Skip to content

mangobanaani/pinnv1

Repository files navigation

Physics-Informed Neural Networks for Earthquake Early Warning

Code and models for the Physics-Informed Neural Networks for Earthquake Early Warning exploration.

Overview

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).

Repository Structure

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

Installation

git clone [email protected]:mangobanaani/pinnv1.git
cd pinnv1
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Requirements:

  • Python 3.8+
  • PyTorch 2.0+
  • Git LFS (for trained models)

Data Setup

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-checkerboard

What 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

Quick Start

# 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 reproduce

Key Experiments

Part 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 generalization

Part 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)

Trained Models

All trained models are included via Git LFS in artifacts/:

  • pinn_phase1.pt - Surface-only baseline
  • pinn_phase2.pt - Sparse boreholes
  • pinn_phase3.pt - Dispersion curves
  • pinn_joint_full.pt - Joint inversion
  • ensemble_baseline/ - N=50 ensemble checkpoints
  • Additional experimental checkpoints

License

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

About

Physics-Informed Neural Networks for Earthquake Early Warning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors