摘要
焊接过程中产生的焊缝缺陷对结构件的强度和使用寿命有较大的影响。针对现有焊缝缺陷分类模型中存在的参数量大、推理速度慢、成本高等问题,提出了一种轻量级实时焊缝分类模型(TDRE-YOLO-cls)。首先,更改YOLOV8n-cls模型架构,将较浅层的C2f模块更改为含有RepConv模块的重参数重塑卷积(RCR)模块,这样在获取多尺度特征的同时,有效控制了推理速度。其次,引入了一种含有特殊下采样和压缩机制的位置特定注意力模块(DPSA),有效减少了模型参数量。最后,为了进一步提升模型对关键信息的提取能力,为DPSA模块设计了一种专用的CSE注意力机制。结果表明,所提出的模型相较于YOLOv8n-cls,在推理速度同样为0.9 ms/frame的前提下,Top-1准确率提高了2.4%,加权精确率提高了2.3%,加权召回率提高了2.4%,并且模型参数量减少了52.1%。
Objective The presence of welding defects in the weld seam significantly impacts the strength and service life of structural components.Traditional detection methods often suffer from limitations such as high computational costs,slow inference speed,and large model sizes,which restrict their practical applications.This paper aims to address these challenges by proposing a lightweight realtime weld defect classification model,TDREYOLOcls,that achieves high accuracy while maintaining a small model size and fast inference speed.Carbon steel is widely used in construction,bridges,shipbuilding,and automobile manufacturing due to its excellent mechanical properties,ease of processing,and relatively low cost.Selecting appropriate welding methods is crucial for ensuring the safety and reliability of carbon steel structures.However,in practical operations,defects such as dents and holes cannot be completely avoided.These defects can not only weaken the loadbearing capacity of weld joints but also lead to failures or accidents.Therefore,timely and accurate detection of weld defects is essential for ensuring the safe and reliable operation of welded structures.With the development of artificial intelligence,nondestructive testing has shown significant improvements in precision and efficiency.However,traditional methods like magnetic particle inspection are limited to ferromagnetic materials and require cumbersome preparation,radiographic testing poses potential health risks and is costly,and ultrasonic testing is slow and complex in data processing.In contrast,laserbased nondestructive testing,despite its inability to detect internal defects,is widely used for surface defect detection due to its high precision,high sampling rate,and compact hardware.Methods We modified the YOLOv8ncls architecture by introducing the ReParameterized Reshaping Convolutional Representation(RCR)module into shallow layers and the Spatial Pyramid Pooling(SPP)and Downsampling PositionSpecific Attention(DPSA)modules into deep layers.The RCR module leverages RepConv blocks to efficiently extract multiscale features.Meanwhile,the DPSA module employs special downsampling and compression mechanisms to reduce model parameters.Additionally,we proposed a Compressed Squeeze and Excitation(CSE)attention mechanism tailored for DPSA to enhance the extraction of critical information.Specifically,we replaced the shallower C2f modules in the YOLOv8ncls architecture with the RCR modules containing RepConv to obtain multiscale features while controlling inference time.We introduced a DPSA module with special downsampling and compression mechanisms to effectively reduce the model parameter size.Finally,to further enhance the model ability to extract key information,we developed a dedicated attention mechanism for the DPSA module.Results and Discussions Experimental results showed that TDREYOLOcls outperforms YOLOv8ncls in several key metrics of Top1 accuracy increased by 2.4%,weighted precision increased by 2.3%,and weighted recall increased by 2.4%.Notably,our model achieved these improvements while reducing the model parameter count by 52.1%and maintaining an inference time of 0.9 ms per frame(Table 2).To comprehensively evaluate the performance and generalization ability of TDREYOLOcls,we conducted extensive experiments on an expanded dataset consisting of burrs,dents,holes,and no obvious defects,totaling 3792 samples.Training involved 200 epochs,with validation and test sets used for performance assessment.Further comparison with various existing models,including YOLOv8ncls,YOLOv11ncls,YOLOv8scls,YOLOv11scls,MobileNetV3,and ShuffleNetV2,demonstrated the superiority of TDREYOLOcls in terms of accuracy,inference time,and model size.On the test set,TDREYOLOcls showed a Top1 accuracy improvement of 2.4%,a weighted precision increase of 2.3%,and a weighted recall enhancement of 2.4%,while maintaining an inference time of 0.9 ms per frame and reducing the model size by 52.1%(Table 2).Ablation studies confirmed the effectiveness of each component in our proposed model,demonstrating its robustness and generalizability(Table 3).Additionally,we performed a detailed analysis on the performance of TDREYOLOcls across different types of weld defects,including burrs,dents,holes,and no defects.Our results indicated that TDREYOLOcls achieves balanced performance across all categories,although there is still room for improvement,particularly in detecting dents.Future work will focus on optimizing the model to better handle specific types of defects,thereby enhancing overall accuracy and reliability.Conclusions The TDREYOLOcls model effectively balances realtime performance,accuracy,and model size,making it suitable for industrial applications where hardware resources are limited.The proposed modifications,including the introduction of RCR,SPP,and DPSA modules,have been shown to significantly improve the model performance without compromising inference time.Future research will continue to refine the model,particularly focusing on improving its performance for challenging defect types such as dents,to achieve even higher overall accuracy.Moreover,we plan to explore the integration of advanced techniques such as semisupervised learning and transfer learning to further enhance the model capabilities.
作者
李云浩
李成铁
李秋明
Li Yunhao;Li Chengtie;Li Qiuming(School of Control Engineering,Northeastern University at Qinhuangdao Campus,Qinhuangdao 066004,Hebei,China)
出处
《中国激光》
北大核心
2025年第12期36-42,共7页
Chinese Journal of Lasers