SolLione's World


I Tried Using Anomalib in Production

Published/Updated: 09 16 2026

So I have been working on an AI project for detecting contamination on berry harvesters belts while they are harvesting in the field. The idea is that humans are fallible and the AI can alert the human if something like a snake gets onto the belt. For reference, these berry harvesters are usually situated on an upper floor with conveyor belts that take the berry from the ground level up to the top where they can be easily sorted by workers.

My two ideas for this project were either using YOLO (darknet) or anomalib (anomaly detection). The problem with detecting contamination with an AI model is you need training data. Now, I am no food safety expert but finding a farmer who would be willing to contaminate their 200,000 USD machine for a little project would probably be difficult. Therefore, it would make more sense to situate cameras on the harvesters were only good images could be taken with bad images (contaminants) being manually filtered out.

After collecting the data I found that anomaly detection is no good for what I am trying to do. The anomaly detection model sees the background (the empty belt) as being normal, but because the berries are in different spots on the belt, they are usually seen as anomalies. Therefore, I would conclude that the only way to get accurate detection of contaminants would be through YOLO models. It does make getting good training data harder though…

My setup was a global shutter USB camera and a raspberry pi 02W. There was a script on this device that took images. I then had a jetson orin nano super at home which ran the inference code. Basically, the system was camera-rpi-tailscale-tailscale-jetson. Both the raspberry pi and the jetson needed an internet connection. I used a hotspot on my phone until I caved and got a real hotspot device.

For projects like this, I would say the most important actions are those that make collection of data easier. Things should be reliable, and not require tinkering over a ssh connection. For this reason, I have considered adding buttons to my raspberry pi that can help me do certain things like start data collection, stop data collection, save images to the server, shut down the device, etc.

In conclusion, anomalib is better for manufacturing where you are looking for “defects” while YOLO is better for identifying if something is present. Seems obvious in hindsight, but its a shame it turned out this way.