CF-YOLO: Context-Aware Feature Refinement for Camouflaged Industrial Micro-Defect Detection
Authors: Xinda Yu, Kunxin Zheng, Chunan Yu, Qingbo Song, Hao Xiao, Ying Zang, Jie Liu
Organizations: School of Information Engineering, Huzhou University, Huzhou, 313000, China. · School of Computer Science and Engineering, Nanjing University of Science and Technology, Nanjing, 210000, China.
Automated detection of surface micro-defects on industrial components, such as copper tubes, is critically important for quality assurance but remains challenging due to the minute scale of anomalies and their visual camouflage against complex backgrounds. These factors lead to weak feature representations and high rates of false positives and missed detections. To address these issues, we propose a novel real-time detection framework designed for efficient context perception and feature refinement. Our method integrates a Context-Perception Aggregation Module (CPAM), which synergises large-kernel perception for macro-texture context and small-kernel aggregation for sharp boundary delineation, effectively breaking the background camouflage. Furthermore, a Feature Additive Refinement Module (FARM) employs a linear-complexity additive token mixer to globally verify and refine the representation of fine-grained anomalies, suppressing noise-induced errors. To support research in this domain, we introduce the Copper Tube Defect Dataset (CTDD), a manually annotated benchmark containing 1,847 images and 4,898 boundingbox defect instances from copper-tube inspection scenarios. Extensive experiments demonstrate that our detector achieves strong and consistent performance on CTDD, outperforming representative baseline detectors, including YOLOv11, by 2.2% in mAP@50 and 3.9% in Precision while maintaining real-time inference speed. This work provides a robust and efficient solution for high-precision industrial inspection, bridging the gap between contextual understanding and detailed feature analysis. Our code and model are available at: https://github.com/Yu-Xinda/CFYOLO-Context-Aware-Feature-Refinement-for-Camouflaged-Industrial-Micro-Defect-Detection
Figures & tables
Figure 1: Visualization of challenging defects with severe background camouflage. The anomalies are nearly indistinguishable due to highly similar textures with the background. Their locations are indicated by red bounding boxes.
Figure 2: Schematic illustration of CF-YOLO for industrial copper tube defect detection, integrating CPAM for context perception and FARM for semantic refinement.
Figure 3: The architecture of the Context-Perception Aggregation Module (CPAM), illustrating the decoupling of Large-Kernel Perception (LKP) and Small-Kernel Aggregation (SKA).
Figure 4: The architecture of the Feature Additive Refinement Module (FARM). Adopting the Convolutional Additive Token Mixer (CATM) paradigm, it performs global semantic refinement via dual-domain (spatial and channel) interactions and linear-complexity additive similarity.
Figure 5: The architecture of the Decoupled Detection Head, featuring parallel streams for classification and regression.
Figure 6: Visual samples from the constructed Copper Tube Defect Dataset.
\toprule Model
P
AP 50
AP 95
AP 75
mIoU
F 1
F 0.5
Avg
\midrule Cascade R-CNN [ 30 ]
0.594
0.732
0.479
0.334
0.755
0.661
0.619
0.596
Faster R-CNN [ 29 ]
0.500
0.746
0.471
0.265
0.613
0.537
0.737
0.553
CenterNet [ 49 ]
0.853
0.667
0.404
0.221
0.753
0.720
0.798
0.631
ATSS [ 50 ]
0.832
0.483
0.402
0.081
0.706
0.638
0.471
0.516
RetinaNet [ 32 ]
0.448
0.684
0.445
0.152
0.704
0.568
0.489
0.499
Dynamic R-CNN [ 51 ]
0.547
0.695
0.450
0.259
0.731
0.644
0.582
0.558
Table 1: Performance comparison with evaluated detection methods on CTDD. The best result is highlighted in bold, and the second-best result is underlined.
Figure 7: Visualization of detection results compared against the Ground Truth (GT). The last column shows the GT annotations, while the second to last column shows the predictions of our proposed method. Preceding columns display results from other models for comparison
\toprule Model
AP 50
AP 50-95
F 1
P
R
\midrule YOLOv11n
0.786
0.468
0.712
0.774
0.660
CF-YOLO
0.794
0.465
0.732
0.760
0.707
\bottomrule
Table 2: External validation results on NEU-DET.
Figure 8: Visual ablation analysis of key components. The left panel demonstrates the effectiveness of CPAM in localizing camouflaged defects, while the right panel illustrates the capability of FARM in capturing micro-scale anomalies. ’GT’ denotes Ground Truth.
\toprule CPAM
FARM
P
F 1
AP 50
\midrule -
-
0.843
0.756
0.749
✓
-
0.842
0.783
0.819
-
✓
0.838
0.780
0.800
✓
✓
0.882
0.796
0.823
\bottomrule
Table 3: Ablation study on the effectiveness of proposed components.
\toprule Variant
AP 50
AP 50-95
F 1
Precision
\midrule Full FARM (Ours)
0.823
0.488
0.796
0.882
No spatial branch
0.772
0.467
0.748
0.825
No channel branch
0.785
0.476
0.765
0.825
Conv-only
0.775
0.472
0.752
0.815
\bottomrule
Table 4: FARM mixer variant ablation on CTDD. Full FARM is the unmodified configuration used in CF-YOLO.
\toprule Configuration
AP 50
AP 50-95
F 1
\midrule FARM in neck (Ours)
0.823
0.488
0.796
FARM before neck
0.760
0.469
0.738
FARM after neck
0.770
0.474
0.748
\bottomrule
Table 5: FARM placement analysis on CTDD.
\toprule Configuration
AP 50
AP 50-95
F 1
\midrule CPAM mid-backbone (Ours)
0.823
0.488
0.796
CPAM shallow
0.730
0.462
0.705
CPAM deep
0.718
0.460
0.695
Fewer CPAM blocks (2 × )
0.770
0.468
0.745
\bottomrule
Table 6: CPAM depth and quantity analysis on CTDD.
\toprule KS
KL
P
F 1
AP 50
\midrule 3
3
0.823
0.703
0.751
3
5
0.854
0.786
0.804
3
7
0.846
0.785
0.814
5
7
0.564
0.494
0.462
5
11
0.850
0.784
0.809
11
11
0.844
0.744
0.783
Table 7: Ablation study on CPAM kernel settings. KL denotes the Large-Kernel Perception branch, and KS denotes the Small-Kernel Aggregation branch.
Glasgow College, University of Electronic Science and Technology of China, Chengdu, 611731, China · Institute of Applied Physics and Computational Mathematics, Beijing, China · Department of Industrial Engineering, Tsinghua University, Beijing, China
State Key Laboratory of Precision Measurement Technology and Instruments, Tsinghua University, Beijing, 100084, China · State Key Laboratory of Digital Manufacturing Equipment and Technology, Huazhong University of Science and Technology, Wuhan, 430074, China