Home

Awesome

Lean Temporal Convolutional Neural Network for yield forecasting

Training temporal Convolution Neural Networks (CNNs) on satellite image time series for yield forecasting.

Table of contents

Model architecture

Prerequisites

To set up the environment:

git clone https://github.com/waldnerf/yieldCNN.git
cd yieldCNN
conda env create -f environment.yml
conda activate leanyf

If a GPU is available, then type in: pip install tensorflow-gpu==2.3.0

You can monitor GPU usage with the following command: watch -n 1 nvidia-smi

Directory tree structure

Below is the directory tree structure of the project. To run the project, one only needs the raw_data folder to be populated. Other folders are created automatically.

leanyf
├── data
│       ├── meta
│       └── params
│           └── Archi_{model_name}_{normalisation}_{input_size}
│                └── crop_{index}
│                    ├── month_{forecast}
│                        └── best_model
├── figures
└── raw_data

Aggregated results are stored in data/model_evaluation_{input_data}CNN.csv.

Script overview

As a helper, certain variables have been hardcoded in mysrc/constants.py.

Scripts were named as explicitly as possible. Here is a short description of the main ones:

Models have been developed in the deeplearning folder:

To do

  1. read raw data and normalize min max over the whole data set after train/test/val split
  2. read normalized (by histo image) and normalize min max over the whole data set after train/test/val split (note that this latter norm has no effect because all data are already 0-1) Data generator delas with both norm and unorm because in any case normalise per image to add error (then norm back to orginal units) In option 2 each image gets the same scale of values (0-1). This means that for a given region, both a good year and a bad year (in terms of yield) will have some grid cells with 1 (the most represented profile). Another option can be tested:
  3. read data normalized by region (all histos of a region) Note: after this option 3, the norm min max over the whole data set after train/test/val split should be turned off.

Contributors