Abstract
Earthquake P-wave detection is the first and most critical step in Earthquake Early Warning (EEW), as detection speed determines how much time is available before strong shaking arrives, while detection accuracy governs the reliability of the warning. Conventional P-Wave detection methods such as Short-Term Average over Long-Term Average (STA/LTA) often struggle in complex noise environments and exhibit higher detection latency. Deep learning offers a more robust alternative by learning complex waveform characteristics directly from data, enabling faster and more reliable detections. However, the high computational cost of deep models limits their use on low-cost, resource-constrained edge devices in decentralized EEW networks. Here we present a lightweight Convolutional Neural Network optimized for real-time P- and S-wave detection on edge hardware using only two seconds of seismic input waveforms. Trained on approximately 89 K waveform segments recorded by strong-motion sensors across New Zealand, the model achieves an overall accuracy of 97.12% and correctly identifies 98% of P-wave segments. With ~ 38 K trainable parameters and sub-7-millisecond inference time on Raspberry Pi 5 hardware, the model demonstrates efficient operation under edge-computing constraints. Its ability to generalize to high-magnitude events highlights its strong potential for integration into distributed EEW systems.
Supplementary Information
The online version contains supplementary material available at 10.1038/s41598-026-42568-y.
Subject terms: Engineering, Mathematics and computing, Natural hazards, Solid Earth sciences
Introduction
Earthquakes remain one of the most devastating natural disasters, with the potential to cause significant loss of life, economic damage, and disruption to critical infrastructure1. Their unpredictability and sudden onset make mitigation a formidable challenge, particularly in seismically active regions such as New Zealand2. Earthquake Early Warning (EEW) systems have emerged as a promising solution, providing precious seconds of advance notice before damaging seismic waves arrive3,4. These warnings enable individuals to take protective actions such as “drop, cover, and hold” or stopping hazardous activities like driving or surgery, while also allowing automated systems to initiate safety protocols, including slowing trains and shutting down gas lines1,5.
The effectiveness of an EEW system depends on its ability to detect earthquakes as early as possible, ideally within the first few seconds of earthquake rupture5. When an earthquake occurs, it generates different types of seismic waves. Primary (P) waves are the fastest and least damaging, arriving before the stronger and slower Secondary (S) waves and surface waves3. This short interval between the arrival of P- and S- waves creates a critical window of opportunity for issuing alerts even with a single station4. In the 2018 Northern Osaka earthquake (M6.1), traditional EEW systems took three to eight seconds to issue emergency alarms after the initial P-wave arrival, resulting in some areas near the epicenter receiving the alert only after severe ground shaking had begun6. Integrating an efficient P-wave detection method could have allowed an alert to be issued earlier, before peak ground shaking occurred, demonstrating the life-saving potential of faster P-wave detection6,7.
Over the years, a wide range of methods have been developed to detect P-waves at the earliest possible moment, a cornerstone requirement for effective EEW systems. Early approaches relied on classical signal processing techniques such as short-term average over long-term average (STA/LTA)8, autoregressive models with Akaike Information Criterion (AR-AIC)9, and waveform cross-correlation using template matching10. Among these, the STA/LTA method remains a commonly used approach due to its simplicity and low computational cost11,12. However, it often struggles to distinguish earthquake signals from complex or non-stationary noise, particularly in low signal-to-noise (SNR) environments13. Its performance is sensitive to parameter tuning (e.g., window lengths and threshold) and can vary across stations, leading to false or delayed detections14,15. These limitations have prompted exploration of more adaptive and data-driven approaches for more reliable P-wave detection.
Machine learning (ML) approaches began to address these limitations by automating feature extraction using classifiers such as logistic regression, support vector machines (SVM), and random forests16,17. However, these models still relied heavily on pre-processed features such as amplitude ratios, frequency content, or energy of the signal18. Deep learning models have since advanced the field by learning features directly from raw seismic waveforms. For example, Convolutional Neural Networks (CNNs), as used in models like PhaseNet19, have shown strong performance in distinguishing between seismic phases. Recurrent Neural Networks (RNNs), particularly those using Long Short-Term Memory (LSTM) units, are well suited for capturing the temporal dynamics of seismic signals6. Hybrid CNN-LSTM architectures, such as those used in CRED20, CREIME21, and P-Detector14, combine spatial and temporal feature extraction and have been widely adopted for this task. In parallel, transformer-based models have shown potential for P-wave detection by leveraging attention mechanisms to capture long-range dependencies in seismic data22,23. Among them, EQTransformer24 has emerged as a state-of-the-art approach for seismic phase detection, while other recent models such as TFEQ25 have begun to explore this architecture in short seismic waveforms.
While deep learning has significantly improved the accuracy of P-wave detection, achieving low-latency performance remains a critical challenge in EEW applications26,27. Centralized EEW systems, which typically require data aggregation from multiple seismic stations which can introduce delays that reduce their effectiveness1,28. These delays can result in so-called “blind zones”, areas near the earthquake epicenter that receive little to no warning due to the proximity of the event6. This is especially concerning for regions like New Zealand, where earthquakes can occur close to urban areas and causes strong ground shaking within seconds29. One promising direction to mitigate such limitations is to bring detection capabilities closer to the source of data by processing seismic signals directly on edge devices such as ground motion sensors6,30. By performing real-time analysis at or near the sensor, edge-based EEW systems can significantly reduce latency, enabling alerts to be issued faster in critical near-field regions31. This approach also provides additional benefits, such as reduced bandwidth requirements, improved scalability, and increased resilience to network disruptions32. Importantly, edge models can also serve as components within hybrid or centralized architectures, enhancing overall system robustness while supporting localized, time-sensitive decisions33,34. However, for edge AI deployment to succeed, models must be both highly accurate and lightweight enough to operate in real time on resource-constrained hardware31.
However, most of the existing deep learning models for earthquake P-wave detection either require long input window, making them too slow for early warning, or are too complex to run efficiently on edge devices25,35. Addressing this limitation requires careful balancing of model complexity and performance. Unlike cloud-based systems that can rely on massive datasets and ample computational power, edge models must be compact, efficient, and robust enough to operate under tight resource constraints36. Crucially, the effectiveness of these models depends not only on architecture design but also on the quality and relevance of the training data37. Generic global datasets may fail to capture the local variability needed for accurate performance, especially in regions with complex seismo-tectonic settings10. For edge AI models to function reliably in the field, they must be trained on small but diverse data that reflect the real seismic characteristics of the regions where they will be deployed38.
In the case of New Zealand, developing a fast and efficient earthquake detection model tailored to local seismic characteristics is especially urgent39,40. Despite being one of the most seismically active countries with a dense seismic monitoring network, New Zealand currently lacks a nationwide EEW system41. High deployment costs, particularly in remote or rural areas, have hindered centralized infrastructure-based solutions40. Recognizing this, the CRISiSLab: a laboratory dedicated to developing technology for disasters, has launched a decentralized, low-cost EEW network using Raspberry Shake sensors as a more scalable alternative41. Yet, the success of such a system depends heavily on the availability of robust, efficient, and regionally optimized detection models.
To address these challenges, we developed a lightweight deep learning model for real-time P-wave detection tailored for edge deployment in New Zealand. While rapid P-wave identification remains the primary objective, the model is also trained to recognize S-wave arrivals to improve phase discrimination and reduce misclassification in real-time operational settings. Our main contributions are as follows:
Develop a model capable of detecting P-waves using the shortest input window reported to date for this task, enabling faster response times.
Train and evaluate the model using region-specific earthquake waveform data from New Zealand, improving its relevance and generalization performance for local EEW applications.
Design the model to be significantly smaller and more efficient than existing deep learning approaches, ensuring compatibility with low-cost edge devices.
Highlight the importance of dataset curation, ensuring the model learns meaningful patterns from a minimal but diverse set of region-specific seismic signals.
Methods
Data preparation
To develop a generalizable and deployable model, we adopted a distinctive data preparation strategy tailored for real-time detection in resource-constrained environments. Although New Zealand is one of the world’s most seismically active countries, deep learning-based earthquake detection using local data for EEW applications has not yet been developed. To address this, we constructed a dataset using records from GeoNet’s earthquake catalog and waveform archive, the primary sources of earthquake metadata and waveform data in New Zealand42,43. The following sections describe the data extraction, preprocessing and labeling process.
The dataset was curated from earthquake waveforms recorded across New Zealand from January 2013 to April 2025. Using data from GeoNet’s strong-motion sensors, we included only events with magnitudes ≥ M 3.0 and selected waveforms based on proximity to the epicenter, within 100 km for most events, and up to 150 km for larger events (magnitude > M 5.0). This selection increased the proportion of waveforms associated with high-magnitude earthquake events, which are essential for reliable EEW applications. We exclusively selected strong-motion data to align with data types available on low-cost sensors (e.g., MEMS sensors). To increase the number of records, we also included strong-motion waveforms where the P-phase arrival times were picked on co-located broadband waveforms. All waveform records associated with the 2016 M 7.8 Kaikōura earthquake were excluded from the dataset, as this event was reserved for an isolated test. For each qualifying record, a 90-second waveform segment, spanning 30 s before and 60 s after the annotated P-wave arrival, was extracted. Waveforms missing any of the three components (vertical, north–south, or east–west) were discarded. In total, ~ 89,000 three-component waveform records passed all filtering and quality checks. These 90-second records served as the parent dataset for subsequent phase labeling and sample generation.
Phase arrival time determination
Accurate P- and S-phase arrival times are critical for constructing reliable training samples. Phase arrivals were automatically determined using two established deep learning pickers, PhaseNet19 and EQTransformer24(original implementations trained on STEAD dataset), applied to three-component strong-motion recordings. To meet the input requirements of these models, the 90-second waveform records were first resampled to 100 Hz. For each model, a single representative arrival per phase was retained by selecting the pick with the highest confidence, subject to predefined probability thresholds (P-phase: PhaseNet > 0.35; S-phase: PhaseNet and EQTransformer > 0.5). P-wave arrivals were identified primarily using PhaseNet: waveforms without a PhaseNet P-pick were discarded, and only picks with a confidence greater than 0.9 were considered. When a GeoNet P-arrival time was available, the PhaseNet pick was accepted only if the absolute time residual between the two was less than 1 s; otherwise, the waveform was omitted to ensure high-quality labeling. S-wave arrivals were determined using a complementary strategy combining both pickers. If either PhaseNet or EQTransformer produced a highly confident S-pick (> 0.8), that arrival was accepted directly. In cases of lower confidence, the theoretical S-arrival time computed using the iasp91 velocity model was used as a reference, and picks from either model with confidence > 0.5 were accepted if they fell within
s of the theoretical arrival. Waveforms for which no eligible S-phase candidate was identified under these criteria were excluded from further analysis. This semi-supervised selection strategy prioritizes labeling accuracy over data volume, ensuring robust ground truth for both P- and S-wave segment extraction.
Training samples generation
To transform the 90-second records into a format suitable for model development, we implemented a windowing and pre-processing workflow. Prior to any segmentation, each 90-second waveform underwent an initial correction to remove the instrument response, standardizing the data across varying sensor types. Following this, a standard pre-processing pipeline was applied to enhance signal quality and emphasize local variations associated with P- and S-wave onsets. This includes: (1) demeaning (removal of the mean from each component individually); (2) linear detrending; and (3) application of a 1–20 Hz bandpass filter to suppress both low-frequency drifts and high-frequency noise. These steps help eliminate constant offsets and linear trends, centering the data around zero and improving the SNR, which enhances the stability of deep learning models during training. The filtering choices are grounded in prior literature and have proven effective in highlighting the impulsive nature of P-wave arrivals in strong-motion records44,45. Figure 1 illustrates the impact of these pre-processing steps on raw waveforms, showing how they suppress unwanted noise and enhance the visibility of P- and S-wave onsets. Finally, waveforms are resampled to 50 Hz to further reduce input size while preserving the relevant frequency contents.
Fig. 1.
Comparison of a noisy, raw and pre-processed three-component waveforms for an earthquake event (2015p364707, THZ station). The top panel shows the raw waveform containing significant background noise, while the bottom panel illustrates the same waveform after pre-processing, clearly revealing the P- and S-wave onsets.
Given the primary objective of this study to enable rapid and reliable P-wave detection for EEW applications, we adopt a 2-second waveform window as the input to our deep learning model. This window length represents the shortest duration successfully used in previous studies for similar tasks, balancing early detection capability with sufficient signal content for accurate classification25,31. Importantly, the shorter input length also results in a reduced data size, enabling faster inference and lower computational requirements, which are critical in this research.
Depending on phase availability, four distinct 2-second segments were extracted for model training and evaluation, three from the pre-processed data (P-wave, S-wave, and a filtered noise segment) and one from the corresponding raw (unfiltered) waveform. To facilitate classification during model training, we labeled P-wave samples as 1, S-wave samples as 2, and noise samples as 0.
P- and S- wave Segments:
These segments are extracted from pre-processed waveform, centered approximately around the annotated arrival time. To avoid overfitting and improve generalization, we introduce random temporal shifts such that phase arrival sample is located at varying positions within the 2-second window21. This augmentation ensures the model learns robust, location-invariant features rather than relying on fixed temporal patterns. For segments that were slightly shorter than 2 s due to incomplete data, we padded the segment with low-variance white Gaussian noise at the beginning to maintain consistent input dimensions.
-
2.
Filtered Noise Sample:
This noise segment is randomly selected from the same pre-processed waveform, ensuring a minimum exclusion zone of
seconds around the P- and S-wave arrival to avoid contamination. This sample enables the model to learn about the characteristics of noise present in filtered seismic data.
-
3.
Unfiltered Noise Sample:
To increase model feasibility on real-time deployment scenarios, a second noise sample is extracted from the unfiltered raw waveform data. With 0.5 probability, additive white Gaussian noise (standard deviation = 0.00001) is applied to all three channels. This sample type introduces realistic variability in background signals, ensuring the model can generalize to unprocessed, real-time input streams.
Filtered wave segments help the model focus on clear, discriminative waveform features by highlighting the characteristic onset of P- and S-wave arrivals and suppressing irrelevant frequencies. In contrast, unfiltered noise samples retain the full complexity of real-world background signals, improving robustness to raw data typically encountered during real-time operations. Including both sample types allows the model to balance feature learning and robustness, enhancing generalization in real-world conditions (see Supplementary Sect. 5 for a quantitative evaluation of filtered and unfiltered waveforms used in model training).
In total, the final dataset comprises 69,452 P-wave segments, 64,068 S-wave segments, and 138,904 noise segments, all three-component waveforms, yielding 272,424 two-second waveform segments. These segments were randomly partitioned into training (70%), validation (15%), and test (15%) sets. An initial attempt to split them chronologically, intended to better simulate real-world deployment, was unsuccessful due to biases observed across different periods (e.g., significant deviations during the COVID-19 lockdown period due to changes in anthropogenic noise). Random splitting was therefore adopted to ensure statistical representativeness across all partitions.
SNR characterization of P-wave segments in the final dataset
To evaluate the reliability and representativeness of the curated dataset, we quantitatively analyzed the Signal-to-Noise Ratio (SNR) of all P-wave segments. This characterization assesses the complexity and variability of the background noise against which the signals are recorded. The results (see Supplementary Sect. 2) show a broad distribution centered near 0 dB, with a mean of 3.28 dB and a standard deviation of 9.92 dB. This indicates that many events have comparable signal and noise energy, creating realistic and challenging conditions for model training. The wide SNR variability ensures that the model must learn to recognize subtle P-wave features rather than relying on simple amplitude changes, enhancing robustness to complex real-world noise. This analysis confirm that the dataset reflects realistic noise conditions, supporting the development of a highly generalizable model.
Architectural selection for edge deployment
Seismic waveform data is inherently sequential, and tasks such as event detection and phase picking require models capable of capturing temporal patterns45. While architectures like RNNs and Transformers have been explored for seismic tasks due to their ability to model sequential data, their high computational cost and memory requirements make them less suitable for real-time deployment on resource-constrained edge devices6,46. RNNs suffer from slow, sequential processing and high memory consumption47, while the self-attention mechanism of Transformers scales quadratically with input length, demanding extensive computational resources and a large number of trainable parameters48–50. This computational inefficiency makes both architectures impractical for systems where low latency and limited resources are paramount.
In contrast, CNNs have become the most widely adopted architecture for seismic signal processing due to their effectiveness in extracting localized temporal features51,52. Early CNN models like ConvNetQuake51 demonstrated that convolutional architectures could outperform traditional methods for earthquake detection. Following that, models such as the Generalized Phase Detection (GPD) achieved high precision in identifying P- and S-wave arrivals using short input windows10. Other notable CNN variants include DynaPicker53, which introduced a 1D Dynamic Convolution approach for flexible short input lengths, and CapsPhase54, which utilized capsule networks to enhance performance under low SNR conditions. The enduring relevance of CNNs is also evident in hybrid models, where many research studies have shown that convolutional layers form the core of the front-end for efficient feature extraction14,20,24.
Despite the proven success of CNNs, current models present several challenges for real-time deployment on edge devices. Many, such as PhaseNet, require long input windows (e.g., 30 s), which increases both latency and computational cost19. Other models, including GPD, DynaPicker, and CapsPhase, rely on dense, complex architectures that are difficult to run on low-power hardware. While recent TinyML-based approaches offer a promising step toward lightweight models for embedded P- and S-wave detection, their accuracy often leaves room for improvement31. A further limitation is that many existing models are trained on massive global datasets to achieve broad generalization, which can be inefficient for region-specific EEW systems that could benefit more from models optimized with limited but diverse local data10.
Based on these architectural and deployment considerations, a custom-designed CNN-based model was selected as the most practical and effective solution for accurate, real-time P-wave detection on edge devices. The weight-sharing mechanism of CNNs significantly reduces both memory usage and computational cost compared to RNNs and Transformers. This inherent efficiency and scalability allow for architectures to be precisely optimized for size and accuracy within the constraints of edge deployments.
Model architecture and design
The design of our CNN model for P-wave detection followed a structured, iterative process aimed at balancing classification accuracy with computational efficiency for edge deployment. While the primary objective is P-wave detection, we framed the task as a three-class classification problem—comprising P-waves, S-waves, and noise—to enhance the model’s reliability for EEW applications. We began with a lightweight baseline architecture inspired by recent TinyML approaches, consisting of two convolutional layers followed by two fully connected output layers31. We then experimented with deeper configurations by adding a third and fourth convolutional layer to explore potential performance gains. However, increasing the depth beyond three layers yielded only marginal improvements in validation accuracy while significantly increasing computational cost. Based on this trade-off, we selected a compact architecture comprising three convolutional layers, each followed by a ReLU activation55, and two dense layers preceding the output layer. The model was trained using the cross-entropy loss function and optimized using the Adam optimizer (learning rate = 0.002)56. Regularization was achieved through dropout57(applied after the second and third convolutional layers) and L2 weight decay (weight decay = 0.0008)58, both of which were tuned via grid search to reduce overfitting. With these improvements, the model reached approximately 130,000 trainable parameters and demonstrated strong performance on both training and validation datasets, especially after fine-tuning hyperparameters, including learning rate, batch size, and kernel sizes.
Previous studies have shown that the performance of CNNs heavily depends on the configuration of the early convolutional layers, particularly the number of filters59. Since this also significantly affects the model’s computational cost, we conducted a focused exploration of filter configurations across all three convolutional layers. To support this, we implemented a flexible training pipeline for end-to-end evaluation of architectures with varying filter counts. To evaluate real-time inference behavior, we conducted online testing, where each candidate model was applied in single-inference mode to simulate real-time operation25. This process involved visually inspecting the model’s output on 100 one-minute waveform windows spanning a range of magnitudes and epicentral distances, aiding in the selection of the best-performing architecture.
To quantify the trade-off between model accuracy and computational complexity, we introduce a Complexity Index (CI) that combines model size and inference cost into a single metric (Eq. 1). Since the number of parameters and floating-point operations (FLOPs)—a standard measures of computational workload—exist on different numerical scales, each quantity is min–max normalized across all model variants before combination. For a given model
, the
is defined as:
![]() |
1 |
where
is the number of trainable parameters and
is the number of FLOPs of model
.
,
,
and
denote the minimum and maximum values of parameters and FLOPs across all evaluated models, respectively. Here, the first term reflects model size and memory footprint60, while the second captures inference-time computational cost61. Using this metric, we trained and evaluated models, with CNN-filter configurations ranging from 44 to 8 across 50 epochs. To ensure the reliability and account for stochastic variance in initialization, each candidate architecture was trained 10 times using different random seeds. Our selection process prioritized both peak performance and robustness; therefore, we evaluated each architecture based on its mean Accuracy accompanied by its standard deviation. This approach allowed us to distinguish between architectures that were “lucky” in a single run and those that consistently performed well across multiple initializations. As illustrated in Fig. 1, we plotted the mean Accuracy against the Complexity Index, with error bars representing performance stability. From the resulting average envelope, we observed that mean Accuracy ranged between 95% and 97%. Notably, models with a complexity index above 0.25 maintained high performance with minimal degradation (Fig. 2), suggesting that significant reductions in model size can be achieved without a substantial loss in accuracy.
Fig. 2.
Performance-Efficiency Trade-off Analysis. Mean classification accuracy (%) as a function of the CI across all evaluated model architectures. Red points represent the mean accuracy of a specific architecture over 10 independent runs, with error bars indicating the standard deviation (
). The blue line represents the Average Accuracy Trend, highlighting the general trend of performance gains relative to increased model complexity. The x-axis includes secondary labels for parameter counts (P) and FLOPs (F). For CI > 0.25, the rate of improvement slows significantly, indicates a region of diminishing returns for further model scaling.
From this analysis, the final model was selected to be within the 0.5–1 complexity index range, balancing performance and efficiency (Refer to the supplementary Sect. 3). It contains ~ 38,000 trainable parameters while achieving accuracy comparable to the dense baseline model. Following the refinement of the convolutional layers, we explored further reductions in model complexity by decreasing the number of neurons in the fully connected layers. While this reduced the overall model size, it also resulted in a noticeable drop in the model’s sensitivity to P-wave onsets, leading to lower recall during evaluation. This decline can be attributed to the fact that the convolutional layers were already optimized with a reduced number of filters to meet efficiency constraints, which in turn limited the number of features passed to the fully connected layers62. With fewer and more compressed feature representations, a smaller fully connected structure struggled to distinguish subtle differences between noise and true P- and S-wave arrivals. Therefore, we retained a relatively larger fully connected layers in the model to preserve its discriminative capability. Further fine-tuning was applied to optimize the hyperparameters of the selected architecture before finalizing the model. The final model is illustrated in the Fig. 3.
Fig. 3.
CNN architecture for P- and S-wave detection. The model contains three convolutional layers (20, 28, and 20 filters with a kernel size of 4), with ReLU activation and dropout layers. The output is flattened and fed into two fully connected layers (18 and 11 neurons) followed by ReLU activation and a final 3-logit output layer representing Noise, P-wave, and S-wave categories.
Model training was conducted for 100 epochs with a batch size of 1024 on an NVIDIA H100 GPU using PyTorch 2.2.2. The total training time for 100 epochs was 151.9 s. Validation loss stabilized around epoch 60, with no significant signs of overfitting observed. Data preprocessing was performed using ObsPy and NumPy, and training diagnostics were visualized using Matplotlib.
Results
Performance on the test data
The trained model was evaluated on an independent test dataset comprising 20,299 waveform segments (2-s duration each), consisting of 6,946 P-wave, 6,407 S-wave, and 6,946 noise samples. Model optimization was guided by the overall classification accuracy on the validation dataset. Here, accuracy is defined as the proportion of correctly classified samples across all three classes, with labels assigned using the argmax assignment, which selects the class with the highest logit output as the predicted label. Under this criterion, the model achieved an overall test accuracy of 97.17%, demonstrating strong generalization capabilities.
To characterize the model’s sensitivity across minimum detection probability thresholds, we evaluated performance using precision (Eq. 1) and recall (Eq. 2):
![]() |
2 |
![]() |
3 |
where
,
, and
denote the number of true positives, false positives, and false negatives for class
, respectively. For this threshold-based evaluation, softmax probabilities were computed from the logits, and predictions were retained only when the maximum class probability exceeded a specified detection threshold.
Figure 4a illustrates the precision–recall (PR) characteristics for P- and S-wave detection across the full range of probability thresholds. P-wave detection exhibits high stability, with precision remaining above 0.94 even as recall approaches 0.99. This indicates highly reliable identification of P-wave arrivals with a minimal false-positive rate. In contrast, S-wave detection shows a more pronounced precision–recall trade-off; precision begins to decline more rapidly once recall exceeds approximately 0.95. This likely reflects the inherent difficulty in resolving S-wave onsets when they are embedded within the high-amplitude P-wave coda.
Fig. 4.
Classification performance of the proposed model on the independent test dataset. (a) Precision–recall curves for P-wave and S-wave detection across varying minimum detection probability thresholds (color-coded), illustrating the trade-off between sensitivity and specificity: higher thresholds (yellow) favor near-perfect precision, while lower thresholds (purple) maximize recall while maintaining precision above 0.93. (b) Normalized confusion matrix for noise, P-wave, and S-wave classes, illustrating class-wise accuracy and dominant misclassification pathways.
The normalized confusion matrix (Fig. 4b), also computed using argmax-based assignment, corroborates these findings. The model correctly classifies 98% of P-waves and 96% of S-waves. S-wave misclassifications primarily occur as P-waves (2%) or noise (2%). Noise rejection is similarly robust, with 98% of noise segments correctly identified, while only 1% are misclassified as P-waves and 2% as S-waves. Overall, the confusion matrix highlights strong class separability and balanced performance across all classes.
For an EEW system, robust P-wave detection performance for high-magnitude events is paramount, while occasional missed detections of low-magnitude events are deemed acceptable30. To evaluate this behavior, we analyzed the variation of model recall as a function of earthquake magnitude and epicentral distance, focusing on events within 100 km using the test dataset. As shown in Fig. 5, model’s recall improves with higher magnitude and shorter epicentral distances. The bivariate heatmap reveals that for earthquakes above approximately M 5, the model achieves near-perfect recall of 1 across all distances (up to 100 km), confirming its ability to detect the high magnitude events with high reliability, directly supporting the primary objective of an EEW system. In contrast, recall gradually declines for smaller earthquakes, especially those below M 4 and at distances beyond 40 km is likely due to reduced SNR ratios. Nevertheless, recall remains above 0.9 even under these more challenging conditions, highlighting the model’s robustness and practical utility in EEW applications.
Fig. 5.

P-wave Recall variation with earthquake magnitude and epicentral distance. Cells containing numbers indicate missed classifications, with the value representing the number of missed detection events in that bin. Total P-wave segments = 6,946.
Application to the 2016 M 7.8 Kaikōura earthquake
To further evaluate the model’s ability to generalize to real-world, high-impact events, we applied it to the 2016 M7.8 Kaikōura earthquake, one of the largest earthquake in New Zealand over the past decade2. Traditional detection approaches that rely on waveform similarity to past events may struggle with such large, infrequent, and highly complex earthquakes due to their novelty10. In contrast, deep learning-based methods are designed to learn generalisable features, offering more robust performance when faced with events not seen during training.
The model operates on raw waveform data without any preprocessing on the entire waveform (only applies min-max normalisation for 2 s segment), using overlapping 2-second windows (90% overlap). Filtering was omitted since the complete waveform is unavailable in real time, and applying filters on short segments offers limited benefit due to reduced frequency resolution and edge effects, while also increasing computational overhead. Within a 200 km epicentral distance, the model successfully detected all the P- and S-wave arrivals (Fig. 6). Beyond that, some stations missed the event. This is primarily attributed to reduced SNR at greater distances, where waveforms can undergo significant attenuation, which is not represent in the training data. Even more compelling is that this performance was achieved despite the model being trained and tested exclusively on events with magnitudes less than M 6.7. This confirms that the model generalizes well to unseen, high-magnitude events. For comparison with a conventional approach, we also included STA/LTA picks (with parameters tuned for real-time detection) in the raw waveforms. These picks were generally later and slightly more prone to false positives compared with the model outputs.
Fig. 6.
Application of the model to the 2016 M 7.8 Kaikōura earthquake, recorded by GeoNet strong-motion sensors. Vertical-component waveforms are plotted as a function of time and epicentral distance, with amplitudes scaled for clarity. All stations that recorded P- and/or S-wave arrivals from this event are included. Solid red lines indicate model-detected P-waves, and dashed orange lines indicate the detected S-waves, with class assignment based on the maximum logit output. Purple triangles denote the first detection using the STA/LTA method (parameters: sta_seconds = 1.0, lta_seconds = 10.0, on_threshold = 3.5, off_threshold = 1.0, minimum trigger length = 0.2 s, applied on the vertical HNZ channel). The dashed green and blue lines represent theoretical P- and S-wave arrival times, respectively, computed using the ak135 velocity model63. Note that the ak135 model provides arrival time estimates only up to ~ 400 km for an event depth of 15 km.
Large earthquakes typically exhibit lower-frequency, high-amplitude waveforms that evolve over time64. As a result, the full rupture is not captured within a short 2-second window10. However, our results show that reliable P-wave detections are still possible within this limited time frame. This is likely because, during the early stages of rupture, the initial waveforms of large earthquakes closely resemble those of smaller events65. The model leverages this similarity by focusing on the coherent, high-frequency characteristics of the P-wave onset, rather than the overall event magnitude or duration, enabling successful early detection even for large earthquakes. The analysis shows that our model’s performance is robust enough to serve as a triggering mechanism for practical EEW operations. For example, at a station located approximately 200 km from the epicenter, the model detects the P-wave nearly 30 s before the anticipated strong shaking arrives. Once a P-wave is detected, the system can trigger subsequent schemes for event characterization, such as magnitude66 and epicentral distance estimation67, and ultimately issue an alert if necessary. This lead time is sufficient to issue effective warnings and initiate protective actions. The ability to provide early detections under minimal preprocessing makes our model a valuable component for integration into low-latency, real-time seismic monitoring and EEW systems.
Application to raspberry shake data
To evaluate the feasibility of deploying our model on low-cost seismic sensors, we applied it to waveform data recorded by Raspberry Shake stations in New Zealand. Raspberry Shake devices are low-cost, MEMS-based seismic instruments that have gained popularity through citizen science initiatives and distributed earthquake monitoring networks41. While they typically exhibit higher noise levels and lower sensitivity compared to high-end strong-motion sensors, they offer a scalable and cost-effective solution for enhancing EEW coverage, particularly in under-instrumented regions. For this evaluation, we selected a recent moderate earthquake (M 3.6; GeoNet public ID: 2025p419621). Our pretrained model was applied without any additional fine-tuning or retraining, using the same configuration developed for the strong-motion dataset.
Figure 7 shows representative detections from four Raspberry Shake stations (R7734, RD9AE, R04D8, and R5F5E), illustrating the model’s ability to generalize across stations with varying noise conditions. At stations R7734 and RD9AE, the model produces high-confidence detections for both P and S phases (probability > 0.9), with sharp probability peaks closely aligned with the visual onsets. Performance remains robust at noisier stations: R04D8 exhibits confident detection of both phases despite elevated background noise, while at R5F5E the model successfully identifies the P-wave but does not trigger on the S-wave, which is barely visible in the raw waveform.
Fig. 7.
Model predictions on waveform data from four Raspberry Shake stations for an M 3.6 earthquake (GeoNet public ID: 2025p419621). Each subplot shows a station’s three-component acceleration waveform (top; ENE: blue, ENN: green, ENZ: red) and the corresponding model output probability (bottom) for P-waves (blue) and S-waves (red). The two right-hand stations exhibit higher background noise. The model was applied to raw waveforms with 90% overlap, corresponding to a time spacing of 10 milliseconds between adjacent outputs. Results show that the model captures all P- and S-wave onsets visible to the naked eye, demonstrating high performance on MEMS-based sensors.
The model’s ability to identify seismic phases on raw Raspberry Shake data without instrument-specific training suggests that the learned features are highly transferable across different sensor technologies. Furthermore, since these results were obtained for a relatively low-magnitude (M 3.6) event, even higher performance and clearer phase detections can be expected for larger, more damaging earthquakes, consistent with the magnitude-dependent performance trends discussed previously in Fig. 5. Overall, the model demonstrates encouraging performance and cross-instrument compatibility when applied to Raspberry Shake data, supporting its potential integration into low-cost, distributed seismic networks; future work will involve systematic quantitative validation using larger MEMS-based datasets and fine-tuning the model if necessary.
Real-Time inference performance on a raspberry Pi edge device
To evaluate the model’s suitability for real-time deployment on low-cost edge hardware, we conducted a continuous week-long inference test on a Raspberry Pi 5. In this setup, simulated seismic waveform data were streamed from a host computer to the Raspberry Pi via TCP socket, emulating real-time sensor acquisition. The input maintained a 50 Hz sampling rate, and the model processed overlapping 2-second windows with 70% overlap. The Raspberry Pi used featured a 64-bit ARM Cortex-A76 quad-core processor (up to 2.4 GHz) and 4 GB of RAM. On average, each inference took 6.5 milliseconds. During the experiment, CPU usage remained under 32% of a single core, memory consumption stayed below 220 MB, and the temperature stabilized around 59 °C, well below the 80 °C thermal throttling threshold for Raspberry Pi-class devices68. This demonstrates the system’s ability to sustain long-duration, real-time operation without thermal or performance degradation. The device retained over 3.5 GB of available memory, leaving ample headroom for concurrent tasks or future deployment of more complex models, such as intensity estimation. The CPU usage increased with the degree of input window overlap. While higher overlap improves temporal resolution and benefits early warning scenarios, it also raises computational load. This trade-off can be tuned according to deployment needs. These results confirm that the model is both computationally efficient and thermally stable under continuous operation, demonstrating its suitability for real-time inference on embedded platforms like the Raspberry Pi. Given its lightweight footprint and reliable performance, the model could be deployed at strong-motion sensor stations across New Zealand, either through integration with existing hardware or by attaching low-cost edge devices, demonstrating its practical suitability for distributed, real-time earthquake monitoring.
Discussion
This study presents a lightweight convolutional neural network model for real-time P-wave detection, developed with a focus on deployment in resource-constrained edge environments and trained on a newly constructed dataset from New Zealand’s GeoNet strong-motion archive. The dataset comprises over 89,000 three-component acceleration waveforms, capturing a wide range of earthquake magnitudes, source–receiver distances, and sensor conditions. As part of the dataset construction and evaluation process, we included both filtered and raw noise segments, enabling the model to better withstand complex noise conditions and reducing susceptibility to false-positive detections. Evaluation on an independent test dataset yielded an overall accuracy of 97.17%; notably, the model maintained high true positive rates for both P-waves (98%) and noise classes (98%), with slightly lower but still strong performance for S-waves (96%), confirming its reliability for automated seismic processing.
P-wave detection performance was correlated with event magnitude and epicentral distance, with recall increasing for larger and closer earthquakes. This trend is physically intuitive, as large earthquakes produce stronger and more coherent early P-wave signals, making them easier to distinguish from noise waveforms. These results suggest that the model has implicitly learned magnitude-dependent energy characteristics of P-waves, despite magnitude not being explicitly provided as an input feature. From an EEW perspective, this behavior is desirable: the model prioritizes reliable detection of large, nearby earthquakes that pose the greatest hazard, while accepting that some low-confidence detections of small, distant events may be missed. Notably, the model successfully detected P-waves from the 2016 Mw 7.8 Kaikōura earthquake, despite being trained only on events with magnitudes up to Mw 6.7. This demonstrates its ability to generalize to rare, high-magnitude earthquakes, a critical requirement for EEW systems. This capability is consistent with previous findings that early rupture characteristics of large (Mw > 6) and moderate earthquakes (approximately Mw 4.5–6) are similar during the first few seconds of ground motion10.
Although the primary focus of this study is P-wave detection, S-waves were also explicitly classified. This design choice encourages the model to learn waveform-specific features rather than relying solely on amplitude changes. Phase classification is particularly relevant for decentralized processing architectures, where decisions often depend on data from individual sensors. However, due to the longer and more complex nature of S-wave codas, and because S-wave onsets are often obscured by P-wave coda at short epicentral distances, a 2-second input window is less optimal for S-wave detection than for P-waves. This limitation likely contributes to the slightly lower recall observed for S-waves. Nevertheless, achieving a recall exceeding 96% for S-wave classification using a 2-second input window represents strong performance.
From a model design perspective, a key technical contribution is the compact architecture. An iterative architecture search guided by a custom “complexity index” revealed that performance saturated beyond an index value of approximately 0.25. This enabled the selection of a highly efficient model with less than 38 K model parameters. Importantly, this compact architecture achieves performance comparable to larger variants, with only a slight reduction in accuracy, while substantially reducing computational requirements. This enables real-time inference on Raspberry Pi 5 hardware with sub-7 ms inference time, low memory usage (< 220 MB), and stable thermal behavior. Precision–recall analysis further demonstrated clear separability between P- and S-wave signals and noise across a wide range of decision thresholds. This allows deployment-specific tuning, favoring either higher recall or lower false-positive rates depending on operational requirements.
To contextualize the compactness of our model, Table 1 compares it against several recent deep learning approaches for real-time P-wave detection, highlighting differences in model size (number of parameters). Notably, our model is the smallest among those listed, making it particularly well-suited to be used in, resource-constrained early warning systems.
Table 1.
Comparison of model complexity for recent real-time P-wave detection models, demonstrating the compactness of our model architecture.
In the context of an operational onsite EEW framework, the our model can serve as a first-stage triggering mechanism that rapidly detects P-wave onsets and initiates subsequent processing stages, such as S-wave intensity estimation based on early P-wave features. A key challenge for onsite EEW systems deployed on resource-constrained devices is the requirement for continuous, 24/7 monitoring, which makes sustained execution of complex deep learning models impractical. In contrast, a lightweight and highly reliable trigger model enables continuous surveillance with minimal computational overhead, while allowing more computationally intensive models to be activated only upon confirmed detections. Although such secondary models may temporarily induce higher resource usage, this overhead is acceptable given the infrequent nature of seismic events and does not impose a sustained performance bottleneck.
We validated this hierarchical strategy by deploying the GPD model on a Raspberry Shake sensor. Despite its substantially higher complexity (> 1.74 million parameters, approximately 47 times larger than the proposed model), GPD achieved an average inference time of less than 0.18 s in an unoptimized configuration. This result demonstrates that, when computational resources are managed hierarchically, edge devices can support sophisticated analysis pipelines without compromising real-time performance. The same triggering paradigm can be extended to regional EEW architectures, where the initial P-wave information identified by the onsite model is transmitted to centralized servers for further processing. Such a hierarchical design enables efficient allocation of computational resources, with lightweight models performing continuous first-stage screening and more complex models invoked only for confirmed events, as demonstrated in prior EEW systems71,72.
Despite the strong performance demonstrated in this study, several limitations should be acknowledged. Further quantitative evaluation across a broader range of sensor types and noise environments is required, as the current validation is based on a limited number of events recorded by Raspberry Shake sensors. In addition, noise segments were randomly extracted from earthquake waveform data, and consequently only a small fraction contained high-amplitude transient signals such as vehicle traffic, calibration pulses, or quarry blasts; underrepresentation of these signal types may lead to occasional spurious classifications as P- or S-waves during real-time operation. Finally, the lack of a sufficiently large, labeled MEMS dataset in New Zealand currently constrains direct evaluation and fine-tuning of the model for these sensor types.
Future work will focus on comprehensive field validation using CRISiSLab’s Raspberry Shake sensor network73 to assess performance under real-world operating conditions, including end-to-end latency, detection reliability, and sensitivity to environmental variability. In parallel, the model will be quantitatively evaluated on MEMS-based data, supported by ongoing efforts to construct a large, labeled MEMS dataset in New Zealand, with the aim of improving robustness to low-quality signals and generalization across sensor types. We also plan to extend the classification framework to explicitly distinguish multiple noise classes, which is expected to sharpen decision boundaries and improve both P- and S-wave detection sensitivity as well as overall classification accuracy.
Having addressed the fundamental challenge of designing a lightweight model suitable for edge deployment, we also plan to apply post-training quantization and hardware-aware optimizations to further reduce computational demands and enhance suitability for resource-constrained embedded devices. For onsite EEW applications, our future direction is to leverage the early P-wave detection by this model to estimate the expected S-wave intensity, thereby enabling ground-motion prediction without requiring explicit epicentral distance estimation in the initial stage. Collectively, these efforts will strengthen the model’s readiness for practical deployment in distributed, low-cost EEW systems.
Conclusion
In summary, this work presents a highly efficient, lightweight CNN model for real-time P-wave detection, purpose-built for deployment on low-cost edge devices within decentralized EEW systems. Trained on a diverse and regionally tailored dataset from New Zealand, the model achieves strong detection performance with minimal computational overhead, demonstrating sub-7 millisecond inference on Raspberry Pi 5 device. Its ability to generalize to unseen, high-magnitude events and maintain high recall within critical near-field distances underscores its practical value to be used in life-saving early warning scenarios. Through careful architectural optimization and dataset curation, we strike a balance between detection accuracy, speed, and resource efficiency—filling a critical gap in current EEW research. Looking ahead, extending the model to validate its performance on MEMS sensor networks, together with further optimizations, will strengthen its readiness for wide-scale implementation and contribute to more accessible, scalable, and resilient earthquake early warning infrastructure.
Supplementary Information
Below is the link to the electronic supplementary material.
Acknowledgements
The authors acknowledge the New Zealand GeoNet programme and its sponsors for providing the earthquake data used in this study. We also thank Mr. Florent Aden from Earth Sciences New Zealand, for valuable discussions regarding the research. The authors further acknowledge Massey University and CRISiSLab for providing the computational resources and hardware used to train and test the models.
Author contributions
D.R. conceptualized and designed the study, prepared the datasets, developed the code, performed the deep learning experiments and data analyses, and wrote the original manuscript. D.R. and R.P. were responsible for project administration and E.H.D. assisted with project planning. P.H. helped with data analysis and filtering, and helped to conceptualize the magnitude heatmap results. R.P. contributed to the conceptualization and interpretation of the kaikora analysis. R.P., P.H., and E.H.D. reviewed and edited the manuscript. All authors have read and agreed to the published version of the manuscript.
Funding
This research is funded by the Massey University Doctoral Scholarship.
Data availability
The earthquake catalogue and waveform data used in this study are publicly available from GeoNet New Zealand at https://doi.org/10.21420/0S8P-TZ38. The source code used in this study is available from the corresponding author upon request.
Declarations
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
References
- 1.Allen, R. M. & Melgar, D. Earthquake early warning: Advances, scientific challenges, and societal needs. Annu. Rev. Earth Planet. Sci.47, 10.1146/annurev-earth-053018-060457 Preprint at (2019).
- 2.Kaiser, A. et al. The 2016 Kaikōura, New Zealand, earthquake: Preliminary seismological report. Seismological Res. Letters88 (3), 727–739 (2017).
- 3.Cremen, G. & Galasso, C. Earthquake early warning: Recent advances and perspectives. Earth Sci. Rev.205, 103184 (2020). [Google Scholar]
- 4.Allen, R. M., Gasparini, P., Kamigaichi, O. & Böse, M. The status of earthquake early warning around the World: An introductory overview. Seismological Res. Letters80, 682–693 (2009).
- 5.Strauss, J. A. & Allen, R. M. Benefits and costs of earthquake early warning. Seismological Res. Letters87, 765–772 (2016).
- 6.Kuyuk, H. S. & Susumu, O. Real-time classification of earthquake using deep learning. Procedia Comput. Sci.140, 298–305 (2018). Elsevier B.V. [Google Scholar]
- 7.Zhang, X., Zhang, M. & Tian, X. Real-Time Earthquake Early Warning With Deep Learning: Application to the 2016 M 6.0 Central Apennines, Italy Earthquake. Geophys Res. Lett48, 2020GL089394 (2021).
- 8.Allen, R. V. Automatic earthquake recognition and timing from single traces. Bulletin Seismological Soc. America68, 1521–1532 (1978).
- 9.Sleeman, R. & van Eck, T. Robust automatic P-phase picking: an on-line implementation in the analysis of broadband seismogram recordings. Phys. Earth Planet. Inter.113, 265–275 (1999). [Google Scholar]
- 10.Ross, Z. E., Meier, M. A., Hauksson, E. & Heaton, T. H. Generalized seismic phase detection with deep learning. Bull. Seismol. Soc. Am.108, 2894–2901 (2018). [Google Scholar]
- 11.Zhu, W., Li, X., Liu, C., Xue, F. & Han, Y. An STFT-LSTM System for P-Wave Identification. IEEE Geosci. Remote Sens. Lett.17, 519–523 (2020). [Google Scholar]
- 12.Kim, S., Khan, I., Choi, S. & Kwon, Y. W. Earthquake Alert Device Using a Low-Cost Accelerometer and its Services. IEEE Access.9, 121964–121974 (2021). [Google Scholar]
- 13.Chin, T. L., Chen, K. Y., Chen, D. Y. & Lin, D. E. Intelligent Real-Time Earthquake Detection by Recurrent Neural Networks. IEEE Trans. Geosci. Remote Sens.58, 5440–5449 (2020). [Google Scholar]
- 14.Khan, I. & Kwon, Y. W. P-Detector: Real-Time P-Wave Detection in a Seismic Waveform Recorded on a Low-Cost MEMS Accelerometer Using Deep Learning. IEEE Geosci. Remote Sens.Lett.19, 1–5 (2022).
- 15.Saad, O. M. et al. SCALODEEP: A Highly Generalized Deep Learning Framework for Real-Time Earthquake Detection. J Geophys. Res. Solid Earth126, e2020JB021473 (2021).
- 16.Tang, L., Zhang, M. & Wen, L. Support Vector Machine Classification of Seismic Events in the Tianshan Orogenic Belt. J Geophys. Res. Solid Earth125, e2019JB018132 (2020).
- 17.Mosher, S. G. & Audet, P. Automatic Detection and Location of Seismic Events From Time-Delay Projection Mapping and Neural Network Classification. J Geophys. Res. Solid Earth125, e2020JB019426 (2020).
- 18.Reynen, A. & Audet, P. Supervised machine learning on a network scale: Application to seismic event classification and detection. Geophys J. Int210, 1394–1409 (2017).
- 19.Spoorthi, G. E., Gorthi, S., Gorthi, R. K. S. S. & PhaseNet A deep convolutional neural network for two-dimensional phase unwrapping. IEEE Signal. Process. Lett.26, 54–58 (2019). [Google Scholar]
- 20.Mousavi, S. M., Zhu, W., Sheng, Y. & Beroza, G. C. CRED: A Deep Residual Network of Convolutional and Recurrent Units for Earthquake Signal Detection. Sci Rep9, 10267 (2019). [DOI] [PMC free article] [PubMed]
- 21.Chakraborty, M. et al. CREIME—A Convolutional Recurrent Model for Earthquake Identification and Magnitude Estimation. J Geophys. Res. Solid Earth127, e2022JB024595 (2022).
- 22.Hu, Y., Zhang, Q., Zhao, W. & Wang, H. TransQuake: A transformer-based deep learning approach for seismic P-wave detection. Earthquake Res. Advances1, 100004 (2021).
- 23.Mai, H., Audet, P., Perry, H. K. C., Mousavi, S. M. & Zhang, Q. Blockly earthquake transformer: A deep learning platform for custom phase picking. Artif. Intell. Geosci.4, 84–94 (2023). [Google Scholar]
- 24.Mousavi, S. M., Ellsworth, W. L., Zhu, W., Chuang, L. Y. & Beroza, G. C. Earthquake transformer—an attentive deep-learning model for simultaneous earthquake detection and phase picking. Nat Commun11, 3952 (2020). [DOI] [PMC free article] [PubMed]
- 25.Wu, A., Khan, I. & Kwon, Y. W. A transformer-based real-time earthquake detection framework in heterogeneous environments. Sci. Rep.15, 8422 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Owusu Duah, J., Osei, O. & Osafo-Gyamfi, S. Predicting Peak Ground Acceleration of Strong-Motion Earthquakes Using Variable Snapshots of P -Wave Data with Long Short-Term Memory Neural Network. Seismol. Res. Lett.95, 2886–2893 (2024). [Google Scholar]
- 27.Zhao, Y. et al. Lightweight Context-Aware Attention Networks for Earthquake Detection and Phase-Picking on IoT Edge Devices. IEEE Syst. J.10.1109/JSYST.2021.3114689 (2021). [Google Scholar]
- 28.Stubailo, I., Alvarez, M., Biasi, G., Bhadha, R. & Hauksson, E. Latency of Waveform Data Delivery from the Southern California Seismic Network during the 2019 Ridgecrest Earthquake Sequence and Its Effect on ShakeAlert. Seismol. Res. Lett.92, 170–186 (2021). [Google Scholar]
- 29.Stirling, M. et al. National Seismic Hazard Model for New Zealand: 2010 Update. Bull. Seismol. Soc. Am.102, 1514–1542 (2012). [Google Scholar]
- 30.Lara, P., Bletery, Q., Ampuero, J., Inza, A. & Tavera, H. Earthquake Early Warning Starting From 3 s of Records on a Single Station With Machine Learning. J Geophys. Res. Solid Earth128, (2023).
- 31.Clements, T. Earthquake Detection with tinyML. Seismol. Res. Lett.10.1785/0220220322 (2023). [Google Scholar]
- 32.Khan, I., Choi, S. & Kwon, Y. W. Earthquake detection in a static and dynamic environment using supervised machine learning and a novel feature extraction method. Sensors (Switzerland)20, (2020). [DOI] [PMC free article] [PubMed]
- 33.Allen, R. M. & Kanamori, H. The potential for earthquake early warning in Southern California. Science (1979)300, (2003). [DOI] [PubMed]
- 34.Wang, C. Y., Huang, T. C. & Wu, Y. M. Using LSTM Neural Networks for Onsite Earthquake Early Warning. Seismological Res. Letters93, 814–826 (2022).
- 35.Zainab, T., Karstens, J. & Landsiedel, O. L. E. Q. On-Device Earthquake Detection with Embedded Machine Learning. in ACM International Conference Proceeding Series 130–143Association for Computing Machinery, (2023). 10.1145/3576842.3582387
- 36.Murshed, M. G. S. et al. Machine Learning at the Network Edge: A Survey. ACM Comput. Surv.54, 1–37 (2022). [Google Scholar]
- 37.Merenda, M., Porcaro, C. & Iero, D. Edge Machine Learning for AI-Enabled IoT Devices: A Review. Sensors20, 2533 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 38.Zhu, G. et al. Toward an Intelligent Edge: Wireless Communication Meets Machine Learning. IEEE Commun. Mag.58, 19–25 (2020). [Google Scholar]
- 39.Chandrakumar, C., Tan, M. L., Holden, C., Stephens, M. T. & Prasanna, R. Performance analysis of P-wave detection algorithms for a community-engaged earthquake early warning system–a case study of the 2022 M5.8 Cook Strait earthquake. NZ J. Geol. Geophys.10.1080/00288306.2023.2284276 (2023). [Google Scholar]
- 40.Tan, M. L. & Becker, J. An Earthquake Early Warning system for Aotearoa New Zealand? 10.13140/RG.2.2.35042.04800.
- 41.Prasanna, R. et al. Saving Precious Seconds—A Novel Approach to Implementing a Low-Cost Earthquake Early Warning System with Node-Level Detection and Alert Generation. Informatics 9, (2022).
- 42.GNS Science. GeoNet Aotearoa New Zealand Seismic Digital Waveform Dataset [Data set]. GNS Science. 10.21420/G19Y-9D40. (2021).
- 43.GNS Science. New Zealand Earthquake Catalogue [Data set]. GNS Science, GeoNet. 10.21420/0S8P-TZ38 (1970).
- 44.Li, B. et al. A deep learning P-wave detection model based on UNet + + designed for China Seismic Experimental Site. Front Earth Sci. (Lausanne)10, 1032839 (2023).
- 45.Zhu, W., Tai, K. S., Mousavi, S. M., Bailis, P. & Beroza, G. C. An End-To-End Earthquake Detection Method for Joint Phase Picking and Association Using Deep Learning. J Geophys. Res. Solid Earth127, e2021JB023283 (2022).
- 46.Shakeel, M., Itoyama, K., Nishida, K. & Nakadai, K. Detecting earthquakes: a novel deep learning-based approach for effective disaster response. Appl. Intell.51, 8305–8315 (2021). [Google Scholar]
- 47.Bednarski, B. P. et al. Temporal convolutional networks and data rebalancing for clinical length of stay and mortality prediction. Sci. Rep.12, 21247 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 48.Fanizzi, A. et al. Comparison between vision transformers and convolutional neural networks to predict non-small lung cancer recurrence. Sci. Rep.13, 20605 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 49.Khan, S. et al. Transformers in Vision: A Survey. ACM Comput. Surv.54, 1–41 (2022). [Google Scholar]
- 50.Nejedly, P. et al. Exploiting Graphoelements and Convolutional Neural Networks with Long Short Term Memory for Classification of the Human Electroencephalogram. Sci. Rep.9, 11383 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 51.Perol, T., Gharbi, M. & Denolle, M. S E I S M O L O G Y Convolutional Neural Network for Earthquake Detection and Location. (2018). https://www.science.org [DOI] [PMC free article] [PubMed]
- 52.Liu, Y., Zhao, Q. & Wang, Y. Peak ground acceleration prediction for on-site earthquake early warning with deep learning. Sci. Rep.14, 5485 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 53.Li, W. et al. Earthquake monitoring using deep learning with a case study of the Kahramanmaras Turkey earthquake aftershock sequence. Solid Earth. 15, 197–213 (2024). [Google Scholar]
- 54.Saad, O. M., Chen, Y. & CapsPhase Capsule Neural Network for Seismic Phase Classification and Picking. IEEE Trans. Geosci. Remote Sens.60, 1–11 (2022). [Google Scholar]
- 55.Agarap, A. F. Deep Learning using Rectified Linear Units (ReLU). (2019). http://arxiv.org/abs/1803.08375
- 56.Kingma, D. P., Ba, J. & Adam A Method for Stochastic Optimization. (2017). http://arxiv.org/abs/1412.6980
- 57.Gal, Y. & Ghahramani, Z. Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning. (2016). http://arxiv.org/abs/1506.02142
- 58.Loshchilov, I. & Hutter, F. Decoupled Weight Decay Regularization. (2019). http://arxiv.org/abs/1711.05101
- 59.Ahmed, W. S., Karim, A. & amir, A.vThe Impact of Filter Size and Number of Filters on Classification Accuracy in CNN. in 2020 International Conference on Computer Science and Software Engineering (CSASE) 88–93 (IEEE, 2020). 10.1109/CSASE48920.2020.9142089
- 60.Hu, X., Chu, L., Pei, J., Liu, W. & Bian, J. Model complexity of deep learning: a survey. Knowl. Inf. Syst.63, 2585–2619 (2021). [Google Scholar]
- 61.Brigato, L. & Iocchi, L. A close look at deep learning with small data. in Proceedings - International Conference on Pattern Recognition 2490–2497Institute of Electrical and Electronics Engineers Inc., (2020). 10.1109/ICPR48806.2021.9412492
- 62.Basha, S. H. S., Dubey, S. R., Pulabaigari, V. & Mukherjee, S. Impact of fully connected layers on performance of convolutional neural networks for image classification. Neurocomputing378, 112–119 (2020). [Google Scholar]
- 63.Kennett, B. L. N. & Seismological Tables AK135. Research School of Earth Sciences, Australian National University Canberra, Australia (2005).
- 64.Ruff, L. & Kanamori, H. The Rupture Process and Asperity Distribution of Three Great Earthquakes from Long-Period Diffracted P-Waves. Physics Earth Planet. Interiors (1983).
- 65.Meier, M., Heaton, T. & Clinton, J. Evidence for universal earthquake rupture initiation behavior. Geophys. Res. Lett.43, 7991–7996 (2016). [Google Scholar]
- 66.Kanamori, H. Real-time seismology and earthquake damage mitigation. Annu. Rev. Earth Planet. Sci.33, 195–214 (2005). [Google Scholar]
- 67.Jung, S., Rhee, H. M. & Sheen, D. H. Rapid assessment of epicentral distance using the initial P waves observed in South Korea. Bull. Seismol. Soc. Am. 108, Preprint at (2018). 10.1785/0120170199
- 68.Benoit-Cattin, T., Velasco-Montero, D. & Fernández-Berni, J. Impact of thermal throttling on long-term visual inference in a cpu-based edge device. Electronics (Switzerland)9, (2020).
- 69.Huang, X., Lee, J., Kwon, Y. W., Lee, C. H. & CrowdQuake: A Networked System of Low-Cost Sensors for Earthquake Detection via Deep Learning. in Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining 3261–3271Association for Computing Machinery, (2020). 10.1145/3394486.3403378
- 70.Wu, A., Lee, J., Khan, I., Kwon, Y. W. & CrowdQuake+ Data-driven Earthquake Early Warning via IoT and Deep Learning. in Proceedings – 2021 IEEE International Conference on Big Data, Big Data 2021 (2021). 10.1109/BigData52589.2021.9671971
- 71.Dokht, R. M. H., Kao, H., Visser, R. & Smith, B. Seismic event and phase detection using time-frequency representation and convolutional neural networks. Seismol. Res. Lett.90, 481–490 (2019). [Google Scholar]
- 72.Lee, J., Khan, I., Choi, S. & Kwon, Y. W. A smart iot device for detecting and responding to earthquakes. Electronics (Switzerland)8, (2019).
- 73.Raj Prasanna. CRISiSLab Sensor Network.
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Citations
- GNS Science. GeoNet Aotearoa New Zealand Seismic Digital Waveform Dataset [Data set]. GNS Science. 10.21420/G19Y-9D40. (2021).
- GNS Science. New Zealand Earthquake Catalogue [Data set]. GNS Science, GeoNet. 10.21420/0S8P-TZ38 (1970).
Supplementary Materials
Data Availability Statement
The earthquake catalogue and waveform data used in this study are publicly available from GeoNet New Zealand at https://doi.org/10.21420/0S8P-TZ38. The source code used in this study is available from the corresponding author upon request.









