CoolFace
Apppublic

NajmiHassan1/Air_Pollution_Prediction_System

sourceHugging Faceupdated 1y agoView on Hugging Face
2likes
App README

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

๐ŸŒ Air Pollution Prediction System

A machine learning-based web application that predicts PM2.5 levels and air quality using environmental and demographic factors.

๐Ÿ“‹ Overview

This system uses trained regression and classification models to predict:

  • โ€”PM2.5 Concentration (ยตg/mยณ) - Fine particulate matter levels
  • โ€”Air Quality Level - Classification into Good, Moderate, Poor, or Hazardous

๐ŸŽฏ Features

  • โ€”Real-time air quality predictions
  • โ€”User-friendly web interface built with Streamlit
  • โ€”Dual prediction capabilities (PM2.5 levels and quality classification)
  • โ€”Interactive input controls with validation
  • โ€”Color-coded results with health recommendations

๐Ÿ“Š Dataset Information

Source: Air Quality and Pollution Assessment Dataset

  • โ€”Size: 5,000 samples
  • โ€”Features: 8 environmental and demographic variables
  • โ€”Target: Air quality levels (Good, Moderate, Poor, Hazardous)

Input Parameters:

  • โ€”Temperature (ยฐC): Average regional temperature
  • โ€”Humidity (%): Relative humidity
  • โ€”PM10 (ยตg/mยณ): Coarse particulate matter
  • โ€”NO2 (ppb): Nitrogen dioxide levels
  • โ€”SO2 (ppb): Sulfur dioxide levels
  • โ€”CO (ppm): Carbon monoxide levels
  • โ€”Industrial Proximity (km): Distance to nearest industrial zone
  • โ€”Population Density (people/kmยฒ): Regional population density

๐Ÿš€ Quick Start

Prerequisites

bash
pip install streamlit numpy pandas pickle

File Structure

air-pollution-predictor/
โ”œโ”€โ”€ app.py                      # Streamlit web interface
โ”œโ”€โ”€ air_pollution_predictor.py  # Main prediction logic
โ”œโ”€โ”€ regression_model.pkl        # Trained PM2.5 prediction model
โ”œโ”€โ”€ classification_model.pkl    # Trained air quality classification model
โ””โ”€โ”€ README.md

๐ŸŽฎ How to Use

  1. 1.Enter Environmental Data: Input temperature, humidity, and pollutant levels
  2. 2.Set Location Factors: Specify industrial proximity and population density
  3. 3.Get Predictions: Choose to predict PM2.5 levels, air quality, or both
  4. 4.View Results: See color-coded predictions with health recommendations

๐Ÿฅ Air Quality Standards

  • โ€”๐ŸŸข Good: Safe air quality with minimal health impact
  • โ€”๐ŸŸก Moderate: Acceptable for most people
  • โ€”๐ŸŸ  Poor: May affect sensitive individuals
  • โ€”๐Ÿ”ด Hazardous: Health risk for everyone

๐Ÿ”ง Technical Details

  • โ€”Framework: Streamlit for web interface
  • โ€”Models: Scikit-learn based regression and classification
  • โ€”Input Validation: Built-in range checking and error handling
  • โ€”Caching: Optimized model loading for better performance

๐Ÿ“ Project Structure

  • โ€”air_pollution_predictor.py: Core prediction logic and model handling
  • โ€”app.py: Streamlit web application interface
  • โ€”Model files: Pre-trained pickle files for predictions

Made with โค๏ธ by Najmi Hassan