Journal of Textile Research ›› 2025, Vol. 46 ›› Issue (08): 226-235.doi: 10.13475/j.fzxb.20250105901

• Machinery & Equipment • Previous Articles     Next Articles

Consistency detection method for precision parts based on machine learning

ZHANG Qingyang1, ZHU Shigen1,2(), BAI Yunfeng1,2, DONG Weiwei1,2, LUO Yilan1,2   

  1. 1. College of Mechanical Engineering, Donghua University, Shanghai 201620, China
    2. Engineering Research Center of Advanced Textile Machinery, Ministry of Education, Donghua University, Shanghai 201620, China
  • Received:2025-01-21 Revised:2025-06-30 Online:2025-08-15 Published:2025-08-15
  • Contact: ZHU Shigen E-mail:sgzhu@dhu.edu.cn

Abstract:

Objective A large number of precision parts used in knitting machinery, such as main needles and auxiliaries, have irregular shapes and fine structures, but the consistency requirements are extremely high. In order to tackle the inefficiency of manual detection of the consistency of precision parts in the past, as well as the shortcomings of machine vision in the detection of the consistency of precision parts, such as excessive program calculation, sensitivity to image stains, and incomplete overview of effective features of images, a consistency detection method for fine, thin and long parts based on machine learning was proposed.

Method Based on the principle of machine learning, on the existing glass disc detection device, taking model 104 knitting needle as an example, and two computer languages of LabVIEW and Python were used to design the detection algorithm, and three machine learning algorithms, which are the support vector machine model, the decision tree model, and the K-nearest neighbor model, were used to improve the detecting consistency of the overhead direction of the knitting needle. The aforementioned glass disc detection system consists of the following functional modules: automatic positioning unit, position sensing unit, image acquisition and processing unit, sorting unit.

Results For the training results of the above three machine learning models, the accuracy of the support vector machine model is 93%, the accuracy of the support vector machine model is 97%, and the accuracy of the KNN model is 88%. The number of sample images required to train the above three models is 600, including 300 qualified sample images and 300 unqualified sample images, and the ratio of the training set to the test set is 7∶3. For validation of the machine learning algorithm's performance in top-view orientation consistency detection of knitting needles, implementation and operation of the ML-based detection program on the target inspection system is mandatory. First, 700 knitting needles were tested once by manual detection, and the qualified needles and unqualified knitting needles were distinguished by a qualified template, and then the machine learning method was used to detect and compare the effects of manual detection and machine learning algorithm. Of the 700 needles manually tested, 272 were qualified and 428 were unqualified, with a detection speed of 10 needles per minute. The 700 needles were inspected in a single pass using machine learning. 271 qualified knitting needles were detected, of which there was no unqualified knitting needle mixing, and the false detection rate was 429 unqualified knitting needles were detected, of which 1 qualified knitting needle was mixed, the missed detection rate was 0.37%, the missed detection rate was low, and the detection speed was 60 needles per minute. According to previous research, the accuracy rate of using machine vision to detect knitting needles is 99%, and the average detection rate of qualified products is 84% in one progressive inspection, that is, the missed detection rate is 16%, and the detection speed is 70 pieces per minute. Compared with manual detection, machine vision detection, and machine learning detection, the missed detection rate of machine learning is greatly improved compared with machine vision, and the detection speed is greatly improved compared with manual inspection, but the detection speed of machine learning is not as good as that of machine vision.

Conclusion Using the machine learning based fine thin and long parts sorting method, the knitting needle detection consistency is carried out, the false detection rate of unqualified knitting needle is 0, and the missed detection rate of qualified knitting needle is 0.37%, which can better meet the requirements of industrial production detection, and has a great improvement in the detection speed compared with manual detection, and has a great improvement compared with machine vision in terms of missing detection rate, wherein the better model obtained during training is the decision tree, and the model accuracy is 97%. In conclusion, in order to further improve the detection efficiency of fine and long parts, a sorting method of fine and long parts based on machine learning was studied, and the machine learning model was used to reduce the missed detection rate of consistency detection and improve the accuracy of detection, which provided an effective method for the consistent sorting of fine thin and long parts.

Key words: precision part, machine learning, consistency testing, feature extraction, model comparison

CLC Number: 

  • TH71

Fig.1

Hardware fixtures and sorting processes"

Fig.2

Partial schematic diagram of qualified template"

Fig.3

Schematic diagram of coordinate system with needle heel line and needle bar line"

Fig.4

Images of good and bad samples in hook area"

Fig.5

Image of good and bad samples in the needle area"

Tab.1

Comparison of grayscale co-occurrence matrices between qualified and unqualified samples"

样本 对比度 能量 相关性
合格样本 546.167 0 0.941 3 0.956 2 0.271 2
不合格样本 573.524 6 0.934 7 0.952 1 0.270 7

Tab.2

Number of grayscale pixels in each of qualified and unqualified samples 个"

样本 不同级别灰度值的像素个数
0~51 52~102 103~153 154~204 204~255
合格样本 907 572 716 486 907
不合格样本 1 256 687 729 684 1 228

Fig.6

Outermost contour lines of good and bad samples"

Fig.7

Comparison of height of outer contour of pass and fail samples"

Tab.3

Train results of different model %"

模型类别 合格样本 不合格样本 准确率 SAUC
准确率 召回率 F1-分数 准确率 召回率 F1-分数
线性核函数 0.92 0.92 0.92 0.94 0.94 0.94 0.93 0.936 9
多项式核函数 0.87 0.90 0.89 0.92 0.90 0.91 0.90 0.907 8
径向基函数核 0.85 0.88 0.87 0.91 0.88 0.90 0.88 0.883 4
Sigmoid核函数 0.83 0.65 0.73 0.64 0.82 0.72 0.73 0.867 0
决策树算法 0.95 1.00 0.98 1.00 0.95 0.97 0.97 0.974 1
KNN算法 0.85 0.93 0.89 0.93 0.83 0.88 0.88 0.883 3

Tab.4

Comparison of training results of various models"

类型 平均准
确率/%
平均召回
率/%
平均F1-
分数/%
准确率/
%
SAUC/%
SVM 0.935 0.935 0.935 0.93 0.936 9
决策树 0.975 0.975 0.975 0.97 0.974 1
KNN 0.890 0.880 0.885 0.88 0.883 3

Tab.5

Comparison of manual inspection, machine vision inspection and machine learning inspection"

