Electric power fitting surface defect detection system and method

By adopting the ConvNeXt-V2 backbone network and the optimized encoders of the HAFI module and CWCM submodule in the surface defect detection of power fittings, the accuracy problem of defect detection of the existing model in complex backgrounds is solved, and more efficient defect identification and detection is achieved.

CN120635007APending Publication Date: 2025-09-12SHANGHAI UNIVERSITY OF ELECTRIC POWER
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510722250.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing models are prone to missed detection or false detection in the detection of surface defects in electrical hardware, especially under the interference of complex background noise, making it difficult to accurately identify diverse and complex defects.

Method used

ConvNeXt-V2 is used as the backbone network, combined with the optimized encoder of the HAFI module and the CWCM sub-module. Through HiLo perception feature interaction and CSP optimization of the wavelet convolution sub-module, the feature extraction and fusion capabilities are enhanced, and the sensitivity to tiny defects is improved.

Benefits of technology

It significantly improves the accuracy of defect detection, reduces the false detection rate, and improves the detection capability of complex defects while maintaining detection efficiency. It is suitable for online monitoring of industrial production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635007A_ABST
    Figure CN120635007A_ABST
Patent Text Reader

Abstract

The invention relates to an electric power fitting surface defect detection system and method. The system comprises a backbone network, an optimization encoder and a real-time decoder. Wherein the backbone network is used for performing preliminary feature extraction on a to-be-detected hardware fitting image, extracting features of an uncovered area and generating a low-resolution feature map; an HAFI module and a CWCM sub-module are introduced into the optimization encoder and are used for further extracting, enhancing and fusing features in the low-resolution feature map so as to obtain a fused enhanced feature map; and the real-time decoder adopts an anchor frame mechanism and a detection head to carry out target positioning and classification on the fusion enhancement feature map, and outputs a detection result, so that the surface defect detection of the electric power fitting is completed. Compared with the prior art, the hardware fitting surface defect detection method has the advantages of avoiding missing detection or false detection, improving the accuracy of hardware fitting surface defect detection and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of defect detection, and in particular to a system and method for detecting surface defects of electric hardware. Background Art

[0002] In recent years, with the development of deep learning technology, end-to-end object detection algorithms have been widely used in the field of surface defect detection, significantly improving detection performance and accuracy. For example, one study improved DETR by improving ResNet and enhancing the multi-scale deformable attention module, achieving better results in detecting small defects in castings. Another study used an improved version of RT-DETR with reparameterization and data augmentation to achieve accurate and fast PCB defect detection.

[0003] For example, the invention patent with publication number CN117173449A discloses an aircraft engine blade defect detection method based on multi-scale DETR, which interacts the feature map with position encoding and the target query sequence with the Transformer, and uses R-Focal loss to calculate the loss and perform backpropagation optimization on the model to improve the accuracy of blade defect detection and increase the detection speed; however, it still has problems of missed detection or false detection when identifying certain types of defects, and is not accurate enough.

[0004] In summary, in the power industry, the detection of component surface defects also faces challenges such as diversity, complexity, and background noise interference. These factors often lead to missed detections or false detections in existing models when identifying certain types of defects. Summary of the Invention

[0005] The purpose of the present invention is to provide a system and method for detecting surface defects of electrical fittings in order to overcome the defects of the prior art.

[0006] The purpose of the present invention can be achieved by the following technical solutions:

[0007] According to one aspect of the present invention, a system for detecting surface defects of electric fittings is provided, the system comprising a backbone network, an optimized encoder and a real-time decoder;

[0008] The backbone network is used to perform preliminary feature extraction on the hardware image to be inspected, extract the features of the unmasked area and generate a low-resolution feature map;

[0009] The HAFI module and CWCM submodule are introduced into the optimized encoder to further extract, enhance and fuse the features in the low-resolution feature map to obtain a fused and enhanced feature map. The HAFI module is a HiLo perception feature interaction module, and the CWCM submodule is a CSP optimized wavelet convolution submodule.

[0010] The real-time decoder uses an anchor frame mechanism and a detection head to locate and classify the fused enhanced feature map and output the detection results, thereby completing the surface defect detection of electrical fittings.

[0011] As the preferred technical solution, the backbone network adopts the ConvNeXtv2 network, and GRN is introduced into the ConvNeXtv2 network. GRN acts on the channel dimension. It first calculates the L2 norm of the input features to measure the global activation intensity of each sample, and then normalizes and scales the input features to make the feature distribution more stable.

