Search

CN-122023368-A - Textile defect identification method based on image identification

CN122023368ACN 122023368 ACN122023368 ACN 122023368ACN-122023368-A

Abstract

The invention discloses a textile defect identification method based on image identification, which relates to the technical field of machine learning and comprises the steps of acquiring known defect type image data of historical textiles under various textile processes, analyzing the known defect type performances under different textile processes, constructing a multi-branch defect identification network, generating defect type knowledge vectors of various textile processes, substituting the knowledge posterior to the knowledge, generating a textile process-defect type association rule knowledge graph, training process-oriented defect detection random forests, dividing the image data of detected real-time textiles, determining that the image data of detected real-time textiles are oriented to a plurality of prevention process-defect types and textile process-defect type association rule knowledge graphs, constructing a multi-head attention mechanism of the textile process-defect types, and marking the image-oriented defect types of the detected real-time textiles. The method has the beneficial effects that the accuracy and the self-adaptive capacity of identifying the cross-process defects are improved.

Inventors

  • DONG LI
  • LIN ZHIFENG
  • YIN JINXIANG
  • MA YAN

Assignees

  • 宁夏闽泰纺织有限公司

Dates

Publication Date
20260512
Application Date
20260206

Claims (8)

  1. 1. The textile defect identification method based on image identification is characterized by comprising the following steps: S1, acquiring known defect type image data of historical textiles under various textile processes, analyzing the known defect type performances under different textile processes, constructing a multi-branch defect identification network, generating defect type knowledge vectors of various textile processes, substituting the knowledge posterior, and generating a textile process-defect type association rule knowledge graph; S2, according to a textile process-defect type association rule knowledge graph, training a process-oriented defect detection random forest, dividing image data of the detected real-time textile, determining that the image data of the detected real-time textile is oriented to a plurality of prevention process-defect type and textile process-defect type association rule knowledge graphs, constructing a multi-head attention mechanism of the textile process-defect type, and marking the image-oriented defect type of the detected real-time textile.
  2. 2. The method for identifying textile defects based on image recognition according to claim 1, wherein step S1 specifically comprises: Based on a textile defect database, acquiring known defect type image data of the historical textile under each textile process, and carrying out gray level conversion and normalization processing on the known defect type image under each textile process; constructing a backbone network and a process adaptation head based on a Two-Stream double-flow network, and constructing a multi-branch defect identification network; The backbone network specifically comprises: Global texture flow, namely, based on known defect type image data under each textile process of a historical textile, performing bilinear interpolation by utilizing Gaussian blur, substituting a Gabor filter to extract a direction filtering amplitude response of a known defect type image, counting the mean value, variance and standard deviation of a response graph of each known defect type filter, calculating the local dominant direction of the response graph of the known defect type filter, constructing a known defect type image direction histogram, marking the direction entropy in each histogram according to a Shannon entropy formula, and obtaining a direction feature graph of the known defect type image; Calculating the power spectrum density in the known defect type image by utilizing two-dimensional Fourier transformation based on the known defect type image data under each textile process of the historical textile, substituting the power spectrum density into logarithmic transformation, converting rectangular coordinate power spectrum into polar coordinate to obtain logarithmic power spectrum in the known defect type image, calculating radial energy distribution in the logarithmic power spectrum in the known defect type image by radial profile analysis, extracting peak position, peak height and peak interval of the known defect type image, calculating angular energy distribution in the known defect type image, and calculating radial characteristics and angular characteristics of the known defect type image; According to the logarithmic power spectrum in the known defect type image, detecting according to a ring sign method, dividing the logarithmic power spectrum into a plurality of image blocks with the same size, searching an adaptive threshold value of each block through an Otsu threshold value, constructing a known defect type image threshold value diagram, performing binarization and morphological processing, substituting Hough circle transformation, iteratively increasing a radius value, extracting coarse granularity angle samples in the known defect type image binary diagram, constructing a preliminary accumulator for carrying out fine granularity Hough transformation on the coarse granularity angle samples in the diagram, determining ring parameters of each known defect type image binary diagram, detecting according to a local maximum value, screening out an optimal ring angle sampling value to obtain a single ring parameter, and determining ring characteristics in the known defect type image; and performing feature stitching on the direction feature image of the known defect type image, the radial feature and the angle feature of the known defect type image and the annular feature in the known defect type image to obtain the global texture flow feature vector of the known defect type image under each textile process of the historical textile.
  3. 3. The method for identifying textile defects based on image recognition according to claim 2, wherein the step S1 further comprises: local structural flow: Based on the logarithmic power spectrum image blocks, carrying out convolution and pooling operation on each logarithmic power spectrum image block according to CNN forward propagation, carrying out pooling by combining a batch normalization and activation function, extracting a local microstructure feature map of each logarithmic power spectrum image block, substituting the local microstructure feature map into a global average pooling layer, and obtaining local structure feature vectors of known defect type images under each textile process of the historical textile; according to the unit time stamp, aiming at the alignment calibration of the local structural feature vector of the known defect type image and the global texture flow feature vector of the known defect type image under each textile process of the historical textile; according to a self-attention mechanism, mutual information between local structural feature vectors of the known defect type images and global texture stream feature vectors of the known defect type images is calculated by utilizing mutual information to carry out merging and sorting, a mutual information matrix between the local structural feature vectors of the known defect type images and the global texture stream feature vectors of the known defect type images under each textile process of the historical textile is constructed, and weighting fusion functions are carried out on the local structural feature vectors and the global texture stream feature vector weights to obtain global texture and local structural fusion feature vectors of the known defect type images under each textile process of the historical textile.
  4. 4. A method for identifying defects in textiles based on image recognition according to claim 3, wherein step S1 further comprises: the process adaptation head comprises the following steps: Based on YOLOv target detection, according to the fusion feature vector of the global texture and the local structure of the known defect type image under each textile process of the historical textile, detecting the yarn center line by utilizing a Steger algorithm, generating the center line diagram of the warp and weft yarns of the known defect type image under each textile process, constructing ideal grid images of the known defect type under each textile process, calculating the Euclidean distance between the known defect type image under each textile process and the ideal grid images of the known defect type, comparing the upper limit and the lower limit of the distance by utilizing the quartile distance, determining an abnormal threshold value, marking the abnormal region in the known defect type image under each textile process to perform broken warp/broken weft and jump detection, and constructing the tatting defect classification head Based on a Mask R-CNN network, according to the global texture and local structure fusion feature vector of a known defect type image under each textile process of a historical textile, determining circle center and radius information according to annular parameters of a binary image of each known defect type image to locate the position of a coil, constructing a coil connection relation graph of the known defect type image, analyzing and utilizing breadth-first search, extracting a communication branch to obtain a known defect type complete connection graph under each textile process, calculating Euclidean distance between the known defect type image under each textile process and the known defect type complete connection graph under each textile process, comparing upper and lower limits of the distances by using a quartile distance, determining an abnormal threshold, and detecting a missing needle, a spline and a horizontal bar aiming at an abnormal region in the known defect type image under each textile process to construct a knitting defect classification head; Based on U-Net image segmentation, according to the fusion feature vector of the global texture and the local structure of the known defect type image under each textile process of the historical textile, utilizing a local gradient calculation method to obtain gradient information of the known defect type image, verifying the local gradient direction of each pixel position, gradually calculating the image gray level distribution value in each window through a sliding window to obtain pixel entropy value distribution of the known defect type image under each textile process, constructing a gray level co-occurrence matrix, calculating the gray level uniform energy value in each window to obtain a gray level uniform energy distribution map of the known defect type under each textile process, calculating Euclidean distance between the known defect type image under each textile process and the gray level uniform energy distribution map of the known defect type under each textile process, utilizing the upper limit and the lower limit of the four-component distance comparison distance to determine an abnormal threshold, and detecting abnormal areas in the known defect type image under each textile process to construct a non-woven classification head.
  5. 5. Based on the multi-branch defect recognition network, defect type vectors in the known defect type images under each textile process of the historical textile are generated, and the defect type vectors are substituted into the low-dimensional defect type vectors in the known defect type images under each textile process of the historical textile by compressing the full-connection layer.
  6. 6. The method for identifying textile defects based on image recognition according to claim 4, wherein the step S1 further comprises: Calculating posterior probability distribution of each textile process and defect type observed under the fusion feature vector of the global texture and the local structure of the given known defect type image by using Bayesian posterior, and endowing the fusion feature vector of the global texture and the local structure with confidence level relative to each textile process and defect type; According to a causal network, taking each textile process as a process node, each defect type as a defect node, taking a global texture and local structure fusion feature vector of a known defect type image as an attribute node, and establishing association rule edges between the global texture and local structure fusion feature vector and the process node and between the defect node and the attribute node relative to the confidence of each textile process and defect type to obtain a textile process-defect type-global texture and local structure fusion feature vector ternary association rule group; According to a ternary association rule set of a textile process-defect type-global texture and local structure fusion feature vector, giving a test global texture and local structure fusion feature vector, calculating a similarity value between each global texture and local structure fusion feature vector in the ternary association rule set by utilizing cosine similarity, determining a plurality of matching attribute nodes, searching for a backward tracing defect node along a matching attribute association edge according to a graph traversing path, normalizing and average weighting calculating the similarity value of the test global texture and local structure fusion feature vector matching attribute node and the confidence of the global texture and local structure fusion feature vector on a current tracing path relative to each textile process and defect type, and constructing a textile process-defect type association rule knowledge graph by taking a path with the highest confidence of the test global texture and local structure fusion feature vector pointing to the textile process-defect type as an attribution path.
  7. 7. The method for identifying textile defects based on image recognition according to claim 5, wherein step S2 specifically comprises: Based on the decision tree, taking a textile process-defect type association rule knowledge graph as a root node, extracting textile process-defect type-global texture and local structure fusion feature vectors of all paths of each defect type, and establishing a process feature decision tree and a defect type decision tree; The process characteristic decision tree and the defect type decision tree are specifically as follows: Taking the textile process-defect type-global texture and local structure fusion feature vectors of all paths of each defect type as root nodes, taking the textile process-global texture and local structure fusion feature vectors in each path as branch nodes of a process feature decision tree, taking each textile process type as leaf nodes of the process feature decision tree, taking the defect type-global texture and local structure fusion feature vectors in each path as branch nodes of the defect type decision tree, taking each defect type as leaf nodes of the defect type decision tree, taking the process feature decision tree as an initial layer of a tree structure, taking the defect type decision tree as an intermediate layer of the tree structure, and constructing a process-oriented defect detection random forest; preprocessing the image data of the real-time textile to be detected, substituting the image data into a process-oriented defect detection random forest, dividing branch nodes according to the minimum base index, and generating the image data of the real-time textile to be detected to be oriented to a plurality of prevention and treatment process-defect types.
  8. 8. The method for identifying textile defects based on image recognition according to claim 6, wherein the step S2 further comprises: extracting image data of the detected real-time textiles to guide a plurality of global texture and local structure fusion feature vectors for preventing and treating the process-defect type, and marking the feature vectors as the image fusion feature vectors of the real-time textiles; According to an MHA multi-head attention mechanism, taking an image fusion feature vector of a real-time textile as a query, taking a textile process path in a textile process-defect type association rule knowledge graph as a key, and taking a textile process attribution type as a value, so as to construct a textile process attention head; according to an MHA multi-head attention mechanism, taking an image fusion feature vector of a real-time textile as a query, taking a defect type path in a textile process-defect type association rule knowledge graph as a key, and taking a defect type attribution category as a value to construct a defect type attention head; Performing linear projection on the image fusion feature vector of the real-time textile, substituting the image fusion feature vector of the real-time textile into a textile process attention head and a defect type attention head to perform linear projection, calculating a textile process attention score and a textile process attention head weight and a defect type attention score and a defect type attention head weight under the position of the image fusion feature vector of the real-time textile, performing multi-head output splicing, inputting linear transformation to construct a matrix multiplication, performing residual connection to obtain an attention weight matrix of the image fusion feature vector of the real-time textile, and performing weighted average to obtain attention distribution of the image fusion feature vector of the real-time textile to each textile process and each defect type; And carrying out attention weighted fusion on the attention head weight of the textile process and the attention head weight of the defect type under the position of the attention distribution of each textile process and each defect type and the attention head weight of the defect type under the position of the image fusion feature vector of the real-time textile according to the image fusion feature vector of the real-time textile, and determining to detect the image pointing defect type of the real-time textile.

Description

Textile defect identification method based on image identification Technical Field The invention relates to the technical field of machine learning, in particular to a textile defect identification method based on image identification. Background In the traditional textile defect identification method, a single image processing technology or a general deep learning model (such as CNN, YOLO series) is generally adopted, the fundamental differences of different textile processes (such as tatting, knitting and non-weaving) on physical structures and defect mechanisms are ignored, so that the model generalization capability is weak and the interpretability is poor, the defects similar in appearance and different in causes are difficult to distinguish due to the fact that feature extraction and process knowledge are disjointed, meanwhile, most of the traditional methods are 'black box' decisions, the correlation reasoning from image features to process defect causes is lacking, accurate process improvement and quality tracing cannot be supported, and the requirements on defect root cause analysis and self-adaptive detection in intelligent manufacturing are difficult to be met. Disclosure of Invention In order to solve the technical problems, the textile defect identification method based on image identification is provided, and the technical scheme solves the problems. In order to achieve the above purpose, the invention adopts the following technical scheme: The textile defect identification method based on image identification comprises the following steps: S1, acquiring known defect type image data of historical textiles under various textile processes, analyzing the known defect type performances under different textile processes, constructing a multi-branch defect identification network, generating defect type knowledge vectors of various textile processes, substituting the knowledge posterior, and generating a textile process-defect type association rule knowledge graph; S2, according to a textile process-defect type association rule knowledge graph, training a process-oriented defect detection random forest, dividing image data of the detected real-time textile, determining that the image data of the detected real-time textile is oriented to a plurality of prevention process-defect type and textile process-defect type association rule knowledge graphs, constructing a multi-head attention mechanism of the textile process-defect type, and marking the image-oriented defect type of the detected real-time textile. Preferably, step S1 specifically includes: Based on a textile defect database, acquiring known defect type image data of the historical textile under each textile process, and carrying out gray level conversion and normalization processing on the known defect type image under each textile process; constructing a backbone network and a process adaptation head based on a Two-Stream double-flow network, and constructing a multi-branch defect identification network; The backbone network specifically comprises: Global texture flow, namely, based on known defect type image data under each textile process of a historical textile, performing bilinear interpolation by utilizing Gaussian blur, substituting a Gabor filter to extract a direction filtering amplitude response of a known defect type image, counting the mean value, variance and standard deviation of a response graph of each known defect type filter, calculating the local dominant direction of the response graph of the known defect type filter, constructing a known defect type image direction histogram, marking the direction entropy in each histogram according to a Shannon entropy formula, and obtaining a direction feature graph of the known defect type image; Calculating the power spectrum density in the known defect type image by utilizing two-dimensional Fourier transformation based on the known defect type image data under each textile process of the historical textile, substituting the power spectrum density into logarithmic transformation, converting rectangular coordinate power spectrum into polar coordinate to obtain logarithmic power spectrum in the known defect type image, calculating radial energy distribution in the logarithmic power spectrum in the known defect type image by radial profile analysis, extracting peak position, peak height and peak interval of the known defect type image, calculating angular energy distribution in the known defect type image, and calculating radial characteristics and angular characteristics of the known defect type image; According to the logarithmic power spectrum in the known defect type image, detecting according to a ring sign method, dividing the logarithmic power spectrum into a plurality of image blocks with the same size, searching an adaptive threshold value of each block through an Otsu threshold value, constructing a known defect type image threshold value diagram, performing binarization and mo