Woven fabric density automatic identification universal method based on deep learning
Through deep learning-based methods, automated identification and correction of woven fabric density is achieved, the problems of subjectivity and low efficiency of traditional detection methods are solved, and the accuracy and production efficiency of detection are improved.
Patent Information
- Application Number
- CN202411643727.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-11
AI Technical Summary
Traditional manual detection methods have problems such as strong subjectivity, low efficiency and poor accuracy, and it is difficult to meet the needs of efficient and accurate woven fabric density detection.
The woven fabric density automatic recognition method based on deep learning is adopted, and the image preprocessing, deep learning recognition module and post-processing calculation module are used to realize automated density recognition and correction.
It improves the degree of automation and accuracy of detection, reduces manual intervention, reduces costs, and improves production efficiency.
Smart Images

Figure CN119600340A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence and image analysis and processing, and in particular to a general method for automatic identification of woven fabric density based on deep learning. Background Art
[0002] In the production process of textile enterprises, the warp and weft density of fabrics is regarded as one of the most important structural parameters, and the number of yarns per unit length is usually measured. This process not only affects the strength and appearance quality of the fabric, but is also directly related to production efficiency and cost control. Traditional manual operation methods rely on the subjective judgment of inspectors, who usually determine the warp and weft density of fabrics by observing the fabric with the naked eye or counting with the help of auxiliary tools such as cloth mirrors and density microscopes.
[0003] However, this traditional detection method has many shortcomings. First, manual detection is highly subjective, and different inspectors may have inconsistent results due to personal experience and vision differences. Second, long-term observation can easily make inspectors feel tired, which affects their judgment and reaction speed, leading to potential errors. In addition, manual operation is generally inefficient, especially in mass production, and cannot meet the needs of rapid response. At the same time, traditional image analysis technology performs poorly in terms of controllability and is difficult to effectively capture the subtle features of yarns, further limiting its application in complex fabric structures.
[0004] With the continuous advancement of digital image processing technology, the automatic measurement methods of woven fabric density can be mainly divided into two categories: spatial domain method and frequency domain method. The spatial domain method analyzes the brightness projection curve of the fabric image and uses regional screening technology to identify the gaps between the yarns to calculate the warp and weft yarn density. However, this process is relatively complicated, the steps are cumbersome and time-consuming. Another method is to detect the color mutation of adjacent yarns, identify the edges in the horizontal and vertical directions, and combine the variance projection and correlation coefficient of the sub-image to obtain the fabric density. This method may introduce errors and reduce the accuracy of detection when the color mutation is not obvious.
[0005] The frequency domain method uses Fourier transform to indirectly calculate the density of warp and weft yarns by analyzing the spectrum. Although this method can provide an estimate of the yarn spacing to a certain extent, its periodic characteristics are often not obvious for fabrics with complex textures, and the result is usually only an approximation of the density. In addition, some methods use wavelet transform for analysis, but due to the lack of a unified standard for the number of decomposition layers, there are large differences in the final detection results. Some other technologies rely on position differences to correct the gap position points, but in actual production environments, this method lacks robustness and controllability, and it is difficult to effectively identify yarn gaps, so it is not ideal.
[0006] At the same time, there are differences in the way different materials of woven fabrics are expressed in the market. The output density of cotton / linen / wool woven fabrics is roots / inch, and the density of filament woven fabrics is expressed in the form of roots / cm. Currently, these two major types of materials are mainly distinguished through manual classification. This process not only increases labor consumption, but also has inevitable errors.
[0007] Based on the above analysis, it is obvious that there is an urgent need for a more efficient and accurate automated measurement solution to overcome the limitations of traditional detection methods, improve the detection accuracy and efficiency of warp and weft yarn density, and reduce interference and errors caused by human factors. Summary of the invention
[0008] The purpose of the present invention is to provide a general method for automatic identification of woven fabric density based on deep learning, which solves the problems raised in the above-mentioned background technology.
[0009] Technical Solution
[0010] To achieve the above objectives, the present invention is implemented by the following technical solutions: A general method for automatic identification of woven fabric density based on deep learning, comprising: a. Image preprocessing module
[0011] Collect high-resolution color woven fabric images and convert them into grayscale;
[0012] Automatically identify the inclination angle of the yarn and transform the coordinate points to obtain a tilt-corrected grayscale image;
[0013] Obtain the grayscale projection discrete curve of the image in the longitude and latitude directions and use Gaussian filtering for smoothing to obtain the minimum value point of the discrete data;
[0014] b. Deep learning recognition module
[0015] According to the minimum point, the local image of the corresponding position is extracted, and a large number of positive and negative samples are made to train the binary classification recognition model. The abnormal yarn gap image is identified through the yarn gap recognition network, and the image between the gap points is judged to be the yarn gap. On the yarn, the complete yarn image is also included;
[0016] Train the woven fabric material recognition model to automatically identify whether the input image is cotton, linen, wool or filament woven fabric;
[0017] c. Post-processing calculation module
[0018] The yarn gap points of the image are re-corrected, and the number of gap points after correction is equal to the number A of warp yarns and the number B of weft yarns;
[0019] According to the predicted woven fabric material category, the corresponding formula is used to convert the number of yarns (roots) into the final woven fabric warp density and weft density output.
[0020] Furthermore, the specific steps of the tilt correction method of the image preprocessing module are as follows:
[0021] First, use OpenCV to convert the acquired image into a grayscale image, calculate the histogram distribution of the grayscale image, and arrange the pixel brightness values from small to large. Then, only the 5% of pixels with the smallest brightness are retained, and the values of these pixels are set to 1, while the values of the remaining pixels are set to 0. In this way, a binary image is formed, in which only the brightest pixels are retained for subsequent processing;
[0022] Then, Hough transform is applied to convert the points with pixel value 1 in the binary image from the rectangular coordinate system to the polar coordinate system. The specific conversion formula is:
[0023] r=x cos θ+y sin θ
[0024] In this formula, r represents the vertical distance from the origin to the target line, and θ represents the angle between the x-axis and the target line. Through this conversion method, the pixel points in the binary image can be effectively mapped from the image space to the parameter space (r,θ), and the transformed coordinate points can be used to obtain the corrected grayscale image.
[0025] Finally, the obtained parameter space (r, θ) is further divided into a specific number of grids. For this purpose, it is necessary to define the increment size of r and θ, namely Δr and Δθ. By traversing each point in the image, for each θ value, the corresponding r value is calculated using the above formula, and the corresponding grid value is increased by 1 in the (r, θ) grid, which is equivalent to cumulative statistics of the (r, θ) parameter space. By counting all traversed points, setting a threshold to filter out grids with a small number of statistics, and finally locating the target grid area with the largest number of statistics, the inclination angle of the yarn can be accurately obtained. The advantage of this method is that it can effectively focus on the main direction of the yarn in the image and reduce the influence of noise, thereby improving the detection accuracy of the yarn inclination angle.
[0026] Furthermore, taking negative skew as an example, the formula is as follows:
[0027]
[0028] All coordinate points in the grayscale image are transformed by the above formula to achieve the purpose of correcting the yarn. The grayscale projection discrete curve in the warp and weft directions is obtained on the corrected image. The grayscale projection discrete curve in the warp and weft directions is obtained on the corrected image, and the minimum value is extracted by Gaussian smoothing as the recognition result of the preliminary gap point of the woven fabric.
[0029] Furthermore, the preliminary gap point recognition result of the woven fabric is obtained, and the grayscale projection discrete curve of the same yarn direction is obtained. The warp discrete curve is obtained by formula (1-1), and the weft discrete curve is obtained by formula (1-2):
[0030] Gaussian filtering is used for smoothing, and the minimum points of all discrete data are obtained. Local images are extracted through the minimum position points, and a large number of positive and negative samples are produced to provide for deep learning model training.
[0031] Furthermore, a large number of positive and negative samples are prepared to train the yarn gap state recognition model, and the specific steps of the method are as follows:
[0032] Sample selection rule: If the coordinate list of the auxiliary line position (i.e., the minimum value point of the discrete data described in claim 4) is [122, 167, 258, 313, 323, 356, 390, 460]
[0033] a. Positive sample selection:
[0034] Select all auxiliary line gaps (122,167)(167,258)(258,313)(313,323)(323,356)(356,390)(390,460) as positive sample labels
[0035] In all the gaps above, 20 smaller intervals are randomly selected. For example, in (122,167): (134,160) (124,134) (145,165) ..... (123,160) The selected interval lengths that account for more than 70% of the length of (122, 167) are positive sample labels, and those below are negative sample labels.
[0036] b. Negative sample selection:
[0037] Cut out the image around each auxiliary line gap. For example, 122, pixels are selected in the order of positive and negative 2 to 7: (120,124) (119,125) (118,126) (117,127) (116,128) (115,129) are all set as negative samples
[0038] The above operations are performed on batch data to obtain a large number of positive and negative samples and train the yarn gap state binary classification model.
[0039] Furthermore, the training of the yarn gap state recognition model is carried out in the following specific steps:
[0040] Obtain the positive and negative sample image dataset described in claim 5, and use ResNet-18 as the basic architecture to build a binary classification deep learning model. ResNet18 consists of 18 layers, and the specific structure is: input layer, multiple residual blocks, global average pooling layer and fully connected layer. The convolution layer of each residual block uses Batch Normalization and ReLU activation function. ResNet18 makes the training of deep convolutional networks more efficient and stable by introducing residual learning and jump connections. The loss function used in the network is the cross-entropy loss function.
[0041] The yarn gap recognition network is used to identify abnormal yarn gap images, and the yarn gap points in the image are re-corrected. If it is predicted as a positive sample, it will not be processed. If it is predicted as a negative sample, it will be merged with the surrounding auxiliary line gaps until it is predicted as a positive sample, and the unnecessary auxiliary lines will be deleted.
[0042] Furthermore, the re-correction of the yarn gap points of the image is divided into two parts:
[0043] Add auxiliary lines to the missing parts
[0044] a. Method for judging abnormal missing parts
[0045] For example, the initial auxiliary line position list Au[122,167,258,313,323,356,390,460]
[0046] The lengths of all auxiliary line gaps are 45, 91, 55, 10, 33, 34, 70, and the calculated mean is 48. All gap lengths divided by M greater than 1.5 are abnormal vacancies, and (167, 258) is an abnormal position. The yarn recognition model trained in step 6 is used to identify the newly added gaps. When the probability of judging it as a yarn is greater than 0.8, this gap position is retained.
[0047] b. Add auxiliary lines to the blank part:
[0048] Auxiliary lines are added between 167 and 258 in steps of M to obtain (167, 215, 258). The yarn recognition model is used to identify the newly added gap. When the probability of judging it as a yarn is greater than 0.8, this auxiliary line is added.
[0049] c. Get the latest auxiliary line position point Au list
[0050] Delete abnormal auxiliary lines
[0051] a. Abnormal auxiliary line judgment method:
[0052] The new Au[122,167,215,258,313,323,356,390,460] is obtained through the fifth step. The gap lengths of all auxiliary lines are 45, 48, 43, 55, 10, 33, 34, 70. The calculated mean M is 48, and all gap lengths with a gap length less than 0.7 divided by M are abnormal parts. (313,323) belongs to the abnormal position.
[0053] b. Solution for deleting auxiliary lines from abnormal parts:
[0054] The (313,323) partial image uses the yarn recognition model to identify the newly added gap. When the probability of judging it as a yarn is less than 0.8, the abnormal auxiliary line 323 is deleted.
[0055] c. Get the latest list of auxiliary line position points Au.
[0056] Furthermore, the woven fabric material recognition model of the deep learning recognition module is specifically implemented as follows:
[0057] Cotton, linen, and wool woven fabrics are taken as one type of samples, and filament woven fabrics are taken as another type of samples. EfficientnetB0 is used as the basic architecture to build a binary classification deep learning model. EfficientB0 can automatically adjust according to the complexity of the input through the deep separable convolution and mobile inverted bottleneck convolution (Mobile Inverted Bottleneck Convolution) modules, achieving a good balance between computational efficiency and classification accuracy. Consistent with claim 6, the loss function used in training is the cross entropy loss function.
[0058] Furthermore, the method of final output of the density by the post-processing calculation module is as follows:
[0059] First, according to the method described in claim 7, the position of the gap point is adjusted, the number of yarns is increased or decreased, and the final number of yarns A (warp) and B (weft) is obtained; secondly, in combination with the material identification result described in claim 8, the type of woven fabric material is automatically predicted, and the number of yarns is converted into the final warp density and weft density output of the woven fabric using a preset formula, wherein cotton, linen, and wool woven fabrics are calculated according to formulas (2-1) (2-2), and filament woven fabrics are calculated according to (3-1) (3-2).
[0060] The present invention provides a general method for automatic identification of woven fabric density based on deep learning. It has the following beneficial effects:
[0061] This general method for automatic identification of woven fabric density based on deep learning has the following advantages: 1. High degree of automation: The present invention realizes end-to-end automatic density identification based on deep learning technology, reduces manual intervention, and improves detection efficiency and accuracy. Compared with traditional methods, the present invention avoids the steps of manual proofreading and material classification, making the entire identification process more efficient. 2. High-precision identification: By analyzing images through deep learning algorithms, the present invention can extract subtle features, achieve high-precision density identification and correction, and provide accurate density expressions such as roots / cm or roots / inch. This accuracy is significantly better than traditional manual measurement methods, ensuring the consistency and reliability of the results. 3. Reduce costs: By reducing manual operations and improving efficiency, the present invention helps to reduce labor costs and material losses, making enterprises more economical in the production process. 4. Scalability: The technical framework of the present invention has good scalability. In the future, the recognition accuracy and range can be improved by adding more deep learning models or improving algorithms to adapt to more complex industrial applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 Schematic diagram of the automatic identification process of the warp and weft yarn density of the woven fabric of the present invention;
[0063] Figure 2 It is a schematic diagram of the end-to-end network framework of the automatic identification process of woven fabric density in the present invention;
[0064] Figure 3 A schematic diagram of a residual module in a yarn gap recognition network in the present invention;
[0065] Figure 4 is the RGB image of the woven fabric collected in the present invention, with a pixel size of 1024×1024;
[0066] Figure 5 For the present invention Figure 2 Binarized image obtained by applying threshold processing;
[0067] Figure 6 It is a polar coordinate schematic diagram of a negatively skewed yarn image in the present invention;
[0068] Figure 7 It is a schematic diagram of the minimum value points before and after the smoothing of the latitudinal grayscale projection discrete curve in the present invention;
[0069] Figure 8 It is a schematic diagram of the minimum value points before and after the smoothing of the longitudinal grayscale projection discrete curve in the present invention;
[0070] Fig. 9 is the RGB image of the woven fabric collected in the present invention, with a pixel size of 1024×1024;
[0071] Fig.10A binary image obtained by applying threshold processing in the present invention;
[0072] Fig.11 It is a schematic diagram of the minimum value points before and after the smoothing of the latitudinal grayscale projection discrete curve in the present invention;
[0073] Fig.12 It is a schematic diagram of the minimum point before and after smoothing of the longitudinal grayscale projection discrete curve in the present invention. DETAILED DESCRIPTION
[0074] like Figure 1-12 As shown, the embodiment of the present invention provides a general method for automatic identification of woven fabric density based on deep learning, including embodiment 1:
[0075] (1) A woven fabric RGB color image is collected as a test sample, such as Figure 2 As shown. The scan resolution is set to 96dpi, and the image size is 1024 pixels × 1024 pixels, which corresponds to an actual physical size of 11.29mm × 11.29mm. The vertical direction represents the warp and the horizontal direction represents the weft. Use OpenCV's grayscale mode cv2.IMREAD_GRAYSCALE to read the image and convert the RGB image to a single-channel grayscale image.
[0076] (2) Binarize the grayscale image. The specific method is to set the threshold to retain the 5% brightest pixels. The result is as follows: Figure 5 Then, the weft angle θweft of the yarn is detected on the binary image using Hough transform, which is 89.80° (retain two decimal places), and the warp angle θwarp is 89.00°, and the corrected grayscale image is obtained by coordinate point transformation. The polar coordinate system involved in Hough transform is as follows Figure 6 As shown in (left), taking the yarn as an example with negative deflection, the position of θweft is Figure 6 (right) shown.
[0077] (3) Obtain the grayscale projection discrete curve of the same yarn direction, and use Gaussian filtering for smoothing, and obtain the minimum value points of all discrete data. Taking the weft yarn as an example, apply formula (1-1) to obtain the grayscale projection discrete curve and find the minimum value point, such as Figure 7 (left) shows the minimum value of discrete data after Gaussian filtering. Figure 7 (Right). The minimum point of the discrete curve of the grayscale projection of the warp yarn is as follows Figure 8 As shown above,
[0078] The minimum point result after Gaussian filtering is shown in Figure 8 (Down).
[0079] (4) According to the minimum points of the discrete data after Gaussian filtering, extract the local images of the corresponding positions. Use the pre-trained resnet18 binary classification model to predict which of these local images are abnormal yarn gap images, add the missing part position points (when the model determines that the probability of yarn is greater than 0.8), and delete the abnormal values. Those predicted to be normal are not processed, and the number of minimum points finally obtained is the number of yarns in this direction. Example 1 finally obtains 48 warp yarns and 36 weft yarns.
[0080] (5) Example 1 inputs the binary classification recognition network for woven fabric materials, and the prediction result is filament woven fabric.
[0081] (6) Convert the number of yarns into density. According to the traditional definition: the density of cotton / linen / wool woven fabrics is defined as the number of warp yarns per inch / the number of weft yarns per inch, and the density of filament woven fabrics is the number of warp yarns per cm / the number of weft yarns per cm. 1 inch = 25.4 mm, 1 cm = 10 mm.
[0082] Example 1 belongs to a filament woven fabric. According to formula (2-3), the warp density is (10×48) / 11.29=42.52 (roots / cm, retaining two decimal places), and according to formula (2-4), the weft density is (10×36) / 11.29=31.89 (roots / cm).
[0083] Embodiment 2:
[0084] (1) A woven fabric RGB color image is collected as a test sample, such as Fig. 9 The scan resolution is set to 96dpi, and the image size is 1024 pixels × 1024 pixels, which corresponds to an actual physical size of 11.29mm × 11.29mm. Use OpenCV to read the image and convert the RGB image to a single-channel grayscale image. Binarize the grayscale image, and the result is as follows: Fig.10 Then, Hough transform is used to perform tilt correction on the binary image.
[0085] (2) Obtain the grayscale projection discrete curve of the same yarn direction and use Gaussian filtering for smoothing to obtain the minimum value points of all discrete data. Fig.11 As shown; the minimum points before and after the longitudinal smoothing are as follows Fig.12 shown.
[0086] (3) Taking the weft yarn as an example, according to the minimum point position Au[28,57,76,114,141,154,162,196,210,239,251,282,289,302,325,366,389,404,449,494,529,569,581,601,618,634,659,700,726,741,775,786,821,857,866,898,939,951,986,1019] of the discrete data after Gaussian filtering, the local image of the corresponding position is extracted. The pre-trained resnet18 binary classification model is used to predict which of these local images are abnormal yarn gap images, add the missing part position points [426, 471, 549, 918], and delete the outliers [154, 162, 210, 251, 289, 302, 404, 581, 634, 741, 786, 866, 951]. Those predicted to be normal are not processed, and the final yarn position is Au[28,57,76,114,141,196,239,282,325,366,389,426,471,449,549,494,529,569,601,618,659,700,726,775,821,918,857,898,939,986,1019]. The number of minimum points 31 is the number of yarns in this direction. The same process is used to calculate the number of warp yarns to be 48.
[0087] (4) Example 2 inputs the binary classification recognition network for woven fabric materials, and the prediction results are cotton / linen / wool woven fabrics.
[0088] Convert the number of yarns into density. According to the traditional definition: the density of cotton / linen / wool woven fabrics is defined as the number of warp yarns in 1 inch / the number of weft yarns in 1 inch, 1 inch = 25.4 mm, and the physical size of the image is 11.29 mm × 11.29 mm. Example 2 belongs to cotton woven fabrics. According to formula (2-1), the warp density is (25.4 × 48) / 11.29 = 107.98 (threads / inch, retaining two decimal places), and according to formula (2-2), the weft density is (25.4 × 31) / 11.29 = 69.74 (threads / inch).
[0089] A general method for automatic identification of woven fabric density based on deep learning, including: a. Image preprocessing module
[0090] Collect high-resolution color woven fabric images and convert them into grayscale;
[0091] Automatically identify the inclination angle of the yarn and transform the coordinate points to obtain a tilt-corrected grayscale image;
[0092] Obtain the grayscale projection discrete curve of the image in the longitude and latitude directions and use Gaussian filtering for smoothing to obtain the minimum value point of the discrete data;
[0093] b. Deep learning recognition module
[0094] According to the minimum point, the local image of the corresponding position is extracted, and a large number of positive and negative samples are made to train the binary classification recognition model. The abnormal yarn gap image is identified through the yarn gap recognition network, and the image between the gap points is judged to be the yarn gap. On the yarn, the complete yarn image is also included;
[0095] Train the woven fabric material recognition model to automatically identify whether the input image is cotton, linen, wool or filament woven fabric;
[0096] c. Post-processing calculation module
[0097] The yarn gap points of the image are re-corrected, and the number of gap points after correction is equal to the number A of warp yarns and the number B of weft yarns;
[0098] According to the predicted woven fabric material category, the corresponding formula is used to convert the number of yarns (roots) into the final woven fabric warp density and weft density output.
[0099] The specific steps of the tilt correction method described in the image preprocessing module are as follows:
[0100] First, use OpenCV to convert the acquired image into a grayscale image, calculate the histogram distribution of the grayscale image, and arrange the pixel brightness values from small to large. Then, only the 5% of pixels with the smallest brightness are retained, and the values of these pixels are set to 1, while the values of the remaining pixels are set to 0. In this way, a binary image is formed, in which only the brightest pixels are retained for subsequent processing;
[0101] Then, Hough transform is applied to convert the points with pixel value 1 in the binary image from the rectangular coordinate system to the polar coordinate system. The specific conversion formula is:
[0102] r=xcosθ+ysinθ
[0103] In this formula, r represents the vertical distance from the origin to the target line, and θ represents the angle between the x-axis and the target line. Through this conversion method, the pixel points in the binary image can be effectively mapped from the image space to the parameter space (r,θ), and the transformed coordinate points can be used to obtain the corrected grayscale image.
[0104] Finally, the obtained parameter space (r, θ) is further divided into a specific number of grids. For this purpose, it is necessary to define the increment size of r and θ, namely Δr and Δθ. By traversing each point in the image, for each θ value, the corresponding r value is calculated using the above formula, and the corresponding grid value is increased by 1 in the (r, θ) grid, which is equivalent to cumulative statistics of the (r, θ) parameter space. By counting all traversed points, setting a threshold to filter out grids with a small number of statistics, and finally locating the target grid area with the largest number of statistics, the inclination angle of the yarn can be accurately obtained. The advantage of this method is that it can effectively focus on the main direction of the yarn in the image and reduce the influence of noise, thereby improving the detection accuracy of the yarn inclination angle.
[0105] Taking negative skew as an example, the formula is as follows:
[0106]
[0107] All coordinate points in the grayscale image are transformed by the above formula to achieve the purpose of correcting the yarn. The grayscale projection discrete curve in the warp and weft directions is obtained on the corrected image. The grayscale projection discrete curve in the warp and weft directions is obtained on the corrected image, and the minimum value is extracted by Gaussian smoothing as the recognition result of the preliminary gap point of the woven fabric.
[0108] Obtain the preliminary gap point recognition results of the woven fabric, obtain the grayscale projection discrete curve of the same yarn direction, the warp discrete curve acquisition formula (1-1), the weft discrete curve acquisition formula (1-2):
[0109] Gaussian filtering is used for smoothing, and the minimum points of all discrete data are obtained. Local images are extracted through the minimum position points, and a large number of positive and negative samples are produced to provide for deep learning model training.
[0110] A large number of positive and negative samples are prepared to train the yarn gap state recognition model. The specific steps of the method are as follows:
[0111] Sample selection rule: If the coordinate list of the auxiliary line position (i.e., the minimum value point of the discrete data described in claim 4) is [122, 167, 258, 313, 323, 356, 390, 460]
[0112] a. Positive sample selection:
[0113] Select all auxiliary line gaps (122,167)(167,258)(258,313)(313,323)(323,356)(356,390)(390,460) as positive sample labels
[0114] In all the gaps above, 20 smaller intervals are randomly selected. For example, in (122,167): (134,160) (124,134) (145,165) ..... (123,160) The selected interval lengths that account for more than 70% of the length of (122, 167) are positive sample labels, and those below are negative sample labels.
[0115] b. Negative sample selection:
[0116] Cut out the image around each auxiliary line gap. For example, 122, pixels are selected in the order of positive and negative 2 to 7: (120,124) (119,125) (118,126) (117,127) (116,128) (115,129) are all set as negative samples
[0117] The above operations are performed on batch data to obtain a large number of positive and negative samples and train the yarn gap state binary classification model.
[0118] The yarn gap state recognition model is trained, and the specific steps of the method are as follows:
[0119] Obtain the positive and negative sample image dataset described in claim 5, and use ResNet-18 as the basic architecture to build a binary classification deep learning model. ResNet18 consists of 18 layers, and the specific structure is: input layer, multiple residual blocks, global average pooling layer and fully connected layer. The convolution layer of each residual block uses Batch Normalization and ReLU activation function. ResNet18 makes the training of deep convolutional networks more efficient and stable by introducing residual learning and jump connections. The loss function used in the network is the cross-entropy loss function.
[0120] The yarn gap recognition network is used to identify abnormal yarn gap images, and the yarn gap points in the image are re-corrected. If it is predicted as a positive sample, it will not be processed. If it is predicted as a negative sample, it will be merged with the surrounding auxiliary line gaps until it is predicted as a positive sample, and the unnecessary auxiliary lines will be deleted.
[0121] Re-correcting the yarn gap points of the image is divided into two parts:
[0122] Add auxiliary lines to the missing parts
[0123] a. Method for judging abnormal missing parts
[0124] For example, the initial auxiliary line position list Au[122,167,258,313,323,356,390,460]
[0125] The lengths of all auxiliary line gaps are 45, 91, 55, 10, 33, 34, 70, and the calculated mean is 48. All gap lengths divided by M greater than 1.5 are abnormal vacancies, and (167, 258) is an abnormal position. The yarn recognition model trained in step 6 is used to identify the newly added gaps. When the probability of judging it as a yarn is greater than 0.8, this gap position is retained.
[0126] b. Add auxiliary lines to the blank part:
[0127] Auxiliary lines are added between 167 and 258 in steps of M to obtain (167, 215, 258). The yarn recognition model is used to identify the newly added gap. When the probability of judging it as a yarn is greater than 0.8, this auxiliary line is added.
[0128] c. Get the latest auxiliary line position point Au list
[0129] Delete abnormal auxiliary lines
[0130] a. Abnormal auxiliary line judgment method:
[0131] The new Au[122,167,215,258,313,323,356,390,460] is obtained through the fifth step. The gap lengths of all auxiliary lines are 45, 48, 43, 55, 10, 33, 34, 70. The calculated mean M is 48, and all gap lengths with a gap length less than 0.7 divided by M are abnormal parts. (313,323) belongs to the abnormal position.
[0132] b. Solution for deleting auxiliary lines from abnormal parts:
[0133] The (313,323) partial image uses the yarn recognition model to identify the newly added gap. When the probability of judging it as a yarn is less than 0.8, the abnormal auxiliary line 323 is deleted.
[0134] c. Get the latest list of auxiliary line position points Au.
[0135] The woven fabric material recognition model described in the deep learning recognition module is specifically implemented as follows:
[0136] Cotton, linen, and wool woven fabrics are taken as one type of samples, and filament woven fabrics are taken as another type of samples. EfficientnetB0 is used as the basic architecture to build a binary classification deep learning model. EfficientB0 can automatically adjust according to the complexity of the input through the deep separable convolution and mobile inverted bottleneck convolution (Mobile Inverted Bottleneck Convolution) modules, achieving a good balance between computational efficiency and classification accuracy. Consistent with claim 6, the loss function used in training is the cross entropy loss function.
[0137] The method for the final output of the density in the post-processing calculation module is as follows:
[0138] First, according to the method described in claim 7, the position of the gap point is adjusted, the number of yarns is increased or decreased, and the final number of yarns A (warp) and B (weft) is obtained; secondly, in combination with the material identification result described in claim 8, the type of woven fabric material is automatically predicted, and the number of yarns is converted into the final warp density and weft density output of the woven fabric using a preset formula, wherein cotton, linen, and wool woven fabrics are calculated according to formulas (2-1) (2-2), and filament woven fabrics are calculated according to (3-1) (3-2).
Claims
1. A general method for automatic identification of woven fabric density based on deep learning, comprising: a. Image preprocessing module Collect high-resolution color woven fabric images and convert them into grayscale; Automatically identify the inclination angle of the yarn and transform the coordinate points to obtain a tilt-corrected grayscale image; Obtain the grayscale projection discrete curve of the image in the longitude and latitude directions and use Gaussian filtering for smoothing to obtain the minimum value point of the discrete data; b. Deep learning recognition module According to the minimum point, the local image of the corresponding position is extracted, and a large number of positive and negative samples are made to train the binary classification recognition model. The abnormal yarn gap image is identified through the yarn gap recognition network, and the image between the gap points is judged to be the yarn gap. On the yarn, the complete yarn image is also included; Train the woven fabric material recognition model to automatically identify whether the input image is cotton, linen, wool or filament woven fabric; c. Post-processing calculation module The yarn gap points of the image are re-corrected, and the number of gap points after correction is equal to the number A of warp yarns and the number B of weft yarns; According to the predicted woven fabric material category, the corresponding formula is used to convert the number of yarns (roots) into the final woven fabric warp density and weft density output.
2. The general method for automatic identification of woven fabric density based on deep learning according to claim 1, characterized in that: The specific steps of the tilt correction method in the image preprocessing module are as follows: First, use OpenCV to convert the acquired image into a grayscale image, calculate the histogram distribution of the grayscale image, and arrange the pixel brightness values from small to large. Then, only the 5% of pixels with the smallest brightness are retained, and the values of these pixels are set to 1, while the values of the remaining pixels are set to 0. In this way, a binary image is formed, in which only the brightest pixels are retained for subsequent processing; Then, Hough transform is applied to convert the points with pixel value 1 in the binary image from the rectangular coordinate system to the polar coordinate system. The specific conversion formula is: r=xcosθ+ysinθ In this formula, r represents the vertical distance from the origin to the target line, and θ represents the angle between the x-axis and the target line. Through this conversion method, the pixel points in the binary image can be effectively mapped from the image space to the parameter space (r,θ), and the transformed coordinate points can be used to obtain the corrected grayscale image. Finally, the obtained parameter space (r, θ) is further divided into a specific number of grids. For this purpose, it is necessary to define the increment size of r and θ, namely Δr and Δθ. By traversing each point in the image, for each θ value, the corresponding r value is calculated using the above formula, and the corresponding grid value is increased by 1 in the (r, θ) grid, which is equivalent to cumulative statistics of the (r, θ) parameter space. By counting all traversed points, setting a threshold to filter out grids with a small number of statistics, and finally locating the target grid area with the largest number of statistics, the inclination angle of the yarn can be accurately obtained. The advantage of this method is that it can effectively focus on the main direction of the yarn in the image and reduce the influence of noise, thereby improving the detection accuracy of the yarn inclination angle.
3. The general method for automatic identification of woven fabric density based on deep learning according to claim 2, characterized in that: Taking negative skew as an example, the formula is as follows: All coordinate points in the grayscale image are transformed by the above formula to achieve the purpose of correcting the yarn. The grayscale projection discrete curve in the warp and weft directions is obtained on the corrected image. The grayscale projection discrete curve in the warp and weft directions is obtained on the corrected image, and the minimum value is extracted by Gaussian smoothing as the recognition result of the preliminary gap point of the woven fabric.
4. The general method for automatic identification of woven fabric density based on deep learning according to claim 3 is characterized in that: The preliminary gap point recognition result of the woven fabric is obtained, and the grayscale projection discrete curve of the same yarn direction is obtained. The warp discrete curve is obtained by formula (1-1), and the weft discrete curve is obtained by formula (1-2): Gaussian filtering is used for smoothing, and the minimum points of all discrete data are obtained. Local images are extracted through the minimum position points, and a large number of positive and negative samples are produced to provide for deep learning model training.
5. The general method for automatic identification of woven fabric density based on deep learning according to claim 4 is characterized in that: The method of preparing a large number of positive and negative samples and training the yarn gap state recognition model has the following specific steps: Sample selection rule: If the coordinate list of the auxiliary line position (i.e., the minimum value point of the discrete data described in claim 4) is [122, 167, 258, 313, 323, 356, 390, 460] a. Positive sample selection: Select all auxiliary line gaps (122,167)(167,258)(258,313)(313,323)(323,356)(356,390)(390,460) as positive sample labels In all the gaps above, 20 smaller intervals are randomly selected. For example, in (122,167): (134,160) (124,134) (145,165) ..... (123,160) The selected interval lengths that account for more than 70% of the length of (122, 167) are positive sample labels, and those below are negative sample labels. b. Negative sample selection: Cut out the image around each auxiliary line gap. For example, 122, pixels are selected in the order of positive and negative 2 to 7: (120,124) (119,125) (118,126) (117,127) (116,128) (115,129) are all set as negative samples The above operations are performed on batch data to obtain a large number of positive and negative samples and train the yarn gap state binary classification model.
6. The general method for automatic identification of woven fabric density based on deep learning according to claim 5 is characterized in that: The specific steps of the method for training the yarn gap state recognition model are as follows: Obtain the positive and negative sample image dataset described in claim 5, and use ResNet-18 as the basic architecture to build a binary classification deep learning model. ResNet18 consists of 18 layers, and the specific structure is: input layer, multiple residual blocks, global average pooling layer and fully connected layer. The convolution layer of each residual block uses Batch Normalization and ReLU activation function. ResNet18 makes the training of deep convolutional networks more efficient and stable by introducing residual learning and jump connections. The loss function used in the network is the cross-entropy loss function. The yarn gap recognition network is used to identify abnormal yarn gap images, and the yarn gap points in the image are re-corrected. If it is predicted as a positive sample, it will not be processed. If it is predicted as a negative sample, it will be merged with the surrounding auxiliary line gaps until it is predicted as a positive sample, and the unnecessary auxiliary lines will be deleted.
7. The general method for automatic identification of woven fabric density based on deep learning according to claim 6, characterized in that: The re-correction of the yarn gap points of the image is divided into two parts: Add auxiliary lines to the missing parts a. Method for judging abnormal missing parts For example, the initial auxiliary line position list Au[122,167,258,313,323,356,390,460] has all auxiliary line gap lengths of 45, 91, 55, 10, 33, 34, 70, and the calculated mean is 48. All gap lengths divided by M greater than 1.5 are abnormal vacancies, and (167,258) is an abnormal position. Use the yarn recognition model trained in step 6 to identify the newly added gaps. When the probability of judging it as a yarn is greater than 0.8, keep this gap position. b. Add auxiliary lines to the blank part: Auxiliary lines are added between 167 and 258 in steps of M to obtain (167, 215, 258). The yarn recognition model is used to identify the newly added gap. When the probability of judging it as a yarn is greater than 0.8, this auxiliary line is added. c. Get the latest auxiliary line position point Au list Delete abnormal auxiliary lines a. Abnormal auxiliary line judgment method: The new Au[122,167,215,258,313,323,356,390,460] is obtained through the fifth step. The gap lengths of all auxiliary lines are 45, 48, 43, 55, 10, 33, 34, 70. The calculated mean M is 48, and all gap lengths with a gap length less than 0.7 divided by M are abnormal parts. (313,323) belongs to the abnormal position. b. Solution for deleting auxiliary lines from abnormal parts: The (313,323) partial image uses the yarn recognition model to identify the newly added gap. When the probability of judging it as a yarn is less than 0.8, the abnormal auxiliary line 323 is deleted. c. Get the latest list of auxiliary line position points Au.
8. The general method for automatic identification of woven fabric density based on deep learning according to claim 1, characterized in that: The woven fabric material recognition model of the deep learning recognition module is specifically implemented as follows: Cotton, linen, and wool woven fabrics were selected as one type of sample, and filament woven fabrics were selected as another type of sample. EfficientnetB0 was used as the basic architecture to build a binary classification deep learning model. EfficientB0 uses the depthwise separable convolution and mobile inverted bottleneck convolution modules to automatically adjust according to the complexity of the input, achieving a good balance between computational efficiency and classification accuracy. Consistent with claim 6, the loss function used in training is the cross entropy loss function.
9. The general method for automatic identification of woven fabric density based on deep learning according to claim 1, characterized in that: The method for the final output of the density in the post-processing calculation module is as follows: First, according to the method described in claim 7, the position of the gap point is adjusted, the number of yarns is increased or decreased, and the final number of yarns A (warp) and B (weft) is obtained; secondly, in combination with the material identification result described in claim 8, the type of woven fabric material is automatically predicted, and the number of yarns is converted into the final warp density and weft density output of the woven fabric using a preset formula, wherein cotton, linen, and wool woven fabrics are calculated according to formulas (2-1) (2-2), and filament woven fabrics are calculated according to (3-1) (3-2).
Citation Information
Cited By
Intelligent quality inspection double-engine system and device for industrial impregnated fabric
CN121053057A
Method and system for detecting yarn density of three-dimensional woven preform
CN121639689A
Method and system for measuring fabric weave structure parameters
CN121661043A