[0012] As a preferred technical solution, the optimized encoder structure is specifically composed of a feature pyramid, a HAFI module, and a feature extraction and fusion module cascaded in sequence; among them, the feature pyramid includes P3, P4 and P5 layers, and the feature extraction and fusion module includes multiple CBS sub-modules and multiple CWCM sub-modules.

[0013] As a preferred technical solution, the feature extraction and fusion module includes 6 CBS submodules and 4 CWCM submodules, which are the first to sixth CBS submodules and the first to fourth CWCM submodules respectively. The feature extraction and fusion module also includes 5 fusion devices, which are the first to fifth fusion devices respectively. The specific structure of the feature extraction and fusion module is as follows: the output end of the HAFI module is connected to the first CBS submodule, the output end of the P4 layer of the feature pyramid is connected to the second CBS submodule, and the output ends of the first CBS submodule and the second CBS submodule are connected to the input end of the first fusion device; the output end of the P3 layer of the feature pyramid is connected to the third CBS submodule, and the output end of the first fusion device is connected to the fourth fusion device via the first CWCM submodule. CBS submodule; the output ends of the third CBS submodule and the fourth CBS submodule are connected to the input end of the third fusion device; the output end of the third fusion device is connected to the fifth CBS submodule via the second CWCM submodule, and the output ends of the fourth CBS submodule and the fifth CBS submodule are connected to the input end of the fourth fusion device; the output end of the fourth fusion device is connected to the sixth CBS submodule via the third CWCM submodule, and the output ends of the first CBS submodule and the sixth CBS submodule are connected to the input end of the second fusion device; the output end of the second fusion device is connected to the CWCM submodule; the output ends of the second, third and fourth CWCM submodules are connected to the fifth fusion device, and the output of the fifth fusion device is the final output of the feature extraction and fusion module.

[0014] As an optimal technical solution, the HAFI module consists of three network branches. Among them, the upper branch directly extracts the query vector, key vector and value vector after inputting the original feature map, and then performs self-attention and projection operations; the middle branch is used to average pool the original feature map and form a feature map set with the original feature map; the lower branch directly extracts the query vector from the original feature map on the one hand, and extracts the key vector and value vector from the feature map set on the other hand, and then uses the extracted query vector, key vector and value vector to perform self-attention and projection operations; finally, the outputs of the upper and lower branches are spliced ​​and fused to form the output of the HAFI module.

[0015] As the preferred technical solution, the HAFI module uses the HiLo Attention mechanism to separate high-frequency and low-frequency information, and calculates low-frequency global attention locally while modeling high-frequency local features.

[0016] As a preferred technical solution, the HiLo Attention mechanism allocates attention heads to high-frequency attention and low-frequency attention according to a preset ratio. High-frequency attention focuses on extracting high-frequency detail information in the input image and can capture local features, while low-frequency attention focuses on low-frequency global structure and emphasizes the overall outline and semantic information of the data. Its specific formula is:

[0017] HiLo(X)=Concat(Hi-Fi(X),Lo-Fi(X));

[0018] Hi-Fi(X)=LocalAttention(X);

[0019] X avg =AvgPool(X);

[0020] Lo-Fi(X)=Global Attention(X avg );

[0021] Among them, X avg is the result of global average pooling of the input features; Hi-Fi(X) is the result of high-frequency attention processing of the input features; Lo-Fi(X) is the result of low-frequency attention processing of the input features; HiLo(X) is the output of the HiLoAttention mechanism.

[0022] As a preferred technical solution, the CWCM submodule divides the input feature map into two parts: one part is directly passed to the subsequent stage after passing through the CBS block to retain the original information; the other part is processed by the CBS block and multi-layer WTConv to extract richer feature representations; the outputs of the two parts are fused and then processed in the CBS module to finally obtain the output feature map of the CWCM module.

[0023] As a preferred technical solution, the detection head in the real-time decoder adopts the RT-DETR detection head, and the RT-DETR detection head supports multi-scale feature extraction.

[0024] According to another aspect of the present invention, a method for detecting surface defects of electrical fittings is provided, the method comprising the following steps:

[0025] S1. Use the convolution module in the backbone network to perform preliminary feature extraction on the hardware image to be inspected, extract the features of the unmasked area and generate a low-resolution feature map;

[0026] S2, input the low-resolution feature map into the feature pyramid processing to output the basic feature map;

[0027] S3, input the basic feature map into the HAFI module, separate and extract high-frequency detail information and low-frequency global structure, and fuse the extraction results to output the frequency domain feature map;

[0028] S4, further extracting and fusing features from the basic feature map and the frequency domain feature map, and outputting a fused enhanced feature map;

[0029] S5. Input the fused enhanced feature map into the real-time decoder, use the anchor frame mechanism and detection head in the real-time decoder to perform target positioning and classification, and finally output the detection results including the defect location, category and confidence level, thereby completing the surface defect detection of electrical hardware.

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] 1. In the present invention, the HAFI module and CWCM submodule are introduced into the optimized encoder. The HAFI module is a HiLo perception feature interaction module, and the CWCM submodule is a CSP optimized wavelet convolution submodule, thereby enhancing the encoder's attention mechanism and feature extraction capabilities. The optimized encoder uses the HAFI module to separate high- and low-frequency features, enhancing the attention mechanism. The CWCM submodule further extracts and fuses multi-scale features, increasing sensitivity to minor defects (such as cracks and scratches) and improving feature extraction capabilities. The combination of this optimized encoder, the backbone network, and the real-time encoder avoids missed or false detections, improving the accuracy of hardware surface defect detection.

[0032] 2. In this paper, the backbone network uses a ConvNeXtv2 network, which generates low-resolution feature maps and preserves the basic semantics of the image. Furthermore, a GRN is introduced into the ConvNeXtv2 network. The GRN operates on the channel dimension, first calculating the L2 norm of the input features to measure the global activation strength of each sample, and then normalizing and rescaling the input features to make the feature distribution more stable. Furthermore, the structure has been adjusted to make it more efficient and accurate, thereby improving information encoding quality and overall model performance.

[0033] 3. This invention combines the high- and low-frequency separation capabilities of the HAFI module with the feature pyramid to improve the system's detection accuracy for defects of varying sizes. Furthermore, by alternating between the CBS and CWCM submodules, the system reduces computational complexity while retaining key features.

[0034] 4. In the feature extraction and fusion module of the present invention, multi-path feature fusion (such as the first CBS submodule and the sixth CBS submodule are connected through the second fusion device, etc.) is used to achieve progressive feature enhancement of features, cross-layer interaction of shallow features (edges, textures) and deep features (semantic information), and improve the detection capability of complex defects (such as hidden cracks).

[0035] 5. In the present invention, the HAFI module achieves separation and fusion of high- and low-frequency features through a three-branch structure. The upper branch processes the global information of the original feature map, and the lower branch captures local details in combination with the feature map after average pooling, achieving decoupling of high- and low-frequency information. The HiLo Attention mechanism is also used to separate high- and low-frequency information. According to a preset ratio, the attention heads are allocated to high- and low-frequency attention, so that the high-frequency attention branch focuses on detailed information such as edges and textures, while the low-frequency attention branch captures the overall outline of the hardware, achieving refined modeling of different frequency domain features.

[0036] 6. In the present invention, the feature map is diverted and processed through the CWCM sub-module. A part of it is directly passed through the CBS block to the subsequent stage to retain the original information and ensure that the basic semantics are not lost; the other part is processed by the CBS block and multi-layer WTConv to extract richer feature representations and enhance sensitivity to texture anomalies. WTConv can focus on both global structure and local details, thereby improving the robustness of feature extraction of the CWCM module; the fusion of the two improves the detection ability of tiny defects, and the CSP structure groups the feature channels for processing, combined with the multi-resolution characteristics of the wavelet transform, so that the overall operating efficiency is improved; while maintaining efficient inference speed, CWCM further enhances the model's ability to model complex features, making it more suitable for diverse visual tasks.

[0037] 7. In the present invention, the detection head in the real-time decoder adopts the RT-DETR detection head, which improves the real-time performance of the overall detection and meets the online monitoring requirements of the industrial production line. In addition, the RT-DETR detection head supports multi-scale feature extraction, enhances the multi-scale adaptability of target detection, and improves the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a schematic structural diagram of a surface defect detection system for electrical fittings in the present invention;

[0039] Figure 2 Schematic diagram of the structure of the HAFI module in the present invention;

[0040] Figure 3 Schematic diagram of the structure of the CBS submodule in the present invention;

[0041] Figure 4 Schematic diagram of the structure of the CWCM submodule in the present invention. DETAILED DESCRIPTION

[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0043] In the power industry, component surface defect detection also faces challenges such as diversity, complexity, and background noise interference. These factors often lead to missed detections or false detections when existing models accurately identify certain types of defects. To address these challenges, this application proposes a surface defect detection system for power fittings, namely the CHC-DETR end-to-end model, which aims to improve defect detection accuracy, reduce false detection rates, and maintain detection efficiency. In this application:

[0044] (1) ConvNeXt-V2 is used as the backbone network, and its fully convolutional masked autoencoder (FCMAE) pre-training framework and global response normalization (GRN) technology are used to enhance the model's robustness to illumination changes and improve its ability to recognize small objects and minor defects.

[0045] (2) A HAFI module is designed to separate high-frequency and low-frequency information processing to enhance the model's ability to capture global contextual information and local details in defect detection tasks.

[0046] (3) A CWCM module is proposed, which enables the model to focus on the overall structure and local details of the defect more effectively, improving the detection accuracy of small or irregular defects while maintaining the inference speed.

[0047] Example 1

[0048] This embodiment adopts a surface defect detection system for electric hardware, namely the CHC-DETR (ConvNeXt-HAFI-CWCM-Detection Transformer) model: it is an improved model based on the DETR (Detection Transformer), and its structure is as follows: Figure 1 The design of the network includes its backbone network, optimized encoder and real-time decoder.

[0049] Backbone network: The backbone network adopts ConvNeXt-V2, which has powerful feature extraction capabilities.

[0050] Optimized Encoder: Compared to traditional encoders, the optimized encoder improves upon them by enhancing the attention mechanism and feature extraction capabilities. Furthermore, its structure has been tweaked to be more efficient and accurate, thereby improving information encoding quality and overall model performance.

[0051] Real-Time Decoder: The detection head utilizes the RT-DETR (Real-Time Detection Transformer) detection head, which offers efficient object detection capabilities, ensuring accuracy while improving inference speed. It supports multi-scale feature extraction, improving detection performance for objects of varying sizes. Furthermore, this detection head exhibits strong robustness, enabling it to adapt to detection needs in complex scenarios.

[0052] like Figure 1As shown in FIG, the optimized encoder structure is specifically composed of a feature pyramid, a HAFI module, and a feature extraction and fusion module cascaded in sequence; wherein, the feature pyramid includes P3, P4 and P5 layers, the feature extraction and fusion module includes 6 CBS submodules and 4 CWCM submodules, which are the first to sixth CBS submodules and the first to fourth CWCM submodules, the feature extraction and fusion module also includes 5 fusion devices, which are the first to fifth fusion devices, and the specific structure of the feature extraction and fusion module is: the output end of the HAFI module is connected to the first CBS submodule, the output end of the P4 layer of the feature pyramid is connected to the second CBS submodule, the output ends of the first CBS submodule and the second CBS submodule are connected to the input end of the first fusion device; the output end of the P3 layer of the feature pyramid is connected to the third CBS submodule Module, the output end of the first fusion device is connected to the fourth CBS submodule via the first CWCM submodule; the output ends of the third CBS submodule and the fourth CBS submodule are connected to the input end of the third fusion device; the output end of the third fusion device is connected to the fifth CBS submodule via the second CWCM submodule, and the output ends of the fourth CBS submodule and the fifth CBS submodule are connected to the input end of the fourth fusion device; the output end of the fourth fusion device is connected to the sixth CBS submodule via the third CWCM submodule, and the output ends of the first CBS submodule and the sixth CBS submodule are connected to the input end of the second fusion device; the output end of the second fusion device is connected to the CWCM submodule; the output ends of the second, third and fourth CWCM submodules are connected to the fifth fusion device, and the output of the fifth fusion device is the final output of the feature extraction and fusion module.

[0053] In this embodiment, the Convolutional Neural Network-Extended-V2 (ConvNeXt-V2) architecture is used as the backbone network of the model. The specific information is as follows:

[0054] ConvNeXt-V2 uses a new approach called the Fully Convolutional Masked Autoencoder (FCMAE) framework. FCMAE is a self-supervised learning framework with a core concept similar to the Masked Autoencoder (MAE): it randomly masks part of the input image and then lets the model predict the masked content, thereby learning powerful feature representations.

[0055] The FCMAE architecture consists of two parts: an encoder and a decoder. The encoder uses the convolutional modules of ConvNeXt-V2 to extract features from unmasked areas and generate low-resolution feature maps. The decoder, using a fully convolutional design, reconstructs the image of the hardware under inspection based on the encoder output and mask position information. During training, the loss function only calculates the reconstruction error in masked areas, allowing the model to focus on learning local and global contextual relationships in the image.

[0056] ConvNeXt-V2 also introduces Global Response Normalization (GRN), a lightweight but effective normalization method designed to improve the generalization and stability of the network. GRN operates on the channel dimension. It first calculates the L2 norm (Euclidean norm) of the input features to measure the global activation strength of each sample, and then makes the feature distribution more stable through normalization and rescaling. In addition, GRN does not rely on batch statistics, making it more robust in small-batch training or distributed environments.

[0057] Defect detection scenarios often face problems such as lighting changes, perspective differences, or occlusions. The features learned by FCMAE through random masks during the pre-training phase are highly robust and can enhance the model's perception of local features. In addition, combined with the large kernel convolution of ConvNeXt-V2, FCMAE performs well when processing high-resolution industrial images, further improving its generalization ability in complex defect detection tasks. Compared with Transformer-based models, the fully convolutional nature of FCMAE avoids patch embedding and self-attention mechanisms, reducing computational complexity while preserving spatial continuity. This design is more advantageous in industrial environments with limited computing resources. GRN normalizes the global response to make the features of different channels more balanced, prevent certain channels in the feature map from being overly dominant, and improve sensitivity to small targets. This improves the model's sensitivity to defect features. This improves the ability to recognize small defects and enhances the reliability and generalization of detection.

[0058] In this embodiment, a HAFI module, namely HiLo-aware Feature Interaction (HAFI), is introduced into the optimized encoder. Its structure is as follows: Figure 2As shown in the figure, the HAFI module consists of three network branches. After the upper branch inputs the original feature map, it directly extracts the query vector, key vector and value vector, and then performs self-attention and projection operations; the middle branch is used to average pool the original feature map and form a feature map set with the original feature map; the lower branch directly extracts the query vector from the original feature map on the one hand, and extracts the key vector and value vector from the feature map set on the other hand, and then uses the extracted query vector, key vector and value vector to perform self-attention and projection operations; finally, the outputs of the upper and lower branches are spliced ​​and fused to form the output of the HAFI module.

[0059] The traditional Transformer encoder needs to calculate the global correlation of all tokens due to its self-attention mechanism, which has a computational complexity of . When processing high-resolution images or long sequences, the computational and storage costs are extremely high. In addition, the standard self-attention mechanism lacks the ability to distinguish information of different frequencies, making it difficult to effectively extract key features. To solve these problems, the HiLo Attention mechanism (high-low frequency attention mechanism) was introduced, such as Figure 4 As shown, the HAFI module includes three input paths. The first input path

[0060] It separates high-frequency and low-frequency information, locally calculating low-frequency global attention while efficiently modeling high-frequency local features, thereby reducing computational complexity and improving feature extraction capabilities. Compared to standard self-attention, the HiLo mechanism effectively reduces computational complexity and enables multi-scale modeling, making it particularly suitable for tasks that require a balance between context and detail. In defect detection tasks, defects often manifest as localized high-frequency details. HiLo Attention accurately captures these details while maintaining the integrity of global information, significantly improving the accuracy and robustness of defect detection.

[0061] The HiLo Attention mechanism distributes attention heads to high-frequency attention (Hi-Fi) and low-frequency attention (Lo-Fi) in a certain proportion, thereby achieving a balance between capturing local details and global information. Its calculation formula is as follows:

[0062] HiLo(X)=Concat(Hi-Fi(X),Lo-Fi(X));

[0063] Among them, Hi-Fi (High-Frequency Attention) focuses on extracting high-frequency details in the input X and can capture fine features such as local textures and edges; Lo-Fi (Low-Frequency Attention) focuses on low-frequency global structures and emphasizes the overall outline and semantic information of the data. The formula for High-Frequency Attention is as follows:

[0064] Hi-Fi(X)=Local Attention(X);

[0065] Among them, Local Attention represents the local attention mechanism, which focuses on modeling local features and can effectively perceive the details of the input. The formula of Low-FrequencyAttention is as follows:

[0066] X avg =AvgPool(X);

[0067] Lo-Fi(X)=Global Attention(X avg );

[0068] X avg The result of global average pooling of the input feature X is to preserve the overall low-frequency information and reduce spatial redundancy. It is then passed as input to the global attention mechanism, which models the global context and generates low-frequency attention features Lo-Fi(X). This enhances the model's global perception and reduces sensitivity to irrelevant local details.

[0069] In this embodiment, the optimized encoder structure is specifically composed of a feature pyramid, a HAFI module, and a feature extraction and fusion module connected in cascade sequence; wherein the feature pyramid includes P3, P4 and P5 layers, and the feature extraction and fusion module includes multiple CBS submodules and multiple CWCM submodules, wherein the structure of the CBS submodule is as follows Figure 3 As shown, the structure of the CWCM submodule is as follows Figure 4 shown.

[0070] The CWCM submodule divides the input feature map into two parts: one part is directly passed to the subsequent stage after passing through the CBS block to retain the original information; the other part is processed by the CBS block and multi-layer WTConv to extract richer feature representations; the outputs of the two parts are fused and then processed in the CBS module to finally obtain the output feature map of the CWCM module.

[0071] In the optimized encoder, in order to improve the ability of the encoder block in extracting and fusing complex defect morphology, low-scale defects and occlusion defect features, a CSP optimized wavelet convolution module (CWCM) is proposed in this scheme.

[0072] The CWCM module specifically divides the input feature map into two parts: one part is directly passed to the subsequent stage after passing through the CBS (Conv, Batch) block to preserve the original information; the other part is processed by stacking the CBS block with WTConv to extract a richer feature representation. This split and partial connection strategy not only reduces redundant computation but also enhances the diversity of gradient flow, effectively alleviating the training difficulties of deep networks. While maintaining efficient inference speed, CWCM further enhances the model's ability to model complex features, making it more suitable for a variety of visual tasks.

[0073] To address the problems that defect detection is easily affected by background noise and that traditional convolution may not be sensitive enough to low-frequency features, this solution introduces WTConv. After adding WTConv to the CWCM module, the decomposition of each wavelet transform level will exponentially expand the receptive field, while the number of parameters only increases linearly, thereby improving the feature expression capability without affecting the model's inference speed. Specifically, for part defect detection, this means that the model can capture defect information over a larger range, reduce dependence on local features, and thus improve the ability to identify small or irregular defects. In addition, metal defects usually appear as tiny cracks, gaps, etc. WTConv can focus on both global structure and local details, thereby improving the robustness of feature extraction in the CWCM module.

[0074] The hierarchical decomposition method adopted by WTConv can more effectively retain low-frequency information. This is because the WT transform further decomposes the low-frequency components at each level, thereby enhancing the expression ability of low-frequency features. Low-frequency components usually represent the overall structure of the image, while high-frequency components correspond to edges, textures, and noise. Defects on the metal surface often lead to abnormalities in the local structure (such as cracks), and these changes are particularly obvious in the low-frequency components. However, traditional convolution is less sensitive to low-frequency features, while WTConv strengthens the expression of low-frequency features through multi-level wavelet decomposition, making the response of the defective area more prominent, thereby improving detection accuracy.

[0075] In this experiment, the accuracy of the model was measured by precision (P), recall (R), and mean average precision (mAP), and the efficiency of the model was tested by GFLOPs (GigaFloating-point Operations per Second), number of parameters (Params), and frame rate (Frames Per Second, FPS).

[0076] All experiments were run on an RTX 4090 GPU using CUDA 11.8. The model was trained with a batch size of 4 images, traversing the dataset for 300 epochs, and using a weight decay rate of 0.0005.

[0077] This example uses the CU-DET dataset, a custom dataset specifically designed for detecting defects in electrical components. It contains four common defect types: cracks, scratches, breaks, and scuffs. The dataset consists of 3,540 images with a resolution of 640×480. During model training and validation, the dataset was split into training and validation sets in an 8:2 ratio.

[0078] In order to verify the effectiveness of the proposed module in the defect detection task, this scheme conducted an ablation experiment on a self-made dataset.

[0079] Table 1 Ablation study results of different modules

[0080]

[0081] Table 1 shows the performance changes after gradually adding various components. It can be seen that compared with the baseline model, the method of this solution has significantly improved in accuracy while reducing the number of parameters. First, after replacing the backbone network with ConvNeXt-V2, the mAP increased from 91.2% to 92.1%, while the number of parameters decreased from 20.08M to 12.51M, and the computational complexity increased, which shows that ConvNeXt-V2 performs better with a more compact parameter scale. Subsequently, after adding the HiLo-Aware Feature Interaction (HAFI) module proposed in this solution, the mAP further increased to 93.8%, and the precision and recall rates increased by 2.8% and 0.9% respectively. This shows that the HAFI module effectively enhances the model's ability to extract multi-scale features by separating high- and low-frequency information processing. Finally, after introducing the CSP-Refined Wavelet Convolution Module (CWCM), mAP reached 94.9%, while precision and recall further increased to 92.6% and 91%, respectively. The number of parameters was reduced to 10.75M, and the computational overhead was significantly reduced to 23.6. This demonstrates that the CWCM module not only improves the model's ability to extract complex defect features, but also effectively reduces the computational load and parameter count, achieving both improved accuracy and efficiency.

[0082] To verify the effectiveness of the proposed method, this paper compares it with the current mainstream target detection methods. The experimental results are shown in Table 2.

[0083] In Table 2, our CHC-DETR method is compared with SSD (Single Shot MultiBox Detector), Faster R-CNN (Faster Region-based Convolutional Neural Network, a fast version of region-based convolutional neural network), YOLOv7, YOLOv5 (full name: "You Only Look Once", an object detection system for computer vision tasks), and RT-DETR.

[0084] Table 2 Comparison with different algorithms on CU-DET

[0085]

[0086] As can be seen, our CHC-DETR method achieves a mAP of 94.9% and performs exceptionally well on all defect types, with particular strengths in scratches (98.6%) and fractures (98.1%). Compared to mainstream object detection models such as SSD, Faster R-CNN, YOLOv7, YOLOv5, and RT-DETR, CHC-DETR achieves significant improvements in mAP.

[0087] Compared to YOLOv7 (93.3%) and YOLOv5 (92.7%), CHC-DETR improves by 1.6% and 2.2%, respectively. CHC-DETR also has an advantage in speed, with an FPS of 56.8, surpassing all other methods except SSD, demonstrating its ability to effectively meet the needs of industrial-grade deployment.

[0088] The CHC-DETR in this scheme also has advantages in parameter count (Params) and computational complexity (GFLOPs). Its parameter count is only 10.75M and its GFLOPs is 23.6, which are much lower than most comparison methods. This means that the experiment can be completed with limited computing power.

[0089] In summary, the method of this scheme surpasses the widely used target detection model in both accuracy and speed, performs well in defect detection tasks, and is more suitable for actual industrial application deployment.

[0090] Compared to RT-DETR, another improved DETR model, the CHC-DETR model in this solution demonstrates significant advantages in defect detection. This model not only performs better for detecting "fracture" defects, but also effectively avoids the false detections associated with RT-DETR and demonstrates higher detection confidence for "scratch" defects. Furthermore, this solution's model successfully identifies small target defects, such as "gaps," with high confidence, further demonstrating its superior detection performance.

[0091] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A surface defect detection system for electric fittings, characterized in that: The system includes a backbone network, an optimized encoder, and a real-time decoder; The backbone network is used to perform preliminary feature extraction on the hardware image to be inspected, extract features of the unmasked area and generate a low-resolution feature map; The optimized encoder introduces a HAFI module and a CWCM submodule for further extracting, enhancing, and fusing features in the low-resolution feature map to obtain a fused and enhanced feature map; wherein the HAFI module is a HiLo perception feature interaction module; the CWCM submodule is a CSP optimized wavelet convolution submodule; The real-time decoder adopts an anchor frame mechanism and a detection head to perform target positioning and classification on the fused enhanced feature map and output the detection results, thereby completing the surface defect detection of electrical fittings.

2. The surface defect detection system for electric fittings according to claim 1, characterized in that: The backbone network adopts the ConvNeXtv2 network, and the GRN is introduced into the ConvNeXtv2 network. The GRN acts on the channel dimension. It first calculates the L2 norm of the input feature and then normalizes and scales the input feature.

3. The surface defect detection system for electric power fittings according to claim 1, characterized in that: The optimized encoder structure is specifically composed of a feature pyramid, a HAFI module, and a feature extraction and fusion module cascaded in sequence; wherein, the feature pyramid includes P3, P4 and P5 layers, and the feature extraction and fusion module includes multiple CBS submodules and multiple CWCM submodules.

