A defect recognition method and system based on efficient multi-path feature fusion network

By introducing GFPN and cross-scale connections into the YOLOv5s model and combining it with the C3Ghost and Dysample methods, the problem of insufficient fusion of deep and shallow features is solved, the accuracy and computational efficiency of defect detection are improved, and it is suitable for cloth defect recognition in resource-constrained environments.

CN119540643BActive Publication Date: 2025-09-23ZHEJIANG SCI-TECH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411693372.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-09-23
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

The existing YOLOv5s model cannot effectively fuse deep and shallow, large-scale and small-scale feature information when processing objects of different scales and proportions, resulting in insufficient detection performance and high computational complexity in cloth defect detection under complex texture backgrounds.

Method used

The global feature pyramid network (GFPN) and cross-scale connections are introduced, combined with the C3Ghost lightweight feature fusion node and Dysample method, to optimize the Neck network of the YOLOv5s model, achieve efficient fusion of deep and shallow, large-scale and small-scale features, transmit information through cross-level and cross-scale connection layers, and use lightweight upsampling technology to reduce computational complexity.

Benefits of technology

It improves the accuracy and reliability of defect recognition, reduces computational complexity and parameter quantity, is suitable for resource-constrained environments, avoids the loss of high-frequency information of feature images, and improves the accuracy of defect recognition and detail retention capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540643B_ABST
    Figure CN119540643B_ABST
Patent Text Reader

Abstract

The present application discloses a defect recognition method and system based on an efficient multi-path feature fusion network, relating to the technical field of cloth defect detection. The method solves the problems in the prior art of being unable to effectively fuse deep and shallow layers, large-scale and small-scale feature information, as well as the high computational complexity and large number of model parameters of the prior model. The method comprises: constructing a cloth defect dataset, constructing an improved YOLOv5s model and performing model training, wherein the improvements comprise: integrating GFPN into the Neck network of YOLOv5s, introducing cross-scale connection layers between interval layers and cross-layer skip connection layers between the same scales in the backbone network, adopting C3Ghost lightweight feature fusion nodes in the Neck network, and adopting the Dysample method to upsample the deep feature map, effectively fusing deep and shallow layers, large-scale and small-scale feature information, thereby improving the performance of the YOLOv5s model in multi-scale and multi-scale target detection, and reducing the computational parameters and complexity of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cloth defect detection, and in particular to a defect recognition method and system based on an efficient multi-path feature fusion network. Background Art

[0002] As a vital component of the global economy, the textile industry has been experiencing rapid growth in recent years driven by technological advancements and shifting market demands. Particularly in the areas of automated and intelligent production, the industry is increasingly demanding efficient and accurate defect detection technologies. Traditional manual inspection methods are inefficient, labor-intensive, and even subject to subjective factors, resulting in unstable results. Therefore, computer vision-based automatic defect detection technology has become a pressing issue for the textile industry. Object detection technology has long been a hot research topic in the field of computer vision. With the rapid development of deep learning, convolutional neural networks (CNNs) have achieved remarkable success in object detection tasks. The YOLO (You Only Look Once) model family exemplifies this progress, providing real-time object detection through an end-to-end approach. However, traditional YOLO models still face challenges when dealing with objects of varying scales and proportions.

[0003] The existing YOLOv5s model combines a Feature Pyramid Network (FPN) and a Path Aggregation Network (PAN) to achieve the fusion of primary features. FPN enhances the semantic information of feature maps through a top-down path, while PAN strengthens the localization capability of feature maps through a bottom-up path. However, this structure only considers the feature interactions between adjacent levels, resulting in a lack of shallow details in the feature maps fused by FPN, and a lack of deep semantic information in the feature maps fused by PAN. In the detection of cloth defects in complex texture backgrounds, shallow features mainly contain detailed information such as texture and defect edges, while deep features contain high-level semantic information related to classification and context. Therefore, how to effectively fuse deep and shallow, large-scale and small-scale feature information becomes the key to improving object detection performance. Summary of the Invention

[0004] The purpose of this application is to overcome the problems in the existing technology that deep and shallow, large-scale and small-scale feature information cannot be effectively integrated, as well as the high computational complexity and large number of model parameters of the existing model, and to provide a defect recognition method and system based on an efficient multi-path feature fusion network.

[0005] In a first aspect, a defect recognition method based on an efficient multi-path feature fusion network is provided, comprising:

[0006] Build a cloth defect dataset;

[0007] An improved YOLOv5s model was constructed by integrating GFPN into the Neck network of YOLOv5s, introducing cross-scale connection layers between interval layers and cross-layer skip connection layers within the same scale into the backbone network, using C3Ghost lightweight feature fusion nodes in the Neck network, and using the Dysample method to upsample deep feature maps.

[0008] The improved YOLOv5s model is trained using the cloth defect dataset to obtain a defect recognition model;

[0009] Obtain the cloth image to be inspected, and use the defect recognition model to perform defect recognition on the cloth image to be inspected.

[0010] In some possible implementations, the C3Ghost lightweight feature fusion node generates intrinsic features through Ghost convolution combined with main convolution, and generates Ghost features through auxiliary depth-wise separable convolution, which are finally spliced ​​into an output feature map. The calculation formula for Ghost feature extraction is:

[0011] X′ in =DWConv(Conv(X in ))

[0012] X out =Cat[(X in ,X′ in ),1]

[0013] Among them, X in To fuse the input features, X in ∈R W×H×C ;X out is the output Ghost feature; Cat[,1] is the sub-feature tensor splicing operation in the channel dimension.

[0014] In some possible implementations, the Dysample method first receives a low-resolution feature map as input, uses a linear layer to calculate the sampling point offset to determine the position during upsampling, performs channel adjustment and mapping convolution according to the upsampling ratio to generate an overall offset, and limits the offset by a static range factor. Then, using pixel reconstruction technology, the offset matrix dimension is adjusted to sW×sH×2g. The final generated sampling set Sa is composed of the offset Of and the original sampling grid Ga, and its mathematical expression is as follows:

[0015] Of=PixSh(y·Conv 1.1 (P))

[0016] Sa=Of+Ga

[0017] Among them, P is the input feature map; g is the number of group convolutions; Conv 1.1 It is a point convolution, and the number of output channels is 2gs 2 ; y is the pixel offset range factor; PixSh is the pixel reconstruction operation.

[0018] In some possible implementations, in the cross-scale connection layer between interval levels, the intermediate-scale feature information of the i-th layer is expressed as follows:

[0019]

[0020] Among them, P i te is the intermediate scale feature information of the i-th cross-scale connection layer; P i ba is the primary feature of the backbone layer corresponding to the intermediate scale layer i; corresponds to the cross-scale feature information; is the intermediate scale feature information of the i-1th layer; C3GConv is the fusion node combined with GhostConv; GConv is the unified Ghost convolution of the i-th layer scale; is the learning weight corresponding to each feature information; β is the fusion bias.

[0021] In some possible implementations, in the cross-layer skip connection layer between the same scales, the intermediate scale feature information of the jth layer is expressed as follows:

[0022]

[0023] in, is the intermediate scale feature information of the j-th same-scale skip layer; is the corresponding skip layer feature information; is the intermediate-scale feature information of the j-1th same-scale skip layer; Cat is the merging of each fusion feature by channel.

[0024] In the second aspect, a defect recognition system based on an efficient multi-path feature fusion network is provided, comprising:

[0025] Dataset construction module, used to construct cloth defect dataset;

[0026] The model construction module is used to build an improved YOLOv5s model. Specifically, it integrates GFPN into the Neck network of YOLOv5s, introduces cross-scale connection layers between interval layers and cross-layer skip connection layers between the same scales in the backbone network, adopts C3Ghost lightweight feature fusion nodes in the Neck network, and uses the Dysample method to upsample deep feature maps;

[0027] The model training module is used to train the improved YOLOv5s model using the cloth defect dataset to obtain a defect recognition model;

[0028] The detection module is used to obtain the cloth image to be detected and use the defect recognition model to perform defect recognition on the cloth image to be detected.

[0029] In some possible implementations, the C3Ghost lightweight feature fusion node generates intrinsic features through Ghost convolution combined with main convolution, and generates Ghost features through auxiliary depth-wise separable convolution, which are finally spliced ​​into an output feature map. The calculation formula for Ghost feature extraction is:

[0030] X′ in =DWConv(Conv(X in ))

[0031] X out =Cat[(X in ,X′ in ),1]

[0032] Among them, X in To fuse the input features, X in ∈R W×H×C ;X out is the output Ghost feature; Cat[,1] is the sub-feature tensor splicing operation in the channel dimension.

[0033] In some possible implementations, the Dysample method first receives a low-resolution feature map as input, uses a linear layer to calculate the sampling point offset to determine the position during upsampling, performs channel adjustment and mapping convolution according to the upsampling ratio to generate an overall offset, and limits the offset by a static range factor. Then, using pixel reconstruction technology, the offset matrix dimension is adjusted to sW×sH×2g. The final generated sampling set Sa is composed of the offset Of and the original sampling grid Ga, and its mathematical expression is as follows:

[0034] Of=PixSh(y·Conv 1.1 (P))

[0035] Sa=Of+Ga

[0036] Among them, P is the input feature map; g is the number of group convolutions; Conv 1.1 It is a point convolution, and the number of output channels is 2gs 2 ; y is the pixel offset range factor; PixSh is the pixel reconstruction operation.

[0037] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable medium stores program code for execution by a device, the program code including steps for executing the method in any one of the implementations of the first aspect.

[0038] In a fourth aspect, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements a method as in any one of the implementations of the first aspect described above.

[0039] This application has the following beneficial effects:

[0040] 1. Enhanced multi-scale feature fusion capabilities: By introducing the Global Feature Pyramid Network (GFPN) and cross-scale connections, this application can effectively fuse deep and shallow, large-scale and small-scale feature information, improving the performance of the YOLOv5s model in multi-scale and multi-scale object detection. In particular, in the detection of cloth defects in complex texture backgrounds, it can more accurately identify and locate defects, improving the accuracy and reliability of defect recognition.

[0041] 2. Improved computational efficiency: This application uses the C3Ghost efficient and lightweight feature fusion node, which significantly reduces the computational parameters and complexity of the YOLOv5s model while maintaining good characterization of defect foreground and background, making it suitable for application in resource-constrained environments;

[0042] 3. Enhanced detail retention: This application solves the low-pass filter effect brought by traditional upsampling methods through DySample lightweight dynamic upsampling, avoids the loss of high-frequency information of feature images, and reduces problems such as target edge blur and image distortion. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings that constitute a part of this application are used to provide a further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an improper limitation on this application.

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0045] Figure 1 This is a flow chart of a defect identification method based on an efficient multi-path feature fusion network according to Example 1 of the present application;

[0046] Figure 2 This is a diagram of the Neck network structure in the defect identification method based on an efficient multi-path feature fusion network in Example 1 of the present application;

[0047] Figure 3 This is a diagram of the C3Ghost network structure in the defect identification method based on an efficient multi-path feature fusion network in Example 1 of the present application;

[0048] Figure 4 This is a schematic diagram of upsampling a deep feature map using the Dysample method in the defect recognition method based on an efficient multi-path feature fusion network in Example 1 of the present application;

[0049] Figure 5 This is the result of using the improved defect recognition model of Example 1 to recognize the original cloth image;

[0050] Figure 6 This is the result of using the benchmark model to identify the same cloth original image;

[0051] Figure 7 This is a structural block diagram of a defect recognition system based on an efficient multi-path feature fusion network according to Example 2 of the present application;

