Package Inspection with Anomaly Detection and a VLM on the Arduino UNO Q
Inspecting a parcel before shipping means looking at it, recognising a defect and deciding what to do about it. SolomonGithu’s project does all of this on the Arduino UNO Q: a visual anomaly detection model finds dents, tears and liquid leaks, then SmolVLM-500M describes the defect in natural language. Both models run locally on the board, with no cloud. Package inspection with Arduino thus becomes a self-contained block, ready to be mounted on a packaging line.
The logic is a cascade. The first stage is a detector trained with Edge Impulse Studio and exported as an .eim binary. The second stage is the VLM, which only comes into play when needed. This split reduces false alarms: the lightweight model does the heavy lifting in 31 ms, and the heavy model only speaks up if there really is something to report.
The Edge Impulse detector: 31 ms, 3.3 MB of RAM and 372 KB of flash

The anomaly detection model is the part that sets the performance figures. On the UNO Q it has an on-device inference time of 31 ms, a RAM peak of 3.3 MB and takes up 372 KB of flash. These are numbers that leave room for the rest of the application, because the board still has to handle the webcam, the web interface and loading the VLM. The model is exported from Edge Impulse Studio as an .eim binary and copied into the /home/arduino/.arduino-bricks/ei-models/ directory of the UNO Q, along with a model.yaml file that describes its configuration.
The reference Edge Impulse project has ID 1030618. Anyone who wants to rebuild it can start from there and replace the dataset with their own images of parcels, then re-export the binary. The vlm_anomaly_threshold threshold decides when the second stage steps in: below that threshold the image is considered clean and the VLM is not loaded.
SmolVLM-500M and the application on App Lab

When the anomaly exceeds the threshold, the system loads SmolVLM-500M and passes it the image together with a text prompt defined by vlm_prompt. The processing takes about 29 seconds, during which the UNO Q’s CPU peaks at 99% utilisation. The natural-language answer can be useful to a human inspector or to an AI agent that adjusts operating parameters, for example the gripping force of robots if the parcel is dented.
The application, backend and frontend, is cloned from a GitHub repository and copied into the /home/arduino/ArduinoApps/ directory of the UNO Q. It is started from App Lab with the Run button and opens in the browser at the board’s local IP address on port 7000. The image is chosen from the sample ones in the img folder or uploaded as a JPG or PNG file up to a maximum of 500 KB. Pressing Run Detection starts the anomaly model first and then, if needed, the VLM.
- Arduino UNO Q as the only computing board
- Logitech HD Pro webcam connected via USB
- USB hub powered from the mains
- Anomaly model exported from Edge Impulse as .eim
- SmolVLM-500M loaded on-device
To rebuild the project you need an Arduino UNO Q, a USB webcam and a USB hub powered from the mains: the webcam alone can draw more current than the board makes available on a single port. For the computing side, the board from the catalogue with the STM32U585 microcontroller and the integrated processor is the one the project is built on, so no other hardware is needed. The full description of the flow and the files can be found on the SolomonGithu project page on Hackster.io.
The SmolVLM-256M model is a lighter alternative, but according to the author’s tests it shows limits in captioning: it hallucinates text, misidentifies objects and is less reliable at following instructions. The 256M has only 18% of its training data dedicated to image captioning, so the choice of the 500M is not random. Those in a hurry can still try it, accepting less precise descriptions.
Source: https://www.hackster.io/sologithu/genai-on-arduino-uno-q-spots-and-describes-anomalies-5d1a49
The post Package Inspection with Anomaly Detection and a VLM on the Arduino UNO Q appeared first on Open Electronics.
[original story: Open Electronics]