CoolFace
Apppublic

sairam333/traffic-congestion-monitoring

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

๐Ÿšฆ Monitoring Traffic Congestion in Smart Cities Using CNN

<div align="center">

![License: MIT](https://opensource.org/licenses/MIT) ![Python Version](https://www.python.org/downloads/) ![TensorFlow Version](https://www.tensorflow.org/) ![Made with Markdown](http://commonmark.org) ![GitHub Repo Stars](https://github.com/Sairam-kattunga/TrafficCongestionMonitoring_CNN/stargazers)

</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

[image]

ModelAccuracyNotes
Custom CNN89%Baseline model
VGG16 (Transfer)96%Significant improvement
MobileNetV2 (Transfer)98%High efficiency
ResNet50 (Transfer)99%Best performer

๐Ÿ›  Project Workflow

  1. 1.Data Preprocessing โ†’ Organize and augment dataset.
  2. 2.Model Training โ†’ Train custom CNN and transfer learning models.
  3. 3.Evaluation โ†’ Generate accuracy reports & confusion matrices.
  4. 4.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/ and dataset/Low_Congestion/
  • โ€”Move:
  • โ€”Dense traffic images โ†’ High_Congestion
  • โ€”Sparse traffic images โ†’ Low_Congestion

2๏ธโƒฃ Installation

bash
# 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.txt

3๏ธโƒฃ Training Models

bash
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 mobilenet

4๏ธโƒฃ Evaluation

bash
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