Appearance quality detection method based on feature library compression
Through pre-training model fine-tuning and feature library compression algorithm, the WideResNet50 feature extractor is used to process chemical fiber fabric images to generate heat maps for defect positioning, solving the problem of low defect detection accuracy in the existing technology, and achieving fast and high accuracy Defect detection of rate meets industrial needs.
Patent Information
- Application Number
- CN202411183482.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-01-10
AI Technical Summary
The existing chemical fiber fabric surface defect detection methods cannot effectively overcome the cold start problem and the demand for a large number of defect samples, and the positioning defect accuracy in complex defect performance types is low, which cannot meet the industrial inspection needs.
The pre-trained model fine-tuning and feature library compression algorithm are used to extract and compress chemical fiber fabric images through feature extractor WideResNet50, and generate heat maps for defect positioning and scoring to quickly identify and locate defects.
The training and detection rate is improved, the misdetection problems caused by defect diversity are overcome, defects can be quickly positioned, industrial inspection needs are met, and defect detection is achieved with high accuracy.
Smart Images

Figure CN119295373A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of surface defect detection, and in particular to an appearance quality detection method based on feature library compression. Background Art
[0002] Chemical fiber, as a widely used synthetic material, has been applied to many industries with its excellent strength, light density and excellent elastic properties. It is not only limited to the traditional textile and clothing field, but also shows important value in cutting-edge fields such as national defense and aerospace, biomedical materials research and development, and energy development. In order to optimize storage and transportation efficiency, chemical fiber filaments are often cleverly wound into a package of a specific shape or capacity with the help of precision winding equipment. However, in the complex processing technology, problems such as out-of-control processing speed, uneven tension distribution, insufficient false twisting, abnormal state of the spinneret assembly, and shaking of the paper tube during winding often leave various defects on the surface of the package. According to the strict standards of the domestic textile industry, these appearance defects are detailedly classified into various types such as hairy silk, uneven winding diameter, tripped silk, mesh silk, dirty silk, forming defects, no tail silk, multiple tail silk, stiff silk, paper tube damage, broken ends, and upper tail silk. Among them, dirty silk, tripped silk and poor forming are considered to be the three most common problems due to their high frequency of occurrence. These problems not only directly reduce the quality level of chemical fiber filament packages, but may also hinder the subsequent weaving process, thereby affecting the overall quality and market competitiveness of the finished product. Therefore, strictly controlling each link in the production process and reducing and eliminating these defects are of great significance to improving the overall performance and market value of chemical fiber products.
[0003] There are three main types of existing fabric surface defect detection methods: supervised learning-based, reconstruction-based, and feature embedding-based. The current fabric surface defect detection methods are: Invention patent application number: 202310813505.9, name: A method and system for online defect detection of chemical fiber filaments, which uses grayscale features and shape features to train the model to locate the stiff fiber area of the chemical fiber. Due to the diversity of chemical fiber defects and the need for a large number of defect training samples, it cannot effectively detect new defect types and lacks generalization; Invention patent application number: 202210867261.8, name: A method for detecting the appearance defects of chemical fiber cakes based on improved YOLOV5, which uses multi-scale fusion attention to improve the model. Due to the large amount of training parameters, there is a cold start problem. The model still cannot reach the industrial standard after fine-tuning due to the problem of movement. Invention patent application number: 202010112073.5, name: A fabric surface defect detection method based on convolutional neural network, which uses a bidirectional segmentation network and is based on the convolution module DepthwiseFire, the unique attention optimization module ARM, the channel attention module SE and the feature fusion module FFM to optimize the convolutional neural network. The small defects shown by chemical fiber fabric defects are difficult to score, making it impossible to achieve high accuracy on fine hair defects; in addition, most models will be affected by factors such as noise data, lighting conditions, and fabric materials in the picture, which will further reduce the accuracy, and the training efficiency is low, which cannot meet the needs of industrial defect detection.
[0004] Therefore, it is necessary to develop a new detection method that can overcome the cold start problem and the need for a large number of defect samples, and can quickly locate defects in complex defect manifestation types and achieve high accuracy. Summary of the invention
[0005] In order to overcome the deficiencies in the prior art, the purpose of the present invention is to provide a method for detecting surface defects of chemical fiber fabrics, which can quickly identify and locate surface defects of chemical fiber fabrics while ensuring accuracy.
[0006] First, a large number of fabric surface images are collected and classified into defect-free and defective types. The pre-trained model is used for fine-tuning. Then, the defective images are reconstructed using the trained probability diffusion denoising model. The reconstructed images are compared with the original images to obtain the defect location and size, forming a heat map.
[0007] The technical solution of the present invention is as follows:
[0008] A method for detecting appearance quality based on feature library compression comprises the following steps:
[0009] Step 1: Divide the chemical fiber fabric images into two categories: defect-free and defective. The normal image set is represented as X = {x1, x2…x i}, and annotate the defect image x′, specifically: for the defective sample image, accurately find the defect area, and then annotate the local defect area. The specific annotation strategy is: the area of the annotated local defect area does not exceed α times the total area of the defect area, 0<α<1.0; it is used to limit the error of manual annotation and avoid the training error caused by manual annotation error;
[0010] Step 2: Build a feature extractor and feature library, specifically:
[0011] Step 2.1: Use WideResNet50 as feature extractor;
[0012] Step 2.2: Transform the normal image x i Input the feature extractor and calculate the receptive field size according to formula (1), and then perform adaptive pooling according to formula (2) to obtain the feature map;
[0013]
[0014] Among them, f p h,w represents a region of size p*p centered at the coordinate (h,w) on the feature map, F i,j Represents the i-th normal image x i The j-th layer feature vector, Φ pool represents adaptive pooling;
[0015] Step 2.3: Take the second-layer feature vector F2(x i ), the fourth layer feature vector F4(x i ), bilinear interpolation is performed on the two layers of features to make the dimensions of the two layers of feature vectors the same; the feature values of layers 2 and 4 can maximize the global features without losing local features;
[0016] Step 2.4: Store the feature vector obtained in step 2.2 into the feature library M. For each normal image x i The eigenvectors of are stored according to formula (3);
[0017]
[0018] Where Z represents the normal image x i The set of feature vectors, F j (x i )=F i,j Represents the j-th layer feature vector of the i-th normal image;
[0019] Step 3: Compress the feature library M, specifically:
[0020] Step 3.1: Randomly select S initial points in the feature library M, calculate the distance between the initial point and all feature points according to formula (4), and add them to the distance matrix R N*S middle;
[0021]
[0022] Among them, D ij Represents the starting point a i and feature point b j The Euclidean distance, N is the number of feature points;
[0023] Step 3.2: Calculate the average distance d from each feature point to the starting point set according to formula (5): avg ;
[0024]
[0025] Step 3.3: Repeat step 3.2 until the average distance from each feature point to the starting point set is obtained, and select the point with the largest average distance to add to the set m;
[0026] Step 3.4: Calculate the distance vector d between all feature points and the newly added points and splice it into the distance matrix R obtained in step 3.1 N*(S+1) middle;
[0027] Step 3.5: Repeat steps 3.2-3.4 until the number of points in set m reaches E% of the total number in M, where E is a natural number greater than zero; set m is the compressed feature library m.
[0028] Step 4: Use the compressed feature library m to locate defects and calculate defect scores, specifically:
[0029] Step 4.1: Input the defect image x′ into the WideResNet50 feature extractor to obtain the feature vector F of the defect image j (x i ′), and stored in the feature library m test middle;
[0030] Step 4.2: According to formula (6), the feature library m test Calculate the features in m to obtain the feature set of the reduced test set and its neighboring feature set m * ;
[0031]
[0032] Among them, the inner optimization function argmin() finds the distance m according to the characteristics of feature library m test The nearest vector set m t, the steps are as follows 3.1-3.5, the outer optimization function argmax() is in Z p (F j (x i ′)) find the feature library m that maximizes the inner optimization result test ;
[0033] Step 4.3: Calculate the defect score s according to formula (7) * , and generate a heat map according to the defect score.
[0034]
[0035] By adopting the above technology, compared with the prior art, the beneficial effects of the present invention are as follows: the present invention utilizes a pre-trained model and a feature library compression algorithm, and solves the problem by reducing the dimension of the feature set into an NP-hard problem, so as to quickly obtain a neighboring feature library, thereby greatly improving the training and detection rates, overcoming the problem of false detection caused by the diversity of defects, and being able to quickly locate defects while meeting industrial detection needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A defect-free image x selected for the embodiment i ;
[0037] Figure 2 Based on Figure 1 The GroundTruth map produced;
[0038] Figure 3 A defective image x′ selected in the embodiment;
[0039] Figure 4 for Figure 3 Heat map generated after defect detection. DETAILED DESCRIPTION
[0040] The specific implementation of the appearance surface defect detection method of the present invention is described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0041] The appearance quality detection method based on feature library compression of the present invention specifically comprises the following steps:
[0042] Step 1: Divide the chemical fiber fabric images into two categories: defect-free and defective. The normal image set is represented as X = {x1, x2…x i},like Figure 1 As shown, the defect image x′ is annotated. The defect image is Figure 3Specifically, for a sample image with defects, the defect area is accurately found, and then the local defect area is marked. The marked area is as follows: Figure 2 As shown, the specific marking strategy is: the area of the marked local defect region shall not exceed α times the total area of the defect region, in this example α = 0.2;
[0043] Step 2: Build a feature extractor and feature library, specifically:
[0044] Step 2.1: Use WideResNet50 as feature extractor;
[0045] Step 2.2: Transform the normal image x i Input the feature extractor and calculate the receptive field size according to formula (1), and then perform adaptive pooling according to formula (2) to obtain the feature map;
[0046]
[0047] Among them, f p h,w represents a region of size p*p centered at the coordinate (h,w) on the feature map, F i,j Represents the i-th normal image x i The j-th layer feature vector, Φ pool represents adaptive pooling;
[0048] Step 2.3: Take the second-layer feature vector F2(x i ), the fourth layer feature vector F4(x i ) is used to represent the global and local features of the feature map, and bilinear interpolation is performed on the two layers of features to make the dimensions of the two layers of feature vectors the same;
[0049] Step 2.4: Store the feature vector obtained in step 2.2 into the feature library M. For each normal image x i The eigenvectors of are stored according to formula (3);
[0050]
[0051] Where Z represents the normal image x i The set of feature vectors, F j (x i )=F i,j Represents the j-th layer feature vector of the i-th normal image;
[0052] Step 3: Perform core set resampling on the feature library M, specifically:
[0053] Step 3.1: Randomly select S initial points in the feature library M, calculate the distance between the initial point and all feature points according to formula (4), and add them to the distance matrix R N*S middle;
[0054]
[0055] Among them, D ij Represents the starting point a i and feature point b j The Euclidean distance, N is the number of feature points;
[0056] Step 3.2: Calculate the average distance d from each feature point to the starting point set according to formula (5): avg ;
[0057]
[0058] Step 3.3: Repeat step 3.2 until the average distance from each feature point to the starting point set is obtained, and select the point with the largest average distance to add to the set m;
[0059] Step 3.4: Calculate the distance vector d between all feature points and the newly added points and splice it into the distance matrix R obtained in step 3.1 N*(S+1) middle;
[0060] Step 3.5: Repeat steps 3.2-3.4 until the number of points in set m reaches E% of the total number in M, where E is a natural number greater than zero. At this time, set m is the compressed library after secondary sampling of the core set;
[0061] Step 4: Use the feature library m after secondary sampling of the core set to locate defects and calculate defect scores, specifically:
[0062] Step 4.1: Select a defect image x′, such as Figure 3 As shown, the defect image x′ is input into the WideResNet50 feature extractor to obtain the feature vector F of the defect image. j (x i ′), and stored in the feature library m test middle;
[0063] Step 4.2: According to formula (6), the feature library m test Calculate the features in m and obtain the feature set m of the reduced test set test ,* and its neighboring feature set m * ;
[0064]
[0065] Among them, the inner optimization function argmin() finds the distance m according to the characteristics of feature library m test The nearest vector set m t , the steps are as follows 3.1-3.5, the outer optimization function argmax() is in Z p (F j (x i ′)) find the feature library m that maximizes the inner optimization result test ;
[0066] Step 4.3: Calculate the defect score s according to formula (7) * , and generate a heat map according to the defect score. The heat map is as follows Figure 4 As shown;
[0067]
[0068] The defective part will appear in the image in a highlighted form, and the rest is the non-defective part, for example Figure 4 The middle defect appears in the lower left position of the figure, and its shape is an oval.
[0069] The contents described in the embodiments of this specification are merely an enumeration of implementation forms of the inventive concept. The protection scope of the present invention should not be regarded as limited to the specific forms described in the embodiments. The protection scope of the present invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims
1. A method for detecting appearance quality based on feature library compression, characterized in that: The steps include: Step 1: Divide the chemical fiber fabric images into two categories: defect-free and defective. The defect-free image set is represented by X = {x1, x2…x i }, and annotate the defect image x′; Step 2: Construct feature extractor and feature library M; Step 3: compress the feature library M; Step 4: Use the compressed feature library m to locate defects and calculate defect scores.
2. The appearance quality detection method based on feature library compression according to claim 1 is characterized in that: The specific steps of labeling the defect image x′ in step 1 are as follows: for a sample image with defects, the defect area is accurately found, and then the local defect area is labeled. The labeling strategy is: the area of the labeled local defect area does not exceed α times the total area of the defect area, 0<α<1.
0.
3. The appearance quality detection method based on feature library compression according to claim 1 is characterized in that: The step 2 is specifically as follows: Step 2.1: Use WideResNet50 as feature extractor; Step 2.2: Transform the defect-free image x i Input the feature extractor and calculate the receptive field size according to formula (1), and then perform adaptive pooling according to formula (2) to obtain the feature map; Among them, f p h,w represents a region of size p*p centered at the coordinate (h,w) on the feature map, F i,j Represents the i-th normal image x i The j-th layer feature vector, Φ pool represents adaptive pooling, (a, b) represents all coordinate points that satisfy the function in formula (1); Step 2.3: Take the second-layer feature vector F2(x i ), the fourth layer feature vector F4(x i ), perform bilinear interpolation on the two layers of features to make the dimensions of the two layers of feature vectors the same; Step 2.4: store the feature vector obtained in step 2.2 into the feature library M. For each defect-free image x i The eigenvectors of are stored according to formula (3); Where Z represents the normal image x i The set of feature vectors, F j (x i )=F i,j Represents the j-th layer feature vector of the i-th normal image.
4. The appearance quality detection method based on feature library compression according to claim 1 is characterized in that: The step 3 is specifically as follows: Step 3.1: Randomly select S initial points in the feature library M, calculate the distance between the initial point and all feature points according to formula (4), and add them to the distance matrix R N*S middle; Among them, D ij Represents the starting point a i and feature point b j The Euclidean distance, N is the number of feature points; Step 3.2: Calculate the average distance d from each feature point to the starting point set according to formula (5): avg ; Step 3.3: Repeat step 3.2 until the average distance from each feature point to the starting point set is obtained, and select the point with the largest average distance to add to the set m; Step 3.4: Calculate the distance vector d between all feature points and the newly added points and splice it into the distance matrix R obtained in step 3.1 N*(S+1) middle; Step 3.5: Repeat steps 3.2-3.4 until the number of points in set m reaches E% of the total number in M, where E is a natural number greater than zero.
5. The appearance quality detection method based on feature library compression according to claim 4 is characterized in that: The step 4 is specifically as follows: Step 4.1: Input the defect image x′ into the WideResNet50 feature extractor, obtain the feature vector of the defect image, and store it in the feature library m test middle; Step 4.2: According to formula (6), the feature library m test Calculate the features in the feature library m to obtain the reduced feature set m of the test set test,* and its neighboring feature set m*; Among them, the inner optimization function argmin() finds the vector set m closest to mtest according to the characteristics of the feature library m t The steps are as follows: 3.1-3.
5. The outer optimization function argmax() finds the feature library m that maximizes the inner optimization result. test ; Step 4.3: Calculate the defect score s* according to formula (7), and generate a heat map according to the defect score; s * =||m test,* -m * ||2 (7)。
Citation Information
Patent Citations
Fabric surface defect detection method based on convolutional neural network
CN111402203A
Chemical fiber spinning cake appearance defect detection method based on improved YOLOV5
CN115222705A
A method and system for online defect detection of chemical fiber filaments
CN116563276B
Cited By
Characteristic point location quality defect identification method for multi-target grading image processing
CN119693374A