Code and models for the Physics-Informed Neural Networks for Earthquake Early Warning exploration.
This repository contains source code, experiment scripts, and trained model checkpoints for evaluating PINNs in earthquake early warning applications using 50 Philippine earthquakes (M6.2-7.6, 2010-2024).
pinnv1/
├── pinn_warning/ # Core PINN library (23 modules)
├── src/ # Physics solvers and models
├── scripts/ # Experiment scripts (77 files)
├── artifacts/ # Trained models (130 checkpoints via Git LFS)
├── data/ # Data downloaded separately (see below)
├── Makefile # Automation for training and data download
└── requirements.txt # Python dependencies
git clone [email protected]:mangobanaani/pinnv1.git
cd pinnv1
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtRequirements:
- Python 3.8+
- PyTorch 2.0+
- Git LFS (for trained models)
This repository includes trained model checkpoints (90 MB) but excludes raw data files (114 MB) which must be downloaded:
# Download Philippine earthquake catalog from USGS (107 MB, ~30 min)
make download-all-earthquakes
# Generate synthetic test data (2.4 MB, ~5 min)
make generate-checkerboardWhat gets downloaded:
- 50 Philippine earthquakes (M6.2-7.6, 2010-2024) from IRIS/USGS
- Waveform snapshots for validation
What gets generated:
- Synthetic checkerboard velocity models
- Borehole observations
- Dispersion curves
- Travel-time data
# Verify installation
make test
# Reproduce key experiments
make sanity-checks # Part 2: Waveform prediction limits
make pga-advanced # Part 4: PGA prediction methods
make gmpe-residual # Part 4: Optimal GMPE-residual approach
# Full reproduction (requires data download)
make reproducePart 1: Practical EEW Feasibility
- Warning time analysis: 17-106 seconds achievable
- Threshold detection methods
Part 2: Waveform Prediction Failure
make sanity-checks
# Result: r ≈ 0 for cross-event generalizationPart 3: Training Time Barrier
- 20 minutes per model (insurmountable for operational EEW)
- Ensemble validation (N=50) confirms failure
Part 4: Successful Alternative
make gmpe-residual
# Result: r = 0.943 (simple MLP predicting AS14 residuals)All trained models are included via Git LFS in artifacts/:
pinn_phase1.pt- Surface-only baselinepinn_phase2.pt- Sparse boreholespinn_phase3.pt- Dispersion curvespinn_joint_full.pt- Joint inversionensemble_baseline/- N=50 ensemble checkpoints- Additional experimental checkpoints
This work is licensed under CC-BY-4.0.
You are free to:
- Share and adapt the code and data
- Use for commercial purposes
Under the terms:
- Attribution required (cite the paper)
- No additional restrictions