sairam333/traffic-congestion-monitoring
๐ฆ Monitoring Traffic Congestion in Smart Cities Using CNN
<div align="center">
    
</div>
๐ Overview
This project offers a deep learning-based solution for real-time traffic congestion analysis. Using Convolutional Neural Networks (CNNs), the system classifies road images into High Congestion and Low Congestion categories.
We compare a custom CNN against transfer learning models โ VGG16, ResNet50, and MobileNetV2 โ to find the most accurate architecture.
๐ Key Features
- ๐ท High-Accuracy Classification โ Detects congestion states from static images.
- ๐ Comparative Model Analysis โ Evaluates 4 CNN architectures.
- โป Transfer Learning โ Uses pre-trained models for better performance.
- ๐ผ Data Augmentation โ Improves robustness and prevents overfitting.
- ๐งฉ Modular Codebase โ Clean scripts for reproducibility.
๐ Results Sneak-Peek
๐ Best Model: ResNet50 (Transfer Learning) โ ~99% Accuracy
๐ Project Workflow
- Data Preprocessing โ Organize and augment dataset.
- Model Training โ Train custom CNN and transfer learning models.
- Evaluation โ Generate accuracy reports & confusion matrices.
- Comparison โ Select best-performing model.
๐ Repository Structure
traffic\_congestion\_project/
โโโ dataset/ # Image dataset
โ โโโ High\_Congestion/
โ โโโ Low\_Congestion/
โโโ models/ # Trained .keras models
โโโ results/ # Evaluation outputs
โโโ scripts/ # Python scripts
โ โโโ preprocess\_data.py
โ โโโ train\_cnn.py
โ โโโ train\_transfer.py
โ โโโ evaluate.py
โโโ README.md
โโโ requirements.txt
โ Getting Started
1๏ธโฃ Dataset Setup
- Download from Kaggle: Traffic Management - Image Dataset
- Create folders:
dataset/High_Congestion/anddataset/Low_Congestion/ - Move:
- Dense traffic images โ High_Congestion
- Sparse traffic images โ Low_Congestion
2๏ธโฃ Installation
# Clone the repo
git clone https://github.com/Sairam-kattunga/Traffic_Congestion_Monitoring_CNN.git
cd Traffic_Congestion_Monitoring_CNN
# Install dependencies
pip install -r requirements.txt3๏ธโฃ Training Models
cd scripts
# Custom CNN
python train_cnn.py
# Transfer Learning
python train_transfer.py --model vgg16
python train_transfer.py --model resnet50
python train_transfer.py --model mobilenet4๏ธโฃ Evaluation
python evaluate.py๐ก Future Enhancements
- ๐ฅ Real-time Video Processing using OpenCV
- ๐ Web App Deployment (Flask / Streamlit)
- ๐ Multi-Class Detection (accident, roadwork, fire, etc.)
- ๐ฏ Hyperparameter Optimization with Optuna / KerasTuner
๐ License
Distributed under the MIT License. See LICENSE for details.
๐ง Contact
Rama Venkata Manikanta Sairam Kattunga ๐ Portfolio ๐ฉ sairamkattunga333@gmail.com ๐ GitHub Repo
>>>>>> 17340f919960658fe9c343dca9540508dbf6d410
