
Building FloodProof on AWS: From Radar to Flood Inspection
How we built FloodProof on AWS EC2 and S3 to analyze satellite SAR radar imagery, filter permanent water, and prioritize emergency flood inspection teams.
Overview
During major flood disasters, dense cloud cover renders optical satellites blind. Synthetic Aperture Radar (SAR) from Sentinel-1 penetrates cloud decks, storms, and darkness to capture surface backscatter reflections.
However, turning satellite radar observations into an actionable operational response presents three major engineering challenges:
- Permanent Water Baselines: Rivers and perennial lakes must be distinguished from newly detected surface water to avoid dispatching teams to normal waterways.
- Infrastructure Impact: Raw flood extent does not reflect human impact. Response coordinators need spatial correlation with transport corridors and human settlements.
- Operational Capacity Constraints: Emergency response teams cannot survey hundreds of square kilometers simultaneously. They need explainable, budget-constrained inspection queues.
We built FloodProof to bridge satellite radar analytics with field response, running a geospatial decision-support pipeline on AWS.
System Architecture
FloodProof uses a decoupled cloud architecture designed for spatial analysis and durable audit persistence:
plaintext
[ Sentinel-1 SAR Imagery ]│▼┌───────────────────────────────────────────────────┐│ AWS EC2 Production Host (Ubuntu 24.04 LTS) ││ - Nginx Reverse Proxy ││ - Next.js & TypeScript Operator Dashboard ││ - Python Geospatial Engine (Subprocess) ││ * XGBoost Water Detection (VV/VH in dB) ││ * 3x3 Local Mean & Std-Deviation Features ││ * Aligned JRC Water Baseline Filtering ││ * OpenStreetMap Topology & Hole Clipping ││ * Multi-Criteria Inspection Planner │└──────────────────┬────────────────────────────────┘│▼ (IAM Role - No Hardcoded Keys)┌───────────────────────────────────────────────────┐│ Amazon S3 Verification Storage ││ - Object: tasks/verification_tasks.json ││ - Persistent, Timestamped Task History ││ - Recovers when Local Task Storage Missing ││ (Inspection Plans Downloaded Client JSON) │└───────────────────────────────────────────────────┘
AWS Services in Production
1. Amazon EC2
We host the end-to-end stack on an Amazon EC2 instance (Ubuntu 24.04 LTS) behind an Nginx reverse proxy. The virtual server handles concurrent web operations and Python-based spatial processing. The application leverages NumPy and SciPy raster processing to deliver responsive on-host sector updates (<50 ms), while heavy on-demand TIFF inference executes asynchronously in several seconds.
2. Amazon S3
Field verification tasks and transition logs persist to Amazon Simple Storage Service (Amazon S3) at
tasks/verification_tasks.json . When operators record simulated field updates, changes sync to S3 with retry logic. The task API recovers from S3 when local task storage is missing or corrupted. Inspection plans are downloaded client-side as JSON.3. AWS Systems Manager (SSM)
We manage server operations and continuous deployments entirely through AWS Systems Manager Run Command. This enables remote administration without opening inbound SSH (port 22) to the public internet.
4. AWS Identity and Access Management (IAM)
The application accesses Amazon S3 strictly through an attached EC2 IAM instance profile (
floodproof-ec2-role ). No access keys or credentials exist in source code or configuration files, adhering directly to AWS least-privilege security best practices.
Engineering Deep-Dive: Permanent Water & Sector Budgeting
Filtering the Aligned JRC Baseline
Raw radar detection frequently flags false alarms along perennial river channels. FloodProof integrates an aligned JRC-derived permanent water baseline supplied with the dataset. Predicted water falling outside this permanent mask is labeled candidate flood water.
Budget-Constrained Multi-Criteria Planning
Instead of assuming limitless response personnel, FloodProof introduces an operator budget parameter (K). When emergency coordinators set K to 10, the engine ranks the 64 uniform evaluation sectors across the region.
While simple thresholding prioritizes large rural water bodies, FloodProof's Infrastructure First strategy evaluates candidate water against mapped OpenStreetMap road segments and building footprints:
- Area-Only Ranking: Directs teams to large open water extents regardless of human exposure.
- Infrastructure-First Ranking: Redirects inspections to sectors where candidate water intersects primary transport corridors and human settlements.
Reproducible Result: Assam Demonstration Scene
On our historical demonstration scene (
India_591317 , Assam 2016), an operator budget of ten sectors under Infrastructure-First planning captures:- 169.8 out of 245.2 meters of predicted mapped-road overlap (69.25%).
- 0.24 out of 0.28 hectares of predicted mapped-building overlap (85.71%).
Note: These figures represent estimated spatial overlap between candidate water and mapped OSM vectors, not ground-confirmed structural damage or road closures.
A Concrete Debugging Lesson: Normalization Floors
During testing, we discovered a subtle discrepancy between our Python evaluation script and the live Next.js operator dashboard. The benchmark reported 69% road and 86% building coverage at K=10, but the web UI was displaying 85% road and 61% building coverage.
Upon auditing the frontend code in
web/pages/index.tsx , we found that the normalization formula used a hardcoded fallback floor:TypeScript
const maxBldHa = Math.max(...current.sectors.map(s =\> s.building_overlap_ha || 0), 1.0);
In the Assam demonstration scene, the maximum building overlap across any single sector was only 0.09 hectares. By using
1.0 as a floor instead of the true maximum, the frontend artificially compressed the building score by a factor of 11. Consequently, building-heavy sectors (such as Sector 28 and Sector 47) received deflated scores, allowing road-dominated sectors to jump ahead in the ranking queue.Once we aligned the frontend normalization floor to
0.001 to match Python's min-max scaling, the selected sectors in both implementations reconciled identically:text
Reconciled Selected Sectors (K=10):SEC_22, SEC_21, SEC_34, SEC_49, SEC_26, SEC_41, SEC_28, SEC_42, SEC_25, SEC_47
This highlighted a fundamental takeaway: in multi-criteria geospatial decision systems, small discrepancies in score normalization between offline benchmarks and live UI logic can dramatically alter operational field dispatch.
Scientific Limitations & Data Provenance
To maintain scientific integrity, the operational scope of FloodProof is qualified by the following boundaries:
- Historical Demonstration Scope & OSM Context: Infrastructure overlap metrics are evaluated on historical Sentinel-1 imagery paired with present-day OpenStreetMap topologies for one demonstration scene. This provides contextual spatial reference for the satellite observations, rather than a historical reconstruction of infrastructure as it existed in 2016.
- Contextual Exposure vs. Confirmed Damage: The system estimates potential spatial exposure using interactive layered raster rendering. Radar backscatter alone cannot determine flood depth, current flow velocity, or road passability.
- OSM Completeness: Mapped infrastructure depends on OpenStreetMap data density, which may vary across rural regions.
- Simulated Demonstrations: All field dispatch states, team assignments, and verification notes presented in the live walkthrough are simulated operational workflows.
Conclusion & Links
FloodProof demonstrates how preprocessed satellite radar chips can be transformed into actionable, explainable inspection priorities on AWS. By combining EC2 compute, S3 persistence, and IAM least-privilege security, response coordinators can move from raw radar detection to budgeted ground dispatch in minutes.
- GitHub Repository: https://github.com/AmanM006/floodproof
- Hosted Application Workspace: http://44.200.240.31/
- Live Scenes API: http://44.200.240.31/api/scenes
- Evaluation Report: Available in repository at
reports/planner_and_ml_evaluation.md
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article