4. The surface defect detection system for electric power fittings according to claim 3, characterized in that: The feature extraction and fusion module includes 6 CBS submodules and 4 CWCM submodules, which are the first to sixth CBS submodules and the first to fourth CWCM submodules respectively. The feature extraction and fusion module also includes 5 fusers, which are the first to fifth fusers respectively. The specific structure of the feature extraction and fusion module is as follows: the output end of the HAFI module is connected to the first CBS submodule, the output end of the P4 layer of the feature pyramid is connected to the second CBS submodule, the output ends of the first CBS submodule and the second CBS submodule are connected to the input end of the first fuser; the output end of the P3 layer of the feature pyramid is connected to the third CBS submodule, and the output end of the first fuser is connected to the fourth CBS submodule via the first CWCM submodule; The output ends of the third CBS submodule and the fourth CBS submodule are connected to the input end of the third fusion device; the output end of the third fusion device is connected to the fifth CBS submodule via the second CWCM submodule, and the output ends of the fourth CBS submodule and the fifth CBS submodule are connected to the input end of the fourth fusion device; the output end of the fourth fusion device is connected to the sixth CBS submodule via the third CWCM submodule, and the output ends of the first CBS submodule and the sixth CBS submodule are connected to the input end of the second fusion device; the output end of the second fusion device is connected to the CWCM submodule; the output ends of the second, third and fourth CWCM submodules are connected to the fifth fusion device, and the output of the fifth fusion device is the final output of the feature extraction and fusion module.

5. The surface defect detection system for electric power fittings according to claim 1, characterized in that: The HAFI module consists of three network branches. After the upper branch inputs the original feature map, it directly extracts the query vector, key vector and value vector, and then performs self-attention and projection operations; the middle branch is used to average pool the original feature map and form a feature map set with the original feature map; the lower branch directly extracts the query vector from the original feature map on the one hand, and extracts the key vector and value vector from the feature map set on the other hand, and then uses the extracted query vector, key vector and value vector to perform self-attention and projection operations; finally, the outputs of the upper and lower branches are spliced ​​and fused to form the output of the HAFI module.

6. The surface defect detection system for electric power fittings according to claim 5, characterized in that: The HAFI module uses the HiLo Attention mechanism to separate high-frequency and low-frequency information, calculates low-frequency global attention locally, and simultaneously models high-frequency local features.

7. The surface defect detection system for electric power fittings according to claim 6, characterized in that: The HiLoAttention mechanism allocates attention heads to high-frequency attention and low-frequency attention according to a preset ratio. High-frequency attention focuses on extracting high-frequency detail information in the input image and can capture local features, while low-frequency attention focuses on low-frequency global structure and emphasizes the overall outline and semantic information of the data. The specific formula is: HiLo(X)=Concat(Hi-Fi(X),Lo-Fi(X)); Hi-Fi(X)=LocalAttention(X); X avg =AvgPool(X); Lo-Fi(X)=Global Attention(X avg ); Among them, X avg is the result of global average pooling of the input features; Hi-Fi(X) is the result of high-frequency attention processing of the input features; Lo-Fi(X) is the result of low-frequency attention processing of the input features; HiLo(X) is the output of the HiLoAttention mechanism.

8. The surface defect detection system for electric power fittings according to claim 1, characterized in that: The CWCM submodule divides the input feature map into two parts: one part is directly passed to the subsequent stage after passing through the CBS block to retain the original information; the other part is processed by the CBS block and multi-layer WTConv to extract richer feature representation; the outputs of the two parts are fused and then processed in the CBS module to finally obtain the output feature map of the CWCM module.

9. The surface defect detection system for electric power fittings according to claim 1, characterized in that: The detection head in the real-time decoder adopts an RT-DETR detection head, and the RT-DETR detection head supports multi-scale feature extraction.

10. A method for detecting surface defects of electric power fittings, characterized in that: The method is applied to an electric fitting surface defect detection system as claimed in any one of claims 1 to 9, and the method steps include: S1. Use the convolution module in the backbone network to perform preliminary feature extraction on the hardware image to be inspected, extract the features of the unmasked area and generate a low-resolution feature map; S2, input the low-resolution feature map into the feature pyramid processing to output the basic feature map; S3, input the basic feature map into the HAFI module, separate and extract high-frequency detail information and low-frequency global structure, and fuse the extraction results to output the frequency domain feature map; S4, further extracting and fusing features from the basic feature map and the frequency domain feature map, and outputting a fused enhanced feature map; S5. Input the fused enhanced feature map into the real-time decoder, use the anchor frame mechanism and detection head in the real-time decoder to perform target positioning and classification, and finally output the detection results including the defect location, category and confidence level, thereby completing the surface defect detection of electrical hardware.

Citation Information

Patent Citations

  • Aero-engine blade defect detection method based on multi-scale DETR

    CN117173449A