End-to-end workflow for generating high resolution cropland maps.
- Creating a crop map
- Training a new model
- Setting up a local environment
- Adding new labeled data
- Tests
- Previously generated crop maps
- Acknowledgments
- Reference
To create a crop map run the following colab notebook:
To train a new model run the following colab notebook (or use it as a guide):
Two models are trained - a multi-headed pixel wise classifier to classify pixels as containing crop or not, and a multi-spectral satellite image forecaster which forecasts a 12 month timeseries given a partial input:
To add new labeled data follow the OpenMapFlow documentation OR run the linked colab notebook.
Ensure you have anaconda installed.
Ensure you have gcloud installed.
conda install mamba -n base -c conda-forge # Install mamba
mamba env create -f environment-dev.yml # Create environment with mamba (faster)
conda activate landcover-mapping # Activate environment
gcloud auth application-default login # Authenticates with Google Cloud
pre-commit install # Setup automatic linting on every commit
pre-commit run --all-files # Run linting on all files
conda env create -f environment-lite.yml # Create environment
conda activate landcover-lite # Activate environment
jupyter notebook
The following tests can be run against the pipeline:
flake8 . # code formatting
mypy . # type checking
python -m unittest # unit tests
# Integration tests
python -m unittest test/integration_test_model_bbox.py
python -m unittest test/integration_test_model_evaluation.py
I]Steps to resolve the issue related with 'fiona' and 'geopandas' module
pip uninstall geopandas #if the package is already installed in the environment
pip install pipwin
pipwin install gdal
pipwin install fiona
pip install geopandas
II]Steps to resolve the issue related with 'netcdf' module
pip uninstall netcdf4
pip install netcdf4
III]Steps to resolve the warning encountered with the 'pyproj' module
mamba remove pyproj or pip uninstall pyproj
pip install pyproj
Google Earth Engine:
Zenodo
If you find this code useful, please cite the following paper:
Gabriel Tseng, Hannah Kerner, Catherine Nakalembe and Inbal Becker-Reshef. 2020. Annual and in-season mapping of cropland at field scale with sparse labels. Tackling Climate Change with Machine Learning workshop at NeurIPS ’20: December 11th, 2020