Autoproc Logo

Assembly Cell Nut Weld Anomaly Detection

Introduction

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.

Problem Overview

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.

The Solution: Autoencoder-Based Anomaly Detection

Step 1: Preprocessing with YOLO

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 nut weld regions

YOLO model detecting and cropping the region of interest

Step 2: Autoencoder Training

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.

Autoencoder reconstruction comparison

Comparison of original images and their error reconstructions

Advanced Techniques: Gaussian Mixture Modeling

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.

Gaussian Mixture Model clustering visualization

Visualization log-likelihood using Gaussian Mixture Models

Results and Insights

The system's performance exceeded initial expectations given the constraints. Key outcomes include:

Conclusion

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.