Home

Awesome

BreizhCrops:

A Time Series Dataset for Crop Type Mapping

Check our Breizhcrops Tutorial Colab Notebook for quick hands-on examples.

Installation

Linux and macOS

Install Breizhcrops as python package from PyPI!

pip install breizhcrops

Windows

If you use Windows, execute these lines.

git clone https://github.com/dl4sits/BreizhCrops.git
pip install torch==1.6.0 -f https://download.pytorch.org/whl/torch_stable.html
conda install gdal fiona geopandas
pip install .

Getting Started

This minimal working example

# import package
import breizhcrops as bzh

# initialize and download FRH04 data
dataset = bzh.BreizhCrops("frh04")

# get data sample
x, y, field_id = dataset[0]

# load pretrained model
model = bzh.models.pretrained("Transformer")

# create a batch of batchsize 1
x = x.unsqueeze(0)

# perform inference
y_pred = model(x)

downloads the FRH04 dataset partition (used for evaluation), loads a pretrained model and performs a prediction on the first sample.

mimimum working example

Furthermore, for a detailed data analysis you can check the Hands-on Tutorial on Time Series. This is a Jupyter Notebook for timeseries data exploration with BreizhCrops benchmark.

Train a model

Train a model via the example script train.py

python train.py TransformerEncoder --learning-rate 0.001 --weight-decay 5e-08 --preload-ram

This script uses the default model parameters from breizhcrops.models.TransformerModel. When training multiple epochs, the --preload-ram flag speeds up training significantly

Acknowledgements

The model implementations from this repository are based on the following papers and github repositories.

The raw label data originates from

Reference

This work will be published in the proceedings of ISPRS Archives 2020. Preprint available on ArXiv

@article{breizhcrops2020,
  title={BreizhCrops: A Time Series Dataset for Crop Type Mapping},
  author={Ru{\ss}wurm, Marc and Pelletier, Charlotte and Zollner, Maximilian and Lef{\`e}vre, S{\'e}bastien and K{\"o}rner, Marco},
  journal={International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences ISPRS (2020)},
  year={2020}
}

ISPRS virtual congress video can be found here

ICML workshop 2019

<a href=https://arxiv.org/abs/1905.11893><img height=300px src=doc/paper.png /></a> <a href="doc/poster.pdf"><img height=300px src=doc/poster.png /></a>

A previous version (see workshop website or arxiv version 1) was presented at the presented at the ICML 2019 Time Series workshop, Long Beach, USA ICML workshop contributions do not appear in the ICML proceedings.