Edge Impulse Project Link: https://studio.edgeimpulse.com/public/568750/live
The Real Challenge in Electronics ManufacturingA tiny mistake in a circuit board can render an entire electronic device useless. Printed Circuit Boards are fundamental to modern technology, and ensuring their quality is a critical challenge that goes far beyond simple visual inspection. In electronics manufacturing, even microscopic defects can compromise the performance and reliability of complex electronic systems.
Traditional quality control methods depend on human inspectors examining circuit boards, a process that is time-consuming and susceptible to human error. A technician might miss a microscopic solder bridge, a misaligned component, or a subtle manufacturing defect that could cause device failure. Automated Optical Inspection (AOI) addresses these challenges by providing a more systematic and reliable approach to quality control.
Our motivation for this project stems directly from our own manufacturing needs. As a small team that develops and produces specialized electronic products in limited quantities, we needed a solution that could provide reliable, repeatable inspection for our small-batch production runs.
Our project addresses the complexity of PCB inspection by combining advanced Artificial Intelligence with specialized hardware. Traditional AOI systems used predefined rules and pattern-matching techniques, which worked well for simple designs but struggled with increasingly complex modern circuit boards. These older systems couldn't easily adapt to variations in manufacturing processes or detect nuanced defects that might escape human detection.
The core of our solution is the DeepX DX-M1, a compact AI accelerator and DeepX's first middle-entry edge Neural Processing Unit. With an impressive AI performance of 23 TOPS, this PCIe M.2 module is a powerful solution for edge computing. The DX-M1 module is equipped with advanced integrated technologies, including a dual-core ARM processor, PCIe Gen3 interface, LPDDR4X/5 memory support, and an integrated image signal processor.
The module integrates seamlessly with the Orange Pi 5 Plus, allowing us to process images in real-time and identify potential issues instantly, without the delays associated with cloud-based processing or manual inspection. While the DeepX module is designed for diverse applications like automotive advanced driver-assistance systems, machine vision, and smart mobility solutions, we've adapted it specifically for precision PCB inspection.
We began by collecting a small dataset of PCB images, capturing both perfectly manufactured boards and some with missing components. We collected the data using a USB digital microscope attached to the Orange Pi. After capturing this visual data, we uploaded it to the Edge Impulse platform and labeled each image as either showing an anomaly or no anomaly.
In the Edge Impulse Studio, we designed an impulse specifically tailored for detecting PCB anomalies using the FOMO-AD algorithm. This algorithm is a powerful tool for identifying visual anomalies in images, particularly when traditional supervised methods fall short. Unlike typical defect detection approaches, FOMO-AD doesn't rely on predefined templates or extensive labeled datasets of defects. Instead, it learns the visual characteristics of normal PCB images and flags deviations as anomalies.
FOMO-AD offers two primary methods for anomaly detection: PatchCore and Gaussian Mixture Model (GMM). For this project, we utilized GMM, which creates a probabilistic model of features extracted from normal PCB images. During evaluation, the algorithm calculates the likelihood that the features of a new image align with the learned model. Features with low probabilities are flagged as anomalies, and an anomaly score is generated for specific regions of the image.
These techniques allow FOMO-AD to go beyond simple anomaly detection by also pinpointing the exact locations of defects. In our case, this means not only identifying the presence of anomalies on a PCB but also highlighting specific areasβsuch as missing components, solder bridges, or misalignmentsβthat require attention.
Next, we trained and tested our model on a separate dataset, carefully analyzing the identified anomalous regions in the samples to validate the model's accuracy and ensure it performs as intended.
Converting our Edge Impulse-trained model for DeepX hardware required a complex model conversion process. From the Edge Impulse project Dashboard, we downloaded the TensorFlow Lite model and model head. We then transformed the original TensorFlow Lite model to ONNX format and finally to DNNX, a hardware-specific format for our AI accelerator.
Our deployment strategy divided the processing across components: the core model ran on the NPU using the DeepX inference engine, while the model head ran on the Orange Pi CPU using TensorFlow Lite. A significant challenge arose when the converted DNNX model produced output dimensions different from the initial Edge Impulse model. To address this, we developed a calibration matrix by processing our calibration dataset through both the DeepX and original TensorFlow Lite models and applying the least squares method. This mathematical technique bridged the output variations, ensuring consistent and accurate model performance across our edge computing setup.
Anomaly detection results on the DeepX DX-M1:
The implications of this technology extend beyond a single manufacturing process. By eliminating human error, increasing inspection speed, and catching defects that would previously go unnoticed, we're improving quality control methodologies. Our approach offers significant advantages: adaptive learning that improves over time, rapid inspections that don't slow down production, and the ability to detect complex defects that traditional methods might miss.
Comments