
(Source: Bing Image Creator)
Introduction
Quality control is a critical aspect of any production line or manufacturing process. Many times quality control is performed by a specially trained or senior employee meticulously spotting faulty items as they roll off the assembly line. But what if that employee becomes distracted or tired? The consequences could be significant: increased shipping and handling costs via product returns, administrative expenses, or the need for refunds to customers due to missing or defective items. Artificial intelligence and specifically a Machine Learning algorithm named FOMO-AD (Faster Objects, More Objects - Anomaly Detection) by Edge Impulse could be instrumental in addressing this challenge.How Does Visual Anomaly Detection Work?


Hardware and Software Setup
FOMO-AD requires an Enterprise plan for Edge Impulse. To explore the capability, you can request an expert-led trial. Download the Python parser script at https://github.com/ronibandini/visualAnomaly, orgit clone
the full repo.
I am using the Texas Instruments TDA4VM development board in this project, so I will download the OS image from https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-SK-TDA4VM/08.06.00.11. The TI AM62A and AM68A Development Kits could also be used in a similar fashion as described in this project.
Note: Download version 8 (08.06.00.11 as indicated by the URL), as the latest version of the image doesn’t seem to detect the USB camera while executing the Edge Impulse Linux Runner later.Extract and flash the image with Etcher or any other similar application.


- User: root
- Password: (empty)

npm
:
http://<your-ip-address>:4912
. For example, mine was http://192.168.1.67:4912
.
Data Collection

- Upload around 100 pictures of correct, quality products to Edge Impulse using No Anomaly as the label
- In Impulse Design, Select Image Data, 96x96 pixels, and Squash as the resize mode.
- Select an Image processing block, and choose FOMO-AD.


Testing The Model
Every learning block has a threshold. This can be the minimum confidence that a neural network needs to have, or the maximum anomaly score before a sample is tagged as an anomaly. You can configure these thresholds to tweak the sensitivity of these learning blocks. This affects both live classification as well as model testing.
Understanding the Anomaly Matrix

Deployment

Note: the SoC’s built-in AI accelerator (edge-impulse-linux-runner —force-engine tidl —force-target runner-linux-aarch64-tda4vm) does not work yet with Visual Anomaly for this board, but should soon.Log in with your Edge Impulse credentials and select your Edge Impulse project.
Note: If you need to change the threshold or make other changes to the model, you can re-download the model with edge-impulse-linux-runner –reset
.
Parsing the Runner Response

anomaly.py
parsing script to the /opt/edge_ai_apps
folder.
Now execute:
X
for anomaly and .
for no anomaly.
Limitations

Final Notes
In conclusion, embracing FOMO-AD can revolutionize quality control, making it more efficient, accurate, and less burdensome for human workers.
Demo Video
References
- https://jakevdp.github.io/PythonDataScienceHandbook/05.12-gaussian-mixtures.html
- https://www.youtube.com/watch?v=se9ZDBVKN1M
- https://www.edge-ai-vision.com/2023/06/visual-anomaly-detection-with-fomo-ad-a-presentation-from-edge-impulse
- https://cumulusds.com/unveiling-the-hidden-cost-of-poor-quality-copq-on-construction-and-maintenance-projects