Clear Sky Science · en
Lightweight convolutional neural network for real-time earthquake P-wave detection on edge devices in New Zealand
Seconds That Can Save Lives
When an earthquake strikes, a few seconds of advance notice can mean the difference between safety and disaster. This study explores how tiny, low-cost computers paired with smart algorithms can spot the very first ripples of an earthquake fast enough to warn people and automated systems before the strongest shaking arrives. By tailoring their approach to New Zealand’s restless ground, the authors show that high-tech early warning does not have to depend on huge data centers—it can run on devices small enough to attach directly to a sensor in the field.
Why the First Gentle Shakes Matter
Earthquakes send out several kinds of waves. The earliest are P-waves, which are usually mild but race ahead of the more damaging waves that follow. If we can detect these first gentle shakes quickly and reliably, warning messages can be sent out while there is still time to duck under a desk, stop a train, pause surgery, or close gas valves. Traditional methods look for simple changes in the signal, but they often get confused by noise from traffic, machinery, or wind, and they may react too slowly. Newer deep learning methods are more accurate, yet they usually demand powerful computers and long stretches of data, making them hard to run on small devices near the sensors themselves.

Teaching a Small Model to Listen Smartly
The researchers designed a compact type of deep learning model called a convolutional neural network to tackle this problem. Instead of needing thirty seconds or more of motion, their system works with just a two-second slice of ground shaking, making it especially fast. They trained it not only to recognize P-waves but also the stronger S-waves and ordinary background noise. To do this, they drew on about 89,000 recordings from New Zealand’s national network of strong-motion instruments, focusing on events within roughly 100–150 kilometers of the sensors and magnitudes above 3.0. Each 90-second recording was cleaned, filtered, and then chopped into short windows representing P-waves, S-waves, and noise, giving the model a wide range of real-world conditions to learn from, including many cases where the signal is barely stronger than the noise.
Packing Power Into a Tiny Footprint
Designing for low-cost hardware meant the model had to be extremely efficient. The team explored many versions of their network, adjusting the number of layers and filters and measuring both accuracy and the amount of computation required. They combined these factors into a single score that let them see when extra complexity stopped giving real benefits. This search led to a final design with only about 38,000 adjustable settings—far fewer than many existing earthquake models—yet it still correctly labeled about 97 percent of test segments overall and 98 percent of P-wave examples. In trials on a Raspberry Pi 5, a widely available hobbyist computer, each decision took roughly 6.5 thousandths of a second, used only a small slice of one processor core, and stayed well within safe temperature limits during a week of continuous operation.
Proving It Works on Big Quakes and Cheap Sensors
To test whether the system could handle the quakes that matter most, the authors applied it to the powerful 2016 Kaikōura earthquake, even though this event was kept out of the training data. Using overlapping two-second windows and only simple rescaling of the incoming signal, the model picked out the first P-waves at stations up to 200 kilometers away, often tens of seconds before strong shaking would have peaked. It also performed well on data from low-cost Raspberry Shake sensors, which are noisier than professional instruments but much easier to deploy widely. Without retraining, the model still found P- and S-waves clearly at several Raspberry Shake stations during a magnitude 3.6 event, suggesting that its “listening skills” transfer across different devices.

What This Means for Everyday Safety
The study shows that it is possible to squeeze reliable, rapid earthquake detection into a model small and efficient enough to run on cheap edge devices scattered across a country. By acting as a first-stage trigger that reacts within seconds on each sensor, the system can feed larger networks or more detailed analyses that estimate how strong the shaking will be and where it will hit hardest. For people living in quake-prone regions like New Zealand, this approach brings the promise of earlier alerts without relying solely on expensive, centralized infrastructure—paving the way for more accessible and resilient early warning systems that could one day be as common as smoke alarms.
Citation: Ravishan, D., Prasanna, R., Herath, P. et al. Lightweight convolutional neural network for real-time earthquake P-wave detection on edge devices in New Zealand. Sci Rep 16, 11536 (2026). https://doi.org/10.1038/s41598-026-42568-y
Keywords: earthquake early warning, P-wave detection, edge computing, deep learning, New Zealand seismology