Skip to content

Repository files navigation

🌊 Flood Risk Prediction System

Predicting flood occurrence using Machine Learning algorithms based on environmental and geographical factors.

Python Scikit-Learn Pandas NumPy License


πŸ“Œ Project Overview

Floods are among the most destructive natural disasters, causing significant damage to human life, infrastructure, and the environment.

This project uses Machine Learning techniques to predict whether a flood is likely to occur based on various environmental and geographical parameters. Three different classification algorithms are implemented and compared to identify the best-performing model.


🎯 Objectives

  • Predict flood occurrence using historical environmental data.
  • Compare the performance of multiple Machine Learning models.
  • Identify the most accurate prediction model.
  • Build a simple and efficient flood prediction system.

πŸ“‚ Dataset Features

The dataset contains the following features:

  • πŸ“ Latitude
  • πŸ“ Longitude
  • 🌧 Rainfall (mm)
  • 🌑 Temperature (Β°C)
  • πŸ’§ Humidity (%)
  • 🌊 River Discharge (mΒ³/s)
  • πŸ“ˆ Water Level (m)
  • β›° Elevation (m)
  • 🌿 Land Cover
  • 🌱 Soil Type
  • πŸ‘₯ Population Density
  • πŸ— Infrastructure
  • πŸ“š Historical Floods

Target Variable

  • Flood Occurred
    • 0 β†’ Low Flood Risk
    • 1 β†’ High Flood Risk

πŸ›  Technologies Used

  • Python
  • Google Colab
  • Pandas
  • NumPy
  • Scikit-learn
  • Matplotlib
  • Seaborn

πŸ€– Machine Learning Models

The following models are implemented:

  • Logistic Regression Classifier
  • Decision Tree Classifier
  • Random Forest Classifier

βš™ Project Workflow

Dataset
    β”‚
    β–Ό
Data Preprocessing
    β”‚
    β–Ό
Encoding Categorical Data
    β”‚
    β–Ό
Train-Test Split
    β”‚
    β–Ό
Model Training
    β”‚
    β–Ό
Prediction
    β”‚
    β–Ό
Performance Evaluation

πŸ“Š Model Performance

Model Accuracy
Logistic Regression 90.15%
Decision Tree Classifier 99.40%
Random Forest Classifier 99.55%

Best Performing Model: Logistic Regression Classifier


πŸ“ Project Structure

Project_1_Flood_Risk_Prediction_System_Using_Machine_Learning/
β”‚
β”œβ”€β”€ Flood_Risk_Prediction_System.ipynb
β”œβ”€β”€ Flood_Risk_Prediction_System.py
β”œβ”€β”€ Dataset/
β”‚   β”œβ”€β”€ flood_risk_india.csv
β”œβ”€β”€ images/
β”‚   β”œβ”€β”€ confusion_matrix.png
β”‚   β”œβ”€β”€ feature_importance.png
β”‚   └── model_accuracy_comparison.png
β”œβ”€β”€ best_model.pkl
β”œβ”€β”€ feature_names.pkl 
β”œβ”€β”€ label_encoders.pkl
β”œβ”€β”€ scaler.pkl 
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
└── LICENSE

πŸš€ Installation

Clone the repository

git clone https://github.com/Tuhin092005/Project_1_Flood_Risk_Prediction_System_Using_Machine_Learning.git

Navigate to the project

cd Project_1_Flood_Risk_Prediction_System_Using_Machine_Learning

Install required libraries

pip install -r requirements.txt

▢️ Run the project

Using Python

python Flood_Risk_Prediction_System.py

Using Google Colab Using Python

Open

Flood_Risk_Prediction_System.ipynb

Upload:

  • flood_risk_india.csv

Run all cells.


πŸ“ˆ Sample Predictions

The model predicts flood risk using two different input scenarios.

πŸ§ͺ Example Prediction 1 (High Flood Risk)

Input

Latitude             : 22.57
Longitude            : 88.36
Rainfall             : 250 mm
Temperature          : 30Β°C
Humidity             : 85%
River Discharge      : 500 mΒ³/s
Water Level          : 8 m
Elevation            : 10 m
Land Cover           : 2
Soil Type            : 1
Population Density   : 5000
Infrastructure       : 1
Historical Floods    : 3

Expected Output

Prediction : 1

Flood Risk : HIGH

A location with heavy rainfall, high humidity, high water level, and multiple historical floods is predicted as High Flood Risk.


πŸ§ͺ Example Prediction 2 (Low Flood Risk)

Input

Latitude             : 23.50
Longitude            : 87.50
Rainfall             : 40 mm
Temperature          : 28Β°C
Humidity             : 55%
River Discharge      : 80 mΒ³/s
Water Level          : 2 m
Elevation            : 120 m
Land Cover           : 1
Soil Type            : 2
Population Density   : 300
Infrastructure       : 3
Historical Floods    : 0

Expected Output

Prediction : 0

Flood Risk : LOW

A location with low rainfall, lower humidity, higher elevation, and no historical floods is predicted as Low Flood Risk.


πŸ“Œ Future Improvements

  • Hyperparameter tuning
  • Cross-validation
  • Feature importance analysis
  • Interactive web application using Streamlit or Flask
  • Real-time weather API integration
  • Interactive dashboard for visualization

πŸ‘¨β€πŸ’» Author

Tuhin Maji

B.Tech in Computer Science & Engineering (AI & ML)

Meghnad Saha Institute of Technology (MSIT), Kolkata


⭐ If you found this project useful

Give this repository a ⭐ and feel free to fork it!


πŸ“œ License

This project is intended for educational and learning purposes.


⭐ Support

If you like this project,

⭐ Star this repository

🍴 Fork this repository

πŸ“’ Share it with others

Happy Coding! πŸš€

About

A Machine Learning-based Flood Risk Prediction System that predicts flood occurrence using environmental and geographical factors with Logistic Regression, Decision Tree, and Random Forest algorithms. Built with Python, Pandas, NumPy, and Scikit-learn.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages