Computer Vision Dashboard by Ali Naderi

Real-Time Traffic Density Estimation

An advanced predictive pipeline leveraging state-of-the-art YOLO11 Nano deep learning and OpenCV region boundaries to estimate vehicle counts and traffic intensity on dual-lane highway camera feeds.

Open Modeling Notebook View EDA Notebook
91.2%
Bounding Box Precision

Low false positive rate, ensuring trees or lane markings are not misidentified as vehicles.

94.7%
Bounding Box Recall

High true positive rate, successfully catching vehicles even under shadows or light glare.

97.4%
mAP50 Accuracy

Mean Average Precision at IoU=0.50 threshold, outperforming YOLOv8 baselines.

72.4%
mAP50-95 Accuracy

Average precision evaluated across IoU 0.50 to 0.95, representing tight box contours.

Training & Validation Convergence

The composite learning curves showing Box Loss, Classification Loss, and Distribution Focal Loss (DFL) stabilizing smoothly across 50 epochs.

YOLO11 Training Results Curves

Key Achievements

  • Upgraded to YOLO11: Switched to the latest architecture, improving feature resolution.
  • GTX 1650 CUDA: Fine-tuned with local GPU acceleration in just 30 minutes.
  • Path Safety: Configured path strings programmatically to support Windows unicode.
  • ONNX Cross-Deployment: Model exported to ONNX format (10.1 MB) for OpenCV C++ deployment.

Bounding Box Distributions

Spatial distribution and size analysis. Bounding box widths and heights peak around 35-50 pixels, confirming vehicles are mid-sized bounding boxes. Center spatial points represent heavy concentration along the lane vectors.

Bounding Box Width/Height aspect ratio distributions and spatial centers

Dataset & Data Quality Properties

The dataset consists of 626 images annotated in YOLOv8 format:

  • Training Set: 536 images with 50% probability horizontal flip augmentation.
  • Validation Set: 90 images kept raw to maintain validation integrity.
  • Resolution: All images standardized to exactly 640x640 resolution.
  • Zero Anomalies: Auditing labels confirmed zero empty coordinate strings or negative sizes.

Normalized Confusion Matrix

Confusion matrix confirming a 0.95 true positive rate for the 'Vehicle' class, with background false negatives restricted to just 0.05.

YOLO11 Normalized Confusion Matrix

Precision-Recall Curve

PR-Curve showing the area under curve (AUC) is 0.974, indicating strong detection performance across confidence values.

YOLO11 Precision-Recall Curve

Processed Video Playback

The output video after frame-by-frame inference, showing region boundaries drawn for both lanes and live traffic intensity tags overlaid.

Region boundaries

Active highway coordinate regions (ROI) for lane counting.

Left Lane (Northeast flow)
[ (465, 350), (609, 350), (510, 630), (2, 630) ]
Active
Right Lane (Southwest flow)
[ (678, 350), (815, 350), (1203, 630), (743, 630) ]
Active

⚡ Interactive Density Calculator

Traffic Status: HEAVY

OpenCV Lane Detection Logic

How coordinates are mapped to classify left and right lane flow:

# Classify detected bounding box centroid against the lane separator threshold (609px)
x_center = (box.xyxy[0] + box.xyxy[2]) / 2
if x_center < lane_threshold:
    vehicles_in_left_lane += 1
else:
    vehicles_in_right_lane += 1

# Identify traffic density status
traffic_intensity = "Heavy" if vehicle_count > heavy_traffic_threshold else "Smooth"

Deliverables & Downloads