How franckinani/maritime-edge-ai-intel-platform works
Purpose and Runtime Topology
This is a containerized Python 3.11+ microservice platform for detecting maritime vessels in real Sentinel-1 SAR imagery. Six services expose FastAPI endpoints (except the Streamlit dashboard), coordinated through Docker Compose and Redis. Primary composition and deployment boundaries are docker-compose.yml, docker-compose.demo.yml, and docker/base/Dockerfile.
Shared Contracts and Configuration
Cross-service payload contracts, notably detection events and related geospatial/TLE models, are centralized in shared/schemas/events.py. Shared constants and secret validation live in shared/config/constants.py and shared/config/secrets_validator.py. Model artifacts are expected under shared/models/ but are not versioned. This shared layer is the compatibility boundary between preprocessing, inference, enrichment, and UI.
Scene Discovery and Ingestion
The ingestion API searches Copernicus Data Space Ecosystem (CDSE) for Sentinel-1 products using geographic/date criteria; downloading/job endpoints remain explicitly incomplete. Its entry point and CDSE-facing logic are services/data_ingestor/main.py and services/data_ingestor/sentinel_fetcher.py. Raw scenes are exchanged downstream through the Compose-managed scenes volume, rather than embedded in API events.
SAR Preprocessing and Georeferencing
The preprocessing service transforms .SAFE radar products into 512×512 NumPy tiles. It supports raw through calibrated, Lee-filtered, dB-converted, and MVSSD-enhanced pipelines, then associates tiles with GCP-derived pixel-to-lat/lon mapping. The API orchestration is services/sentinel_preprocessor/main.py; core SAR operations are in services/sentinel_preprocessor/sar_preprocessing_module.py and services/sentinel_preprocessor/tools/apply_mvssd_ops.py. Tile files form the boundary to model inference via the shared tiles volume.
Detection and Event Production
The detector loads an INT8 YOLOv8 ONNX model, accepts a tile by path or base64, performs input preparation, inference, NMS, and priority assignment, and emits the shared detection-event shape. Its service boundary is services/detector/main.py; model storage is shared/models/. Detector output is metadata/event-oriented, while large imagery remains filesystem/volume-backed.
Satellite Context and External Resilience
Satellite tracking independently retrieves and caches TLE data, computes SGP4 positions, and supplies satellite context for detections. services/satellite_monitor/main.py implements a source hierarchy: SatNOGS primary, Celestrak fallback, then stale cache. This isolates unreliable external orbital-data access from image-processing and event-persistence paths.
Enrichment, Persistence, and Operator Access
The aggregator receives detection events, computes maritime zone classification (territorial waters, EEZ, high seas), matches Global Fishing Watch AIS data for vessel/dark-vessel context, and persists/query-aggregates events through SQLite or Postgres. Its boundary is services/aggregator/main.py. services/ground_dashboard/app.py is the Streamlit operator entry point: upload flows invoke preprocessing/detection, satellite queries call the monitor, and continuous monitoring reads aggregator events/stats.
Infrastructure and Research Boundary
docker-compose.yml provides service startup ordering, health checks, Redis shared cache, and shared scene/tile volumes. All service images build from docker/base/Dockerfile. Credentials for CDSE and GFW are environment-provided via .env.example. Offline/reproducibility and model-development workflows are deliberately separated under research/scripts/ and research/notebooks/, rather than part of the operational request path.
Main entry points: detector/main.py Vessel detector · aggregator/main.py Event aggregator · docker-compose.yml Docker Compose · app.py Ground dashboard
Components 21
Shared contracts
Compatibility boundary across services.
- Event schemas · Detection and geospatial/TLE payload models.
shared/schemas/events.py - Constants and secrets
shared/config/constants.py - Model artifacts · Unversioned YOLO model artifacts.
Operational services
- Docker Compose · Starts services, health checks, cache, and shared volumes.
docker-compose.yml - Base service image
docker/base/Dockerfile - Data ingestor · Searches Sentinel-1 products; download jobs are incomplete.
services/data_ingestor/main.py - CDSE fetcher
services/data_ingestor/sentinel_fetcher.py - SAR preprocessor · Converts SAFE products to georeferenced 512×512 tiles.
services/sentinel_preprocessor/main.py - SAR processing pipeline · Calibration, filtering, dB, MVSSD, and GCP mapping.
services/sentinel_preprocessor/sar_preprocessing_module.py - Vessel detector · INT8 YOLOv8 ONNX inference, NMS, and priority assignment.
services/detector/main.py - Satellite monitor · TLE hierarchy, cache, and SGP4 satellite context.
services/satellite_monitor/main.py - Event aggregator · Enriches, persists, and queries detection events.
services/aggregator/main.py - Ground dashboard · Operator upload, satellite-query, and monitoring interface.
services/ground_dashboard/app.py
Compose-managed storage
- Redis cache
- Scenes volume · Raw Sentinel-1 scene exchange.
- Tiles volume · Tile exchange between preprocessing and inference.
- Event database · Persistent detection-event store.
External data sources
- Copernicus Data Space
- SatNOGS / Celestrak · Primary and fallback orbital sources.
- Global Fishing Watch
Research boundary
Offline and model-development workflows.
- Research workflows · Separated from operational request paths.
Connections 25
- Docker Compose → Base service image: builds services from
- Docker Compose → Redis cache: provisions
- Docker Compose → Scenes volume: mounts
- Docker Compose → Tiles volume: mounts
- Data ingestor → CDSE fetcher: uses
- CDSE fetcher → Copernicus Data Space: searches products
- Data ingestor → Scenes volume: writes raw scenes
- Scenes volume → SAR preprocessor: reads SAFE scenes
- SAR preprocessor → SAR processing pipeline: orchestrates
- SAR preprocessor → Tiles volume: writes georeferenced tiles
- Tiles volume → Vessel detector: supplies tiles
- Model artifacts → Vessel detector: loads ONNX model
- Vessel detector → Event schemas: emits events
- Vessel detector → Event aggregator: sends detection events
- Satellite monitor → SatNOGS / Celestrak: retrieves TLEs
- Satellite monitor → Redis cache: caches TLE data
- Satellite monitor → Event schemas: supplies satellite context
- Event aggregator → Global Fishing Watch: matches AIS context
- Event aggregator → Event database: persists events
- Ground dashboard → SAR preprocessor: invokes upload processing
- Ground dashboard → Vessel detector: invokes detection
- Ground dashboard → Satellite monitor: queries satellite context
- Ground dashboard → Event aggregator: reads events and stats
- Constants and secrets → Data ingestor: validates credentials
- Constants and secrets → Event aggregator: validates credentials