Home

Awesome

CrowdQuake: A Networked System of Low-Cost Sensors for Earthquake Detection via Deep Learning

<!---This is a Python3 implementation of Convolutional Recurrent Neural Networks for the task of binary classification of seismic detection, as described in our paper.-->

Overview

Here we provide the implementation of Artificial Neural Network (ANN) and Convolutional Recurrent Neural Network (CRNN) used in our paper in ACM KDD 2020.

<!---[![](https://img.shields.io/badge/Source-Download-yellow)](https://drive.google.com/drive/folders/1lgtYs1o59uzAUAv_W9FE4xAI2_wCuB5J?usp=sharing)-->

The repository is organised as follows:

Requirements

<!---numpy==1.16.1--> <!---pandas=0.24.1--> <!---obspy==1.1.1--> <!---scikit-learn==0.21.2--> <!---tensorflow-gpu==1.14--> <!---Keras==2.2.4--> <!---matplotlib==3.0.3-->

$ pip install -r requirements.txt

In addition, CUDA 10.0 and cuDNN 7.4 have been used.

Dataset

The dataset contains two classes of three-component time-series acceleration waveforms:

  1. Earthquake: Download from National Research Institute for Earth Science and Disaster Resilience (NIED).

Note: In our paper, we use two earthquake datasets.

  1. 2299 K-NET records of Japan earthquakes from Jan. 1st 1996 to May 31th 2019, each of whose x-axis component peak ground acceleration (PGA) is greater than 0.1 gravity (g).
  2. 8973 K-NET records of Japan earthquakes from Jan. 1st 1996 to May 31th 2019, each of whose x-axis component PGA is greater than 0.05 g.

To download the earthquake data for reproducing our results, please:

  • Visit NIED (registration is required to download data).
  • Select Download -- Data Download after Search for Data.
  • Set Network -- K-NET.
  • Set Peak acceleration -- from 100 to 10000 (i.e., > 0.1 g) or from 50 to 10000 (i.e., > 0.05 g).
  • Set Recording start time.
  • Click Submit, then select all records in Data List.
  • Click Download All Channels Data.
  • Notice that, due to the constraint of the website, only headmost 1200 data will be displayed in Data List. Please change the range of Recording start time, then repeat above procedures to download all data in batches.
  1. Non-Earthquake: Background noise of the low-cost sensors measured in several environments and various human activities recorded by our low-cost sensors.

You can also use your own dataset, but the dataset should contain three-component time-series acceleration signals.

Models

You can choose between the following models:

<!---* CNN-->

Running the code

  1. Download the data as described above.
  2. Run Code/Processing.py to process the raw data.
  3. Run Code/ANN.py or Codes/CRNN.py to train and test each model.
  4. Run Models/ANN_kfold.py or Models/CRNN_kfold.py for the k-fold cross validation for each model.
  5. Run Code/PerformanceMetrics.py to calculate the performance metrics.

Note:

  1. To reproduce our results, please download the same set of data as we used in the paper.
  2. For different test cases, please change the settings as described in each code file.
<!---## Cite--> <!---Please cite our paper if you use this code in your own work:-->