Automatic defect identification system and method for woven carpet production

In the detection of defects of woven carpets, the deep learning model based on the YOLOv8 model is used for attention enhancement and lightweight improvement, which solves the misjudgment problem of traditional methods when identifying complex textures and diverse patterns, and improves the detection ability of small target defects, achieving higher recognition accuracy and lower missed detection rates.

CN119942313AActive Publication Date: 2025-05-06WEIHAI HAIMA DAHUA CARPET CO LTD +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510015401.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-05-06
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

When traditional carpet defect detection methods identify woven carpets with complex textures and diverse patterns, they are prone to misjudging the normal pattern as defects, and the detection ability of small target defects is limited, and the recognition accuracy is low.

Method used

A deep learning model based on the YOLOv8 model is used for attention enhancement and lightweight improvement. The specific improvements include replacing some CBS modules in the backbone network and neck network as generalized separable convolution module GSConv, enhancing attention to the C2f module, and adding a small object detection layer and feature fusion module to the detection head part.

Benefits of technology

By introducing the YOLOv8 model, it can effectively distinguish normal patterns and defects, significantly improve the recognition accuracy, and have higher sensitivity when detecting small target defects, reducing missed detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942313A_ABST
    Figure CN119942313A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic defect identification system and method for woven carpet production, and relates to the technical field of image processing. A defect detection model is obtained by performing attention enhancement and lightweight improvement on a YOLOv8 model, including adding an attention mechanism in a neck network and adding a small target detection layer to a detection head part. The trained model is applied to defect detection of the woven carpet, a surface image of the woven carpet to be detected is obtained and preprocessed, and a target image is obtained; and inputting into a defect detection model to obtain a defect detection result. By introducing the target detection model YOLOv8, complex texture features can be learned from a large number of samples, normal patterns and defects are effectively distinguished, and the recognition accuracy is greatly improved. And meanwhile, the small target detection layer is added, so that the model has higher sensitivity when detecting small target defects, the detection capability on the small target defects such as thin line breakage and tiny stains is remarkably enhanced, and the phenomenon of missing detection is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image processing, and in particular to a system and method for automatically identifying defects in woven carpet production. Background Art

[0002] As a high-end decorative material widely used in homes, offices and commercial places, the quality of machine-woven carpets is directly related to the market competitiveness of products. In the production process of carpets, due to differences in raw material quality, weaving process and dyeing technology, defects such as broken threads, stains, color difference and damage are prone to occur.

[0003] Traditional carpet defect detection mainly relies on manual inspection. With the continuous expansion of carpet production scale and the increase in production speed, the efficiency and accuracy of manual inspection are gradually unable to meet the needs of modern industry. Manual inspection consumes a lot of manpower, and long-term work can easily lead to fatigue, thereby increasing the false detection rate and missed detection rate. In recent years, machine vision technology has been introduced into carpet defect detection in order to replace manual inspection. Traditional rule-based machine vision methods identify defects through edge detection, color difference analysis and other means, and can achieve a certain degree of automation in specific scenarios. However, for woven carpets with complex textures and diverse patterns, these methods are prone to misjudge the normal patterns of the carpet as defects, or cannot effectively distinguish defects from the background. In addition, traditional methods have limited detection capabilities for small target defects (such as fine line breaks or tiny stains), and the recognition accuracy is low, which is difficult to meet actual needs. Summary of the invention

[0004] The purpose of the present invention is to solve the problem of low recognition accuracy mentioned in the above background technology, and to propose a system and method for automatically identifying defects in woven carpet production.

[0005] The first aspect of the present invention provides a method for automatically identifying defects in woven carpet production, the method comprising:

[0006] Acquiring a surface image of a woven carpet to be inspected;

[0007] Preprocessing the surface image to obtain a target image;

[0008] Using the target image as an input of a pre-trained defect detection model to obtain a defect detection result;

[0009] The defect detection model is a deep learning model based on the YOLOv8 model with attention enhancement and lightweight improvements; the specific improvements include:

[0010] Replace some CBS modules in the backbone network and neck network with generalized separable convolution modules GSConv;

[0011] Perform attention enhancement on the C2f module to obtain the C2fGSSA module, and replace the C2f module in the neck network with the C2fGSSA module;

[0012] A small target detection layer is added to the detection head, and a corresponding feature fusion module is added to the neck network.

[0013] Optionally, the backbone network and the neck network in the original YOLOv8 model have a total of 22 layers, and each layer corresponds to a computing module;

[0014] The method of replacing part of the CBS in the backbone network and the neck network with the generalized separable convolution module GSConv includes:

[0015] Replace the CBS modules in the second, fourth, sixth, eighth, seventeenth, and twentieth layers with GSConv modules.

[0016] Optionally, the C2f module is composed of a standard convolution module and a bottleneck structure module; each bottleneck structure module includes two CBS modules;

[0017] The C2f module is enhanced with attention to obtain a C2fGSSA module, which includes:

[0018] The CBS module in the bottleneck structure module is replaced by the GSConv module, and the SimAM attention module is added thereto to obtain an improved bottleneck structure module; the calculation process of the improved bottleneck structure module is:

[0019] X2=f SimAM (f GSConv (f GSConv (X1)));

[0020] Among them, X1 is the input of the improved bottleneck structure module; f GSConv represents the convolution operation of the GSConv module; f SimAM represents the weighted calculation of the SimAM attention module; X2 is the output of the improved bottleneck structure module;

[0021] Each bottleneck structure module in the C2f module is replaced by an improved bottleneck structure module to obtain a C2fGSSA module.

[0022] Optionally, the adding of a small target detection layer in the detection head part and the adding of a corresponding feature fusion module in the neck network include:

[0023] Modify the output-input relationship between the fifteenth layer and the sixteenth layer, use the output of the fifteenth layer as the input of the feature fusion module, and use the output of the feature fusion module as the input of the sixteenth layer;

[0024] The operation process of the feature fusion module includes:

[0025]

[0026] Wherein, D1 is the feature map output by the fifteenth layer; P2 is the feature map output by the third layer; Y1, Y2 and Y3 are the feature maps generated by the operation process, and Y3 is used as the predicted feature map of the small target detection head; Y4 is the output of the feature fusion module; f C2fGSSA Indicates the operation of the G2fGSSA module; upsample indicates upsampling; concat indicates channel concatenation; f CSConv Represents the convolution operation of the GSConv module.

[0027] Optionally, during the model training process, the loss function MPDIoU is used to replace the loss function CIoU of the original YOLOv8 model; the calculation process of the loss function MPDIoU includes:

[0028]

[0029] Among them, x1, y1, x2, y2 are the coordinate representations of the real box; is the coordinate representation of the prediction box; d1 and d2 are the Euclidean distances between the upper left corner and the lower right corner of the real box and the prediction box, respectively; IoU is the intersection over union of the real box and the prediction box; H and W are the height and width of the target image.

[0030] A second aspect of the present invention provides a system for automatically identifying defects in woven carpet production, the system comprising:

[0031] A data acquisition module, used for acquiring a surface image of the woven carpet to be inspected;

[0032] A preprocessing module, used for preprocessing the surface image to obtain a target image;

[0033] A detection module is used to use the target image as the input of a pre-trained defect detection model to obtain a defect detection result; the defect detection model is a deep learning model obtained by performing attention enhancement and lightweight improvement based on the YOLOv8 model; the specific improvements include: replacing some CBS modules in the backbone network and the neck network with the generalized separable convolution module GSConv; performing attention enhancement on the C2f module to obtain the C2fGSSA module, and replacing the C2f module in the neck network with the C2fGSSA module; adding a small target detection layer in the detection head part, and adding a corresponding feature fusion module in the neck network.

[0034] Optionally, the backbone network and the neck network in the original YOLOv8 model have a total of 22 layers, and each layer corresponds to a computing module;

[0035] The method of replacing part of the CBS in the backbone network and the neck network with the generalized separable convolution module GSConv includes:

[0036] Replace the CBS modules in the second, fourth, sixth, eighth, seventeenth, and twentieth layers with GSConv modules.

[0037] Optionally, the C2f module is composed of a standard convolution module and a bottleneck structure module; each bottleneck structure module includes two CBS modules;

[0038] The C2f module is enhanced with attention to obtain a C2fGSSA module, which includes:

[0039] The CBS module in the bottleneck structure module is replaced by the GSConv module, and the SimAM attention module is added thereto to obtain an improved bottleneck structure module; the calculation process of the improved bottleneck structure module is:

[0040] X2=f SimAM (f GSConv (f GSConv (X1)));

[0041] Among them, X1 is the input of the improved bottleneck structure module; f GSConv represents the convolution operation of the GSConv module; f SimAM represents the weighted calculation of the SimAM attention module; X2 is the output of the improved bottleneck structure module;

[0042] Each bottleneck structure module in the C2f module is replaced by an improved bottleneck structure module to obtain a C2fGSSA module.

[0043] Optionally, the adding of a small target detection layer in the detection head part and the adding of a corresponding feature fusion module in the neck network include:

[0044] Modify the output-input relationship between the fifteenth layer and the sixteenth layer, use the output of the fifteenth layer as the input of the feature fusion module, and use the output of the feature fusion module as the input of the sixteenth layer;

[0045] The operation process of the feature fusion module includes:

[0046]

[0047] Wherein, D1 is the feature map output by the fifteenth layer; P2 is the feature map output by the third layer; Y1, Y2 and Y3 are the feature maps generated by the operation process, and Y3 is used as the predicted feature map of the small target detection head; Y4 is the output of the feature fusion module; f C2fGSSA Indicates the operation of the G2fGSSA module; upsample indicates upsampling; concat indicates channel concatenation; f CSConv Represents the convolution operation of the GSConv module.

[0048] Optionally, during the model training process, the loss function MPDIoU is used to replace the original loss function CIoU; the calculation process of the loss function MPDIoU includes:

[0049]

[0050] Among them, x1, y1, x2, y2 are the coordinate representations of the real box; is the coordinate representation of the predicted box; d1 and d2 are the Euclidean distances between the upper left corner and the lower right corner of the real box and the predicted box, respectively; IoU is the intersection over union of the real box and the predicted box; H and W are the height and width of the target image.

[0051] Beneficial effects of the present invention:

[0052] The present invention proposes a method for automatically identifying defects in woven carpet production, which includes: acquiring a surface image of a woven carpet to be detected; preprocessing the surface image to obtain a target image; using the target image as an input of a pre-trained defect detection model to obtain a defect detection result; the defect detection model is a deep learning model obtained by performing attention enhancement and lightweight improvement based on a YOLOv8 model; specific improvements include: replacing part of CBS modules in a backbone network and a neck network with a generalized separable convolution module GSConv; performing attention enhancement on a C2f module to obtain a C2fGSSA module, and replacing the C2f module in the neck network with a C2fGSSA module; adding a small target detection layer in the detection head part, and adding a corresponding feature fusion module in the neck network.

[0053] By introducing the target detection model YOLOv8, it is possible to learn complex texture features from a large number of samples, effectively distinguish normal patterns from defects, and greatly improve recognition accuracy. At the same time, adding a small target detection layer makes the model more sensitive when detecting small target defects, and significantly enhances the detection ability of small target defects such as fine line breaks and tiny stains, reducing missed detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The present invention will be further described below in conjunction with the accompanying drawings.

[0055] Figure 1 A flow chart of a method for automatically identifying defects in woven carpet production is provided for an embodiment of the present invention;

[0056] Figure 2 A network structure diagram of YOLOv8 is provided for an embodiment of the present invention;

[0057] Figure 3 A network structure diagram of a defect detection model is provided for an embodiment of the present invention;

[0058] Figure 4 A schematic diagram of the structure of a C2fGSSA module is provided for an embodiment of the present invention;

[0059] Figure 5 A structural schematic diagram of a decoupling detection head is provided for an embodiment of the present invention;

[0060] Figure 6 An architecture diagram of a system for automatically identifying defects in woven carpet production is provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] The embodiment of the present invention provides a method for automatically identifying defects in woven carpet production. Figure 1 , Figure 1 A flowchart of a method for automatically identifying defects in woven carpet production provided by an embodiment of the present invention. The method comprises the following steps:

[0063] S101, obtaining a surface image of a woven carpet to be inspected.

[0064] S102, preprocessing the surface image to obtain a target image.

[0065] S103, using the target image as an input of the pre-trained defect detection model to obtain a defect detection result.

[0066] Among them, the defect detection model is a deep learning model based on the YOLOv8 model with attention enhancement and lightweight improvement; the specific improvements include: replacing some CBS (Conv2d+BatchNorm+SiLU) modules in the backbone network and the neck network with the generalized separable convolution module GSConv; enhancing the attention of the C2f module to obtain the C2fGSSA module, and replacing the C2f module in the neck network with the C2fGSSA module; adding a small target detection layer to the detection head part, and adding a corresponding feature fusion module to the neck network. The defect detection results include the defect location and type.

[0067] Based on the automatic defect recognition method for woven carpet production provided by the embodiment of the present invention, by introducing the target detection model YOLOv8, it is possible to learn complex texture features from a large number of samples, effectively distinguish normal patterns from defects, and greatly improve the recognition accuracy. At the same time, by adding a small target detection layer, the model has a higher sensitivity when detecting small target defects, and the detection ability of small target defects such as fine line breaks and tiny stains is significantly enhanced, reducing the phenomenon of missed detection.

[0068] In one implementation, preprocessing includes resizing (adjusting the image size to the input size required by the model, such as 640*640) and normalization (subtracting the mean used during training from each channel of the image and dividing it by the standard deviation) to ensure that the input image can adapt to the structure and requirements of the model.

[0069] In one embodiment, see Figure 2 , Figure 2 A network structure diagram of YOLOv8 provided in an embodiment of the present invention. The original YOLOv8 model consists of a backbone network Backbone, a neck network Neck, and a detection head Head; wherein the backbone network and the neck network have a total of 22 layers, and each layer corresponds to an operation module. It should be noted that the layer number starts from 0, and the number N in _N after each module name in the figure represents the N+1th layer, that is, CBS_0 represents the first layer, C2f_2 represents the third layer, and so on. See Figure 3 , Figure 3 A network structure diagram of a defect detection model provided by an embodiment of the present invention. The defect detection model is obtained by performing attention enhancement and lightweight improvement based on the YOLOv8 model.

[0070] In one implementation, part of the CBS in the backbone network and the neck network is replaced with a generalized separable convolution module GSConv (Generalized Separable Convolution). Specifically: the CBS modules in the second, fourth, sixth, eighth, seventeenth, and twentieth layers are replaced with GSConv modules.

[0071] GSConv decomposes the standard convolution operation into depthwise convolution and pointwise convolution. This structure significantly reduces the number of parameters and computational complexity of the convolution operation. Choosing to replace a specific layer with GSConv can optimize the computational efficiency of a specific part of the network while retaining the feature extraction capability of the key layer to ensure that the detection performance does not degrade.

[0072] In one implementation, the C2f module is enhanced with attention to obtain a C2fGSSA module, and the C2f module in the neck network is replaced with the C2fGSSA module. Specifically:

[0073] See also Figure 4 , Figure 4 A schematic diagram of the structure of a C2fGSSA module provided in an embodiment of the present invention.

[0074] like Figure 4 As shown in (a) in Fig. 1, the C2f module includes a standard convolution module CBS and n bottleneck structure modules Bottleneck; Figure 4 As shown in (b), each bottleneck structure module includes two CBS modules;

[0075] The CBS module in the bottleneck structure module is replaced by the GSConv module, and the SimAM attention module is added thereto to obtain the improved bottleneck structure module GSSABottleneck; each bottleneck structure module in the C2f module is replaced by the improved bottleneck structure module to obtain the C2fGSSA module. In the embodiment of the present invention, n=1 is taken, and the C2fGSSA module is described as containing one bottleneck structure module, as follows: Figure 4 As shown in (c) in the figure, the calculation process of the C2fGSSA module is:

[0076]

[0077] Among them, P is the input feature map; f CBS represents convolution operation; split represents channel segmentation; f GSSABottleneck represents the operation of the GSSABottleneck module; concat represents channel concatenation; X4 is the output of the C2fGSSA module; X0, X1, X2, and X3 are feature maps generated during the calculation process.

[0078] like Figure 4 As shown in (d) in the figure, the calculation process of the improved bottleneck structure module GSSABottleneck is:

[0079] X2=fSimAM (f GSConv (f GSConv (X1)));

[0080] Among them, X1 is the input of the improved bottleneck structure module; f GSConv represents the convolution operation of the GSConv module; f SimAM represents the weighted calculation of the SimAM attention module; X2 is the output of the improved bottleneck structure module;

[0081] Replace all C2f modules in the neck network with C2fGSSA modules.

[0082] SimAM is a lightweight attention mechanism that aims to enhance the model's attention to key areas by adaptively weighting the significance of each pixel in the feature map. At the same time, its calculation process is very simple, mainly relying on mean calculation and activation function (Sigmoid), and the computational overhead is much lower than complex attention modules (such as SENet, CBAM, etc.). After replacing the CBS module in the bottleneck structure with the GSConv module, adding the SimAM attention module can reduce the amount of calculation while suppressing irrelevant information in the complex background, so that the model can focus more on the defective area on the carpet, thereby improving the accuracy of detection.

[0083] In one implementation, a small target detection layer is added to the detection head, and a corresponding feature fusion module is added to the neck network.

[0084] Modify the output-input relationship between the fifteenth and sixteenth layers, use the output of the fifteenth layer as the input of the feature fusion module, and use the output of the feature fusion module as the input of the sixteenth layer (the modified network will change the number of network layers and feature transfer direction, and the layer definition of the original YOLOv8 model remains unchanged for description).

[0085] See also Figure 3 In the dotted box, the computation process of the feature fusion module includes:

[0086]

[0087] Among them, D1 is the feature map output by the fifteenth layer; P2 is the feature map output by the third layer; Y1, Y2 and Y3 are the feature maps generated by the operation process, and Y3 is used as the predicted feature map of the small target detection layer detect4; Y4 is the output of the feature fusion module; f C2fGSSA Indicates the operation of the G2fGSSA module; upsample indicates upsampling; concat indicates channel concatenation; f CSConv Represents the convolution operation of the GSConv module.

[0088] The detection head of the YOLOv8 model has three detection layers, which process feature maps of different sizes (such as 20*20, 40*40, and 80*80) respectively. On the basis of the three detection layers, a small target detection layer is added to obtain a larger feature map (such as 160*160) for small target detection, thereby making full use of deep and shallow features and reducing the missed detection rate of small target defects.

[0089] In one embodiment, the YOLOv8 model uses a decoupled detection head, participating in Figure 5 , Figure 5 It is a structural diagram of a decoupled detection head. As shown in the figure, the classification and regression branches each use independent loss functions. For example, for the classification loss Cls-Loss, the loss function used can be Focal Loss; for the bounding box regression loss Bbox-Loss, the loss function used can be CIoU Loss. During the model training process, for the regression branch, the loss function MPDIoU is used to replace the original loss function CIoU; according to the position coordinates (x1, y1, x2, y2) of the real box and the position coordinates of the predicted box Perform loss calculation; the calculation process of the loss function MPDIoU includes:

[0090]

[0091] Among them, d1 and d2 are the Euclidean distances between the upper left corner and the lower right corner of the real box and the predicted box respectively; IoU is the intersection over union of the areas of the real box and the predicted box; H and W are the height and width of the target image.

[0092] By calculating the Euclidean distance between the upper left corner and the lower right corner of the real box and the predicted box, the positioning error of the bounding box is evaluated more carefully, which can more effectively guide the optimization of the bounding box and make the predicted box converge to the correct position more quickly. Compared with CIoU, which mainly optimizes the center point offset, MPDIoU adds constraints on the border vertices, making the regression branch more accurate when dealing with irregular or small objects.

[0093] The embodiment of the present invention provides a system for automatically identifying defects in woven carpet production. Figure 6 , Figure 6 This is a diagram of the architecture of a system for automatically identifying defects in woven carpet production provided by an embodiment of the present invention. The system includes:

[0094] The data acquisition module is used to acquire the surface image of the woven carpet to be inspected.

[0095] The preprocessing module is used to preprocess the surface image to obtain the target image.

[0096] The detection module is used to take the target image as the input of the pre-trained defect detection model to obtain the defect detection result.

[0097] Among them, the defect detection model is a deep learning model obtained by attention enhancement and lightweight improvement based on the YOLOv8 model; the specific improvements include: replacing some CBS modules in the backbone network and the neck network with the generalized separable convolution module GSConv; enhancing the attention of the C2f module to obtain the C2fGSSA module, and replacing the C2f module in the neck network with the C2fGSSA module; adding a small target detection layer to the detection head part, and adding a corresponding feature fusion module in the neck network.

[0098] Based on the automatic defect recognition system for woven carpet production provided by the embodiment of the present invention, by introducing the target detection model YOLOv8, it is possible to learn complex texture features from a large number of samples, effectively distinguish normal patterns from defects, and greatly improve the recognition accuracy. At the same time, by adding a small target detection layer, the model has a higher sensitivity when detecting small target defects, and the detection ability of small target defects such as fine line breaks and tiny stains is significantly enhanced, reducing the phenomenon of missed detection.

[0099] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.

Claims

1. A method for automatically identifying defects in woven carpet production, characterized in that: The method comprises: Acquiring a surface image of a woven carpet to be inspected; Preprocessing the surface image to obtain a target image; Using the target image as an input of a pre-trained defect detection model to obtain a defect detection result; The defect detection model is a deep learning model based on the YOLOv8 model with attention enhancement and lightweight improvements; the specific improvements include: Replace some CBS modules in the backbone network and neck network with generalized separable convolution modules GSConv; Perform attention enhancement on the C2f module to obtain the C2fGSSA module, and replace the C2f module in the neck network with the C2fGSSA module; A small target detection layer is added to the detection head, and a corresponding feature fusion module is added to the neck network.

2. The method for automatically identifying defects in woven carpet production according to claim 1, characterized in that: The original YOLOv8 model has a total of 22 layers in the backbone network and the neck network, and each layer corresponds to a computing module; The method of replacing part of the CBS in the backbone network and the neck network with the generalized separable convolution module GSConv includes: Replace the CBS modules in the second, fourth, sixth, eighth, seventeenth, and twentieth layers with GSConv modules.

3. The method for automatically identifying defects in woven carpet production according to claim 1, characterized in that: The C2f module consists of a standard convolution module and a bottleneck structure module; each bottleneck structure module includes two CBS modules; The C2f module is enhanced with attention to obtain a C2fGSSA module, which includes: The CBS module in the bottleneck structure module is replaced by the GSConv module, and the SimAM attention module is added thereto to obtain an improved bottleneck structure module; the calculation process of the improved bottleneck structure module is: X2=f SimAM (f GSConv (f GSConv (X1))); Among them, X1 is the input of the improved bottleneck structure module; f GSConv represents the convolution operation of the GSConv module; f SimAM represents the weighted calculation of the SimAM attention module; X2 is the output of the improved bottleneck structure module; Each bottleneck structure module in the C2f module is replaced by an improved bottleneck structure module to obtain a C2fGSSA module.

4. The method for automatically identifying defects in woven carpet production according to claim 1, characterized in that: The method of adding a small target detection layer to the detection head and adding a corresponding feature fusion module to the neck network includes: Modify the output-input relationship between the fifteenth layer and the sixteenth layer, use the output of the fifteenth layer as the input of the feature fusion module, and use the output of the feature fusion module as the input of the sixteenth layer; The operation process of the feature fusion module includes: Wherein, D1 is the feature map output by the fifteenth layer; P2 is the feature map output by the third layer; Y1, Y2 and Y3 are the feature maps generated by the operation process, and Y3 is used as the predicted feature map of the small target detection head; Y4 is the output of the feature fusion module; f C2fGSSA Indicates the operation of the G2fGSSA module; upsample indicates upsampling; concat indicates channel concatenation; f CSConv Represents the convolution operation of the GSConv module.

5. The method for automatically identifying defects in woven carpet production according to claim 1, characterized in that: During the model training process, the loss function MPDIoU is used to replace the loss function CIoU of the original YOLOv8 model; the calculation process of the loss function MPDIoU includes: Among them, x1, y1, x2, y2 are the coordinate representations of the real box; is the coordinate representation of the prediction box; d1 and d2 are the Euclidean distances between the upper left corner and the lower right corner of the real box and the prediction box, respectively; IoU is the intersection over union of the real box and the prediction box; H and W are the height and width of the target image.

6. A system for automatically identifying defects in woven carpet production, characterized in that: The system comprises: A data acquisition module, used for acquiring a surface image of the woven carpet to be inspected; A preprocessing module, used for preprocessing the surface image to obtain a target image; A detection module is used to use the target image as the input of a pre-trained defect detection model to obtain a defect detection result; the defect detection model is a deep learning model obtained by performing attention enhancement and lightweight improvement based on the YOLOv8 model; the specific improvements include: replacing some CBS modules in the backbone network and the neck network with the generalized separable convolution module GSConv; performing attention enhancement on the C2f module to obtain the C2fGSSA module, and replacing the C2f module in the neck network with the C2fGSSA module; adding a small target detection layer in the detection head part, and adding a corresponding feature fusion module in the neck network.

7. The automatic defect identification system for woven carpet production according to claim 6 is characterized in that: The original YOLOv8 model has a total of 22 layers in the backbone network and the neck network, and each layer corresponds to a computing module; The method of replacing part of the CBS in the backbone network and the neck network with the generalized separable convolution module GSConv includes: Replace the CBS modules in the second, fourth, sixth, eighth, seventeenth, and twentieth layers with GSConv modules.

8. The automatic defect identification system for woven carpet production according to claim 6 is characterized in that: The C2f module consists of a standard convolution module and a bottleneck structure module; each bottleneck structure module includes two CBS modules; The C2f module is enhanced with attention to obtain a C2fGSSA module, which includes: The CBS module in the bottleneck structure module is replaced by the GSConv module, and the SimAM attention module is added thereto to obtain an improved bottleneck structure module; the calculation process of the improved bottleneck structure module is: X2=f SimAM (f GSConv (f GSConv (X1))); Among them, X1 is the input of the improved bottleneck structure module; f GSConv represents the convolution operation of the GSConv module; f SimAM represents the weighted calculation of the SimAM attention module; X2 is the output of the improved bottleneck structure module; Each bottleneck structure module in the C2f module is replaced by an improved bottleneck structure module to obtain a C2fGSSA module.

9. The automatic defect identification system for woven carpet production according to claim 6, characterized in that: The method of adding a small target detection layer to the detection head and adding a corresponding feature fusion module to the neck network includes: Modify the output-input relationship between the fifteenth layer and the sixteenth layer, use the output of the fifteenth layer as the input of the feature fusion module, and use the output of the feature fusion module as the input of the sixteenth layer; The operation process of the feature fusion module includes: Wherein, D1 is the feature map output by the fifteenth layer; P2 is the feature map output by the third layer; Y1, Y2 and Y3 are the feature maps generated by the operation process, and Y3 is used as the predicted feature map of the small target detection head; Y4 is the output of the feature fusion module; f C2fGSSA Indicates the operation of the G2fGSSA module; upsample indicates upsampling; concat indicates channel concatenation; f CSConv Represents the convolution operation of the GSConv module.

10. The automatic defect identification system for woven carpet production according to claim 6, characterized in that: During the model training process, the loss function MPDIoU is used to replace the original loss function CIoU; the calculation process of the loss function MPDIoU includes: Among them, x1, y1, x2, y2 are the coordinate representations of the real box; is the coordinate representation of the predicted box; d1 and d2 are the Euclidean distances between the upper left corner and the lower right corner of the real box and the predicted box, respectively; IoU is the intersection over union of the real box and the predicted box; H and W are the height and width of the target image.

Citation Information

Patent Citations

  • Method for detecting green crisp plums in complex scene based on improved YOLOv8

    CN117612158A

  • Fancy cloth defect detection method and system and storage medium

    CN117974673A

  • Improved YOLOv8 dense pedestrian detection method based on GSConv + VOV-GSCSP

    CN118015539A

  • Optical substrate surface defect detection method based on improved YOLOv8n model

    CN118297924A

  • Old people falling detection method based on improved YOLOv8 model

    CN118692139A