[0052] Figure 8 This is a schematic diagram of the internal structure of the electronic device of Example 4 of the present application.

[0053] Reference numerals:

[0054] 100, dataset construction module; 200, model construction module; 300, model training module; 400, detection module. DETAILED DESCRIPTION

[0055] 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.

[0056] Example 1

[0057] like Figure 1 As shown, the defect identification method based on an efficient multi-path feature fusion network involved in Example 1 of the present application includes:

[0058] S100, constructing a cloth defect dataset;

[0059] Specifically, first obtain the images required for training the model. This can be done through image capture equipment or by crawling the web to obtain images of fabrics with defects.

[0060] Then, the collected defective cloth images are marked with defects, and duplicate data, missing value data and outlier data are removed. The cloth images without duplicate data, missing value data and outlier data are divided into training set and verification set. For example, the image data is divided into training set and verification set in a ratio of 8:2.

[0061] In a further embodiment, in order to expand the cloth defect dataset, the existing image data may also be expanded through data enhancement technology.

[0062] S200. Build an improved YOLOv5s model, specifically by integrating GFPN into the Neck network of YOLOv5s, introducing cross-scale connection layers between interval layers and cross-layer skip connection layers within the same scale into the backbone network, using the C3Ghost lightweight feature fusion node in the Neck network, and using the Dysample method to upsample deep feature maps;

[0063] In this embodiment, the structure of the feature fusion network is based on the improved Neck network and combines the design concept of GFPN (Global Feature Pyramid Network) to achieve efficient fusion of features at different scales. Subsequently, connections between scales are introduced into the network to allow information exchange between feature maps at different levels. This design enables deeper semantic information and surface detail information to interact and fuse appropriately between different scales. Finally, jump connections are introduced within the same scale to ensure that feature information remains consistent during transmission, thereby effectively avoiding information loss or redundancy.

[0064] In this embodiment, the C3_Ghost node is also used to generate intrinsic features by combining Ghost convolution with main convolution, and Ghost features are generated by auxiliary depth separable convolution (DW convolution). This design maintains good characterization capabilities for the target foreground and background while reducing computational complexity. The generated intrinsic features and Ghost features are spliced ​​to form an output feature map, thereby enhancing the richness of feature expression. The present invention also uses the DySample method to improve the detail perception ability of the feature map through point sampling design. The module receives a low-resolution feature map as input and uses a linear layer to calculate the sampling point offset to determine the position during upsampling. Subsequently, channel adjustment and mapping convolution are performed according to the upsampling ratio to generate an overall offset, and the offset is limited by a static range factor to prevent sampling point overlap and ensure feature consistency.

[0065] like Figure 2As shown in the figure, the original Neck network of the YOLOv5s model has been improved. Incorporating the design concepts of the GFPN, an efficient multi-path feature fusion network architecture is proposed. The Neck component is designed to fuse the primary features extracted by the Backbone at multiple scales, enabling the model to simultaneously localize and detect objects of varying sizes and scales. In the detection of cloth defects in complex textured backgrounds, shallow features primarily contain detailed information such as texture and defect edges, while deep features contain high-level semantic information related to classification and context. The original YOLOv5s combines a Feature Pyramid Network (FPN) and a Path Aggregation Network (PAN) to fuse primary features, but this architecture only considers feature interactions between adjacent layers. As a result, feature maps fused by the FPN lack shallow details, while feature maps fused by the PAN lack deep semantic information. The GFPN (Global Feature Pyramid Network) architecture introduces skip layers and cross-scale connections, effectively transferring feature information from deep to shallow layers and from large to small scales.

