Skip to content

kavianpour/CNN-BiLSTM-AM-Earthquake-Prediction

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CNN-BiLSTM-AM — Earthquake Prediction with a Spatio-Temporal Attention Model

A deep learning framework that predicts both the maximum magnitude and the number of earthquakes in the coming month, designed for the nonlinear, chaotic nature of seismic data. It pairs a CNN-BiLSTM-attention network with a novel Zero-Order-Hold (ZOH) preprocessing step, validated across nine seismic regions of China.

Citations

📄 Paper: A CNN-BiLSTM model with attention mechanism for earthquake prediction The Journal of Supercomputing 79 (2023) 19194–19226 · doi:10.1007/s11227-023-05369-y

👥 Parisa Kavianpour, Mohammadreza Kavianpour, Ehsan Jahani, Amin Ramezani

🌟 Highly cited — this work has accumulated 200+ citations, making it a well-recognized reference for deep-learning-based earthquake prediction.


TL;DR

Earthquakes are stochastic and chaotic, which makes them notoriously hard to forecast — and seismic time series are full of "empty" months that confuse a model during training. This work tackles both problems:

  1. Spatio-temporal feature learning. A CNN extracts spatial features, feeding a bi-directional LSTM (BiLSTM) that captures temporal patterns in both directions, so the model learns the shape of seismic history rather than treating months in isolation.
  2. Attention mechanism (AM). An attention layer re-weights the BiLSTM's hidden states so the most informative time steps dominate the prediction.
  3. Zero-Order-Hold (ZOH) preprocessing. A novel idea borrowed from missing-data imputation: the many "zero" (no-earthquake) months that destabilize training are replaced by holding the last nonzero value — reducing the effect of seismic complexity and sharpening the forecasts.

The model predicts two targets a month ahead — maximum magnitude and earthquake count — and is tested on a 50-year catalog across nine regions of China, beating shallow ML (SVM, DT, MLP, RF) and deep baselines (CNN, LSTM, CNN-BiLSTM).

⚠️ Status — documentation & resources only. This repository currently hosts the method overview, problem framing, figures, and dataset pointers. The training code is not yet public. See Roadmap.


The architecture

CNN-BiLSTM-AM architecture

Five blocks. Input applies ZOH preprocessing → a feature-extraction CNN (4 conv layers + flatten) → a sequence-learning block (2 BiLSTM layers with dropout) → an attention block → a prediction block (3 FC layers) that outputs the forecast.

A detailed walkthrough lives in docs/method.md.


Why this is hard — three challenges

Challenge What goes wrong How this model responds
Chaotic, nonlinear signal Earthquakes are random and hard to pattern; shallow ML extracts only surface features. CNN + BiLSTM learn deep spatial and bidirectional temporal structure.
Many "empty" months Zero-valued months mislead training and inflate error. ZOH preprocessing holds the last nonzero value, easing training.
Not all features matter equally Plain sequence models weight every step the same and miss critical moments. Attention assigns higher weight to the most influential hidden states.

Full discussion in docs/challenges.md.


Two key ideas

Zero-Order-Hold (ZOH) preprocessing

Seismic months with no qualifying earthquake produce zeros that aren't part of the underlying behavior, yet they dominate training and hurt accuracy. Inspired by imputation in missing-data problems, ZOH replaces each zero with the last nonzero value from the prior month — applied only to training data, never the test set. The ablations show ZOH contributes more than attention to the final accuracy, and clearly beats mean- or max-substitution baselines.

Predicting earthquake count, not just magnitude

Most prior work forecasts only time / location / magnitude. This study also predicts the number of earthquakes per month — a signal that helps paint a fuller picture of a region's seismicity — as a separate case study alongside maximum-magnitude prediction.


Headline results

The study scope — nine seismic regions of China

Nine study regions of China

Mainland China (one of the world's most seismically active areas) split into nine geologically distinct regions, each trained separately. Points are real catalog earthquakes (1966–2021, magnitude ≥ 3.5, 11,442 events).

Consistent wins across every region

Ablation radar

Ablation on the R² metric across all nine regions. The full model (yellow) dominates CNN-BiLSTM and its partial variants everywhere — showing ZOH and attention each add value, region by region.

The numbers

  • Maximum-magnitude prediction: averaged over nine regions, the model reaches R² ≈ 0.906 with RMSE/MAE of 0.074 / 0.076, versus the best baseline (CNN-BiLSTM) at R² ≈ 0.445 — and far ahead of shallow ML (SVM lowest).
  • Earthquake-count prediction: improves on the CNN-BiLSTM baseline across RMSE, MAE, and R², driven by the ZOH + attention additions.
  • Generalization: holds up even on a shrunken sub-region with a shifted data distribution, where baselines degrade — evidence of robustness.
  • Best vs. worst region: on a tough region the model still hits R² ≈ 0.801 where a decision-tree baseline collapses to ≈ 0.111.

See docs/method.md for the metrics and training setup.


Dataset

A 50-year seismic catalog of mainland China; see docs/datasets.md. No data is redistributed here.

Property Value
Sources USGS + National Seismological Center (NSC)
Span Jan 1966 – May 2021, magnitude ≥ 3.5
Size 11,442 events → 665 monthly samples
Regions 9 (lat 23–45°, lon 75–119°, split 3×3)
Targets max magnitude/month; earthquake count/month

Repository contents

.
├── README.md               # you are here
├── assets/                 # figures extracted from the paper
├── docs/
│   ├── method.md           # CNN, BiLSTM, attention, ZOH, training setup
│   ├── challenges.md       # the three challenges, in depth
│   └── datasets.md         # catalog, regions, preprocessing, two case studies
├── CITATION.cff            # machine-readable citation
└── LICENSE                 # docs/figures license

Roadmap

  • Method overview, problem framing, and figures
  • Dataset documentation and region/preprocessing design
  • Reference implementation (Keras/PyTorch) of CNN-BiLSTM-AM
  • ZOH preprocessing utility
  • Catalog-download + region-splitting scripts
  • Reproduction scripts for both case studies

Citation

If you find this work useful, please cite the paper (see CITATION.cff):

@article{kavianpour2023cnnbilstm,
  title   = {A CNN-BiLSTM model with attention mechanism for earthquake prediction},
  author  = {Kavianpour, Parisa and Kavianpour, Mohammadreza and
             Jahani, Ehsan and Ramezani, Amin},
  journal = {The Journal of Supercomputing},
  volume  = {79},
  pages   = {19194--19226},
  year    = {2023},
  doi     = {10.1007/s11227-023-05369-y}
}

License & figures

Text and documentation in this repository are released under the terms in LICENSE. The figures in assets/ are reproduced from the published article (© 2023 The Author(s), under licence to Springer Nature) and are included here solely to document and explain the authors' own work; all rights remain with the copyright holder.

About

A CNN-BiLSTM model with attention mechanism for earthquake prediction — The Journal of Supercomputing (2023) 79:19194–19226

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors