🌤️ Air Quality Index (AQI) Prediction
A Streamlit web application that predicts Air Quality Index (AQI) based on pollutant levels using multiple machine learning models.
- Predicts AQI using four different models:
- Standard Calculation (98% accuracy)
- Linear Regression (85% accuracy)
- Decision Tree (92% accuracy)
- Random Forest (95% accuracy)
- Real-time AQI category classification
- Beautiful and responsive UI
- Detailed model information and accuracy scores
- AQI categories legend with color coding
- Clone the repository:
git clone https://github.com/ARN1954/AQI_PREDICTION.git
cd AQI_PREDICTION
- Install dependencies:
pip install -r requirements.txt
The models are trained on real-world air quality data containing:
- SO₂ (Sulphur Dioxide) levels
- NO₂ (Nitrogen Dioxide) levels
- RSPM (Respirable Suspended Particulate Matter) levels
- SPM (Suspended Particulate Matter) levels
The application uses three machine learning models with the following performance metrics:
Model | R² Score | Mean Absolute Error |
---|---|---|
Linear Regression | 0.98 | 16.94 |
Decision Tree | 0.85 | 10.00 |
Random Forest | 0.9914 | 8.45 |
The application classifies air quality into six categories:
AQI Range | Category | Color |
---|---|---|
0-50 | Good | 🟢 Green |
51-100 | Moderate | 🟡 Yellow |
101-200 | Poor | 🟠 Orange |
201-300 | Unhealthy | 🔴 Red |
301-400 | Very Unhealthy | 🟣 Purple |
>400 | Hazardous | ⚫ Black |
- Run the Streamlit app:
streamlit run app.py
-
Open your browser and navigate to
http://localhost:8501
-
Enter the pollutant levels:
- SO₂ (Sulphur Dioxide) in µg/m³
- NO₂ (Nitrogen Dioxide) in µg/m³
- RSPM (Respirable Suspended Particulate Matter) in µg/m³
- SPM (Suspended Particulate Matter) in µg/m³
-
Select your preferred prediction model
-
Click "Predict AQI" to get the results
air-quality-prediction/
├── app.py # Streamlit application
├── train_models.py # Model training script
├── models/ # Trained models directory
│ ├── linear_regression_model.pkl
│ ├── decision_tree_model.pkl
│ ├── random_forest_model.pkl
│ └── ... (scalers)
├── requirements.txt # Project dependencies
└── README.md # Project documentation
- streamlit
- pandas
- numpy
- scikit-learn
- joblib
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or suggestions, please open an issue in the repository.