[0066] like Figure 2 As shown in the figure, the fusion network adopts a variety of optimization strategies to achieve efficient mapping and fusion of some primary features of Backbone. First, the module introduces cross-scale connections between interval levels and cross-layer jump connections between the same scale in the main branch to ensure sufficient interaction and fusion between deep semantic information and shallow detail information. Secondly, the module uses the C3_Ghost efficient and lightweight feature fusion node to reduce the computational parameters and complexity of the model while maintaining good representation capabilities for the foreground and background of defects. In addition, in order to solve the low-pass filter effect brought about by the nearest neighbor interpolation method in the traditional upsampling process, the network uses the Dysample method to upsample the deep feature map, thereby unifying the size of the feature map between each level. Avoid the loss of high-frequency information of the feature image, reduce the problem of target edge blur and image distortion. In order to characterize the key fusion layers of the improved neck fusion module in detail, in the cross-scale connection layer, the expression of the intermediate scale feature information of the i-th layer is as follows:

[0067]

[0068] In the above formula: P i te is the intermediate scale feature information of the i-th cross-scale connection layer; P i ba is the primary feature of the backbone layer corresponding to the intermediate scale layer i; corresponds to the cross-scale feature information; is the intermediate scale feature information of the i-1th layer; C3GConv is the fusion node combined with GhostConv; GConv is the unified Ghost convolution of the i-th layer scale; is the learning weight corresponding to each feature information; β is the fusion bias.

[0069] like Figure 3 As shown in Figure 1, the C3Ghost structure diagram of the improved fusion nodes of the efficient multi-path feature fusion network is shown. In general convolution, there is similar information between channel features, some of which are intrinsic features and others are Ghost features. Ghost convolution combines the main convolution to generate intrinsic features, and generates Ghost features through auxiliary depth-wise separable convolution (DW convolution), which are finally spliced ​​into the output feature map. This method reduces the consumption of computing resources while maintaining model performance by reducing the convolution kernel and introducing linear transformation. The fusion nodes of the efficient multi-path feature fusion network are improved to C3Ghost. Assume that the fusion input feature is X in , X in ∈R W×H×C The calculation formula for Ghost lightweight convolution feature extraction is as follows:

[0070] X′ in =DWConv(Conv(X in ))

[0071] X out =Cat[(X in ,X′ in ),1]

[0072] In the above formula, X in is the input feature of the module; X out is the output feature of the module; Cat[,1] is the sub-feature tensor splicing operation in the channel dimension.

[0073] To optimize the feature fusion of the model, this paper improves the efficient transmission of deep and shallow features in cross-scale connections, while also improving the transmission of same-scale features. In same-scale skip connections, the feature information of each layer must maintain the same scale to ensure efficiency during the transmission process and avoid information loss or redundancy. In the same-scale skip layer, the intermediate-scale feature information of the jth layer is expressed as follows:

[0074]

[0075] In the above formula: is the intermediate scale feature information of the j-th same-scale skip layer; is the corresponding skip layer feature information; is the intermediate-scale feature information of the j-1th same-scale skip layer; Cat is the merging of each fusion feature by channel.

[0076] To enhance the detail perception of feature maps, this application introduces the DySample lightweight dynamic upsampling module. This ensures effective transfer of semantics and details between features, and maintains consistency and resolution at different scales when implementing multi-path feature fusion.

[0077] like Figure 4 As shown in the figure, the detail perception ability of the feature map is improved through upsampling design. DySample first receives the low-resolution feature map as input and uses the linear layer to calculate the sampling point offset to determine the position during upsampling. Channel adjustment and mapping convolution are performed according to the upsampling ratio s to generate the overall offset, and the offset is limited by the static range factor y to prevent sampling point overlap and ensure feature consistency. Subsequently, the pixel reconstruction technology is used to adjust the offset matrix dimension to sW×sH×2g. The final generated sampling set Sa is composed of the offset Of and the original sampling grid Ga. Its mathematical expression is as follows:

[0078] Of=PixSh(y·Conv 1.1 (P))

[0079] Sa=Of+Ga

[0080] In the above formula: P is the input feature map; g is the number of group convolutions; Conv 1.1 It is a point convolution, and the number of output channels is 2gs 2 ; y is the pixel offset range factor; PixSh is the pixel reconstruction operation.

