Code Monkey home page Code Monkey logo

streamline_detection's Introduction

The hydrological streamline detection using an attention U-net model

Data description: Training, validation, and testing dataset (LiDAR derived feature maps), scripts, pretrained models, and prediction results for the hydrological streamline detection of Rowan Creek, NC, watershed area. The dataset is generated and provided by USGS (author: Larry Stanislawski ([email protected]) and Ethan Shavers ([email protected])). Contents:

  • data.zip:

    • mask.npy: The mask of research area. 1 indicates research area. 0 indicates outside area.
    • reference.npy: numpy array format of reference data. 1 indicates streamlines, 0 indicates non-streamlines
    • prediction_data.npy: The prediction data of research area
    • train*.npy: training data with data augmentation.
    • vali*.npy: validation data for model tuning.
    • trainlabel.npy: the labels for training data.
    • valilabel.npy: the labels for validation data.
  • script:

    • train_U_net.py: training script of the U_net model for streamline detection.
    • train_attention_U_net.py: training script of the attention U_net model for streamline detection.
    • accuracy_evaluation.py: accuracy evaluation for the prediction results.
    • generate_resultant_tifs.py: convert result to geo-referenced .tiffs.
  • result (files to be saved in):

    • *.pickle: stores the intermediate training statistics and printouts.
    • preds_test_*.npy: predicted results orginzed as patches.
    • preds_test_*.tif: Organized.tiffs of predicted results.
  • models (files to be saved in):

    • *.h5: stores the trained model.

Environment: Python3.7 Library dependencies: cuda10.0, pdal 1.2, sklearn 0.18.1, keras 2.0, tensorflow 1.0, osgeo(gdal) 3.0.4.

Steps:

  1. Download the data from https://doi.org/10.6084/m9.figshare.12584975.v1, unzip, and put it in the same directory as models, scripts, and result folders.
  2. Run train_U_net.py or train_attention_U_net.py for model training by specifying the input directory and training scenario ('up','down','left', or 'right').
  3. Run generate_resultant_tifs.py to transfer predicted results to geo-referenced tiffs.
  4. Run accuracy_evaluation.py to generate the evaluation statistics of the four scenarios' prediction maps using the U-net (0) or the attention U-net model(1).

Note: 1. If you don't want to train from scratch, you can simply download the pretrained model from: https://doi.org/10.6084/m9.figshare.12587318.v1, unzip it in the models folder, and load the pretrained models to generate your predictions. 2. You can also directly download, unzip, and visualize the generated prediction maps from: https://doi.org/10.6084/m9.figshare.12587324.v1.

Publication:

streamline_detection's People

Contributors

zeweixu avatar stephencuinujia avatar

Watchers

James Cloos avatar Nattapon Jaroenchai avatar Furqan Baig avatar  avatar  avatar  avatar

Forkers

zeweixu

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.