A deep learning system for automated earthquake detection and P/S wave arrival time picking, inspired by EQTransformer. Built using the STEAD dataset with multi-task learning architecture.
Seismic monitoring networks generate terabytes of continuous data daily. This project implements automated detection and phase picking that enables real-time earthquake early warning, comprehensive catalog generation, and seismic event monitoring at scale.
- Multi-task deep learning model (detection + P-pick + S-pick)
- Classical STA/LTA baseline for comparison
- Three-component seismogram processing (E, N, Z)
- Gaussian probability output for arrival times
- Sub-second picking accuracy
- Production-ready inference pipeline
Raw 3C Waveform → Bandpass Filter (1-45Hz) → Detrend → Normalize →
→ Model Input (6000, 3) → Detection + P-pick + S-pick
seismic-event-detection/
├── data/ # STEAD dataset (not tracked)
├── models/ # Saved model weights
├── notebooks/
│ └── EDA.ipynb # Exploratory analysis
├── src/
│ ├── data_loader.py # STEAD HDF5 loading
│ ├── preprocessing.py # Filtering, normalization
│ ├── sta_lta.py # Classical detection baseline
│ ├── models.py # EQTransformer-lite architecture
│ ├── train.py # Multi-task training
│ ├── evaluate.py # Detection and picking metrics
│ ├── visualize.py # Waveform plotting
│ └── inference.py # Production detection
├── scripts/
│ ├── download_data.py
│ └── demo.py
├── docs/
│ └── IMPLEMENTATION_PLAN.md
├── requirements.txt
└── README.md
# Clone the repository
git clone https://github.com/Sakeeb91/seismic-event-detection.git
cd seismic-event-detection
# Install dependencies
pip install -r requirements.txt
# Download STEAD dataset (follow instructions)
python scripts/download_data.py
# Train model
python src/train.py
# Evaluate
python src/evaluate.py
# Run demo
python scripts/demo.pySTEAD (STanford EArthquake Dataset)
- 1.2 million three-component seismograms
- ~450,000 earthquakes globally
- High-quality P and S arrival time labels
- Format: HDF5 files with CSV metadata
- Each trace: (6000, 3) = 60 seconds at 100 Hz
Multi-task model predicting:
- Detection probability - Is there an earthquake?
- P-wave probability - Gaussian around P arrival
- S-wave probability - Gaussian around S arrival
Input (3, 6000) → ResNet Encoder → Transformer → 3 Decoder Branches
├── Detection (1, 6000)
├── P-pick (1, 6000)
└── S-pick (1, 6000)
| Metric | Target |
|---|---|
| Detection F1 | 0.95+ |
| P-pick MAE | 0.1-0.2 seconds |
| S-pick MAE | 0.2-0.3 seconds |
- Python 3.8+
- PyTorch 1.9+
- See
requirements.txtfor full dependencies
MIT License
- Mousavi et al. "Earthquake Transformer—An Attentive Deep-Learning Model for Simultaneous Earthquake Detection and Phase Picking"
- STEAD Dataset: https://github.com/smousavi05/STEAD