Construction method of transformer substation equipment defect detection network based on YOLOv5

By introducing the cross-domain dynamic interactive attention fusion module CDIAFM in the Neck part of YOLOv5, using Fourier transform and dynamic interactive attention to deal with grayscale changes, the problem of insufficient sensitivity of the model to grayscale changes in the prior art is solved, and higher detection accuracy and fewer missed detection and false detection are achieved.

CN119785170APending Publication Date: 2025-04-08CHINA THREE GORGES UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411781724.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing YOLOv5-based substation equipment defect detection network ignores grayscale changes in the Concat operation of the Neck part, resulting in insufficient sensitivity to grayscale changes in the model, and missed and missed detection.

Method used

In the Neck part of YOLOv5, the Concat operation is replaced with the cross-domain dynamic interactive attention fusion module CDIAFM, the Fourier transform is introduced to obtain frequency domain information, process amplitude and phase information, and guide frequency domain features to the spatial domain through dynamic interactive attention, enhancing the recognition ability of grayscale changes.

Benefits of technology

The performance of the model in the detection of defects in substation equipment is significantly improved, the missed detection and missed detection situations are reduced, and the detection accuracy of areas with prominent grayscale changes is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119785170A_ABST
    Figure CN119785170A_ABST
Patent Text Reader

Abstract

The invention provides a construction method of a transformer substation equipment defect detection network based on YOLOv5, a basic framework of the network is a YOLOv5 framework, Concat operation of a Neck part in the YOLOv5 is improved, and the Concat operation is replaced by a cross-domain dynamic interactive attention fusion module CDIAFM. The two feature maps of different layers enter a cross-domain dynamic interactive attention fusion module and are processed through a frequency domain branch and a space branch respectively, and a space domain feature # imgabs0 # and a frequency domain feature # imgabs1 # are obtained. According to the method, the frequency domain features and the space domain features are combined, and information interaction is carried out between the frequency domain and the space domain by utilizing dynamic interactive attention, so that the model can more accurately identify gray level change, and the conditions of missing detection and false detection are reduced. In a substation scene with complex background interference and rich scale and texture details, the method provided by the invention can improve the detection precision, and is excellent in the substation equipment defect detection task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image target detection, and in particular to a method for constructing a substation equipment defect detection network based on YOLOv5. Background Art

[0002] With the rapid development of smart grids and industrial automation, substations are the core of the power system, and the stability and safety of their equipment operation are crucial. How to quickly and accurately detect and identify potential hidden dangers in substation equipment has become an important challenge in power system maintenance. Traditional manual detection methods are time-consuming, inefficient, and have safety hazards, which makes it difficult to meet the needs of efficient and safe inspections of substations. Therefore, how to use deep learning models to improve the accuracy and robustness of substation equipment defect detection has become a key research direction.

[0003] In recent years, the application of convolutional neural network (CNN) in substation equipment defect detection has become one of the main research directions. Yu Hong et al. improved the Faster R-CNN target detection network in "Research on Substation Equipment Identification and Defect Detection Technology Based on Faster R-CNN Algorithm" and successfully identified common substation equipment defects. Although good results were achieved, the model was relatively complex and required high computing resources, which limited its wide application in practice. Chen Ting et al. optimized the YOLOv4 algorithm in "Substation Defect Detection Based on Improved YOLOv4" and applied it to substation equipment defect detection. Compared with two-stage target detection models such as Faster R-CNN, it showed certain advantages. Li Dahua et al. designed a multi-scale channel information-global-local attention plug-in for the YOLO series model in "LiteYOLO-ID: Lightweight Target Detection Network for Insulator Defect Detection", which comprehensively extracted and utilized multi-scale feature map information, while capturing global context information and local spatial details, thereby enhancing the learning ability of the network. Although these methods have achieved certain detection effects in substation equipment defect detection, most of the existing methods ignore the challenges of grayscale changes to spatial domain detection, and often have problems of missed detection and false detection. Summary of the invention

