Journal of Textile Research ›› 2021, Vol. 42 ›› Issue (11): 29-38.doi: 10.13475/j.fzxb.20210103610

• Fiber Materials • Previous Articles     Next Articles

Real-time detection of inferior cocoons through model compression and receptive field enhancement

ZHANG Yinhui, YANG Hongkuan, LIU Qiang, HE Zifen   

  1. Faculty of Mechanical and Electrical Engineering, Kunming University of Science and Technology, Kunming, Yunnan 650500, China
  • Received:2021-01-15 Revised:2021-06-14 Online:2021-11-15 Published:2021-11-29

Abstract:

The current inferior cocoons detection mainly depends on manual visual inspection, which leads to low work efficiency. Based on anchor parameter presetting, channel pruning and embedding receptive field block, an improved lightweight real time inferior cocoons detection model was proposed.Firstly, the model parameters of YOLOv3 were preset through K-means clustering analysis of the anchor suitable for inferior cocoons detection. Then, according to a preset pruning rate, the sparsely trained model was pruned based on batch normalization layer scaling factor to compress the size of the model. Finally, the receptive field block was embedded the pruned model to enlarge the receptive field of the model and enhance the discriminability and robustness of the model. The experimental results show that the proposed inferior cocoons real-time detection model is 46.90 M in size, and the mean average detection speed and precision reach 50.18 frames/s and 96.80% respectively. Compared with the original YOLOv3 model, the parameters are compressed by 79.96%, the mean average detection speed is increased by 60.63%, and the mean average detection precision is increased by 3.20%.

Key words: cocoons, inferior cocoons detection, YOLOv3 model, clustering analysis, model compression, receptive field block

CLC Number: 

  • TP391

Fig.1

YOLOv3 model structure diagram"

Fig.2

Visualization results of height/width ratio of anchor in inferior cocoons detection data"

Fig.3

Model channel pruning schematic diagram"

Fig.4

Calculation and derivation of RFB module receptive field"

Fig.5

YOLOv3-MC-RFB model structure diagram"

Fig.6

Inferior cocoons physical picture. (a)Thin shelled cocoon; (b)Crushed cocoon; (c)Little cocoon; (d)Yellow spotted cocoon"

Tab.1

Experimental parameters"

参数名称 数值
giou损失的系数(giou) 1.582
分类损失的系数(cls) 27.76
分类损失函数中正样本的权重(cls_pw) 1.446
有无物体损失的系数(obj) 21.35
有无物体损失函数中正样本的权重(obj_pw) 3.941
标签与锚点框的iou阈值(iou_t) 0.263 5
学习率(lr0) 0.002 324
余弦退火超参数(lrf) 0.000 1
学习率动量(momentum) 0.97
权重衰减系数(weight_decay) 0.000 456 9

Tab.2

Experimental results of different number of anchor"

锚点框数量 锚点框尺寸 模型大小/M 平均检测速度/(帧·s-1) mAP/%
3 (38,28),(31,35),(31,41) 234.00 31.14 96.10
6 (26,32),(33,26),(28,42),
(40,30),(33,38),(40,34)
234.00 30.68 96.00
9 (27,29),(24,33),(33,26),
(26,40),(30,35),(42,28,
(38,33),(30,42),(35,39)
234.00 30.46 95.90
12 (28,27),(34,24),(26,33),(27,39),
(35,31),(41,27),(31,37),(26,38),
(44,30),(33,41),(41,34),(37,38)
235.00 30.38 95.20

Fig.7

Distribution of γ before (a) and after (b) sparse training"

Tab.3

Experimental results of different pruning rates"

剪枝率/% 模型大小/M 平均检测速度/
(帧·s-1)
mAP/%
10.00 205.00 30.96 95.99
20.00 177.00 33.82 95.99
30.00 151.00 37.36 95.99
40.00 127.00 39.93 95.99
50.00 104.00 42.23 95.99
60.00 83.60 44.53 95.98
70.00 65.00 47.39 95.97
80.00 46.90 51.05 95.95

Tab.4

Model effects after embedding RFB"

RFB添加
的位置
模型大
小/M
平均检测速度/
(帧·s-1)
mAP/%
4层后 46.90 47.52 96.70
11层后 46.90 49.87 96.60
36层后 46.90 50.18 96.80
61层后 46.90 50.04 96.20
74层后 46.90 49.57 96.10
86层后 46.90 48.47 96.70
98层后 46.90 48.77 96.10

Fig.8

Detection effect at different cocoons quantity distribution. (a) Original image; (b) Detection results"

Fig.9

Detection effect at different camera angles. (a) Original image; (b) Detection results"

Tab.5

Comparison of the experimental results with different detection model"

检测模型 模型大
小/M
平均检测速度/
(帧·s-1)
mAP/%
YOLOv3 234.00 31.24 93.80
YOLOv4 245.00 26.38 96.78
SSD 92.10 41.79 96.64
YOLOv3-MC-RFB 46.90 50.18 96.80

Fig.10

Inferior cocoons detection effect of Yolov3-MC-RFB model. (a) Single category of inferior cocoons; (b) Multiple categories of inferior cocoons"

[1] 封槐松, 李建琴. 新中国60年蚕桑业发展历程与特点[J]. 中国蚕业, 2014, 35(3):1-10.
FENG Huaisong, LI Jianqin. New China 60 years sericulture development course and characteristic[J]. Chinese Sericulture, 2014, 35(3):1-10.
[2] 封槐松, 李建琴. 我国蚕桑产业发展“十二五”回顾与“十三五”展望[J]. 中国蚕业, 2016, 37(1):4-10.
FENG Huaisong, LI Jianqin. China sericulture industry development "twelfth five-year" review and "thirteenth five-year" outlook[J]. Chinese Sericulture, 2016, 37(1):4-10.
[3] MUSAYEV E. Optoelectronic nondestructive testing techniquesof cocoons properties and applications[J]. NDT & International, 2005, 38(1):59-68.
[4] PRASOBHKUMAR P P, FRANCIS C R, GORTHI S S. Automated quality assessment of cocoons using a smart camera based system[J]. Engineering in Agriculture, Environment and Food, 2018, 11(4):202-210.
doi: 10.1016/j.eaef.2018.05.002
[5] 周志宇, 刘喜昂, 杨东鹤. 机器视觉在蚕茧表面积测量中的应用[J]. 纺织学报, 2006, 27(12):29-31.
ZHOU Zhiyu, LIU Xi'ang, YANG Donghe. Application of machine vision in measuring cocoons surface area[J]. Journals of Textile Research, 2006, 27(12):29-31.
[6] 甘勇, 孔庆华, 韦荔甫. 基于数字图像处理的蚕茧表面积计算方法[J]. 光学技术, 2007, 33(1):27-28.
GAN Yong, KONG Qinghua, WEI Lifu. A method for calculating cocoons surface area based on digital image processing[J]. Optical Technology, 2007, 33(1):27-28.
[7] 黄凌霞, 吴迪, 金航峰, 等. 基于变量选择的蚕茧茧层量可见-近红外光谱无损检测[J]. 农业工程学报, 2010, 26(2):231-236.
HUANG Lingxia, WU Di, JIN Hangfeng, et al. The cocoons layer quantity based on variable selection can be seen-NIR spectrum nondestructive testing[J]. Journal of Agricultural Engineering, 2010, 26(2):231-236.
[8] 代芬, 吴玲, 叶观燕, 等. 基于近红外漫透射光谱信息的蚕茧雌雄检测[J]. 农业机械学报, 2015, 46(12):280-284.
DAI Fen, WU Ling, YE Guanyan, et al. Sex detection of silkworm cocoons based on near-infrared diffuse transmission spectral information[J]. Journal of Agricultural Machinery, 2015, 46(12):280-284.
[9] 王超. 基于机器视觉的蚕茧图像识别研究[D]. 柳州:广西科技大学, 2019:24-29.
WANG Chao. Research on cocoon image recognition based on machine vision[D]. Liuzhou:Guangxi University of Science and Technology, 2019:24-29.
[10] 刘莫尘, 许荣浩, 闫筱, 等. 基于FCM及HSV模型的方格蔟黄斑茧检测与剔除技术[J]. 农业机械学报, 2018, 49(7):31-38.
LIU Mocheng, XU Ronghao, YAN Xiao, et al. Based on FCM and HSV model, detection and screening technology of grid cluster macular cocoons[J]. Journal of Agricultural Machinery, 2018, 49(7):31-38.
[11] 刘莫尘, 许荣浩, 李法德, 等. 基于颜色与面积特征的方格簇蚕茧分割定位算法与试验[J]. 农业机械学报, 2018, 49(3):43-50.
LIU Mocheng, XU Ronghao, LI Fade, et al. Segmentation and location algorithm of square silkworm cocoons based on color and area characteristics and experiment[J]. Journal of Agricultural Machinery, 2018, 49(3):43-50.
[12] REDMON J FARHADI A, YOLOv3: an incremental improvement[EB/OL]. (2018-04-08)[2021-01-10]https://arXiv:1804.02767 .
[13] REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: unified, real-time object detection[C]// Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition(CVPR). Las Vegas: IEEE, 2016: 779-788.
[14] REDMON J, FARHADI A. YOLO9000: better, faster, stronger[C]// Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition(CVPR). Hawaii: IEEE, 2017: 6517-6525.
[15] HE Kaiming, ZHANG Xiangyu, REN Shaoqing, et al. Deep residual learning for image recognition[C]// Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition(CVPR). Las Vegas: IEEE, 2016: 770-778.
[16] IOFFE S, SZEGEDY C. Batch normalization: accelerating deep network training by reducing internal covariate shift[C]// Proceedings of International Conference on Machine Learning(ICML). Lille: IMIS, 2015: 448-456.
[17] LIN T Y, DOLLAR P, GIRSHICK R, et al. Feature pyramid networks for object detection[C]// Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition(CVPR). Hawaii: IEEE, 2017: 936-944.
[18] LIU Zhuang, LI Jianguo, SHEN Zhiqiang, et al. Learning efficient convolutional networks through network slimming[C]// Proceedings of 2017 IEEE International Conference on Computer Vision(ICCV). Venice: IEEE, 2017: 2755-2736.
[19] LIU Songtao, HUANG Di, WANG Yunhong. Receptive field block net for accurate and fast object detec-tion [C]//Proceedings of European Conference on Computer Vision(ECCV). Munich: Springer, 2018: 404-419.
[20] LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot multibox detector [C]//Proceedings of European Conference on Computer Vision(ECCV). Amsterdam: Springer, 2016: 21-37.
[21] BOCHKOVSKIY A, WANG C Y, LIAO H Y M. YOLOv4: optimal speed and accuracy of object detec-tion[EB/OL]. (2020-04-23)[2021-01-10]https://arxiv.org/abs/2004.10934 .
[1] XING Lijuan, LIU Xinjin, SU Xuzhong, CAO Xiuming. Evaluation on comprehesive physical properties of special animal fibers based on gray clustering [J]. Journal of Textile Research, 2019, 40(01): 26-31.
[2] . Automatic extraction on embroidered patterns [J]. JOURNAL OF TEXTILE RESEARCH, 2017, 38(09): 120-126.
[3] . Evaluation of fabric design based on perceptual image [J]. Journal of Textile Research, 2015, 36(04): 60-64.
[4] . Evaluating on moisture comfort property of PP magnetic fiber fabric based on grey clustering [J]. JOURNAL OF TEXTILE RESEARCH, 2013, 34(5): 35-40.
[5] ZHANG Ning, WANG Hong-Fu. Body size classification of female models in Jingsu-Zhejiang based on 3-D body measurement [J]. JOURNAL OF TEXTILE RESEARCH, 2012, 33(6): 71-75.
[6] QIAN Xiaonong;YIN Bing. Research on subdividing of the human body recognition based on 3D body measurement [J]. JOURNAL OF TEXTILE RESEARCH, 2011, 32(2): 107-111.
[7] WANG Yunyi;YU Qingwen;FENG Jiahao;LI Jun;CHEN Yisong. Research on the heat and moisture coupling transfer in new regenerated fiber fabrics [J]. JOURNAL OF TEXTILE RESEARCH, 2008, 29(2): 37-40.
[8] WANG Yuxiu;LI Xiaojiu;LIU Hao. Fuzzy clustering analysis of body type in 2D non-contacted body measurement system [J]. JOURNAL OF TEXTILE RESEARCH, 2007, 28(2): 100-103.
[9] LUO Jun;FEI Wan-chun. Distribution of the filament number of each cocoon layer in raw silk threads [J]. JOURNAL OF TEXTILE RESEARCH, 2006, 27(2): 1-4.
[10] JIANG Wei-qing. Relationship between the comprehensive wearing characteristics and the structure parameters of lightweight worsted fabrics [J]. JOURNAL OF TEXTILE RESEARCH, 2006, 27(11): 86-89.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
[1] . [J]. JOURNAL OF TEXTILE RESEARCH, 2003, 24(06): 35 -36 .
[2] . [J]. JOURNAL OF TEXTILE RESEARCH, 2003, 24(06): 107 .
[3] . [J]. JOURNAL OF TEXTILE RESEARCH, 2003, 24(06): 109 -620 .
[4] . [J]. JOURNAL OF TEXTILE RESEARCH, 2004, 25(02): 105 -107 .
[5] . [J]. JOURNAL OF TEXTILE RESEARCH, 2004, 25(02): 108 -110 .
[6] . [J]. JOURNAL OF TEXTILE RESEARCH, 2004, 25(02): 111 -113 .
[7] . [J]. JOURNAL OF TEXTILE RESEARCH, 2004, 25(02): 114 -115 .
[8] . [J]. JOURNAL OF TEXTILE RESEARCH, 2004, 25(03): 7 -8 .
[9] . [J]. JOURNAL OF TEXTILE RESEARCH, 2004, 25(03): 9 -10 .
[10] PAN Xu-wei;GU Xin-jian;HAN Yong-sheng;CHENG Yao-dong. Research on quick response of apparel supply chain for collaboration[J]. JOURNAL OF TEXTILE RESEARCH, 2006, 27(1): 54 -57 .