How to Build Cost-Effective Edge AI for Quality & Failure Detection

There are infinitely more ways things can go wrong than there are ways they can go right. Anyone who has spent any time working in manufacturing, cybersecurity, or fraud detection knows this all too well. While success requires every gear to mesh and every line of code to perform exactly as expected, failure can result from a single, infinitesimal deviation. It is the one unpatched vulnerability in otherwise secure code, the microscopic fracture in a turbine blade, or the slight anomaly in a transaction pattern that goes unnoticed that makes all the difference.

With so many ways for things to go wrong, setting up a monitoring system to check for each one is impractical. A better solution is something called anomaly detection. Instead of trying to catalog every possible failure mode, anomaly detection focuses on deeply understanding what "normal" looks like by using machine learning algorithms. By establishing a baseline of healthy operations, the system can flag anything that deviates from the expected pattern.

Anomaly detection models are trained to recognize normal conditions

One area where anomaly detection has proven itself to be particularly valuable is in manufacturing. When paired with a camera, a visual anomaly detection system can inspect items as they are produced, flagging any defects that arise in real time. These capabilities could significantly improve quality control at companies both large and small. However, existing solutions are too expensive or complex for many organizations to implement.

Toward Accessible Edge AI

Fortunately, times are changing. Advances in edge AI hardware and the Edge Impulse machine learning development platform are making anomaly detection systems more accessible than ever before. So much so, in fact, that a prototype system can now be built in just a few hours for little more than $100. That is exactly what Roni Bandini has done, and he has documented his work so that others can do the same.

Bandini designed his project around the Thundercomm Rubik Pi 3. This board shares a footprint and layout similar to those of a Raspberry Pi, but under the hood it is something quite different. It is built around the Qualcomm Dragonwing QCS6490 platform, which integrates a Hexagon neural processing unit capable of up to 12 trillion operations per second alongside an Adreno 643 GPU and an octa-core CPU. Combined with 8 GB of LPDDR4x memory and 128 GB of fast UFS 2.2 storage, this little computer is far more capable than many boards typically used for embedded vision projects. This level of performance means that machine learning inference can be run locally, without relying on cloud connectivity, reducing latency and improving reliability in industrial environments.

Streamlining Development with Edge Impulse

On the software side, Bandini leaned heavily on Edge Impulse. This platform simplifies building, training, optimizing, and deploying machine learning algorithms for embedded and edge devices. After updating the system and installing a small set of dependencies on the Rubik Pi 3, Bandini installed the Edge Impulse Linux runner. This runner handles camera input, model execution, and output formatting, allowing developers to focus on the model itself rather than low-level plumbing.

A visual anomaly detector built with Edge Impulse

Using this setup, any model developed with Edge Impulse can rapidly be deployed for use in a real-world anomaly detection system. Bandini pointed to one of his previous projects — an automated manufacturing inspection system — as an example. This project uses the FOMO-AD visual anomaly detection model to find flaws in electric components. Following along with a project such as this is a good way to learn how to build your own visual anomaly detection models. The same workflow can be adapted to a wide range of use cases, from detecting surface defects on manufactured goods to spotting missing components, packaging errors, or even subtle changes in texture or alignment. By retraining the model with images relevant to a specific application, the system can be tailored to meet the needs of different industries and production environments.

Automating Insights and Reporting

Once the anomaly detection system has been built, the next consideration is how defects should be reported. Bandini focused on using an automation workflow called n8n. It is a platform that allows data from different sources to be aggregated, processed, and acted upon with minimal custom code. In this project, n8n is used to receive anomaly data from the Rubik Pi 3 via a webhook, store it in a data table, and generate reports on demand.

n8n can help automate reporting

A small Python script parses the Edge Impulse runner output and sends relevant anomaly information such as coordinates and scores to n8n whenever a configurable threshold is exceeded. From there, n8n can generate graphs, aggregate statistics over time, and send email notifications to stakeholders. This separation of functions simplifies development and debugging. The edge device focuses on real-time inference, while the workflow platform handles reporting, visualization, and integration with other systems.

By lowering the cost and complexity barrier, platforms such as Edge Impulse and devices like the Rubik Pi 3 are enabling more organizations to move from reactive quality control to proactive, data-driven inspection. For manufacturers looking to catch problems before they escalate, that shift could make all the difference.

To learn more about how Bandini developed this project, be sure to read the project write-up.

Comments

Subscribe

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

Subscribe to our newsletter