Low false positive rate, ensuring trees or lane markings are not misidentified as vehicles.
High true positive rate, successfully catching vehicles even under shadows or light glare.
Mean Average Precision at IoU=0.50 threshold, outperforming YOLOv8 baselines.
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.
■ 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.
■ 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.
■ Precision-Recall Curve
PR-Curve showing the area under curve (AUC) is 0.974, indicating strong detection performance across confidence values.
■ 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.
⚡ Interactive Density Calculator
■ OpenCV Lane Detection Logic
How coordinates are mapped to classify left and right lane flow:
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
Traffic_Density_Advanced_Modeling.ipynb
Source Jupyter Notebook containing YOLO11 training, GPU setup, and OpenCV counting loop.
Traffic_Density_Advanced_EDA.ipynb
Source Jupyter Notebook containing label distribution, resolutions validation, and visualization overlays.
best.onnx
Optimized model weights exported to ONNX format (10.1 MB) for cross-platform visual serving.
processed_sample_video.mp4
Transcoded output video demonstrating real-time dual-lane counting and traffic intensity tag overlays.