An Improved YOLOv12 Algorithm with Multi-Stage Transfer Learning for Real-Time Wood Defect Detection

Authors

  • Shidu He College of Computer Science and Technology, Harbin Engineering University, Harbin, 150001, China

DOI:

https://doi.org/10.5755/j01.itc.55.2.43872

Keywords:

Wood defect detection, Transfer learning, YOLOv12, Shape-IoU, Mixed Local Channel Attention

Abstract

Exploring efficient, precise, and cross-domain adaptable wood defect detection algorithms is essential for advancing automation and ensuring reliability in industrial quality inspection. To overcome the limitations of existing approaches, including difficulties in modeling complex defect morphologies, handling large-scale variations, and addressing data scarcity, this paper presents an enhanced solution that integrates the YOLOv12-SMD algorithm with a multi-stage transfer learning paradigm. Specifically, considering the shortcomings of YOLOv12 in aspect ratio modeling, feature representation, and information retention under fixed interpolation sampling, three improvements are introduced. Firstly, the Shape-Intersection over Union (Shape-IoU) loss function enhances sensitivity to variations in width, height, and center offsets. Secondly, the Mixed Local-Channel Attention (MLCA) module strikes a balance between global dependency modeling and local saliency extraction. Thirdly, dynamic upsampling (DySample) alleviates the loss of tiny details. To overcome the limitations of small sample sizes and distributional discrepancies across domain settings, a multi-stage transfer learning strategy is employed to achieve feature alignment and enhance generalisation. Experimental results demonstrate that on preprocessed source domain datasets, YOLOv12-SMD increases the baseline mean 
Average Precision at IoU of 0.5 (mAP@50) from 77.9% to 80.8%, outperforming other sophisticated detectors.  On the two target domain datasets, the incorporation of multi-stage transfer learning paradigm improves mAP@50 by 4.8% and 9.4%, respectively, while reducing training time by 16.7% and 34.2%. Multiple runs confirm the stability of these improvements. In conclusion, the proposed paradigm strikes an optimal balance of accuracy, efficiency, and robustness across various domains, providing an effective and intelligent solution for wood defect detection in industrial quality inspection.

Downloads

Published

2026-07-23

Issue

Section

Articles