Data Collection for Spot Welding Defect Detection System
In the development of our spot welding defect detection system, the data collection phase was crucial to ensure the model's accuracy and reliability. This section details the methodologies and challenges encountered during the data collection process, as well as the solutions implemented to acquire a suitable dataset for training our machine learning model.
Initial Setup and Challenges
The first step in our data collection process involved integrating an IP camera into our spot welding setup. The IP camera was selected for its remote accessibility and high-resolution imaging capabilities, which are essential for capturing detailed images of the welding spots. To begin data collection, we accessed the IP camera's admin page by logging into the camera's homepage. This interface provided various options, including a feature to capture images, which seemed like a straightforward solution for our needs.
However, we quickly encountered a significant challenge. When we used the IP camera's default capture option, the images included a very large area around the welding spot. These wide-angle images were problematic for two main reasons. First, the welding spots, which are the primary focus for defect detection, occupied only a small fraction of the image. Second, training a machine learning model with such images would be inefficient, as the model would have to learn to ignore large amounts of irrelevant background information. This inefficiency could lead to poor performance and longer training times.
Attempted Solutions and Further Challenges
To address this issue, we initially attempted to use PatchCore, a technique designed to help models focus on specific patches or regions within an image. PatchCore was supposed to allow the model to concentrate on the welding spots by extracting and analysing smaller, relevant patches from the larger images. Unfortunately, PatchCore did not yield the expected results. The technique struggled to consistently identify and isolate the welding spots, resulting in inaccurate and unreliable data for training. This failure necessitated a more customised approach to our data collection.
Custom Image Capture Solution
Recognising the limitations of the default capture option and the ineffectiveness of PatchCore, we developed a custom solution to automatically capture zoomed images of the welding spots. This involved writing a script that would access the IP camera's live feed and apply a digital zoom to focus on the specific area where the welding spot is located. By doing so we ensured that each image captured would centre on the welding spot, excluding unnecessary background and providing a consistent, focused view for analysis.
To determine the appropriate zoom level and area of focus we conducted several tests adjusting the zoom and cropping parameters until the welding spots were clearly and consistently centred in the frame. This precision was critical, as any variation in the image focus could introduce noise and reduce the model's ability to learn effectively.
Dataset Compilation
With the custom image capture script in place, we began the process of compiling our dataset. We collected two types of images: those with a cab (welding spot) present and those with a cab absent. For each category we aimed to gather a balanced number of samples to ensure the model could learn to distinguish between defective and non-defective welds effectively. Over several days of operation we successfully collected approximately 100 images of welding spots (cab present) and 100 images of areas where welding spots should have been but were absent (cab not present).
During the collection process we ensured that the images varied enough to capture different angles lighting conditions and potential defects. This diversity is essential for training a robust model capable of generalising well to new, unseen data. Each image was reviewed to confirm that the welding spot was correctly focused and that the image quality was sufficient for analysis any images that did not meet these criteria were discarded and re-captured.
Conclusion
The data collection phase for our spot welding defect detection system highlighted the importance of tailored solutions in machine learning projects. The initial challenges with the IP camera's default capture option and the ineffective results from PatchCore underscored the need for a customised approach. By developing a script to automatically capture zoomed images we were able to compile a high-quality, focused dataset that forms the foundation for training an accurate and efficient defect detection model. This experience demonstrates that in machine learning, the quality and relevance of the dataset are paramount and sometimes require innovative solutions to achieve the desired outcomes.