[Paper Review] Traffic Density Estimation using a Convolutional Neural Network
This paper proposes a convolutional neural network (CNN)-based system for real-time traffic density estimation at urban intersections using publicly available traffic camera images. By applying class imbalance handling and image masking, the model achieves 74.3% accuracy and 81.3% F1 score on a self-labeled dataset of 4,582 images, demonstrating feasibility for adaptive traffic signal control to reduce congestion.
The goal of this project is to introduce and present a machine learning application that aims to improve the quality of life of people in Singapore. In particular, we investigate the use of machine learning solutions to tackle the problem of traffic congestion in Singapore. In layman's terms, we seek to make Singapore (or any other city) a smoother place. To accomplish this aim, we present an end-to-end system comprising of 1. A traffic density estimation algorithm at traffic lights/junctions and 2. a suitable traffic signal control algorithms that make use of the density information for better traffic control. Traffic density estimation can be obtained from traffic junction images using various machine learning techniques (combined with CV tools). After research into various advanced machine learning methods, we decided on convolutional neural networks (CNNs). We conducted experiments on our algorithms, using the publicly available traffic camera dataset published by the Land Transport Authority (LTA) to demonstrate the feasibility of this approach. With these traffic density estimates, different traffic algorithms can be applied to minimize congestion at traffic junctions in general.
Motivation & Objective
- To develop an end-to-end machine learning system for real-time traffic density estimation at traffic junctions using public traffic camera data.
- To improve urban traffic flow by enabling adaptive traffic signal control based on real-time density estimates.
- To address challenges such as class imbalance, varying lighting/weather conditions, and real-time processing in a practical deployment setting.
- To ensure system safety, reliability, and ethical use in public infrastructure, avoiding bias or malicious exploitation.
Proposed method
- A custom CNN architecture is trained on a self-labeled dataset of 4,582 traffic camera images, categorized into density classes (e.g., empty, low, medium, high).
- Class imbalance is mitigated using ratio-weighted cross-entropy loss, where loss weights are inversely proportional to class frequency: $ \alpha_c = \text{median\_count} / \text{count}_c $.
- Real-time data augmentation is applied during training to increase diversity and improve minority class generalization.
- Image masking is used to suppress irrelevant regions (e.g., opposite lanes), though its impact on performance is marginal.
- The system processes streaming video data incrementally, supporting real-time inference for dynamic traffic signal adaptation.
- A human-in-the-loop interface ensures compatibility with existing traffic signals and pedestrian crossings, with optional integration of pedestrian detection.
Experimental results
Research questions
- RQ1Can a CNN effectively estimate traffic density from static traffic camera images with high accuracy and robustness under real-world variations?
- RQ2How do class imbalance handling techniques like weighted loss and data augmentation affect model performance on minority density classes?
- RQ3To what extent does image masking improve model accuracy by focusing on relevant traffic lanes?
- RQ4Can the system achieve real-time performance and maintain safety and reliability for deployment in public traffic infrastructure?
Key findings
- The model achieved 74.3% accuracy and 81.3% F1 score when using both class imbalance mitigation and image masking, indicating strong performance on imbalanced data.
- The F1 score increased significantly with class imbalance handling, demonstrating improved precision and recall for minority classes despite only a small accuracy gain.
- Top-2 accuracy reached 94%, suggesting that even misclassification between adjacent density levels provides useful information for traffic control.
- Image masking provided a 1-2% accuracy gain but was not highly impactful, indicating the CNN could implicitly focus on relevant regions without explicit preprocessing.
- The system’s performance is robust enough to support real-time deployment, especially when combined with temporal averaging over video frames.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.