An open API service indexing awesome lists of open source software.

https://github.com/yashpotdar-py/flood-vision

Flood Vision - A deep learning–based computer vision system for flood mapping and damage assessment using aerial imagery.
https://github.com/yashpotdar-py/flood-vision

cuda deep-learning flood-detection iot python

Last synced: 2 months ago
JSON representation

Flood Vision - A deep learning–based computer vision system for flood mapping and damage assessment using aerial imagery.

Awesome Lists containing this project

README

          

# 🌊 Flood Vision: Flood Mapping and Damage Segmentation System

![Python](https://img.shields.io/badge/Python-3.13-blue?logo=python)
![PyTorch](https://img.shields.io/badge/PyTorch-2.x-orange?logo=pytorch)
![CUDA](https://img.shields.io/badge/CUDA-Enabled-green?logo=nvidia)
![Status](https://img.shields.io/badge/Status-In_Development-yellow)
![License](https://img.shields.io/badge/License-Academic-lightgrey)

> **Flood Vision** - A deep learning–based computer vision system for flood mapping and damage assessment using aerial imagery.

---

## 🧭 Overview

**Flood Vision** is a computer vision system designed to automatically analyze aerial or drone footage from flood-affected regions.
It uses **semantic segmentation** to identify and label key terrain types such as **water**, **flooded buildings**, **vegetation**, and **roads**, helping researchers and responders estimate affected areas efficiently.

The project focuses on **robust image segmentation** and **high-speed inference** on CUDA-enabled devices.

---

## βš™οΈ Features Implemented

- βœ… 4-class **semantic segmentation model**
- βœ… **Weighted loss** for handling class imbalance
- βœ… **CUDA acceleration** for efficient GPU training
- βœ… **Video and image inference**
- βœ… **Color-coded visual outputs**
- βœ… **FloodNet dataset** integration
- βœ… Modular and extendable PyTorch architecture

---

## πŸ§ͺ Tech Stack

| Component | Technology |
|------------|-------------|
| **Language** | Python 3.13 |
| **Framework** | PyTorch |
| **GPU Acceleration** | NVIDIA CUDA |
| **Data Augmentation** | Albumentations |
| **Video/Image Processing** | OpenCV |
| **Visualization** | Matplotlib |
| **Loss Function** | Weighted Cross-Entropy |

---

## πŸ—‚οΈ Dataset

This project uses the **FloodNet** dataset for supervised training.

πŸ“š **Dataset Link:**
[https://github.com/BinaLab/FloodNet-Supervised_v1.0](https://github.com/BinaLab/FloodNet-Supervised_v1.0)

### πŸ“– Citation

```bibtex
@ARTICLE{9460988,
author={Rahnemoonfar, Maryam and Chowdhury, Tashnim and Sarkar, Argho and Varshney, Debvrat and Yari, Masoud and Murphy, Robin Roberson},
journal={IEEE Access},
title={FloodNet: A High Resolution Aerial Imagery Dataset for Post Flood Scene Understanding},
year={2021},
volume={9},
pages={89644-89654},
doi={10.1109/ACCESS.2021.3090981}
}
````

---

## 🧰 Installation

### 1️⃣ Clone the repository

```bash
git clone https://github.com/yashpotdar-py/flood-vision.git
cd flood-vision
```

### 2️⃣ Create and activate a virtual environment

```bash
python -m venv .venv
.\.venv\Scripts\activate
```

### 3️⃣ Install dependencies

```bash
pip install -r requirements.txt
```

### 4️⃣ (Optional) Verify CUDA availability

```bash
python -c "import torch; print(torch.cuda.is_available())"
```

---

## πŸ‹οΈβ€β™‚οΈ Training

Train the segmentation model with:

```bash
python -m train.train_segmentation_4class
```

The training script:

- Loads images and masks from the FloodNet dataset
- Applies Albumentations-based augmentations
- Uses a **weighted loss** for balanced learning
- Logs metrics like IoU and validation loss

---

## πŸ” Inference

Run segmentation on an image or video:

```bash
python -m inference.run_inference --input data/videos/test1.mp4 --output results/output.mp4
```

### Color Legend

| Class | Color | Description |
| ----------------- | --------- | --------------------|
| Water | 🟦 Blue | Flooded water areas|
| Flooded Buildings | πŸŸ₯ Red | Buildings under water|
| Vegetation & Roads| 🟩 Green | Trees, fields, grass, Streets and infrastructure|

The processed video will be saved in `results/output_videos/`.

---

## πŸ“ Project Structure

```plaintext
flood-vision/
β”‚
β”œβ”€β”€ data/
β”‚ β”œβ”€β”€ images/
β”‚ β”œβ”€β”€ masks/
β”‚ └── videos/
β”‚
β”œβ”€β”€ train/
β”‚ β”œβ”€β”€ train_segmentation_4class.py
β”‚ └── utils/
β”‚
β”œβ”€β”€ inference/
β”‚ β”œβ”€β”€ run_inference.py
β”‚
β”œβ”€β”€ models/
β”‚ β”œβ”€β”€ unet.py
β”‚ └── loss_utils.py
β”‚
β”œβ”€β”€ results/
β”‚ └── output_videos/
β”‚
└── README.md
```

---

## πŸ“Š Sample Metrics (Training Snapshot)

| Metric | Value |
| --------------- | ----- |
| Mean IoU | 0.74 |
| Pixel Accuracy | 0.90 |
| Validation Loss | 0.27 |

---

## πŸ‘¨β€πŸ’» Authors

**Developed by:**

- **Yash Potdar** - Model architecture & deployment, CUDA optimizations
- **Sahil Pawar** - Data preprocessing, model training, testing& evaluation
- **Akanksha Singh** - Web interface design, documentation, and system integration

**Affiliation:**

πŸŽ“ Final-Year B.E. Project,
Department of Artiticial Intelligence & Data Science
AISSMS Institute of Information Technology (AISSMS)

---

## πŸ“œ License

This project is intended for **academic and research purposes**.
The **FloodNet dataset** belongs to its original authors.
Please cite the dataset and this repository when used in derivative works.

---

## πŸ™ Acknowledgments

- [FloodNet Dataset](https://github.com/BinaLab/FloodNet-Supervised_v1.0)
- [PyTorch](https://pytorch.org/)
- [Albumentations](https://albumentations.ai/)
- [OpenCV](https://opencv.org/)

---

> *"Mapping floods through vision - towards smarter, data-driven disaster response."*

---