Please wait a minute...
Journal of ZheJiang University (Engineering Science)  2026, Vol. 60 Issue (7): 1438-1451    DOI: 10.3785/j.issn.1008-973X.2026.07.007
    
Lightweight rebar surface defect detection algorithm based on global information perception
Jian XIAO1(),Xiaoyuan YANG1,Xinze HE1,Lin CHEN2,Xin HU3,*()
1. School of Electronics and Control Engineering, Chang’an University, Xi’an 710064, China
2. School of Information Engineering, Suqian University, Suqian 223800, China
3. School of Energy and Electrical Engineering, Chang’an University, Xi’an 710064, China
Download: HTML     PDF(4002KB) HTML
Export: BibTeX | EndNote (RIS)      

Abstract  

A lightweight defect detection algorithm was proposed to address the issues of insufficient detection accuracy for rebar surface defects and limited computational resources of terminal devices. Based on the YOLOv8n model, the C2f module was redesigned and a backbone network with global information modeling capabilities was constructed by combining the conditional positional encoding characteristics of the convolutional gated linear unit and the dynamic global interaction capability of the self-attention mechanism. A context anchor attention module was used to improve the high-level screening feature pyramid network. A combined strategy of width-wise and height-wise strip convolutions was adopted to effectively focus on the long-distance pixel information, and the information redundancy in multi-scale feature fusion was reduced through feature selection. An adaptive detection head was proposed via shared convolution and separated BN layers to improve the parameter utilization while ensuring the detection accuracy. The Unified-IoU bounding box loss function was employed to enhance the performance of dense defect detection through dynamic weight distribution. Experimental results showed that the improved algorithm achieved a mAP@0.5 of 95.4% on a self-constructed rebar dataset, which was 4.3 percentage points higher than that of YOLOv8n. The model’s parameter count was reduced to 1.4 M, representing a decrease of 53.33%, the computational complexity was reduced by 34.57%, and the FPS reached 156 frames per second, achieving a balance between the detection performance and the computational resource consumption. Additionally, the algorithm’s good generalization performance was validated on the NEU-DET dataset.



Key wordsdefect detection      YOLOv8n      lightweight network      global information      HS-FPN      Unified-IoU     
Received: 02 April 2025      Published: 23 May 2026
CLC:  TP 391.4  
Fund:  陕西省秦创原“科学家+工程师”队伍建设项目(2024QCY-KXJ-161);咸阳市重点研发计划资助项目(L2025-ZDKJ-ZDGG-RGZN-005).
Corresponding Authors: Xin HU     E-mail: xiaojian@chd.edu.cn;huxin@chd.edu.cn
Cite this article:

Jian XIAO,Xiaoyuan YANG,Xinze HE,Lin CHEN,Xin HU. Lightweight rebar surface defect detection algorithm based on global information perception. Journal of ZheJiang University (Engineering Science), 2026, 60(7): 1438-1451.

URL:

https://www.zjujournals.com/eng/10.3785/j.issn.1008-973X.2026.07.007     OR     https://www.zjujournals.com/eng/Y2026/V60/I7/1438


基于全局信息感知的轻量级螺纹钢表面缺陷检测算法

针对螺纹钢表面缺陷检测精度不足及终端设备计算资源受限的问题,提出轻量级缺陷检测算法. 基于YOLOv8n模型,结合卷积门控线性单元的条件位置编码特性与自注意力机制的动态全局交互能力重新设计C2f模块,构建具有全局信息建模能力的主干网络. 采用上下文锚点注意力模块改进高层筛选特征金字塔网络,通过宽、高方向带状卷积组合策略聚焦远距离像素信息,并通过特征选择减少多尺度特征融合中的信息冗余. 通过共享卷积与分离BN层,提出自适应检测头,提高参数利用率并保证检测精度. 采用Unified-IoU边界框损失函数,通过动态权重分配提升密集缺陷检测性能. 实验结果表明,在自建螺纹钢数据集上,改进算法的mAP@0.5达到94.5%,较YOLOv8n提升了4.3个百分点;模型参数量降低至1.4 M,减少了53.33%;计算量降低了34.57%,FPS达到156帧/s,实现了检测性能与计算资源消耗的平衡. 此外,在NEU-DET数据集上验证了该算法具有良好的泛化性能.