检测方法 合格数
量/枚
不合格
数量/枚
误检
率/%
漏检
率/%
检测速度/
(枚·min-1)
人工检测 272 428 6
机器视觉检测 0 16 70
机器学习检测 271 429 0 0.37 60
[1] 崔敬涛. 织针新材料及热处理工艺研究[D]. 上海: 东华大学, 2014:1-39.
CUI Jingtao. Study on new knitting needle material and heat treatment technology[D]. Shanghai: Donghua University, 2014:1-39.
[2] 程静. 弹簧片安装工艺及其设备[D]. 上海: 东华大学, 2012:1-47.
CHENG Jing. Installation technology and equipment of spring leaf[D]. Shanghai: Donghua University, 2012:1-47.
[3] 李涛, 白云峰, 朱世根. 基于机器视觉的织针自动化检测系统[J]. 毛纺科技, 2018, 46(9): 74-78.
LI Tao, BAI Yunfeng, ZHU Shigen. Automatic detection system for knitting needle based on the machine vision technology[J]. Wool Textile Journal, 2018, 46(9): 74-78.
[4] 王坤. 基于机器视觉的花边针自动分拣方法研究[D]. 上海: 东华大学, 2022:1-43.
WANG Kun. Investigation on automatic sorting method of curved edge needle based on machine vision[D]. Shanghai: Donghua University, 2022:1-43.
[5] 杨宏贤, 朱世根, 白云峰, 等. 基于机器视觉的扁平细长带钩零件检测系统研发[J]. 仪表技术与传感器, 2021(5):117-121.
YANG Hongxian, ZHU Shigen, BAI Yunfeng, et al. Development of inspection system for flat and slender parts with hook based on machine vision[J]. Instrument Technique and Sensor, 2021(5):117-121.
[6] 段雨露. 基于机器视觉的槽针分拣策略与应用[D]. 上海: 东华大学, 2023:1-47.
DUAN Yulu. Machine vision-based grooved needle sorting strategy and application[D]. Shanghai: Donghua University, 2023:1-47.
[7] 朱世根, 杨宏贤, 白云峰, 等. 长条状细薄带钩零件变形自动检测系统[J]. 纺织学报, 2020, 41(10):158-163.
doi: 10.13475/j.fzxb.20200306006
ZHU Shigen, YANG Hongxian, BAI Yunfeng, et al. Investigation on automatic deformation inspection system of long and thin parts with hooks[J]. Journal of Textile Research, 2020, 41(10):158-163.
doi: 10.13475/j.fzxb.20200306006
[8] 赵趣超. 基于机器学习的人脸识别系统研究[J]. 内蒙古科技与经济, 2024(14):115-118.
ZHAO Quchao. Research on face recognition system based on machine learning[J]. Inner Mongolia Science Technology & Economy, 2024(14):115-118.
[9] 朱世根, 白云峰, 李涛, 等. 一种基于机器视觉的织针自动检测装置: CN201710898969.9[P]. 2020-05-29.
ZHU Shigen, BAI Yunfeng, LI Tao, et al. An automatic knitting needle detection device based on machine vision: CN201710898969.9[P]. 2020-05-29.
[10] 李强, 陈初侠, 黄涛, 等. 一种去除高密度椒盐噪声的中值滤波算法[J]. 电脑知识与技术, 2021, 17(35):137-9.
LI Qiang, CHEN Chuxia, HUANG Tao, et al. A median filtering algorithm for removing high-density salt-and-pepper noise[J]. Computer Knowledge and Technology, 2021, 17(35):137-9.
[11] 黎武林, 王天宝. 基于canny算法的改进自适应边缘检测[J]. 长江信息通信, 2023, 36(1): 67-70.
LI Wulin, WANG Tianbao. Improved adaptive edge detection based on canny algorithm[J]. Changjiang Information & Communications, 2023, 36(1): 67-70.
[12] 赵颖, 李玉双, 武小荣. 基于舌图像多特征融合与机器学习的裂纹舌识别算法[J]. 燕山大学学报, 2022, 46(6):522-528.
ZHAO Ying, LI Yushuang, WU Xiaorong. Crack tongue recognition algorithm based on tongue image multi-features fusion and machine learning[J]. Journal of Yanshan University, 2022, 46(6):522-528.
[13] 李静, 杨玉倩, 沈伟, 等. 基于灰度共生矩阵的织物纹理研究[J]. 现代纺织技术, 2013, 21(3): 12-16.
LI Jing, YANG Yuqian, SHEN Wei, et al. Research on fabric texture based on gray level co-occurrence matrix[J]. Advanced Textile Technology, 2013, 21(3): 12-16.
[14] 孙国栋, 林松, 艾成汉, 等. 基于灰度直方图反向投影的织物疵点图像分割[J]. 制造业自动化, 2016, 38(4): 20-21, 35.
SUN Guodong, LIN Song, AI Chenghan, et al. Image segmentation of fabric defects based on gray level histogram back projection[J]. Manufacturing Automation, 2016, 38(4): 20-21, 35.
[15] 李龙卓. 基于形状特征的图像检索技术研究[D]. 青岛: 青岛科技大学, 2015:1-41.
LI Longzhuo. Research on image retrieval technology based on shape features[D]. Qingdao: Qingdao University of Science & Technology, 2015:1-41.
[16] 简丽琼. 基于Hu矩和Zernike矩的文字识别[J]. 科技信息, 2009(17):454-455.
JIAN Liqiong. Text recognition based on hu moments and zernike moments[J]. Science & Technology Information, 2009(17):454-455.
[17] 范天程, 汪珍亮, 李云飞, 等. 基于机器学习的沟谷地貌识别模型对比: 以黄土高原典型流域为例[J]. 水土保持学报, 2023, 37(4): 205-213.
FAN Tiancheng, WANG Zhenliang, LI Yunfei, et al. Comparing the performance of machine learning models for identifying gully landforms: a case study of a typical watershed on the Chinese loess plateau[J]. Journal of Soil and Water Conservation, 2023, 37(4): 205-213.
[18] 李琮康. 基于传统机器学习与卷积神经网络的玉米种子分类识别研究[D]. 郑州: 河南农业大学, 2024:1-36.
LI Congkang. Research on classification and recognition of maize seeds based on traditional machine learning and convolutional neural network[D]. Zhengzhou: Henan Agricultural University, 2024:1-36.
[19] 谭卢敏, 冯新刚. 基于机器学习算法的缺损米粉块在线快速检测[J]. 食品与机械, 2022, 38(5):78-81,86.
TAN Lumin, FENG Xingang. On line fast detection of defective rice flour based on machine learning algori-thm[J]. Food & Machinery, 2022, 38(5):78-81,86.
[20] 李新. 支持向量机的核方法及其多核聚类算法的研究[D]. 青岛: 中国海洋大学, 2010:1-39.
LI Xin. Research of Kernel methods for support vector machine and multiple Kernel clustering algorithm[D]. Qingdao: Ocean University of China, 2010:1-39.
[21] 彭子康, 张芹, 陈世航, 等. 基于机器学习和图像处理的水质检测方法[J]. 自动化应用, 2023, 64(10):188-191.
PENG Zikang, ZHANG Qin, CHEN Shihang, et al. Water quality detection methods based on machine learning and image processing[J]. Automation Application, 2023, 64(10):188-191.
[22] 温博文, 董文瀚, 解武杰, 等. 基于改进网格搜索算法的随机森林参数优化[J]. 计算机工程与应用, 2018, 54(10):154-157.
doi: 10.3778/j.issn.1002-8331.1612-0328
WEN Bowen, DONG Wenhao, XIE Wujie, et al. Parameter optimization method for random forest based on improved grid search algorithm[J]. Computer Engineering and Applications, 2018, 54(10):154-157.
doi: 10.3778/j.issn.1002-8331.1612-0328
[23] 朱峻生, 王胜, 柏君, 等. 基于改进KNN算法的有限钻孔预测全域地质特征的方法[J]. 隧道建设, 2023, 43(S2):348-358.
ZHU Junsheng, WANG Sheng, BAI Jun, et al. An improved K-nearest neighbor algorithm method using finite boreholes for predicting fullarea geological fea-tures[J]. Tunnel Construction, 2023, 43(S2): 348-358.
[24] 郇益斌. 基于训练集聚类的KNN算法及其应用研究[D]. 青岛: 山东科技大学, 2017:1-50.
XUN Yibin. Research on KNN algorithm based on clustering of training set and its application[D]. Qingdao: Shandong University of Science and Technology, 2017:1-50.
[1] WANG Qing, JIANG Yuefu, ZHAO Tiantian, ZHAO Shihang, LIU Jiayi. Pose estimation and bobbin grasping based on deep learning methods [J]. Journal of Textile Research, 2025, 46(07): 217-226.
[2] JU Yu, WANG Zhaohui, LI Boyi, YE Qinwen. Employee efficiency prediction of garment production line based on machine learning [J]. Journal of Textile Research, 2024, 45(05): 183-192.
[3] LU Yan, HONG Yan, FANG Jian. Research progress on applications of machine learning in flexible strain sensors in context of material intelligence [J]. Journal of Textile Research, 2024, 45(05): 228-238.
[4] QIU Kebin, CHEN Weiguo, ZHANG Zhiqiang, HUANG Weizhong. Color feature extraction of colored fibers based on two-dimensional Gaussian kernel density estimation [J]. Journal of Textile Research, 2024, 45(05): 85-93.
[5] REN Jie, ZHANG Jie, WANG Junliang. Multi-fault feature adaptive extraction method for textile typical equipment [J]. Journal of Textile Research, 2024, 45(04): 211-220.
[6] WANG Zhenhua, ZHANG Zhouqiang, ZAN Jie, LIU Jianghao. Fabric defects detection algorithm based on multi-scale Laws texture energy and low-rank decomposition [J]. Journal of Textile Research, 2024, 45(04): 96-104.
[7] WANG Menglei, WANG Jing'an, GAO Weidong. Research progress in computer aided cotton blending technology [J]. Journal of Textile Research, 2023, 44(08): 225-233.
[8] WANG Zhongyu, SU Yun, WANG Yunyi. Development of personal comfort models based on machine learning and their application prospect in clothing engineering [J]. Journal of Textile Research, 2023, 44(05): 228-236.
[9] LIU Junping, ZHANG Fuhong, HU Xinrong, PENG Tao, LI Li, ZHU Qiang, ZHANG Junjie. Personalized clothing matching recommendation based on multi-modal fusion [J]. Journal of Textile Research, 2023, 44(03): 176-186.
[10] MA Chuanxu, ZHANG Ning, PAN Ruru. Detection of cheese yarn bobbin varieties based on support vector machine [J]. Journal of Textile Research, 2023, 44(01): 194-200.
[11] LIU Huanhuan, WANG Zhaohui, YE Qinwen, CHEN Ziwei, ZHENG Jingjin. Progress and trends in application of wearable technology for emotion recognition [J]. Journal of Textile Research, 2022, 43(08): 197-205.
[12] SUN Chunhong, DING Guangtai, FANG Kun. Cashmere and wool classification based on sparse dictionary learning [J]. Journal of Textile Research, 2022, 43(04): 28-32.
[13] XU Zengbo, ZHANG Ling, ZHANG Yanhong, CHEN Guiqing. Research on clothing collar types based on complex network extraction and support vector machine classification [J]. Journal of Textile Research, 2021, 42(06): 146-152.
[14] ZHENG Xiaoping, LIU Chengxia. Objective evaluation of woven garment bagging performance by laser measurement [J]. Journal of Textile Research, 2021, 42(05): 143-149.
[15] WANG Hui, SUN Jie, DING Xiaojun, LONG Ying, ZOU Fengyuan. Comparison of feature extracting and matching methods for fabric patterns [J]. Journal of Textile Research, 2020, 41(04): 45-50.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!