Skip to content

PK007788/Urban_Xray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Flood Intelligence System

Urban Resilience Prototype (SDG-13)

Overview

The AI Flood Intelligence System is a near real-time urban flood and drain overflow alert prototype designed for low-lying areas.

The system integrates drainage health modeling, zone-level aggregation, and machine learning-based probabilistic prediction to generate localized flood risk alerts.

Unlike rainfall-only alert systems, this project models how the drainage network behaves under stress and predicts the probability of flooding within the next one hour.

The system is modular, interpretable, and designed to support future municipal deployment.

This system combines:

Drain-level sensor data

Zone-level aggregation

Physics-informed modeling

Machine Learning-based risk prediction

Interpretable alert generation

Goal

The goal is to enable early, explainable, and localized flood warnings that can support:

Municipal authorities

Urban planners

Citizen reporting systems

Climate resilience initiatives

Problem Context

Urban flooding in low-lying regions is often caused by:

Drain blockages

Reduced drainage efficiency

Cascading drain failures

Persistent overload conditions

Rainfall alone does not reliably indicate flooding risk. The drainage system’s health and degradation dynamics must also be considered.

This project addresses that gap by combining physics-informed features with a probabilistic AI model.

System Architecture

Sensors / Rainfall / Reports
→ Drain-Level Health (DCI)
→ Zone-Level Aggregation
→ Degradation and Flood-Time Dynamics
→ AI Probability Model
→ Risk Interpretation Layer
→ Localized Alerts and Dashboard

Core Components

1. Drainage Condition Index (DCI)

Raw drain sensor readings (water level, flow efficiency, blockage indicators) are normalized into a Drainage Condition Index:

DCI ∈ [0, 1]

Where:

1 represents a fully healthy drain
0 represents a failed or blocked drain

The index is smoothed over time to obtain:

DCI_eff

This reduces noise and captures effective drain health.

2. Zone-Level Feature Engineering

Drains are grouped into zones. From drain-level DCI values, the following zone-level features are computed:

mean_DCI_eff
min_DCI_eff
pct_low_DCI
mean_degradation_rate
min_degradation_rate
degradation_volatility
zone_flood_time_now
zone_flood_slope
zone_flood_volatility
time_under_2hr_min
drains_TTF_lt_1hr
drains_TTF_lt_30min

These features describe:

Current system health
Rate of degradation
Instability and volatility
Persistence under risk conditions
Cascading failure clustering

3. AI Flood Prediction Model

Model Type: Logistic Regression

The model predicts:

Probability of flooding within the next 1 hour

Output:

AI_flood_risk_score ∈ [0, 1]

The choice of logistic regression ensures:

Interpretability
Stable probabilistic output
Real-time compatibility
Low computational overhead

Model evaluation:

ROC-AUC ≈ 0.78
Strong early-warning separation between flood and non-flood states

4. Risk Interpretation Layer

Predicted probability is converted into actionable risk levels:

Probability < 0.30 → LOW
0.30 – 0.50 → WATCH
0.50 – 0.70 → WARNING
≥ 0.70 → CRITICAL

This allows gradual escalation instead of binary alerts.

5. Dashboard Interface

The Streamlit dashboard provides:

Dataset snapshot
AI flood probability viewer
Risk level visualization
ROC curve and performance summary
Probability distribution plots
Feature correlation heatmap
System interpretation text

The dashboard is intended for demonstration, evaluation, and monitoring.

Project Structure

Project Structure

Drain_Intelligence/

├── processing/
│   ├── compute_dci.py
│   ├── compute_degradation.py
│   ├── compute_time_to_failure.py
│   └── compute_zone_basin_flood_time.py
│
├── output/
│   ├── ai_zone_training_dataset.csv
│   ├── ai_zone_risk_score.csv
│   └── zone_flood_prediction.csv
│
├── AI_Flood/
│   ├── training/
│   │   └── train_zone_flood_model.py
│   │
│   ├── inference/
│   │   ├── predict_zone_flood_risk.py
│   │   └── risk_interpretation.py
│   │
│   ├── models/
│   │   └── zone_flood_logistic.pkl
│   │
│   └── analysis/
│       └── flood_model_analysis.ipynb
│
├── dashboard/
│   └── app.py
│
└── README.md

README.md

How to Run

Train the model:

python AI_Flood/training/train_zone_flood_model.py

Run the dashboard:

streamlit run dashboard/app.py

Run inference programmatically:

from AI_Flood.inference.predict_zone_flood_risk import predict_zone_flood_probability

Alignment with SDG-13 (Climate Action)

This system contributes to climate resilience by:

Enabling early flood warnings
Modeling drainage infrastructure vulnerability
Supporting localized disaster mitigation
Providing interpretable decision support

The architecture is modular and can be extended for ward-level or city-level deployment.

Design Principles

Physics-informed feature engineering
Zone-level abstraction
Interpretable probabilistic AI
Real-time safe computation
Modular separation of training and inference
Explainable risk thresholds

Limitations

Currently operates on structured or simulated sensor datasets
Rainfall API integration is not yet live
Citizen reporting integration is conceptual
Geospatial visualization layer is limited

Under Developmental Phase

Real-Time Sensor Integration
MQTT / IoT streaming pipeline
Live DCI updates
Edge-based preprocessing

Rainfall API Integration
OpenWeather or IMD integration
Rainfall-trigger adjustments in zone features

Citizen Reporting Module
WhatsApp or SMS integration
Report-density feature integration
Crowd-sourced validation

Geospatial Mapping
Zone heatmaps
GIS-based overlays
Vulnerability visualization

Advanced Modeling
Random Forest and XGBoost comparison
Time-series models
Adaptive threshold tuning

Alert Automation
SMS push alerts
Escalation pipeline for municipal authorities

Municipal Deployment Path
Ward-level scaling
API service layer
Cloud deployment architecture

Final Statement

Urban flood prediction should not rely solely on rainfall intensity. By modeling drainage health, degradation dynamics, and cascading failures, the AI Flood Intelligence System provides early, explainable, and localized flood risk alerts suitable for resilient urban infrastructure planning.

About

Physics-informed AI system for zone-level urban flood prediction and early warning using drainage health modeling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors