Abstract
Industrial quality control requires high-precision detection of surface defects such as cracks, bubbles, and stains. However, standard object detection frameworks often struggle with background texture variations and boundary ambiguity. This paper presents the Reference-based Defect Detection Network (RDDN), a novel framework designed to mitigate these challenges by utilizing template images to cancel background noise and context boxes to resolve visual confusion. By focusing on the residual signal between a defective sample and a clean reference, RDDN achieves significant performance gains on complex industrial benchmarks.
Introduction
In industrial manufacturing, identifying tiny defects is a high-stakes task where accuracy directly impacts safety and cost. While general-purpose object detectors like Faster R-CNN have revolutionized computer vision, they face two specific hurdles in industrial environments:
- Texture Shift (TS): Industrial backgrounds, such as the intricate weave of fabric or the grain of aluminum, are rarely perfectly uniform. Detectors often overfit to these background patterns, leading to failure when the texture shifts slightly.
- Partial Visual Confusion (PVC): Defects are often irregularly shaped. A bounding box capturing only a portion of a defect can appear identical to a box capturing a complete, smaller defect. Without broader spatial context, detectors struggle to accurately localize defect boundaries.
To address these issues, the RDDN introduces two primary mechanisms: Template Reference (TR) and Context Reference (CR).
Methodology
1. Template Reference (TR)
The Template Reference module provides the network with a "clean" version of the surface to serve as a baseline. The authors explore three implementation strategies for this reference:
- TR-Pre: Pixel-level subtraction of the template from the input image before it enters the backbone.
- TR-Inter: Feature-level subtraction within the Feature Pyramid Network (FPN). This method "erases" background features, forcing the model to prioritize the residual signal—the defect itself.
- TR-Post: A post-processing refinement that compares the features of a detected region to the corresponding region in the template using cosine similarity. If the regions are highly similar, the detection score is penalized.
Recognizing that perfect "clean" templates are not always available in real-world scenarios, the authors developed a Pseudo Template Generator (PTG). This GAN-like sub-network synthesizes a "normal" version of a defective image, allowing the TR modules to function even without a pre-existing reference library.
2. Context Reference (CR)
To resolve the ambiguity of partial versus complete defects, the Context Reference module introduces a concentric larger box for every region proposal. By fusing the features of the original proposal with this expanded context, the model gains a wider field of view. This additional information allows the detector to distinguish between a complete defect and a crop that only contains a fragment of a larger anomaly.
Experimental Evaluation
Datasets
The RDDN was evaluated on two challenging industrial benchmarks:
- Aluminum Dataset: Comprising 4,356 images with 10 defect types (e.g., abrasion marks, bubbles). This dataset lacks natural templates, serving as a primary test for the Pseudo Template Generator.
- Fabric Dataset: Comprising 3,522 images with 15 defect categories. This dataset includes well-aligned template images, allowing for a direct evaluation of the TR modules.
Results
The RDDN consistently outperformed baseline detectors across both benchmarks:
- Aluminum Performance: Utilizing a ResNet-101 backbone, the RDDN achieved 83.9 mAP, a substantial improvement over the 77.8 mAP baseline.
- Fabric Performance: The gains were even more significant on fabric textures. The baseline Faster R-CNN scored 42.2 mAP, while the full RDDN reached 51.4 mAP—a nearly 10-point increase.
Furthermore, the TR-Inter and TR-Post methods demonstrated superior robustness to "pixel-gap" (slight misalignments between the template and the sample) compared to simple pixel-level subtraction.
Discussion and Insights
The success of RDDN highlights the power of subtraction in anomaly detection. In many vision tasks, the goal is to learn the background; in defect detection, the background is essentially noise. By explicitly removing this noise—either through pixel subtraction or feature-level suppression—the signal-to-noise ratio for the defect is dramatically increased.
Additionally, the Context Reference module proves that looking "outside the box" is essential for boundary resolution. Finally, the Pseudo Template Generator demonstrates that the model can effectively "hallucinate" a normal background, reducing the dependency on exhaustive reference databases.
Limitations and Future Work
Despite its performance, the RDDN introduces certain trade-offs:
- Computational Overhead: TR-Inter effectively doubles the memory required for CNN backbone features, as both the sample and template must be processed.
- Inference Speed: The multi-stage pipeline is slower than vanilla detectors, which may pose challenges for high-speed production lines.
- Alignment Sensitivity: While the model handles minor shifts, it still requires relatively well-aligned templates. Future research will focus on optimizing these modules for real-time deployment and improving robustness to significant rotations or scaling between samples and references.
Summary updated