TL;DR
This paper introduces TCQI-YOLOv5, an enhanced YOLOv5 model for automatically detecting defects in automotive terminal crimping. By integrating novel feature extraction modules and an improved loss function, it achieves a remarkable 98.3% mAP, significantly outperforming previous methods and meeting real-time industrial demands.
What Problem Does This Paper Address?
The automotive industry relies heavily on reliable signal transmission, with wiring harnesses and their terminal connections being critical. Currently, inspecting the quality of terminal crimping is largely a manual process. This manual inspection is inefficient, labor-intensive, and prone to errors like missed defects. As production lines speed up, this manual approach becomes a bottleneck, necessitating an automated, accurate, and fast solution for terminal crimping quality inspection (TCQI).
Methods
The core of this work is an improved YOLOv5 architecture, dubbed TCQI-YOLOv5. Key modifications include:
- Enhanced Feature Extraction: The original YOLOv5's C3 module is replaced with a novel C2f-fast-EMA hybrid module. This module combines:
- C2f Module: A more efficient structure that uses CBS (Convolution-BatchNorm-SiLU) and split/concat operations to improve feature representation and mitigate vanishing gradients, particularly beneficial for small objects.
- FasterNet Module: Incorporates Partial Convolution (PConv) in its bottleneck layers. PConv processes only a fraction of input channels, drastically reducing computational cost and memory access without sacrificing accuracy, thus boosting inference speed.
- Efficient Multi-scale Attention (EMA) Mechanism: This attention module enhances the network's ability to capture critical feature information by grouping features and using parallel attention branches to aggregate multi-scale spatial and channel dependencies. It's crucial for distinguishing subtle differences, like insulation length variations.
- Improved Localization: The traditional IOU loss function is replaced with SIOU loss. SIOU considers not only overlap but also the angle, distance, and shape between predicted and ground-truth bounding boxes, leading to more accurate localization, especially for small or elongated defect regions.
Datasets
The study utilized a custom dataset for terminal crimping quality inspection. This dataset comprises 4000 images, with 500 images for each of the eight TCQI categories. These categories represent various defect types related to insulation crimping, crimp barrel, and wire tip. The dataset was annotated using Labelimg software.
Key Insights and Ideas
- Subtle Defects are Key: The paper highlights that many critical defects, like shallow insulation crimps, are characterized by subtle visual differences (e.g., slight variations in length). This underscores the need for models with high sensitivity to fine-grained features.
- Efficiency vs. Accuracy Trade-off is Manageable: By incorporating modules like FasterNet with PConv, the researchers demonstrate that it's possible to significantly reduce computational load and improve inference speed without a substantial drop in accuracy.
- Attention is Crucial for Fine Distinctions: The EMA mechanism proved vital in distinguishing between visually similar defects, such as shallow and normal insulation crimps, by focusing on pixel-level feature differences.
- Loss Function Matters for Localization: The shift from IOU to SIOU loss significantly improved bounding box regression accuracy, which is critical for precisely identifying and localizing defects.
Key Results
- High Overall Accuracy: The TCQI-YOLOv5 model achieved a mean Average Precision (mAP) of 98.3%, a significant improvement over the baseline YOLOv5.
- Improved Detection of Difficult Defects: For the challenging "shallow insulation crimp" (jypqd) category, precision increased from 89.4% to 96.3% after the proposed enhancements.
- Real-time Performance: The model's detection speed meets industrial requirements, with an average frame rate of 53 FPS (though slightly lower than the baseline due to enhancements, it's still well within practical limits).
- Component Contributions: Ablation studies showed that each component (C2f, FasterNet, EMA, SIOU) contributed to the overall performance improvement, with EMA providing the largest single-step mAP increase.
- Comparison to Other Models: TCQI-YOLOv5 outperformed established models like Faster-RCNN and SSD, and also surpassed the base YOLOv5s and YOLOv5m models in mAP.
Limitations and Future Work
- Small/Blurred Defects: The model sometimes struggles with extremely small or blurred defects, especially when they are near edges or affected by motion, complex lighting, or low-resolution imaging. This is attributed to the loss of fine-grained spatial information during down-sampling in the backbone.
- Inter-class Confusion: For defects with high structural similarity, especially in noisy backgrounds, the model can still exhibit inter-class confusion (e.g., misclassifying "wire exposure").
- Future Directions:
- Explore High-Resolution Feature Fusion techniques to better preserve location and detail for small targets.
- Integrate various terminal morphologies into training and categorize terminals first before applying defect detection.
- Investigate newer YOLO versions and other advanced detection algorithms.
Summary updated