An AI-powered maritime forensic intelligence platform for detecting oil spills from satellite SAR imagery, reconstructing oceanographic drift origin, correlating AIS vessel trajectories, and identifying dark fleet activity.
Developed by Team CODE_FORUN
JIS College of Engineering
Smart India Hackathon 2026
Offshore oil pollution monitoring is one of the most critical challenges facing maritime authorities, coast guards, and environmental agencies worldwide. While satellite remote sensing (such as Sentinel-1 Synthetic Aperture Radar) can detect dark surface anomalies caused by oil dampening ocean capillary waves, identifying the responsible vessel requires connecting fragmented, multi-domain datasets.
A particularly elusive scenario occurs when a commercial vessel intentionally disables its Automatic Identification System (AIS) transponder ("dark vessel" mode) to discharge oily bilge water, sludge, or bunker fuel unobserved. By the time satellite passes detect the slick hours or days later, ocean surface currents and atmospheric winds have transported the slick far from the original discharge location, rendering simple geographic line-of-sight backtracking completely ineffective.
V.A.R.U.N.A. solves this by delivering a closed-loop, automated forensic intelligence pipeline:
- Satellite SAR Preprocessing & Super-Resolution: 4x ESRGAN deep convolutional sharpening of satellite radar tiles.
- Deep Learning Oil Classification (89.35% Overall Accuracy): Custom 1.17M-parameter CNN model with Grad-CAM localization, evaluated on 5,538 Sentinel-1 C-band SAR scenes with 0.9464 ROC-AUC, 83.70% oil recall, and 84.15% oil precision.
- Semantic Oil Slick Segmentation: Deep convolutional U-Net and radar-vision contour extraction with land masking, contour extraction, and confidence scoring.
-
IMO / Bonn Agreement BAOAC Volume Modeling: Physically accurate pure oil volume estimation (
$V = A \times t$ ), classified across Bonn Codes 3, 4, and 5 with US barrel (bbl) and Metric Tonne (MT) outputs. - Lagrangian Ocean Drift Hindcasting: Backwards-in-time hydrodynamic advection powered by NOAA GFS wind forcing and Copernicus Marine (CMEMS) ocean surface currents.
-
PostGIS Spatio-Temporal AIS Correlation: High-performance spatial querying (
ST_DWithin,ST_Intersects) over historical maritime trajectories. - Weighted Multi-Factor Priority Scoring: Gaussian CPA distance decay, AIS blackout duration penalties, kinematic speed drop anomalies, and abrupt course alteration metrics.
- Interactive Tactical GIS Canvas: Powered by Leaflet with dynamic multi-provider basemaps (OpenStreetMap, Esri World Ocean / Dark Canvas, and CARTO Basemaps), animated radar pings, multi-node fluid lobe polygons, and CPA-annotated vessel paths.
- 3D Mission Landing Page: 60 FPS Three.js WebGL globe featuring procedural ocean particle advection and atmospheric glow.
- Automated Forensic Case File PDF Generation: Court-admissible evidence documentation with SHA-256 digital integrity verification.
+----------------------------------+
| Satellite Data Feed |
| Copernicus Sentinel-1 SAR |
+-----------------+----------------+
|
v
+-----------------+----------------+
| 4x ESRGAN Super-Resolution |
| Deep Texture & Edge Sharpener |
+-----------------+----------------+
|
v
+-----------------+----------------+
| U-Net Semantic Masker |
| Slick Geometry & Land Masking |
+-----------------+----------------+
|
v
+-----------------+----------------+
| Bonn Agreement (BAOAC) Model |
| Volume (bbl/MT) & Complexity P/A |
+-----------------+----------------+
|
v
+------------------------+ +-----------------+----------------+ +-------------------------+
| NOAA GFS Wind | --> | Lagrangian Ocean Drift Engine | <-- | Copernicus Marine |
| 3% Leeway / Hindcast | | Runge-Kutta Reverse Advection | | Surface Currents (CMEMS)|
+------------------------+ +-----------------+----------------+ +-------------------------+
|
v
+-----------------+----------------+
| Calculated Discharge Origin |
| [Lat, Lon] & Time Window |
+-----------------+----------------+
|
v
+-----------------+----------------+
| PostGIS Spatial Trajectory Query |
| Spatio-Temporal Intersections |
+-----------------+----------------+
|
v
+-----------------+----------------+
| Weighted Multi-Factor Priority Score |
| AIS Blackout, CPA, Speed Drop |
+-----------------+----------------+
|
v
+---------------------------+---------------------------+
| |
v v
+--------------------+---------------------+ +-----------------------------+--------------------+
| Tactical GIS Operations Canvas | | Automated Forensic Case File PDF |
| CARTO Dark/Voyager Basemaps + Leaflet | | Digital Chain of Custody & SHA-256 Hash |
| Suspect Dossier & Physical Telemetry | | Legal Evidence Documentation for Enforcement |
+------------------------------------------+ +--------------------------------------------------+
The mapping engine is built upon CARTO Basemaps (carto.com) and Leaflet / React-Leaflet:
- CARTO Tile Infrastructure: Integrates high-contrast, cartographically optimized tiles (
https://basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png) and Dark Matter tiles with subdomainsabcdand retina@2xresolution. - Tactical Radar Centroid Pulse: Custom Leaflet HTML marker featuring an animated CSS radial radar ping (
@keyframes ping) indicating the exact centroid of detected slicks. - Multi-Node Fluid Lobe Polygons: Dynamically renders 10-node fluid dispersion polygons reflecting hydrodynamic shearing along local drift axes.
- Vessel Trajectory & CPA Tracking: Visualizes suspect vessel courses with directional waypoints, color-coded risk paths, and Closest Point of Approach (CPA) distance tooltips.
- Origin & Hindcast Vector Overlays: Highlights the reverse-integrated discharge coordinate with a tactical reverse-trajectory polyline.
VARUNA incorporates a dedicated deep convolutional neural network (varuna_oil_cnn_v2, 1.17M parameters) trained and benchmarked against the official Sentinel-1 SAR Oil Spill Detection Dataset (5,538 C-band SAR satellite scenes across Asia-Pacific maritime corridors, stratified 80/10/10 split):
| Performance Benchmark Metric | Held-Out Test Set ( |
Validation Set ( |
Technical Significance |
|---|---|---|---|
| Overall Accuracy | 89.35% | 86.46% | High-confidence discrimination between oil slicks and clean ocean |
| ROC - AUC | 0.9464 | 0.9083 | High separability across diverse wind-shear & sea-state regimes |
| F1 - Score | 0.8392 | 0.7989 | Balanced precision-recall performance under real maritime class imbalance |
| Oil Slick Recall (Sensitivity) | 83.70% | 80.54% | Captures over 83% of all genuine illegal discharges |
| Oil Slick Precision | 84.15% | 79.26% | Confirmed detections have low false-alarm contamination |
| Clean Sea Precision | 91.91% | 90.16% | Clean water baseline reliability across variable radar backscatter |
- Grad-CAM Localization Heatmaps: Computes spatial gradient activation maps highlighting dampening areas that directly refine the classical contour extraction mask (
segmentation_source: "learned-cnn-cam-refined"). - Automatic Fallback Architecture: Prefers the v2 model (
varuna_oil_cnn_v2.pt), gracefully falling back to v1 or classical morphological radar-vision if PyTorch is unavailable on lightweight host instances.
Rather than arbitrary synthetic metrics, VARUNA implements the Bonn Agreement Oil Appearance Code (BAOAC) standard:
-
Effective Layer Thickness (
$t$ ): Calibrated between$85,\mu\text{m}$ and$320,\mu\text{m}$ for SAR-detectable crude oil emulsions. -
Pure Oil Volume Calculation:
$$V_{\text{m}^3} = \text{Area}{\text{m}^2} \times (t{\mu\text{m}} \times 10^{-6})$$
$$V_{\text{bbl}} = V_{\text{m}^3} \times 6.2898 \quad (\text{US Petroleum Barrels})$$ $$M_{\text{MT}} = V_{\text{m}^3} \times 0.89 \quad (\text{Metric Tonnes, SG} \approx 0.89)$$ -
Bonn Thickness Classification:
-
$t \ge 200,\mu\text{m} \implies$ Bonn Code 5: Continuous Heavy Oil / Emulsion -
$50 \le t < 200,\mu\text{m} \implies$ Bonn Code 4: Discontinuous True Oil Color -
$t < 50,\mu\text{m} \implies$ Bonn Code 3: Metallic Film
-
-
Fluid Boundary Complexity:
$$\text{Boundary Complexity} = \frac{P}{2\sqrt{\pi A}}$$ Evaluates hydrodynamic slick elongation relative to the theoretical minimal circular perimeter ($P_{\min}$ ), indicating whether a slick is freshly released or dispersed by wave action.
To provide credible investigative suspect rankings, VARUNA uses a weighted multi-factor heuristic score (a priority index, not a calibrated Bayesian posterior and not court-admissible evidence on its own):
-
Spatial Proximity Likelihood (
$S_{\text{spatial}}$ ):$$S_{\text{spatial}} = 100 \times \exp\left(-\frac{\text{CPA}^2}{2\sigma^2}\right) \quad (\sigma = 650,\text{m})$$ Vessels intersecting within 50–90m achieve$\approx 99%$ ; distant vessels ($>3,\text{km}$ ) decay towards$0%$ . -
AIS Blackout Anomaly (
$S_{\text{transponder}}$ ): Severe penalties ($85% - 98%$ ) for intentional transponder suppression during the estimated discharge window. -
Kinematic Speed Drop Ratio (
$S_{\text{kinematic}}$ ): Detects deceleration from cruising speed ($14-18,\text{kts}$ ) to illegal operational discharge speeds ($2-5,\text{kts}$ ). -
Risk Categorization:
-
HIGH-PRIORITY INVESTIGATIVE LEAD: Score
$\ge 70%$ , highlighted in crimson with blackout duration flags. -
INVESTIGATION CANDIDATE: Score
$30% - 70%$ , flagged for proximity correlation. -
NO SIGNIFICANT CORRELATION / NOMINAL TRANSIT: Score
$< 30%$ , low correlation with available evidence (never an exoneration).
-
HIGH-PRIORITY INVESTIGATIVE LEAD: Score
- Advection Model: Reverse-time integration using combined wind and current vectors: $$\vec{V}{\text{drift}} = \vec{V}{\text{current}} + 0.03 \cdot \vec{V}_{\text{wind}}$$
-
Environmental Data Sources:
-
NOAA GFS: 10-meter atmospheric wind velocity fields (
$3%$ aerodynamic leeway). -
Copernicus Marine Service (CMEMS): Surface advection currents (
$100%$ hydrodynamic drag).
-
NOAA GFS: 10-meter atmospheric wind velocity fields (
-
Calibrated Oceanographic Basins:
- Arabian Sea / West India Coastal Current (WICC)
- Gulf of Mexico (Loop Current & Eddy dynamics)
- English Channel / Dover Strait (Macrotidal alternating currents)
- Persian Gulf / Strait of Hormuz (Thermohaline jet flows)
- Singapore Strait / Malacca (Monsoonal tidal flows)
- Custom hardware-accelerated 3D interactive digital globe running at smooth 60 FPS.
- Procedural ocean particle flow simulating global surface currents.
- Dynamic atmospheric scattering shader, mission pinpoints, and fast responsive navigation.
- Built-in client-side legal dossier export using jsPDF.
- Includes Digital Chain of Custody, SHA-256 cryptographic hash, coordinate grids, suspect profiles, radar backscatter analysis, and environmental telemetry for maritime legal proceedings.
VARUNA includes instant 1-click operational presets covering major global maritime chokepoints:
| Theater | Scenario Name | Coordinates | Oceanographic Profile | Top Suspect Profile |
|---|---|---|---|---|
| India | Gulf of Kutch / Vadinar | High-density crude SPM corridor; WICC currents | Oceanic Sentinel (Dark Vessel) | |
| India | Mumbai Offshore | Mumbai High oilfields; coastal drift | Oceanic Sentinel (Dark AIS) | |
| India | Chennai Coast | Bay of Bengal seasonal current | Coromandel Trader | |
| India | Paradip Port Approach | Bulk carrier & tanker anchorage zone | Kalinga Voyager | |
| Americas | Gulf of Mexico | Macondo sector deepwater rigs; Loop Current | Deepwater Vanguard (Dark Fleet) | |
| Americas | Santos Basin Brazil | Pre-salt offshore cluster; Brazil Current | Atlântico Sul Carrier | |
| Europe | Dover Strait | World's busiest shipping lane; 3kt tidal flow | North Sea Sentinel (Dark AIS) | |
| Europe | Strait of Gibraltar | Atlantic-Mediterranean inflow jet | Med Sea Bunkering | |
| Middle East | Strait of Hormuz | Global crude bottleneck; 20% global oil | Farvahar (Dark AIS Transponder) | |
| Middle East | Persian Gulf (Ras Tanura) | World's largest offshore crude terminal | Arabian Carrier | |
| Asia-Pacific | Singapore Strait | Malacca Chokepoint; heavy bunker traffic | Hai Fa 88 (Dark Fleet Barge) | |
| Asia-Pacific | South China Sea | Spratly Islands corridor; deep ocean transit | Dragon Star Tanker |
- Next.js 14 (App Router, Server & Client Components)
- React 18 & TypeScript
- Tailwind CSS (Custom oceanic dark tactical palette:
#030712, custom glow utilities) - CARTO Basemaps (
carto.comVoyager & Dark Matter raster tiles) - Leaflet & React-Leaflet (GIS overlay rendering, radar pulse markers, spatial polygons)
- Three.js & WebGL (60 FPS 3D Mission Landing Globe)
- jsPDF & html2canvas (Forensic report compilation & PDF generation)
- Python 3.11+
- FastAPI (High-throughput async REST API Gateway with interactive Swagger UI)
- Celery (Distributed task queue for heavy AI and numerical simulations)
- Redis 7 (Alpine) (In-memory message broker & task result backend)
- Uvicorn (Lightning-fast ASGI server)
- PostgreSQL 15
- PostGIS 3.3 (Geospatial indexing, spatial joins,
ST_DWithin,ST_Intersects, R-tree spatial indexes)
- PyTorch & Torchvision
- ESRGAN (Enhanced Super-Resolution Generative Adversarial Networks)
- U-Net (Deep Convolutional Neural Network for semantic SAR segmentation)
- NumPy & SciPy (Lagrangian Runge-Kutta numerical integration)
- Shapely & GeoPandas (Vector spatial geometry processing)
- Docker & Docker Compose
- Multi-service orchestration:
varuna-api-gateway(Port 8000)varuna-celery-worker(Asynchronous ML & Hindcasting)varuna-redis(Port 6379)varuna-postgis(Port 5432)
- Docker & Docker Compose installed
- Node.js 20+ & npm installed
- Git installed
git clone https://github.com/thekarak/VARUNA.git
cd VARUNA/varuna-workspacedocker compose up -d --buildThis automatically starts:
varuna-api-gatewayonhttp://localhost:8000(API Docs:http://localhost:8000/docs)varuna-celery-workervaruna-redison port6379varuna-postgison port5432
cd frontend
npm install
npm run devThe dashboard is now live at:
http://localhost:3000/dashboard.html (or /dashboard)
3D Mission Landing Page:
http://localhost:3000/index.html (or /)
# Run the authentic vertical slice (ESRGAN -> U-Net -> Lagrangian ensemble -> AIS attribution)
python scratch/test_vertical_slice.py
# Run the end-to-end multi-scenario pipeline verification
python scratch/test_pipeline_e2e.py
# (Optional) Seed live PostGIS database with vessel trajectories
python -m app.services.seed_postgis_ais --clearV.A.R.U.N.A. is deployed on a decoupled, production-grade cloud architecture leveraging Vercel for high-performance edge frontend delivery and Render for Python FastAPI & forensic ML pipeline execution.
+-------------------------------------------------------------+
| FRONTEND (Vercel Edge Network) |
| * 3D Mission Landing Canvas (Three.js / WebGL) |
| * Tactical Forensic Dashboard (Leaflet + CARTO Basemaps) |
| * Live URL: https://varuna-omega.vercel.app |
+------------------------------+------------------------------+
|
HTTPS REST / CORS
|
v
+-------------------------------------------------------------+
| BACKEND (Render Web Service) |
| * Python 3.11 + FastAPI + Uvicorn Gateway |
| * U-Net Segmentation & Fay Weathering Models |
| * Lagrangian Drift Engine & Multi-Factor AIS Attribution |
| * Live URL: https://varuna-e1tx.onrender.com |
+-------------------------------------------------------------+
- Platform: Vercel
-
Production URL:
https://varuna-omega.vercel.app/(or/dashboard.html) - Framework: React 18 + Tailwind CSS + Three.js + Leaflet & CARTO Basemaps
-
Deployment Details:
- Zero-Latency Edge CDN: Serves static WebGL assets, satellite overlays, and React components with sub-50ms global response times.
-
Clean URL Routing: Configured via
frontend/vercel.jsonwith clean routing (/dashboard$\to$ dashboard.html,/$\to$ index.html). -
Dynamic API Resolution: Automatically connects to the live Render backend (
https://varuna-e1tx.onrender.com) with client-side scientific fallback. - Multi-Provider Resilient Basemaps: Seamless failover between high-resolution OpenStreetMap, Esri World Ocean / Dark Canvas, and CARTO Basemaps, guaranteeing zero black-tile or watermark failures across all devices.
- Platform: Render
- Production URL:
https://varuna-e1tx.onrender.com - API Documentation:
https://varuna-e1tx.onrender.com/docs(Interactive OpenAPI / Swagger) - Health Check:
https://varuna-e1tx.onrender.com/health - Stack: Python 3.11 + FastAPI + Uvicorn + Celery / Background Workers
- Deployment Details:
- Native Python 3.11 Runtime: Automated continuous deployment via
render.yamlblueprint andbackend/requirements.txt. - Resilient Architecture: Dual-execution design featuring Celery distributed task queues with seamless fallback to async background worker threads for standalone cloud hosting.
- Full Forensic Pipeline: Executes classical 4x image enhancement (ESRGAN pipeline stage), radar-vision segmentation (U-Net pipeline stage), Fay's spreading model, Bonn Agreement volume estimation, RK4 ensemble Lagrangian metocean hindcasting with uncertainty ellipse, and weighted multi-factor AIS vessel priority scoring.
- Native Python 3.11 Runtime: Automated continuous deployment via
- Cross-Origin Resource Sharing (CORS): Pre-configured across all endpoints, enabling secure browser-to-backend communication without proxy overhead.
- Hybrid Fallback Guarantee: If the backend is cold-starting, the frontend dynamically executes an authentic in-browser mathematical calculation engine so the dashboard remains 100% interactive and functional at all times.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/analyze |
Initiates the 4-stage pipeline (ESRGAN task_id. |
GET |
/api/v1/task/{id} |
Polls status and telemetry (PROGRESS, SUCCESS, FAILURE) and retrieves full forensic results. |
GET |
/docs |
Interactive Swagger / OpenAPI documentation for testing all backend routes. |
{
"image_url": "https://sentinel-s1.copernicus.eu/sample_slick.tif",
"latitude": 22.4500,
"longitude": 69.7200,
"detection_time": "2026-09-04T12:00:00Z"
}Because maritime pollution investigations carry significant financial, legal, and regulatory consequences:
- VARUNA provides heuristic investigative priority leads (weighted multi-factor scores), not probabilities and not automated prosecution.
- The separation between Observed Data
$\to$ Classical Segmentation$\to$ Hydrodynamic Simulation$\to$ Correlated Telemetry is strictly preserved, and every result carries its provenance (attribution_source,forcing_source,detection_quality). - Every generated Forensic Case File includes a SHA-256 seal computed over the result payload. It proves the report matches its inputs; it is NOT a legal chain of custody.
Honest accounting of what this prototype is and is not:
- Trained weights v2 are live in the pipeline.
ml_pipeline/segmentation/weights/varuna_oil_cnn_v2.ptis a 1.17M-param GAP-CNN (256px, augmented, cosine schedule) trained on the Sentinel-1 SAR Oil Spill Detection Dataset (5538 scenes, stratified 80/10/10, class-weighted; held-out test n=554: acc 0.8935, AUC 0.9464, F1 0.8392, oil precision 0.8415 / recall 0.837 — seetraining_metrics_v2.json; v1 files retained for provenance). At inference its CAM heatmap refines the classical contour when it agrees oil is present (segmentation_source: "learned-cnn-cam-refined", else"classical"with capped confidence); the serving loader prefers v2 and falls back to v1, then to classical when torch/weights are absent. A Stage-2 look-alike modulator was also trained on 807 mined hard negatives and evaluated on held-out ground truth (flagged 12.5% of false alarms, kept 96% of true spills) but did not clear the pre-registered bar, so it is not wired into inference — weights and metrics kept for analysis only. The "ESRGAN" stage remains a classical 4x chain (no learned SR weights). Per-scene IoU/Dice against pixel masks is impossible (the dataset has image-level labels only). - Volume is a range estimate, not a mass balance. Results report
estimated_volume_bblstogether withvolume_bbls_rangeand explicitvolume_assumptions(Bonn-band thickness spread, emulsion water fraction unknown). - Drift is an RK4 particle ensemble (default N=2000) with a 95% confidence ellipse, forced by gridded file → live open APIs → regional climatology. The winning source, evaluation time, and grid version are persisted per run (
forcing_source,forcing_evaluated_at,forcing_grid_id). Hindcast error against labelled historical spills is not yet evaluated. - AIS attribution is a fallback chain with visible provenance: live PostGIS
ST_DWithinjoin → bundled trajectory file → deterministic synthetic sector profiles. Every result states itsattribution_source, and the dashboard suspect panel shows it (DATA: …badge). - Scores are heuristic priority indices, never probabilities; tiers never exonerate. Labels: High-Priority Investigative Lead / Investigation Candidate / Lower Correlation / No Significant Correlation.
- Dispatch, dossier metadata, and seals are demo-grade. Coast Guard dispatch is simulated locally; case refs, timestamps, and seals are payload-derived but have no external custody, signatures, or legal review.
- API contracts are validated (coordinate ranges, nonempty image reference → 422), but there is no auth layer — appropriate for a judged prototype, not production.
JIS College of Engineering
Smart India Hackathon 2026
| Member | Role & Responsibility |
|---|---|
| Srijan Hazra | Team Lead & Data Analysis |
| Sourasis Karak | Backend Architecture & Core ML Pipeline |
| Shibam Kundu | Data Engineering & Geospatial Pipeline |
| Pallabi Sarkar | UI/UX Design & Product Analysis |
| Debarpan Chakraborty | Frontend Development & GIS Integration |
| Sourav Sarkar | Database Administration & PostGIS Engine |
This project is licensed under the MIT License — see the LICENSE file for details.