Defect identification method and system based on efficient multi-path feature fusion network

By introducing global feature pyramid network and cross-scale connections in the YOLOv5s model, combined with C3Ghost and Dysample methods, the effective fusion of deep and shallow features is achieved, solving the problem of poor feature fusion in the existing technology, improving the performance of cloth defect detection and reducing the computational complexity.

CN119540643AActive Publication Date: 2025-02-28ZHEJIANG SCI-TECH UNIV

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to effectively integrate the feature information of deep and shallow layers, large scale and small scale, resulting in poor cloth defect detection performance under complex texture backgrounds, and at the same time, high calculation complexity and large model parameters.

Method used

The defect identification method based on the efficient multi-path feature fusion network is adopted. By introducing the global feature pyramid network (GFPN) and cross-scale connections, combined with the C3Ghost lightweight feature fusion node and Dysample method, the deep feature map is upsampled to achieve effective fusion of deep and shallow features.

Benefits of technology

The performance of the YOLOv5s model in multi-scale and multi-scale object detection is improved, especially in cloth defect detection under complex texture backgrounds, which can more accurately identify and locate defects, improve the accuracy and reliability of defect recognition, and reduce the computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540643A_ABST
    Figure CN119540643A_ABST
Patent Text Reader

Abstract

The invention discloses a defect identification method and system based on an efficient multi-path feature fusion network, relates to the technical field of cloth defect detection, and solves the problems that deep-layer, shallow-layer, large-scale and small-scale feature information cannot be effectively fused in the prior art, and an existing model is high in calculation complexity and large in model parameter quantity. The method comprises the steps that a cloth flaw data set is constructed, an improved YOLOv5s model is constructed, and model training is carried out, and the improvement content comprises the steps that GFPN is fused into a Neck network of YOLOv5s, cross-scale connection layers between interval levels and cross-layer jump connection layers between the same scales are introduced into a backbone network, in the Neck network, C3Ghost lightweight feature fusion nodes are adopted, and the cross-scale jump connection layers between the interval levels and the cross-scale jump connection layers between the interval levels are fused into the backbone network. According to the method, the deep feature map is subjected to up-sampling by adopting a Dysample method, deep and shallow feature information and large-scale and small-scale feature information are effectively fused, the performance of a YOLOv5s model in multi-scale and multi-proportion target detection is improved, and meanwhile, calculation parameters and complexity of the model are reduced.
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 an important part of the global economy, the textile industry has been experiencing rapid development in recent years with the advancement of technology and changes in market demand. Especially in terms of automated and intelligent production, the textile industry has an increasing demand for efficient and accurate defect detection technology. Traditional manual detection methods are inefficient, require a lot of effort, and are even affected by subjective human factors, resulting in unstable detection results. Therefore, automatic defect detection technology based on computer vision has become an urgent problem that needs to be solved in the textile industry. In the field of computer vision, object detection technology has always been a hot research topic. 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) series of models are representatives of this progress, providing real-time object detection through an end-to-end approach. However, the traditional YOLO model still faces some challenges when dealing with objects of different scales and proportions.

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

[0004] The purpose of this application is to overcome the problems in the prior art 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 models, 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] Construct a cloth defect dataset;

[0007] Construct 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;

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

[0009] Obtain a cloth image to be inspected, and use a 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-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 concatenated 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 grouped 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 expression of the intermediate scale feature information of the i-th layer is 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 of layer i; To correspond 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 skip layer of the same scale; is the corresponding skip layer feature information; is the intermediate-scale feature information of the j-1th skip layer of the same scale; Cat is the merging of each fusion feature by channel.

[0024] In a 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 building module is used to build an improved YOLOv5s model, which includes: 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;

