{"id":25284634,"url":"https://github.com/cahya-wirawan/phase-classification","last_synced_at":"2026-05-04T13:34:17.980Z","repository":{"id":38803301,"uuid":"119407522","full_name":"cahya-wirawan/phase-classification","owner":"cahya-wirawan","description":"Seismic Phase Classification","archived":false,"fork":false,"pushed_at":"2022-12-08T00:54:06.000Z","size":8730,"stargazers_count":2,"open_issues_count":7,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-04T10:46:38.615Z","etag":null,"topics":["keras","machine-learning","python","seismic","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/cahya-wirawan.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}},"created_at":"2018-01-29T16:18:14.000Z","updated_at":"2021-02-04T04:49:04.000Z","dependencies_parsed_at":"2022-09-12T01:51:24.418Z","dependency_job_id":null,"html_url":"https://github.com/cahya-wirawan/phase-classification","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cahya-wirawan/phase-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cahya-wirawan%2Fphase-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cahya-wirawan%2Fphase-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cahya-wirawan%2Fphase-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cahya-wirawan%2Fphase-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cahya-wirawan","download_url":"https://codeload.github.com/cahya-wirawan/phase-classification/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cahya-wirawan%2Fphase-classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32609809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["keras","machine-learning","python","seismic","tensorflow"],"created_at":"2025-02-12T20:52:11.498Z","updated_at":"2026-05-04T13:34:17.950Z","avatar_url":"https://github.com/cahya-wirawan.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Seismic Phase Classification\n\nThis project is an attempt to apply deep learning on seismic phase classification. \n\n## The Datasets\nThe project uses an internal dataset (not included in this repo) collected from two seismic stations LPAZ \nand URZ from the last several years (?). It contains 776155 entries and 16 features. The dataset  \nml_feature_bck2.csv is a dump of database table ml_feature_bck2, which is created/collected by Radek Hofman.\nFurthermore, it is splited using the python script phase_splitter.py into two files (ml_feature_bck2_train.csv \nand ml_feature_bck2_test.csv) for training (and validation) dataset and test dataset. The test dataset \ncontains following entries\n\n|  Station and Phase | #Entries    |\n| ------------------ |  ----------:|\n|  LPAZ P-Phase      |   300       |\n|  LPAZ S-Phase      |   120       |\n|  LPAZ T-Phase      |   200       |\n|  LPAZ Noise        |   500       |\n|  URZ P-Phase       |   300       |\n|  URZ S-Phase       |   120       |\n|  URZ T-Phase       |   200       |\n|  URZ Noise         |   500       |\n\n\n## Datasets Visualization\nt-Distributed Stochastic Neighbor Embedding (t-SNE) is used to reduce the dimensionality of the dataset\nand visualize it in 2D graph [Jupyter notebook's phase_tSNE](https://github.com/cahya-wirawan/phase-classification/blob/master/phase_tsne.ipynb) . \n![16D Phases in 2D](https://github.com/cahya-wirawan/phase-classification/blob/master/images/4Phases-tSNE.jpg)\n\n## The Application\n\n### phase_classification.py\nThis is the main application for the training and testing. The deep learning model is implemented using Keras \nwith Tensorflow as backend. Keras is used intead of Tensorflow directly to simplify the prototyping. The training will \ngenerate a weight and model files: phase_weights_best_\u0026lt;station name\u0026gt;.hdf5 and \nphase_model_best_\u0026lt;station name\u0026gt;.hdf5 in \"results\" directory which will be used later for testing purpose.\n\n### Usage\n\n* List of all possible commands:\n```\n$ python phase_classification.py -h                                                                                      \nUsing TensorFlow backend.                                                                                                                                  \nusage: phase_classification.py [-h] [-a {train,test}]                                                                                                      \n                               [--train_dataset TRAIN_DATASET]                                                                                             \n                               [--test_dataset TEST_DATASET] [-e EPOCHS]                                                                                   \n                               [-l LAYERS] [-d DROPOUT] [-s STATION]                                                                                       \n                               [-v VERBOSE] [-P P] [-S S] [-T T] [-N N]                                                                                    \n                                                                                                                                                           \noptional arguments:                                                                                                                                        \n  -h, --help            show this help message and exit                                                                                                    \n  -a {train,test}, --action {train,test}                                                                                                                   \n                        set the action, either training or test the dataset                                                                                \n                        (default: train)                                                                                                                   \n  --train_dataset TRAIN_DATASET                                                                                                                            \n                        set the path to the training dataset (default:                                                                                     \n                        data/phase/ml_feature_bck2_train.csv)                                                                                              \n  --test_dataset TEST_DATASET                                                                                                                              \n                        set the path to the test dataset (default:                                                                                         \n                        data/phase/ml_feature_bck2_test.csv)                                                                                               \n  -e EPOCHS, --epochs EPOCHS                                                                                                                               \n                        set the epochs number) (default: 2000)                                                                                             \n  -l LAYERS, --layers LAYERS                                                                                                                               \n                        set the hidden layers) (default: 128 128 64 48 48 32                                                                               \n                        32 48 32 16)                                                                                                                       \n  -d DROPOUT, --dropout DROPOUT                                                                                                                            \n                        set the dropout) (default: 0.1)                                                                                                    \n  -s STATION, --station STATION                                                                                                                            \n                        set the station name, it supports currently only LPAZ,                                                                             \n                        URZ and ALL (default: ALL)                                                                                                         \n  -v VERBOSE, --verbose VERBOSE                                                                                                                            \n                        set the verbosity) (default: 0)                                                                                                    \n  -P P                  set the number of entries of P to be read from the                                                                                 \n                        dataset) (default: 6000)                                                                                                           \n  -S S                  set the number of entries of S to be read from the                                                                                 \n                        dataset) (default: 3000)                                                                                                           \n  -T T                  set the number of entries of T to be read from the                                                                                 \n                        dataset) (default: 8000)                                                                                                           \n  -N N                  set the number of entries of N to be read from the                                                                                 \n                        dataset) (default: 10000)                \n```\n\n* Training (the default model uses 11 hidden layers \"128 128 64 48 48 32 32 48 32 16\" and 2000 epochs):\n```\n$ python phase_classification.py\nUsing TensorFlow backend.\nN: 10000 entries\nP: 6000 entries\nS: 3000 entries\nT: 8000 entries\nSummary: 27000 entries\n/home/cahya/.virtualenvs/phase/lib/python3.5/site-packages/sklearn/base.py:115: DeprecationWarning: Estimator KerasClassifier modifies parameters in __init__. This behavior is deprecated as of 0.18 and support for this behavior will be removed in 0.20.\n  % type(estimator).__name__, DeprecationWarning)\n2018-02-01 12:01:20.894296: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA\n2018-02-01 12:01:21.017779: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:895] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n2018-02-01 12:01:21.019589: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1105] Found device 0 with properties: \nname: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.8855\npciBusID: 0000:28:00.0\ntotalMemory: 7.92GiB freeMemory: 7.34GiB\n2018-02-01 12:01:21.019611: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1195] Creating TensorFlow device (/device:GPU:0) -\u003e (device: 0, name: GeForce GTX 1080, pci bus id: 0000:28:00.0, compute capability: 6.1)\n...\nBaseline: 70.54% (1.90%)\n\n```\n* Training using only 3 hidden layers \"4 4 4\", dropout of 0.3 and 10 epochs:\n```\n$ python phase_classification.py -l \"4 4 4\" -d 0.3 -e 10\n...\nBaseline: 37.60% (4.20%)\n```\n* Testing :\n```\n$ python phase_classification.py -a test\nUsing TensorFlow backend.\nN: 1000 entries\nP: 600 entries\nS: 240 entries\nT: 400 entries\nSummary: 2240 entries\n2018-02-06 12:16:26.875535: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA\n2018-02-06 12:16:26.998599: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:895] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n2018-02-06 12:16:26.998962: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1105] Found device 0 with properties: \nname: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.8855\npciBusID: 0000:28:00.0\ntotalMemory: 7.92GiB freeMemory: 7.34GiB\n2018-02-06 12:16:26.998977: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1195] Creating TensorFlow device (/device:GPU:0) -\u003e (device: 0, name: GeForce GTX 1080, pci bus id: 0000:28:00.0, compute capability: 6.1)\nLoaded model from disk\nacc: 70.54%\nConfusion matrix:\n              P     S     T     N \n        P 413.0   1.0 126.0  60.0 \n        S   9.0 121.0  33.0  77.0 \n        T  73.0  39.0 228.0  60.0 \n        N  47.0  67.0  68.0 818.0 \n```\n## Test Comparison\n\nFollowing is the accuracy comparison among difference weights against difference test dataset:\n\n|  Weight\\Station |  S-LPAZ   |  S-URZ   |  S-ALL   |\n| --------------- | ---------:|---------:| --------:|\n| W-LPAZ          |   73.12%  |  58.13%  |  65.62%  |\n| W-URZ           |   56.96%  |  71.88%  |  64.42%  |\n| W-ALL           |   70.00%  |  71.07%  |  70.54%  |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcahya-wirawan%2Fphase-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcahya-wirawan%2Fphase-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcahya-wirawan%2Fphase-classification/lists"}