Defect detection method for gradient texture fabric

Through the multi-constraint feature extraction and feature fusion processing module, combined with the multi-layer perceptron, the defect characteristics in the gradient texture fabric are identified, which solves the problem of poor detection effect of gradient texture fabric defects in the existing technology and significantly improves the accuracy of detection. and reliability.

CN118429341BActive Publication Date: 2024-09-20JIANGSU BRANCH OF CHINA ACAD OF MASCH SCI & TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410885619.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-09-20
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

The existing computer vision-based defect detection methods for gradient texture fabrics are not ideal and have a high false detection rate, making it difficult to accurately identify the defect features in gradient texture fabrics.

Method used

The multi-constraint feature extraction module is used to process the image, output the defect pixel point set, and input it into the feature fusion processing module. The defect detail features are obtained through the multi-layer perceptron, and the defect type, quantity and area are identified.

Benefits of technology

It improves the accuracy of defect detection in gradient texture fabrics, reduces the missed detection rate and false detection rate, and can more accurately identify the defect characteristics in gradient texture fabrics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429341B
    Figure CN118429341B
Patent Text Reader

Abstract

The present invention discloses a defect detection method for a gradient texture fabric, comprising: collecting an image Z of the gradient texture fabric; processing the image Z using a multi-constraint feature extraction module, and outputting a defect pixel point set T of the image Z; inputting the defect pixel point set T into a feature fusion processing module to obtain a defect position feature Y1 and a defect type feature Y2; recalibrating the defect position feature Y1 and the defect type feature Y2 to obtain calibration features #imgabs0# and #imgabs1#, respectively, and splicing the calibration features #imgabs2# and #imgabs3# in the channel dimension to obtain a fusion feature #imgabs4#; then inputting the fusion feature into a multi-layer perceptron to output a final defect detail feature Y3; and obtaining the defect type, the number corresponding to each defect type, and the area of ​​each defect of the gradient texture fabric according to the defect detail feature Y3. The present invention can accurately identify the defect features existing in the gradient texture fabric.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of defect detection, and in particular to a defect detection method for gradient texture fabrics. Background Art

[0002] Gradient texture fabric is a common and important material in the textile industry. Due to the gradient characteristics of its texture, this kind of fabric is prone to various types of defects during the production process, such as color difference, thread breakage, weaving defects, etc. These defects not only affect the appearance and quality of the product, but also cause economic losses. Therefore, it is necessary to detect gradient texture fabrics. At present, the detection of fabric defects mainly relies on computer vision technology. Although the existing fabric defect detection method based on computer vision can achieve good results for the defect detection of solid color fabrics. However, since the gradient characteristics of gradient texture fabrics are more complex than those of solid color fabrics, the existing detection method is not ideal for the defect detection of gradient texture fabrics, and the false detection rate is high. Summary of the invention

[0003] The technical problem to be solved by the present invention is: how to improve the accuracy of defect detection on gradient texture fabrics.

[0004] To this end, the present invention provides a method for detecting defects in a gradient texture fabric, which can accurately identify defect features existing in the gradient texture fabric.

[0005] The technical solution adopted by the present invention to solve the technical problem is: a method for detecting defects of gradient texture fabrics, comprising: S1, collecting an image Z of the gradient texture fabric; S2, processing the image Z using a multi-constraint feature extraction module, outputting a defect pixel point set T of the image Z, and a defect feature recognition threshold , is the preliminary statistical threshold, Yes The constraint function is represents the constraint coefficient; S3, inputting the defect pixel point set T into the feature fusion processing module to obtain the defect position feature Y1 and the defect type feature Y2; and recalibrating the defect position feature Y1 and the defect type feature Y2 to obtain the calibration feature and , the calibration feature and Concatenate in the channel dimension to get fusion features ; Then input the fusion feature into the multi-layer perceptron to output the final defect detail feature Y3; S4, according to the defect detail feature Y3, obtain the defect type of the gradient texture fabric, the number corresponding to each defect type, and the area of ​​each defect.

[0006] Furthermore, step S2 specifically includes:

[0007] S21, extracting the gray value of each pixel point of the image Z , Indicates pixel coordinates;