[0004] The present invention provides a method for constructing a substation equipment defect detection network based on YOLOv5, which solves the problem that when using the YOLOv5 network for substation equipment defect detection, the Concat operation of the Neck part only relies on the spatial domain to model the structural features of the image, but ignores the grayscale change. This leads to insufficient sensitivity of the model to grayscale changes, resulting in missed detection and false detection.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: The construction method of the substation equipment defect detection network based on YOLOv5 includes the following steps: S1. Construct a substation equipment defect detection network based on YOLOv5. Based on the YOLOv5 backbone architecture, the network replaces the Concat operation of the Neck part with the cross-domain dynamic interactive attention fusion module CDIAFM, so that the model can more accurately identify grayscale changes and reduce missed detection and false detection. S2. Construct a cross-domain dynamic interactive attention fusion module. This module merges two input features through channel splicing, and then divides them into two branches: frequency domain and space domain. In the frequency domain branch, Fourier transform FFT is introduced to obtain information in the frequency domain, and the amplitude and phase information in the frequency domain are processed separately. After processing, the inverse Fourier transform IFFT is used to return to the space domain to obtain frequency domain features. Among them, the amplitude information helps the model enhance the perception of the intensity of grayscale changes, making it easier for the model to focus on prominent change areas and suppress background noise. The phase information helps the model maintain the precise position and shape of the grayscale change area to ensure clear edges. Finally, after dynamic interactive attention, the important information in the frequency domain features is guided to the space domain, so that the model can better identify areas with prominent grayscale changes. The contextual information in the space domain is reversely supplemented to the frequency domain to enhance the perception of subtle changes. S3, input substation image and complete defect detection; after inputting the substation image, feature extraction and fusion are performed through the YOLOv5-based network, and finally the target detection and classification of substation equipment defects are completed in the detection head.

[0006] The substation equipment defect detection network based on YOLOv5 in S1 above includes: First, the input substation image passes through the Backbone part of YOLOv5, using the CSPDarknet53 network structure, which is responsible for extracting features from the input image; Backbone gradually extracts low-level to high-level features of the image through a series of convolutional layers and residual connections to capture the spatial information in the image; then, the image features are passed to the Neck part, and the part that originally used four Concats for feature fusion has been improved to adopt the cross-domain dynamic interactive attention fusion module CDIAFM and introduce frequency domain information. Finally, the fused features enter the Head part, and the detection head of YOLOv5 is responsible for generating the final prediction results, including bounding box coordinates, target category labels and confidence scores; the entire network is trained using a standard loss function to optimize target detection accuracy and efficiency.

[0007] The process of constructing the cross-domain dynamic interactive attention fusion module in S2 above is as follows: Input Features , → Concat operation → 1*1 convolution operation → get features ; Frequency Domain Branch: Characteristics → Fast Fourier Transform FFT operation → Convert from spatial domain to frequency domain to obtain phase characteristic information and amplitude information ; Phase characteristics →1*1 convolution operation→ReLU operation→1*1 convolution operation→get the processed phase feature ; Amplitude characteristics →1*1 convolution operation→ReLU operation→1*1 convolution operation→get the processed phase feature ; feature ,feature → Inverse Fourier transform IFFT operation → Convert from frequency domain back to spatial domain to obtain frequency domain features ; Spatial Domain Branch: Features →3*3 convolution operation→ReLU operation→3*3 convolution operation→get spatial domain features ; Frequency-spatial domain interaction: Frequency domain characteristics →Linear transformation →Calculation , , ; Spatial Domain Characteristics →Linear transformation →Calculation , , ; use and Calculate Attention → Extract frequency domain feature information → Compare the result with Multiply → get the frequency domain features containing spatial information ; use and Calculate Attention → Extract information about spatial domain features → Combine the results with Multiply → get the spatial domain features containing frequency domain information ; The adaptive weight allocator assigns weights σ, →Multiply pixel by pixel; The adaptive weight allocator assigns weights 1-σ, →Multiply pixel by pixel; After weight multiplication, two features are fused and added to obtain the interactive features. .

[0008] The specific process of S3 above is: After the substation image is input, defect detection is performed through the YOLOv5-based network; first, the input substation image is subjected to feature extraction by the Backbone part of YOLOv5 to extract multi-level feature information; then, it is fused through the cross-domain dynamic interactive attention fusion module CDIAFM of the Neck part to integrate information of different scales to enhance the expression ability of the model; after fusion, the features are subjected to convolution and activation operations to adapt to the output format of the detection head; finally, the processed features are input to the detection head to realize the target detection and classification of substation equipment defects.

[0009] In the above S2, the two input feature maps , After Concat, the channels are concatenated in the channel dimension, and then the number of channels is adjusted to half of the original through 1*1 convolution to obtain the fused features. , the formula is as follows: ; Among them, Concat represents the concatenation operation in the channel dimension, and Conv1*1 represents the convolution with a convolution size of 1, which reduces the number of channels to half of the original.

[0010] In the above S2, the feature Input into the frequency domain branch and the space domain branch respectively, and extract the frequency domain feature information and the space domain feature information respectively: In the frequency domain branch, the feature First, use the fast Fourier transform FFT to convert from the spatial domain to the frequency domain to obtain the corresponding phase and amplitude information; next, process the phase and amplitude separately, and extract and refine features through 1*1 convolution, ReLu operation, and 1*1 convolution in turn; finally, use the inverse fast Fourier transform IFFT to convert the processed features from the frequency domain back to the spatial domain to obtain the features in the frequency domain; the formula is as follows: ; ; Among them: Input feature map After fast Fourier transform FFT, it is converted into frequency domain features , h, w are spatial coordinates, u, v are frequency coordinates, j is an imaginary unit; frequency domain characteristics is a complex number, decomposed into its real part and the imaginary part .

[0011] In the above S2, the formula for converting from the spatial domain to the frequency domain to obtain the corresponding phase and amplitude information is as follows: ; ; in: Represents the phase characteristics, Indicates amplitude characteristics; ; ; in: represents the phase characteristics after processing, Represents the amplitude feature after processing, Conv1*1 represents the convolution with a convolution size of 1; ; ; in: represents the real part of the restored frequency domain features, Represents the imaginary part of the restored frequency domain features; ; Among them: After inverse Fourier transform IFFT, the characteristics in the frequency domain are obtained .

[0012] In the above S2, in the spatial domain branch: Features After 3*3 convolution, ReLU operation, and 3*3 convolution for feature extraction, the features in the spatial domain are obtained. : ; Frequency-Spatial Interaction: Input Features , Generate query matrix Query, key matrix Key and value matrix Value through different linear transformations; transform the frequency domain features As a query matrix , used in the spatial domain The key matrix Interact to obtain spatial domain features containing frequency domain information ; In turn, the characteristics of the spatial domain As a query matrix , used in the frequency domain The key matrix Interact to obtain frequency domain features including spatial domain ; The formula is as follows: ; ; ; ; ; ; Finally, in order to adaptively fuse two cross-domain features , . Get the features , we consider an adaptive weight allocator to fuse cross-domain features; the adaptive weight allocator can be formulated as: ; Among them, Awa represents the adaptive weight allocator, and σ represents the learnable factor in the adaptive weight allocator.

[0013] The present invention provides a method for constructing a substation equipment defect detection network based on YOLOv5, and designs a cross-domain dynamic interactive attention fusion module. The module first merges two input features through channel splicing, and then divides them into two branches: frequency domain and space domain. In the frequency domain branch, Fourier transform FFT is introduced to obtain information in the frequency domain, and the amplitude and phase information in the frequency domain are processed respectively. After processing, the inverse Fourier transform IFFT is used to return to the space domain to obtain frequency domain features. Among them, the amplitude information helps the model enhance the perception of the intensity of grayscale changes, making it easier for the model to pay attention to the prominent change area and suppress background noise. The phase information helps the model maintain the precise position and shape of the grayscale change area to ensure clear edges. Finally, after dynamic interactive attention, the important information in the frequency domain features is guided to the space domain, so that the model can better identify the area with prominent grayscale changes; and the context information in the space domain is reversely supplemented to the frequency domain to enhance the perception of subtle changes. The present invention verifies the effectiveness of the proposed network structure and module, and significantly improves the performance of the model in substation equipment defect detection. BRIEF DESCRIPTION OF THE DRAWINGS The present invention will be further described below in conjunction with the accompanying drawings and embodiments: Figure 1 It is a diagram of the overall network structure of an embodiment of the present invention; Figure 2 Schematic diagram of the cross-domain dynamic interactive attention fusion module CDIAFM. DETAILED DESCRIPTION

[0014] In order to make the purpose, technical solutions and advantages of the present invention clearer, the following content will systematically and completely describe the specific technical solutions of the present invention in combination with the drawings provided according to the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0015] The construction method of the substation equipment defect detection network based on YOLOv5 includes the following steps: S1. Construct a substation equipment defect detection network based on YOLOv5. Based on the YOLOv5 backbone architecture, the network replaces the Concat operation of the Neck part with the cross-domain dynamic interactive attention fusion module CDIAFM, so that the model can more accurately identify grayscale changes and reduce missed detection and false detection. S2. Construct a cross-domain dynamic interactive attention fusion module. This module merges two input features through channel splicing, and then divides them into two branches: frequency domain and space domain. In the frequency domain branch, Fourier transform FFT is introduced to obtain information in the frequency domain, and the amplitude and phase information in the frequency domain are processed separately. After processing, the inverse Fourier transform IFFT is used to return to the space domain to obtain frequency domain features. Among them, the amplitude information helps the model enhance the perception of the intensity of grayscale changes, making it easier for the model to focus on prominent change areas and suppress background noise. The phase information helps the model maintain the precise position and shape of the grayscale change area to ensure clear edges. Finally, after dynamic interactive attention, the important information in the frequency domain features is guided to the space domain, so that the model can better identify areas with prominent grayscale changes. The contextual information in the space domain is reversely supplemented to the frequency domain to enhance the perception of subtle changes. S3, input substation image and complete defect detection; after inputting the substation image, feature extraction and fusion are performed through the YOLOv5-based network, and finally the target detection and classification of substation equipment defects are completed in the detection head.

