Skip to content
OnlyProjects
B.Tech / B.E. · Artificial Intelligence & Machine LearningFor educational purposes only
Code included

River Water Quality Classification & Screening Tool on CPCB Monitoring Data (Python + MySQL)

Screens CPCB river-water samples into quality bands, flags stations that fail bathing criteria and predicts likely BOD exceedance when lab results are missing

Mapped to your syllabusAnna University Regulation 2021 · CS3811 Project Work / Internship · Semester 8

Overview

1 min read

River Water Quality Classification & Screening Tool is a scoped mini-project in applied machine learning: it takes real water-quality records from the Central Pollution Control Board's National Water Quality Monitoring Programme (NWMP) — hundreds of river, lake and well stations across India measured on parameters such as pH, dissolved oxygen (DO), biochemical oxygen demand (BOD), conductivity and coliform counts — and turns them into two useful things.

First, a compliance audit. Each station-year is checked against CPCB's published water-quality criteria for outdoor bathing (pH 6.5–8.5, DO ≥ 5 mg/L, BOD ≤ 3 mg/L and coliform limits), producing a ranked list of the parameters and stations that fail most often.

Second, a classifier that screens for organic pollution. BOD — the single best indicator of sewage load — needs a five-day laboratory incubation and is the parameter most often missing from a monitoring record. The project trains a logistic-regression baseline and an explainable decision-tree classifier in scikit-learn to predict whether a sample likely exceeds the BOD limit from the parameters that are quickly available (DO, pH, temperature, conductivity), evaluated with stratified k-fold cross-validation, confusion matrices and precision/recall for the exceedance class.

A small Django web app over MySQL stores stations, samples and predictions, accepts a CSV of new readings or a single manual entry, and shows the screened band with the parameters most likely to fail. The scope is deliberately modest: one dataset, two models, one app — completed and defended well beats an ambitious half-built system.

Relevant for
Tamil Nadu
Level
Beginner · 12 weeks · solo
Common at
Anna University, Visvesvaraya Technological University, JNTU Hyderabad
Updated
Oct 2026

Syllabus alignment

Anna University · Regulation 2021

CS3811 · Project Work / Internship · Semester 8 · 10 credits

Subjects this project applies
  • CS3361 Data Science Lab (NumPy / pandas / Matplotlib)
  • CS3491 Artificial Intelligence & Machine Learning (scikit-learn)
  • CS3481 DBMS Laboratory (SQL / MySQL)
  • CCS375 Web Technologies (Django)
  • Python programming
How it is evaluated

Team: individually or as a group (number set by college, typically 3–4)

report in university-prescribed format + viva-voce by panel including external examiner

Also fits: VTU 2022 Scheme (OBE/CBCS), JNTUH R22.

What's in the box

11 parts · 5 free · 2 previewed · 4 unlock for ₹2,000

Problem & synopsis

5 min read

Problem statement

CPCB's NWMP network publishes thousands of river-water measurements every year, but three problems keep the data from being used at the ground level. First, the records are spread across portal pages and reports in formats that need cleaning before any analysis. Second, BOD — the parameter that best indicates sewage contamination — requires a five-day lab test, and it is precisely the one most often missing, so many samples cannot be judged for organic pollution at all. Third, officials and citizens have no simple way to see which stations repeatedly fail the published bathing criteria and why.

There is a need for a beginner-built but methodologically sound tool that consolidates NWMP data into one clean table, audits every sample against CPCB's criteria, and uses a transparent scikit-learn classifier to screen samples with missing BOD from the parameters that are measured on the spot — flagging likely exceedances for follow-up testing instead of leaving them blank.

Synopsis

Abstract

India's rivers are monitored by a large public network, yet the monitoring data rarely reaches a student, NGO or panchayat in a usable form, and one key number — BOD, the main signal of organic (sewage) pollution — is slow and costly to measure, so records frequently ship with it blank. This mini-project builds a pandas pipeline over CPCB's NWMP station data, audits compliance against CPCB's bathing-water criteria, and trains a screening classifier that flags likely BOD exceedance from instant-read parameters, wrapped in a small Django/MySQL web tool.

Introduction

The National Water Quality Monitoring Programme runs a network of hundreds of stations on rivers, lakes, canals and wells, sampled monthly or quarterly; the certified datasets are published through the National Water Data Portal and CPCB's NWMP pages. For a beginner data-science student this is an ideal first real dataset: tabular, small enough for a laptop, publicly sourced, and connected to a topic every examiner in Tamil Nadu understands — the state of the Cauvery, Vaigai and Adyar rivers.