[0008] S22. Calculate preliminary statistical threshold , where W represents the number of pixels and C is the threshold adjustment constant;

[0009] S23, obtaining edge constraints of each pixel: ;

[0010] S24. Obtain the local contrast constraint of each pixel:

[0011] , Represents the pixel mean of image Z;

[0012] S25. Calculation constraint function , , Represent the weight factors of edge constraint and local contrast constraint respectively;

[0013] S26. Identify threshold value based on defect characteristics Obtain the defective pixel set T of image Z.

[0014] Furthermore, in step S3, the process of acquiring the defect position feature Y1 includes:

[0015] The defective pixel set T is expressed as The three-dimensional convolutional layer input tensor of , c represents the number of channels, h, w represent the height and width of the spatial dimension respectively; The information space Q, feature space M and actual feature value A are mapped to three spaces through three different convolution layers: the information space Q that needs to be paid attention to at the current position is mapped through the question convolution layer, the feature space M of all positions in the input feature is mapped through the memory convolution layer, and the actual feature value A of all positions in the input feature is mapped through the answer convolution layer; the information space Q, feature space M and actual feature value A are mapped to three dimensions. Flatten to 2D , respectively get the flattened features ; Calculate the similarity matrix , , the similarity matrix S is used to measure the similarity between the information space of each pixel position and all feature spaces to capture the relationship between different spatial positions; calculate the probability distribution matrix , the softmax function is used to convert the similarity matrix S into a probability distribution matrix ; Calculate output features , and then output the features from Restore to , thus obtaining the defect location feature .

[0016] Furthermore, in step S3, the process of obtaining the defect type feature Y2 includes:

[0017] The defective pixel set T is expressed as The three-dimensional convolutional layer input tensor of , c represents the number of channels, h, w represent the height and width of the spatial dimension respectively; Perform average pooling and maximum pooling respectively to obtain two channel feature vectors and ; The channel feature vector and The channel attention weight is obtained through the shared fully connected layer and LeakReLU activation function , Represents the weight matrix of the fully connected layer; output defect type features , represents the value of the kth channel at position (i, j), represents the attention weight of the kth channel.

[0018] Furthermore, in step S3, the process of acquiring the defect detail feature Y3 includes:

[0019] Get the calibration feature of the defect location feature Y1 , Represents the convolutional layer used to recalibrate the defect position feature; obtains the calibration feature of the defect type feature Y2 , Represents a convolutional layer for recalibrating defect type features; the calibration features and Concatenate in the channel dimension to get fusion features , fusion features The size of is 2c×h×w; then the fusion features Input into the multi-layer perceptron and output defect detail features , the size of the defect detail feature Y3 is c×h×w.

[0020] Furthermore, the defect detail feature Y3 includes the position information and defect type of the defect pixel flaw(i,j); according to the position information of the defect pixel flaw(i,j), the adjacent defect pixels are integrated to obtain the defect area; assuming the area of ​​the defect pixel is a, the area of ​​the defect area = a*v, v represents the number of defect pixels contained in the defect area; assuming the number of integrated defect areas is m, if the defect types of the m defect areas are different, then the gradient texture fabric has m defect types; if the defect types of the m defect areas are repeated, the repeated defect types are not counted; and the number corresponding to each defect type is counted.

[0021] Furthermore, channel information can characterize the global characteristics of the image and reflect the information differences between different color channels of each pixel in the image; spatial information can characterize the local characteristics of the image and reflect the spatial relationship between the position of each pixel in the image and the surrounding pixels.

[0022] Furthermore, the method further includes: outputting a detection report of the gradient texture fabric according to step S4.

[0023] The beneficial effect of the present invention is that the defect detection method of the gradient texture fabric of the present invention can more accurately extract the defect feature point set T in the gradient texture fabric image by introducing a multi-constraint feature extraction module; then the defect feature point set T is input into the feature fusion processing module for fusion processing, and the defect detail features are output, and then the defect type, the number corresponding to each defect type, and the area of ​​each defect are obtained according to the defect detail features. This method is an improvement proposed for a special product such as gradient texture fabric, which can improve the accuracy of gradient texture fabric defect detection and reduce the missed detection rate and the false detection rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0025] Figure 1 It is a flow chart of the defect detection method of the gradient texture fabric of the present invention.

[0026] Figure 2 It is a schematic diagram of the operation principle of the feature fusion processing module of the present invention.

[0027] Figure 3 It is an operation flow chart of the multi-constraint feature extraction module and the feature fusion processing module of the present invention. DETAILED DESCRIPTION

[0028] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0029] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0030] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0031] like Figures 1 to 3 As shown, the present invention provides a method for detecting defects of a gradient texture fabric, comprising:

[0032] S1. Collect image Z of gradient texture fabric.

[0033] S2. Use the multi-constraint feature extraction module to process the image Z and output the defect pixel set T of the image Z and the defect feature recognition threshold , Preliminary statistical thresholds, Yes The constraint function is Represents the constraint coefficient.

[0034] S3, input the defect pixel point set T into the feature fusion processing module to obtain the defect position feature Y1 and the defect type feature Y2; and recalibrate the defect position feature Y1 and the defect type feature Y2 to obtain the calibration features and , the calibration feature and Concatenate in the channel dimension to get fusion features ; Then input the fused features into the multi-layer perceptron to output the final defect detail feature Y3.

[0035] S4. Obtain the defect type, the number of each defect type, and the area of ​​each defect of the gradient texture fabric according to the defect detail feature Y3.

[0036] It should be noted that the present invention uses a multi-constraint feature extraction module to extract features from the image Z. Compared with conventional feature extraction methods, it is more suitable for feature extraction of gradient texture fabrics and can improve the accuracy of feature extraction of gradient texture fabrics. The defect pixel point set T obtained by the multi-constraint feature extraction module is used as an input parameter of the feature fusion processing module to obtain the defect detail feature Y3, and finally the defect type, the number corresponding to each defect type, and the area of ​​each defect in the gradient texture fabric are obtained for reference in subsequent quality control.

[0037] Factors that lead to fabric defects include: raw materials, semi-finished products, production equipment, and operation. For example, among the defects of cotton fabrics, there are defects caused by yarn: mainly bamboo yarn, coarse warp, uneven weft, etc.; there are defects caused by pre-weaving preparation: mainly warp shrinkage, oil yarn, wrong threading, starch spots, cotton balls, etc.; most fabric defects are caused by poor mechanical condition of the loom and improper weaving operation: mainly skipped yarn, star jump, skipped flowers, double weft, hundred feet, sparse weft, weft loss, knot weft shrinkage, warp shrinkage, broken warp, sunken yarn, side support defects, rough edges, gaps, rotten edges, cloud weaving, dense roads, tear marks, wrong threading, holes, etc. In other words, there are many types of defects that may occur in the production process of fabrics, and the causes of the defects are also different. Therefore, when performing defect detection on fabrics, it is necessary to be able to detect the defect type and the corresponding number and size of defects, so as to analyze the causes of the defects, take effective measures to improve, and improve the quality of subsequent fabric products.

[0038] In the image acquisition stage, the acquisition device includes a lighting module and a camera. The lighting module ensures uniform illumination on the surface of the gradient texture fabric, so that the camera can obtain a clear original image. The original image is preprocessed (denoising, enhancement, etc.) to obtain image Z.

[0039] Gradient texture is a special texture that defines a gradient from one color to another in space. Gradient texture can make the fabric surface produce a rich color transition effect. The difficulty of defect feature extraction of gradient texture fabric is that: because the color is gradual, in the area of ​​color transition, the gray value reflected in image Z will not differ too much, and the existence of defects will cause the gray value of image Z at the defect position to change. If the defect happens to exist in the transition area, it may cause the gray value of the defective pixel to be the same as or very close to the gray value of the normal pixel near it. In this way, when identifying defects, if only relying on the gray value threshold to distinguish between defect points and normal points, it is possible to identify defective pixels as normal pixels, or normal pixels as defective pixels, resulting in inaccurate feature extraction results. For example, taking the gradient from black to white as an example, the color gradient process is black→gray→white. Assuming that pixels p1 and p2 are adjacent pixels, p1 and p2 are exactly the transition between gray and white. If p1 (grayish) and p2 (whiteish) are both normal pixels, the grayscale values ​​of the two points are different. Assuming that there is a hole defect on p2, the grayscale value of p2 may become the same as or very close to the grayscale value of p1, so during recognition, p2 is likely to be recognized as a normal gray pixel. Based on this, in order to improve the accuracy of defect recognition of gradient texture fabrics, the present invention introduces a "multi-constraint feature extraction module".

[0040] Specifically, the processing process of the multi-constraint feature extraction module on the image Z includes:

[0041] S21, extract the gray value of each pixel of image Z , Represents pixel coordinates.

[0042] S22. Calculate preliminary statistical threshold , where W represents the number of pixels and C is the threshold adjustment constant.

[0043] S23, obtaining edge constraints of each pixel: .

[0044] S24. Obtain the local contrast constraint of each pixel:

[0045] , Represents the pixel mean of image Z.

[0046] S25. Calculation constraint function , , Represent the weight factors of edge constraint and local contrast constraint respectively.

[0047] S26. Identify threshold value based on defect characteristics Obtain the defective pixel set T of image Z.

[0048] It should be noted that if the size of the gradient texture fabric is small, the image Z contains the entire gradient texture fabric; if the size of the gradient texture fabric is large, the image must be collected in sections, that is, multiple images Z will be obtained. When there are multiple images Z, steps S21-S26 are performed on each image Z. During feature extraction, the present invention innovatively introduces edge constraints and local contrast constraints. The edge constraints can identify the edges of each pixel, and the local contrast is used to identify subtle brightness changes between pixels, which helps to detect low-contrast defective pixels and prevent missed detection. Taking into account the gradient characteristics of gradient texture fabrics, the present invention does not directly identify the defective edges as in conventional methods, but identifies the edges and local contrast of each pixel. On this basis, the present invention also assigns weights to the two constraints, that is, the constraint function of the present invention is , weight factor , The value of is automatically optimized by particle swarm algorithm to find the optimal solution. Preliminary statistical threshold The constraint of can more accurately identify the defective pixels in image Z. And by introducing the constraint coefficient , so that the defect feature recognition threshold It has the ability of adaptive adjustment and can cope with different gradient texture fabrics, which is beneficial to improve the robustness and flexibility of defect detection to cope with more complex scenes.

[0049] After obtaining the defective pixel point set T of the image Z, it is necessary to process the defective pixel point set T to obtain the detailed features of the defect.

[0050] Specifically, in step S3, the process of obtaining the defect position feature Y1 includes:

[0051] The defective pixel set T is expressed as The input tensor of the three-dimensional convolutional layer is c, where c represents the number of channels, h and w represent the height and width of the spatial dimension respectively. Through three different convolutional layers (the stride of the three convolutional layers is 1, the size is 3*3, and the convolution kernels are different), it is mapped to three spaces. The three spaces are: the information space Q that needs to be paid attention to at the current position is mapped through the question convolution layer, the feature space M of all positions in the input feature is mapped through the memory convolution layer, and the actual feature value A of all positions in the input feature is mapped through the answer convolution layer. Among them, , , , , , Respectively represent the weight matrices , , The convolutional layer of the output Q, M, A is still . Transform the information space Q, feature space M, and actual feature value A from three dimensions Flatten to 2D ( , is the flattening of the spatial dimension), and the flattened features are obtained respectively. , , , , the Reshape function is used to flatten the features for subsequent matrix operations. Calculate the similarity matrix , , the similarity matrix S is used to measure the similarity between the information space of each pixel position and all feature spaces to capture the relationship between different spatial positions. Calculate the probability distribution matrix , the softmax function is used to convert the similarity matrix S into a probability distribution matrix The eigenvalue space and the probability distribution matrix are multiplied by weighted sum to obtain the output feature , output features Contains the location information of the defective pixel. Then the output feature from Restore to , thus obtaining the defect location feature .

[0052] In step S3, the process of obtaining the defect type feature Y2 includes:

