Giter VIP home page Giter VIP logo

deep-transfer-learning-crop-prediction's Introduction

Deep Transfer Learning for Crop Yield Prediction with Remote Sensing Data

This project implements the deep learning architectures from You et al. 2017 and applies them to developing countries with significant agricultural productivity (Argentina, Brazil, India).

We also examine the efficacy of transfer learning of yield forecasting insights between adjoining countries; some results were published in the proceedings of COMPASS 2018. Our paper can be viewed here.

Contributers: Anna X Wang, Caelin Tran, Nikhil Desai, Professor David Lobell, Professor Stefano Ermon

Requirements

  • A Google Earth Engine account (for imagery retrieval)
  • A Google Cloud storage account (for image data storage and access)
  • A Google Cloud compute instance with python2 and GDAL

Instructions

For any of these scripts, python <script>.py -h will provide a CLI usage string with explanations of each parameter.

Instructions for creating a dataset

Steps marked with (#) should be done if the country of interest is not the US, India, Brazil, Argentina, or Ethiopia. See commit 9f7f43 in this repository for an example of adding a new country (Ethiopia).

  1. (#) Create a Google Earth Engine table from a shapefile of your new country's level2 boundaries.
  2. (#) Add your country to pull_modis.py configuration - you will need the identifier of the shapefile table in GEE, and also need to add instructions on how to extract relevant metadata (e.g. a human-readable name) from a feature in the shapefile. More detail are in the comments in pull_modis.py.
  3. Run pull_modis.py with country and imagery type to download imagery to a Google Cloud bucket
  4. Put satellite imagery into "sat" folder, temperature images into "temp" folder, cover images into "cover" folder
  5. Run histograms.py with the sat,temp,cover folders specified arguments - outputs to a "histograms" folder
  6. (#) Save a CSV containing yields for relevant set of regions, harvest years, and crop types. (TODO: more explanation of the yields CSV format)
  7. Run make_datasets.py with the "histograms" folder and yields CSV, along with relevant parameters for use in ML (train/test split, years to ignore or to use, etc) - creates a "dataset" folder containing numpy arrays which will be used by training/testing architecture

Instructions for training the model

  1. Run train_NN.py with a dataset name and neural net architecture type (CNN or LSTM). Generates a "log" folder containing the model weights, model predictions, and logs tracking model error.
  2. Look inside the log folder for model results.

Instructions for fine-tuning a trained model on a different dataset

  1. Run train_NN.py on a dataset folder "X" as above. Generates a "log" folder.
  2. Run test_NN.py and pass in as arguments the "log" folder from training, along with a new dataset folder "Y" on which to fine-tune the model.
  3. Result is a new folder "log2" containing the new model weights, predictions, and error logs for performance on dataset "Y".

deep-transfer-learning-crop-prediction's People

Contributors

annaxwang avatar nadesai 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.