关键词: 缺陷检测,  YOLOv8n,  轻量化网络,  全局信息,  高层筛选特征金字塔网络(HS-FPN),  Unified-IoU 
Fig.1 Overall network architecture diagram
Fig.2 Architecture diagram of backbone network CACGLUFormer
Fig.3 Comparison of different channel mixers
Fig.4 Structure diagram of SFF strategy
Fig.5 Architecture diagram of improved HS-FPN
Fig.6 Structure diagram of SCSBN detection head
类别N
图片实例
锈迹1 88312 673
划伤1 99510 304
结疤396571
Tab.1 Number of images and instances for each defect type in self-built dataset
Fig.7 Partial sample photos in dataset
模型P/%R/%mAP@0.5/%mAP@0.5-0.95/%Np/MFLOPs/GFPS/(帧·s?1)
YOLOv8n(baseline)88.383.190.255.93.08.1133
YOLOv8n-GhostNet85.582.887.652.21.75.1140
YOLOv8n-GhostNetV281.484.886.349.62.46.4134
YOLOv8n-MobileViT87.883.089.855.42.212.8132
YOLOv8n-MobileNetV382.780.284.541.12.35.7133
YOLOv8n-MobileNetV485.083.788.841.75.722.5128
YOLOv8n-ShuffleNetV281.380.084.241.51.95.2139
YOLOv8n-EfficientNetV282.978.884.542.02.12.6148
YOLOv8n-VanillaNet84.983.286.551.82.05.7147
YOLOv8n-FasterNet85.183.987.850.44.210.7130
YOLOv8n-StarNet82.078.983.745.92.26.5137
CACGLUFormer87.587.492.956.22.46.8148
Tab.2 Results of comparison experiment on lightweight backbone networks
损失函数P/%R/%mAP@0.5/%mAP@0.5-0.95/%FPS/(帧·s?1)
CIoU88.383.190.255.9133
DIoU86.484.990.256.2136
GIoU87.983.690.055.9131
EIoU81.585.889.956.073
WIoU81.585.389.855.893
SIoU87.483.790.256.5101
Wise-IoU88.285.490.755.7125
Inner-IoU87.487.191.255.5128
Unified-IoU(linear)89.189.291.756.5135
Unified-IoU(cos)89.089.191.656.5135
Unified-IoU(fraction)88.889.191.356.6136
Tab.3 Comparison experiment of loss functions
检测头mAP@0.5/%Np/MFLOPs/GFPS/(帧·s?1)
YOLOv8n90.23.08.1133
+A-Head88.12.46.5135
+B-Head89.92.46.5128
+SCSBN Head90.92.46.5135
Tab.4 Comparison experiment of lightweight detection heads
模型ABCD类别P/%R/%mAP@0.5/%mAP@0.5-0.95/%Np/MFLOPs/GFPS/(帧·s?1)
M0划伤92.985.293.054.73.08.1133
锈迹88.076.287.252.2
结疤84.187.890.560.7
All88.383.190.255.9
M1划伤89.290.094.454.52.46.8148
锈迹89.380.289.953.0
结疤84.092.094.461.1
All87.587.492.956.2
M2划伤90.486.892.454.12.17.3152
锈迹88.979.989.453.0
结疤85.490.692.564.4
All88.285.891.457.2
M3划伤92.090.994.357.42.46.5135
锈迹88.482.989.357.8
结疤82.085.788.955.4
All87.586.590.957.4
M4划伤89.990.994.557.41.86.4141
锈迹87.284.091.654.4
结疤88.993.892.156.6
All88.789.592.756.8
M5划伤89.291.295.055.41.45.3149
锈迹87.684.091.555.7
结疤86.490.993.860.6
All87.888.793.457.2
M6F划伤91.292.495.656.31.45.3155
锈迹91.086.694.256.1
结疤86.388.693.164.2
All90.088.994.358.9
M7C划伤91.493.096.556.21.45.3152
锈迹91.286.594.656.3
结疤87.687.292.564.0
All90.289.094.558.8
M8L划伤91.693.096.356.41.45.3156
锈迹91.286.894.756.1
结疤87.787.192.464.0
All90.289.094.558.8
Tab.5 Ablation experiments of different improvement strategies
模型P/%R/%mAP@0.5/%mAP@0.5-0.95/%Np/MFLOPs/GFPS/(帧·s?1)
Faster R-CNN82.172.982.744.6137.1370.26
SSD80.680.785.049.341.1145.341
YOLOv3-Tiny80.879.986.350.912.118.978
YOLOv4-Tiny84.381.088.452.15.916.1113
YOLOv5n85.581.289.452.52.47.1107
YOLOv6n81.680.687.251.34.211.2130
YOLOv7-Tiny85.481.289.354.76.113.1109
YOLOX-Tiny86.282.590.356.15.16.5122
YOLOv8n88.383.190.255.93.08.1133
YOLOv9n85.583.390.756.52.38.4135
YOLOv10n85.682.790.555.92.78.2131
YOLOv11n86.183.490.955.82.66.3136
YOLOv8-VSC88.688.892.756.32.06.0152
LTSCD-YOLO89.287.891.956.52.49.8144
S-YOLO89.887.993.257.92.68.4127
本研究模型90.289.094.558.81.45.3156
Tab.6 Comparative experiments of advanced mainstream models
Fig.8 Visual comparison of detection results before and after model improvement
Fig.9 Comparison of defect detection heatmaps before and after model improvement
模型P/%R/%mAP@0.5/%mAP@0.5-0.95/%Np/MFLOPs/GFPS/(帧·s?1)
YOLOv8n74.671.376.842.63.08.1122
DCS-YOLOv874.971.476.93.37.8277
SDB-YOLOv8s77.472.179.27.216.2146
YOLOv11n76.371.579.642.52.66.3127
本研究模型76.671.779.743.01.45.3129
Tab.7 Comparison experiment of different models on NEU-DET dataset
Fig.10 Detection results of proposed model and baseline model on NEU-DET dataset
[1]   TIAN Y, ZHANG G, YE H, et al Corrosion of steel rebar in concrete induced by chloride ions under natural environments[J]. Construction and Building Materials, 2023, 369: 130504
doi: 10.1016/j.conbuildmat.2023.130504
[2]   QIU J, ZHANG W, JING Y Quantitative linear correlation between self-magnetic flux leakage field variation and corrosion unevenness of corroded rebars[J]. Measurement, 2023, 218: 113173
doi: 10.1016/j.measurement.2023.113173
[3]   EDDY I C, UNDERHILL P R, MORELLI J, et al. Pulsed eddy current response to liftoff in different sizes of concrete embedded rebar [C]// Proceedings of the IEEE SENSORS. Montreal: IEEE, 2019: 1–4.
[4]   LUO Q, SUN Y, LI P, et al Generalized completed local binary patterns for time-efficient steel surface defect classification[J]. IEEE Transactions on Instrumentation and Measurement, 2019, 68 (3): 667- 679
doi: 10.1109/TIM.2018.2852918
[5]   YIN T, YANG J. Detection of steel surface defect based on faster R-CNN and FPN [C]// Proceedings of the 7th International Conference on Computing and Artificial Intelligence. Tianjin: ACM, 2021: 15–20.
[6]   胡欣, 周运强, 肖剑, 等 基于改进YOLOv5的螺纹钢表面缺陷检测[J]. 图学学报, 2023, 44 (3): 427- 437
HU Xin, ZHOU Yunqiang, XIAO Jian, et al Surface defect detection of threaded steel based on improved YOLOv5[J]. Journal of Graphics, 2023, 44 (3): 427- 437
[7]   李相垚, 侯红玲, 杨澳, 等. 面向钢材表面缺陷检测的DCS-YOLOv8算法研究[J/OL]. 机械科学与技术, 2024: 1–10. (2024-10-10) [2025-04-01]. https://link.cnki.net/doi/10.13433/j.cnki.1003-8728.20240128.
LI Xiangyao, HOU Hongling, YANG Ao, et al. Research on DCS-YOLOv8 algorithm for steel surface defect detection [J/OL]. Mechanical Science and Technology for Aerospace Engineering, 2024: 1–10. (2024-10-10) [2025-04-01]. https://link.cnki.net/doi/10.13433/j.cnki.1003-8728.20240128.
[8]   刘义艳, 郝婷楠, 贺晨, 等 基于DBBR-YOLO的光伏电池表面缺陷检测[J]. 图学学报, 2024, 45 (5): 913- 921
LIU Yiyan, HAO Tingnan, HE Chen, et al Photovoltaic cell surface defect detection based on DBBR-YOLO[J]. Journal of Graphics, 2024, 45 (5): 913- 921
[9]   LIU G, HU Y, CHEN Z, et al Lightweight object detection algorithm for robots with improved YOLOv5[J]. Engineering Applications of Artificial Intelligence, 2023, 123: 106217
doi: 10.1016/j.engappai.2023.106217
[10]   王春梅, 刘欢 YOLOv8-VSC: 一种轻量级的带钢表面缺陷检测算法[J]. 计算机科学与探索, 2024, 18 (1): 151- 160
WANG Chunmei, LIU Huan YOLOv8-VSC: lightweight algorithm for strip surface defect detection[J]. Journal of Frontiers of Computer Science and Technology, 2024, 18 (1): 151- 160
[11]   TANG Z, ZHANG W, LI J, et al LTSCD-YOLO: a lightweight algorithm for detecting typical satellite components based on improved YOLOv8[J]. Remote Sensing, 2024, 16 (16): 3101
doi: 10.3390/rs16163101
[12]   梁礼明, 龙鹏威, 卢宝贺, 等. EHH-YOLOv8s: 一种轻量级的带钢表面缺陷检测算法[J/OL]. 北京航空航天大学学报, 2024: 1–15. (2024-08-08) [2025-04-01]. https://link.cnki.net/doi/10.13700/j.bh.1001-5965.2024.0426
LIANG Liming, LONG Pengwei, LU Baohe, et al. EHH-YOLOv8s: a lightweight algorithm for strip surface defect detection [J/OL]. Journal of Beijing University of Aeronautics and Astronautics, 2024: 1–15. (2024-08-08) [2025-04-01]. https://link.cnki.net/doi/10.13700/j.bh.1001-5965.2024.0426.
[13]   PENG H, XIE H, LIU H, et al LGFF-YOLO: small object detection method of UAV images based on efficient local-global feature fusion[J]. Journal of Real-Time Image Processing, 2024, 21 (5): 167
doi: 10.1007/s11554-024-01550-5
[14]   刘振江, 张会娟, 姬淼鑫, 等. 轻量级多尺度特征融合增强的空间非合作小目标检测算法[J/OL]. 北京航空航天大学学报, 2024: 1–12. (2024-09-20) [2025-04-01]. https://link.cnki.net/doi/10.13700/j.bh.1001-5965.2024.0509.
LIU Zhenjiang, ZHANG Huijuan, JI Miaoxin, et al. Lightweight multi-scale feature fusion enhancement algorithm for spatial non-cooperative small target detection [J/OL]. Journal of Beijing University of Aeronautics and Astronautics, 2024: 1–12. (2024-09-20) [2025-04-01]. https://link.cnki.net/doi/10.13700/j.bh.1001-5965.2024.0509.
[15]   SHI D. TransNeXt: robust foveal visual perception for vision Transformers [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2024: 17773–17783.
[16]   CAI X, LAI Q, WANG Y, et al. Poly kernel inception network for remote sensing detection [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2024: 27706–27716.
[17]   CHEN Y, ZHANG C, CHEN B, et al Accurate leukocyte detection based on deformable-DETR and multi-level feature fusion for aiding diagnosis of blood diseases[J]. Computers in Biology and Medicine, 2024, 170: 107917
doi: 10.1016/j.compbiomed.2024.107917
[18]   王安静, 袁巨龙, 朱勇建, 等 基于改进YOLOv8s的鼓形滚子表面缺陷检测算法[J]. 浙江大学学报: 工学版, 2024, 58 (2): 370- 380
WANG Anjing, YUAN Julong, ZHU Yongjian, et al Drum roller surface defect detection algorithm based on improved YOLOv8s[J]. Journal of Zhejiang University: Engineering Science, 2024, 58 (2): 370- 380
[19]   LUO X, CAI Z, SHAO B, et al. Unified-IoU: for high-quality object detection [EB/OL]. (2024-08-13) [2025-04-01]. https://arxiv.org/abs/2408.06636.
[20]   YU W, SI C, ZHOU P, et al MetaFormer baselines for vision[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024, 46 (2): 896- 912
doi: 10.1109/TPAMI.2023.3329173
[21]   PATEL I, PATEL S An optimized deep learning model for flower classification using NAS-FPN and faster R-CNN[J]. International Journal of Scientific & Technology Research, 2020, 9 (3): 5308- 5318
[22]   QIAN X, ZHANG N, WANG W Smooth GIoU loss for oriented object detection in remote sensing images[J]. Remote Sensing, 2023, 15 (5): 1259
doi: 10.3390/rs15051259
[23]   PENG H, YU S A systematic IoU-related method: beyond simplified regression for better localization[J]. IEEE Transactions on Image Processing, 2021, 30: 5032- 5044
doi: 10.1109/TIP.2021.3077144
[24]   HAN K, WANG Y, TIAN Q, et al. GhostNet: more features from cheap operations [EB/OL]. (2020-03-13) [2025-04-01]. https://arxiv.org/abs/1911.11907.
[25]   TANG Y, HAN K, GUO J, et al. GhostNetV2: enhance cheap operation with long-range attention [C]// Proceedings of the 36th International Conference on Neural Information Processing Systems. New Orleans: Curran Associates Inc, 2022: 9969–9982.
[26]   MEHTA S, RASTEGARI M. MobileViT: light-weight, general-purpose, and mobile-friendly vision Transformer [EB/OL]. (2022-03-04) [2025-04-01]. https://arxiv.org/abs/2110.02178.
[27]   Howard A, SANDLER M, CHU G, et al. Searching for MobileNetV3 [C]// Proceedings of the IEEE/CVF International Conference on Computer Vision. Seoul: IEEE, 2019: 1314–1324.
[28]   QIN D, LEICHNER C, DELAKIS M, et al. MobileNetV4: universal models for the mobile ecosystem [C]// European Conference on Computer Vision. Milan: ECVA, 2025: 78–96.
[29]   YANG H, LIU J, MEI G, et al Research on real-time detection method of rail corrugation based on improved ShuffleNet V2[J]. Engineering Applications of Artificial Intelligence, 2023, 126: 106825
doi: 10.1016/j.engappai.2023.106825
[30]   梁礼明, 龙鹏威, 金家新, 等 基于改进YOLOv8s的钢材表面缺陷检测算法[J]. 浙江大学学报: 工学版, 2025, 59 (3): 512- 522
LIANG Liming, LONG Pengwei, JIN Jiaxin, et al Steel surface defect detection algorithm based on improved YOLOv8s[J]. Journal of Zhejiang University: Engineering Science, 2025, 59 (3): 512- 522
[31]   CHEN H, WANG Y, GUO J, et al. VanillaNet: the power of minimalism in deep learning [EB/OL]. (2023-05-23) [2025-04-01]. https://arxiv.org/abs/2305.12972.
[32]   CHEN J, KAO S, HE H, et al. Run, don’t walk: chasing higher FLOPS for faster neural networks [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Vancouver: IEEE, 2023: 12021–12031.
[1] Wei TIAN,Linhong ZHOU,Xinyang LI,Jianming WANG,Yukang HUANG. 3D-printed concrete apparent defect detection method based on improved YOLOv8[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(4): 833-843.
[2] Weiqun LUO,Jingwei LU,Jiadi WU,Yuying LIANG,Chuanpeng SHEN,Rui ZHU. Lightweight detection model for typical environmental terrain target in Tibetan Plateau[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(3): 594-603.
[3] Hui LIU,Fangxiu WANG,Yi WANG,Zibo HUANG,Chen SU. Lightweight improved RT-DETR algorithm for grape leaf disease detection[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(3): 604-613.
[4] Yanle WANG,Ruifeng ZHANG,Qiang LI. Graph neural network recommendation model integrating global information and contrastive learning[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(2): 351-359.
[5] Tao ZHOU,Pengfei WANG,Weijie GAO. Device defect detection based on intrinsic rotational symmetry[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(9): 1856-1863.
[6] Zihao LIU,Jiaxin ZHANG,Feng XUE,Jun ZHANG,Weijie CHEN,Yebo LU. Surface defect detection method of precision pipe fittings based on improved YOLO-v8[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(7): 1514-1522.
[7] Wenbo JU,Huajun DONG. Motherboard defect detection method based on context information fusion and dynamic sampling[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(6): 1159-1168.
[8] Gengliang LIANG,Shuguang HAN. Denim fabric defect detection algorithm based on improved RT-DETR[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(6): 1169-1178.
[9] Mingzhi HU,Jun SUN,Biao YANG,Kairong CHANG,Junlong YANG. Super-resolution reconstruction of remote sensing image based on CNN and Transformer aggregation[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(5): 938-946.
[10] Liming LIANG,Pengwei LONG,Jiaxin JIN,Renjie LI,Lu ZENG. Steel surface defect detection algorithm based on improved YOLOv8s[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(3): 512-522.
[11] Guangming WANG,Zhengyao BAI,Shuai SONG,Yue’e XU. Lightweight multimodal data fusion network for auxiliary diagnosis of Alzheimer’s disease[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(1): 39-48.
[12] Shancheng TANG,Jianhui LU,Ying ZHANG,Zicheng JIN,Anxin ZHAO. Unsupervised surface defect detection of magnetic tile for repair of suspected area defects[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(4): 718-728.
[13] Kun LIU,Ding WANG,Jingkai WANG,Haiyong CHEN,Weipeng LIU. Feature filtering and feature decoupling based domain generalization model[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(3): 459-467.
[14] Anjing WANG,Julong YUAN,Yongjian ZHU,Cong CHEN,Jinjin WU. Drum roller surface defect detection algorithm based on improved YOLOv8s[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(2): 370-380.
[15] Longxue LIANG,Chenglong HE,Xiaosuo WU,Haowen YAN. Remote sensing image semantic segmentation network based on global information extraction and reconstruction[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(11): 2270-2279.