Abstract:Focusing on the problems such as low inspection speed and low accuracy caused by subjective factors in the manual inspection method of ampoule packaging quality, an inspection algorithm based on machine vision and lightweight neural network was proposed. First, threshold processing, tilt correction and cutting of ampoule regions were performed on the images to be inspected by using the threshold segmentation and affine transformation methods in machine learning. Second, the network structure of the classification algorithm was designed according to the characteristics of images and the requirements of defect recognition. Finally, the ampoule packaging defect dataset was constructed by collecting the images of the production site. After that, the proposed ampoule packaging defect identification network was verified, and the accuracy and inspection speed of the algorithm deployed on the Jetson Nano embedded platform were tested. Experimental results show that, taking the product of five ampoules each box as the example, the proposed ampoule packaging quality inspection algorithm takes 70.1 ms/box averagely, that is up to 14 boxes/s, and has the accuracy of 99.94%. It can achieve online high-precision ampoule packaging quality inspection on the Jetson Nano embedded platform.
[1] Banner Engineering. 安瓿瓶装盒检测[EB/OL].[2020-02-29]. https://www.bannerengineering.com.cn/cn/zh/solutions/partquality-inspection/Ampoule-Bottles-Inspection.html. (Banner engineering. Ampoule bottles inspection[EB/OL].[2020-02-29]. https://www.bannerengineering.com.cn/cn/zh/solutions/partquality-inspection/Ampoule-Bottles-Inspection.html.) [2] 方文星, 王野. 一种铝塑泡罩药品包装缺陷检测方法[J]. 包装工程,2019,40(1):133-139.(FANG W X,WANG Y. Defect detection method for drug packaging with aluminum plastic bubble cap[J]. Packaging Engineering,2019,40(1):133-139.) [3] QASIM R H,AL-ANI M S. Efficient approach of detection and visualization of the damaged tablets[J]. Journal of Theoretical and Applied Information Technology,2018,96(3):643-656. [4] RAWAT W,WANG Z. Deep convolutional neural networks for image classification:a comprehensive review[J]. Neural Computation,2017,29(9):2352-2449. [5] 姚明海, 陈志浩. 基于深度主动学习的磁片表面缺陷检测[J]. 计算机测量与控制,2018,26(9):29-33.(YAO M H,CHEN Z H. Deep active learning in detection of surface defects on magnetic sheet[J]. Computer Measurement and Control,2018,26(9):29-33.) [6] 张琪, 王国栋, 赵希梅, 等. 基于轻量级卷积神经网络的肝部病理组织切片分类[J]. 青岛大学学报(自然科学版),2018,31(4):76-82.(ZHANG Q,WANG G D,ZHAO X M,et al. Classification of liver pathological tissue sections based on the lightweight convolutional neural network[J]. Journal of Qingdao University (Natural Science Edition),2018,31(4):76-82.) [7] HOWARD A G,ZHU M,CHEN B,et al. MobileNets:efficient convolutional neural networks for mobile vision applications[EB/OL].[2020-02-29]. https://arxiv.org/pdf/1704.04861.pdf. [8] SANDLER M, HOWARD A, ZHU M, et al. MobileNetv2:inverted residuals and linear bottlenecks[C]//Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway:IEEE,2018:4510-4520. [9] HE K,ZHANG X,REN S,et al. Deep residual learning for image recognition[C]//Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway:IEEE, 2016:770-778. [10] 刘平, 陈斌, 阮波. 基于边缘信息的图像阈值化分割方法[J]. 计算机应用,2004,24(9):28-30,36.(LIU P,CHEN B,RUAN B. Image thresholding segmentation based on edge information[J]. Journal of Computer Applications, 2004, 24(9):28-30,36.) [11] GONZALEZ R C,WOODS R E. 数字图像处理[M]. 3版. 阮秋琦,阮宇智,译. 北京:电子工业出版社,2011:424-486. (GONZALEZ R C,WOODS R E. Digital Image Processing[M]. 3rd ed. RUAN Q Q,RUAN Y Z,translated. Beijing:Publishing House of Electronics Industry,2011:424-486.) [12] 纪姚林, 黄慧明. 基于边缘信息的二维Otsu阈值分割算法的改进[J]. 信息技术,2017(11):43-45,48. (JI Y L,HUANG H M. Improvement of 2-D Otsu threshold segmentation algorithm based on edge information[J]. Information Technology,2017(11):43-45,48.) [13] PyTorch. AdaptiveAvgPool2d[EB/OL].[2020-02-29]. https://pytorch.org/docs/master/generated/torch.nn. AdaptiveAvgPool2d.html#torch. nn. AdaptiveAvgPool2d. [14] IOFFE S,SZYEGEDY C. Batch normalization:accelerating deep network training by reducing internal covariate shift[C]//Proceedings of the 32nd International Conference on Machine Learning. New York:JMLR. org,2015:448-456. [15] KRIZHEVSKY A, HINTON G. Convolutional deep belief networks on CIFAR-10[EB/OL].[2020-02-29]. https://www.cs.toronto.edu/~kriz/conv-cifar10-aug2010.pdf. [16] SRIVASTAVA N, HINTON G, KRIZHEVSKY A, et al. Dropout:a simple way to prevent neural networks from overfitting[J]. Journal of Machine Learning Research,2014,15(1):1929-1958. [17] BOTTOU L. Large-scale machine learning with stochastic gradient descent[C]//Proceedings of the 19th International Conference on Computational Statistics. Heidelberg:Physica-Verlag, 2010:177-186. [18] LOSHCHILOV I, HUTTER F. Decoupled weight decay regularization[EB/OL].[2020-02-29]. https://arxiv.org/pdf/1711.05101.pdf. [19] MA N,ZHANG X,ZHENG H,et al. ShuffleNet V2:practical guidelines for efficient CNN architecture design[C]//Proceedings of the 2018 European Conference on Computer Vision,LNCS 11218. Cham:Springer,2018:122-138. [20] IANDOLA F N,HAN S,MOSKEWICZ M W,et al. SqueezeNet:AlexNet-level accuracy with 50x fewer parameters and <0.5 MB model size[EB/OL].[2020-02-29]. https://arxiv.org/pdf/1602.07360.pdf. [21] HUANG D,SHAN C,ARDABILIAN M,et al. Local binary patterns and its application to facial image analysis:a survey[J]. IEEE Transactions on Systems,Man,and Cybernetics,Part C (Applications and Reviews),2011,41(6):765-781. [22] HUANG G B,WANG D H,LAN Y. Extreme learning machines:a survey[J]. International Journal of Machine Learning and Cybernetics,2011,2(2):107-122.