The Smart Water Leak Detection System leverages Machine Learning and Interactive Dashboards to detect and monitor water leakages in pipelines. It uses IoT sensor data (pressure, flow rate, vibration, temperature, etc.) and provides real-time leak detection, what-if analysis, batch predictions, and geo-visualization.
This project consists of:
- ML Models (Jupyter Notebook): Training and evaluation (
water_leak_detection.ipynb). - Frontend Dashboard (Streamlit App): Interactive monitoring (
app.py).
- Leak Prediction – Detect leakage for individual pipeline inputs using trained ML models (Random Forest, Decision Tree, Logistic Regression, SVM).
- What-if Analysis – Simulate different sensor values with sliders and instantly see prediction changes.
- Zone Map & Geo Analysis – Interactive GIS map showing leak locations, active/dead pipes, and zone-wise analytics.
- Batch Prediction – Upload a CSV dataset for bulk leak detection with downloadable results.
- Analytics & Insights – Feature importance, model comparisons, and system insights.
- AI Assistant (Groq LLaMA Model) – Ask AI for leak trends, maintenance insights, and generate plots dynamically.
- About Page – Quick overview of the system.
- Frontend: Streamlit
- Visualization: Plotly, Folium (maps), Streamlit-Folium
- Machine Learning: Scikit-learn (Random Forest, Decision Tree, Logistic Regression, SVM)
- AI Assistant: Groq API (LLaMA models)
- Data Handling: Pandas, NumPy
Smart-Water-Leak-Detection/
│── frontend/ # Streamlit or Flask/Django app
│ └── app.py
│
│── ml_model/ # Notebooks + model files
│ └── water_leak_detection.ipynb
│
│── data/ # Datasets
│ ├── location_aware_gis_leakage_dataset.csv
│ └── testing.csv
│── requirements.txt # Dependencies
│── .gitignore
│── README.md
git clone https://github.com/your-username/Smart-Water-Leak-Detection.git
cd Smart-Water-Leak-Detectionpython -m venv venv
source venv/bin/activate # On Linux/Mac
venv\Scripts\activate # On Windowspip install -r requirements.txtOpen water_leak_detection.ipynb in Jupyter Notebook / JupyterLab:
jupyter notebook water_leak_detection.ipynbThis will allow you to retrain and export .pkl models.
streamlit run app.pyThe app will open in your browser at:
http://localhost:8501
Navigate using Sidebar Menu:
- Predict Leakage Input pipeline parameters & predict.
- What-if Analysis Adjust sliders for simulations.
- Zone Map & Geo Analysis Visualize leaks on interactive maps.
- Batch Prediction Upload CSV for bulk predictions.
- Analytics & Insights Explore feature importance & model comparison.
- AI Assistant Ask questions and request plots.
Dataset Requirements (for Batch Prediction & AI Assistant):
- Columns:
Pressure, Flow_Rate, Temperature, Vibration, RPM, Operational_Hours, Latitude, Longitude, Zone, Block, Pipe, Location_Code, Leakage_Flag(optional)
- Random Forest: 0.98 accuracy (best performing)
- Decision Tree: 0.91 accuracy
- SVM: 0.90 accuracy
- Logistic Regression: 0.89 accuracy