This repository provides the official PyTorch implementation of our paper "Short-Term Earthquake Forecasting via Self-Supervised Learning".
- Linux
- NVIDIA GPU + CUDA CuDNN
- python 3.7.16
- cudatoolkit 11.1.1
- torch 1.13.1
- torchvision 0.9.0
- numpy 1.21.5
- scikit-learn 1.0.2
-
Download the preprocessed test set and put it in the
datasets/
directory. -
Download the pre-trained model and put it in the
results/
directory. -
To do the quick test, run:
python downstream_test.py
-
Download AETA dataset and earthquake catalog.
-
All downloaded electromagnetic data are stored in the
datasets/
directory, comprising 159 CSV files. Each file within this directory contains the electromagnetic data from a single observation station.
-
The data preprocessing includes several crucial steps: station selection, data cleaning, missing data imputation, data normalization, and dataset construction.
-
Perform data preprocessing using the following script.
cd data_preporcessing
bash magn.sh
-
We design the prediction task as a pretext task, leveraging the past week's observational data to predict the coming week's data.
-
To do the pretext prediction task on a large-scale dataset composed of all samples, run:
cd scripts
bash pre.sh
-
We set the classification task as a downstream task, focusing on whether a major earthquake occurs in the coming week.
-
To do the downstream classification task on a small-scale yet balanced dataset built through undersampling, run:
cd scripts
bash cls.sh