Detecting anomalies in nut welds within an assembly cell is a critical task for ensuring product quality. We were tasked with creating a system that could analyze an image of a part and determine whether the nut weld was properly executed. The project presented several constraints, including limited budget, fixed camera placement, and no access to anomalous training data. Here, we describe the challenges faced, the methods implemented, and the solutions devised to develop a reliable anomaly detection system.
The main requirement was to develop a system capable of detecting faulty nut welds using only images of correctly welded parts for training. Several constraints shaped our approach:
To test our system, the plant's team manually created a dozen examples simulating anomalies based on past experiences.
Given the constraints of camera placement, we trained a fine-tuned YOLO model to identify and crop out the region of interest: the nut weld. Despite the limitations in image quality due to distance and lighting, this step reliably isolated the nut weld in every captured frame.
YOLO model detecting and cropping the region of interest
With ~7,000 real-world samples confirmed to have no anomalies, we trained an autoencoder to reconstruct the cropped images of nut welds. The autoencoder architecture was chosen for its ability to learn a compressed representation of the data and highlight deviations from the norm.
Comparison of original images and their error reconstructions
To further improve anomaly detection, we modified the architecture to remove the decoder and applied a Gaussian Mixture Model (GMM) to the encoded feature space. This approach clustered the encoded representations of correctly welded parts and assigned log-likelihood values to new samples.
Visualization log-likelihood using Gaussian Mixture Models
The system's performance exceeded initial expectations given the constraints. Key outcomes include:
By leveraging a combination of YOLO-based cropping, autoencoder training, and Gaussian Mixture Modeling, we developed a system capable of detecting nut weld anomalies with high reliability. This approach addresses the challenge of working with limited data, constrained budgets, and suboptimal imaging conditions. The methods outlined here can serve as a template for anomaly detection in other industrial applications with similar constraints.