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 | 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 |
- 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
- 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.
traffic/
βββ traffic.py # Main training/evaluation script
βββ gtsrb/ # Dataset (0 to NUM_CATEGORIES-1)
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation