Inspiration

Air pollution numbers like PM2.5 or NO2 don't mean much to the average person. Someone can check an air quality app and see "PM2.5: 150" but have no real sense of whether that's dangerous or what to actually do about it. I wanted to close that gap — turning raw pollutant data into something people can actually understand and act on.

What it does

AQI Predictor takes six pollutant readings — PM2.5, PM10, NO2, SO2, CO, and O3 — and predicts the Air Quality Category (Good, Satisfactory, Moderate, Poor, Very Poor, or Severe). Along with the prediction, it shows:

  • A confidence score for the prediction
  • A probability breakdown across all categories
  • A practical health tip based on the category
  • A unique "what-if" feature that shows how much the air quality would improve if PM2.5 were reduced by 30%

How I built it

I trained a Random Forest Classifier using scikit-learn on a dataset generated from standard AQI breakpoint rules (used by agencies like CPCB). The categorization logic follows real-world AQI standards, so even though the training data is synthetic, the underlying rules are grounded in actual air quality science.

For the interface, I used Streamlit, which let me build both the backend logic and the frontend UI entirely in Python — no separate web framework needed.

Challenges I ran into

Getting the "what-if" feature to feel genuinely useful (not just a gimmick) took some iteration — I wanted it to give people something actionable, not just another number. Balancing a clean, simple UI with enough information density to feel informative was also a challenge.

What I learned

I got a much clearer understanding of how AQI categories are actually calculated, and how to translate a technical ML output into something a non-technical user can immediately act on.

What's next

  • Training on real government air quality datasets (like CPCB data) instead of synthetic data
  • Adding location-based real-time air quality lookup
  • Mobile alerts when air quality crosses into unhealthy ranges

Built With

Share this project:

Updates

Submission history