[0016] The substation equipment defect detection network based on YOLOv5 in S1 above includes: First, the input substation image passes through the Backbone part of YOLOv5, using the CSPDarknet53 network structure, which is responsible for extracting features from the input image; Backbone gradually extracts low-level to high-level features of the image through a series of convolutional layers and residual connections to capture the spatial information in the image; then, the image features are passed to the Neck part, and the part that originally performed feature fusion through four Concats has been improved to adopt the cross-domain dynamic interactive attention fusion module CDIAFM and introduce frequency domain information, so that the frequency domain and spatial domain information complement each other, thereby enhancing the perception of subtle changes, especially for areas with prominent grayscale changes, and improving the performance of the model in substation equipment defect detection; finally, the fused features enter the Head part, and the detection head of YOLOv5 is responsible for generating the final prediction results, including bounding box coordinates, target category labels and confidence scores; the entire network is trained through a standard loss function to optimize target detection accuracy and efficiency.

[0017] The process of constructing the cross-domain dynamic interactive attention fusion module in S2 above is as follows: Input Features , → Concat operation → 1*1 convolution operation → get features ; Frequency Domain Branch: Characteristics → Fast Fourier Transform FFT operation → Convert from spatial domain to frequency domain to obtain phase characteristic information and amplitude information ; Phase characteristics →1*1 convolution operation→ReLU operation→1*1 convolution operation→get the processed phase feature ; Amplitude characteristics →1*1 convolution operation→ReLU operation→1*1 convolution operation→get the processed phase feature ; feature ,feature → Inverse Fourier transform IFFT operation → Convert from frequency domain back to spatial domain to obtain frequency domain features ; Spatial Domain Branch: Features →3*3 convolution operation→ReLU operation→3*3 convolution operation→get spatial domain features ; Frequency-spatial domain interaction: Frequency domain characteristics →Linear transformation →Calculation , , ; Spatial Domain Characteristics →Linear transformation →Calculation , , ; use and Calculate Attention → Extract frequency domain feature information → Compare the result with Multiply → get the frequency domain features containing spatial information ; use and Calculate Attention → Extract information about spatial domain features → Combine the results with Multiply → get the spatial domain features containing frequency domain information ; The adaptive weight allocator assigns weights σ, →Multiply pixel by pixel; The adaptive weight allocator assigns weights 1-σ, →Multiply pixel by pixel; After weight multiplication, two features are fused and added to obtain the interactive features. .

[0018] The specific process of S3 above is: After the substation image is input, defect detection is performed through the YOLOv5-based network; first, the input substation image is subjected to feature extraction by the Backbone part of YOLOv5 to extract multi-level feature information; then, it is fused through the cross-domain dynamic interactive attention fusion module CDIAFM of the Neck part to integrate information of different scales to enhance the expression ability of the model; after fusion, the features are subjected to convolution and activation operations to adapt to the output format of the detection head; finally, the processed features are input to the detection head to realize the target detection and classification of substation equipment defects.

[0019] In the above S2, the two input feature maps , After Concat, the channels are concatenated in the channel dimension, and then the number of channels is adjusted to half of the original through 1*1 convolution to obtain the fused features. , the formula is as follows: ; Among them, Concat represents the concatenation operation in the channel dimension, and Conv1*1 represents the convolution with a convolution size of 1, which reduces the number of channels to half of the original.

[0020] In the above S2, the feature Input into the frequency domain branch and the space domain branch respectively, and extract the frequency domain feature information and the space domain feature information respectively: In the frequency domain branch, the feature First, use the fast Fourier transform FFT to convert from the spatial domain to the frequency domain to obtain the corresponding phase and amplitude information; next, process the phase and amplitude separately, and extract and refine features through 1*1 convolution, ReLu operation, and 1*1 convolution in turn; finally, use the inverse fast Fourier transform IFFT to convert the processed features from the frequency domain back to the spatial domain to obtain the features in the frequency domain; the formula is as follows: ; ; Among them: Input feature map After fast Fourier transform FFT, it is converted into frequency domain features , h, w are spatial coordinates, u, v are frequency coordinates, j is an imaginary unit; frequency domain characteristics is a complex number, decomposed into its real part and the imaginary part .

[0021] In the above S2, the formula for converting from the spatial domain to the frequency domain to obtain the corresponding phase and amplitude information is as follows: ; ; in: Represents the phase characteristics, Indicates amplitude characteristics; ; ; in: represents the phase characteristics after processing, Represents the amplitude feature after processing, Conv1*1 represents the convolution with a convolution size of 1; ; ; in: represents the real part of the restored frequency domain features, Represents the imaginary part of the restored frequency domain features; ; Among them: After inverse Fourier transform IFFT, the characteristics in the frequency domain are obtained .

[0022] In the above S2, in the spatial domain branch: Features After 3*3 convolution, ReLU operation, and 3*3 convolution for feature extraction, the features in the spatial domain are obtained. : ; Frequency-Spatial Interaction: Input Features , Generate query matrix Query, key matrix Key and value matrix Value through different linear transformations; transform the frequency domain features As a query matrix , used in the spatial domain The key matrix Interact to obtain spatial domain features containing frequency domain information ; In turn, the characteristics of the spatial domain As a query matrix , used in the frequency domain The key matrix Interact to obtain frequency domain features including spatial domain ; The formula is as follows: ; ; ; ; ; ; Finally, in order to adaptively fuse two cross-domain features , . Get the features , we consider an adaptive weight allocator to fuse cross-domain features; the adaptive weight allocator can be formulated as: ; Among them, Awa represents the adaptive weight allocator, and σ represents the learnable factor in the adaptive weight allocator.

[0023] Embodiment 1: like Figure 1 and Figure 2 As shown, a method for constructing a substation equipment defect detection network based on cross-domain dynamic interactive attention fusion of YOLOv5 includes the following steps: Step S1: Build a substation equipment defect detection network based on YOLOv5. Based on the YOLOv5 backbone architecture, the network replaces the Concat operation of the Neck part with the cross-domain dynamic interactive attention fusion module CDIAFM, so that the model can more accurately identify grayscale changes and reduce missed detections and false detections.

[0024] Step S2, construct a cross-domain dynamic interactive attention fusion module. This module first merges the two input features through channel splicing, and then divides them into two branches: frequency domain and spatial domain. In the frequency domain branch, Fourier transform FFT is introduced to obtain information in the frequency domain, and the amplitude and phase information in the frequency domain are processed separately. After processing, the inverse Fourier transform IFFT is used to return to the spatial domain to obtain frequency domain features. Among them, the amplitude information helps the model enhance the perception of the intensity of grayscale changes, making it easier for the model to focus on prominent change areas and suppress background noise. The phase information helps the model maintain the precise position and shape of the grayscale change area to ensure clear edges. Finally, after dynamic interactive attention, the important information in the frequency domain features is guided to the spatial domain, so that the model can better identify areas with prominent grayscale changes; and the contextual information in the spatial domain is reversely supplemented to the frequency domain to enhance the perception of subtle changes.

[0025] Step S3: Input the substation image and complete defect detection. After the substation image is input, feature extraction and fusion are performed through the YOLOv5-based network, and finally the target detection and classification of substation equipment defects are completed in the detection head.

[0026] Through the above steps, a substation equipment defect detection network based on YOLOv5's cross-domain dynamic interactive attention fusion is constructed.

[0027] Specifically, S1 includes: building a substation equipment defect detection network based on YOLOv5.

[0028] like Figure 1As shown in the figure, the network is based on the YOLOv5 structure, and the Concat operation is replaced by the cross-domain dynamic interactive attention fusion module CDIAFM in its Neck part, so that the model can more accurately identify grayscale changes and reduce missed detection and false detection. First, the input substation image is extracted through the Backbone part of YOLOv5. In the Neck part, the fused features are formed into a unified feature representation through channel splicing, and then divided into two parallel branches: in the frequency domain branch, Fourier transform FFT is introduced to obtain information in the frequency domain, and the amplitude and phase information in the frequency domain are processed respectively. After processing, the inverse Fourier transform IFFT is returned to the spatial domain to obtain frequency domain features. Among them, the amplitude information helps the model enhance the perception of the intensity of grayscale changes, making it easier for the model to pay attention to the prominent change area and suppress background noise. The phase information helps the model maintain the precise position and shape of the grayscale change area to ensure clear edges. Finally, after dynamic interactive attention, the important information in the frequency domain features is guided to the spatial domain, so that the model can better identify the areas with prominent grayscale changes; and the context information in the spatial domain is reversely supplemented to the frequency domain to enhance the perception of subtle changes. After this fusion process, the fused features are further processed by convolution and finally input into the detection head of YOLOv5 to achieve target detection and classification of substation equipment defects.

[0029] Specifically, S2 includes: building a cross-domain dynamic interactive attention fusion module.

[0030] Two input feature maps , After Concat, the channels are concatenated in the channel dimension, and then the number of channels is adjusted to half of the original through 1*1 convolution to obtain the fused features. , as shown in the following formula: ; Among them, Concat represents the concatenation operation in the channel dimension, and Conv1*1 represents the convolution with a convolution size of 1, which reduces the number of channels to half of the original.

[0031] feature The information is input into the frequency domain branch and the space domain branch respectively to extract the frequency domain feature information and the space domain feature information respectively.

[0032] In the frequency domain branch, the feature First, use the fast Fourier transform FFT to convert from the spatial domain to the frequency domain to obtain the corresponding phase and amplitude information. Next, the phase and amplitude are processed separately, and the features are extracted and refined through 1*1 convolution, ReLu operation, and 1*1 convolution. Finally, the processed features are converted from the frequency domain back to the spatial domain through the inverse fast Fourier transform IFFT to obtain the features in the frequency domain. As shown in the following formula: ; ; Among them: Input feature map After fast Fourier transform FFT, it is converted into frequency domain features , h, w are spatial coordinates, u, v are frequency coordinates, and j is an imaginary unit. Frequency domain features is a complex number, decomposed into its real part and the imaginary part .

[0033] ; ; in: Represents the phase characteristics, Represents amplitude characteristics ; ; in: represents the phase characteristics after processing, Represents the processed amplitude feature, and Conv1*1 represents the convolution with a convolution size of 1.

[0034] ; ; in: represents the real part of the restored frequency domain features, Represents the imaginary part of the restored frequency domain features ; Among them: After inverse Fourier transform IFFT, the characteristics in the frequency domain are obtained

[0035] In the spatial domain branch: Features After 3*3 convolution, ReLU operation, and 3*3 convolution for feature extraction, the features in the spatial domain are obtained. .

[0036] ; Frequency-Spatial Interaction: Input Features , Generate query matrix Query, key matrix Key and value matrix Value through different linear transformations. As a query matrix , used in the spatial domain The key matrix Interact to obtain spatial domain features containing frequency domain information ; In turn, the characteristics of the spatial domain As a query matrix , used in the frequency domain The key matrix Interact to obtain frequency domain features including spatial domain . As shown in the following formula: ; ; ; ; ; ; Finally, in order to adaptively fuse two cross-domain features , . Get the features , we consider an adaptive weight allocator to fuse cross-domain features. The adaptive weight allocator can be formulated as: ; Among them, Awa represents the adaptive weight allocator, and σ represents the learnable factor in the adaptive weight allocator.

[0037] Specifically, S3 includes: inputting substation images and completing defect detection.

[0038] After inputting the substation image, defect detection is performed through a network based on YOLOv5. First, the input substation image is subjected to feature extraction by the Backbone part of YOLOv5 to extract multi-level feature information. Then, these features are fused through the cross-domain dynamic interactive attention fusion module CDIAFM of the Neck part to integrate information of different scales to enhance the expression ability of the model. After fusion, the features undergo a series of processing, including convolution and activation operations, to facilitate adaptation to the output format of the detection head. Finally, the processed features are input to the detection head to achieve target detection and classification of substation equipment defects.

[0039] Embodiment 2: 1. Parameter settings The dataset used in this paper is obtained by field photography of substations and network acquisition, and contains 6617 original pictures of substation defects. The dataset is divided into a training set and a test set with a ratio of 3:1. In view of the wide variety of substation defects, we selected 14 common defects as labels for subsequent analysis and processing.

[0040] In addition, the present invention uses the SGD optimizer to optimize the proposed network, and the momentum coefficient is set to β = 0.937. The resolution of the input image is 640 × 640, and the learning rate and batch size are set to 0.0001 and 16 respectively. The initialization learning rate is set to 0.01, and the loss function uses CIoU to ensure the accuracy and convergence speed of the model.

[0041] All experiments in this paper are conducted on NVIDIA RTX3090 GPU, and the code is implemented based on Pytorch. In order to comprehensively evaluate the performance of the proposed method, this paper uses mAP50 and mAP50-95 as evaluation indicators. At the same time, we compare our network with four other recent excellent algorithms, mainly including YOLOv5s, YOLOv7, YOLOv8s, and YOLOv10s.

[0042] 2. Experimental results

[0043] Table 1 Comparison results of our method with each method on the dataset Our invention is quantitatively evaluated with four other algorithms on our private dataset. Table 1 shows the mAP50 and mAP50-95 results of the tested method. mAP50 represents the average precision when the IoU threshold is 0.50, which is used to evaluate the accuracy of detection. mAP50-95 combines the average precision under multiple IoU thresholds, which can more comprehensively reflect the performance of the model.

[0044] As can be seen from the results, our method performs well in both mAP50 and mAP50-95 indicators, reaching 0.711 and 0.483 respectively. In comparison, the mAP50 of YOLOv5s, YOLOv7, YOLOv8s and YOLOv10s are 0.679, 0.695, 0.683 and 0.67 respectively, and the mAP50-95 are 0.428, 0.446, 0.459 and 0.462 respectively, which are all inferior to our model. Although YOLOv7 performs similarly to our model in some indicators, its model parameters are large and the computational resource consumption is high, which limits its efficiency and scalability in practical applications. In contrast, our method still achieves better performance while maintaining a relatively small number of parameters. This fully demonstrates the advantages of our method in balancing model complexity and detection performance, and provides a more efficient and resource-friendly solution for practical applications.

[0045] In summary, the proposed substation equipment defect detection network shows excellent detection performance in scenes with significant grayscale changes. This method can effectively cope with different scales, lighting changes (such as dark, bright and shadow) and rich texture details under complex background interference, greatly improving the detection accuracy, especially in areas with prominent grayscale changes.

[0046] 3. Ablation experiment In order to evaluate the effectiveness of this module, this paper mainly designs ablation experiments on the proposed YOLOv5-based framework and the cross-domain dynamic interactive attention fusion module. There are two experiments in total: (1) Base: Basic YOLOv5s framework. (2) Base+CDIAFM: Based on the basic framework, the Concat operation in the Neck part is replaced by the cross-domain dynamic interactive attention fusion module.

[0047] Table 2. mAP50 and mAP50-95 results on our private dataset

[0048] To ensure the fairness of the experiment, we trained the above two models using a private dataset under the same setting, and listed the mAP50 and mAP50-95 results in Table 2. First, based on the basic YOLOv5s framework, mAP50 and mAP50-95 reached 0.679 and 0.428 respectively. After introducing the cross-domain dynamic interactive attention fusion module CDIAFM proposed by us, mAP50 and mAP50-95 increased by 0.032 and 0.055 respectively. The experimental results show that this method shows significant effects in the substation equipment defect detection task, which further verifies the effectiveness of the cross-domain dynamic interactive attention fusion module CDIAFM.

Claims

1. A method for constructing a substation equipment defect detection network based on YOLOv5, characterized in that: The following steps are involved: S1. Construct a substation equipment defect detection network based on YOLOv5. Based on the YOLOv5 backbone architecture, the network replaces the Concat operation of the Neck part with the cross-domain dynamic interactive attention fusion module CDIAFM, so that the model can more accurately identify grayscale changes and reduce missed detection and false detection. S2, build a cross-domain dynamic interactive attention fusion module; This module combines two input features through channel splicing and fusion, and then divides them into two branches: frequency domain and spatial domain. In the frequency domain branch, Fourier transform FFT is introduced to obtain information in the frequency domain, and the amplitude and phase information in the frequency domain are processed separately. After processing, the inverse Fourier transform IFFT is used to return to the spatial domain to obtain frequency domain features. Among them, the amplitude information helps the model enhance the perception of the intensity of grayscale changes, making it easier for the model to focus on prominent change areas and suppress background noise. The phase information helps the model maintain the precise position and shape of the grayscale change area to ensure clear edges. Finally, through dynamic interactive attention, the important information in the frequency domain features is guided to the spatial domain, allowing the model to better identify areas with prominent grayscale changes. The contextual information in the spatial domain is reversely supplemented to the frequency domain to enhance the perception of subtle changes. S3, input substation image and complete defect detection; after inputting the substation image, feature extraction and fusion are performed through the YOLOv5-based network, and finally the target detection and classification of substation equipment defects are completed in the detection head.

2. The method for constructing a substation equipment defect detection network based on YOLOv5 according to claim 1, characterized in that: The substation equipment defect detection network based on YOLOv5 in S1 includes: First, the input substation image passes through the Backbone part of YOLOv5, using the CSPDarknet53 network structure, which is responsible for extracting features from the input image; Backbone gradually extracts low-level to high-level features of the image through a series of convolutional layers and residual connections to capture the spatial information in the image; then, the image features are passed to the Neck part, and the part that originally used four Concats for feature fusion has been improved to adopt the cross-domain dynamic interactive attention fusion module CDIAFM and introduce frequency domain information. Finally, the fused features enter the Head part, and the detection head of YOLOv5 is responsible for generating the final prediction results, including bounding box coordinates, target category labels and confidence scores; the entire network is trained using a standard loss function to optimize target detection accuracy and efficiency.

