Skip to content

About

AI-powered air pollution detection and AQI prediction system using machine learning and global environmental data.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

🌍 Air Pollution Detection System

AI-Powered Air Quality Analysis & AQI Prediction Platform

Python Machine Learning Decision Tree Random Forest Tkinter Status


Overview

Air Pollution Detection System is an AI-powered desktop application designed to analyze and predict air quality levels using machine learning techniques.

The system utilizes global air pollution data and machine learning models to evaluate Air Quality Index (AQI) categories based on major pollutant indicators such as:

  • CO AQI
  • Ozone AQI
  • NO₂ AQI
  • PM2.5 AQI

Users can search by city and country through an interactive graphical interface and instantly obtain air quality information, pollutant statistics, and predicted AQI categories.


Key Features

  • Interactive Tkinter GUI
  • Global Air Pollution Dataset
  • City & Country Based Search
  • AQI Category Prediction
  • Decision Tree Classifier
  • Random Forest Experimentation
  • AQI Visualization
  • Color-Coded Air Quality Indicators
  • Smart Error Handling
  • Automatic Country Suggestions
  • Real-Time AQI Lookup

Project Objectives

  • Monitor air quality across cities and countries
  • Predict AQI categories using machine learning
  • Analyze pollutant concentrations
  • Build an intelligent environmental monitoring tool
  • Provide a user-friendly graphical interface
  • Generate meaningful air quality insights
  • Apply AI techniques to environmental datasets

Dataset Information

Dataset

Global Air Pollution Dataset

Dataset Contains

  • Country
  • City
  • AQI Value
  • AQI Category
  • CO AQI Value
  • Ozone AQI Value
  • NO₂ AQI Value
  • PM2.5 AQI Value

The dataset covers multiple countries and cities, making the system applicable to a wide range of environmental monitoring scenarios.


System Architecture

User Input (City/Country)
            ↓
Input Validation
            ↓
Dataset Retrieval
            ↓
Data Preprocessing
            ↓
Feature Extraction
            ↓
Machine Learning Model
            ↓
AQI Prediction
            ↓
Results Display

Based on the workflow presented in the project design documentation.


Machine Learning Pipeline

Feature Selection

The model utilizes:

  • CO AQI Value
  • Ozone AQI Value
  • NO₂ AQI Value
  • PM2.5 AQI Value
  • Maximum AQI Value

Classification Models

Decision Tree Classifier

Used as the primary AQI category prediction model.

Random Forest Classifier

Implemented and evaluated as an alternative machine learning model.

Target Variable

AQI Category

Predicted categories include:

  • Good
  • Moderate
  • Unhealthy for Sensitive Groups
  • Unhealthy
  • Very Unhealthy
  • Hazardous

Application Workflow

1. User Input

Users enter:

  • Country
  • City

through the graphical interface.

2. Input Validation

The system verifies:

  • City existence
  • Country validity
  • Dataset availability

3. Data Retrieval

Relevant records are extracted from the global air pollution dataset.

4. Feature Engineering

Pollutant indicators are processed and the maximum AQI value is calculated.

5. Prediction

The trained machine learning model predicts the AQI category.

6. Results Display

The system displays:

  • AQI Value
  • AQI Category
  • Predicted AQI Category
  • CO AQI
  • Ozone AQI
  • NO₂ AQI
  • PM2.5 AQI

with color-coded indicators for easier interpretation.


Smart Error Handling

The application includes intelligent validation mechanisms:

Invalid City Detection

Displays an error message when a city does not exist in the dataset.

Country Correction Suggestion

If a city exists in another country, the system automatically suggests the correct country and offers to display the results.

Example:

City 'Gujranwala' is not in 'Niger'
but exists in 'Pakistan'

This improves user experience and system reliability.


Technology Stack

Programming Language

  • Python

Data Processing

  • Pandas

Machine Learning

  • Scikit-learn
  • Decision Tree Classifier
  • Random Forest Classifier

Model Persistence

  • Joblib

GUI Development

  • Tkinter

Development Tools

  • Jupyter Notebook
  • Git
  • GitHub

Project Structure

Air_Pollution_Detection_System
│
├── app.py
├── trainModel.py
├── main.py
├── global_air_pollution_dataset.csv
├── air_pollution_model.pkl
├── Project Report
└── README.md

Installation

Clone Repository

git clone https://github.com/ahadbuilds/Air_Pollution_Detection_System.git

Navigate to Project

cd Air_Pollution_Detection_System

Install Dependencies

pip install pandas scikit-learn joblib

Run Application

python app.py

Learning Outcomes

  • Environmental Data Analysis
  • Machine Learning Classification
  • AQI Prediction Systems
  • GUI Development with Tkinter
  • Data Preprocessing
  • Feature Engineering
  • Model Evaluation
  • AI-Based Environmental Monitoring

Future Enhancements

  • Real-Time AQI APIs
  • Deep Learning Models
  • Interactive Dashboard
  • Geographical Heatmaps
  • Cloud Deployment
  • AQI Forecasting
  • Mobile Application Integration

Team Members

  • Abdul Ahad
  • Muhammad Wafa Abbas
  • Muhammad Zaman

BS Computer Science

University of Engineering & Technology (UET), Lahore


Disclaimer

This project is intended for educational, research, and portfolio purposes only.

The predictions generated by the system should not be considered official environmental or governmental air quality assessments.


License

This project is released for educational and portfolio use.

About

AI-powered air pollution detection and AQI prediction system using machine learning and global environmental data.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages