Target detection method and system for knitwear defect detection

Through the improved YOLOv10 algorithm, the dynamic snake convolution and channel-first convolution attention module is used to solve the detection performance limitations of knitted defect detection under complex lighting and background conditions, and achieve efficient and accurate defect detection results.

CN119559130APending Publication Date: 2025-03-04WUHAN TEXTILE UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411600622.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The prior art In the detection of knitted defects, especially under complex lighting and background conditions, the detection performance has limitations, resulting in low detection accuracy and efficiency.

Method used

An improved YOLOv10 algorithm is proposed to extract features through dynamic serpentine convolution, combining channel-first convolution attention module and multiple detection heads to enhance the robustness and detection capabilities of the model.

Benefits of technology

It realizes efficient defect detection under different background colors, textures and light source conditions, improves the accuracy and efficiency of detection, and reduces the background error detection rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559130A_ABST
    Figure CN119559130A_ABST
Patent Text Reader

Abstract

The invention relates to a target detection method and system for knitwear defect detection, and the method comprises the steps: obtaining a knitwear defect picture, and processing the knitwear defect picture to obtain a knitwear defect data set; constructing an initial defect detection model, wherein the initial defect detection model is composed of a trunk feature extraction network, a channel priority convolution attention module, a deep convolution module and multiple detection heads; constructing a target loss function to train the initial defect detection model to obtain an optimized defect detection model; and inputting the processed knitwear defect data set into the optimized defect detection model to obtain a defect detection result. The method can effectively improve the knitwear defect detection precision and efficiency, and has the advantages of being rapid in detection, high in universality, high in intelligent degree, low in background false detection rate and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of machine vision applications, and in particular to a target detection method and system for knitted product defect detection. Background Art

[0002] With the rapid development of the textile industry, knitwear has been widely used in daily life. However, knitwear is prone to various defects during the production process, such as holes, wire drawing, pilling, color difference, uneven dyeing, uneven weaving density, pattern misalignment, etc. These defects not only affect the appearance and quality of the product, but may also lead to customer complaints and economic losses. Therefore, knitwear defect detection has become an important link in the textile industry.

[0003] Traditional knitted fabric defect detection mainly relies on manual inspection, and quality inspectors discover and mark defects through visual inspection. However, there are many problems with manual inspection, such as low detection efficiency, low accuracy, and easy fatigue of quality inspectors. In addition, the results of manual inspection are easily affected by subjective factors, resulting in inconsistent detection results. With the expansion of production scale and the improvement of automation, traditional manual inspection methods can no longer meet the needs of the modern textile industry. In recent years, automated defect detection technology based on computer vision and deep learning has gradually emerged. As an efficient target detection algorithm, YOLO has attracted widespread attention due to its fast detection speed and high accuracy. YOLOv10 is the latest version of the YOLO series algorithm, which has stronger feature extraction capabilities and higher detection accuracy. However, in practical applications, the detection performance of YOLOv10 under complex lighting and background conditions still has certain limitations. Therefore, the present disclosure provides an improved YOLOv10 algorithm for knitted fabric defect detection and a robustness enhancement method thereof to achieve rapid detection, and the method has the advantages of strong versatility, high intelligence, and low background false detection rate. Summary of the invention

[0004] In order to solve the problem of poor detection performance caused by different background colors, textures and light source intensity, angle and color of knitted fabrics, the present disclosure proposes a target detection method for knitted fabric defect detection to solve the above problem.

[0005] According to one aspect of the present disclosure, there is provided a target detection method for knitted product defect detection, comprising:

[0006] S10, obtaining knitted product defect images, and processing the knitted product defect images to obtain a knitted product defect dataset;

[0007] S20, constructing an initial defect detection model, wherein the initial defect detection model is composed of a backbone feature extraction network, a channel-priority convolution attention module, a deep convolution module, and a multi-detection head;

[0008] S30, constructing a target loss function to train the initial defect detection model to obtain an optimized defect detection model;

[0009] S40, inputting the processed knitted product defect data set into the optimized defect detection model to obtain a defect detection result.

[0010] Preferably, constructing an initial defect detection model includes:

[0011] The backbone of the initial defect detection model is improved, and the acquired knitted fabric defect image is input into the backbone. The feature of the knitted fabric defect image is extracted through the dynamic snake convolution of the backbone to obtain a feature map. The standard convolution kernel in the dynamic snake convolution is linearized in the x-axis and y-axis directions. The change in the x-axis direction is:

[0012]

[0013] The change in the y-axis direction is:

[0014]

[0015] In the formula, K i±b (x i±b ,y i±b is the specific position of each grid in the convolution kernel K, b=0,1,2,3,4 represents the horizontal distance from the center grid, Δx is the offset in the x-axis direction, and Δy is the offset in the y-axis direction.

[0016] Preferably, constructing the initial defect detection model further includes:

[0017] The extracted feature map is input into the channel-priority convolutional attention module, and the spatial information of the feature map is extracted through the channel attention of the channel-priority convolutional attention module. The process of extracting spatial information is as follows:

[0018]

[0019]

[0020] In the formula, Represents the highly spatial structural information of the ith sub-feature obtained after the light convolution operation, represents the width spatial structure information of the i-th sub-feature obtained after the light convolution operation, k i represents the convolution kernel applied to the i-th sub-feature, Represents the highly spatial structural information of the ith sub-feature before the light convolution operation, Represents the width spatial structure information of the i-th sub-feature before the light convolution operation.

[0021] Preferably, constructing an initial defect detection model also includes: processing the spatial information to obtain a channel attention map, multiplying the elements of the feature map and the channel attention map to obtain a channel prior, and inputting it into a deep convolution module to generate a spatial attention map, and multiplying the channel attention map with the elements in the channel prior one by one to obtain refined output features.

[0022] Preferably, the refined output feature calculation formula is:

[0023]

[0024]

[0025] X s =Attn H ×Attn W ×X

[0026] In the formula, σ(·) represents the normalized activation function, and denotes that there are i group normalizations along the H and W dimensions, respectively, X s Represents the final output feature, Attn H To perform group normalization on the H-dimensional output features, Attn W is the output feature on W dimension after group normalization, and X is the input feature.

[0027] Preferably, constructing a target loss function to train the initial defect detection model includes:

[0028] Improved normalization of the channel-priority convolutional attention module of the initial defect detection model;

[0029] The normalized cost distance is used to calculate the similarity between the detection box and the target box of the channel-priority convolutional attention module, and the corresponding Gaussian distribution is obtained. The similarity between the Gaussian distributions is measured by the normalized cost distance.

[0030] A target loss function is established based on the similarity between the Gaussian distributions to determine the overlapping area between the detection frame and the target frame.

[0031] Preferably, the objective loss function considers the information of the distance between the center points of the bounding box, the overlapping area and the scale information of the aspect ratio of the bounding box, and is expressed as:

[0032]

[0033] In the formula, is the distance metric, gx a ,gy a Respectively represent the distribution and The center coordinates, w a 、w b Respectively represent the distribution and The width, h a and h b Respectively represent the distribution and Height, represents the Euclidean distance;

[0034] The normalized cost distance is expressed as:

[0035]

[0036] In the formula, is the normalized cost distance, E is a constant, and represents the average absolute size of the AI-TOD dataset.

[0037] According to one aspect of the present disclosure, there is provided an object detection system for knitted product defect detection, comprising:

[0038] A module for obtaining a knitted product defect data set is used to obtain a knitted product defect image, and to process the knitted product defect image to obtain a knitted product defect data set;

[0039] An initial defect detection model construction module is used to construct an initial defect detection model, wherein the initial defect detection model is composed of a backbone feature extraction network, a channel-priority convolution attention module, a deep convolution module, and a multi-detection head;

[0040] An initial defect detection model training module constructs a target loss function to train the initial defect detection model to obtain an optimized defect detection model;

[0041] The defect detection module inputs the processed knitwear defect data set into the optimized defect detection model to obtain the defect detection result.

[0042] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor executable instructions; wherein the processor is configured to: execute the above-mentioned target detection method for knitted product defect detection.

[0043] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the target detection method for knitted product defect detection is implemented.

[0044] Compared with the prior art, the beneficial effects of the present disclosure are:

[0045] 1) The present invention uses dynamic snake convolution to extract features from defect images and adaptively adjusts the shape and size of the convolution kernel to better capture the details and edge information in the image.

[0046] 2) The present invention performs weighted processing on the features of different channels through a channel-priority convolutional attention module, thereby enhancing the expressiveness of important features and suppressing the interference of unimportant features.

[0047] 3) The present invention adds a new detection head specifically for detecting tiny defects. After learning the feature information of small targets from the shallow feature map, it is spliced ​​with the deep feature map, so that the deep network can also learn the feature information of small targets, allowing the network to pay more attention to the detection of small targets, thereby improving the model's sensitivity and detection ability to small-size defects.

[0048] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.

[0049] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0051] Figure 1 A flow chart of a target detection method for knitwear defect detection is shown;

[0052] Figure 2 A diagram showing the working principle of channel attention in an embodiment of the present disclosure is shown;

[0053] Figure 3 The improved YOLOv10 working principle diagram in the disclosed embodiment is shown;

[0054] Figure 4 The textile image to be tested in the embodiment of the present disclosure is shown;

[0055] Figure 5 The block diagram of the object detection system for knitwear defect detection is shown. DETAILED DESCRIPTION

[0056] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0057] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0058] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0059] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0060] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0061] Example 1

[0062] Based on the above ideas, the present invention proposes a target detection method for knitted fabric defect detection.

[0063] Figure 1 A flow chart showing a target detection method for knitted fabric defect detection. The method comprises:

[0064] S10, obtaining knitted product defect images, and processing the knitted product defect images to obtain a knitted product defect dataset;

[0065] S20, constructing an initial defect detection model, wherein the initial defect detection model is composed of a backbone feature extraction network, a channel-priority convolution attention module, a deep convolution module, and a multi-detection head;

[0066] S30, constructing a target loss function to train the initial defect detection model to obtain an optimized defect detection model;

[0067] S40, inputting the processed knitted product defect data set into the optimized defect detection model to obtain a defect detection result.

[0068] The present disclosure provides a target detection method for knitted product defect detection, comprising the following steps:

[0069] S10, obtaining knitted product defect images, and processing the knitted product defect images to obtain a knitted product defect dataset.

[0070] In this embodiment, a linear array camera is used to shoot the knitted fabric to be inspected to obtain knitted fabric defect pictures, and the knitted fabric defect pictures are processed to obtain a knitted fabric defect data set; the data at the input end is input into the backbone network Backbone after the optimized convolution method for feature extraction; the extracted features are passed through a channel-priority convolution attention module, and a multi-scale deep convolution separable convolution module is used to form a spatial attention; a multi-head detector is introduced to construct an initial defect detection module; a new small target detection method based on Wasserstein distance is introduced, and the Loss is changed to obtain an optimized defect detection module; the improved YOLOv10 model is trained and tested to obtain a trained YOLOv10 model.

[0071] S20. Construct an initial defect detection model, wherein the initial defect detection model is composed of a backbone feature extraction network, a channel-priority convolution attention module, a deep convolution module and a multi-detection head.

[0072] In this embodiment, in order to improve the robustness of the model under different background colors, textures and light source conditions, an initial defect detection model is constructed here, including: improving the backbone part of the initial defect detection model, improving the backbone part of YOLOv10, inputting the acquired knitwear defect image into the backbone part, and extracting features of the knitwear defect image through dynamic snake convolution of the backbone part to obtain a feature map.

[0073] In order to give the convolution kernel more flexibility and enable it to focus on the complex geometric features of the target, a deformation offset Δ is introduced, inspired by deformable convolution. We sequentially select the next position of each object to be processed for observation, thereby ensuring the continuity of attention and not spreading the perception range too far due to a large deformation offset.

[0074] In dynamic snake convolution, the standard convolution kernel is linearized in both the x-axis and y-axis directions. Consider a convolution kernel of size 16. Taking the x-axis direction as an example, the specific position of each grid in the convolution kernel K is expressed as: K i±b =(x i±b ,y i±b), where b = 0, 1, 2, 3, 4 represents the horizontal distance from the center grid. Each grid position K in the convolution kernel K i±b The selection of is a cumulative process. From the center position K i Initially, the position of the grid away from the center depends on the position of the previous grid: K i+1 Relative to K i The offset Δ={δ|δ∈[-1, 1]} is added. Therefore, the offset needs to be accumulated ∑ to ensure that the convolution kernel conforms to the linear morphology structure.

[0075] The standard convolution kernel in the dynamic snake convolution is linearized in the x-axis and y-axis directions, and the change in the x-axis direction is:

[0076]

[0077] The change in the y-axis direction is:

[0078]

[0079] Where Δx is the offset in the x-axis direction, and Δy is the offset in the y-axis direction.

[0080] The extracted feature maps are input into the channel-priority convolutional attention module, which uses a multi-scale deep convolutional module to effectively extract spatial relationships while retaining channel priors. Channel attention aggregates the spatial information of the input feature map through operations such as average pooling and maximum pooling.

[0081] Preferably, constructing the initial defect detection model further includes:

[0082] The extracted feature map is input into the channel-priority convolutional attention module. The spatial information of the feature map is extracted through the channel attention of the channel-priority convolutional attention module. The multi-scale deep convolution module can effectively extract the spatial relationship while retaining the channel prior. The channel attention aggregates the spatial information of the input feature map through operations such as average pooling and maximum pooling. The process of extracting spatial information is:

[0083]

[0084]

[0085] Where ΔX i represents the spatial structure information of the i-th sub-feature obtained after the light convolution operation, k i represents the convolution kernel applied to the i-th sub-feature, Represents the highly spatial structural information of the ith sub-feature before the light convolution operation, Represents the width spatial structure information of the i-th sub-feature before the light convolution operation.

[0086] The spatial information is then processed through the MLP and added to generate the channel attention map. The working principle of channel attention is as follows Figure 2 As shown in Figure 1, the channel prior is obtained by element-wise multiplication of the input feature and the channel attention map, and is input into the deep convolution module to generate the spatial attention map. Finally, the refined features are obtained as output by element-wise multiplication of the channel mixing result and the channel prior.

[0087] Furthermore, the spatial information is processed by MLP to obtain a channel attention map, the elements of the feature map and the channel attention map are multiplied to obtain the channel prior, and the channel prior is input into the deep convolution module to generate the spatial attention map, and the channel attention map is multiplied one by one with the elements in the channel prior to obtain refined output features.

[0088] Preferably, the refined output feature calculation formula is:

[0089]

[0090]

[0091] X s =Attn H ×Attn W ×X

[0092] In the formula, σ(·) represents the normalized activation function, and Respectively, there are K group normalizations along the H and W dimensions, X s represents the final output feature, for, For, Attn H Attn is the output feature on the H dimension after group normalization. W is the output feature on W dimension after group normalization, and X is the input feature.

[0093] Building the initial defect detection model also includes: adding a small defect detection head to the head end, introducing a multi-head detector, and learning the feature information of small targets from the shallow feature map, and then splicing it with the deep feature map, so that the deep network can also learn the feature information of small targets, so that the network can pay more attention to the detection of small targets and improve the target detection effect. The working principle of the improved YOLOv10 is as follows: Figure 3 shown.

[0094] S30, constructing a target loss function to train the initial defect detection model to obtain an optimized defect detection model.

[0095] In this embodiment, NWD is used to calculate the similarity between boxes, and the boxes are modeled as Gaussian distributions. Then, Wasserstein distance is used to measure the similarity between the two distributions, thereby replacing IOU. The advantage of NWD is that even if two boxes do not overlap at all, or overlap very little, the similarity can still be measured. At the same time, it is insensitive to the scale of the target and is more stable for small targets.

[0096] The details are as follows:

[0097] The channel-priority convolutional attention module of the initial defect detection model is improved and normalized; the normalized cost distance is used to calculate the similarity between the detection box and the target box of the channel-priority convolutional attention module to obtain the corresponding Gaussian distribution, and the similarity between the Gaussian distributions is measured by the normalized cost distance; based on the similarity between the Gaussian distributions, a target loss function is established to determine the overlapping area of ​​the detection box and the target box to solve the problem when the boundary boxes do not overlap.

