ZUBAIR AHMED. Case study 01 · Detection
All work

Detection · production pipeline

Aqua-Boundary

A distributed geospatial ML pipeline that detects and segments aquaculture pond boundaries from satellite imagery and emits production-ready vector GeoJSON.

Role
Sole engineer
Sensor
Sentinel-2 MSI L2A
AWS ODR · Planetary Computer
Region
4 districts
Andhra Pradesh, India
Models
YOLOv8 → SAM ViT-H
6 trained & benchmarked
Result
94% mIoU
30 min → 2 min per tile

The problem

Data collection and surveying in aquaculture is still done by hand. It is labour intensive, slow, and prone to human error — and at delta scale, it simply does not finish. The proposal was to replace manual survey with boundary delineation driven by remotely sensed data.

Objectives

  • Build a strong inland fisheries geospatial database.
  • Modernise and strengthen the aquaculture value chain.
  • Give value-chain stakeholders the means to monitor sustainability and drive innovation.

My role

Sole engineer on the pipeline. I manually delineated the boundaries that became the training set, trained and tuned the ML and DL models, designed the workflow architecture, built the inference stages, and took it from prototype to containerised deployment.

Data

SourceWhat it gives
Sentinel-2
AWS & Planetary Computer
Imagery across 12 spectral bands at roughly a five-day revisit, enough to observe the phenological and environmental changes that come with shrimp farming. High temporal and spectral resolution makes it well suited to aquaculture monitoring.
Ground truth
Google satellite basemap
Sentinel-2 scenes were visually interpreted and validated against the Google satellite basemap.

The dataset for the whole study was created from scratch, through visual interpretation and manual delineation.

End-to-end methodology workflow diagram for the pond boundary detection pipeline
Fig. 01End-to-end methodology, from raster acquisition through detection and segmentation to vectorised pond boundaries.

Experiments

The research ran across four districts of Andhra Pradesh known for aquaculture. Six models were trained and tested in total. The YOLO + SAM combination outperformed every other configuration.

Table of accuracy metrics comparing the six trained segmentation models for one region
Fig. 02Metrics from one of the four study regions, across all six trained models.
Side by side visual comparison of pond boundary predictions from each model
Fig. 03Visual comparison of model outputs against the same scene.
Further visual comparison of segmentation outputs across models
Fig. 04Boundary fidelity at pond edges — where the two-stage approach separates from single-stage segmentation.

What I built

  • A geospatial training dataset created from scratch by manual delineation.
  • Training and hyperparameter optimisation across six model configurations.
  • An Xarray/Dask-based Sentinel-2 data extraction pipeline feeding the models.
  • A two-stage detection-segmentation pipeline: YOLOv8 proposes pond regions, SAM ViT-H refines them into precise masks, which are then vectorised to GeoJSON.
  • A Temporal-orchestrated workflow that splits the process into stages on independent task queues, so each can be scaled and tuned separately.
  • A FastAPI trigger-and-poll API over the workflow.
  • Docker packaging with separate API and worker images.

How it works

Input is raster tiles pulled from S3. Output is GeoJSON boundaries written back to S3, alongside a rendered PNG for quick visual review.

Stage 01Generate model input, upload to S3
Stage 02YOLO detection activity
Stage 03SAM segmentation activity
Stage 04Vectorisation to GeoJSON
Stage 05PNG visualisation

API contract

RequestType
latitudefloat
longitudefloat
start_datestr — defaults to a fixed 3 or 6 month window ending today
end_datestr — defaults to a fixed 3 or 6 month window ending today
ResponseType
boundary_geojsondict — the delineated pond boundaries
output_s3_keystr — GeoJSON location in S3
image_output_s3_keystr — rendered PNG location in S3
internal_datadict — metadata carried across workflow activities

Request sequence

01Client calls FastAPI
02Validate request
03Fetch satellite data
04Generate pond boundaries
05Return result

Results

  • Processes a tile — three 1.3 × 1.3 km images — in about two minutes.
  • Replaces an average of 30 minutes of manual digitisation per tile with two minutes of GeoAI segmentation.
  • 94% mIoU sustained across four geographically distinct regions.
← All work Next: Aerator Detection →