Real-Time Traffic Sign Classification

Demonstrating the capabilities of Machine Learning and Deep Learning in identifying traffic signs from live input.

Introduction

In modern transportation systems, the ability to quickly and accurately recognize traffic signs is crucial for ensuring road safety and facilitating efficient navigation. Traditional methods of traffic sign classification often rely on manual interpretation or simple rule-based systems, which may be prone to errors or limited in scalability. To address these challenges, there is a growing need for automated systems capable of real-time traffic sign classification using advanced machine learning techniques.

The proposed project aims to develop such a system, leveraging state-of-the-art machine learning algorithms to analyze traffic sign images captured in real-time by onboard cameras or sensors. By harnessing the power of deep learning, convolutional neural networks (CNNs), and other advanced techniques, the system will be able to accurately identify and classify various types of traffic signs, including regulatory signs, warning signs, and informational signs.

Key Objectives

Dataset

The dataset used in this project consists of thousands of images of traffic signs collected from diverse driving environments. Each image in the dataset represents a specific category of traffic signs, such as speed limits, prohibitory signs, warning signs, and more. The images vary in terms of background, lighting conditions, and angles to simulate real-world scenarios as closely as possible.

Key Features of the Dataset:

Workflow

  1. Data Preparation
    • Load and preprocess data: Load images from directories corresponding to traffic signs. Images are resized to a consistent format (100x100 pixels) and labeled according to their directories.
    • Raw Data
      Raw Data
    • Data cleaning and mapping: Filter out data labeled as 'unknown', remap class labels to new IDs for a streamlined dataset, and separate images based on presence or absence of direction-related labels (e.g., right, left, straight).
  2. Data Preprocessing
    • Split data: Separate the images into training, validation, and test sets to ensure the model is trained on diverse samples and validated on unseen data.
    • Normalize images: Convert image pixel values from integers to floats and scale them between 0 and 1 for neural network processing.
    • Augmentation:
      • Directional Images:
        • Apply basic augmentation: Rotate images by ±20 degrees to simulate slight variations in orientation. This helps prevent overfitting while preserving the intended direction of the traffic sign. For example, a slight rotation ensures that left remains left, right remains right, and straight remains straight without significant distortion.
        • Images with Direction
          Images with Direction
      • No Directional Images:
        • Apply enhanced augmentation: Rotate images by ±40 degrees to introduce more variability in orientation. Since these images do not have explicit directional cues, a wider range of rotation helps the model generalize better to unseen data. The increased rotation angle ensures that features of the traffic signs are captured from various perspectives, enhancing the model's robustness.
        • Images without Direction
          Images without Direction
  3. Model Building
    • CNN architecture setup: Construct a VGG-16 inspired model with multiple convolutional layers, max pooling layers, and dense layers to learn hierarchical features from the traffic sign images.
    • VGG-16 Architecture
      VGG-16 Architecture
  4. Model Training
    • Compile the model: Define loss functions (e.g., categorical cross-entropy), select an optimizer (e.g., Adam), and specify evaluation metrics (e.g., accuracy).
    • Train the model: Fit the model to the training data, adjusting weights and biases through backpropagation and gradient descent optimization.
  5. Model Evaluation
    • Evaluate performance: Assess the model's accuracy, precision, recall, and F1-score on the validation and test sets to gauge its effectiveness in traffic sign classification.
    • Model Evaluation Metrics
      Model Evaluation Metrics
  6. Real-Time Inference
    • Integrate with live input: Implement a real-time inference pipeline that captures video frames from a camera feed, preprocesses the frames (e.g., resizing, normalization), and feeds them into the trained model for traffic sign classification.
    • Display results: Overlay the detected traffic sign labels on the live video stream, providing visual feedback to users about the recognized signs.

Results

The model achieved impressive results in real-time traffic sign classification, demonstrating high accuracy and robustness across various scenarios. Key findings and performance metrics include:

These results validate the effectiveness of the machine learning model in accurately identifying and classifying traffic signs in real-time, contributing to enhanced road safety and navigation.

Accuracy for CNN
Accuracy for CNN
Accuracy for CNN with PCA data
Accuracy for CNN with PCA data
Accuracy for VGG architecture
Accuracy for VGG architecture
Accuracy for VGG architecture with PCA data
Accuracy for VGG architecture with PCA data

Future Work

While the current model has demonstrated impressive performance in real-time traffic sign classification, there are several avenues for further exploration and enhancement:

Future Work GIF
Future Work