Skip to content

shiverin/CNNTraffic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🚦 Traffic Sign Classification

This project implements a convolutional neural network (CNN) to classify traffic signs using the German Traffic Sign Recognition Benchmark (GTSRB). The model is built and trained with TensorFlow.


🧠 Model Architectures & Results

Model Architecture Dropout Test Accuracy Test Loss Inference Time
1 Conv(32) β†’ Pool β†’ Dense(128) βœ… 97.02% 0.1261 ~2s
2 Conv(32) β†’ Pool β†’ Conv(64) β†’ Pool β†’ Dense(128) βœ… 98.84% 0.0555 ~2s
3 Conv(32) β†’ Pool β†’ Conv(64) β†’ Pool β†’ Dense(128) β†’ Dropout(0.5) β†’ Dense(128) β†’ Dropout(0.5) βœ… 97.30% 0.1289 ~2s
4 Conv(32) β†’ Pool β†’ Conv(64) β†’ Pool β†’ Conv(128) β†’ Pool β†’ Dense(128) β†’ Dropout(0.5) βœ… 98.86% 0.0466 ~3s
5 Conv(32) β†’ Pool β†’ Conv(64) β†’ Pool β†’ Conv(128) β†’ Pool β†’ Dense(512) β†’ Dropout(0.5) βœ… 98.97% 0.0386 ~3s
6 Conv(32) β†’ Pool β†’ Conv(64) β†’ Pool β†’ Conv(128) β†’ Pool β†’ Dense(512) β†’ Dropout(0.5) β†’ Dense(256) β†’ Dropout(0.5) βœ… 98.12% 0.0765 ~3s

πŸ§ͺ Experiment Setup

  • Input shape: 30 Γ— 30 RGB images
  • Dataset: German Traffic Sign Recognition Benchmark (GTSRB), organized by category folders
  • Train/Test split: 60% train, 40% test
  • Optimizer: Adam (default parameters)
  • Loss function: Categorical Crossentropy
  • Activation functions: ReLU (hidden layers), Softmax (output layer)
  • Normalization: Pixel values scaled by images / 255.0
  • Epochs: 10
  • Batch size: Default

πŸ“ˆ Observations

  • Increasing network depth with additional Conv and Pool layers significantly improves accuracy.
  • Model 2 shows strong performance with just two Conv layers.
  • Dropout helps reduce overfitting, but excessive dropout (Model 3) can slightly hurt performance.
  • Best results achieved by Model 4, which uses 3 Conv + Pool layers and a Dense layer with dropout.

πŸ—‚οΈ Project Structure

traffic/
β”œβ”€β”€ traffic.py # Main training/evaluation script
β”œβ”€β”€ gtsrb/ # Dataset (0 to NUM_CATEGORIES-1)
β”œβ”€β”€ requirements.txt # Python dependencies
└── README.md # Project documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages