TrafficSense: AI-Powered Smart Traffic Analytics for Urban AreaFeatured
Featured Project

TrafficSense: AI-Powered Smart Traffic Analytics for Urban Area

YOLO11ByteTrackGrafanaRedisPostgresqlApache SparkApache Kafka

About this Project

A real-time traffic density analysis system for Malang City intersections that integrates Edge Intelligence (YOLOv11 & ByteTrack) with Kappa Architecture (Apache Spark & Kafka) to deliver high-precision insights on resource-constrained hardware

Details

Project Overview This project implements an intelligent traffic monitoring system focused on the Jl. Galunggung intersection in Malang City. By utilizing an Edge Intelligence approach, the system processes raw CCTV streams directly at the ingestion layer, which minimizes network bandwidth and central processing loads. The architecture is built on the Kappa Architecture principle, allowing a single stream to handle both real-time and historical analytics without duplicating logic.

Key Features:

• Edge-Based Processing: Object detection (YOLOv11) and tracking (ByteTrack) are performed at the edge, optimized to run on devices with less than 6GB of RAM.

• Stateful Vehicle Tracking: The system uses Redis for state persistence to maintain vehicle IDs accurately and prevent counting errors caused by ID switching.

• Scalable Data Pipeline: Uses Apache Kafka as a message broker and Spark Structured Streaming for micro-batch aggregation and ETL processes.

• High-Performance Storage: Employs a PostgreSQL Data Warehouse with a Star Schema to enable fast querying and reporting.

• Interactive Visualization: Real-time data is visualized through a Grafana dashboard with an end-to-end information latency of approximately 15 seconds.

Challenges and Innovative Solutions:

• Local Traffic Complexity: Indonesian traffic is uniquely dominated by motorcycles (76.4%). The system was fine-tuned with 2,500 local images to adapt the YOLOv11 model to these specific vehicle characteristics, achieving a 0.95 mAP@50 score.

• Non-Linear Movement: Motorcycles often move aggressively and unpredictably. This was addressed by implementing the ByteTrack algorithm, which is significantly more reliable than standard trackers for managing small, clustered objects moving non-linearly.

Learnings and Results:

• Operational Efficiency: The implementation of the Star Schema saved up to 90% in storage space compared to storing raw detection data.

• Traffic Insights: Deep-dive analysis revealed a "Box Pattern" in daily volume, with peak hours identified between 06:00–09:00 and 16:00–19:00.

• Service Assessment: The system calculated a V/C Ratio of 0.83 during evening peaks, classifying the road at Level of Service (LoS) D, which indicates unstable flow and a need for dynamic traffic light timing adjustments.

In summary, this project serves as a "digital eagle eye," providing high-accuracy urban monitoring while remaining lightweight enough to be deployed on affordable edge infrastructure

Technologies Used

Y
YOLO11
B
ByteTrack
G
Grafana
R
Redis
P
Postgresql
A
Apache Spark
A
Apache Kafka

Interested in working together?

Let's discuss your next project and bring your ideas to life.

© 2026 Eggi Satria. All rights reserved.