"The earthquake starts softly and then it hits hard."
This project presents a complete end-to-end system for detecting P-wave (Primary) and S-wave (Secondary) arrival times from raw seismic signals using signal processing, baseline machine learning, and an upgraded CNN-based deep learning model.
Accurate identification of P and S wave arrivals is critical for:
- Earthquake early warning systems
- Epicenter localization
- Magnitude estimation
- Structural safety analysis
- Disaster mitigation
Manual picking of arrivals is slow, subjective, and sensitive to noise. This system automates the entire workflow.
Definition:
- Arrives first
- Longitudinal (compressional)
- Ground moves back–forth in direction of wave travel
Think of pushing and pulling a slinky.
| Property | P Wave |
|---|---|
| Speed | Fastest |
| Medium | Solid, Liquid, Gas |
| Motion | Compression & Expansion |
| Arrival | First |
| Damage | Very low |
On a seismogram: small oscillations, weak amplitude.
Definition:
- Arrives after P wave
- Transverse (shear)
- Ground moves perpendicular to direction of travel
Think of shaking a rope.
| Property | S Wave |
|---|---|
| Speed | Slower |
| Medium | Solids only |
| Motion | Shearing |
| Arrival | Second |
| Damage | High |
S waves have much larger amplitude and cause structural damage.
P waves compress → Earth handles compression well.
S waves shear → Structures do not handle shear well.
- P wave → Knock on the door
- S wave → Door gets kicked in
One-line takeaway: P waves arrive first and are weak; S waves arrive later and are stronger and destructive.
Raw Seismic Signal
↓
Signal Conditioning
↓
Butterworth Bandpass Filtering
↓
Feature Extraction
↓
Baseline ML Model
↓
CNN Model
↓
P & S Arrival Detection
Nyquist = Sampling Rate / 2
It defines the highest frequency that can be captured without aliasing when converting continuous seismic signals to discrete form.
A Butterworth bandpass filter retains only the relevant seismic frequency band. Filter order (N=4) controls how sharply unwanted frequencies are removed.
- Low order → smooth filtering
- High order → sharp but risky (ringing, instability)
Each order adds approximately 20 dB/decade roll-off.
| Order | Roll-off |
|---|---|
| 1 | 20 dB/decade |
| 2 | 40 dB/decade |
| 4 | 80 dB/decade |
| 8 | 160 dB/decade |
N=4 provides a balanced tradeoff between noise removal and signal preservation. When used with zero-phase filtering (filtfilt), the effective order doubles.
A traditional ML model was first implemented to establish a performance benchmark.
Features used:
- Signal energy
- Rolling variance
- STA/LTA ratio
- Frequency band energy
- Amplitude envelope
- Zero-crossing rate
The baseline model provided initial detection capability but struggled in low SNR and complex noise scenarios.
To improve robustness, the system was upgraded to a Convolutional Neural Network (CNN).
Why CNN?
- Learns waveform patterns automatically
- Captures local temporal features
- Handles noisy signals better
- Reduces reliance on manual feature engineering
The CNN significantly improved detection accuracy and generalization across seismic events.
- Precision
- Recall
- F1 Score
- Mean Absolute Error
- Detection latency
High recall for P-wave detection is critical for early warning systems.
Even detecting a P wave seconds earlier can enable early warnings before the destructive S wave arrives.
This project integrates physics-based signal processing with deep learning for reliable, automated seismic phase detection.