Giter VIP home page Giter VIP logo

attention-mechanism-unet's Introduction

MSc Data Science Dissertation/Project

An Attention-Based U-Net for Detecting Deforestation Within Satellite Sensor Imagery. https://www.sciencedirect.com/science/article/pii/S0303243422000113

Datasets

Amazon 1 (Regular 3-dim Dataset) -- https://zenodo.org/record/3233081

Amazon 2 (Larger 4-band Amazon and Atlantic Datasets) -- https://zenodo.org/record/4498086#.YMh3GfKSmCU

Files

  • dataset -- Folder of original dataset from Regular Dataset.
  • figures -- Figures for report (amazon-atlantic-forest-mapjpg.jpg from https://pubmed.ncbi.nlm.nih.gov/20433744/).
  • models -- Folder of each of the three types of Attention U-Net model; load into Keras using 'load_model([modelfilename])'.
  • metrics -- Folder of metrics (accuracy, precision, recall, F1-score) for each result.
  • Experimentation.ipynb -- Jupyter notebook of data processing, augmentation, model training and testing.
  • Figures.ipynb -- Jupyter notebook of figures found in figures.
  • predictor.py -- Takes any input RGB or 4-band image and outputs Attention U-Net-predicted deforestation mask to file.
  • preprocess-4band-amazon-data.py -- Python script to preprocess GeoTIFFs from 4-band Amazon Dataset and export as numpy pickles.
  • preprocess-4band-atlantic-forest-data.py -- Python script to preprocess GeoTIFFs from 4-band Atlantic Forest Dataset and export as numpy pickles.
  • preprocess-rgb-data.py -- Python script to preprocess data in RGB Dataset and export as numpy pickles.
  • requirements.txt -- Required Python libraries.

How to use

Obtaining Attention U-Net Deforestation Masks

  • Run pip -r requirements.txt to install libraries.
  • Download 'unet-attention-3d.hdf5', 'unet-attention-4d.hdf5' and 'unet-attention-4d-atlantic.hdf5' models, and place in same directory as script.
  • Run 'python predictor.py [MODEL IDENTIFIER] [INPUT IMAGE PATH]' or 'python3 predictor.py [MODEL IDENTIFIER] [INPUT IMAGE PATH]'.
    • Model identifier for RGB is 1, 4-band Amazon-trained is 2, 4-band Atlantic Forest-trained is 3.
    • e.g. Get mask prediction of image named 'test.tif' from 4-band Amazon model: 'python predictor.py 2 test.tif'.

Obtaining Pre-Processed Data

  • Run pip -r requirements.txt to install libraries.
  • Run 'preprocess-4band-amazon-data.py' to pre-process 4-band Amazon data.
  • Run 'preprocess-4band-atlantic-forest-data.py' to pre-process 4-band Atlantic Forest data.
  • Run 'preprocess-rgb-data.py' to pre-process RGB Amazon data.

attention-mechanism-unet's People

Contributors

davej23 avatar zhangce8880 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.