[0098] The objective loss function considers the information of the distance between the center points of the bounding box, the overlapping area, and the scale information of the aspect ratio of the bounding box, and is expressed as:

[0099]

[0100] In the formula, is the distance metric, gx a ,gy a Respectively represent the distribution and The center coordinates, w a 、w b Respectively represent the distribution and The width, h a and h b Respectively represent the distribution and Height, represents the Euclidean distance; however, It is a distance metric and cannot be used directly as a similarity metric (i.e., a value between 0 and 1 as IoU). Therefore, it is normalized using its exponential form to obtain a new metric, namely the normalized cost distance.

[0101] The normalized cost distance is expressed as:

[0102]

[0103] In the formula, is the normalized cost distance, E is a constant, and represents the average absolute size of the AI-TOD dataset.

[0104] S40, inputting the processed knitted product defect data set into the optimized defect detection model to obtain a defect detection result.

[0105] In this embodiment, the knitwear picture to be detected is as follows: Figure 4 As shown, Figure 4 (a) to (i) in the figure are 9 pictures of different knitwear to be tested.

[0106] The disclosed embodiment uses dynamic snake convolution to Figure 4 The knitwear images to be inspected are used for feature extraction, and the shape and size of the convolution kernel are adaptively adjusted to better capture the details and edge information in the image; the channel-priority convolution attention module is used to weight the features of different channels to enhance the expression ability of important features and suppress the interference of unimportant features; a new detection head is added specifically for detecting tiny defects to improve the model's sensitivity and detection ability for small-size defects; a loss function is designed, data iteration is performed, and the data is trained and tested by improving the YOLOv10 model to obtain the required model.

[0107] Example 2

[0108] As another aspect of the embodiment of the present disclosure, a target detection system 100 for knitted product defect detection is also provided. Figure 5 As shown, including:

[0109] A knitwear defect data set acquisition module 1 acquires knitwear defect images and processes the knitwear defect images to obtain a knitwear defect data set;

[0110] An initial defect detection model construction module 2 is used to construct an initial defect detection model, wherein the initial defect detection model is composed of a backbone feature extraction network, a channel-priority convolution attention module, a deep convolution module, and a multi-detection head;

[0111] An initial defect detection model training module 3 constructs a target loss function to train the initial defect detection model to obtain an optimized defect detection model;

[0112] The defect detection module 4 inputs the processed knitted product defect data set into the optimized defect detection model to obtain the defect detection result.

[0113] In the absence of any contradiction, the above modules in the system of the embodiment of the present disclosure can implement any implementation method of the method in the above embodiment 1.

[0114] Based on the description of the above embodiments, it can be seen that the embodiments of the present disclosure can achieve the following technical effects:

[0115] 1) The present invention uses dynamic snake convolution to extract features from defect images and adaptively adjusts the shape and size of the convolution kernel to better capture the details and edge information in the image.

[0116] 2) The present invention performs weighted processing on the features of different channels through a channel-priority convolutional attention module, thereby enhancing the expressiveness of important features and suppressing the interference of unimportant features.

[0117] 3) The present invention adds a new detection head specifically for detecting tiny defects. After learning the feature information of small targets from the shallow feature map, it is spliced ​​with the deep feature map, so that the deep network can also learn the feature information of small targets, allowing the network to pay more attention to the detection of small targets, thereby improving the model's sensitivity and detection ability to small-size defects.

[0118] The embodiment of the present disclosure also provides an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above-mentioned target detection method for knitwear defect detection. The electronic device can be provided as a terminal, a server, or other forms of equipment.

[0119] The present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the target detection method for knitted product defect detection is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.

[0120] Those skilled in the art will understand that, in the above-mentioned target detection method and system for knitted fabric defect detection in the specific implementation mode, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0121] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0122] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A target detection method for knitted fabric defect detection, characterized in that: The steps include: S10, obtaining knitted product defect images, and processing the knitted product defect images to obtain a knitted product defect dataset; S20, constructing an initial defect detection model, wherein the initial defect detection model is composed of a backbone feature extraction network, a channel-priority convolution attention module, a deep convolution module, and a multi-detection head; S30, constructing a target loss function to train the initial defect detection model to obtain an optimized defect detection model; S40, inputting the processed knitted product defect data set into the optimized defect detection model to obtain a defect detection result.

2. The method according to claim 1, characterized in that Build an initial defect detection model, including: The backbone of the initial defect detection model is improved, and the acquired knitted fabric defect image is input into the backbone. The feature of the knitted fabric defect image is extracted through the dynamic snake convolution of the backbone to obtain a feature map. The standard convolution kernel in the dynamic snake convolution is linearized in the x-axis and y-axis directions. The change in the x-axis direction is: The change in the y-axis direction is: In the formula, K i±b =(x i±b ,y i±b ) is the specific position of each grid in the convolution kernel K, b = 0, 1, 2, 3, 4 represents the horizontal distance from the center grid, Δx is the offset in the x-axis direction, and Δy is the offset in the y-axis direction.

3. The method according to claim 2, characterized in that Build an initial defect detection model, also including: The extracted feature map is input into the channel-priority convolutional attention module, and the spatial information of the feature map is extracted through the channel attention of the channel-priority convolutional attention module. The process of extracting spatial information is as follows: In the formula, Represents the highly spatial structural information of the ith sub-feature obtained after the light convolution operation, represents the width spatial structure information of the i-th sub-feature obtained after the light convolution operation, k i represents the convolution kernel applied to the i-th sub-feature, Represents the highly spatial structural information of the ith sub-feature before the light convolution operation, Represents the width spatial structure information of the i-th sub-feature before the light convolution operation.

4. The method according to claim 3, characterized in that Constructing an initial defect detection model also includes: processing the spatial information to obtain a channel attention map, multiplying the elements of the feature map and the channel attention map to obtain a channel prior, and inputting it into a deep convolution module to generate a spatial attention map, multiplying the channel attention map with the elements in the channel prior one by one to obtain refined output features.

5. The method according to claim 4, characterized in that The refined output feature calculation formula is: X s =Attn H ×Attn W ×X In the formula, σ(·) represents the normalized activation function, and denotes that there are i group normalizations along the H and W dimensions, respectively, X s Represents the final output feature, Attn H To perform group normalization on the H-dimensional output features, Attn W is the output feature on W dimension after group normalization, and X is the input feature.

6. The method according to claim 1, characterized in that Constructing a target loss function to train the initial defect detection model includes: Improved normalization of the channel-priority convolutional attention module of the initial defect detection model; The normalized cost distance is used to calculate the similarity between the detection box and the target box of the channel-priority convolutional attention module, and the corresponding Gaussian distribution is obtained. The similarity between the Gaussian distributions is measured by the normalized cost distance. A target loss function is established based on the similarity between the Gaussian distributions to determine the overlapping area between the detection frame and the target frame.

7. The method according to claim 6, characterized in that The objective loss function considers the information of the distance between the center points of the bounding box, the overlapping area, and the scale information of the aspect ratio of the bounding box, and is expressed as: In the formula, is the distance metric, gx a ,gy a Respectively represent the distribution and The center coordinates, w a 、w b Respectively represent the distribution and The width, h a and h b Respectively represent the distribution and Height, represents the Euclidean distance; The normalized cost distance is expressed as: In the formula, is the normalized cost distance, E is a constant, and represents the average absolute size of the AI-TOD dataset.

8. A target detection system for knitted fabric defect detection, characterized in that: include: A module for obtaining a knitted product defect data set is used to obtain a knitted product defect image, and to process the knitted product defect image to obtain a knitted product defect data set; An initial defect detection model construction module is used to construct an initial defect detection model, wherein the initial defect detection model is composed of a backbone feature extraction network, a channel-priority convolution attention module, a deep convolution module, and a multi-detection head; An initial defect detection model training module constructs a target loss function to train the initial defect detection model to obtain an optimized defect detection model; The defect detection module inputs the processed knitwear defect data set into the optimized defect detection model to obtain the defect detection result.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the target detection method for knitted product defect detection according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the target detection method for knitted product defect detection according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • High-reflection and high-transmittance material surface flaw detection method based on improved YOLOv11

    CN120580221A