
Fields of the World (FTW)
The Fields of the World (FTW) model is an example of an open source segmentation model that can predict crop field boundaries. This model predicts 3 classes:- non_field_background
- field
- field_boundaries
Inference on seasonal planting / harvest multi-spectral imagery
We’ll run the Fields of the World model on median pixel mosaics for the planting and harvest seasons using 4 multi-spectral bands for each season: Red, Green, Blue, and NIR. This data is sourced from Sentinel-2 L2A product2 from the European Space Agency. Rather than needing to create these mosaics manually, we’ll use RasterFlow’s registered datasets for Sentinel-2 seasonal mosaics, which are built in to this model recipe.Preview: model inputs and outputs
The interactive map linked below shows the input imagery and model outputs for this notebook’s example AOI. Toggle layers in the sidebar to compare the inputs, the raster model output, and the vectorized geometries side-by-side. Layers:- FTW input planting mosaic: RGB Sentinel-2 median-pixel mosaic for the planting season
- FTW input harvest mosaic: RGB Sentinel-2 median-pixel mosaic for the harvest season
- FTW model outputs: raster output from the model, shown using the
field_boundariesband - FTW vector geometries: polygons of detected fields, derived from the raster output
- FTW PM Tiles: same field polygons delivered as PMTiles for fast rendering at scale
Selecting an Area of Interest (AOI)
To start, we will choose an Area of Interest (AOI) for our analysis. The area around Haskell County, Kansas has some interesting crop field patterns so we will try out the model there.Initializing the RasterFlow client
Running a model
RasterFlow has pre-defined workflows to simplify orchestration of the processing steps for model inference. These steps include:- Ingesting imagery for the specified Area of Interest (AOI)
- Generating a seamless image from multiple image tiles (a mosaic)
- Running inference with the selected model
(Optional) Build an optimized Zarr for visualization
RasterFlow writes its outputs as Zarr stores at native resolution. To explore them interactively on cloud.wherobots.com/map, you can build an optimized multiscale Zarr.build_zarr_multiscales adds downsampled overview levels (image pyramids) to the store so the map can stream coarse tiles when zoomed out and full-resolution pixels when zoomed in.
This step is optional and can take a few minutes for large outputs, so the code below is commented out by default — uncomment it to run it.
Visualizing outputs
If RasterFlow is enabled for your organization, you can visualize the Zarr, GeoParquet, and other geospatial outputs using cloud.wherobots.com/map.Vectorize the raster model outputs
The output for the FTW model is a raster with three classes as bands: field, field_boundaries, and non_field_background. We will run a seperate flow to convert the fields and field boundaries into vector geometries. Converting these results to geometries allows us to more easily post process the results or join the results with other vector data.Save the vectorized results to the catalog
We can store these vectorized outputs in the catalog by using WherobotsDB to persist the GeoParquet results.Visualize the vectorized results
To visualize the vectorized results, we will show the fields around Plymell, Kansas and filter out results with a score lower than 0.5. This threshold was determined through observation to strike a balance: it eliminates obvious noise without being overly aggressive, ensuring that we don’t accidentally filter out too many relevant results.Generate PM Tiles for visualization
To improve visualization performance of a large number of geometries, we can use Wherobots built-in high performance PM tile generator. The FTW model has a tendency to create extremely large boundary geometries, which doesn’t play nicely with PMTiles. To avoid this we subdivide the boundary geometries.Sharing PMTiles results with the Wherobots PMTiles Viewer
You can generate a pre-signed url to your pmtiles usingget_url.
Then, copy this to your clipboard with right-click + “Copy Output to Clipboard”.
You can paste this url into https://tile-viewer.wherobots.com/ and create a publicly accessible PMTiles map served from your own bucket.
References
- Kerner, H., Chaudhari, S., Ghosh, A., Robinson, C., Ahmad, A., Choi, E., Jacobs, N., Holmes, C., Mohr, M., et al. (2024). Fields of The World: A Machine Learning Benchmark Dataset For Global Agricultural Field Boundary Segmentation. arXiv preprint arXiv:2409.16252. Accepted at AAAI-2025 Artificial Intelligence for Social Impact (AISI) track.
- ESA. (2015). Sentinel-2 User Handbook (Issue 1, Rev. 2). European Space Agency. https://sentinels.copernicus.eu/documents/247904/685211/Sentinel-2_User_Handbook

