{"id":27440187,"url":"https://github.com/senli1073/seist","last_synced_at":"2025-04-14T22:02:37.047Z","repository":{"id":198977056,"uuid":"701683537","full_name":"senli1073/SeisT","owner":"senli1073","description":"[TGRS] SeisT: A Foundational Deep-Learning Model for Earthquake Monitoring Tasks","archived":false,"fork":false,"pushed_at":"2024-11-20T05:48:09.000Z","size":25534,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T10:04:52.338Z","etag":null,"topics":["baz-azimuth","deep-learning","distributed-training","earthquake-detection","epicentral-distance","first-motion-polarity","foundation","magnitude","phase-picking","pytorch","seismogram","seismology","transformer"],"latest_commit_sha":null,"homepage":"https://doi.org/10.1109/TGRS.2024.3371503","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/senli1073.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-07T09:02:28.000Z","updated_at":"2025-03-19T07:07:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"5638330e-c6b1-43c4-9516-aae3bc16fd2f","html_url":"https://github.com/senli1073/SeisT","commit_stats":null,"previous_names":["senli1073/seist"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senli1073%2FSeisT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senli1073%2FSeisT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senli1073%2FSeisT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senli1073%2FSeisT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/senli1073","download_url":"https://codeload.github.com/senli1073/SeisT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968740,"owners_count":21191158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baz-azimuth","deep-learning","distributed-training","earthquake-detection","epicentral-distance","first-motion-polarity","foundation","magnitude","phase-picking","pytorch","seismogram","seismology","transformer"],"created_at":"2025-04-14T22:02:36.551Z","updated_at":"2025-04-14T22:02:37.020Z","avatar_url":"https://github.com/senli1073.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n[![TGRS](https://img.shields.io/badge/IEEE_TGRS_(2024)-5908215-blue)](https://doi.org/10.1109/TGRS.2024.3371503)\n[![arXiv](https://img.shields.io/badge/arXiv-2310.01037-b31b1b)](https://arxiv.org/abs/2310.01037)\n![License](https://img.shields.io/github/license/senli1073/SeisT)\n![LastCommit](https://img.shields.io/github/last-commit/senli1073/SeisT)\n------------------\n\n- [SeisT Architecture](#seist-architecture)\n- [Introduction](#introduction)\n- [Usage](#usage)\n  - [Data preparation](#data-preparation)\n  - [Training](#training)\n  - [Fine-tuning](#fine-tuning)\n  - [Testing](#testing)\n- [Citation](#citation)\n- [Reporting Bugs](#reporting-bugs)\n- [Acknowledgement](#acknowledgement)\n- [License](#license)\n\n## SeisT Architecture\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/senli1073/SeisT/main/images/SeisT_Architecture.png\"\u003e\n\u003c/p\u003e\n\n## Introduction\nSeisT is a backbone for seismic signal processing, which can be used for multiple seismic monitoring tasks such as earthquake detection, seismic phase picking, first-motion polarity classification, magnitude estimation, back-azimuth estimation, and epicentral distance estimation.\n\nThis repository also provides some baseline models implemented by Pytorch under `./models`, such as PhaseNet, EQTransformer, DitingMotion, MagNet, BAZ-Network, and distPT-Network. \n\nNOTE: The model weights included in this repository serve as the basis for performance evaluation in the paper. They have been evaluated using identical training/testing data and a consistent training strategy, thereby affirming the effectiveness of SeisT. Nevertheless, if you intend to employ these models in practical engineering applications, it is crucial to retrain the SeisT models with larger datasets to align with the specific demands of engineering applications.\n\n## Usage\n\n### Data Preparation\n\n- **For training and evaluation**\n  \n  Create a new file named `yourdata.py` in the directory `dataset/` to read the metadata and seismograms of the dataset. Then the `@register_dataset` decorator needs to be used to register your dataset. \n\n  (Please refer to the code samples, such as `datasets/DiTing.py` and `datasets/PNW.py`)\n\n- **For model deployment**\n\n  Follow the steps in `demo_predict.py` and rewrite the `load_data` function.\n\n### Training\n\n- **Model**\u003cbr/\u003e\n  Before starting training, please make sure that your model file is in the directory `models/` and is registered by using `@register_model`. The  available models in the project can be inspected using the following method: \n  ```Python\n  \u003e\u003e\u003e from models import get_model_list\n  \u003e\u003e\u003e get_model_list()\n  ['eqtransformer', 'phasenet', 'magnet', 'baz_network', 'distpt_network', 'ditingmotion', 'seist_s_dpk', 'seist_m_dpk', 'seist_l_dpk', 'seist_s_pmp', 'seist_m_pmp', 'seist_l_pmp', 'seist_s_emg', 'seist_m_emg', 'seist_l_emg', 'seist_s_baz', 'seist_m_baz', 'seist_l_baz', 'seist_s_dis', 'seist_m_dis', 'seist_l_dis']\n  ```\n  The task names and their abbreviations in this project are shown in the table below:\n\n  \u003ctable\u003e\u003ctbody\u003e\n\n  \u003cth valign=\"bottom\"\u003eTask\u003c/th\u003e\n  \u003cth valign=\"bottom\"\u003eAbbreviation\u003c/th\u003e\n\n  \u003ctr\u003e\u003ctd align=\"left\"\u003eDetection \u0026 Phase Picking\u003c/td\u003e\n  \u003ctd align=\"left\"\u003edpk\u003c/td\u003e\n\n  \u003ctr\u003e\u003ctd align=\"left\"\u003eFirst-Motion Polarity Classification\u003c/td\u003e\n  \u003ctd align=\"left\"\u003epmp\u003c/td\u003e\n\n  \u003ctr\u003e\u003ctd align=\"left\"\u003eBack-Azimuth Estimation\u003c/td\u003e\n  \u003ctd align=\"left\"\u003ebaz\u003c/td\u003e\n\n  \u003ctr\u003e\u003ctd align=\"left\"\u003eMagnitude Estimation\u003c/td\u003e\n  \u003ctd align=\"left\"\u003eemg\u003c/td\u003e\n\n  \u003ctr\u003e\u003ctd align=\"left\"\u003eEpicentral Distance Estimation\u003c/td\u003e\n  \u003ctd align=\"left\"\u003edis\u003c/td\u003e\n\n  \u003c/tbody\u003e\u003c/table\u003e\n\n- **Model Configuration**\u003cbr/\u003e\n  The configurations of the loss functions, labels, and the corresponding models are in `config.py` which also provides a detailed explanation of all the fields.\n\n\n- **Start training**\u003cbr/\u003e\n  To start training with a CPU or a single GPU, please use the following command to start training:\n  ```Shell\n  python main.py \\\n    --seed 0 \\\n    --mode \"train_test\" \\\n    --model-name \"seist_m_dpk\" \\\n    --log-base \"./logs\" \\\n    --device \"cuda:0\" \\\n    --data \"/root/data/Datasets/Diting50hz\" \\\n    --dataset-name \"diting\" \\\n    --data-split true \\\n    --train-size 0.8 \\\n    --val-size 0.1 \\\n    --shuffle true \\\n    --workers 8 \\\n    --in-samples 8192 \\\n    --augmentation true \\\n    --epochs 200 \\\n    --patience 30 \\\n    --batch-size 500\n  ```\n  \n  To start training with multiple GPUs, please use `torchrun` to start training:\n  ```Shell\n  torchrun \\\n    --nnodes 1 \\\n    --nproc_per_node 2 \\\n    main.py \\\n      --seed 0 \\\n      --mode \"train_test\" \\\n      --model-name \"seist_m_dpk\" \\\n      --log-base \"./logs\" \\\n      --data \"/root/data/Datasets/Diting50hz\" \\\n      --dataset-name \"diting\" \\\n      --data-split true \\\n      --train-size 0.8 \\\n      --val-size 0.1 \\\n      --shuffle true \\\n      --workers 8 \\\n      --in-samples 8192 \\\n      --augmentation true \\\n      --epochs 200 \\\n      --patience 30 \\\n      --batch-size 500\n  ```\n  \n  There are also a variety of other custom arguments which are not mentioned above. Use the command `python main.py --help` to see more details.\n\n  \n### Fine-tuning\n\nThe following table provides the pre-trained checkpoints used in the paper:\n\u003ctable\u003e\u003ctbody\u003e\n\n\u003cth valign=\"bottom\"\u003eTask\u003c/th\u003e\n\u003cth valign=\"bottom\"\u003eTrain set\u003c/th\u003e\n\u003cth valign=\"bottom\"\u003eSeisT-S\u003c/th\u003e\n\u003cth valign=\"bottom\"\u003eSeisT-M\u003c/th\u003e\n\u003cth valign=\"bottom\"\u003eSeisT-L\u003c/th\u003e\n\n\n\u003ctr\u003e\u003ctd align=\"left\"\u003eDetection \u0026 Phase Picking\u003c/td\u003e\n\u003ctd align=\"left\"\u003eDiTing\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_s_dpk_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_m_dpk_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_l_dpk_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\n\u003ctr\u003e\u003ctd align=\"left\"\u003eFirst-Motion Polarity Classification\u003c/td\u003e\n\u003ctd align=\"left\"\u003eDiTing\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_s_pmp_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_m_pmp_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_l_pmp_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\n\u003ctr\u003e\u003ctd align=\"left\"\u003eBack-Azimuth Estimation\u003c/td\u003e\n\u003ctd align=\"left\"\u003eDiTing\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_s_baz_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_m_baz_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_l_baz_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\n\u003ctr\u003e\u003ctd align=\"left\"\u003eMagnitude Estimation\u003c/td\u003e\n\u003ctd align=\"left\"\u003eDiTing\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_s_emg_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_m_emg_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_l_emg_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\n\u003ctr\u003e\u003ctd align=\"left\"\u003eMagnitude Estimation\u003c/td\u003e\n\u003ctd align=\"left\"\u003ePNW\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_s_emg_pnw.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_m_emg_pnw.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_l_emg_pnw.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\n\u003ctr\u003e\u003ctd align=\"left\"\u003eEpicentral Distance Estimation\u003c/td\u003e\n\u003ctd align=\"left\"\u003eDiTing\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_s_dis_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_m_dis_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://raw.githubusercontent.com/senli1073/SeisT/main/pretrained/seist_l_dis_diting.pth\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\n\u003c/tbody\u003e\u003c/table\u003e\n\nUse the \"--checkpoint\" argument to pass in the path of the pre-training weights.\n\n### Testing\n  To start training with a CPU or a single GPU, please use the following command to start testing:\n\n  ```Shell\n  python main.py \\\n    --seed 0 \\\n    --mode \"test\" \\\n    --model-name \"seist_m_dpk\" \\\n    --log-base \"./logs\" \\\n    --device \"cuda:0\" \\\n    --data \"/root/data/Datasets/Diting50hz\" \\\n    --dataset-name \"diting\" \\\n    --data-split true \\\n    --train-size 0.8 \\\n    --val-size 0.1 \\\n    --workers 8 \\\n    --in-samples 8192 \\\n    --batch-size 500\n  ```\n  \n  To start training with multiple GPUs, please use `torchrun` to start testing:\n  ```Shell\n  torchrun \\\n    --nnodes 1 \\\n    --nproc_per_node 2 \\\n    main.py \\\n      --seed 0 \\\n      --mode \"test\" \\\n      --model-name \"seist_m_dpk\" \\\n      --log-base \"./logs\" \\\n      --data \"/root/data/Datasets/Diting50hz\" \\\n      --dataset-name \"diting\" \\\n      --data-split true \\\n      --train-size 0.8 \\\n      --val-size 0.1 \\\n      --workers 8 \\\n      --in-samples 8192 \\\n      --batch-size 500\n  ```\n\n  It should be noted that the `train_size`, `val_size`, and `seed` in the test phase must be consistent with that training phase. Otherwise, the test results may be distorted.\n\n## Citation\n\nPaper: https://doi.org/10.1109/TGRS.2024.3371503\n\nIf you find this repo useful in your research, please consider citing:\n\n```\n@ARTICLE{10453976,\n  author={Li, Sen and Yang, Xu and Cao, Anye and Wang, Changbin and Liu, Yaoqi and Liu, Yapeng and Niu, Qiang},\n  journal={IEEE Transactions on Geoscience and Remote Sensing}, \n  title={SeisT: A Foundational Deep-Learning Model for Earthquake Monitoring Tasks}, \n  year={2024},\n  volume={62},\n  pages={1-15},\n  doi={10.1109/TGRS.2024.3371503}\n}\n```\n\nThe baseline models used in this paper:\n\n- **PhaseNet**\u003cbr/\u003e\n  *Zhu, W., \u0026 Beroza, G. C. (2019). PhaseNet: A deep-neural-network-based seismic arrival-time picking method. Geophysical Journal International, 216(1), 261-273.*\n\n- **EQTransformer**\u003cbr/\u003e\n  *Mousavi, S. M., Ellsworth, W. L., Zhu, W., Chuang, L. Y., \u0026 Beroza, G. C. (2020). Earthquake transformer—an attentive deep-learning model for simultaneous earthquake detection and phase picking. Nature communications, 11(1), 3952.*\n\n- **DiTingMotion**\u003cbr/\u003e\n  *Zhao, M., Xiao, Z., Zhang, M., Yang, Y., Tang, L., \u0026 Chen, S. (2023). DiTingMotion: A deep-learning first-motion-polarity classifier and its application to focal mechanism inversion. Frontiers in Earth Science, 11, 1103914.*\n\n- **MagNet**\u003cbr/\u003e\n  *Mousavi, S. M., \u0026 Beroza, G. C. (2020). A machine‐learning approach for earthquake magnitude estimation. Geophysical Research Letters, 47(1), e2019GL085976.*\n\n- **BAZ-Network** \u003cbr/\u003e\n  *Mousavi, S. M., \u0026 Beroza, G. C. (2020). Bayesian-Deep-Learning Estimation of Earthquake Location From Single-Station Observations. IEEE Transactions on Geoscience and Remote Sensing, 58(11), 8211-8224.*\n\n\n## Reporting Bugs\nReport bugs at https://github.com/senli1073/SeisT/issues.\n\nIf you are reporting a bug, please include:\n\n- Operating system version.\n- Versions of Python and libraries such as Pytorch.\n- Steps to reproduce the bug.\n\n\n## Acknowledgement\nThis project refers to some excellent open source projects: [PhaseNet](https://github.com/AI4EPS/PhaseNet), [EQTransformer](https://github.com/smousavi05/EQTransformer), [DiTing-FOCALFLOW](https://github.com/mingzhaochina/DiTing-FOCALFLOW), [MagNet](https://github.com/smousavi05/MagNet), [Deep-Bays-Loc](https://github.com/smousavi05/Deep-Bays-Loc), [PNW-ML](https://github.com/niyiyu/PNW-ML), and [SeisBench](https://github.com/seisbench/seisbench).\n\n\n## License\nCopyright S.Li et al. 2023. Licensed under an MIT license.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenli1073%2Fseist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsenli1073%2Fseist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenli1073%2Fseist/lists"}