Gear defect detection method and system based on multi-domain efficient feature aggregation network
By adopting multiple high -efficiency feature aggregation networks in gear defect detection, the problem of low efficiency, strong subjectivity, and insufficient sensitivity to minimum defect detection in existing technologies have been solved, and high -precision, low -cost gear defect detection is achieved.
Patent Information
- Application Number
- CN202411397545.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-10-09
AI Technical Summary
The existing gear defect detection methods have problems such as low efficiency, strong subjectivity, and insufficient sensitivity to detection of subtle defects. Especially when facing sparse and subtle defects, the detection accuracy is low.
Based on the multi -domain high -efficiency feature aggregation network, multi -domain hybrid feature extraction networks, multi -scale features focus on the propagation integration network and detecting head network, and conduct strong gear defect detection with strong robust and high accuracy. This method is extracted in the frequency domain and spatial domain, combined with local and global, space, and channel characteristic information, and combines multi -scale features to finally detect gear defects.
It improves the accuracy and robustness of gear defect detection, can more accurately detect the defects of the gear, reduce the detection cost, and avoid subjective impact.
Smart Images

Figure CN118898614B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision applications, and in particular relates to a gear defect detection method and system based on a multi-domain efficient feature aggregation network. Background Art
[0002] In the context of intelligent manufacturing, gears are core components of mechanical transmission systems, and their operating status directly affects the performance and safety of mechanical equipment. During the manufacturing, installation and operation process, gears are easily affected by factors such as stress concentration, friction and wear, fatigue damage, etc., resulting in wear, fracture, breakage and other defects. If these defects are not discovered and repaired in time, they may lead to unstable operation of the equipment and even cause major safety accidents. Therefore, under the framework of intelligent manufacturing, accurate gear defect detection is not only the key to ensure the normal operation of equipment and extend its service life, but also the core link to promote the efficient and safe operation of intelligent production lines.
[0003] Traditional gear defect detection methods mainly rely on manual inspection, vibration analysis or acoustic emission detection. Although these methods can identify gear defects to a certain extent, they have many limitations. For example, manual inspection is inefficient and highly subjective, and can easily lead to missed detections or false detections due to human factors. Although vibration analysis and acoustic emission detection can monitor the operating status of gears, they are not sensitive enough to detect subtle defects and usually require professional analysts to interpret the data, which increases the complexity and cost of detection.
[0004] The gear defect detection method based on deep learning can automatically learn and extract complex gear defect features, greatly improving the accuracy and robustness of detection, and the detection cost is low. However, gear defects such as fractures have sparse features and are easily ignored or lost in the feature extraction and fusion process, resulting in the model's detection accuracy is often low when facing these sparse and subtle defects, making it difficult to meet actual industrial needs. Summary of the invention
[0005] In order to overcome the deficiencies of the above-mentioned prior art, the present invention provides a gear defect detection method and system based on a multi-domain efficient feature aggregation network, constructs a multi-domain efficient feature aggregation network, and performs gear defect detection with strong robustness and high precision.
[0006] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:
[0007] A first aspect of the present invention provides a gear defect detection method based on a multi-domain efficient feature aggregation network.
[0008] The gear defect detection method based on multi-domain efficient feature aggregation network includes:
[0009] Acquire an image of a gear to be inspected;
[0010] Inputting the gear image into a trained multi-domain efficient feature aggregation network for defect detection to obtain a gear defect image with defect candidate areas marked;
[0011] Among them, the multi-domain efficient feature aggregation network includes a multi-domain hybrid feature extraction network, a multi-scale feature focusing propagation fusion network and a detection head network; the multi-domain hybrid feature extraction network adopts a multi-domain feature lossless downsampling module to extract features of gear images in the frequency domain and spatial domain and realize downsampling to obtain a feature map of a new scale, and uses an efficient hybrid feature perception module to further extract feature information from the local and global, spatial and channel perspectives to obtain a multi-scale feature map; the multi-scale feature focusing propagation fusion network fuses multi-scale features to obtain a fused feature map; the detection head network detects gear defects based on the fused feature map.
[0012] Furthermore, the multi-domain hybrid feature extraction network is composed of multiple multi-domain feature lossless downsampling modules and efficient hybrid feature perception modules, specifically:
[0013] It is composed of a first multi-domain feature lossless downsampling module, a second multi-domain feature lossless downsampling module, a third multi-domain feature lossless downsampling module, a first efficient mixed feature perception module, a fourth multi-domain feature lossless downsampling module, a second efficient mixed feature perception module, a fifth multi-domain feature lossless downsampling module and a third efficient mixed feature perception module in cascade.
[0014] Furthermore, the multi-domain feature lossless downsampling module uses wavelet transform and convolution operation to extract frequency domain features and space domain features respectively to achieve downsampling; the frequency domain features and space domain features are fused to obtain an initial feature map, specifically:
[0015] (1) Feature map After wavelet transform, high-frequency feature map is obtained , , And low frequency feature map , feature map After convolution operation, the feature map is obtained ,in, , , , and The width and height are the feature maps Half of , the number of channels is equal;
[0016] (2) High-frequency feature maps , and Respectively with the learnable weight parameters , and Multiply to get the high-frequency feature map , and , the feature map , and Add to get the feature map , the feature map With learnable weight parameters Multiply to get the feature map ; The low frequency feature map With learnable weight parameters Multiply to get the feature map ; The feature map With feature map Concatenate in the channel dimension to get the feature map ,in, , , and The values of are all greater than 0 and less than 1;
[0017] (3) Feature map After the convolution with a kernel size of 3×3 and a step size of 1, the number of channels of the feature map becomes One quarter of the feature map ;
[0018] (4) Feature map After two mapping functions consisting of convolution kernel size 3×3 and step size 1, the feature map is obtained. and ;
[0019] (5) Feature map and Multiply to get the feature map , the feature map and Add to get the feature map ;
[0020] (6) Feature map After convolution with a kernel size of 1×1 and a step size of 1, the feature map is obtained. , feature map It is the feature map output by the multi-domain feature lossless downsampling module, where the feature map The width and height are the feature maps Half the number of channels.
[0021] Furthermore, the efficient hybrid feature perception module extracts local features and global features from the input feature map; fuses the local features and global features in two dimensions, space and channel, to obtain a feature map for further feature extraction, specifically:
[0022] (1) Feature map After convolution with a kernel size of 1×1 and a step size of 1, the feature map is obtained. , feature map The width and height of the feature map Same, the number of channels is the feature map half of;
[0023] (2) Feature map After the convolution with a kernel size of k×k and a step size of 1, local features are extracted to obtain the feature map , the feature map With learnable weight parameters Multiply to get the feature map ;
[0024] (3) Feature map The global feature extraction is performed through the visual state space module to obtain the feature map , the feature map With learnable weight parameters Multiply to get the feature map ; Among them, the visual state space module VSSBlock is the core module in the VMamba network, which achieves linear complexity without sacrificing the global receptive field and efficiently traverses the spatial domain;
[0025] (4) Feature map With feature map Splice in the channel dimension to get the spatial feature map , where the spatial feature map Feature Map The width, height and number of channels are the same;
[0026] (5) Feature map After maximum pooling and average pooling respectively, the feature map is obtained and ; The feature map With learnable weight parameters Multiply to get the feature map ; The feature map With learnable weight parameters Multiply to get the feature map ; The feature map With feature map Add to get the feature map ;
[0027] (6) Feature map After convolution with a kernel size of 3×3 and a step size of 1, the feature map is obtained. , the feature map The feature map is obtained by Sigmoid activation function ;
[0028] (7) Feature map With spatial feature map Multiply to get the feature map , feature map It is the feature map output by the efficient hybrid feature perception module.
[0029] Furthermore, the multi-scale feature focused propagation fusion network includes a fourth high-efficiency mixed feature perception module, a fifth high-efficiency mixed feature perception module, a sixth high-efficiency mixed feature perception module, a seventh high-efficiency mixed feature perception module, two identical multi-scale feature aggregation modules, two identical convolution modules, two identical upsampling modules and four identical splicing modules.
[0030] Furthermore, the multi-scale feature aggregation module processes the feature map to be aggregated through channel segmentation, upsampling and convolution to obtain multiple new feature maps; aggregates the multiple new feature maps to obtain the aggregated feature map, specifically:
[0031] (1) Feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , where the feature map The width and height of the feature map The number of channels is equal to the feature map half of;
[0032] (2) Feature map Input into the upsampling module to get the feature map , the feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , where the feature map and feature map The width, height and number of channels are equal;
[0033] (3) Feature map Perform equal division in the channel dimension to obtain the feature map and ; The feature map Input the convolution module with a convolution kernel size of 3×3 and a step size of 2 to obtain the feature map ; The feature map Input the maximum pooling module to get the feature map , the feature map Input the convolution module with a convolution kernel size of 3×3 and a step size of 1 to obtain the feature map ; The feature map and feature map Concatenate to get feature map , the feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , where the feature map and feature map , The width, height and number of channels are equal;
[0034] (4) Feature map , and Respectively with the learnable weight parameters , and Multiply to get the feature map , and , the feature map , and Concatenate in the channel dimension to get the feature map ;
[0035] (5) Feature map The feature maps are obtained by inputting three convolution modules with convolution kernel size of 5×5 and step size of 1, convolution kernel size of 9×9 and step size of 1, and convolution kernel size of 11×11 and step size of 1 respectively. , and ;
[0036] (6) Feature map , and Respectively with the learnable weight parameters , and Multiply to get the feature map , and , the feature map , and Add to get the feature map ;
[0037] (7) Feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , feature map It is the output feature map of the feature aggregation module.
[0038] Furthermore, the detection head network uses a YOLOv8 detection head network to output the location and category of the defect candidate area, wherein the category includes tooth damage, tooth fracture and tooth surface wear.
[0039] A second aspect of the present invention provides a gear defect detection system based on a multi-domain efficient feature aggregation network.
[0040] The gear defect detection system based on multi-domain efficient feature aggregation network includes acquisition module and detection module:
[0041] The acquisition module is configured to: acquire an image of a gear to be detected;
[0042] The detection module is configured to: input the gear image into a trained multi-domain efficient feature aggregation network for defect detection, and obtain a gear defect image with defect candidate areas marked;
[0043] Among them, the multi-domain efficient feature aggregation network includes a multi-domain hybrid feature extraction network, a multi-scale feature focusing propagation fusion network and a detection head network; the multi-domain hybrid feature extraction network adopts a multi-domain feature lossless downsampling module to downsample the gear image in the frequency domain and the spatial domain to construct an initial feature map, and uses an efficient hybrid feature perception module to enhance the initial feature map from the local and global, spatial and channel perspectives to obtain a multi-scale feature map; the multi-scale feature focusing propagation fusion network fuses multi-scale features to obtain a fused feature map; the detection head network detects gear defects based on the fused feature map.
[0044] The third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in the gear defect detection method based on a multi-domain efficient feature aggregation network as described in the first aspect of the present invention.
[0045] The fourth aspect of the present invention provides an electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the gear defect detection method based on a multi-domain efficient feature aggregation network as described in the first aspect of the present invention are implemented.
[0046] One or more of the above technical solutions have the following beneficial effects:
[0047] The present invention uses a downsampling method in multiple domains to reduce the loss of sparse features, extracts features from the perspectives of local and local, space and channel to enrich feature representation, and aggregates multi-scale features to make the multi-scale features have rich contextual information, thereby ultimately improving the detection accuracy of gear defects; this method has the characteristics of strong robustness and high detection accuracy in the scenario of gear defect detection.
[0048] In the process of image processing, the present invention uses data enhancement methods to make the trained network more robust; uses a multi-domain efficient feature aggregation network to detect gear defects, which is low-cost, high-efficiency, and free from subjective influence. Compared with the previous neural network model, the designed multi-domain hybrid feature extraction network, multi-scale feature focusing propagation fusion network, detection head network, and multi-domain feature lossless downsampling module, efficient hybrid feature perception module and feature aggregation module that constitute the above network can detect gear defects more accurately.
[0049] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0051] Figure 1 This is a flow chart of the method of the first embodiment.
[0052] Figure 2 This is a diagram of the multi-domain hybrid feature extraction network structure of the first embodiment.
[0053] Figure 3 This is a structural diagram of the multi-domain feature lossless downsampling module of the first embodiment.
[0054] Figure 4 This is a structural diagram of the efficient hybrid feature perception module of the first embodiment.
[0055] Figure 5 This is a diagram of the multi-scale feature focused propagation fusion network structure of the first embodiment.
[0056] Figure 6 This is a structural diagram of the multi-scale feature aggregation module of the first embodiment. DETAILED DESCRIPTION
[0057] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0058] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0059] Embodiment 1
[0060] In one embodiment of the present disclosure, a gear defect detection method based on a multi-domain efficient feature aggregation network is provided, comprising the following steps:
[0061] Step S1: obtaining an image of a gear to be inspected;
[0062] Step S2: inputting the gear image into a trained multi-domain efficient feature aggregation network for defect detection to obtain a gear defect image with defect candidate areas marked;
[0063] Among them, the multi-domain efficient feature aggregation network includes a multi-domain hybrid feature extraction network, a multi-scale feature focusing propagation fusion network and a detection head network; the multi-domain hybrid feature extraction network adopts a multi-domain feature lossless downsampling module to extract features of gear images in the frequency domain and spatial domain and realize downsampling to obtain a feature map of a new scale, and uses an efficient hybrid feature perception module to further extract feature information from the local and global, spatial and channel perspectives to obtain a multi-scale feature map; the multi-scale feature focusing propagation fusion network fuses multi-scale features to obtain a fused feature map; the detection head network detects gear defects based on the fused feature map.
[0064] The present embodiment is described in detail below in conjunction with the accompanying drawings. Figure 1 As shown:
[0065] a) Collect gear defect images.
[0066] Use CCD industrial camera to collect gear defect images to ensure the quality of the collected gear defect images.
[0067] b) Perform data enhancement processing on the collected gear defect images.
[0068] The data enhancement method of flipping and adding Gaussian noise is used to flip the gear defect image horizontally and vertically, increase the number of gear defects, and add Gaussian noise to the gear defect image to simulate the noise introduced by the camera.
[0069] c) Label the gear defect images after data enhancement and create a gear defect dataset.
[0070] The annotated gear defect categories are tooth breakage, tooth fracture, and tooth surface wear. The annotated file names correspond to the image file names one by one, and the training set and test set are divided into 8:2 ratios.
[0071] d) Construct a multi-domain efficient feature aggregation network, which mainly includes a multi-domain hybrid feature extraction network, a multi-scale feature focusing propagation fusion network and a detection head network.
[0072] 1. Multi-domain hybrid feature extraction network
[0073] It mainly includes five multi-domain feature lossless downsampling modules and three efficient hybrid feature perception modules. The specific connection methods are as follows: Figure 2 As shown, it is composed of a first multi-domain feature lossless downsampling module, a second multi-domain feature lossless downsampling module, a third multi-domain feature lossless downsampling module, a first efficient mixed feature perception module, a fourth multi-domain feature lossless downsampling module, a second efficient mixed feature perception module, a fifth multi-domain feature lossless downsampling module and a third efficient mixed feature perception module in cascade.
[0074] Specifically, the gear image Input into the multi-domain hybrid feature extraction network, and obtain the feature map through the first multi-domain feature lossless downsampling module , the feature map Input the second multi-domain feature lossless downsampling module to obtain the feature map , the feature map Input the third multi-domain feature lossless downsampling module to obtain the feature map , the feature map Input the first efficient hybrid feature perception module to obtain the feature map , the feature map Input the fourth multi-domain feature lossless downsampling module to obtain the feature map , the feature map Input the second efficient hybrid feature perception module to obtain the feature map , the feature map Input the fifth multi-domain feature lossless downsampling module to obtain the feature map , the feature map Input the third efficient hybrid feature perception module to obtain the feature map .
[0075] Among them, the structure of the multi-domain feature lossless downsampling module is as follows Figure 3 As shown, for the convenience of description, the input of the multi-domain feature lossless downsampling module is collectively referred to as the feature map , the feature map After inputting the multi-domain feature lossless downsampling module, the specific processing flow is as follows:
[0076] (1) Feature map After wavelet transform, high-frequency feature map is obtained , , And low frequency feature map , feature map The feature map is obtained by convolution operation with a convolution kernel size of 3×3 and a step size of 2. ,in, , , , and The width and height are the feature maps half of the number of channels.
[0077] (2) High-frequency feature maps , and Respectively with the learnable weight parameters , and Multiply to get the high-frequency feature map , and , the feature map , and Add to get the feature map , the feature map With learnable weight parameters Multiply to get the feature map ; The low frequency feature map With learnable weight parameters Multiply to get the feature map ; The feature map With feature map Concatenate in the channel dimension to get the feature map ,in, , , and The values of are greater than 0 and less than 1.
[0078] (3) Feature map After the convolution with a kernel size of 3×3 and a step size of 1, the number of channels of the feature map becomes One quarter of the feature map .
[0079] (4) Feature map After two mapping functions consisting of convolution kernel size 3×3 and step size 1, the feature map is obtained. and .
[0080] (5) Feature map and Multiply to get the feature map , the feature map and Add to get the feature map .
[0081] (6) Feature map After convolution with a kernel size of 1×1 and a step size of 1, the feature map is obtained. , feature map It is the feature map output by the multi-domain feature lossless downsampling module, where the feature map The width and height are the feature maps Half the number of channels.
[0082] The structure of the efficient hybrid feature perception module is as follows Figure 4 As shown, for the convenience of description, the input of the efficient hybrid feature perception module is collectively referred to as feature map , the feature map After inputting the efficient hybrid feature perception module, the specific processing flow is as follows:
[0083] (1) After convolution with a kernel size of 1×1 and a step size of 1, the feature map is obtained , feature map The width and height of the feature map Same, the number of channels is the feature map half.
[0084] (2) Feature map After the convolution with a kernel size of k×k and a step size of 1, local features are extracted to obtain the feature map , the feature map With learnable weight parameters Multiply to get the feature map .
[0085] (3) Feature map The global feature extraction is performed through the visual state space module to obtain the feature map , the feature map With learnable weight parameters Multiply to get the feature map Among them, the visual state space module (VSSBlock) is the core module in the Vmamba network, which achieves linear complexity without sacrificing the global receptive field and efficiently traverses the spatial domain.
[0086] (4) Feature map With feature map Splice in the channel dimension to get the spatial feature map , where the spatial feature map Feature Map have the same width, height, and number of channels.
[0087] (5) Feature map After maximum pooling and average pooling respectively, the feature map is obtained and . The feature map With learnable weight parameters Multiply to get the feature map . The feature map With learnable weight parameters Multiply to get the feature map . The feature map With feature map Add to get the feature map .
[0088] (6) Feature map After convolution with a kernel size of 3×3 and a step size of 1, the feature map is obtained. , the feature map The feature map is obtained by Sigmoid activation function .
[0089] (7) Feature map With spatial feature map Multiply to get the feature map , feature map It is the output feature map of the efficient hybrid feature perception module, that is, the enhanced feature map.
[0090] The value of k in the first efficient hybrid feature perception module is 5, the value of k in the second efficient hybrid feature perception module is 7, and the value of k in the third efficient hybrid feature perception module is 9. and The values of are greater than 0 and less than 1.
[0091] 2. Multi-scale feature focused propagation fusion network
[0092] like Figure 5As shown, it mainly includes four efficient hybrid feature perception modules (namely, the fourth efficient hybrid feature perception module, the fifth efficient hybrid feature perception module, the sixth efficient hybrid feature perception module, and the seventh efficient hybrid feature perception module), two identical multi-scale feature aggregation modules, two identical convolution modules, two identical upsampling modules, and four identical splicing modules.
[0093] Extract multi-scale feature maps from multi-domain hybrid features , and Input into the multi-scale feature focused propagation fusion network, the specific processing flow is:
[0094] (1) Multi-scale feature map , and Input into the first multi-scale feature aggregation module to obtain the feature map .
[0095] (2) Feature map Input into the first convolution module and the first upsampling module respectively to obtain the feature map and .
[0096] (3) Feature map and Input into the first concatenation module to get the feature map .
[0097] (4) Feature map Input into the fourth efficient hybrid feature perception module to obtain the feature map .
[0098] (5) Feature map and Input into the second concatenation module to get the feature map .
[0099] (6) Feature map Input into the fifth efficient hybrid feature perception module to obtain the feature map .
[0100] (7) Feature map , and Input into the second feature aggregation module to obtain the feature map .
[0101] (8) Feature map Input into the second convolution module and the second upsampling module respectively to obtain the feature map and .
[0102] (9) Feature map , and Input into the third splicing module to get the feature map .
[0103] (10) The feature map Input into the sixth efficient hybrid feature perception module to obtain the feature map .
[0104] (11) The feature map , and Input into the fourth splicing module to get the feature map .
[0105] (12) The feature map Input into the seventh efficient hybrid feature perception module to obtain the feature map .
[0106] (13) Finally, the feature map , feature map , feature map As the final fused feature map of the multi-scale feature focused propagation fusion network.
[0107] Among them, the value of k in the fourth high-efficiency mixed feature perception module is 9, the value of k in the fifth high-efficiency mixed feature perception module is 5, the value of k in the sixth high-efficiency mixed feature perception module is 9, and the value of k in the seventh high-efficiency mixed feature perception module is 5.
[0108] For the multi-scale feature aggregation module, its structure is as follows Figure 6 As shown, for the convenience of description, the three inputs of the multi-scale feature aggregation module are collectively referred to as feature maps , and , where the feature map The width and height are the feature maps Half of the number of channels and feature maps Twice, the feature map The width and height are the feature maps Twice as many channels as feature maps half of the feature map , and Input the multi-scale feature aggregation module. The specific processing steps are:
[0109] (1) Feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , where the feature map The width and height of the feature map The number of channels is equal to the feature map half.
[0110] (2) Feature map Input into the upsampling module to get the feature map , the feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , where the feature map and feature map The width, height, and number of channels are equal.
[0111] (3) Feature map Perform equal division in the channel dimension to obtain the feature map and ; The feature map Input the convolution module with a convolution kernel size of 3×3 and a step size of 2 to obtain the feature map ; The feature map Input the maximum pooling module to get the feature map , the feature map Input the convolution module with a convolution kernel size of 3×3 and a step size of 1 to obtain the feature map . The feature map and feature map Concatenate to get feature map , the feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , where the feature map and feature map , The width, height, and number of channels are equal.
[0112] (4) Feature map , and Respectively with the learnable weight parameters , and Multiply to get the feature map , and , the feature map , and Concatenate in the channel dimension to get the feature map .
[0113] (5) Feature map The feature maps are obtained by inputting three convolution modules with convolution kernel size of 5×5 and step size of 1, convolution kernel size of 9×9 and step size of 1, and convolution kernel size of 11×11 and step size of 1 respectively. , and .
[0114] (6) Feature map , and Respectively with the learnable weight parameters , and Multiply to get the feature map , and , the feature map , and Add to get the feature map .
[0115] (7) Feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , feature map It is the output feature map of the feature aggregation module.
[0116] in, , , , , and The values of are all greater than 0 and less than 1.
[0117] 3. Detection head network
[0118] The detection head network using YOLOv8 outputs the location and category of the defect candidate area, where the categories include tooth breakage, tooth fracture, and tooth surface wear.
[0119] Specifically, the feature map , as well as They are input into the detection head network of YOLOv8 respectively, and the detection output image is obtained through the non-maximum suppression algorithm. ,image The defect candidate areas and defect categories are marked in the figure.
[0120] e) The constructed multi-domain efficient feature aggregation network is trained using the fabricated gear defect dataset.
[0121] During the training process, the image size was initialized to 640×640, and the training was repeated for 500 rounds, with 16 images per batch.
[0122] f) Encapsulate and deploy the trained multi-domain efficient feature aggregation network and detect gear defects.
[0123] After the multi-domain efficient feature aggregation network is trained, first save the weights with the best detection results, then write a script that can load and save the multi-domain efficient feature aggregation network and use the weights for reasoning, then integrate the script into the application, and finally deploy the application to the local server to realize the detection of gear defects using the multi-domain efficient feature aggregation network.
[0124] Embodiment 2
[0125] In one embodiment of the present disclosure, a gear defect detection system based on a multi-domain efficient feature aggregation network is provided, including an acquisition module and a detection module:
[0126] The acquisition module is configured to: acquire an image of a gear to be detected;
[0127] The detection module is configured to: input the gear image into a trained multi-domain efficient feature aggregation network for defect detection, and obtain a gear defect image with defect candidate areas marked;
[0128] Among them, the multi-domain efficient feature aggregation network includes a multi-domain hybrid feature extraction network, a multi-scale feature focusing propagation fusion network and a detection head network; the multi-domain hybrid feature extraction network adopts a multi-domain feature lossless downsampling module to downsample the gear image in the frequency domain and the spatial domain to construct an initial feature map, and uses an efficient hybrid feature perception module to enhance the initial feature map from the local and global, spatial and channel perspectives to obtain a multi-scale feature map; the multi-scale feature focusing propagation fusion network fuses multi-scale features to obtain a fused feature map; the detection head network detects gear defects based on the fused feature map.
[0129] Embodiment 3
[0130] The purpose of this embodiment is to provide a computer-readable storage medium.
[0131] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the gear defect detection method based on a multi-domain efficient feature aggregation network as described in the first embodiment of the present disclosure.
[0132] Embodiment 4
[0133] The purpose of this embodiment is to provide an electronic device.
[0134] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps of the gear defect detection method based on a multi-domain efficient feature aggregation network as described in the first embodiment of the present disclosure are implemented.
[0135] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A gear defect detection method based on a multi-domain efficient feature aggregation network, characterized in that: include: Acquire an image of a gear to be inspected; Inputting the gear image into a trained multi-domain efficient feature aggregation network for defect detection to obtain a gear defect image with defect candidate areas marked; Among them, the multi-domain efficient feature aggregation network includes a multi-domain hybrid feature extraction network, a multi-scale feature focusing propagation fusion network and a detection head network; the multi-domain hybrid feature extraction network uses a multi-domain feature lossless downsampling module to extract features of the gear image in the frequency domain and the spatial domain and realize downsampling to obtain a feature map of a new scale, and uses an efficient hybrid feature perception module to further extract feature information from the local and global, spatial and channel perspectives to obtain a multi-scale feature map; the multi-scale feature focusing propagation fusion network fuses multi-scale features to obtain a fused feature map; the detection head network detects gear defects based on the fused feature map; The efficient hybrid feature perception module extracts local features and global features from the input feature map; fuses the local features and global features in two dimensions, space and channel, to obtain a feature map for further feature extraction, specifically: (1) Feature map After convolution with a kernel size of 1×1 and a step size of 1, the feature map is obtained. , feature map The width and height of Same, the number of channels is the feature map half of; (2) Feature map After the convolution with a kernel size of k×k and a step size of 1, local features are extracted to obtain the feature map , the feature map With learnable weight parameters Multiply to get the feature map ; (3) Feature map The global feature extraction is performed through the visual state space module to obtain the feature map , the feature map With learnable weight parameters Multiply to get the feature map ; Among them, the visual state space module VSS Block is the core module in the VMamba network, which achieves linear complexity without sacrificing the global receptive field and efficiently traverses the spatial domain; (4) Feature map With feature map Splice in the channel dimension to get the spatial feature map , where the spatial feature map Feature Map The width, height and number of channels are the same; (5) Feature map After maximum pooling and average pooling respectively, the feature map is obtained and ; The feature map With learnable weight parameters Multiply to get the feature map ; The feature map With learnable weight parameters Multiply to get the feature map ; The feature map With feature map Add to get the feature map ; (6) Feature map After convolution with a kernel size of 3×3 and a step size of 1, the feature map is obtained. , the feature map The feature map is obtained by Sigmoid activation function ; (7) Feature map With spatial feature map Multiply to get the feature map , feature map It is the feature map output by the efficient hybrid feature perception module.
2. The gear defect detection method based on multi-domain efficient feature aggregation network according to claim 1 is characterized in that: The multi-domain hybrid feature extraction network is composed of multiple multi-domain feature lossless downsampling modules and efficient hybrid feature perception modules, specifically: It is composed of a first multi-domain feature lossless downsampling module, a second multi-domain feature lossless downsampling module, a third multi-domain feature lossless downsampling module, a first efficient mixed feature perception module, a fourth multi-domain feature lossless downsampling module, a second efficient mixed feature perception module, a fifth multi-domain feature lossless downsampling module and a third efficient mixed feature perception module in cascade.
3. The gear defect detection method based on multi-domain efficient feature aggregation network according to claim 2 is characterized in that: The multi-domain feature lossless downsampling module uses wavelet transform and convolution operation to extract frequency domain features and space domain features respectively to achieve downsampling; the frequency domain features and space domain features are fused to obtain the initial feature map, which is specifically: (1) Feature map After wavelet transform, high-frequency feature map is obtained , , And low frequency feature map , feature map After convolution operation, the feature map is obtained ,in, , , , and The width and height are the feature maps Half of , the number of channels is equal; (2) High-frequency feature maps , and Respectively with the learnable weight parameters , and Multiply to get the high-frequency feature map , and , the feature map , and Add to get the feature map , complete the weighted addition, and transform the feature map With learnable weight parameters Multiply to get the feature map ; The low frequency feature map With learnable weight parameters Multiply to get the feature map ; The feature map With feature map Splice in the channel dimension to get the feature map ,in, , , and The values of are all greater than 0 and less than 1; (3) Feature map After the convolution with a kernel size of 3×3 and a step size of 1, the number of channels of the feature map becomes One quarter of the feature map ; (4) Feature map After two mapping functions consisting of convolution kernel size 3×3 and step size 1, the feature map is obtained. and ; (5) Feature map and Multiply to get the feature map , the feature map and Add to get the feature map ; (6) Feature map After convolution with a kernel size of 1×1 and a step size of 1, the feature map is obtained. , feature map It is the feature map output by the multi-domain feature lossless downsampling module, where the feature map The width and height are the feature maps Half the number of channels.
4. The gear defect detection method based on multi-domain efficient feature aggregation network according to claim 1 is characterized in that: The multi-scale feature focusing propagation fusion network includes a fourth high-efficiency mixed feature perception module, a fifth high-efficiency mixed feature perception module, a sixth high-efficiency mixed feature perception module, a seventh high-efficiency mixed feature perception module, two identical multi-scale feature aggregation modules, two identical convolution modules, two identical upsampling modules and four identical splicing modules.
5. The gear defect detection method based on multi-domain efficient feature aggregation network according to claim 4 is characterized in that: The multi-scale feature aggregation module processes the feature map to be aggregated through channel segmentation, upsampling and convolution to obtain multiple new feature maps; aggregates the multiple new feature maps to obtain aggregated feature maps, specifically: (1) Feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , where the feature map The width and height of The number of channels is equal to the feature map half of; (2) Feature map Input into the upsampling module to get the feature map , the feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , where the feature map and feature map The width, height and number of channels are equal; (3) Feature map Perform equal division in the channel dimension to obtain the feature map and ; The feature map Input the convolution module with a convolution kernel size of 3×3 and a step size of 2 to obtain the feature map ; The feature map Input the maximum pooling module to get the feature map , the feature map Input the convolution module with a convolution kernel size of 3×3 and a step size of 1 to obtain the feature map ; The feature map and feature map Concatenate to get feature map , where the feature map and feature map , The width, height and number of channels are equal; (4) Feature map , and Respectively with the learnable weight parameters , and Multiply to get the feature map , and , the feature map , and Concatenate in the channel dimension to get the feature map ; (5) Feature map The feature maps are obtained by inputting three convolution modules with convolution kernel size of 5×5 and step size of 1, convolution kernel size of 9×9 and step size of 1, and convolution kernel size of 11×11 and step size of 1 respectively. , and ; (6) Feature map , and Respectively with the learnable weight parameters , and Multiply to get the feature map , and , the feature map , and Add to get the feature map ; (7) Feature map Input the convolution module with a convolution kernel size of 1×1 and a step size of 1 to obtain the feature map , feature map It is the output feature map of the feature aggregation module.
6. The gear defect detection method based on multi-domain efficient feature aggregation network according to claim 1 is characterized in that: The detection head network uses the YOLOv8 detection head network to output the location and category of the defect candidate area, wherein the category includes tooth damage, tooth fracture and tooth surface wear.
7. A gear defect detection system based on a multi-domain efficient feature aggregation network, adopting a gear defect detection method based on a multi-domain efficient feature aggregation network as described in any one of claims 1 to 6, characterized in that: Including acquisition module and detection module: The acquisition module is configured to: acquire an image of a gear to be detected; The detection module is configured to: input the gear image into a trained multi-domain efficient feature aggregation network for defect detection, and obtain a gear defect image with defect candidate areas marked; Among them, the multi-domain efficient feature aggregation network includes a multi-domain hybrid feature extraction network, a multi-scale feature focusing propagation fusion network and a detection head network; the multi-domain hybrid feature extraction network uses a multi-domain feature lossless downsampling module to downsample the gear image in the frequency domain and the spatial domain to construct an initial feature map, and uses an efficient hybrid feature perception module to enhance the initial feature map from the perspectives of local and global, space and channel to obtain a multi-scale feature map; the multi-scale feature focusing propagation fusion network fuses multi-scale features to obtain a fused feature map; The detection head network detects gear defects based on the fused feature map.
8. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; a processor for executing the computer-readable instructions; Wherein, when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 6 is executed.
9. A storage medium, characterized in that: The computer-readable instructions are non-transitorily stored, wherein when the computer-readable instructions are executed by a computer, the method according to any one of claims 1 to 6 is performed.
Citation Information
Patent Citations
Wine bottle defect detection method and system based on multi-path and multi-scale feature fusion
CN115375677A
Steel surface defect detection method and system and computer equipment
CN116664558A