Skip to content

zhenglab/SSL-EF

Repository files navigation

SSL-EF

This repository provides the official PyTorch implementation of our paper "Short-Term Earthquake Forecasting via Self-Supervised Learning".

Prerequisites

  • 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

Quick Example

  • 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

Datasets

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

Data Preprocessing

  • 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

Pretext Task

  • 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

Downstream Task

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published