AI & Machine Learning
Daily Outpatient Footfall Forecasting for a District Hospital OPD (Python, Keras, MySQL)
Forecast daily OPD crowds department by department, and plan the doctor roster before the Monday rush arrives
- Python
- pandas
- statsmodels
- +4
Predict tomorrow's air quality band for every Bengaluru monitoring station, before the morning commute
Mapped to your syllabusBCU SEP 2024 · 24BCAPJ Project · Semester 5Bengaluru AQI Forecaster is a machine-learning project that predicts the next day's Air Quality Index (AQI) for each air-monitoring station in Bengaluru and converts every forecast into the matching health-advisory band of the CPCB's National AQI scale — Good, Satisfactory, Moderate, Poor, Very Poor or Severe.
India's National Air Quality Index, launched in 2014, compresses readings of eight pollutants into one 0–500 number and six colour-coded bands. Bengaluru, a city of over eleven million people, is covered by only about a dozen continuous monitoring stations operated by the CPCB and the Karnataka State Pollution Control Board, and what citizens see today is a bulletin of current values — never a warning about tomorrow. Morning walkers, schools, outdoor workers and asthma patients learn that the air turned Poor only after it has already turned Poor. This project closes that gap with open data: it pulls station-level readings from the Government of India's data.gov.in platform, learns each station's seasonal and weekly behaviour, and predicts tomorrow's AQI per station.
The stack follows the BCA syllabus closely: Python for the pipeline, scikit-learn for the models, MySQL for storage and Power BI for analytics, with Flask added as an industry-standard extra to serve the dashboard. It demonstrates the complete data-science workflow — ingestion, cleaning, feature engineering, model comparison, evaluation against a persistence baseline and deployment — which makes it a solid, viva-defensible choice for a BCA project in the AI/ML stream.
Syllabus alignment
Bengaluru residents currently get air-quality information only as current readings from CPCB/KSPCB bulletins and apps. There is no public, station-wise forecast for tomorrow, so sensitive groups — asthma patients, children, outdoor workers, morning exercisers — cannot plan around the Poor-band episodes that repeatedly occur in winter and after festivals. Behind this sit concrete data problems: a sparse network of roughly a dozen continuous stations covering a large city, frequent missing values in the raw feed, sharp spatial variation between traffic junctions and residential areas, and strong seasonality that simple averages ignore.
There is a need for a reproducible machine-learning system that ingests the official open data, models each station's history with proper time-series discipline (no data leakage, rolling-origin validation), predicts next-day AQI, translates it into the CPCB's six health-advisory bands, and presents the result in a dashboard that a non-expert can read in five seconds — all on zero-budget, open-source tooling.
This project builds and evaluates a next-day air-quality forecasting service for Bengaluru using exclusively open government data. An automated pipeline ingests station-level AQI readings from the data.gov.in "Real time Air Quality Index from Various Locations" resource, cleans and stores them in MySQL, engineers time-lagged and rolling-average features, and trains regression models (linear regression, random forest, gradient boosting) plus a companion classifier that maps each forecast to the CPCB's six official health bands. Every model is compared against a persistence baseline ("tomorrow equals today") using MAE, RMSE, R² and macro-F1 under time-series cross-validation. Results are served through a Flask dashboard and analysed in Power BI.
Bengaluru's air is usually rated Satisfactory to Moderate, but December–February brings stagnant winds, construction dust and traffic emissions that push several stations into the Poor band, and Deepavali adds short, severe spikes. The city's official network of continuous monitoring stations is small relative to its population, and readings differ sharply between a junction like Silk Board and a green area like Hebbal. Because pollution drives asthma, bronchitis and cardio-vascular stress, a reliable one-day warning lets people move workouts indoors, schools reschedule play periods and hospitals expect more OPD cases.
In scope
Out of scope (v1)
The project follows the Incremental SDLC model: a thin end-to-end pipeline (pull → store → predict → display) is built in the first increment and then improved in controlled iterations, so there is always a demonstrable system for the guide and the three internal reviews.
| Phase | Weeks | Activities | Deliverable |
|---|---|---|---|
| Requirement analysis | 1 | Study the data.gov.in AQI API, list functional/non-functional requirements, define evaluation protocol | SRS + evaluation plan |
| Data acquisition & design | 2–3 | Build ETL, define MySQL schema, backfill two years of readings, cleaning rules | Populated database + EDA notebook |
| Increment 1 | 4–6 | Feature engineering, persistence baseline, linear regression, first backtest | Baseline metrics table |
| Increment 2 | 7–9 | Random forest and gradient boosting, band classifier, hyper-parameter tuning | Model comparison report |
| Increment 3 | 10–11 | Flask dashboard, advisory text, Power BI dashboard | Working system |
| Testing | 12 | Unit tests, integration tests, walk-forward validation, error analysis by season | Test report |
| Documentation & submission | 13–14 | Report, diagrams, screenshots, demo rehearsal, viva preparation | Final submission |
Team division: Member 1 owns the ETL and database layers, Member 2 owns features, models and evaluation, Member 3 owns both dashboards and the documentation of results.
Testing approach: unit tests for the AQI band function (CPCB breakpoints) and feature builder; integration tests for the ETL against recorded API fixtures; walk-forward backtests on unseen months; error analysis split by season and station to check that winter Poor-band episodes are not systematically missed.
The system is organised in four layers with clear contracts between them:
flowchart TD
D["data.gov.in AQI API"] -->|"daily scheduled pull"| E["ETL job — Python, pandas"]
E -->|"clean readings"| DB[(MySQL)]
F["Feature builder — lags, rolling means, calendar"] -->|"feature rows"| M["scikit-learn models"]
DB --> F
M -->|"joblib artefacts"| A["Model store"]
M -->|"backtest metrics"| DB
M -->|"next-day AQI + band"| DB
DB --> W["Flask dashboard"]
DB --> P["Power BI analytics"]
W --> U(["Citizen / student / researcher"])
P --> V(["Analyst / guide / review panel"])erDiagram
STATION ||--o{ READING : produces
READING ||--o{ READING_FEATURE : "is expanded into"
STATION ||--o{ FORECAST : receives
MODEL ||--o{ FORECAST : generates
MODEL ||--o{ EVALUATION : "is scored by"
STATION {
int station_id PK
string station_code UK
string station_name
string city
float latitude
float longitude
}
READING {
int reading_id PK
int station_id FK
datetime observed_at
decimal pm25
decimal pm10
decimal no2
decimal so2
decimal co
decimal o3
int aqi
string dominant_pollutant
}
READING_FEATURE {
int feature_id PK
int reading_id FK
decimal aqi_lag1
decimal aqi_lag24
decimal aqi_roll3
decimal aqi_roll24
float temperature
float humidity
float wind_speed
int is_festival
}
MODEL {
int model_id PK
string model_name
string algorithm
string hyperparameters
}
FORECAST {
int forecast_id PK
int station_id FK
int model_id FK
date target_date
decimal predicted_aqi
string predicted_band
datetime created_at
}
EVALUATION {
int eval_id PK
int model_id FK
decimal mae
decimal rmse
decimal r2
decimal f1_macro
}flowchart LR
G(["data.gov.in AQI feed"]) -- "station readings" --> S(("Bengaluru AQI\nForecaster"))
S -- "ETL status, gaps report" --> G
S -- "forecast + advisory" --> C(["Citizen"])
S -- "metrics, trends" --> R(["Guide / reviewer"])Key design decisions: readings and derived features are kept in separate tables so features can be rebuilt without touching source data; every forecast records which model produced it, enabling honest A/B comparison; and the persistence baseline lives beside the ML models in the same metrics table, so improvement over the naive forecast is always visible.
Module 01
A scheduled Python job authenticates against the data.gov.in AQI API, pulls all Bengaluru stations, normalises column names and units, deduplicates rows and records a data-quality report (per-station missing percentages) after every run so silent feed failures cannot go unnoticed.
Module 02
Schema for stations, readings, features, models, forecasts and evaluations with foreign keys and a unique constraint on (station, observed_at) to prevent duplicate ingestion; cleaning rules and backfill logic live in one module, and everything the dashboards show is queried from here.
Module 03
Builds per-station features strictly from past data — AQI at t−1 and t−24, 3-hour and 24-hour rolling means, pollutant ratios, month, day-of-week and a festival flag — with a guard that recomputes features inside each cross-validation fold so future information can never leak into training.
Module 04
Trains linear regression, random forest and gradient boosting regressors plus a random-forest band classifier, tunes hyper-parameters with grid search inside rolling-origin folds, and evaluates MAE, RMSE, R² and macro-F1 against the persistence baseline, writing every experiment to the metrics table.
Module 05
A responsive web dashboard showing each station's latest reading, tomorrow's predicted AQI and band, the dominant pollutant and an advisory sentence (for example, 'Sensitive groups should limit outdoor exertion'), with a history chart per station rendered from MySQL.
Module 06
A Power BI report connected to MySQL with monthly AQI trends per station, band distribution, station-vs-station comparison and forecast-versus-actual overlays, used in reviews and the viva to demonstrate the Data Analytics (24BCA52) skill with real Bengaluru data.
Slide 1
Bengaluru AQI Forecaster
Slide 2
Why air quality, why a forecast
Slide 3
Problem Statement
Slide 4
Existing vs Proposed System
Slide 5
Objectives
Slide 6
Dataset & Data Source
Slide 7
Technology Stack
Slide 8
System Architecture
Slide 9
Feature Engineering & Models
Slide 10
Results / Demo
Slide 11
Testing
Slide 12
Conclusion & Future Scope
Bullets, speaker notes and the .pptx · ₹2,000
Read each answer, close it, and say it in your own words. Your viva will ask. Now you'll know.
For each pollutant measured, the concentration is mapped onto a sub-index scale of 0–500 using official health breakpoints. The overall AQI reported for a station is the worst sub-index across pollutants, and the pollutant providing that worst value is called the dominant pollutant. The number then falls into one of six bands: Good, Satisfactory, Moderate, Poor, Very Poor or Severe.
The regressor predicts tomorrow's AQI value, which is what we evaluate with MAE and RMSE, but citizens act on categories, not decimals. The band classifier learns the six official CPCB classes directly and is evaluated with accuracy and macro-F1. Keeping them separate lets us optimise numeric accuracy and advisory usefulness independently, and measure where each one fails.
AQI depends non-linearly on its drivers — winter inversions, festival spikes, weekend traffic patterns — and on interactions like low wind speed amplifying emissions. Random forest and gradient boosting capture non-linearity and interactions without manual feature crosses, and they also give feature importances we can report. Linear regression stays in the study as an interpretable reference point.
+13 more questions, with answers
Unlocks with the project · ₹2,000
Unlock for ₹2,000What to change before it goes anywhere near a submission. Skipping it is how the demo fails live.
Unlocks with the project · ₹2,000
Unlock for ₹2,000How to study it, adapt it and walk your examiner through it, step by step.
Unlocks with the project · ₹2,000
Unlock for ₹2,000OnlyProjects. (2026). Bengaluru AQI Forecaster: Next-Day Air Quality Prediction from CPCB Station Data (Python, scikit-learn, Power BI): BCA AI & Machine Learning project bundle [Educational resource]. https://onlyprojects.online/projects/bca-aiml-bengaluru-aqi-forecaster
Keep browsing
Same degree, same syllabus slot, different idea. Pick the one your guide will actually approve.
AI & Machine Learning
Forecast daily OPD crowds department by department, and plan the doctor roster before the Monday rush arrives
AI & Machine Learning
Turn a Soil Health Card into an explained, district-specific crop recommendation a small farmer can act on
Web Development
Room allocation, complaints and mess billing without the register
Blockchain
From field verification to bank credit, every instalment of a DBT-style farm subsidy leaves a hash-linked, independently checkable trail
Blockchain
The shopkeeper's credit book rebuilt as a hash-chained ledger, where a torn page or an altered amount can no longer be hidden
Cloud Computing
One small app, two containers, a tested restore drill — operations discipline for a real tuition business