Improved YOLOv8n-based power distribution equipment defect detection method and device
By introducing RAB-C2f and SOEP modules in the YOLOv8n model, combining the double-residual attention mechanism, the feature extraction and fusion process is optimized, and the problem of insufficient detection accuracy and efficiency in the detection of distribution equipment is solved, achieving efficient identification of small targets in complex contexts.
Patent Information
- Application Number
- CN202510561751.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-15
AI Technical Summary
The existing YOLO algorithm has problems with insufficient detection accuracy and efficiency in power distribution equipment defect detection, especially in complex backgrounds and small object detection tasks.
By introducing the RAB-C2f module and SOEP module in the YOLOv8n model, combining the double-residual attention mechanism, optimizing the feature extraction and fusion process, establishing an improved YOLO-RAB-SOEP model, and using Adam optimization algorithm and learning rate decay strategy for training.
It significantly improves the detection accuracy and efficiency of small targets in complex contexts, enhances the generalization ability and stability of the model, and improves the accuracy and speed of detection.
Smart Images

Figure CN120495838A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection technology, and in particular to a method and device for detecting defects in power distribution equipment based on an improved YOLOv8n. Background Art
[0002] Defects in distribution equipment can threaten the safe and stable operation of power systems. Therefore, distribution equipment defect detection plays a vital role in the power sector. Currently, the YOLO algorithm is widely used for fault detection. However, using YOLO for distribution equipment defect detection still faces the dual challenges of detection accuracy and efficiency. Therefore, improvements to existing technologies are needed.
[0003] Defects in distribution equipment can not only affect the stable operation of the power grid but can also lead to outages of power facilities and significant economic losses. Therefore, defect detection in distribution equipment is particularly important. While the YOLO algorithm has demonstrated promising results in some applications, the task of detecting distribution equipment still faces many challenges, particularly when detecting small objects in complex backgrounds and dynamic environments.
[0004] When it comes to defect detection for power distribution equipment, accurately and quickly identifying small targets in complex environments remains a technical challenge. Traditional target detection algorithms often fail to achieve ideal detection results, especially when facing complex backgrounds and small device details. Summary of the Invention
[0005] In order to overcome the shortcomings of low detection accuracy and low detection efficiency of existing distribution equipment defect detection methods, the present invention provides a distribution equipment defect detection method and device based on improved YOLOv8n to improve detection accuracy and efficiency.
[0006] The technical solution adopted by the present invention to solve its technical problem is:
[0007] A method for detecting defects in power distribution equipment based on improved YOLOv8n includes the following steps:
[0008] S1. Processing and dividing the distribution equipment detection data set;
[0009] S2. By introducing the RAB-C2f module and SOEP module into the YOLOv8n model, an improved YOLOv8n distribution equipment defect detection model is established;
[0010] S3. Use the training set to train the improved model to obtain the target detection model;
[0011] S4. Input the test set samples into the target detection model to perform defect detection and evaluate the results.
[0012] Furthermore, in S1, the processing and dividing of the power distribution equipment detection data set includes: standardizing and normalizing the power distribution equipment detection data set, and dividing the data set into a training set and a test set, wherein the division ratio of the training set to the test set is 7:3.
[0013] Furthermore, in said S2, improving the distribution equipment defect detection model of YOLOv8n includes improving the structures related to feature extraction, fusion and prediction;
[0014] Based on YOLOv8n, the RAB-C2f module is introduced and combined with the dual residual attention mechanism and SOEP module for feature enhancement, thereby optimizing the backbone network and neck network, significantly improving the accuracy of small target detection in complex backgrounds.
[0015] Preferably, the feature extraction layer is used to perform multi-layer convolution feature extraction on the preprocessed image to form a feature map;
[0016] The feature fusion layer consists of the C2f-RAB module, the SPDConv module, and the CSPOMniKernel module, which is used to achieve deep and shallow information fusion;
[0017] The prediction layer is used to make multi-scale predictions for feature maps of different sizes;
[0018] The C2f-RAB module is an improvement based on the C2f module. By combining multi-layer feature reuse and attention mechanism, it optimizes the feature extraction and fusion process, thereby improving the detection accuracy of the model.
[0019] In S3, the training model adopts the Adam optimization algorithm and the learning rate decay strategy. When the model loss value no longer decreases after a specific number of epochs, the training is stopped. The initial value of the learning rate is a specific value, and the learning rate decays to a specific proportion of the original value after a specific number of epochs.
[0020] Preferably, the specific value is 0.001, the specific number is 20, the specific ratio is 0.9, and the specific number is 10.
[0021] A power distribution equipment defect detection device based on improved YOLOv8n, comprising:
[0022] Data processing and division module, used to process and divide the distribution equipment detection data set;
[0023] A model building module is used to build an improved YOLOv8n distribution equipment defect detection model by introducing C2f-RAB and SOEP modules into YOLOv8n;
[0024] The model training module is used to train the improved model using the training set to obtain the target detection model;
[0025] The detection and evaluation module is used to input the test set samples into the target detection model for defect detection and evaluate the results.
[0026] The present invention constructs an efficient distribution equipment defect detection model by adding YOLO with C2f-RAB and SOEP modules. While reducing redundant information, it fully enhances low-level detail features and high-level positioning features, realizes the fusion of deep and shallow information, and improves the accuracy of target detection.
[0027] The beneficial effects of the present invention are mainly manifested in: improving detection accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a flow chart of a method for detecting defects in power distribution equipment based on improved YOLOv8n provided by the present invention;
[0029] Figure 2 This is a YOLOv8-RAB-SOEP model architecture diagram in a distribution equipment defect detection method based on improved YOLOv8n provided by the present invention;
[0030] Figure 3 This is a system architecture diagram of a distribution equipment defect detection device based on improved YOLOv8n provided by the present invention. DETAILED DESCRIPTION
[0031] The present invention will be further described below with reference to the accompanying drawings.
[0032] Reference Figures 1 to 3 , a distribution equipment defect detection method based on improved YOLOv8n, comprising the following steps:
[0033] S1. Processing and dividing the distribution equipment detection data set;
[0034] In this embodiment, the processing and dividing of the power distribution equipment detection data set includes:
[0035] The distribution equipment detection dataset is standardized and normalized, and the dataset is divided into a training set and a test set, where the ratio of the training set to the test set is 7:3.
[0036] S2. By introducing the RAB-C2f module and SOEP module into the YOLOv8n model, an improved YOLOv8n distribution equipment defect detection model is established;
[0037] The improved YOLOv8n model includes improved feature extraction, fusion and prediction related structures;
[0038] By introducing the RAB-C2f module and SOEP module into YOLOv8n, an improved YOLOv8n distribution equipment defect detection model is established, including:
[0039] Based on YOLOv8n, the RAB-C2f module is introduced and combined with the dual residual attention mechanism and SOEP module for feature enhancement, thereby optimizing the backbone network and neck network, significantly improving the accuracy of small target detection in complex backgrounds.
[0040] In this embodiment, the feature extraction layer is used to perform multi-layer convolution feature extraction on the preprocessed image to form a feature map;
[0041] The feature fusion layer consists of the C2f-RAB module, the SPDConv module, and the CSPOMniKernel module, which is used to achieve deep and shallow information fusion;
[0042] The prediction layer is used to make multi-scale predictions for feature maps of different sizes;
[0043] The C2f-RAB module is an improvement based on the C2f module. By combining multi-layer feature reuse and attention mechanism, it optimizes the feature extraction and fusion process, thereby improving the detection accuracy of the model.
[0044] In the actual detection of power distribution equipment, the existence of small defect targets and complex environmental conditions such as rainy days and foggy days make it particularly important to enhance low-level detail features, which helps to accurately distinguish similar features, thereby ensuring the detection effect in complex scenes. At the same time, enhancing high-level positioning features is equally critical, which helps to highlight edge features more clearly in complex backgrounds. In addition, if there is too much redundant information in the detection process, it may have a negative impact on the overall detection performance. Therefore, this embodiment adds a RAB-C2f module on the basis of YOLOv8n, and combines the dual residual attention mechanism with the SOEP module for feature enhancement, thereby optimizing the backbone network and the neck network. This introduction fully enhances low-level detail features and high-level positioning features while reducing redundant information. Thus, an improved distribution equipment detection model called YOLO-RAB-SOEP has been developed, such as Figure 2 The following figure shows the YOLO-RAB-SOEP model architecture diagram.
[0045] YOLO-RAB-SOEP model architecture:
[0046] The YOLO-RAB-SOEP model architecture consists of three parts: the feature extraction layer, the feature fusion layer, and the prediction output layer. The feature extraction layer performs multi-layer convolution feature extraction on the preprocessed image to form a feature map.
[0047] The convolutional layer is the most basic operation in a neural network. Its purpose is to extract the spatial features of the input data. Assuming the input data is X, the convolution operation is defined as follows:
[0048] Y=X*W+b
[0049] At the feature fusion layer, the improved model introduces the Cross-Stage Feature Fusion (C2F) module. C2F is a cross-stage feature fusion method that enhances the network's feature representation capabilities by concatenating feature maps from different layers. In YOLO-RAB-SOEP, the C2F layer appears repeatedly, emphasizing the fusion of features at multiple scales.
[0050] For two feature maps X1 and X2, the output of c2f is calculated by concatenation operation:
[0051] Y = concat(X1, X2)
[0052] This means that the network will concatenate the two feature maps along the channel direction to form a new feature map.
[0053] The spatial translation convolution (SPDConv) in the YOLO-RAB-SOEP model architecture is a convolutional layer used to extract spatial information. It enhances the model's perception of complex backgrounds and object details through finer spatial operations.
[0054] Assume that the input feature map is X and the output of SPDConv is Y as follows:
[0055] Y=f(X,θ), where f is the SPDConv operation and θ is the parameter of the operation.
[0056] To enhance the robustness of the network, CSP0mniKernel is introduced, which is a multi-kernel convolution method. It enhances the network's adaptability to various features by combining multiple convolution kernels.
[0057] Assume that the input is X and the output is Y, and use multiple convolution kernels to calculate:
[0058] Among them, W i is the i-th convolution kernel, and n is the number of convolution kernels.
[0059] Upsampling is used to increase the size of the feature map, usually to restore spatial resolution. It increases the resolution of the feature map through interpolation or transposed convolution. For example, assuming the input is X, the upsampling operation can be expressed as:
[0060] Y=UpSample(X)
[0061] In order to enhance the network's detection ability for objects of different sizes, especially small targets, SPPF (Spatial Pyramid Pooling Fusion) is introduced to extract multi-scale features through pooling operations at different scales.
[0062] Assume the input is X and the output of the SPPF operation is Y:
[0063] Y=SPP(X)
[0064] The SPP operation is performed through multiple pooling layers and feature map fusion, usually including 1x1, 3x3 and 5x5 pooling kernels to extract information at different scales.
[0065] In the prediction output part of the model, the detection module (Detect) is introduced to generate the final detection results.
[0066] The task of the detection module is usually to output bounding boxes and category labels through a convolutional network. Assuming that the output of the network is Y, the detection formula is expressed as:
[0067] Y=Detect(X)
[0068] The improved YOLO-RAB-SOEP model enhances feature extraction, fusion, and accuracy by combining multiple c2f, SPDConv, CSP0mniKernel, and other modules. These improvements enable better detection of small objects in complex scenes and handle different scales in images through upsampling and downsampling and feature fusion.
[0069] Figure 2 The confusion matrix of YOLO-RAB-SOEP on the partitioned dataset is shown. This matrix reflects the model's accuracy in detecting different types of distribution equipment targets. As can be seen from the matrix, only a very small number of distribution equipment targets were misclassified as "background," while a very small number of background objects were mistaken for distribution equipment. Notably, there were no false detections of defective objects, and the number of missed defective objects was extremely low. Furthermore, the model excelled in detecting small objects, a result that is crucial for distribution equipment detection, as the risk of false detection of defective objects is greater than that of background and distribution equipment.
[0070] The trained YOLO-RAB-SOEP model shows its prediction performance under different backgrounds. Due to the use of data augmentation and data fusion, the power distribution equipment in some images in the dataset may be occluded. It is important to emphasize that the model demonstrates significant performance when dealing with power distribution equipment and its defects under various background conditions. This demonstrates that our work not only improves the model's detection performance but also enhances its generalization capabilities in complex backgrounds.
[0071] S3. Use the training set to train the improved model to obtain the target detection model;
[0072] In this embodiment, the improved model is trained using the training set to obtain the target detection model, including:
[0073] The training model uses the Adam optimization algorithm and the learning rate decay strategy. Training is stopped when the model loss value no longer decreases for a specific number of consecutive epochs.
[0074] In this embodiment, the initial value of the learning rate is a specific value, and the learning rate decays to the original specific ratio after each specific number of epochs.
[0075] In this embodiment, the specific value is 0.001, the specific number is 20, the specific ratio is 0.9, and the specific number of times is 10.
[0076] S4. Input the test set samples into the target detection model to perform defect detection and evaluate the results.
[0077] Reference Figure 3 The embodiment of the present invention provides a power distribution equipment defect detection device based on an improved YOLOv8n, which is used to implement the power distribution equipment defect detection method based on the improved YOLOv8n as described in the above embodiment, including:
[0078] The data processing and partitioning module 10 is responsible for preprocessing and partitioning the power distribution equipment detection dataset. Data preprocessing includes standardization and normalization operations to ensure the quality and consistency of the input data. Specifically, the data processing and partitioning module includes a data standardization unit and a data normalization unit for performing corresponding standardization and normalization on the data. In addition, it also includes a dataset partitioning unit for dividing the dataset into a training set and a test set according to a preset ratio.
[0079] Model construction module 20, which is used to build a model suitable for distribution equipment defect detection by introducing an improved mechanism in the YOLO-RAB-SOEP model. The model construction module 20 constructs an improved YOLO-RAB-SOEP model based on the YOLOv8n model. The model optimizes the backbone network and neck network structure by introducing a design based on feature reuse and dual residual attention mechanism. The overall network consists of a feature extraction layer, a feature fusion layer and a prediction layer. The feature extraction layer is responsible for performing multi-layer convolution operations on the preprocessed image to extract feature maps; the feature fusion layer integrates the improved C2f_RAB module, SPDConv module and CSPOMniKernel module to achieve effective fusion of deep and shallow features; among them, the C2f_RAB module integrates the dual residual attention mechanism, which significantly improves the network's perception of local and global features. The prediction layer performs multi-scale target prediction on feature maps of different sizes, thereby improving the performance of the model in distribution equipment defect detection.
[0080] Model training module 30 is used to train the improved YOLO-RAB-SOEP model using the training set data to obtain the final object detection model. The training module includes the following components: an optimization algorithm unit: This unit uses the Adam optimization algorithm to update parameters to improve model convergence speed and accuracy; a learning rate adjustment unit: This unit automatically adjusts the learning rate according to a preset strategy to ensure stable model training and rapid convergence; and a training stop determination unit: This unit determines when to stop training based on the model's loss value, ensuring the effectiveness of the training process and preventing overfitting.
[0081] The detection and evaluation module 40 is responsible for inputting test set samples into the target detection model for defect detection and evaluating the detection results. Evaluation metrics include but are not limited to accuracy, recall, and mAP (mean average precision). The module includes multiple metric calculation units for calculating and outputting the model's performance metrics in different test scenarios, thereby evaluating the model's detection effectiveness.
[0082] The present invention improves detection accuracy by introducing new network modules into the YOLOv8n model. The addition of these modules makes the original YOLOv8n more stable when detecting small targets and complex backgrounds. Specifically, the RAB-C2f module is added to the YOLOv8n network, combined with the dual residual attention mechanism, to optimize the feature extraction and fusion process, thereby improving the accuracy and speed of target detection. At the same time, the introduction of the SOEP module further enhances the positioning capability of the network, enabling the model to work stably in more complex environments. This technical solution is suitable for multiple application scenarios such as automated inspections and real-time monitoring in the power industry.
[0083] The technical innovation of this invention lies in the structural optimization of YOLOv8n, particularly the integration of new feature extraction and fusion methods. By introducing the RAB-C2f and SOEP modules, the model not only maintains efficient detection capabilities in complex backgrounds, but also effectively enhances the network's sensitivity to small objects and details through the combination of multi-layer convolution and attention mechanisms. These technical innovations make this method particularly effective in highly complex power equipment inspection tasks, accurately identifying even minor defects or faults on distribution equipment, significantly improving inspection efficiency and safety.
[0084] The advantages of this invention lie not only in improved accuracy, but also in optimized training speed and enhanced model stability. By carefully controlling the training process, such as adaptive adjustment of the learning rate and flexible design of the training strategy, the model can operate efficiently in a variety of application scenarios, maintaining high detection accuracy, especially under significant environmental changes.
[0085] In the defect detection of power distribution equipment, how to accurately and quickly identify small targets in complex environments remains a technical challenge. Traditional target detection algorithms, especially in cases where the background is complex and the equipment details are small, often cannot achieve ideal detection effects. To this end, the present invention proposes an improved YOLOv8n model, which improves the model's perception of detailed features and small targets by introducing the RAB-C2f module and the SOEP module. The improved model not only enhances the feature extraction and fusion capabilities, but also can operate stably in a variety of environments, especially in the detection tasks of power distribution equipment, and has significant advantages. The following will introduce the specific implementation steps of the technical solution in detail, and further illustrate its application effect through actual cases.
[0086] The embodiments of this specification are merely examples of implementations of the invention and are provided for illustrative purposes only. The scope of protection of the present invention should not be considered limited to the specific embodiments described in these embodiments. The scope of protection of the present invention also extends to equivalent technical means that can be conceived by a person of ordinary skill in the art based on the invention.
Claims
1. A method for detecting defects in power distribution equipment based on improved YOLOv8n, characterized in that: The method comprises the following steps: S1. Processing and dividing the distribution equipment detection data set; S2. By introducing the RAB-C2f module and SOEP module into the YOLOv8n model, an improved YOLOv8n distribution equipment defect detection model is established; S3. Use the training set to train the improved model to obtain the target detection model; S4. Input the test set samples into the target detection model to perform defect detection and evaluate the results.
2. The power distribution equipment defect detection method based on improved YOLOv8n according to claim 1, characterized in that: In S1, the processing and dividing of the power distribution equipment detection data set includes: standardizing and normalizing the power distribution equipment detection data set, and dividing the data set into a training set and a test set, wherein the division ratio of the training set to the test set is 7:
3.
3. The power distribution equipment defect detection method based on improved YOLOv8n according to claim 1 or 2, characterized in that: In said S2, improving the distribution equipment defect detection model of YOLOv8n includes improving the structures related to feature extraction, fusion and prediction; Based on YOLOv8n, the RAB-C2f module is introduced, and the dual residual attention mechanism and SOEP module are combined for feature enhancement, thereby optimizing the backbone network and neck network.
4. The power distribution equipment defect detection method based on improved YOLOv8n according to claim 3, characterized in that: The feature extraction layer is used to perform multi-layer convolution feature extraction on the preprocessed image to form a feature map; The feature fusion layer consists of the C2f-RAB module, the SPDConv module, and the CSPOMniKernel module, which is used to achieve deep and shallow information fusion; The prediction layer is used to make multi-scale predictions for feature maps of different sizes; The C2f-RAB module is an improvement based on the C2f module. It optimizes the feature extraction and fusion process by combining multi-layer feature reuse and attention mechanism.
5. The power distribution equipment defect detection method based on improved YOLOv8n according to claim 1 or 2, characterized in that: In S3, the training model adopts the Adam optimization algorithm and the learning rate decay strategy. When the model loss value no longer decreases after a specific number of epochs, the training is stopped. The initial value of the learning rate is a specific value, and the learning rate decays to a specific proportion of the original value after a specific number of epochs.
6. The method for detecting defects in power distribution equipment based on the improved YOLOv8n according to claim 5, wherein: The specific value is 0.001, the specific number is 20, the specific ratio is 0.9, and the specific number of times is 10.
7. A device for implementing the distribution equipment defect detection method based on improved YOLOv8n as claimed in claim 1, characterized in that: The device comprises: Data processing and division module, used to process and divide the distribution equipment detection data set; A model building module is used to build an improved YOLOv8n distribution equipment defect detection model by introducing C2f-RAB and SOEP modules into YOLOv8n; The model training module is used to train the improved model using the training set to obtain the target detection model; The detection and evaluation module is used to input the test set samples into the target detection model for defect detection and evaluate the results.