Existing System

  • CPCB publishes the raw records and annual reports; analysis is left to the reader.
  • State pollution-control board dashboards show current readings but no screening when a parameter is missing.
  • Research papers model water quality with remote sensing or deep learning — beyond a beginner's semester and hard to verify.
  • Gap: no simple, reproducible tool that (a) audits stations against the published criteria and (b) gives a defensible estimate of organic-pollution risk when BOD is unavailable.

Proposed System

  • A cleaned station-sample table (station, date, pH, DO, BOD, conductivity, temperature, coliform) built from the NWMP downloads with a documented missing-value policy.
  • A rule-based audit flagging each sample against the bathing criteria and summarising failures by station, river and year.
  • A screening classifier — logistic regression as baseline, decision tree for explainability — predicting the BOD-exceedance class from co-measured quick parameters, with stratified 5-fold cross-validation and a precision/recall report for the exceedance class (recall matters most: a missed polluted sample is the costly error).
  • A Django + MySQL tool: upload a monitoring CSV or type one reading; the app stores it, returns the screened band, lists the parameters likely to fail and plots the station's trend.

Feasibility Study

  • Technical: the dataset is a few MB of CSV; pandas, scikit-learn and Django are already taught in CS3361, CS3491 and CCS375; everything runs on an average laptop.
  • Economic: zero cost — public data, open-source stack.
  • Operational: the tool needs no training; the audit table alone is immediately useful for a college environment audit or an NGO report. The honest limitation — screening estimates risk, it does not replace the lab BOD test — is printed on the results page.

Objectives

  1. 01Download and consolidate CPCB NWMP water-quality records into one tidy station-sample table with a documented cleaning and missing-value policy.
  2. 02Audit every sample against CPCB's bathing-water criteria (pH, DO, BOD, coliform) and rank stations by repeat failures.
  3. 03Derive the BOD-exceedance class from the BOD readings where present, and train a logistic-regression baseline to predict it from quick parameters.
  4. 04Train an explainable decision-tree classifier on the same task and compare it with the baseline using stratified 5-fold cross-validation.
  5. 05Report precision and recall for the exceedance class and justify prioritising recall over precision for a screening tool.
  6. 06Store stations, samples and predictions in MySQL and expose them through a three-page Django app with CSV upload and manual entry.
  7. 07Visualise station trends and failure hot-spots with Matplotlib charts embedded in the app.

Scope

In scope

  • CPCB NWMP surface-water records for a bounded period (for example 2017–2022) and a chosen set of rivers/stations; the loader accepts the portal's CSV format.
  • Six parameters: pH, DO, BOD, conductivity, temperature and total/faecal coliform.
  • Rule-based compliance audit against the Class-B bathing criteria.
  • Two classifiers (logistic regression, decision tree) with k-fold cross-validation; optional k-NN comparison.
  • Django app: station list, sample entry/CSV upload, screening result page with trend chart; MySQL storage.

Out of scope (v1)

  • Groundwater and coastal stations (different criteria tables).
  • Real-time sensor feeds from continuous monitoring stations.
  • Deep-learning or satellite-based models.
  • Prediction of exact BOD values (this is a classification screening, not a lab substitute).
  • Multi-user authentication beyond Django's admin — the tool is single-department oriented.

Methodology

The project follows a linear (waterfall-style) plan with a small evaluation loop at the model stage — appropriate for a 12-week, single-person mini-project where requirements are stable and the risk sits in model quality, not in scope creep.

PhaseWeeksActivitiesDeliverable
Requirements & data study1–2Study CPCB criteria and NWMP data format; finalise parameter list and target classRequirement notes + data dictionary
Data preparation3–4Clean and merge the NWMP CSVs; missing-value policy; build the audit tableClean dataset + audit summary
Modelling & evaluation5–7Class derivation, logistic baseline, decision tree, stratified 5-fold CV, precision/recall analysisModel comparison report
Application8–9Django models, CSV upload, screening view, Matplotlib trend chartsWorking app on local server
Testing & documentation10pytest units for cleaning and thresholds; Django tests for the predict view; screenshot passTest report
Report & viva prep11–12Final report in the university format; rehearse viva with the model metrics on one slideFinal submission

