Skip to content

Repository files navigation

💧 AquaOS — AI Water Quality Monitoring System

Intelligent water analysis powered by Hybrid AI (Machine Learning + Explainable Logic)


🚀 Overview

AquaOS is a data-driven water quality monitoring platform designed to evaluate, interpret, and track water safety using a combination of machine learning models and AI-based reasoning.

The system transforms raw sensor inputs into:

  • Clear safety decisions
  • Quantifiable risk scores
  • Structured explanations

It is built to simulate real-world monitoring environments such as:

  • Water treatment facilities
  • Environmental monitoring systems
  • Reservoir and river analysis

🧠 Core Concept — Hybrid AI

Unlike traditional systems that only classify results, AquaOS uses a multi-layered AI architecture:

Layer Function
ML Model (Random Forest) Predicts water quality score
Rule-Based Engine Explains decisions
Risk Engine Evaluates future degradation
AI Advisor Provides domain-level insights

This enables the system to be both: ✔ Predictive
✔ Explainable


🔬 Parameters Analyzed

The system evaluates key indicators of water safety:

  • pH Level — acidity/alkalinity balance
  • Turbidity — suspended particles
  • Total Dissolved Solids (TDS) — dissolved substances
  • Dissolved Oxygen — oxygen availability

⚙️ Core Capabilities

🤖 AI-Based Water Analysis

  • Predicts Water Quality Score (0–100)
  • Classifies:
    • SAFE
    • UNSAFE
  • Processes real-time or simulated data

🧠 Explainable AI (XAI)

  • Identifies root causes of contamination
  • Provides scientific reasoning
  • Generates corrective recommendations

Not just what happened, but why it happened


📊 Water Quality Index (WQI)

Score Range Classification
90 – 100 Excellent
70 – 89 Good
50 – 69 Fair
25 – 49 Poor
0 – 24 Hazardous

🔮 Risk Assessment

  • Evaluates future degradation probability
  • Categorizes risk:
    • LOW
    • MODERATE
    • HIGH

🧪 Scenario Simulation

  • Modify parameters dynamically
  • Observe impact on water safety
  • Enables predictive experimentation

📊 Reports & History (UPDATED)

  • Persistent storage using SQL (SQLite + SQLAlchemy)
  • User-specific report tracking
  • AI explanations stored with each record
  • Downloadable analysis reports

🔐 Authentication & Access Control

  • JWT-based authentication
  • Role-based system:
Role Access
Admin Full system control
Staff Analysis + monitoring
Student Limited access

🧠 AI Advisor

  • Answers water-related queries
  • Provides contextual explanations
  • Supports learning and decision-making

🖥 Desktop Application

  • Runs as standalone software
  • Built using:
    • PyWebView
    • PyInstaller

🏗 System Architecture


Frontend (Streamlit UI)
↓
FastAPI Backend (API Layer)
↓
Hybrid AI Engine
├── ML Model (Prediction)
├── Rule Engine (Explainability)
└── Risk Engine
↓
Database (SQLite)
↓
Reports & Visualization


🛠 Tech Stack

Backend

  • Python
  • FastAPI
  • SQLAlchemy
  • Uvicorn

Frontend

  • Streamlit
  • Plotly
  • Pandas

AI / ML

  • Scikit-learn (Random Forest)
  • Hybrid AI Logic

Security

  • JWT Authentication
  • Role-Based Access Control

Database

  • SQLite

Desktop

  • PyWebView
  • PyInstaller

📂 Project Structure


backend/
├── main.py
├── ai_engine.py
├── ai_advisor.py
├── auth.py
├── models.py
├── database.py
├── report_generator.py
├── train_model.py
├── model.pkl

frontend/
├── pages/
│   ├── _Dashboard.py
│   ├── _AI_Analysis.py
│   ├── _Reports.py
│   ├── _Devices.py
│   ├── _About_System.py
│   └── _User_Management.py
│
├── components/

desktop_launcher.py
water_quality.db


⚙️ Installation

git clone https://github.com/your-username/aquaos-water-monitoring.git
cd aquaos-water-monitoring

pip install -r requirements.txt

▶️ Run the System

Full Desktop App

python desktop_launcher.py

OR Run Separately

Backend:

uvicorn backend.main:app --reload

Frontend:

streamlit run frontend/pages/_Dashboard.py

📌 Example Input

Parameter Value
pH 7.2
Turbidity 3
TDS 350
Dissolved Oxygen 6

🔥 Key Highlights

  • Hybrid AI (ML + Explainability)
  • Real-time decision system
  • Scenario simulation engine
  • User-specific data tracking
  • Structured reporting system

🔮 Future Scope

  • IoT sensor integration
  • Real-time streaming pipelines
  • Cloud deployment
  • Advanced anomaly detection
  • Continuous model retraining

📜 License

For educational and research purposes.

About

AI Water Quality Monitoring System is an intelligent platform that analyzes water quality using parameters like pH, turbidity, TDS, and dissolved oxygen. It provides AI-based safety analysis, Water Quality Index scoring, risk prediction, historical trends, report generation, and an interactive dashboard for monitoring water conditions.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages