A system and method for automatically identifying defects in woven carpet production

By improving the YOLOv8 model, the problem of low recognition accuracy in woven carpet defect detection was solved, the detection capability of complex textures and small target defects was improved, and efficient automated detection was achieved.

CN119942313BActive Publication Date: 2025-10-03WEIHAI HAIMA DAHUA CARPET CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional machine vision methods have low recognition accuracy in woven carpet defect detection, especially in the detection of complex textures and small target defects, which makes it difficult to meet the needs of modern industry.

Method used

An improved YOLOv8 model is adopted. By replacing the CBS module in the backbone network and the neck network with the generalized separable convolution module GSConv, attention is enhanced. A small target detection layer and a feature fusion module are added to the detection head. The MPDIoU loss function is used to optimize model training.

Benefits of technology

It significantly improves the recognition accuracy of woven carpet defects, enhances the detection capability of complex textures and small target defects, and reduces missed detections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942313B_ABST
    Figure CN119942313B_ABST
Patent Text Reader

Abstract

The present invention discloses a system and method for automatically identifying defects in woven carpet production, and relates to the technical field of image processing. A defect detection model is obtained by performing attention enhancement and lightweight improvements on the YOLOv8 model, including adding an attention mechanism to the neck network and adding a small target detection layer to the detection head. The trained model is applied to the defect detection of woven carpets, and the surface image of the woven carpet to be detected is obtained and preprocessed to obtain a target image; the target image is input into the 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 can be effectively distinguished, and the recognition accuracy rate can be greatly improved. At the same time, the addition of the small target detection layer makes the model have 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.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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] Machine-woven carpets are a high-end decorative material widely used in homes, offices, and commercial spaces. Their quality is directly related to the product's market competitiveness. During the carpet production process, due to differences in raw material quality, weaving techniques, and dyeing technology, defects such as broken threads, stains, color variations, and damage are prone to occur.

[0003] Traditional carpet defect detection relies primarily on manual inspection. With the continuous expansion of carpet production and the increase in production speed, the efficiency and accuracy of manual inspection are gradually failing to meet the needs of modern industry. Manual inspection consumes a large amount of manpower, and long-term work can easily lead to fatigue, thereby increasing the rate of false detections and missed detections. In recent years, machine vision technology has been introduced to carpet defect detection in the hope of replacing manual inspection. Traditional rule-based machine vision methods identify defects through methods such as edge detection and color difference analysis, 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 misidentifying the normal carpet pattern as a defect or are unable to effectively distinguish defects from the background. Furthermore, traditional methods have limited detection capabilities for small target defects (such as fine line breaks or tiny stains), resulting in low recognition accuracy, making them difficult to meet practical 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] A 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 input to 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. 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 replacement of 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 consists of a standard convolution module and a bottleneck structure module; each bottleneck structure module includes two CBS modules;

[0017] The C2f module is subjected to attention enhancement 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 after it 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 the C2fGSSA module.

[0022] Optionally, the adding of a small target detection layer in the detection head 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 computation process of the feature fusion module includes:

[0025]

[0026] 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 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 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 areas of the real box and the predicted 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, configured to preprocess the surface image to obtain a target image;

[0033] A detection module is configured to use the target image as input to a pre-trained defect detection model to obtain defect detection results; the defect detection model is a deep learning model based on the YOLOv8 model that has been improved through attention enhancement and lightweighting; specific improvements include: replacing some CBS modules in the backbone network and the neck network with generalized separable convolution modules GSConv; performing attention enhancement on the 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 to the detection head, and adding a corresponding feature fusion module to 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 replacement of 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 consists of a standard convolution module and a bottleneck structure module; each bottleneck structure module includes two CBS modules;

[0038] The C2f module is subjected to attention enhancement 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 after it 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 the C2fGSSA module.

[0043] Optionally, the adding of a small target detection layer in the detection head 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 computation process of the feature fusion module includes:

[0046]

[0047] 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 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 areas 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: obtaining a surface image of a woven carpet to be inspected; preprocessing the surface image to obtain a target image; using the target image as 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 improvements on the YOLOv8 model; specific improvements include: replacing some CBS modules in the backbone network and the neck network with generalized separable convolution modules GSConv; performing attention enhancement on the C2f module to obtain a 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.

[0053] By introducing the object detection model YOLOv8, it can learn complex texture features from a large number of samples, effectively distinguishing normal patterns from defects, and significantly improving recognition accuracy. Furthermore, the addition of a small object detection layer gives the model greater sensitivity in detecting small defects, significantly enhancing its ability to detect small defects such as fine line breaks and minor stains, and reducing missed detections. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0056] Figure 2 A YOLOv8 network structure diagram 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 structural diagram of a C2fGSSA module is provided for an embodiment of the present invention;

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

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

[0061] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making any creative efforts shall fall 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 includes 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 input to the pre-trained defect detection model to obtain a defect detection result.

[0066] The defect detection model is a deep learning model based on the YOLOv8 model, enhanced with attention and lightweight improvements. Specific improvements include replacing some CBS (Conv2d+BatchNorm+SiLU) modules in the backbone and neck networks with generalized separable convolutional modules (GSConv); performing attention enhancement on the C2f module to obtain a C2fGSSA module, which is then replaced with a C2fGSSA module in the neck network; adding a small object detection layer to the detection head and a corresponding feature fusion module to the neck network. Defect detection results include defect location and type.

[0067] An automatic defect identification method for woven carpet production, provided by an embodiment of the present invention, utilizes the object detection model YOLOv8 to learn complex texture features from a large number of samples, effectively distinguishing between normal patterns and defects, and significantly improving recognition accuracy. Furthermore, the addition of a small target detection layer gives the model greater sensitivity in detecting small defects, significantly enhancing its ability to detect small defects such as thread breaks and minor stains, and reducing missed detections.

[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 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 This is a network structure diagram of YOLOv8 provided by an embodiment of the present invention. The original YOLOv8 model consists of a backbone network, a neck network, and a detection head. 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. 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 based on the YOLOv8 model with attention enhancement and lightweight improvements.

[0070] In one implementation, some CBS modules in the backbone and neck networks are replaced with generalized separable convolution (GSConv) modules. 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. Replacing specific layers with GSConv optimizes computational efficiency in specific parts of the network while preserving the feature extraction capabilities of key layers, ensuring no degradation in detection performance.

[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 structural diagram of a C2fGSSA module provided in an embodiment of the present invention.

[0074] like Figure 4 As shown in (a) in the figure, 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 after it 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 this 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), 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 focus on key areas by adaptively weighting the saliency of each pixel in the feature map. Its computational process is very simple, relying mainly on mean calculation and activation function (Sigmoid). Its computational overhead is much lower than that of complex attention modules (such as SENet and CBAM). After replacing the CBS module in the bottleneck structure with the GSConv module and adding the SimAM attention module, the amount of computation can be reduced while suppressing irrelevant information in the complex background, allowing the model to focus more on the defective areas on the carpet, thereby improving detection accuracy.

[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. The layer definition of the original YOLOv8 model remains unchanged for description).

[0085] See also Figure 3 In the dotted box, the computational 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). 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 fully utilizing 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, Figure 5 , Figure 5 It is a structural diagram of the 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 of the real box (x1, y1, x2, y2) 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 top-left and bottom-right corners of the ground-truth bounding box and the predicted box, the bounding box positioning error is more carefully evaluated, which can more effectively guide bounding box optimization and enable the predicted box to converge to the correct position more quickly. Compared to CIoU, which primarily optimizes center point offset, MPDIoU adds constraints on bounding box vertices, making the regression branch more accurate when handling 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 a 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 results.

[0097] Among them, the defect detection model is a deep learning model obtained by attention enhancement and lightweight improvement based on the YOLOv8 model; specific improvements include: replacing some CBS modules in the backbone network and neck network with generalized separable convolution modules 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] An automatic defect recognition system for woven carpet production, provided by an embodiment of the present invention, utilizes the object detection model YOLOv8 to learn complex texture features from a large number of samples, effectively distinguishing between normal patterns and defects, and significantly improving recognition accuracy. Furthermore, the addition of a small target detection layer gives the model greater sensitivity in detecting small defects, significantly enhancing its ability to detect small defects such as thread breaks and minor stains, and reducing missed detections.

[0099] The above is a detailed description of an embodiment of the present invention. However, the content described is only a preferred embodiment of the present invention and should not be considered to limit the scope 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 input to 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. 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; Add a small target detection layer to the detection head and a corresponding feature fusion module to the neck network; Among them, 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 subjected to attention enhancement 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 after it to obtain an improved bottleneck structure module; the calculation process of the improved bottleneck structure module is: Among them, X1 is the input of the improved bottleneck structure module; Represents the convolution operation of the GSConv module; 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 the C2fGSSA module; The addition of a small target detection layer to the detection head and the addition of a corresponding feature fusion module to the neck network include: 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 computation 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 layer; Y4 is the output of the feature fusion module; Indicates the operation of the G2fGSSA module; upsample indicates upsampling; concat indicates channel concatenation; Represents the convolution operation of the GSConv module.

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 and neck networks, with each layer corresponding to a computing module. The replacement of 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: During model training, 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: in, is the coordinate representation of the real box; Is the coordinate representation of the prediction box; 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.

4. 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, configured to preprocess the surface image to obtain a target image; A detection module is configured to use the target image as input to a pre-trained defect detection model to obtain defect detection results. The defect detection model is a deep learning model based on the YOLOv8 model, which has been improved by performing attention enhancement and lightweighting. Specific improvements include: replacing some CBS modules in the backbone network and the neck network with generalized separable convolution modules (GSConv); performing attention enhancement on the 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 to the detection head and a corresponding feature fusion module to the neck network; Among them, 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 subjected to attention enhancement 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 after it to obtain an improved bottleneck structure module; the calculation process of the improved bottleneck structure module is: Among them, X1 is the input of the improved bottleneck structure module; Represents the convolution operation of the GSConv module; 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 the C2fGSSA module; The addition of a small target detection layer to the detection head and the addition of a corresponding feature fusion module to the neck network include: 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 computation 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 layer; Y4 is the output of the feature fusion module; Indicates the operation of the G2fGSSA module; upsample indicates upsampling; concat indicates channel concatenation; Represents the convolution operation of the GSConv module.

5. The automatic defect identification system for woven carpet production according to claim 4 is characterized in that: The original YOLOv8 model has a total of 22 layers in the backbone and neck networks, with each layer corresponding to a computing module. The replacement of 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.

6. The automatic defect identification system for woven carpet production according to claim 4 is 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: in, is the coordinate representation of the real box; Is the coordinate representation of the prediction box; 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.

Citation Information

Patent Citations

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

    CN117612158A

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

    CN118015539A

  • Old people falling detection method based on improved YOLOv8 model

    CN118692139A

  • Fabric defect detection method, computer equipment and medium

    CN119180809A