Inspiration

Pakistan loses billions of dollars to floods every year, and the 2010 and 2022 floods displaced tens of millions of people. The worst moment to be blind is during the monsoon, because optical satellites can't see through the clouds. We wanted a system that works exactly when the sky is closed: it sees water through the clouds, tells authorities how bad it is compared to the worst flood in living memory, and turns that into an action.

What it does

FloodSense-PK is a national flood intelligence and early-warning platform that fuses three evidence streams:

  • Now: Sentinel-1 radar (SAR) plus a U-Net segmentation model finds floodwater through clouds and at night.
  • Then: Landsat-5 imagery of the 2010 Great Pakistan Floods gives a historical benchmark. A "Delta Severity" metric shows whether today is worse or safer than 2010.
  • Live: A scraper reads river discharge from Pakistan's Flood Forecasting Division and classifies barrages as NORMAL, HIGH or EXTREME.

On top of that, it provides:

  • A transparent risk score from 1 to 10: 40% flood extent, 30% delta vs 2010, 30% river status.
  • A four-agent disaster workflow (Disaster Intelligence → Simulation → Response & Communication) that classifies risk, projects flood growth over 6/12/24/48 hours, warns downstream districts with ETAs, and drafts citizen and authority alerts.
  • AI tactical reports (Gemini, with Groq as fallback) grounded in the real numbers.
  • A RAG Knowledge Assistant that answers questions with cited sources.
  • Personal flood-alert emails with the nearest safe zone, distance and travel time.
  • Three frontends: a Streamlit dashboard, a React web console backed by a FastAPI REST API, and a Flet mobile app covering 148 districts.

How we built it

  • Satellite pipeline: Google Earth Engine pulls Sentinel-1 VV composites and applies an SRTM slope mask to cut terrain false positives. Landsat-5 MNDWI, minus 2009 permanent water, reconstructs the 2010 flood footprint.
  • Deep learning: A U-Net with a ResNet34 encoder (PyTorch, segmentation-models-pytorch) was trained on Sen1Floods11 with Dice + Focal loss. It reached 0.5503 validation IoU. Large tiles are sliced into 256×256 patches and stitched back into one mask and probability map.
  • Risk and simulation: The risk score is a weighted formula. The simulation agent uses a volume-balance model: net river flux that spills overbank accumulates as water volume and spreads over the floodplain at an assumed depth.
  • RAG: A knowledge PDF is parsed with pypdf, chunked, embedded with all-MiniLM-L6-v2 and stored in Qdrant. Retrieved context feeds both the chatbot and the Disaster Intelligence Agent.
  • Backend and frontends: FastAPI with MongoDB Atlas, JWT auth and background analysis jobs; React 19 + Vite + TypeScript + Tailwind v4 + TanStack Query; Streamlit and Flet.

Challenges we ran into

  • Cloud-covered monsoon scenes, which is why we chose SAR over optical imagery.
  • Running a model trained on global data on Pakistan, where domain shift is real and flooded vegetation and urban areas are hard for SAR.
  • Comparing 2010 optical data with current SAR. We treat the delta as a benchmark indicator, not a pixel-perfect difference.
  • Keeping the fragile FFD scraper working when the portal layout changes.
  • Running large GEE exports and tiled inference without blocking the UI, which led to the background job design.

Accomplishments that we're proud of

  • An end-to-end system from raw radar pixels to a citizen alert in someone's inbox.
  • A risk score that is transparent and explainable, not a black box.
  • An agent pipeline that is deterministic and testable without any API keys, with graceful fallbacks when services are down.

What we learned

SAR physics for water detection, tiled inference for large rasters, how to ground LLM output in real numbers, and how to design a decoupled API for web and mobile clients.

What's next for FloodSense-PK

  • Fine-tune the model on Pakistan-specific flood labels.
  • Use true dual-polarization (VV + VH) instead of approximating VH.
  • Combine with DEM and optical data for urban flooding.
  • Add SMS and WhatsApp alerts, and partnerships with NDMA and provincial authorities.

Built With

  • fastapi
  • flet
  • gemini-api
  • geopandas
  • google-earth-engine
  • groq
  • landsat-5
  • mongodb-atlas
  • plotly
  • pydantic
  • pydeck
  • python
  • pytorch
  • qdrant
  • rasterio
  • react
  • segmentation-models-pytorch
  • sentence-transformers
  • sentinel-1
  • streamlit
  • tailwindcss
  • tanstack-query
  • typescript
  • u-net
  • vite
Share this project:

Updates

Submission history