Giter Club home page Giter Club logo

unet_cea's Introduction

unet_cea

Using Unet to train model based on wenchuan aftershocks and automatically detect p,s phases

This is the unet code used in the paper: 赵明,陈石,房立华,David A Yuen. 2019. 基于U形全卷积神经网络的震相识别与到时拾取方法研究. 地球物理学报,待刊.

And,it is developed from ConvNetQuake : Perol., T, M. Gharbi and M. Denolle. Convolutional Neural Network for Earthquake detection and location. preprint arXiv:1702.02073, 2017.

The u-net structure

The u-net

The example of labeled sample:

labeled sample

Some detect results

Detections

Some train snapshots

snapshots

Installation

  • export PYTHONPATH=pwd:$PYTHONPATH

  • Install dependencies: conda env create -f unet_cea.yaml

create dataset

First you need a phase file for doing such thing:

./bin/create_dataset_events_unet.py --stream_dir waveform --catalog ps_picks_capital.csv --output_dir train_30s_unet --plot True --window_size 30

the ps_picks_capital.csv has a format like this:

,ev_dir,ev_id,ev_start,p_pick,s_pick,stname,time_diff,utc_timestamp,utc_timestamp_s

0,HE.200901010316.0001,1,2009-01-01T03:16:45.759000Z,2009-01-01T03:16:49.219000Z,2009-01-01T03:16:50.599000Z,CC.XBZ,1.3799998760223389,1230751009.219,1230751010.599

1,HE.200901010316.0001,1,2009-01-01T03:16:45.759000Z,2009-01-01T03:16:51.779000Z,2009-01-01T03:16:56.459000Z,BU.LQS,4.680000066757202,1230751011.779,1230751016.459

2,HE.200901010316.0001,1,2009-01-01T03:16:45.759000Z,2009-01-01T03:16:52.129000Z,2009-01-01T03:16:55.599000Z,BJ.SSL,3.4700000286102295,1230751012.129,1230751015.599

....................................................................................................................................................................

Train(just a small data to show the code really work ^_^)

python ./bin/unet_train.py --tfrecords_dir data/train/ --checkpoint_dir model

validate

python ./bin/unet_eval.py --tfrecords_dir data/test --checkpoint_path output/unet_capital/ --batch_size 1000 --output_dir output/unet --events

Tensorboard for real-time monitor

tensorboard --logdir model

Trained model

An trained model on Chinese Metropolitian Network(178 stations,266350 samples),thanks to Hebei Earthquake Administration for providing the catalogs and high accuracy manual picks

The directory unet_capital

Use new test data(not used in the train and validate process) to check the preformance of the model:

python ./bin/unet_eval_from_tfrecords.py --tfrecords_dir detection --checkpoint_path ./unet_capital/unet.ckpt-585000 --batch_size 8 --output_dir output

or you can test with your own data (mseed)

可以直接用以下程序,载入你自己的mseed格式波形,进行实时检测

python ./bin/unet_eval_from_stream.py --stream_path ./mseed/ --checkpoint_path unet_capital/unet.ckpt-590000 --batch_size 8 --output_dir output/predict_from_stream --plot

(more to come)

unet_cea's People

Contributors

mingzhaochina avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.