[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-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 concatenated 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 grouped 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 a program code for execution by a device, wherein the program code includes steps for executing the method in any one of the implementations of the first aspect described above.

[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 in the first aspect above.

[0039] This application has the following beneficial effects:

[0040] 1. Enhanced multi-scale feature fusion capability: This application introduces the global feature pyramid network (GFPN) and cross-scale connections to effectively fuse deep and shallow, large-scale and small-scale feature information, thereby improving the performance of the YOLOv5s model in multi-scale and multi-scale target detection, especially in cloth defect detection under complex texture backgrounds, which can more accurately identify and locate defects, thereby improving the accuracy and reliability of defect recognition;

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

[0042] 3. Enhanced detail retention capability: This application solves the low-pass filter effect caused 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 constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. 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 creative work.

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

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

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

[0048] Figure 4 It 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 a result diagram 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 It is a structural block diagram of a defect recognition system based on an efficient multi-path feature fusion network according to Embodiment 2 of the present application;

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

[0053] Reference numerals:

[0054] 100. Data set construction module; 200. Model construction module; 300. Model training module; 400. Detection module. DETAILED DESCRIPTION

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

[0056] Example 1

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

[0058] S100, constructing a cloth defect dataset;

[0059] Specifically, first obtain the images required for the training model, which can be obtained through image capture equipment, or by crawling the network to obtain images of cloth with defects.

[0060] Then, the collected defective cloth images are annotated 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 a training set and a validation set. For example, the image data is divided into a training set and a validation set in a ratio of 8:2.

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

[0062] S200, 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 the deep feature map;

[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 in 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. And the generated intrinsic features and Ghost features are spliced ​​to form an output feature map, which enhances 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 is improved, and combined with the design concept of GFPN, an efficient multi-path feature fusion network structure is proposed. The design of the Neck part aims to fuse the primary features extracted by the Backbone at multiple scales, so as to realize the simultaneous positioning and detection of targets of different sizes and proportions. In the detection of cloth defects under complex texture backgrounds, shallow features mainly contain detailed information such as texture and defect edges, while deep features contain high-level semantic information associated with classification and context. The original YOLOv5s combines the Feature Pyramid Network (FPN) and the Path Aggregation Network (PAN) to fuse primary features, but this structure only considers the feature interaction between adjacent levels. As a result, the feature maps fused by FPN lack shallow details, while the feature maps fused by PAN lack deep semantic information. The GFPN (Global Feature Pyramid Network) structure introduces skip layers and cross-scale connections, which can effectively transmit deep and shallow, large-scale and small-scale feature information.

[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 scales 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 calculation 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 caused 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 maps between each level. Avoid the loss of high-frequency information of the feature image and reduce problems such as 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 of layer i; To correspond 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 is an improvement of each fusion node of the efficient multi-path feature fusion network. 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 deep separable convolution (DW convolution), which are finally spliced ​​into the output feature map. This method reduces the consumption of computing resources by reducing the convolution kernel and introducing linear transformation while maintaining the model performance. 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 Ghost lightweight convolution feature extraction calculation formula 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 concatenated in the channel dimension.

[0073] In order to optimize the feature fusion of the model, this paper improves the efficient transmission of deep and shallow features in cross-scale connections, and improves the transmission of same-scale features. In the same-scale jump connection, the feature information of each layer needs to keep the same scale to ensure the efficiency of the transmission process and avoid information loss or redundancy. In the same-scale jump 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 skip layer of the same scale; is the corresponding skip layer feature information; is the intermediate-scale feature information of the j-1th skip layer of the same scale; Cat is the merging of each fusion feature by channel.

[0076] In order to improve the detail perception ability of feature maps, this application introduces the DySample lightweight dynamic upsampling module. When implementing multi-path feature fusion, it ensures the effective transmission of semantics and details between features, and ensures consistency and resolution at different scales.

[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. According to the upsampling ratio s, channel adjustment and mapping convolution are performed 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. Then, 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 grouped 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 the 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 a prediction result to test the performance of the defect recognition model. The defect recognition model can also 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 5FIG. 4 is a diagram showing the result of using the improved defect recognition model of this embodiment to recognize the original cloth image. Figure 6 The figure shown is the result of using the benchmark model (i.e., YOLOv5s model) to identify the same cloth original image. It can be seen that the benchmark model cannot identify the second type of skipped yarn defects, and the identification of the third group of scattered yarn defects is not accurate enough, while the defect recognition model of the present application can accurately identify skipped yarn and scattered yarn defects.

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

[0086]

[0087]

[0088] It can be seen from Table 1 above that the recognition accuracy P, recall R, and mAP of the improved YOLOv5s model in this embodiment are improved compared with 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 embodiment, the original Neck network of the YOLOv5s model is improved, and combined with the design concept of GFPN, an efficient multi-path feature fusion network is proposed, which effectively avoids the problem of loss of the original backbone features of the model after the fusion of the neck features. First, the module introduces cross-scale connections between interval levels and cross-layer jump connections between the same scales in the main branch to ensure full interaction and fusion between deep semantic information and shallow detail information. Secondly, the module uses the C3_Ghost efficient and lightweight feature fusion node. By integrating GhostConv with its connection structure, it reduces the calculation parameters and complexity of the model while maintaining good representation capabilities for the defect foreground and background.

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

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

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

[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 the 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 concatenated 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, and 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 grouped 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 identification system based on an efficient multi-path feature fusion network in this embodiment can refer to the specific implementations of the defect identification method based on an efficient multi-path feature fusion network mentioned above. 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 a program code for execution by a device, wherein the program code includes steps for executing a 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 Embodiment 4 of the present application includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and when the program or instruction is executed by the processor, a method in any one of the implementations in Embodiment 1 of the present application is implemented;

[0109] Among them, the processor can adopt a general-purpose 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 capability. In the implementation process, each step of the method in any implementation of Embodiment 1 of the present application may be completed by an integrated logic circuit of hardware in the processor or by instructions in software form.

[0111] The above-mentioned processor may 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 devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium 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 a memory, and the processor reads the information in the memory, and completes the functions required to be performed by the unit included in the data processing device of the embodiment of the present application in combination with its hardware, or executes the method in any one of the implementation modes in the embodiment 1 of the present application.

[0112] The above are only preferred specific implementations of the present application; however, the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and its improved ideas of the present application within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A defect recognition method based on an efficient multi-path feature fusion network, characterized in that: include: Construct a cloth defect dataset; Construct 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; The improved YOLOv5s model is trained using the cloth defect dataset to obtain a defect recognition model; Obtain a cloth image to be inspected, and use a defect recognition model to perform defect recognition on the cloth image to be inspected.

2. The defect recognition method based on efficient multi-path feature fusion network according to claim 1 is characterized in that: 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: X in =DWConv(Conv(X in )) X out =Cat[(X in ,X in ),1] 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 concatenated in the channel dimension.

3. The defect recognition method based on efficient multi-path feature fusion network according to claim 1 is characterized in that: 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: Of=PixSh(y·Conv 1,1 (P)) Sa=Of+Ga Among them, P is the input feature map; g is the number of grouped 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.

4. The defect recognition method based on efficient multi-path feature fusion network according to claim 1 is characterized in that: 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: 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 of layer i; To correspond 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.

5. The defect recognition method based on efficient multi-path feature fusion network according to claim 4 is characterized in that: 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 skip layer of the same scale; is the corresponding skip layer feature information; is the intermediate-scale feature information of the j-1th skip layer of the same scale; Cat is the merging of each fusion feature by channel.

6. 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 building module is used to build an improved YOLOv5s model, which includes: 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; 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.

7. The defect recognition system based on efficient multi-path feature fusion network according to claim 6 is characterized in that: 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: X′ in =DWConv(Conv(X in )) X out =Cat[(X in ,X′ in ),1] 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 concatenated in the channel dimension.

8. The defect recognition system based on efficient multi-path feature fusion network according to claim 7 is characterized in that: 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: Of=PixSh(y·Conv 1.1 (P)) Sa=Of+Ga Among them, P is the input feature map; g is the number of grouped 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.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code for execution by a device, wherein the program code includes steps for executing the method according to any one of claims 1 to 5.

10. An electronic device, characterized in that: The electronic device comprises 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 as claimed in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Novel target detection system and method under roadside view angle

    CN115346177A

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

    CN118262164A

  • Fabric defect detection method and system

    CN118735894A

Cited By

  • Ceramic tile surface flaw detection method and system based on improved YOLOv8n

    CN120525814A

  • Multi-sensor fused cloth online flaw identification method and system

    CN120876405A

  • A multi-sensor fusion cloth online flaw identification method and system

    CN120876405B

  • Construction method, training method and use method of segmentation model

    CN122066959A