Coder Social home page Coder Social logo

tum-lmf / fieldrnn Goto Github PK

View Code? Open in Web Editor NEW
40.0 7.0 17.0 3.06 MB

Temporal Vegetation Classification with Recurrent Neural Networks

License: MIT License

Python 3.88% Jupyter Notebook 96.10% Shell 0.02%
lstm rnn tensorflow cvpr2017 vegetation-dynamics classification earthvision2017

fieldrnn's Introduction

Recurrent Neural Networks for Multitemporal Crop Identification

Source code of Rußwurm & Körner (2017) at EARTHVISION 2017

When you use this code please cite

Rußwurm M., Körner M. (2017). Temporal Vegetation Modelling using Long Short-Term Memory Networks
for Crop Identification from Medium-Resolution Multi-Spectral Satellite Images. In Proceedings of the
IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, 2017.

Tensorflow Graphs

The TensorFlow graphs for recurrent and convolutional networks are defined at rnn_model.py and cnn_model.py.

Installation

Requirements

A complete package list at requirements.txt

Please Note: Due to changes in the tf.nn.rnn_cell.MultiRNN class in Tensorflow 1.2.0 the current code is not compatible with TF version 1.2.0

Installation
# clone this repository
git clone https://github.com/TUM-LMF/fieldRNN.git
cd fieldRNN

# download body of data to execute train.py and evaluate.py (~5 GB)
sh download_data.sh

# download tf checkpoints and svm baseline to run cvprwsevaluation.ipynb (~50 GB)
sh download_models.sh

The data is hosted at mediaTUM.

Network Training

The training is performed on train data, either from the database directly. The test (also referred to as validation) data is used logged in Tensorflow event files.

$ python train.py --help
positional arguments:
  layers                number of layers
  cells                 number of rnn cells, as multiple of 55
  dropout               dropout keep probability
  fold                  select training/evaluation fold to use
  maxepoch              maximum epochs

For instance:

python train.py 4 2 0.5 0 30 --gpu 0 --model lstm --savedir save

tensorflow checkpoint and eventfiles of this call will be stored at save/lstm/4l2r50d0f

Model Evaluation

The script evaluate.py evaluates one model based on evaluation data.

python evaluate.py models/lstm/2l4r50d9f

The latest checkpoint of one model is restored and the entire body of evaluation data is processed. After the evaluation process eval_targets.npy, eval_probabilities.npy and eval_observations.npy are stores in the save directory. These files are later used for calculation of accuracy metrics by cvprwsevaluation.ipynb

Support Vector Machine baseline

Support Vector Machine for baseline evaluation is based on scikit-learn framework

The script svm.py performes the gridsearch. The generated files svm/scores.npy, svm/targets.npy, svm/predicted.npy are needed for cvprwsevaluation.ipynb

Earthvision 2017 Evaluation

The (complete, but untidy) evaluation of plots and accuracy metrics can be founds at cvprwsevaluation.ipynb

Data

download train and test datasets of the first fold and the evaluation dataset via

sh download_data.sh

data required for train.py and evaluate.py

The data is stored as pickle files with dimensions raster data x as [batchsize, observations, features] labels y as [batchsize, observations, features]

Models

models required for cvprwsevaluation.ipynb

Resulting model checkpoints from the grid search can be downloaded (50 GB!) via

sh download_models.sh
naming scheme

4l5r50d5f represents 4 layers, x5 rnn_cells, 50% dropout keep probability, and fold 5

fieldrnn's People

Contributors

marccoru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fieldrnn's Issues

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.