Method for constructing transformer substation equipment defect detection network based on difference compensation of YOLOv8
By adding a shared mapping difference compensation module to the YOLOv8 network, the problem that the feature fusion method of the YOLO network fails to effectively explore the differences between features in substation equipment defect detection is solved, and a significant improvement in detection performance and lower computing costs are achieved.
Patent Information
- Application Number
- CN202411781983.7
- 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
The existing YOLO network has the problem of feature fusion method in the detection of substation equipment defects, which fails to effectively explore the differences between features, resulting in limited detection performance.
Add a shared mapping difference compensation module in front of YOLOv8's detection head, map and align features through shared parameters, capture the difference information and fuse it with the features before the input detection head, enhancing the integrity and expression ability of feature representation.
The detection performance is significantly improved, and the excellent effect is shown on the multi-classified defect image dataset of the substation, while maintaining a low parameter quantity and calculation quantity.
Smart Images

Figure CN119785171A_ABST
Abstract
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 YOLOv8 difference compensation. Background Art
[0002] As a key node in the power system, substations play a vital role in the transmission, distribution and conversion of electric energy. As the types, quantity and complexity of substation equipment continue to increase, its operating environment becomes more complex, and the demand for equipment monitoring and maintenance increases accordingly. Therefore, it is particularly important to ensure the stable operation of substation equipment.
[0003] However, the traditional manual inspection method is time-consuming and laborious, and the efficiency and accuracy of the inspection are often difficult to meet the needs when facing many complex equipment. This has prompted intelligent detection technology to become an important development direction for improving the safety and reliability of substations. In the maintenance and management of power facilities, target detection technology plays a core role, especially in identifying and monitoring the abnormal status of large power equipment and the classification and status monitoring of small and medium-sized components in substations such as insulators and grounding wires. These detailed classification tasks are crucial to ensure the safe operation of the entire substation. At present, target detection algorithms are mainly divided into two categories: two-stage and single-stage target detection algorithms.
[0004] In the specific application of substations, two-stage object detection algorithms have shown remarkable performance, especially in the study of Zhao et al., who significantly improved the detection capability of power equipment, especially glass and composite insulators, by combining feature pyramid network (FPN) and adaptive threshold algorithm in HSV color space. This high-precision detection capability is crucial for timely detection and repair of minor damage to substation equipment, which helps prevent small problems from evolving into major faults that may affect the stable operation of the power system. However, although such algorithms provide accurate detection results in substation defect detection, they face challenges in processing speed and computational efficiency, which has prompted the development of single-stage object detection algorithms. The most representative single-stage algorithm is the YOLO series. For example, the densely connected FPN (DC-FPN) proposed by Zhang et al. based on YOLOv3 reduces the number of parameters of the insulator defect detection model and significantly improves the detection accuracy, making the detection of small equipment in the complex environment of substations more accurate. In addition, Bao et al. optimized the YOLOv5 detection model by introducing CA attention mechanism and BiFPN, making it more effective in handling small scale and diverse features in substations.
[0005] Although existing anomaly detection methods use effective feature fusion and transfer strategies, these methods often ignore the correlation between features, which may lead to duplication and redundancy of information, while masking the potential useful information in feature differences, thereby limiting the detection performance of the model. Summary of the invention
[0006] The present invention provides a method for constructing a substation equipment defect detection network based on YOLOv8 difference compensation, which solves the limitation of the features transmitted before the YOLO detection head when using the YOLO network for substation anomaly detection. The existing feature fusion method does not effectively explore the differences between features, resulting in limited detection performance of the model.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is: The method for constructing a substation equipment defect detection network based on difference compensation of YOLOv8 includes the following steps: S1, loading target detection image data from a corresponding database and converting it into a YOLO training format, and dividing the training set and the test set to prepare for subsequent model training and verification; S2. Build an improved YOLOv8 overall architecture and add three shared mapping difference compensation modules to the three detection heads of YOLOv8 respectively; S3. Design and implement a shared mapping difference compensation fusion module; S4. Input the substation equipment defect data set into the constructed substation equipment defect detection model, train the model through loss constraints, and finally output the defect detection results.
[0008] In S1 above, a substation equipment defect dataset in YOLO format is created And the corresponding tags .
[0009] The improved YOLOv8 overall architecture is constructed in S2 above, and the three shared mapping difference compensation fusion modules are added to the three detection heads of YOLOv8 respectively. The structure is as follows: The first layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The second layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The third layer feature extraction module C2f; The fourth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The fifth layer feature extraction module C2f; The sixth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The seventh layer feature extraction module C2f; The eighth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The ninth spatial pyramid pooling layer SPPF module; The tenth layer upsample Upsample module; The eleventh layer concat operation; The twelfth layer C2F module; The thirteenth layer upsample Upsample module; The fourteenth layer is concat operation; The fifteenth layer C2F module; The sixteenth layer isomorphic feature difference compensation module IFDC1; The seventeenth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The eighteenth layer concat operation; The nineteenth layer C2F module; The twentieth layer isomorphic feature difference compensation module IFDC2; The 21st layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The twenty-second layer concat operation; 23rd floor C2F module; The twenty-fourth layer isomorphic feature difference compensation module IFDC3; The twenty-fifth layer detection head 1; The twenty-sixth layer detection head 2; The twenty-seventh layer detection head 3; The specific operation of the sixteenth layer IFDC1 is: the feature map output by the fifth layer And the feature map of the fifteenth layer output →Shared mapping difference compensation fusion module IFDC1→output a feature map ; The specific operation of the 20th layer IFDC2 is: the feature map output by the seventh layer And the feature map output by the nineteenth layer →Shared mapping difference compensation fusion module IFDC2→output a feature map ; The specific operation of the 24th layer IFDC3 is: the feature map output by the ninth layer And the feature map output by the 23rd layer →Shared mapping difference compensation fusion module IFDC3→Output a feature map .
[0010] The specific structure of the shared mapping difference compensation fusion module IFDC in the above S3 is as follows: Backbone network feature x→1*1 standard convolution → Batch Normalization →Activation function →Output feature map →3*3 standard convolution →Activation function →Output feature map → and Add input to 3*3 →Activation function →Output feature map →Feature map and Add → Output Feature map ; Detection head feature y→1*1 standard convolution → Batch Normalization →Activation function →Output feature map →3*3 standard convolution →Activation function →Output feature map → and Add input to 3*3 →Activation function →Output feature map →Feature Map and Add → Output Feature map ; , →Element-by-element subtraction →Output difference features ; Differentiating features →1*1 standard convolution →Sigmoid activation function →Output weights and difference features Multiply → get the updated difference feature →Differentiation features and Add element by element → get fusion Feature map →1*1 standard convolution → Batch Normalization →Activation function →Get Fusion features .
[0011] The model training in S4 above adopts the following steps: S4.1, input the defect image of substation equipment into the improved YOLOv8 model for feature extraction; S4.2, the feature maps of different layers are fused in the neck part of YOLOv8, and the fused features are transmitted to the detection heads of three sizes for processing to generate the final detection image; S4.3. Apply three loss constraints during network training to optimize model performance.
[0012] In S4.3 above, the three loss constraints are as follows: 1) Binary cross entropy loss BCE, which quantifies the difference between the model's predicted probability and the actual label. By minimizing the BCE loss, the classification performance of the model can be optimized. The specific formula is: ; in The true label is usually represented as 0 or 1; Represents the probability predicted by the model, which means the probability that the model believes the sample belongs to label 1; 2) Bounding box regression loss CIoU is used to fully reflect the similarity between the predicted box and the true box. The specific formula is: ; Where IoU is the inter-unit union between the predicted bounding box b and the real bounding box The intersection-and-union ratio between them; ) represents the predicted bounding box b and the true bounding box The Euclidean distance between the center points; c is the diagonal length of the minimum enclosed area containing the two boxes; is a term used to measure the consistency of aspect ratio; is a weight parameter used to balance the importance of the proportional term and other parts; 3) Distribution focus loss DFL is used to deal with regression problems when predicting continuous variables. The specific formula is: ; in is the true continuous target value; and is in the discretized space, and the true value The closest two adjacent discrete points; and is the true value predicted by the model Drop discrete points and probability or score; The total loss function of the overall network is expressed as: ; in , , is a hyperparameter that balances between different losses.
[0013] The present invention provides a method for constructing a substation equipment defect detection network based on difference compensation of YOLOv8, and the beneficial effects are as follows: 1) We improved the YOLOv8 model, significantly improving the detection performance and demonstrating excellent results on a substation multi-classification defect image dataset. Our algorithm has been experimentally compared to confirm its excellent performance while maintaining a low number of parameters and computational complexity.
[0014] 2) Based on the Yolov8 network, a shared mapping difference compensation fusion module is proposed to explore the feature connection between the backbone network and the detection head. This module uses shared parameters to map and align features, captures difference information through subtraction, and fuses with the features before inputting the detection head to compensate for the deficiencies of the detection head features, thereby enhancing the integrity and expressiveness of the fused feature representation. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The present invention will be further described below in conjunction with the accompanying drawings and embodiments: Figure 1 is an overall network structure diagram of an embodiment of the present invention; Figure 2 Schematic diagram of the shared mapping difference compensation fusion module IFDC. DETAILED DESCRIPTION
[0016] 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.
[0017] The method for constructing a substation equipment defect detection network based on difference compensation of YOLOv8 includes the following steps: S1, loading target detection image data from a corresponding database and converting it into a YOLO training format, and dividing the training set and the test set to prepare for subsequent model training and verification; S2. Build an improved YOLOv8 overall architecture and add three shared mapping difference compensation modules to the three detection heads of YOLOv8 respectively; S3. Design and implement a shared mapping difference compensation fusion module, which is responsible for deep feature fusion between different feature layers to better highlight abnormal signals; S4. Input the substation equipment defect data set into the constructed substation equipment defect detection model, train the model through loss constraints, and finally output the defect detection results.
[0018] In S1 above, a substation equipment defect dataset in YOLO format is created And the corresponding tags .
[0019] The improved YOLOv8 overall architecture is constructed in S2 above, and the three shared mapping difference compensation fusion modules are added to the three detection heads of YOLOv8 respectively. The structure is as follows: The first layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The second layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The third layer feature extraction module C2f; The fourth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The fifth layer feature extraction module C2f; The sixth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The seventh layer feature extraction module C2f; The eighth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The ninth spatial pyramid pooling layer SPPF module; The tenth layer upsample Upsample module; The eleventh layer concat operation; The twelfth layer C2F module; The thirteenth layer upsample Upsample module; The fourteenth layer is concat operation; The fifteenth layer C2F module; The sixteenth layer isomorphic feature difference compensation module IFDC1; The seventeenth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The eighteenth layer concat operation; The nineteenth layer C2F module; The twentieth layer isomorphic feature difference compensation module IFDC2; The 21st layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The twenty-second layer concat operation; 23rd floor C2F module; The twenty-fourth layer isomorphic feature difference compensation module IFDC3; The twenty-fifth layer detection head 1; The twenty-sixth layer detection head 2; The twenty-seventh layer detection head 3; The specific operation of the sixteenth layer IFDC1 is: the feature map output by the fifth layer And the feature map of the fifteenth layer output →Shared mapping difference compensation fusion module IFDC1→output a feature map ; The specific operation of the 20th layer IFDC2 is: the feature map output by the seventh layer And the feature map output by the nineteenth layer →Shared mapping difference compensation fusion module IFDC2→output a feature map ; The specific operation of the 24th layer IFDC3 is: the feature map output by the ninth layer And the feature map output by the 23rd layer →Shared mapping difference compensation fusion module IFDC3→Output a feature map .
[0020] The specific structure of the shared mapping difference compensation fusion module IFDC in the above S3 is as follows: Backbone network feature x→1*1 standard convolution → Batch Normalization →Activation function →Output feature map →3*3 standard convolution →Activation function →Output feature map → and Add input to 3*3 →Activation function →Output feature map →Feature Map and Add → Output Feature map ; Detection head feature y→1*1 standard convolution → Batch Normalization →Activation function →Output feature map →3*3 standard convolution →Activation function →Output feature map → and Add input to 3*3 →Activation function →Output feature map →Feature Map and Add → Output Feature map ; , →Element-by-element subtraction →Output difference features ; Differentiating features →1*1 standard convolution →Sigmoid activation function →Output weights and difference features Multiply → get the updated difference feature →Differentiation features and Add element by element → get fusion Feature map →1*1 standard convolution → Batch Normalization →Activation function →Get Fusion features .
[0021] The model training in S4 above adopts the following steps: S4.1, input the defect image of substation equipment into the improved YOLOv8 model for feature extraction; S4.2, the feature maps of different layers are fused in the neck part of YOLOv8, and the fused features are transmitted to the detection heads of three sizes for processing to generate the final detection image; S4.3. Apply three loss constraints during network training to optimize model performance.
[0022] In S4.3 above, the three loss constraints are as follows: 1) Binary cross entropy loss BCE, which quantifies the difference between the model's predicted probability and the actual label. By minimizing the BCE loss, the classification performance of the model can be optimized. The specific formula is: ; in The true label is usually represented as 0 or 1; Represents the probability predicted by the model, which means the probability that the model believes the sample belongs to label 1; 2) Bounding box regression loss CIoU is used to fully reflect the similarity between the predicted box and the true box. The specific formula is: ; Where IoU is the inter-unit union between the predicted bounding box b and the real bounding box The intersection-and-union ratio between them; ) represents the predicted bounding box b and the true bounding box The Euclidean distance between the center points; c is the diagonal length of the minimum enclosed area containing the two boxes; is a term used to measure the consistency of aspect ratio; is a weight parameter used to balance the importance of the proportional term and other parts; 3) Distribution focus loss DFL is used to deal with regression problems when predicting continuous variables. The specific formula is: ; in is the true continuous target value; and is in the discretized space, and the true value The closest two adjacent discrete points; and is the true value predicted by the model Drop discrete points and probability or score; The total loss function of the overall network is expressed as: ; in , , is a hyperparameter that balances between different losses.
[0023] Embodiment 1: like Figure 1 and Figure 2 As shown, a method for constructing a substation equipment defect detection network based on shared mapping difference compensation of YOLOv8 includes the following steps: S1. Load the target detection image data from the corresponding database and convert it to the YOLO training format, and divide it into training and test sets to prepare for subsequent model training and verification; S2. Build an improved YOLOv8 overall architecture and add three shared mapping difference compensation modules to the three detection heads of YOLOv8 respectively; S3. Design and implement a shared mapping difference compensation module, which is responsible for deep feature fusion between different feature layers to better highlight abnormal signals; S4. Input the substation equipment defect data set into the constructed substation equipment defect detection model, train the model through loss constraints, and finally output the defect detection results.
[0024] Step S1 specifically includes: Create a substation equipment defect dataset in YOLO format And the corresponding tags .
[0025] Step S2 specifically includes: like Figure 1 As shown in the figure, we have made improvements to the neck part of YOLOv8, inputting the feature maps output by the fifth and fifteenth layers into the IFDC1 module for fusion, and outputting the feature map The feature map output from the seventh layer and the feature map output from the nineteenth layer are input to the IFDC2 module for fusion, and the output feature map ; The feature maps output from the ninth and twenty-third layers are input to the IFDC3 module for fusion, and the output feature maps The specific formula is as follows: ; ; ; Step S3 specifically includes: For the overall structure of the shared mapping difference compensation fusion module IFDC, Figure 2 The size is Feature map From different layers, From the backbone network, From the detection head. First, I will use a shared 1*1 standard convolution on the two feature maps. Project them into the same feature space for dimensionality reduction and get the output Feature Map , , the specific formula is as follows.
[0026] ; ; After obtaining the feature map after dimensionality reduction, in order to further refine and enhance the features, we first use a shared 3x3 standard convolution kernel for preliminary feature construction. This method uses the same convolution parameters in the same feature space to effectively perform deep construction and refinement, thereby ensuring the consistency and efficiency of the feature extraction process. The specific formula is as follows: ; ; To further deepen the feature processing, we further use the shared ScConv to perform feature enhancement in the same feature space and obtain the feature map , In this step, we introduce residual connections to integrate the previous feature maps With the new processed output Merge to enhance the learning ability of the model and prevent information loss. The specific formula is as follows: ; ; Next, we integrate the features extracted twice and merge the initially constructed features with the enhanced features through an addition operation. This step aims to aggregate information from different processing stages, further enhance the expressiveness of the features and the prediction accuracy of the model, and ensure the integrity and effectiveness of the final feature map.
[0027] ; ; Afterwards, we will feature map Subtract the difference features from each other to extract the difference features. To further utilize these difference features, we use a 1x1 standard convolution kernel and a Sigmoid activation function to convert the difference features into weight values. These weight values reflect the importance of each feature in the final detection task. Then, we combine these weighted difference features with the features of the detection head. Add and fuse to get Feature map .
[0028] ; ; Finally, through 1*1 convolution, BN, and RELU operations, Feature map Convert to Fusion features .
[0029] ; Step S4 specifically includes: In the training process of the substation equipment defect detection model, in order to improve the detection effect of the model, we used three different loss functions for constraints and optimization. The specific description is as follows: The first binary cross entropy loss BCE is used to quantify the difference between the defect probability predicted by the model and the true label. By minimizing the BCE loss, the model can better fit the training data, thereby improving the classification performance. The specific formula is: ; In binary cross entropy loss (BCE), the true label Usually 0 or 1; the predicted probability of the model is expressed as , whose value is between 0 and 1, indicating the probability that the model considers the sample to belong to the defect class.
[0030] The second loss is the bounding box regression loss CIoU, which is used to measure the similarity between the predicted box and the true box. CIoU takes into account factors such as the overlapping area, center point distance, and aspect ratio of the predicted box and the true box, so that it can more comprehensively reflect the matching between the predicted box and the true box: ; Where IoU is the inter-unit union between the predicted bounding box b and the real bounding box The intersection-over-union ratio between them is used to measure the size of the overlapping area of two boxes; ) represents the predicted bounding box b and the true bounding box The Euclidean distance between the center points, , is used to reflect the deviation in position between the two; c is the diagonal length of the minimum closed area containing the two boxes, which is used to standardize the distance term so that the loss value is consistent between boxes of different scales; 𝑣 is a term used to measure the consistency of the aspect ratio. By comparing the difference in aspect ratio between the predicted box and the real box, the model can fit the shape of the object more accurately; It is a weight parameter used to balance the importance of the scale term and other parts, so that CIoU can comprehensively consider the overlap area, center point distance and aspect ratio consistency.
[0031] The third loss is the distribution focus loss DFL, which is mainly used to deal with the regression problem of predicting continuous variables, such as the precise position prediction of the bounding box. The specific formula is: ; in is the true continuous target value; and is the discretized space with the true value The closest two adjacent discrete points; and is the true value predicted by the model Drop discrete points and probability or score.
[0032] The total loss function of the overall network is expressed as: ; in , , is a hyperparameter that balances between different losses, =7.5, =0.5, =1.5.
[0033] Embodiment 2: 1. Parameter settings This study was evaluated on a self-collected dataset of defective images of substation equipment. Due to the limited number of samples, a total of 6646 images were collected, and the dataset was divided into a training set and a test set, of which the training set contained 4653 images and the test set contained 1993 images, with a division ratio of approximately 7:3. The experiment was conducted on an NVIDIA RTX3090 GPU and a deep learning framework based on PyTorch. The input image size was set to 640x640 pixels, and the network training used the Adam optimizer, in which the momentum decay coefficient β1 was set to 0.9 and β2 was set to 0.999. The initial learning rate was set to 0.01, and the batch size was set to 16 in view of the GPU memory limitation. In order to comprehensively evaluate the proposed method, precision, recall, MAP50, and MAP50-95 were selected as performance indicators. In addition, to verify the superiority of this method, it was compared with several popular algorithms such as Yolov5s, RTMdet, Yolov8n, and Yolov10n.
[0034] 2. Experimental results Table 1 Comparison results of our method with each method on the substation anomaly dataset
[0035] Our method is quantitatively evaluated on the substation equipment defect dataset with four other algorithms. Table 1 shows the average precision (P), recall (R), MAP50 and MAP50-95 results of each method on the test set. It can be seen that on the substation anomaly dataset, our method outperforms other methods in all indicators.
[0036] In summary, the substation equipment defect detection network we proposed has excellent detection performance in substations; through this network, anomalies in images can be efficiently identified and accurately classified.
Claims
1. A method for constructing a substation equipment defect detection network based on difference compensation of YOLOv8, characterized in that: The following steps are involved: S1. Load the target detection image data from the corresponding database and convert it to the YOLO training format, and divide it into training and test sets to prepare for subsequent model training and verification; S2. Build an improved YOLOv8 overall architecture and add three shared mapping difference compensation modules to the three detection heads of YOLOv8 respectively; S3. Design and implement a shared mapping difference compensation fusion module; S4. Input the substation equipment defect data set into the constructed substation equipment defect detection model, train the model through loss constraints, and finally output the defect detection results.
2. The method for constructing a substation equipment defect detection network based on difference compensation of YOLOv8 according to claim 1 is characterized in that: In S1, a substation equipment defect dataset in YOLO format is created And the corresponding tags .
3. The method for constructing a substation equipment defect detection network based on difference compensation of YOLOv8 according to claim 2 is characterized in that: The improved YOLOv8 overall architecture is constructed in S2, and the three shared mapping difference compensation fusion modules are added to the three detection heads of YOLOv8 respectively. The structure is as follows: The first layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The second layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The third layer feature extraction module C2f; The fourth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The fifth layer feature extraction module C2f; The sixth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The seventh layer feature extraction module C2f; The eighth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The ninth spatial pyramid pooling layer SPPF module; The tenth layer upsampling Upsample module; The eleventh layer concat operation; The twelfth layer C2F module; The thirteenth layer upsample Upsample module; The fourteenth layer is concat operation; The fifteenth layer C2F module; The sixteenth layer isomorphic feature difference compensation module IFDC1; The seventeenth layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The eighteenth layer concat operation; The nineteenth layer C2F module; The twentieth layer isomorphic feature difference compensation module IFDC2; The 21st layer is a standard convolution Conv module with a convolution kernel size of 3*3 and a step size of 2; The twenty-second layer concat operation; 23rd floor C2F module; The twenty-fourth layer isomorphic feature difference compensation module IFDC3; 25th layer detection head 1; The twenty-sixth layer detection head 2; The twenty-seventh layer detection head 3; The specific operation of the sixteenth layer IFDC1 is: the feature map output by the fifth layer And the feature map of the fifteenth layer output →Shared mapping difference compensation fusion module IFDC1→output a feature map ; The specific operation of the 20th layer IFDC2 is: the feature map output by the seventh layer And the feature map output by the nineteenth layer →Shared mapping difference compensation fusion module IFDC2→Output a feature map ; The specific operation of the 24th layer IFDC3 is: the feature map output by the ninth layer And the feature map output by the 23rd layer →Shared mapping difference compensation fusion module IFDC3→Output a feature map .
4. The method for constructing a substation equipment defect detection network based on difference compensation of YOLOv8 according to claim 3 is characterized in that: The specific structure of the shared mapping difference compensation fusion module IFDC in S3 is as follows: Backbone network feature x→1*1 standard convolution → Batch Normalization →Activation function →Output feature map →3*3 standard convolution →Activation function →Output feature map → and Add input to 3*3 →Activation function →Output feature map →Feature map and Add → Output Feature map ; Detection head feature y→1*1 standard convolution → Batch Normalization →Activation function →Output feature map →3*3 standard convolution →Activation function →Output feature map → and Add input to 3*3 →Activation function →Output feature map →Feature map and Add → Output Feature map ; , →Element-by-element subtraction →Output difference features ; Differentiating features →1*1 standard convolution →Sigmoid activation function →Output weights and difference features Multiply → get the updated difference feature →Differentiation features and Add element by element → get fusion Feature map →1*1 standard convolution → Batch Normalization →Activation function →Get Fusion features .
5. The method for constructing a substation equipment defect detection network based on difference compensation of YOLOv8 according to claim 4 is characterized in that: The model training in S4 described above adopts the following steps: S4.1, input the defect image of substation equipment into the improved YOLOv8 model for feature extraction; S4.2, the feature maps of different layers are fused in the neck part of YOLOv8, and the fused features are transmitted to the detection heads of three sizes for processing to generate the final detection image; S4.
3. Apply three loss constraints during network training to optimize model performance.
6. The method for constructing a substation equipment defect detection network based on difference compensation of YOLOv8 according to claim 5, characterized in that: In S4.3, the three loss constraints are as follows: 1) Binary cross entropy loss BCE, which quantifies the difference between the model's predicted probability and the actual label. By minimizing the BCE loss, the classification performance of the model can be optimized. The specific formula is: ; in The true label is usually represented as 0 or 1; Represents the probability predicted by the model, which means the probability that the model believes the sample belongs to label 1; 2) Bounding box regression loss CIoU is used to fully reflect the similarity between the predicted box and the true box. The specific formula is: ; Where IoU is the inter-unit union between the predicted bounding box b and the real bounding box The intersection-and-union ratio between them; ) represents the predicted bounding box b and the true bounding box The Euclidean distance between the center points; c is the diagonal length of the minimum enclosed area containing the two boxes; is a term used to measure the consistency of aspect ratio; is a weight parameter used to balance the importance of the proportional term and other parts; 3) Distribution focus loss DFL is used to deal with regression problems when predicting continuous variables. The specific formula is: ; in is the true continuous target value; and is in the discretized space, and the true value The closest two adjacent discrete points; and is the true value predicted by the model Drop discrete points and The probability or score of The total loss function of the overall network is expressed as: ; in , , is a hyperparameter that balances between different losses.