🚗 Smart Car Registration Number Detection : Edge AI + Cloud AI (Gemini)
💡 What Inspired Me
I was fascinated by the growing hype around Edge AI and wanted to understand how it actually works in real world applications. I had read a lot about how it reduces latency compared to Cloud AI, but I wasn’t sure how that translated into practice. To truly experience it, I decided to build something hands on, a smart parking system that detects cars entering a parking lot and automatically reads their registration numbers using both Edge and Cloud AI.
🧠 What I Learned
Working on this project taught me a lot about the balance between edge and cloud computing. I learned firsthand how Edge AI performs faster because it processes data locally, avoiding network delays that Cloud AI alone would face.
Some key takeaways:
- Running a machine learning model on a Raspberry Pi was a great learning experience.
- I figured out how to interface a camera with the Pi and process real time images using Python.
- Discovered that the
libcameralibrary works well with Linux Bookworm but not with Trixie, which was an important compatibility lesson.
🏗️ How I Built My Project
The project evolved through two main versions:
Version 1: Ultrasonic Sensor Approach
- Used an ultrasonic sensor to measure the distance of objects from the sensor.
- If an object was closer than a certain threshold, the Pi would take a picture and send it to the Gemini API to extract the car’s registration number.
- The problem: this approach triggered even when humans or other objects came near the sensor, leading to unnecessary and costly API calls.
Version 2: Edge AI + Cloud AI
- Improved the system by integrating Edge AI (YOLO model) to detect car bumpers using the Raspberry Pi camera.
- When the front or back bumper was detected, the Pi captured the image and sent it to Google Gemini for license plate recognition.
- The focus on detecting bumpers instead of entire cars ensured clear license plate images and more accurate results using the same camera.
This version significantly reduced false detections and optimized API usage, combining the speed of Edge AI with the intelligence of Cloud AI.
⚙️ Challenges I Faced
- No prior experience running machine learning models on edge devices. I used AI tools and tutorials to guide me through the process.
- Had to select and learn a suitable model with minimal prior ML experience, eventually choosing YOLO (Ultralytics) for its simplicity and performance.
- Hardware setup issues: I had to gather the necessary components like the ultrasonic sensor and camera one by one which took alot of my time (waiting).
- Compatibility issues:
libcameradidn’t work properly with the new Raspberry Pi recommended Trixie Linux, so I had to switch back to Bookworm for stable performance.
Through this project, I got a hands on understanding of Edge AI and Cloud AI collaboration, built practical IoT experience, and learned how to design efficient, real time AI systems for real world use cases like charged smart parking.
Built With
- camera-module-2
- gemeni-api
- python
- raspberry-pi
- ultralytics
- ultrasonic-sensor
- yolo