纺织学报 ›› 2025, Vol. 46 ›› Issue (08): 226-235.doi: 10.13475/j.fzxb.20250105901

• 机械与设备 • 上一篇    下一篇

基于机器学习的精细薄长零件一致性检测方法

张清扬1, 朱世根1,2(), 白云峰1,2, 董威威1,2, 骆祎岚1,2   

  1. 1.东华大学 机械工程学院, 上海 201620
    2.东华大学 纺织装备教育部工程研究中心, 上海 201620
  • 收稿日期:2025-01-21 修回日期:2025-06-30 出版日期:2025-08-15 发布日期:2025-08-15
  • 通讯作者: 朱世根(1963—),男,教授,博士。主要研究方向为先进成形制造。E-mail:sgzhu@dhu.edu.cn
  • 作者简介:张清扬(2000—),男,硕士生。主要研究方向为先进成形制造技术。

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 Published:2025-08-15 Online:2025-08-15

摘要:

为解决以往人工检测精密零件一致性的低效性,以及机器视觉检测精密零件一致性中出现的程序计算量过大、对图像污点敏感、图像有效特征概况不全面等缺点,提出了基于机器学习的精细薄长零件一致性检测方法。基于机器学习算法,可全面提取织针图像的有效特征,忽略图像污点一类的无效特征,减轻计算量,克服以往机器视觉的缺点,再利用有效特征数据训练模型,实现高效的织针检测。以某种织针为研究实例,对比各类机器学习算法,实现检测织针俯视方向一致性的功能。研究结果表明:较佳检测模型是决策树模型,其准确率为97%;织针误检率为0,漏检率为0.37%,检测速度为60枚/min,可较好满足工业生产检测的要求。本研究为精细薄长零件一致性分拣提供了有效方法。

关键词: 精细薄长零件, 机器学习, 一致性检测, 特征提取, 模型对比

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

中图分类号: 

  • TH71

图1

硬件装置和分拣流程"

图2

合格模板局部示意图"

图3

坐标系与针踵线和针杆线示意图"

图4

针钩区域合格样本与不合格样本图像"

图5

针身区域合格样本与不合格样本图像"

表1

合格样本与不合格样本的灰度共生矩阵对比"

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

表2

合格样本与不合格样本的各灰度级像素数量"

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

图6

合格与不合格样本的最外层轮廓线"

图7

合格与不合格样本的外轮廓高度对比"

表3

不同模型的训练结果"

模型类别 合格样本 不合格样本 准确率 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

表4

各类模型的训练结果对比"

类型 平均准
确率/%
平均召回
率/%
平均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

表5

人工检测与机器视觉和机器学习检测的对比"

检测方法 合格数
量/枚
不合格
数量/枚
误检
率/%
漏检
率/%
检测速度/
(枚·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] 王青, 姜越夫, 赵恬恬, 赵世航, 刘甲怡. 基于深度学习的纱管位姿估计方法及抓取实验[J]. 纺织学报, 2025, 46(07): 217-226.
[2] 鞠宇, 王朝晖, 李博一, 叶勤文. 基于机器学习的服装生产线员工效率预测[J]. 纺织学报, 2024, 45(05): 183-192.
[3] 卢妍, 洪岩, 方剑. 智能背景下机器学习在柔性应变传感器中的应用研究进展[J]. 纺织学报, 2024, 45(05): 228-238.
[4] 裘柯槟, 陈维国, 张志强, 黄为忠. 基于二维高斯核密度估计的有色纤维颜色特征提取方法[J]. 纺织学报, 2024, 45(05): 85-93.
[5] 任杰, 张洁, 汪俊亮. 纺织典型装备故障多特征自适应提取方法[J]. 纺织学报, 2024, 45(04): 211-220.
[6] 王振华, 张周强, 昝杰, 刘江浩. 基于多尺度Laws纹理能量和低秩分解的织物疵点检测算法[J]. 纺织学报, 2024, 45(04): 96-104.
[7] 王梦蕾, 王静安, 高卫东. 计算机辅助配棉技术研究进展[J]. 纺织学报, 2023, 44(08): 225-233.
[8] 王中昱, 苏云, 王云仪. 机器学习建立的个体热舒适模型及其在服装领域的应用展望[J]. 纺织学报, 2023, 44(05): 228-236.
[9] 刘军平, 张伏红, 胡新荣, 彭涛, 李丽, 朱强, 张俊杰. 基于多模态融合的个性化服装搭配推荐[J]. 纺织学报, 2023, 44(03): 176-186.
[10] 马传旭, 张宁, 潘如如. 基于支持向量机的筒子纱纱管品种检测[J]. 纺织学报, 2023, 44(01): 194-200.
[11] 刘欢欢, 王朝晖, 叶勤文, 陈子唯, 郑婧瑾. 可穿戴技术在情绪识别中的应用进展及发展趋势[J]. 纺织学报, 2022, 43(08): 197-205.
[12] 孙春红, 丁广太, 方坤. 基于稀疏字典学习的羊绒与羊毛分类[J]. 纺织学报, 2022, 43(04): 28-32.
[13] 徐增波, 张玲, 张艳红, 陈桂清. 基于复杂网络提取和支持向量机模型分类的服装领型研究[J]. 纺织学报, 2021, 42(06): 146-152.
[14] 郑晓萍, 刘成霞. 基于激光测量的机织服装起拱性客观评价[J]. 纺织学报, 2021, 42(05): 143-149.
[15] 汪会, 孙洁, 丁笑君, 龙颖, 邹奉元. 织物纹样特征提取与匹配方法比较[J]. 纺织学报, 2020, 41(04): 45-50.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!