Second place solution in the Zindi AgriFieldNet India Challenge to classify crop types in agricultural fields across Northern India using multispectral observations from Sentinel-2 satellite. Ensembled weighted tree-based models “LGBM, CATBOOST, XGBOOST” with stratified k-fold cross validation, taking advantage of spatial variability around each field within different distances.
MLHub model id: model_ecaas_agrifieldnet_silver_v1
. Browse on Radiant MLHub.
Please review the model architecture, license, applicable spatial and temporal extents and other details in the model documentation.
Inferencing | Training |
---|---|
30 GB RAM | 30 GB RAM |
First clone this Git repository.
git clone https://github.com/radiantearth/model_ecaas_agrifieldnet_silver.git
cd model_ecaas_agrifieldnet_silver/
After cloning the model repository, you can use the Docker Compose runtime files as described below.
Pull pre-built image from Docker Hub (recommended):
docker pull docker.io/radiantearth/model_ecaas_agrifieldnet_silver:1
Or build image from source:
docker build -t radiantearth/model_ecaas_agrifieldnet_silver:1 -f Dockerfile .
Prepare your input and output data folders. The data/
folder in this repository
contains some placeholder files to guide you.
data/
folder must contain:
input/chips/
Sentinel-2 10m imagery chips for inferencing:
images/
Sentinel-2 10m imagery chips for inferencing:
chip_id
e.g. 00c23
Sentinel-2 bands 10m:
B01.tif
Type=Byte, ColorInterp=CoastalB02.tif
Type=Byte, ColorInterp=BlueB03.tif
Type=Byte, ColorInterp=GreenB04.tif
Type=Byte, ColorInterp=RedB05.tif
Type=Byte, ColorInterp=RedEdgeB06.tif
Type=Byte, ColorInterp=RedEdgeB07.tif
Type=Byte, ColorInterp=RedEdgeB08.tif
Type=Byte, ColorInterp=NIRB8A.tif
Type=Byte, ColorInterp=NIR08B09.tif
Type=Byte, ColorInterp=NIR09B11.tif
Type=Byte, ColorInterp=SWIR16B12.tif
Type=Byte, ColorInterp=SWIR22
fields/
Corresponding field ids for each pixel in Sentinel-2 images:
chip_id
e.g. 00c23
Corresponding field ids:
field_ids.tif
/input/checkpoint/
the model checkpoint lgbms, xgbms, cats
.
Please note: the model checkpoint is included in this repository.output/
folder is where the model will write inferencing results.Set INPUT_DATA
and OUTPUT_DATA
environment variables corresponding with
your input and output folders. These commands will vary depending on operating
system and command-line shell:
# change paths to your actual input and output folders
export INPUT_DATA="/home/my_user/model_ecaas_agrifieldnet_silver/data/input"
export OUTPUT_DATA="/home/my_user/model_ecaas_agrifieldnet_silver/data/output"
Run the appropriate Docker Compose command for your system
docker-compose up model_ecaas_agrifieldnet_silver_v1
# If the user is not added to docker group
sudo -E docker-compose up model_ecaas_agrifieldnet_silver_v1
Wait for the docker compose
to finish running, then inspect the
OUTPUT_DATA
folder for results.
Please review the model output format and other technical details in the model documentation.