Evaluation protocol: the classifier is never judged on accuracy alone — the exceedance-class confusion matrix per fold is the reported result, and the decision tree's learned thresholds are printed and compared with the CPCB criteria as a sanity check.

Architecture & tech stack

3 diagrams · 7 technologies · 1 min read

  • Python
  • pandas
  • NumPy
  • Matplotlib
  • scikit-learn
  • MySQL
  • Django

The tool is a simple three-tier application with an offline analysis stage. A Python pipeline stage cleans the CPCB CSVs and computes the audit table; the model stage trains and serialises the classifier; the Django app then serves stations, samples and screening results from MySQL.

flowchart TD
  A["CPCB NWMP CSV downloads"] --> B["pandas cleaning pipeline"]
  B --> C["MySQL: stations & samples"]
  B --> D["Compliance audit vs bathing criteria"]
  C --> E["Model training (scikit-learn)"]
  E --> F["Serialised classifier (joblib)"]
  F --> G["Django app"]
  C --> G
  G --> H["Screening result page + trend chart"]
  G --> I["CSV upload / manual sample entry"]

ER diagram

erDiagram
  STATION ||--o{ SAMPLE : "is sampled at"
  SAMPLE ||--o{ PREDICTION : "is screened as"
  STATION {
    int station_id PK
    string station_name
    string river_name
    string station_type
  }
  SAMPLE {
    int sample_id PK
    int station_id FK
    date sampled_on
    float ph
    float do_mg_l
    float bod_mg_l
    float conductivity
    int coliform_mpn
  }
  PREDICTION {
    int prediction_id PK
    int sample_id FK
    string model_name
    int class_label
    float probability
    string flagged_params
  }

DFD level 0

flowchart LR
  U(["Student / NGO analyst"]) -- "CSV upload or manual reading" --> SYS(("Water Quality<br/>Screening Tool"))
  SYS -- "band, flagged parameters, trend chart" --> U
  C(["CPCB NWMP portal"]) -- "station CSV exports" --> SYS

One request walk-through: the analyst uploads a month of readings; Django parses the CSV with validation, inserts SAMPLE rows, runs each through the serialised classifier when BOD is blank, and renders the screening page with the band, probability and the parameters most likely to fail.

Modules

4 modules

  1. Module 01

    Data Preparation & Compliance Audit

    Reads the NWMP CSV exports, normalises station names and parameter columns, applies the missing-value policy (drop samples lacking the target; impute median within station for non-target gaps), and produces the audit table: per sample, pass/fail against the pH, DO, BOD and coliform criteria, rolled up by station, river and year. Emits a data dictionary so the grader can trace every column.

  2. Module 02

    Classification Models & Evaluation

    Derives the BOD-exceedance label where BOD exists, trains the logistic-regression baseline and the decision tree on quick parameters (DO, pH, conductivity, temperature), runs stratified 5-fold cross-validation, and reports the confusion matrix, precision and recall for the exceedance class per fold. The tree's learned thresholds are printed against CPCB's criteria as an interpretability check, and the better model is serialised with joblib for the app.

  3. Module 03

    Django Screening Tool & MySQL Storage

    Django models map the STATION / SAMPLE / PREDICTION schema into MySQL. The app has three pages: station list with failure counts, a sample-entry page (CSV upload with row-level validation, or one manual reading), and a result page that returns the screened band, probability, flagged parameters and a Matplotlib trend chart. Django's admin gives a free back-office for corrections.

  4. Module 04

    Testing, Documentation & Viva Pack

    pytest units for the cleaning functions and threshold logic, Django tests for the upload and predict views against a seeded fixture database, the README runbook, and the viva pack: one slide with the confusion matrix, one with the decision-tree thresholds and one with the audit findings for the chosen rivers.

Slides

11 slides · titles free · bullets, notes and the .pptx unlock

  1. Slide 1

    River Water Quality Classification & Screening Tool

  2. Slide 2

    Motivation

  3. Slide 3

    Problem Statement & Objectives

  4. Slide 4

    Data Source — CPCB NWMP

  5. Slide 5

    System Design

  6. Slide 6

    Compliance Audit

  7. Slide 7

    Screening Model

  8. Slide 8

    Evaluation

  9. Slide 9

    Demo

  10. Slide 10

    Limitations & Future Scope

  11. Slide 11

    Conclusion & References

Bullets, speaker notes and the .pptx · ₹2,000

The titles above are the real outline. The rest is what you present from.

Unlock for ₹2,000

Viva questions & answers

3 of 14 answered free · 11 unlock

Read each answer, close it, and say it in your own words. Your viva will ask. Now you'll know.

  1. 01Concept

    Why is BOD the central parameter in your project?

    BOD measures how much oxygen microbes will consume decomposing organic matter, so it directly reflects sewage load — the most common river pollutant in India. It is central for two reasons: environmentally it is the best single indicator of organic pollution, and practically it needs a five-day incubation, which is exactly why it goes missing in monitoring records and why a screening model is useful.

  2. 02Concept

    Your class label is derived from the same dataset — isn't the classification circular?

    Good question — the label comes from BOD readings, but the features deliberately exclude BOD and use only the quick parameters. The model learns whether DO, pH, conductivity and temperature carry enough signal to estimate the BOD class when the lab test is unavailable. Circularity would only occur if BOD itself were a feature; a leakage test in the pipeline asserts it never is.

  3. 03Concept

    What is stratified k-fold cross-validation and why stratified here?

    Stratified 5-fold cross-validation splits the data into five parts while keeping the class ratio — here, samples exceeding the BOD limit versus not — the same in every fold. Stratification matters because exceedances are the minority class; plain random folds could leave a fold with almost no positive samples and make the recall estimate meaningless.

+11 more questions, with answers

Try the free ones out loud first. Your examiner will not accept “it's in the PPT”.

Source code & how to run

8 steps · complete source code · unlocks with the project

Unlocks with the project · ₹2,000

8 steps · source code zip

Prerequisites, install, seed data and tests, written for demo day. Plus the complete source.

Unlock for ₹2,000

READMEFIRST

281 words · unlocks with the project

What to change before it goes anywhere near a submission. Skipping it is how the demo fails live.

Unlocks with the project · ₹2,000

281 words · ~1 min read

The checklist of things to rename, re-seed and re-think so the project reads as yours.

Unlock for ₹2,000

Instructions

327 words · unlocks with the project

How to study it, adapt it and walk your examiner through it, step by step.

Unlocks with the project · ₹2,000

327 words · ~2 min read

Report structure, formatting rules and the submission checklist your department will grade.

Unlock for ₹2,000

References

8 sources

  1. National Water Data Portal (NWIC) — Water Quality datasets (CPCB NWMP)
  2. Central Pollution Control Board — Water Quality Management (NWMP data and monitoring network)
  3. PIB — CPCB water-quality monitoring network coverage (press release)
  4. scikit-learn User Guide — classification, model evaluation and cross-validation
  5. Django documentation
  6. Bureau of Indian Standards, IS 10500:2012 — Drinking Water Specification
  7. Aurélien Géron, Hands-On Machine Learning with Scikit-Learn, Keras & TensorFlow, 3rd ed., O'Reilly
  8. Wes McKinney, Python for Data Analysis, 3rd ed., O'Reilly

Cite this bundle

OnlyProjects. (2026). River Water Quality Classification & Screening Tool on CPCB Monitoring Data (Python + MySQL): B.Tech / B.E. Artificial Intelligence & Machine Learning project bundle [Educational resource]. https://onlyprojects.online/projects/btech-aiml-river-water-quality-classification-cpcb-nwmp

Future scope

1 min read

  • Add a per-station time-series forecast (next-season band) once the screening classifier is stable.
  • Extend to groundwater stations with the separate criteria table.
  • Replace fixed thresholds with CPCB's Water Quality Index scoring once the portal exposes it consistently.
  • A Tamil-language results page for field volunteers.
  • Scheduled refresh: re-download the portal CSVs each quarter and re-run the audit automatically.
  • Optional k-NN or random-forest comparison as a fifth-chapter experiment for students who want more.

Keep browsing

Same degree, same syllabus slot, different idea. Pick the one your guide will actually approve.

B.Tech / B.E.Code included

Aerospace / Aeronautical

Low-Speed Open-Circuit Wind Tunnel with Force Balance for Aerofoil Lift-Drag Measurement

Build a subsonic test tunnel on a student budget, then trace lift and drag on a 3D-printed NACA 0012 against theory

  • C / Arduino Uno (industry-standard extra) — HX711 load-cell and serial logging firmware
  • Python (NumPy, Matplotlib) — calibration, force coefficients and plots
  • MATLAB / Scilab — thin-airfoil theory overlay and regression
  • +4

intermediate14 wk4 students