seismic earthquake license:apache-2.0 region:us
---
license: apache-2.0
metrics:
- mae
tags:
- seismic
- earthquake
---

# Model Card for PhaseHunter

<!-- Provide a quick summary of what the model is/does. -->

## Model Details

### Model Description

<!-- Provide a longer summary of what this model is. -->
PhaseHunter is a state-of-the-art deep learning model designed for the precise estimation and uncertainty quantification of seismic phase onset times. The tool is especially valuable in seismology, assisting in the accurate identification of P and S wave arrival times in seismic data, which is critical for earthquake detection and characterization.



- **Developed by:** Artemii Novoselov
- **Model type:** Deep Learning, Seismic Data Analysis
- **License:** Apache-2.0


## Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->

PhaseHunter is primarily used in seismic data analysis for detecting the arrival times of P and S waves, which are crucial in earthquake studies. It is suited for both academic and industrial research settings where accurate and efficient seismic phase picking is required. The tool's capacity for uncertainty quantification adds a layer of reliability to the analysis.

### Direct Use

<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->

PhaseHunter can be directly applied to raw seismic data to identify the precise onset times of seismic phases. This functionality is particularly beneficial for seismologists and researchers who are analyzing seismic events and require accurate phase picking.


### Out-of-Scope Use

<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->

PhaseHunter is specifically designed for seismic data analysis and may not be suitable for other types of time-series data analysis or applications outside seismology.


## Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

The performance of PhaseHunter is dependent on the quality and characteristics of the input seismic data. As such, it may not perform optimally on low-quality or noisy data. Users should be aware of these limitations and consider preprocessing steps to enhance data quality where necessary.

### Recommendations

<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->

Users are advised to familiarize themselves with the characteristics of seismic data and the specific requirements of PhaseHunter for optimal performance. It is also recommended to consult the accompanying documentation and literature for a deeper understanding of the tool's capabilities and limitations.

## How to Get Started with the Model

PhaseHunter is designed to be straightforward to use, even for those new to seismic data processing. Here's a step-by-step guide:

1. Load the Pre-trained Model:
First, import PhaseHunter
```python
import torch
from phasehunter.model import PhaseHunter
```

Then load the pre-trained PhaseHunter model from a checkpoint (if on Linux):

```python
# Auto select device, note that PhaseHunter works best on GPU
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

model = PhaseHunter.load_from_checkpoint('ckpts/30s_STEAD_decay-epoch=196.ckpt')
model = model.eval().to(device)
```

At this time, 2 pre-trained models are available:

* `ckpts/30s_STEAD_decay-epoch=196.ckpt` - 30s version of PhaseHunter trained on STEAD dataset for 200 epochs
* `ckpts/30s_ETHZ_decay-epoch=187.ckpt` - 30s version of PhaseHunter trained on ETHZ dataset for 200 epochs

2. Download or use your own waveform data, e.g.:

```python
from obspy import read
st = read('path_to_your_waveform_data')
predictions = model.process_continuous_waveform(st)
print(predictions)
```

`process_continuous_waveform` works with 3 channel Obspy streams of any length

## For a more comprehansive tutorial try PhaseHunter in Google Colab
<a target="_blank" href="https://colab.research.google.com/github/crimeacs/PhaseHunter/blob/main/notebooks/PhaseHunter_intro.ipynb">
  <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
</a>