QuakeWake: A Novel AI-Based Early Earthquake Warning and
Post-Quake Building Safety Guidance System
Dhroov V Bharatia
a
ACM Student Member, U.S.A.
Keywords:
Earthquake, Earthquake Early Warning, Supervised Learning, Autonomous Learning, P-Wave, S-Wave,
Building Damage, Dynamic Time Warping, User Collaboration.
Abstract:
Millions of people around the world suffer from earthquakes every year. This research introduces an inno-
vative, mobile device-based approach for real-time earthquake detection and prediction. By discerning quake
patterns from users’ regular usage patterns, a novel approach that prevents excessively draining battery uses an
on-device neural network only when needed to detect earthquake tremors. Cloud servers running an AI module
reliably predict the quake intensity and propagation pattern using signals from many users, enabling warning
others who have yet to experience these tremors. It also detects buildings at high risk to reinhabit due to high
relative floor displacement exceeding the building safety standards. A low-cost, affordable, and highly reliable
optional adjunct device on the user’s premise captures tremors with higher accuracy than mobile devices. This
enables effective building-wide earthquake warnings and eliminates fatalities due to post-earthquake build-
ing structural integrity issues. With a neural network trained with many past earthquake patterns, the mobile
devices reliably detected quakes and the AI module accurately detected its propagation with 99% accuracy,
warning users along its path. Moreover, the adjunct device adequately captured shifts in the building’s struc-
ture and reliably flagged the building as uninhabitable with more than 95% accuracy.
1 INTRODUCTION
Earthquakes are very dangerous as they cause tremen-
dous damage and often there is not enough warning.
Earthquake Early Warning (EEW) systems attempt to
warn people to evacuate during an earthquake. How-
ever, earthquakes can strike at any time and at any
place and it is not always possible to accurately pre-
dict or detect earthquakes. Today’s earthquake detec-
tion methods using seismometers are too expensive,
too few, and not always reliable and the current meth-
ods have proven to be inadequate as apparent from the
many casualties every year. A system that can imme-
diately and reliably warn a large number of people to
evacuate during an earthquake can save lives.
Typical earthquakes emit two very common types
of waves: Primary (P)-Waves and Secondary (S)-
Waves. P-waves travel fast but are not very harmful
whereas S-waves travel about half the speed, but are
very harmful. Many EEW systems use sensors that
detect the P-Waves and warn people before the harm-
ful earthquake surface waves arrive. However, there
a
https://orcid.org/0009-0003-1502-8081
are too few detection systems to immediately and reli-
ably detect these P-Waves and warn a very large num-
ber of users in harm’s way.
The purpose of this research is to create an intelli-
gent earthquake system to reliably warn people before
an earthquake arrives and if their building is unsafe af-
ter the earthquake. A novel collaborative earthquake
early warning system is presented using the ubiqui-
tous mobile smartphones. This helps overcome the
two big issues faced by conventional EEW systems -
the number of sensors providing coverage over popu-
lous areas and reliable means to notify affected users
when an earthquake is detected. The accelerometer in
a mobile device monitors the user’s phone movements
and a pre-trained neural network on the device helps
determine if such movements may be due to an earth-
quake. Collaborating such detection across a large
number of users in the vicinity adds accuracy and re-
liability to such detection. Additionally, by predicting
the earthquake’s path of progression, users in the path
of the earthquake can also be warned even if they have
not yet experienced any tremors. The ground shift and
intensity recorded by each device further help in es-
timating if their building is safe to inhibit and hence
Bharatia, D. V.
QuakeWake: A Novel AI-Based Early Earthquake Warning and Post-Quake Building Safety Guidance System.
DOI: 10.5220/0013123200003890
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 17th International Conference on Agents and Artificial Intelligence (ICAART 2025) - Volume 3, pages 303-310
ISBN: 978-989-758-737-5; ISSN: 2184-433X
Proceedings Copyright © 2025 by SCITEPRESS Science and Technology Publications, Lda.
303
provides additional valuable safety guidance during
and after an earthquake. Additionally, low-cost ex-
ternal accelerometer sensors mounted on the building
structure can further ensure in providing such reliable
building safety guidance.
1.1 Related Work
In 1868, the earliest front-detection EEW system
(Cooper, 1868) was for the Hayward fault near San
Francisco where telegraph cables signaled ground
shaking to ring the city bell. (Aranda et al., 1995)
more recently used front-detection to give 60s warn-
ing for Mexico City 320km away. But awaiting strong
ground shaking loses valuable time and directional
propagation prevents warnings for large areas around
the epicenter leading to P-Waves based detection.
Reliably detecting P-Waves and using its ampli-
tude to judge quake intensity poses big challenges due
to limited detection time constraints as apparent in
(Allen and Kanamori, 2003), (Allen et al., 2009) and
(Wu and Kanamori, 2008). Most of EEW work still
focuses on seismometers or a network of seismome-
ters leading to two general categories of modern EEW
systems: 1) regional and 2) on-site EEW.
Regional EEWs use a few seconds of initial
ground motion data to provide intensity measure es-
timates over a region using pre-calibrated ground-
motion models. As in (Bhardwaj et al., 2016), (Mu
and Yuen, 2016), and (M
¨
unchmeyer et al., 2021) they
face significant issues due to epistemic and aleatory
uncertainties in modeling and epicenter proximity
constraints. As in (Caruso et al., 2017), (M
¨
unchmeyer
et al., 2021) and (Colombelli and Zollo, 2015) on-site
EEWs focus on standalone single sensor estimating
intensity and surface waves based on early P-Waves.
They are limited to a locality and fail to help address
structures in the area.
Building damage due to earthquakes involves a
qualified inspector and since most buildings lack floor
shift detection it prevents automated warnings. Re-
cent machine learning techniques can detect certain
cracks in structure such as in (Chen et al., 2024) but
hidden building damage remains an unresolved issue.
(Reilly et al., 2013) used mobile device ac-
celerometers to detect ground motion and transfer the
accelerometer samples to a server for ground motion
analysis. However, such continuous sever-based anal-
ysis is not pragmatic on a large scale. Instead, by
having a very large number of user phones, acting
as earthquake monitoring sensors, this paper demon-
strates how to achieve very high reliability, accuracy,
and coverage for earthquake detection without the
aforesaid limitations of conventional EEW systems.
PiCtrl Server
Raspberry Pi Zero W
MPU6050
Accelerometer
I2C
Audio
Warning
WiFi
Android Device
QuakeWake Room
Database
QuakeWake
Service
Operation Manager
QuakeWake
Activities
Notifier
PiManager
Normal Operation
Calibration
Provisioning
Accelerometer
Quakewake
Cloud
Internet
Figure 1: QuakeWake Overview.
2 PROPOSED APPROACH
QuakeWake leverages the pervasiveness of mobile
phones equipped with an accelerometer to detect and
collaborate earthquake tremors along with their loca-
tion as shown in Figure 1. It reliably projects the path,
intensity estimate, and time of the earthquake’s arrival
even for numerous users not yet in the earthquake’s
vicinity. Additionally, using the relative floor-shift
data of a user’s building gathered during the earth-
quake, it warns if the building is safe to reinhabit.
A mobile device is typically equipped with
a micro-electro-mechanical system (MEMS) ac-
celerometer that measures the acceleration in move-
ment along the X, Y, and Z axis allowing analysis of
the device’s movement. Unlike other user activity-
related movements, earthquake tremors caused by
fast-moving P-waves produce a distinct pattern of this
movement. A pre-trained convolution neural network
(CNN) as in Figure 3 reliably detects this movement
and warns users of the earthquake. The speed dif-
ference between these early detected P-waves and
slow-moving harmful surface waves like S-waves en-
abled early warning. By extrapolating the location of
detected tremors from many users, QuakeWake also
warns users not yet in the vicinity, giving ample time
to evacuate.
A building structure that experiences a large shift
is prone to severe structural damage that could be
hidden from view and extremely unsafe to inhabit.
QuakeWake detects such shifts during the earthquake
and based on collaborated data from similar buildings
in the neighborhood, it uses a cloud-based neural net-
work to predict building safety to warn users. An
optional external accelerometer device powered by a
low-cost Raspberry Pi Zero W can be mounted on the
user’s premise to further improve this building safety
guidance. It improves reliability by providing better
relative displacement detection and its low cost makes
it a pragmatic user safety feature for all buildings.
ICAART 2025 - 17th International Conference on Agents and Artificial Intelligence
304
2000 4000 6000 8000 10000
Distance from focus (km)
P-Wave
S-Wave
5
10
15
20
25
Travel Time
(minutes)
P to S
Time Interval
Figure 2: Wave Lag.
Input: 1000 timesteps, 3 features.
Conv1D: filters 128, kernel-size: 3,
ReLU
Conv1D: filters 128, kernel-size: 3,
Dropout(0.5)
MaxPooling1D: pool_size: 2
Flatten
Dense: 256, activation: ReLU
Dense: 5, activation: softmax
Loss: category_crossentropy, optimizer=adam,
metrics=accuracy
ReLU
X
Y
Z
Conv1D
Conv1D
Dense
None
P
S
R
L
1-D
Figure 3: Detect-CNN.
2.1 Earthquake Waves
When an earthquake occurs, the shockwaves of re-
leased energy take the form of seismic waves. Seismic
waves are categorized as primary waves (P-Wave),
secondary waves (S-Wave), and additional surface
waves (L-Wave/R-Wave).
Primary waves (P-Waves) are the least destructive
type of seismic wave and have the fastest velocity.
They are longitudinal waves that travel fastest at 6
km/s, pass through all matter, and cause objects to
shift back and forth. P-Waves being the fastest ar-
rive early and are used to detect earthquakes before
the more destructive waves hit. As shown in figure
2, the distance of the user from the epicenter deter-
mines the fore-warning duration based on how early
P-Waves arrive before other waves.
Secondary waves (S-Waves) are the more destruc-
tive large amplitude waves generated by tectonic plate
movements. Other major destructive wave types in-
clude Love (L-Waves) and Rayleigh (R-Waves).
2.2 Detecting Earthquake
Earthquake causes prolonged shaking of the earth’s
surface proportional to the quake’s intensity and this
causes a phone resting on a surface to move with it.
The acceleration of this movement is monitored by
the phone’s accelerometer and by analyzing the shake
pattern, an earthquake is detected. Earthquakes can
occur at any time, and there are many wave patterns
depending on the type of waves and the user’s relative
position to the quake epicenter. Therefore, the Quake-
Wake app is provisioned to continuously monitor for
tremors. Additionally, to rule out other shaking mo-
tions such as user movements, notifications with hap-
tic vibrations, and other causes of seismic waves, it is
essential to reliably detect an earthquake pattern. Di-
rect point-wise comparison of waveforms fails to reli-
ably discern shake patterns, especially for low quake
intensity P-Waves. Therefore, a 1-dimensional (1-D)
CNN is used to accurately detect the earthquake shake
patterns.
The accelerometer motion data is sampled with a
sliding window for motion along the X, Y, and Z axis.
Overlapping 10s waves are sampled at 100Hz provid-
ing 1000 samples, representing a feature per channel
which is fed as input to the CNN and the output pre-
dicts if a quake is detected. This detection CNN was
trained using publicly available earthquake datasets
such as STEAD (Mousavi et al., 2019). If an optional
external accelerometer device is present, QuakeWake
app also validates its results with it.
2.3 Activity Matching with Dynamic
Time Warping
Frequent predictions using detection CNN are re-
source intensive and heavily drain the phone battery.
To conserve battery, it is necessary to attempt such
prediction only when there is something unusual as
there is no earthquake most of the time.
Users tend to repeat a finite set A of common daily
activities. A time-series t
x
of an activity typically does
not exactly match the time-series t
y
for a known activ-
ity y A but they do loosely match barring some tem-
poral variations. So a simple point-wise Euclidean
distance cannot correlate t
x
and t
y
. As shown in Fig-
ure 4, an optimal alignment between t
x
and t
y
needs
non-linear “warping” (shown as green dotted lines be-
tween them) by stretching or shrinking along the time
axis. A Dynamic Time Warping (DTW) algorithm
non-linearly warp matches similar activities even if
their time-series are out of phase along the time axis.
As shown in (Salvador and Chan, 2007), DTW (X ,Y )
provides distances between the i
th
point in time-series
t
x
for waveform X to j
th
point in time-series t
y
for
waveform Y aligning along optimal path P as:
DTW (X ,Y ) =
r
(i, j)P
(X
i
Y
j
)
2
(1)
DTW operates in linear time and space and can
quickly correlate a current activity to an everyday
known activity. Use of resource-intensive CNN can
be restricted to only most likely unusual earthquake
samples, significantly reducing the battery drain.
A time-series sample s comprises a tuple
(s
xi
,s
yi
,s
zi
) with 0 i w
N
, and w
N
represents to-
tal intervals in ss capture window. s
xi
,s
yi
,s
zi
is the
acceleration along X,Y , Z axis for i
th
interval with
QuakeWake: A Novel AI-Based Early Earthquake Warning and Post-Quake Building Safety Guidance System
305
X
Y
Figure 4: Dynamic Time Warping.
positive values when phone moves to right sideways:
X axis, away from user: Y axis, vertically up: Z
axis. At a 100Hz sampling rate, s of duration t has
w
N
= t × 100 intervals. Early detection time-series
spans m sec and earthquakes confirming time-series
spans nsec,m < n. As per Figure 2, forewarning
needs at least m 2sec and n 10sec.
The system manages time-series activity samples
saved in three sets. An Earthquake Set E has m sec
samples of potential earthquake patterns e E. The
Activity Set A for activity a A, each with first m sec
samples of a known user activity. The Probable-
activity Set P has msec samples of activity p P to be
potential user activity known not to be an earthquake.
A current sample is searched in a set using a novel
DTW exact indexing technique based on (Keogh and
Ratanamahatana, 2005). A query sample Q comprises
a partial incoming time-series which is extended fur-
ther only for high likelihood of a match. Consider
each existing set sample C is n units long and N is the
dimensionality of index space 1 N n. U and L
are upper and lower warping path envelopes around
query Q with
ˆ
U
i
and
ˆ
L
i
being piecewise constant ap-
proximations of U and L for time-series represented
as c
i
,1 i N. Lower bound piecewise aggregate
approximation LB PAA(Q,C) approximates the lower
bound distance of query Q from sample C in an exist-
ing set as:
v
u
u
u
t
N
i=1
n
N
(c
i
ˆ
U
i
)
2
if c
i
> U
i
(c
i
ˆ
L
i
)
2
if c
i
> L
i
0 otherwise
(2)
LB PAA(Q,C) T
LB
The MINDIST (Q, R) is the lower bounding mea-
sure between query Q and a minimum bounding rect-
angle (MBR) R that represents the smallest rectangle
to spatially contain piecewise aggregate approxima-
tion points C
i
under a node of a hierarchical MBR-
based indexing structure, with MINDIST(Q, R) as:
v
u
u
u
t
N
i=1
n
N
(l
i
ˆ
U
i
)
2
if l
i
> U
i
(h
i
ˆ
L
i
)
2
if h
i
> L
i
0 otherwise
(3)
MINDIST (Q, R) T
MD
When LB PAA(Q,C) exceeds T
LB
there is no like-
lihood of match but when it is less, it is possible
foreach user awaiting earthquake detection do
s awaitMovement(): Monitor time-series s captured
with < m sec window around every m/8 sec until 2
consecutive samples s for each interval 0 i w
N
have
{
(s
xi
,s
yi
,s
zi
) | |s
xi
| > T
x
,|s
yi
| > T
y
or |s
zi
| > T
z
}
, where
T
x
,T
y
,T
z
are minimum move thresholds.;
if s W // Known waking activity then
awaitCalm(): Wait for
{
(s
xi
,s
yi
,s
zi
) | |s
xi
| < T
x
,|s
yi
| < T
y
,|s
zi
| < T
z
}
for
each sample interval 0 i w
N
;
continue;
end
if s E or detectCNN(s) := possible earthquake // Known
tremor or suspected tremor detected then
earthquakePossibleWarning();
con f irmCNN(): Capture more samples and form n sec
time-series p, with each s as m sec of detectCNN(s);
con f irm detectCNN(p);
if con f irm = earthquake then
earthquakeCon f irmedWarning();
inQuakeMonitorAndReport();
end
clearEarthquake();
continue;
end
if s P // Learn more waking activities then
Increment counter associated with s in P;
if counter(s P) > T
p
, where T
p
is activity inclusion
threshold then
Move s from P to A;
end
end
else
P P {s};
end
end
Algorithm 1: Earthquake Detection Algorithm.
that Q may match C and therefore additional sam-
ple intervals are retrieved if Q does yet have sufficient
sample intervals as C. This technique is also appli-
cable while computing MINDIST (Q,R). It enables
handling samples with time-axis warping with one or
more time-series portions expanded beyond that of the
target time-series. This technique allows to start ag-
gressively indexing samples even when the full win-
dow of the query sample is not yet complete and once
it is known to be highly probable for matching, it can
be expanded to the full query time-series with mini-
mal cost. It avoids awaiting query to be fully available
saving valuable earthquake detection time.
Algorithm 1, detect earthquakes with very few
computations. awaitMovement() helps avoid com-
putation when the phone lies dormant as on a ta-
ble. When a known user activity disrupts this dor-
mant state, all samples during this activity are ig-
nored until the phone is dormant, eliminating pro-
cessing when the user is using the phone. In the dor-
mant state, only if a known potential earthquake pat-
ICAART 2025 - 17th International Conference on Agents and Artificial Intelligence
306
4. notifyQuake
(eta, intensity)
4. notifyQuake
(eta, intensity)
Quakewake
Cloud
3. Analyze
propagation
1. Wave Detected
2. quakeAt
(gps, intensity)
2
3
4
4
2. quakeAt
(gps, intensity)
1
2
Figure 5: Collaboration Protocol.
90 secs
190 secs
Extrapolations
Reported
140 secs
Epicenter
Line of Best Fit
Figure 6: Predict Path.
tern or detectCNN() detects a possible earthquake,
earthquake processing is launched. As it learns more
non-earthquake activities that wake it from a dormant
state, A expands, and it spends most of the time in
awaitMovement() and awaitCalm() - both requiring
very little computation, thereby conserving battery
power. Moreover, earthquake warnings can be issued
as early as m = 2 seconds which is a great improve-
ment over today’s EEW systems.
2.4 Collaborating Early Warning
A QuakeWake mobile application immediately warns
its user when it detects earthquake tremors. Addition-
ally, as shown in Figure 5, it also reports the detected
earthquake intensity and its GPS location to Quake-
Wake cloud servers. QuakeWake cloud then creates
an earthquake activity map and as shown in Figure
6, extrapolates the earthquake intensity, direction of
propagation, and estimated time of arrival (ETA) to
wider areas around the epicenter and notifies users in
these affected areas giving them an additional 90 to
190 seconds of advance notification, potentially sav-
ing their lives. Reports from many users in highly
populated urban areas significantly increase predic-
tion accuracy for the path and ETA.
Quakewake
Cloud
2. Analysis
1. isSafe(gps, localIntensity)
3. safetyRecommend
(gps, expected-intensity, isSafe)
1
2
3
Figure 7: Building Safety.
2.5 Building Safety
Building safety standards and organizations such as
the United States Geological Survey (USGS, 2024)
specify a safe limit for floor movement relative to the
structure below. Due to their high cost, most buildings
are not equipped with the instrumentation that mea-
sures such a shift during an earthquake. The hidden
structural damage due to such shift is extremely dan-
gerous leaving the building residents vulnerable dur-
ing and after major earthquakes.
Although no two buildings suffer the same dam-
age, similar buildings in a neighborhood tend to ex-
perience similar floor shift patterns and tend to suf-
fer similar earthquake damage. Therefore, a building-
safety neural network is used to predict the quake in-
tensity and shifts using regression as shown in Figure
8 and warn users of unsafe buildings. It can guide
users even if they could not record the precise earth-
quake shift for their building. This neural network
is pre-trained using historical datasets for earthquake
damage and safety information, and continuously re-
fined with current quake data using an adjunct net-
work model. Building structures respond differently
to different types of earthquake waves. Even for the
same wave type, response changes based on whether
the building was exposed to a rising or falling edge
of the surface wave. Different buildings on the same
path can be exposed to different cycles of the destruc-
tive S, R, or L waves. Therefore, the building-safety
neural network must be retrained with actual reports
from the affected buildings in the current earthquake
to discern these variations of destruction patterns in
the area. When a large number of users are concen-
trated in a small area, adequate training makes predic-
tion reliable. Sparsely populated areas may need ad-
ditional information such as ground shaking intensity
ShakeMap published by the U.S. Geological Survey.
QuakeWake also provides a means to use additional
building information such as from OpenStreetMap
(OSM) project (OpenStreetMap, 2024) based on the
user’s location and predict building safety as corre-
lated with other similar buildings in the neighbor-
hood.
The QuakeWake app records the building move-
ments during an earthquake. When a user requests a
building safety check, as shown in Figure 7 the app
sends a request to the QuakeWake cloud server with
the building type, building’s GPS location, recorded
intensity, and maximum local shifts recorded during
the quake. QuakeWake server uses a building-safety
neural network to predict the expected quake intensity
and whether it is safe.
QuakeWake: A Novel AI-Based Early Earthquake Warning and Post-Quake Building Safety Guidance System
307
Figure 8: Building Safety Regression.
3 RESULTS AND DISCUSSION
3.1 Experimental Setup
A set of randomized time-series samples representing
different activities and events was prepared and then
used to test different aspects of QuakeWake as dis-
cussed below.
Earthquake Samples. Time-series data from the
STEAD dataset as in (Mousavi et al., 2019) was cap-
tured along the three orthogonal seismograph com-
ponent axes. 5 sets of local earthquake samples
in randomized groups of 100,000 samples were ex-
tracted from the available earthquake samples world-
wide within 350km of the earthquakes. Each earth-
quake sample window contained both P and S waves
and began from 5 to 10 seconds prior to the P arrival
and ended at least 5 seconds after the S arrival. The
samples were conditioned by removing the mean and
resampled at 100 Hz. Similarly, a randomized group
of 100,000 non-earthquake seismic noise sample data
was also used from this dataset to represent seismic
conditions when there is no earthquake. Addition-
ally, the building damage dataset from the Gorkha
Earthquake of Nepal as in (M
¨
obius, 2015) was used
to build 10 sets of building safety samples in random-
ized groups of 50,000 samples.
User Activity Samples. The Bogazici Univer-
sity smartphone accelerometer sensor dataset as in
(Davarcı and Anarım, 2022) was used in conjunction
with other real-time data collection by the researcher
for user movements during different activities. A cus-
tom app gathered time-series samples for different age
groups and genders by sampling accelerometer data
at 100Hz. 25 randomized groups of 10,000 samples
were created for typical everyday activities.
Motion Test-Bed. A set of modern Android phone
devices was used to test various aspects of Quake-
Wake. For accurate and repeatable test movements,
custom directional stepper motors from a 3D-printer
were repurposed to move a platform as per time-series
input data. The test setup was calibrated to produce
test device accelerometer data that matches the input
time-series sample to produce the platform motion.
Battery Drain. QuakeWake was tested with vary-
ing duty cycles of any-activity, each cycle compris-
ing a period of calm followed by a period of activ-
ity. The period of activity comprises a specific duty
cycle of earthquake activity, wherein a random mix
of earthquake and user activities are performed so as
to achieve the required earthquake duty cycle. Tests
were repeated with different any-activity duty cycles,
each repeated with different earthquake duty cycles
and intensities. The battery drain was recorded af-
ter an extended test duration depending on the any-
activity duty cycle.
Earthquake Detection. Earthquake detection was
tested by placing a test phone onto the motion test-
bed described above and driven by a test time-series
sample. Accuracy was determined based on whether
QuakeWake correctly detected earthquake samples
and did not detect other samples as earthquakes. Mul-
tiple trials were conducted with test samples for dif-
ferent earthquake shift distances, different earthquake
powers resulting in different peak acceleration magni-
tudes, different contact surfaces of the table, different
materials of the phone cover, and different earthquake
wave types. Tests were repeated continuously with
more than 98% user activity samples and the remain-
der as earthquake samples for a long time to ensure
that Dynamic Time Warping mostly eliminated the
resource-intensive detection CNN computations and
conserved battery power.
Training Building Safety Neural Network. The
building safety neural network was trained exten-
sively using samples from the Gorkha Earthquake
dataset. Testing for impact on building safety predic-
tion by retraining with reports from the current quake
was tested by retraining the preexisting trained model
with an additional set of 50,000 test samples such that
the test samples are localized in different high-density
reporting areas with at least one region each of 100,
50, 20, and 10 reports per square kilometer.
3.2 Comparisons and Analysis
As shown in Figures 9, 10, 11, and 12, QuakeWake
reliably detected an earthquake with very high accu-
racy for typical operating conditions. As shown in
Figures 9 and 10, with a phone on a very smooth con-
tact surface, it detected typical mild quakes with shifts
exceeding 40mm and peak acceleration of 10m/s
2
.
Figure 11 shows that for typical contact surfaces
ICAART 2025 - 17th International Conference on Agents and Artificial Intelligence
308
Table 1: QuakeWake Test Summary.
Purpose Values
Detect varying shifts Mean:98.51% σ:0.96%
Detect varying power Mean:96.37% σ:2.96%
Detect surfaces Mean:89.01% σ:10.19%
Detect wave-types Mean:93.26% σ:5.89%
Collab. forewarning 78-187s Mean:150s
Bldg. safety accuracy Mean:90.43%, σ:2.09%
Bldg. retrain accuracy Mean:97.12% σ:1.26%
40
50
60
70
80
90
100
20 40 60 80 100 120 140
Accuracy (%)
Shift Distance (mm)
X-Accuracy
Y-Accuracy
Z-Accuracy
Figure 9: Detect varying shift.
of wooden furniture or with TPU, rubber, or sili-
cone covers, accuracy increased drastically resulting
in flawless earthquake detections even for very mild
earthquakes. The typical contact surface does not re-
sult in excessive slippage and hence the ground mo-
tion during an earthquake tremor reaches the phone’s
accelerometer verbatim leading to a very high earth-
quake detection accuracy.
As evident from Figure 12, the earthquake detec-
tion accuracy is almost perfect for both the primary
P-waves and secondary S-waves but goes down by
around 15% for only the R-waves and by 8% when
only L-waves are used. As R-waves and L-waves are
not as common as the P-waves and S-waves, the neu-
ral network lacked training for L and R waves. This
is less of a concern as R and L-waves rarely exist on
their own and are always preceded by the P-waves.
Figure 13, shows results for any-activity duty cy-
cle of 50% revealing that the battery drain percent-
30
40
50
60
70
80
90
100
1
2
3
4
5
10 20 30 40 50
Accuracy (%)
Acceleration (m/s
2
)
X-Accuracy
Y-Accuracy
Z-Accuracy
Figure 10: Detect varying power.
30
40
50
60
70
80
90
100
WoodTPU WoodBare TileTPU TileBare
Accuracy (%)
Surface
X-Accuracy
Y-Accuracy
Z-Accuracy
Figure 11: Detect varying contact surfaces.
30
40
50
60
70
80
90
100
P-Wave
S-Wave
R-Wave L-Wave
Accuracy (%)
Earthquake Wave-Type
X-Accuracy
Y-Accuracy
Z-Accuracy
Figure 12: Detect varying wave-type.
age is mostly proportional to the duty cycle of the
earthquakes, confirming that DTW-based activity de-
tection and use of CNN only for earthquake samples
works well. Severe earthquakes have less ambiguous
patterns leading to lower battery drain. Battery drain
for moderate earthquakes was not significantly worse
especially when the duty cycle was low. Typically
earthquake duty cycles are low and QuakeWake pro-
vides excellent performance with a very low battery
drain allowing users to constantly use QuakeWake.
The baseline building safety neural network pre-
dicts with over 90% accuracy. As evident from Fig-
ure 14, when the earthquake passes through a densely
populated area, the safety accuracy prediction is near
perfect at 100 records/sq. km. and around 98% at 50
records/sq. km. As portrayed in Figure 8, more re-
training samples from small populated areas lead to
0
10
20
30
40
50
60
5
10
15
20 25 30 35
Battery Drain(%)
Earthquake Duty Cycle
Severe
Moderate
Figure 13: Battery Drain.
QuakeWake: A Novel AI-Based Early Earthquake Warning and Post-Quake Building Safety Guidance System
309
86
88
90
92
94
96
98
100
1
10 20 50 100
Safety Accuracy
Reports (per sq. km)
Figure 14: Building safety on retraining.
better regression and these retraining samples capture
the unique destruction pattern of the current earth-
quake leading to highly precise predictions.
4 CONCLUSIONS
QuakeWake reliably detects quake vibrations using
the accelerometer in phone devices and immediately
warns its users when it detects earthquake tremors or
if a user is in the path of an earthquake. Without
an elaborate infrastructure of costly seismographs, it
arms everyday users’ smartphones to detect an earth-
quake and forewarn users in harm’s way. It performs
well with typical non-slipping phone covers and on
wooden furniture. By using a novel Dynamic Time
Warping algorithm, it discerns everyday activity mo-
tions and uses the resource-intensive CNN detection
only when an earthquake is suspected, thereby con-
serving battery power. QuakeWake records the maxi-
mum shift experienced during an earthquake and uses
this information to enable building safety warnings.
By continuously retraining a building safety neural
network, it learns to predict this safety based on pat-
terns of the current earthquake. With its low-cost and
simple but robust design, QuakeWake can help save
numerous lives across the globe. In the future, Quake-
Wake can be integrated with other warning systems to
greatly enhance its efficacy.
REFERENCES
Allen, R. M., Brown, H., Hellweg, M., Khainovski, O.,
Lombard, P., and Neuhauser, D. (2009). Real-time
earthquake detection and hazard assessment by elarms
across california. Geophysical research letters, 36(5).
Allen, R. M. and Kanamori, H. (2003). The potential for
earthquake early warning in southern california. Sci-
ence, 300(5620):786–789.
Aranda, J. E., Jimenez, A., Ibarrola, G., Alcantar, F.,
Aguilar, A., Inostroza, M., and Maldonado, S. (1995).
Mexico city seismic alert system. Seismological Re-
search Letters, 66(6):42–53.
Bhardwaj, R., Sharma, M. L., and Kumar, A. (2016). Multi-
parameter algorithm for earthquake early warning.
Geomatics, Natural Hazards and Risk, 7(4):1242–
1264.
Caruso, A., Colombelli, S., Elia, L., Picozzi, M., and Zollo,
A. (2017). An on-site alert level early warning sys-
tem for italy. Journal of Geophysical Research: Solid
Earth, 122(3):2106–2118.
Chen, W., Hou, J., Wang, Y., and Yu, M. (2024). Visu-
alization analysis of concrete crack detection in civil
engineering infrastructure based on knowledge graph.
Case Studies in Construction Materials, page e03711.
Colombelli, S. and Zollo, A. (2015). Fast determination
of earthquake magnitude and fault extent from real-
time p-wave recordings. Geophysical Journal Inter-
national, 202(2):1158–1163.
Cooper, J. (1868). Earthquake indicator. San Francisco
Bulletin, 3.
Davarcı, E. and Anarım, E. (2022). Bogazici university
smartphone accelerometer sensor dataset. Data in
brief, 40:107833.
Keogh, E. and Ratanamahatana, C. A. (2005). Exact index-
ing of dynamic time warping. Knowledge and infor-
mation systems, 7(3):358–386.
Mousavi, S. M., Sheng, Y., Zhu, W., and Beroza, G. C.
(2019). Stanford earthquake dataset (stead): A global
data set of seismic signals for ai. IEEE Access,
7:179464–179476.
Mu, H.-Q. and Yuen, K.-V. (2016). Ground motion predic-
tion equation development by heterogeneous bayesian
learning. Computer-Aided Civil and Infrastructure
Engineering, 31(10):761–776.
M
¨
unchmeyer, J., Bindi, D., Leser, U., and Tilmann, F.
(2021). The transformer earthquake alerting model:
A new versatile approach to earthquake early warning.
Geophysical Journal International, 225(1):646–656.
M
¨
obius (2015). Earthquake magnitude, dam-
age and impact: Gorkha earthquake 2015.
https://www.kaggle.com/datasets/arashnic/
earthquake-magnitude-damage-and-impact.
OpenStreetMap (2024). Openstreetmap project. https:
//www.openstreetmap.org.
Reilly, J., Dashti, S., Ervasti, M., Bray, J. D., Glaser, S. D.,
and Bayen, A. M. (2013). Mobile phones as seis-
mologic sensors: Automating data extraction for the
ishake system. IEEE Transactions on Automation Sci-
ence and Engineering, 10(2):242–251.
Salvador, S. and Chan, P. (2007). Toward accurate dynamic
time warping in linear time and space. Intelligent Data
Analysis, 11(5):561–580.
USGS (2024). United states geological survey scientific re-
search results. https://www.usgs.gov/products.
Wu, Y.-M. and Kanamori, H. (2008). Development of
an earthquake early warning system using real-time
strong motion signals. Sensors, 8(1):1–9.
ICAART 2025 - 17th International Conference on Agents and Artificial Intelligence
310