[0053] The defective pixel set T is expressed as The input tensor of the three-dimensional convolutional layer is c, where c represents the number of channels, h and w represent the height and width of the spatial dimension respectively. Perform average pooling and maximum pooling respectively to obtain two channel feature vectors and Average pooling calculates the average value of all spatial positions for each channel c to obtain the channel feature vector , k represents the channel index, x and y represent the height index and width index of the feature map respectively. The maximum pooling calculates the maximum value of all spatial positions for each channel c to obtain the channel feature vector . The channel feature vector and The channel attention weight is obtained through the shared fully connected layer and LeakReLU activation function , Represents the weight matrix of the fully connected layer; the fully connected layer is used to learn the weight of each channel and capture the relationship between channels. The LeakReLU activation function introduces nonlinear capabilities and normalizes the output to between 0 and 1, making the attention weight more reasonable. Finally, the output defect type feature , represents the value of the kth channel at position (i, j), Represents the attention weight of the kth channel. By weighting each channel with the attention weight, important defect type characteristics can be highlighted.

[0054] In the present invention, channel information can characterize the global characteristics of an image and can reflect the information differences between different color channels of each pixel in the image; spatial information can characterize the local characteristics of an image and can reflect the spatial relationship between the position of each pixel in the image and the surrounding pixels.

[0055] After obtaining the defect position feature Y1 and the defect type feature Y2, the two need to be merged. In step S3, the process of obtaining the defect detail feature Y3 includes: obtaining the calibration feature of the defect position feature Y1 , Represents the convolutional layer used for recalibration of defect location features. Get the calibration features of defect type feature Y2 , Represents a convolutional layer for recalibrating defect type features. The purpose of recalibrating the defect location feature Y1 and the defect type feature Y2 is to further enhance and optimize the features so that the two can more accurately and effectively express the relevant information of the defect during the fusion process. and Concatenate in the channel dimension to get fusion features , stitching the two calibration features in the channel dimension can achieve the effect of feature complementarity, and can combine the two different types of feature information together. In subsequent processing, these two types of features can be used at the same time to improve the ability to identify and locate defects. In addition, in the deep learning framework, splicing in the channel dimension helps to preserve the integrity of the spatial structure while increasing the richness of the features. More comprehensive features can be used for decision-making, improving overall processing performance and enhancing recognition capabilities. Fusion features The size of is 2c×h×w; then the fusion features Input into the multi-layer perceptron, learn more complex feature representation, and finally output defect detail features , the size of the defect detail feature Y3 is c×h×w. The defect detail feature Y3 contains the location information and defect type of the defect pixel flaw(i,j).

[0056] After obtaining the defect detail feature Y3, according to the position information of the defect pixel flaw(i,j), the adjacent defective pixels are integrated to obtain the defect area; assuming that the area of ​​the defective pixel is a, the area of ​​the defect area = a*v, v represents the number of defective pixels contained in the defect area; assuming that the number of defective areas after integration is m, if the defect types of the m defective areas are all different, then the gradient texture fabric has m defect types; if the defect types of the m defective areas are repeated, the repeated defect types are not counted; and the number corresponding to each defect type is counted. Based on this, it can be known what kind of defect appears at that position on the current gradient texture fabric, which defect appears in the largest number and area, so as to analyze which link in the production process has problems and find the cause in time. The method also includes: outputting the inspection report of the gradient texture fabric according to step S4.

[0057] In summary, the defect detection method of the gradient texture fabric of the present invention can more accurately extract the defect feature point set T in the gradient texture fabric image by introducing a multi-constraint feature extraction module; then the defect feature point set T is input into the feature fusion processing module for fusion processing, and the defect detail features are output, and then the defect type, the number corresponding to each defect type, and the area of ​​each defect are obtained according to the defect detail features. This method is an improvement proposed for a special product such as gradient texture fabric, which can improve the accuracy of gradient texture fabric defect detection and reduce the missed detection rate and false detection rate.

[0058] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. A method for detecting defects in gradient texture fabrics, characterized in that: include: S1, collect image Z of gradient texture fabric; S2. Use the multi-constraint feature extraction module to process the image Z and output the defect pixel set T of the image Z and the defect feature recognition threshold , is the preliminary statistical threshold, Yes The constraint function is Represents the constraint coefficient; specifically includes: S21, extracting the gray value of each pixel point of the image Z , Indicates pixel coordinates; S22. Calculate preliminary statistical threshold , where W represents the number of pixels and C is the threshold adjustment constant; S23, obtaining edge constraints of each pixel: ; S24. Obtain the local contrast constraint of each pixel: , Represents the pixel mean of image Z; S25. Calculation constraint function , , Represent the weight factors of edge constraint and local contrast constraint respectively; S26. Identify threshold value based on defect characteristics Obtain the defective pixel point set T of the image Z; S3, inputting the defect pixel point set T into the feature fusion processing module to obtain the defect position feature Y1 and the defect type feature Y2; and recalibrating the defect position feature Y1 and the defect type feature Y2 to obtain calibration features and , the calibration feature and Concatenate in the channel dimension to get fusion features ; Then the fusion feature is input into the multi-layer perceptron to output the final defect detail feature Y3; S4. Obtain the defect type, the number of each defect type, and the area of ​​each defect of the gradient texture fabric according to the defect detail feature Y3.

2. The method for detecting defects of a gradient texture fabric according to claim 1, characterized in that: In step S3, the process of obtaining the defect position feature Y1 includes: The defective pixel set T is expressed as The 3D convolutional layer input tensor of , c represents the number of channels, h and w represent the height and width of the spatial dimension respectively; The characteristics Mapped to three spaces through three different convolutional layers, the three spaces are: the information space Q that needs to be paid attention to at the current position is mapped through the question convolution layer, the feature space M of all positions in the input feature is mapped through the memory convolution layer, and the actual feature value A of all positions in the input feature is mapped through the answer convolution layer; Transform the information space Q, feature space M, and actual feature value A from three dimensions Flatten to 2D , respectively get the flattened features ; Calculate the similarity matrix , , the similarity matrix S is used to measure the similarity between the information space of each pixel position and all feature spaces to capture the relationship between different spatial positions; Calculate the probability distribution matrix , the softmax function is used to convert the similarity matrix S into a probability distribution matrix ; Calculate output features , and then output the features from Restore to , thus obtaining the defect location feature .

3. The method for detecting defects of a gradient texture fabric according to claim 2, characterized in that: In step S3, the process of obtaining the defect type feature Y2 includes: The defective pixel set T is expressed as The 3D convolutional layer input tensor of , c represents the number of channels, h and w represent the height and width of the spatial dimension respectively; Features Perform average pooling and maximum pooling respectively to obtain two channel feature vectors and ; The channel feature vector and The channel attention weight is obtained through the shared fully connected layer and LeakReLU activation function , Represents the weight matrix of the fully connected layer; Output defect type characteristics , represents the value of the kth channel at position (i, j), represents the attention weight of the kth channel.

4. The method for detecting defects of a gradient texture fabric according to claim 3, characterized in that: In step S3, the process of obtaining the defect detail feature Y3 includes: Get the calibration feature of the defect location feature Y1 , Represents the convolutional layer used for recalibration of defect position features; Get the calibration feature of defect type feature Y2 , represents the convolutional layer used for defect type feature recalibration; The calibration feature and Concatenate in the channel dimension to get fusion features , fusion features The dimensions are 2c×h×w; Then the fusion features Input into the multi-layer perceptron and output defect detail features , the size of the defect detail feature Y3 is c×h×w.

5. The method for detecting defects of a gradient texture fabric according to claim 4, characterized in that: The defect detail feature Y3 includes the position information and defect type of the defect pixel flaw(i,j); according to the position information of the defect pixel flaw(i,j), the adjacent defect pixels are integrated to obtain the defect area; assuming the area of ​​the defect pixel is a, the area of ​​the defect area = a*v, v represents the number of defect pixels contained in the defect area; assuming the number of integrated defect areas is m, if the defect types of the m defect areas are different, then the gradient texture fabric has m defect types; if the defect types of the m defect areas are repeated, the repeated defect types are not counted; and the number corresponding to each defect type is counted.

6. The method for detecting defects of a gradient texture fabric according to claim 4, characterized in that: Channel information can characterize the global characteristics of an image and reflect the information differences between different color channels of each pixel in the image; spatial information can characterize the local characteristics of an image and reflect the spatial relationship between the position of each pixel in the image and the surrounding pixels.

7. The method for detecting defects of a gradient texture fabric according to claim 1, characterized in that: The method further comprises: outputting a detection report of the gradient texture fabric according to step S4.