The Road to Smarter Parking is Paved with Edge AI

A great many things change as you travel around the world, but one thing that remains constant is the difficulty of finding a parking spot in urban areas. The old routine of circling the block for twenty minutes, only to have another driver zoom ahead of you to claim the prize when a spot finally does open up, is a universal experience that transcends geographical boundaries. Some cities deal with parking issues better than others, but clearly there is plenty of room for improvement.

The most rudimentary solution to parking woes is the installation of a system of parking meters. By charging a time-based fee, the balance between supply and demand can be tilted more in favor of efficient turnover, ensuring that spaces are not monopolized by a handful of long-term parkers. But when the rules are enforced by periodic monitoring by human attendants, gaps in enforcement inevitably arise. That will open the door to misuse of parking spaces that negates the efficiency gains sought by the meter system.

Traditional parking meters leave much to be desired

If Jallson Suryo is right, smart parking meters may soon transform the way cities manage demand by integrating sensors with intelligent algorithms, allowing for real-time occupancy tracking without human intervention. Not only would such a system ensure compliance with all applicable parking rules, but it could also enable additional efficiency gains through tactics like dynamic pricing based on demand.

Looking under the hood: a high-performance, low-cost solution

That raises the question: If these systems are so useful, then why are they so rarely seen in the wild? Suryo suspects it has something to do with the complexity and high costs associated with the options that are available today. Having a good deal of experience with edge machine learning under his belt, he wondered if he might be able to come up with a simpler, less expensive solution that does the same job.

After giving the problem some thought, Suryo came up with a design that could finally put the brakes on inefficient parking systems. By using an object detection model, Suryo realized that individual vehicles, and the parking spaces that they occupy, could be identified in real time. Combining that information with the state of a parking meter (i.e., paid or unpaid) and the posted rules (e.g., 30-minute parking), violations could be addressed immediately. Similarly, prices could be reduced during periods of light demand.

The equipment used to build the prototype

In theory, that plan should work. However, if the result proved to be as complex and expensive as existing options, it would be of little help. So to keep the system user-friendly and easy on city budgets, Suryo chose to work with a Raspberry Pi 5 single-board computer. This hardware has enough power to run computer vision algorithms, but only if they are carefully tuned to work with resource-constrained platforms. For this reason, he leveraged Edge Impulse to develop the object detection pipeline.

For an application such as this, a high level of detection accuracy is absolutely essential. As such, Suryo chose to work with Edge Impulse’s new family of object detection models called YOLO-Pro. These models are based on the tried-and-true YOLO models, which have been so successful in this area, but with an important twist. Each and every YOLO-Pro model has been expertly tuned for top-tier performance on edge computing devices.

Learning the rules of the road

While YOLO-Pro models are pre-trained for object detection, the best performance is achieved by training them further with a domain-specific dataset. Understanding the benefits of this transfer learning approach, Suryo connected a USB camera to the Raspberry Pi to collect some images. To simplify development during the proof of concept stage, he used a miniature parking area and model cars.

Labeling data in Edge Impulse Studio

The collected images were then uploaded to a new project in Edge Impulse Studio using the Data Acquisition tool. Each image also needs to have metadata associated with it that specifies the objects of interest that the model is to learn to recognize. This metadata is supplied in the form of bounding boxes that are given labels. These can be manually drawn using the Labeling Queue tool, or the AI labeling feature can be leveraged to save some time by automating the job.

To handle all of the data processing, from the capture of raw images to the identification of vehicles, an impulse was created. As a first step, this impulse reduces the resolution of the incoming images. This reduces the computational complexity of downstream processing steps, which is essential when working with low-power edge hardware. The data is then fed into a YOLO-Pro object detection model that is tasked with understanding what cars look like.

The object detection impulse

The impulse was trained on the image dataset previously collected by Suryo. The training accuracy was reported as being 100%. That seems suspiciously high, but the result was confirmed by the model testing tool, which only uses data that was held out of the training process. When moving from the perfectly controlled conditions of the model to the real world, the accuracy may drop somewhat. However, these preliminary results indicate that the accuracy should still be excellent.

Where the rubber meets the road: deployment and beyond

In any case you can’t improve on perfection, so Suryo deployed the trained impulse to the Raspberry Pi. After installing the Edge Impulse Linux CLI on the computer, deploying the model was as easy as issuing a few commands in a terminal session. The impulse runner (also a part of the CLI) allows for immediate testing of a deployed model to check accuracy on the device’s actual hardware. Using this tool, Suryo found that the pipeline was working exactly as expected.

You can't ask for anything more

At this stage, the model is ready to be incorporated into custom software. In this way, the inference results can trigger actions — such as adjusting parking rates or issuing a citation for a violation.

The inferencing time is around 40ms, which is an incredibly fast for object-detection speed

Whether you have a parking problem to solve, want to get in better shape, or would like to improve your home security system, a custom Edge Impulse model can help you reach your goal. As a first step, read through Suryo’s project write-up to get a feel for how the platform could work for you. From there, poke around the public Edge Impulse project to understand how an impulse can be designed. After that, the only thing left to do is to unleash your imagination.

Comments

Subscribe

Are you interested in bringing machine learning intelligence to your devices? We're happy to help.

Subscribe to our newsletter