This repository contains the codebase for SeismicSense, a tool designed for detecting and analyzing earthquake events, focusing on P and S phase arrivals.
The model utilizes the STEAD Dataset, a curated dataset for seismic event detection.
- Preprocessing and Training
Start with theSeismicSense_preprocess_n_train.py
script:- Set
mode="prepare"
to preprocess the data. - Once preprocessing is complete, set
mode="train"
to train the model. - We have our custom layer to make the model run on MCU.
- Set
- Testing the Original Model
UseSeismicSense_test.py
to evaluate the trained model on the test set.
-
Quantize the Entire Model
UseSeismicSensequant.py
to quantize the trained model.- Test the quantized model with
SeismicSensequant_test.py
.
- Test the quantized model with
-
Split Models for Quantization
If you prefer to work with split models:- Use
Split.py
to split the model. - Quantize the split models using
SeismicSensequant_split.py
. - Test the quantized split models with
TestingSplit_quant.py
.
- Use
SeismicSense_preprocess_n_train.py
: Handles data preparation and model training.SeismicSense_test.py
: Tests the original trained model.SeismicSensequant.py
: Quantizes the entire model.SeismicSensequant_test.py
: Tests the fully quantized model.Split.py
: Splits the model into parts for modular handling.SeismicSensequant_split.py
: Quantizes the split models.TestingSplit_quant.py
: Tests the quantized split models.
- Clone this repository:
git clone <repo_url> cd <repo_name>
- Install the required dependencies:
pip install -r requirements.txt
- Follow the workflow steps above for your use case.
The STEAD Dataset: STEAD GitHub Repository