Edge Impulse logo
Blog Post

Driving Under Pressure: Flat Tire Detection Using Machine Vision

TinyML, Computer VisionThis device uses Edge Impulse and an OpenMV Cam to measure a car's tire levels and alerts the driver if they are unsafe to drive on.

Nick Bild

February 8, 2022

    According to the U.S. Department of Transportation, 28 percent of vehicles on the road have at least one underinflated tire. This poses a serious problem, given that even small changes in tire pressure affect a vehicle’s handling and stopping distance. Even more concerning is that poor management of tire pressure can lead to potentially hazardous blowouts and tread separations. Your pocketbook and the environment can also suffer from the resulting poor fuel economy.

    Alerting drivers about underinflated tires may seem like a solved problem with nearly all new cars now being equipped with tire pressure monitoring systems (TPMS), but these systems do have drawbacks under certain circumstances. In particular, when managing a large fleet of vehicles, TPMS is not practical because it requires visual inspection of the dashboard inside each car. Bob Hammell has recently put forward an idea for a device that solves this problem by autonomously inspecting the tires of a vehicle as it passes by.

    Spotting an under-inflated tire.

    Hammell’s prototype device consists of an OpenMV Cam H7 Plus board, which provides both computational resources and an image sensor. This is fitted into a custom 3D-printed case along with a LiPo battery and an RGB LED. The device is attached to a 3D-printed stand, which is placed at ground level, where it can get a good view of the tires of any vehicles that pass by.  When the device is powered on, it begins executing a loop in which images are captured, then classified by a machine learning model, and finally, the color of the LED on top of the case indicates the inflation level of the tire.

    The inner workings of the device.

    OpenMV IDE was used to capture images of tires, at differing levels of inflation, with the OpenMV Cam.  Hammell was sure to collect a wide variety of images for each class, “full,” “flat,” and “no tire,” to ensure that the classifier would work well under real-world conditions. This dataset was seamlessly loaded into a new project in Edge Impulse by linking OpenMV IDE to an Edge Impulse account.  With the dataset uploaded, it was time to pivot over to the Edge Impulse interface to design the data processing pipeline.

    For this project, the pipeline started with an “Image Data” block that downsampled images and converted them into a list of features so that they would be compatible with the next step, which was a “Learning” block. The specific block chosen uses transfer learning to benefit from the learning already encoded in a MobileNetV2 neural network that was pre-trained on a very large dataset. This model architecture is known to perform well in image classification tasks, and is optimized for embedded devices, such as the OpenMV Cam H7 Plus.

    Preparing the data.

    After setting the training parameters and checking the architecture of the neural network, Hammell used the “Transfer Learning” tab to start training the model with his tire inflation dataset. Once training finished, the “Model” window provided metrics about how well the model performed in evaluating the validation data. The results showed that 100% of “no tire” images were correctly classified, and 97.8% and 94.7% of “full” and “flat” images, respectively, were also accurately identified.  If you are not able to achieve such impressive results initially, Hammell suggests revisiting your input data to ensure that each image does in fact conform to the class definition, and also possibly capturing more sample data.  Tuning the model parameters on the “Transfer Learning” tab can also improve results.

    Running this model locally on the OpenMV Cam was as simple as clicking on “Deployment” in the Edge Impulse navigation menu and downloading a zip file. These files were copied to the device over USB, along with a custom Python script, and everything was ready to go.  Whenever a tire with low pressure is detected, the LED turns red to visually alert an inspector.  Similarly, the LED turns green when the tire pressure is looking good.

    Assessing model performance.

    Hammell has future plans to turn his prototype into a device that can be used practically in industrial applications. To get there, he notes that he will need to increase the size of the training dataset and include different types of tires. He also wants to make modifications to be able to detect different pressure ranges, rather than just “flat” or “full.”  Further, to make the notifications more useful, Hammell has plans to replace the LED with email or text message alerts.

    Want to see Edge Impulse in action? Schedule a demo today. 


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

    Subscribe to our newsletter