[0081] S300, using the cloth defect dataset to train the improved YOLOv5s model to obtain a defect recognition model;

[0082] Specifically, the improved YOLOv5s model is trained and verified using the training set and validation set to obtain a defect recognition model that can be used to identify cloth defects. In order to test the performance of the defect recognition model, a test set can also be constructed and input into the defect recognition model to obtain prediction results to test the performance of the defect recognition model, and the defect recognition model can be further optimized based on the test results.

[0083] S400: Acquire a cloth image to be detected, and use a defect recognition model to perform defect recognition on the cloth image to be detected.

[0084] In this embodiment, a camera is used to obtain a video of the cloth in real time, and a defect recognition model is used to identify defects in each frame of the video. In order to save computing resources, images can also be captured from the video at preset time intervals, and the defect recognition model is used to identify defects in the captured images. Figure 5The figure shows the result of using the improved defect recognition model of this embodiment to identify the original cloth image. Figure 6 The figure shows the result of using the benchmark model (i.e., YOLOv5s model) to identify the same original cloth image. It can be seen that the benchmark model cannot identify the second type of skipped yarn defects, and the recognition of the third group of scattered yarn defects is not accurate enough. The defect recognition model of this application can accurately identify skipped yarn and scattered yarn defects.

[0085] As shown in Table 1 below, this is a validity analysis table of the improved YOLOv5s model provided in this embodiment:

[0086]

[0087]

[0088] As can be seen from Table 1 above, the recognition accuracy P, recall R, and mAP of the improved YOLOv5s model in this embodiment are improved compared to the baseline model (YOLOv5s), which shows that the improved YOLOv5s model in this embodiment has better performance in the defect recognition task, can detect defects more accurately, and reduce false detections and missed detections.

[0089] In this example, the original Neck network of the YOLOv5s model is improved. Incorporating the design concept of GFPN, a highly efficient multi-path feature fusion network is proposed. This effectively avoids the problem of loss of original backbone features after the fusion of neck features. First, the module introduces cross-scale connections between interval layers and cross-layer skip connections within the same scale in the main branch to ensure sufficient interaction and fusion between deep semantic information and shallow detail information. Second, the module uses the C3_Ghost efficient and lightweight feature fusion node. By integrating GhostConv with its connection structure, the module reduces the model's computational parameters and complexity while maintaining good representation of defect foreground and background.

[0090] like Figure 7 As shown, the defect recognition system based on an efficient multi-path feature fusion network involved in Example 2 of the present application includes:

[0091] A data set construction module 100 is used to construct a cloth defect data set;

[0092] Model construction module 200 is used to build an improved YOLOv5s model, specifically including: integrating GFPN into the Neck network of YOLOv5s, introducing cross-scale connection layers between interval layers and cross-layer skip connection layers between the same scales in the backbone network, using C3Ghost lightweight feature fusion nodes in the Neck network, and using the Dysample method to upsample deep feature maps;

[0093] A model training module 300 is used to train the improved YOLOv5s model using the cloth defect dataset to obtain a defect recognition model;

[0094] The detection module 400 is used to obtain a cloth image to be detected and perform defect recognition on the cloth image to be detected using a defect recognition model.

[0095] In a further embodiment, the C3Ghost lightweight feature fusion node generates intrinsic features through Ghost convolution combined with main convolution, and generates Ghost features through auxiliary depth-separable convolution, which are finally spliced ​​into an output feature map. The calculation formula for Ghost feature extraction is:

[0096] X′ in =DWConv(Conv(X in ))

[0097] X out =Cat[(X in ,X′ in ),1]

[0098] Among them, X in To fuse the input features, X in ∈R W×H×C ;X out is the output Ghost feature; Cat[,1] is the sub-feature tensor splicing operation in the channel dimension.

[0099] The Dysample method first receives a low-resolution feature map as input, uses a linear layer to calculate the sampling point offset to determine the position during upsampling, performs channel adjustment and mapping convolution according to the upsampling ratio to generate an overall offset, and limits the offset by a static range factor. Then, using pixel reconstruction technology, the offset matrix dimension is adjusted to sW×sH×2g. The final generated sampling set Sa is composed of the offset Of and the original sampling grid Ga. Its mathematical expression is as follows:

[0100] Of=PixSh(y·Conv 1.1 (P))

[0101] Sa=Of+Ga

[0102] Among them, P is the input feature map; g is the number of group convolutions; Conv 1.1 It is a point convolution, and the number of output channels is 2gs 2 ; y is the pixel offset range factor; PixSh is the pixel reconstruction operation.

[0103] It should be noted that other specific implementations of the defect recognition system based on the efficient multi-path feature fusion network in this embodiment can refer to the specific implementations of the defect recognition method based on the above-mentioned efficient multi-path feature fusion network. To avoid redundancy, they will not be repeated here.

[0104] Example 3

[0105] A computer-readable storage medium according to embodiment 3 of the present application, wherein the computer-readable storage medium stores program code for execution by a device, the program code including steps for executing the method in any one of the implementations in embodiment 1 of the present application;

[0106] Among them, the computer-readable storage medium can be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM); the computer-readable storage medium can store program code, and when the program stored in the computer-readable storage medium is executed by the processor, the processor is used to execute the steps of the method in any one of the implementation methods in Example 1 of the present application.

[0107] Example 4

[0108] like Figure 8 As shown, an electronic device involved in Example 4 of the present application includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the method in any one of the implementations in Example 1 of the present application;

[0109] Among them, the processor can adopt a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the method in any one of the implementation methods in Example 1 of the present application.

[0110] The processor may also be an integrated circuit electronic device with signal processing capabilities. In the implementation process, each step of the method in any one of the implementations in Example 1 of the present application may be completed by hardware integrated logic circuits in the processor or software instructions.

[0111] The above-mentioned processor can also be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in combination with its hardware, completes the functions required to be executed by the units included in the data processing device of the embodiment of the present application, or executes the method in any one of the implementation modes in Example 1 of the present application.

[0112] The above are only preferred specific implementations of this application; however, the scope of protection of this application is not limited thereto. Any person skilled in the art who, within the technical scope disclosed in this application, makes equivalent substitutions or modifications based on the technical solutions and improved concepts of this application shall be covered by the scope of protection of this application.

Claims

1. A defect recognition method based on an efficient multi-path feature fusion network, characterized in that: include: Build a cloth defect dataset; An improved YOLOv5s model is constructed, specifically including: integrating GFPN into the Neck network of YOLOv5s, introducing cross-scale connection layers between interval levels and cross-layer skip connection layers between the same scale in the backbone network, and using the C3Ghost lightweight feature fusion node in the Neck network. The C3Ghost lightweight feature fusion node generates intrinsic features through Ghost convolution combined with main convolution, and generates Ghost features through auxiliary depthwise separable convolution, which are finally spliced ​​into output feature maps. The Dysample method is used to upsample the deep feature maps. In the cross-scale connection layer between interval levels, the expression of the intermediate scale feature information of the i-th layer is as follows: ; in, is the intermediate scale feature information of the i-th cross-scale connection layer; is the primary feature of the backbone layer corresponding to the intermediate scale layer i; corresponds to the cross-scale feature information; is the intermediate scale feature information of the i-1th layer; It is the fusion node combined with GhostConv; Unify Ghost convolution for the i-th scale; is the learning weight corresponding to each feature information; is the fusion bias; In the cross-layer skip connection layer between the same scales, the intermediate scale feature information of the jth layer is expressed as follows: ; in, is the intermediate scale feature information of the j-th same-scale skip layer; is the corresponding skip layer feature information; is the intermediate scale feature information of the j-1th same-scale skip layer; Merge each fusion feature by channel; The improved YOLOv5s model is trained using the cloth defect dataset to obtain a defect recognition model; Obtain the cloth image to be inspected, and use the defect recognition model to perform defect recognition on the cloth image to be inspected.

2. The defect recognition method based on an efficient multi-path feature fusion network according to claim 1 is characterized in that: The calculation formula for Ghost feature extraction is: ; ; in, To fuse the input features, ; To output Ghost features; Perform concatenation operations on the sub-feature tensors along the channel dimension.

3. The defect recognition method based on an efficient multi-path feature fusion network according to claim 1, characterized in that: The Dysample method first receives the low-resolution feature map as input, uses the linear layer to calculate the sampling point offset to determine the position during upsampling, performs channel adjustment and mapping convolution according to the upsampling ratio to generate the overall offset, and limits the offset by the static range factor. Then, using the pixel reconstruction technique, the offset matrix dimension is adjusted to , the final generated sampling set By offset With the original sampling grid Its mathematical expression is as follows: ; ; in, is the input feature map; is the number of group convolutions; is point convolution, and the number of output channels is ; is the pixel offset range factor; This is the pixel reassembly operation.

4. A defect recognition system based on an efficient multi-path feature fusion network, characterized in that: include: Dataset construction module, used to construct cloth defect dataset; The model construction module is used to build an improved YOLOv5s model. Specifically, it integrates GFPN into the Neck network of YOLOv5s, introduces cross-scale connection layers between interval levels and cross-layer skip connection layers between the same scales in the backbone network, and adopts the C3Ghost lightweight feature fusion node in the Neck network. The C3Ghost lightweight feature fusion node generates intrinsic features through Ghost convolution combined with main convolution, and generates Ghost features through auxiliary depth-wise separable convolution. The final splicing is into an output feature map, and the Dysample method is used to upsample the deep feature map. In the cross-scale connection layer between interval levels, the expression of the intermediate scale feature information of the i-th layer is as follows: ; in, is the intermediate scale feature information of the i-th cross-scale connection layer; is the primary feature of the backbone layer corresponding to the intermediate scale layer i; corresponds to the cross-scale feature information; is the intermediate scale feature information of the i-1th layer; It is the fusion node combined with GhostConv; Unify Ghost convolution for the i-th scale; is the learning weight corresponding to each feature information; is the fusion bias; In the cross-layer skip connection layer between the same scales, the intermediate scale feature information of the jth layer is expressed as follows: ; in, is the intermediate scale feature information of the j-th same-scale skip layer; is the corresponding skip layer feature information; is the intermediate scale feature information of the j-1th same-scale skip layer; Merge each fusion feature by channel; The model training module is used to train the improved YOLOv5s model using the cloth defect dataset to obtain a defect recognition model; The detection module is used to obtain the cloth image to be detected and use the defect recognition model to perform defect recognition on the cloth image to be detected.

5. The defect recognition system based on efficient multi-path feature fusion network according to claim 4 is characterized in that: The calculation formula for Ghost feature extraction is: ; ; in, To fuse the input features, ; To output Ghost features; Perform concatenation operations on the sub-feature tensors along the channel dimension.

6. The defect recognition system based on efficient multi-path feature fusion network according to claim 5 is characterized in that: The Dysample method first receives the low-resolution feature map as input, uses the linear layer to calculate the sampling point offset to determine the position during upsampling, performs channel adjustment and mapping convolution according to the upsampling ratio to generate the overall offset, and limits the offset by the static range factor. Then, using the pixel reconstruction technique, the offset matrix dimension is adjusted to , the final generated sampling set By offset With the original sampling grid Its mathematical expression is as follows: ; ; in, is the input feature map; is the number of group convolutions; is point convolution, and the number of output channels is ; is the pixel offset range factor; This is the pixel reassembly operation.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program codes for execution by a device, wherein the program codes include steps for executing the method according to any one of claims 1 to 3.

8. An electronic device, characterized in that: The electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Pipeline weld ultrasonic phased array defect identification method based on deep learning

    CN118262164A

  • Fabric defect detection method and system

    CN118735894A