3. The method for constructing a substation equipment defect detection network based on YOLOv5 according to claim 2, characterized in that: The process of constructing the cross-domain dynamic interactive attention fusion module in S2 is as follows: Input Features , → Concat operation → 1*1 convolution operation → get features ; Frequency Domain Branch: Characteristics → Fast Fourier Transform FFT operation → Convert from spatial domain to frequency domain to obtain phase characteristic information and amplitude information ; Phase characteristics →1*1 convolution operation→ReLU operation→1*1 convolution operation→get the processed phase feature ; Amplitude characteristics →1*1 convolution operation→ReLU operation→1*1 convolution operation→get the processed phase feature ; feature ,feature → Inverse Fourier transform IFFT operation → Convert from frequency domain back to spatial domain to obtain frequency domain features ; Spatial Domain Branch :feature →3*3 convolution operation→ReLU operation→3*3 convolution operation→get spatial domain features ; Frequency-spatial domain interaction: Frequency domain characteristics →Linear transformation →Calculation , , ; Spatial Domain Characteristics →Linear transformation →Calculation , , ; use and Calculate Attention → Extract frequency domain feature information → Compare the result with Multiply → get the frequency domain features containing spatial information ; use and Calculate Attention → Extract information about spatial domain features → Combine the results with Multiply → get the spatial domain features containing frequency domain information ; The adaptive weight allocator assigns weights σ, →Multiply pixel by pixel; The adaptive weight allocator assigns weights 1-σ, →Multiply pixel by pixel; After weight multiplication, two features are fused and added to obtain the interactive features. .

4. The method for constructing a substation equipment defect detection network based on YOLOv5 according to claim 3, characterized in that: The specific process of S3 is as follows: After inputting the substation image, defect detection is performed through the network based on YOLOv5. First, the input substation image is subjected to feature extraction by the Backbone part of YOLOv5 to extract multi-level feature information. Then, it is fused through the cross-domain dynamic interactive attention fusion module CDIAFM of the Neck part to integrate information of different scales to enhance the expression ability of the model. After fusion, the features are convolved and activated to fit the output format of the detection head; Finally, the processed features are input into the detection head to achieve target detection and classification of substation equipment defects.

5. The method for constructing a substation equipment defect detection network based on YOLOv5 according to claim 4, characterized in that: In S2, the two input feature maps , After Concat, the channels are concatenated in the channel dimension, and then the number of channels is adjusted to half of the original through 1*1 convolution to obtain the fused features. , the formula is as follows: ; Among them, Concat represents the concatenation operation in the channel dimension, and Conv1*1 represents the convolution with a convolution size of 1, which reduces the number of channels to half of the original.

6. The method for constructing a substation equipment defect detection network based on YOLOv5 according to claim 5, characterized in that: The S2 features Input them into the frequency domain branch and the space domain branch respectively, and extract the frequency domain feature information and the space domain feature information respectively: In the frequency domain branch, the feature First, use fast Fourier transform (FFT) to convert from the spatial domain to the frequency domain to obtain the corresponding phase and amplitude information; Next, the phase and amplitude are processed separately, and the features are extracted and refined by 1*1 convolution, ReLu operation, and 1*1 convolution in turn; finally, the processed features are converted from the frequency domain back to the spatial domain through the inverse fast Fourier transform IFFT to obtain the features in the frequency domain; the formula is as follows: ; ; Among them: Input feature map After fast Fourier transform FFT, it is converted into frequency domain features , h, w are spatial coordinates, u, v are frequency coordinates, j is an imaginary unit; frequency domain characteristics is a complex number, decomposed into its real part and the imaginary part .

7. The method for constructing a substation equipment defect detection network based on YOLOv5 according to claim 6, characterized in that: In S2, the formula for converting from the spatial domain to the frequency domain to obtain the corresponding phase and amplitude information is as follows: ; ; in: Represents the phase characteristics, Indicates amplitude characteristics; ; ; in: represents the phase characteristics after processing, Represents the amplitude feature after processing, Conv1*1 represents the convolution with a convolution size of 1; ; ; in: represents the real part of the restored frequency domain features, Represents the imaginary part of the restored frequency domain features; ; Among them: After inverse Fourier transform IFFT, the characteristics in the frequency domain are obtained .

8. The method for constructing a substation equipment defect detection network based on YOLOv5 according to claim 6, characterized in that: In S2, in the spatial domain branch: Features After 3*3 convolution, ReLU operation, and 3*3 convolution for feature extraction, the features in the spatial domain are obtained. : ; Frequency-Spatial Interaction: Input Features , Generate query matrix Query, key matrix Key and value matrix Value through different linear transformations; transform the frequency domain features As a query matrix , used in the spatial domain The key matrix Interact to obtain spatial domain features containing frequency domain information ; In turn, the characteristics of the spatial domain As a query matrix , used in the frequency domain The key matrix Interact to obtain frequency domain features including spatial domain ; The formula is as follows: ; ; ; ; ; ; Finally, in order to adaptively fuse two cross-domain features , ; Get Features ,We consider an adaptive weight allocator to fuse cross-domain features; The adaptive weight allocator can be formulated as: ; Among them, Awa represents the adaptive weight allocator, and σ represents the learnable factor in the adaptive weight allocator.

Citation Information

Cited By

  • Cross-gate operation identification method and device based on deep learning, electronic equipment and program product

    CN120182720A