Last Chance: Register for Transform, VB's AI event of the year, hosted online July 15-17.

Keeping tabs on freeway traffic flow is desirable for a whole host of reasons, chiefly because it can shed light on the underlying causes of congestion, road rule violations, and accidents. Unfortunately, traditional techniques rely on a pricey combination of radar, laser, and lidar sensors. That’s why researchers at the University of Swabi in Pakistan, Comstats University in Islamabad, and Jessore University of Science and Technology in Bangladesh pursued an alternative: machine learning algorithms that can extract useful data from camera footage.

In a preprint paper (“An Intelligent Monitoring System of Vehicles on Highway Traffic“) on, researchers describe a framework that leverages a 480 x 640-pixel camera (mounted on a roadside pole or traffic signal) to capture video at 25 frames per second that an AI model then ingests frame by frame to detect vehicles and record both their locations and speeds. The system extracts individual frames using a simple image-processing technique, while an algorithm classifies background data (like trees, buildings, and parked cars) and foreground data (moving vehicles and pedestrians) contained within the frames’ numerical pixel values to create road masks sans stationary objects.

After completing noise-suppressing preprocessing steps, the system isolates the vehicles in each frame by detecting their contours (specifically by determining whether an edge belonging to a car passes through a given pixel) and by comparing the colors of each to those of adjacent vehicles. Region growing — an image segmentation technique that examines pixels of seed points and determines whether the pixel neighbors should be added to the initial region — is used to determine vehicles’ directions, and the vehicles’ distances from the camera are used to measure their relative speeds.

AI highway traffic monitoring

Above: Tracking vehicles using AI.

Image Credit: AI highway traffic monitoring

The researchers conceded that a camera capable of higher resolutions and frame rates might be able to capture “richer” time and vehicle data, but they assert that their proof of concept — which they claim to have tested on several roads with good qualitative results — provides a starting point for a simple, cost-effective, and readily deployable highway monitoring solution.

“The proposed framework … [which uses] pattern recognition, digital image processing, and mathematical techniques for vehicle detection, tracking, and speed calculation … helps in proper management of traffic flow, resulting in limited chances of accidents,” wrote the coauthors. “Furthermore, the framework can be used to detect and pull over the vehicles that violate traffic rules.”

They leave to future work adapting the framework for road junctions and extending it to tunnels and overpasses.