Improved YOLOv11 electrical equipment defect identification method suitable for small target detection

By improving the YOLOv11 algorithm, replacing the backbone network with EfficientNetV2, introducing the RFAConv module and EMA attention mechanism, using the CARAFE module for feature reconstruction, and introducing RepC3 reparameterized convolution in the detection head, the problems of information loss and misidentification in the detection of small targets in electrical equipment are solved, and efficient and accurate defect identification is achieved.

CN121582178APending Publication Date: 2026-02-27CHANGZHOU UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511705711.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing YOLO algorithms suffer from problems such as loss of small target information, easy misidentification, and insufficient detection accuracy in complex backgrounds when detecting small target defects in electrical equipment, making it difficult to meet the requirements for efficient and accurate detection.

Method used

An improved YOLOv11 electrical equipment defect identification method is adopted. This method replaces the backbone network with EfficientNetV2, introduces the RFAConv module to enhance multi-scale perception capabilities, embeds the EMA attention mechanism to improve the focus on key regions, uses the CARAFE module for feature reconstruction, and introduces the RepC3 reparameterized convolution module into the detection head. The model is optimized by combining bounding box regression loss and class loss.

Benefits of technology

It significantly improves the detection capability of small target defects, reduces the false negative rate, enhances the ability to focus on key defect areas, optimizes feature detail preservation and localization accuracy, achieves an efficient balance between accuracy and speed, and improves the multi-scale detection performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582178A_ABST
    Figure CN121582178A_ABST
Patent Text Reader

Abstract

The invention discloses an improved YOLOv11 electrical equipment defect identification method suitable for small target detection, and belongs to the technical field of computer vision. According to the method, multi-term structure optimization is carried out on a YOLOv11n model, and the method mainly comprises the following steps: replacing a backbone network with an OfficientNetV2 to improve the feature extraction efficiency; an RFAConv module is introduced into a shallow layer, and small target perception is enhanced through a multi-scale receptive field; an EMA attention mechanism is embedded into the detection head, and a key defect area is focused; a CARAFE module is adopted at the neck to carry out content self-adaptive upsampling, and detail features are reserved; and a RepC3 re-parameterization module is further introduced into the detection head to balance the precision and the speed. According to the method, the problems of small target leak detection, complex background interference and low model deployment efficiency are effectively solved, the precision and robustness in electrical equipment defect detection are remarkably improved, and the method is suitable for multiple practical application scenes such as power equipment inspection, industrial visual inspection and intelligent monitoring of power transmission lines.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision, and particularly relates to an improved YOLOv11 electrical equipment defect identification method suitable for small target detection. BACKGROUND

[0002] With the continuous expansion of the scale of the power system and the improvement of the operation complexity, the stability and safety of electrical equipment have become an important prerequisite for ensuring the efficient operation of the power grid. Electrical equipment is easily affected by environmental factors, mechanical stress, and aging during long-term operation, resulting in various types of defects such as surface cracks, corrosion, loose bolts, and insulation aging. If these defects cannot be detected in time, they can easily cause equipment failure or even safety accidents, causing significant economic losses and safety hazards. Therefore, it is of great practical significance and engineering value to develop high-precision and high-efficiency electrical equipment defect detection technology.

[0003] Traditional defect detection methods mainly rely on manual inspection or infrared imaging. The traditional manual inspection method has inherent defects such as low efficiency and high risk. The defect detection method based on traditional image processing relies on manual feature design, such as edge extraction and texture analysis, and its robustness is significantly affected by factors such as light changes and equipment surface oxidation. These methods have the disadvantages of low detection efficiency, strong subjectivity, and high omission rate, and are difficult to adapt to multi-scale defect recognition in complex backgrounds, especially in complex background and small target defect scenarios.

[0004] In recent years, with the development of deep learning technology, especially the target detection algorithm, the detection method based on convolutional neural network has been gradually applied to the defect recognition task in electrical equipment images. Among the many target detection algorithms, the YOLO series algorithm has been widely concerned due to its good balance between real-time performance and accuracy. In the research of YOLO algorithm, with the continuous iteration of technology, the YOLO series algorithm has made significant progress in speed and accuracy.

[0005] However, the current YOLO algorithm based on deep learning still faces severe challenges in small target defect detection of electrical equipment, which is specifically manifested in the following aspects: small target defects are small in size and have unclear features in images, and information is easily lost in the downsampling process; at the same time, small targets in complex backgrounds are easily misidentified. The model requires high feature extraction capability, especially in the presence of various complex textures and interference in electrical equipment, and the engineering applicability of existing detection models is severely restricted.

[0006] Therefore, it is an urgent need in the industry to seek an efficient, accurate and low-cost electrical equipment defect detection method. It is urgent to improve the existing YOLO structure to specifically enhance the model's ability to identify small targets, resist interference from complex backgrounds, and focus on key defect areas, thereby improving the model's detection accuracy and robustness in real industrial scenarios. SUMMARY

[0007] The technical problem to be solved by the present application is: In order to overcome the above technical problems, the present application provides an improved YOLOv11 electrical equipment defect recognition method suitable for small target detection. To solve the problem of small target detection difficulty, the YOLOv11 algorithm is optimized, thereby improving the model's recognition accuracy and robustness for small defect targets in electrical equipment images.

[0008] The technical scheme adopted by the present application to solve the technical problem is: An improved YOLOv11 electrical equipment defect recognition method suitable for small target detection, comprising the following steps: Step 1: Collect defect image data of electrical equipment, build a data set and perform classification labeling; use industrial cameras, drones or fixed monitoring equipment to collect images of electrical equipment, ensure that the common fault parts and the appearance of the equipment under different working conditions are covered, and obtain image data containing defect features as the basis for subsequent processing and modeling. Including surface damage, cracks, corrosion, loosening and other defect conditions. Then store the data and perform classification labeling to provide training and test data for subsequent processing.

[0009] Step 2: Divide the data set into training set, validation set and test set; preprocess the collected raw images to improve quality and feature saliency, analyze and divide the data set, and check whether the samples of each type of defect are balanced. According to the training needs, divide the data set into training set, validation set and test set, respectively for training, validation and evaluation of the model.

[0010] Step 3: Construct an improved YOLOv11n network model, which at least includes the following improvements: Step 3.1, replace the original YOLOv11n model's backbone network with EfficientNetV2 network, take advantage of its efficient feature extraction capability and smaller calculation cost to realize the unification of model lightweight and precision improvement; Step 3.2, introduce RFAConv (Receptive Field Attention Convolution) module in the shallow feature extraction path of the EfficientNetV2 backbone, enhance the perception ability of small targets through multi-scale receptive field and attention mechanism; Step 3.3, embed EMA (Efficient Multi-scale Attention) attention mechanism in the detection head structure of the model, guide the model to pay more attention to key target areas, and improve the representation of multi-scale fusion features; Step 3.4, introduce CARAFE up-sampling module in the neck feature fusion path of the model, replace the fixed interpolation up-sampling method, realize content adaptive feature reconstruction, better preserve target edge and texture details, and further introduce RepC3 re-parameterization convolution module in the multi-scale fusion module of the detection head; Step 4: use the training set and the validation set to supervise the training of the improved YOLOv11n model, combine the bounding box regression loss and the class loss to optimize the model weight, so that it has the ability to accurately identify small defects in complex background, improve the detection precision and generalization performance, and obtain the trained electrical equipment defect recognition model; use the training set and the validation set to supervise the training of the improved YOLOv11n model. During the training process, the bounding box regression loss and the class loss are considered comprehensively, and the model performance is improved through joint optimization. The bounding box regression loss is used to measure the overlap between the predicted box and the true defect area, and the improved intersection over union loss function is used to make the model more accurately locate small targets; the class loss is used to constrain the classification results of each defect class, and the cross entropy function is used to calculate the difference between the predicted and true classes; the bounding box regression loss and the class loss are weighted and summed in proportion to the weight to form the total loss, and the model is optimized in the reverse propagation process. The positioning and classification ability; so as to obtain a small target defect recognition model with high precision in complex background; Step 5: use the trained model to detect and identify defects in the electrical equipment test set images.

[0011] The EfficientNetV2 backbone network adopts a structure containing a Fused-MBConv module, and in the overall expansion strategy of the model, a composite scaling method is adopted by simultaneously adjusting the network depth, width and input image resolution, and in the training process, a progressive learning strategy is adopted to gradually increase the difficulty and resolution of the input image during the model training process. The overall expansion strategy of the EfficientNetV2 backbone network adopts a composite adjustment method, that is, by comprehensively considering the proportional relationship of network depth, width and input resolution, the optimal balance between calculation amount and performance is obtained. Depth determines the number of model layers and feature extraction capability, width affects the number of channels and detail expression capability, and input resolution affects feature perception accuracy. The progressive learning strategy means that the difficulty and resolution of the input image are gradually increased from simple to complex during the model training process. In the early stage, lower resolution images are used for rapid convergence, and then the resolution and data enhancement intensity are gradually increased, so that the model has stronger feature adaptability and generalization ability in the later training stage. This strategy effectively reduces the convergence instability problem in the early training stage, and improves the detail recognition effect in small target detection.

[0012] The RFAConv module enhances feature perception in the following way: Spatial responses are extracted under different receptive field scales, and attention weights are introduced to weight and fuse the feature outputs of multi-scale receptive field branches, so as to improve the expression ability of the network to multi-scale small targets.

[0013] This mechanism of the RFAConv module can effectively enhance the response ability of the network to multi-scale regions, so that the model can automatically adjust its focus according to the actual scale of the target, especially for small target recognition and complex background, which has obvious detection improvement effect.

[0014] The introduction of the RFAConv module makes the feature map obtain richer context modeling ability in the spatial domain and the channel domain. In the target detection task, it can effectively solve the problem that different scale targets cannot be considered at the same time in the same layer, and enhance the comprehensive understanding of multi-scale features by the model. Especially when it is applied to the shallow layer or neck structure of the YOLO series network, RFAConv can significantly improve the recall rate of small targets and improve the overall detection accuracy.

[0015] The EMA attention mechanism is realized in the following way: For the input feature map, first, the average pooling in the spatial dimension is performed on each channel to calculate the overall response degree of the channel; Then, the responses of all channels are normalized by linear transformation to generate channel attention weights; Finally, the channel attention weight is multiplied with the original input feature channel by channel to obtain the weighted output. This mechanism can strengthen the key channel and suppress the redundant channel, and is particularly effective in multi-scale feature fusion. Compared with complex spatial attention mechanisms, EMA can achieve precise attention to target regions in images with fewer parameters and computational complexity, and is particularly suitable for high-precision scenarios such as small target detection and electrical equipment defect identification.

[0016] In step 3.4, a RepC3 reparameterization convolution module is further introduced in the multi-scale fusion module of the detection head.

[0017] The RepC3 reparameterization convolution module achieves optimization in the following way: In the training phase, the RepC3 reparameterization convolution module includes multiple parallel paths, at least including a standard convolution path, a lightweight convolution path and an identity mapping path, each parallel path including a convolution layer and a batch normalization operation; in training, they learn different scale and direction feature information respectively, and improve the network's perception ability of image spatial structure.

[0018] In the inference phase, the multiple parallel paths are fused into a single convolution layer through a structure reparameterization operation.

[0019] In the inference phase of the RepC3 reparameterization convolution module, the fused convolution kernel weight is obtained by combining the convolution kernel weight of each parallel path with the scaling factor and variance parameter of its corresponding batch normalization layer; the fused bias is obtained by combining the bias of each path with the offset parameter and mean parameter of its corresponding batch normalization layer, and the multi-path fusion operation enables the model to maintain single-path efficient calculation in the inference phase while having the powerful feature expression ability of the multi-path structure in the training phase.

[0020] The CARAFE up-sampling module includes an up-sampling kernel prediction module and a feature reorganization module, which reorganizes features in the following way: The up-sampling kernel prediction module adaptively generates a set of convolution kernels for up-sampling according to the input feature map content; The feature reorganization module uses the convolution kernel generated by the up-sampling kernel prediction module to perform weighted calculation in the corresponding neighborhood of the input feature map to reconstruct the output feature map.

[0021] The trained model is used to infer the test set images of the electrical equipment, the model outputs the prediction box coordinates and the corresponding defect category label, and the abnormal or defect area on the surface of the equipment is located; if the model detection result meets the expected accuracy requirement, it is deployed in the actual application scene to realize the intelligent identification of the electrical equipment defects; if the detection performance does not meet the target standard, the data set is optimized or the model structure parameters are adjusted for improvement, and the model is continuously updated through training and evaluation results to continuously improve the detection accuracy and robustness, and to ensure that the final system has stable and reliable application ability.

[0022] In step 2, the division ratio of the data set is training set: verification set: test set = 7:2:1.

[0023] The improved YOLOv11 electrical equipment defect identification method suitable for small target detection has the following remarkable beneficial effects: 1. The detection ability of small target defects is significantly improved: by replacing the backbone network with EfficientNetV2, the feature extraction ability and progressive learning strategy are used to significantly enhance the feature representation ability of small defects such as insulator cracks and equipment surface rust. At the same time, the RFAConv module is introduced in the shallow feature extraction path, which effectively enhances the perception ability of the model to small scale targets through multi-scale receptive field and attention weighted fusion mechanism, and significantly reduces the missed detection rate of small target defects.

[0024] 2. The focusing ability on key defect areas is enhanced: the EMA attention mechanism is embedded in the detection head structure, which can fuse multi-scale features and guide the model to pay more attention to the key target area in the image through channel weighting, thereby improving the representation of multi-scale fusion features. This enables the model to accurately focus on the real defect area under complex background interference and effectively suppress false detection.

[0025] 3. The feature detail retention and positioning accuracy are optimized: the CARAFE module is introduced in the neck feature fusion path to replace the traditional fixed interpolation upsampling method. CARAFE can adaptively predict the upsampling kernel according to the feature map content, realize content adaptive feature reconstruction, and better retain the edge contour and subtle texture details of the defect target, thereby improving the positioning accuracy of the defect.

[0026] 4. Achieving efficient balance of precision and speed: the EfficientNetV2 backbone network adopted by the present application has excellent speed and precision balance characteristics. Further, the RepC3 reparameterization convolution module is introduced in the detection head. In the training stage, the multi-branch structure is used to enhance the feature expression ability, and in the inference stage, it is converted into a single-branch structure to improve the speed. This collaborative design makes the present application have faster inference speed while maintaining high detection accuracy.

[0027] 5. Improving the multi-scale detection performance of the model: through the cooperative action of the composite scaling mechanism of EfficientNetV2, the multi-scale receptive field of RFAConv and the multi-scale feature fusion of EMA attention, the model can effectively cope with the challenge of large scale change of electrical equipment defects, and maintains high detection sensitivity for defects of different sizes. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 is a basic flow diagram of an improved YOLOv11 electrical equipment defect recognition method suitable for small target detection provided by an embodiment of the present application.

[0029] Figure 2 is a whole structure diagram of the existing YOLOv11n model.

[0030] Figure 3 is a whole structure diagram of the improved YOLOv11n network model of the present application.

[0031] Figure 4 is a structure comparison diagram of Fused-MBConv and MBConv modules in the EfficientNetV2 network.

[0032] Figure 5 is a structure diagram of the RFAConv module.

[0033] Figure 6 is a structure diagram of the EMA attention mechanism. DETAILED DESCRIPTION

[0034] The present application will now be further described in detail with reference to the accompanying drawings. It should be emphasized that the following description is merely exemplary and is not intended to limit the scope of the present application and its applications.

[0035] The embodiment of the application provides an improved YOLOv11 electrical equipment defect identification method suitable for small target detection. The specific implementation of the embodiment is based on the code debugging and test experiment environment of Python 3.8. The server operating system used is Windows 11; the CPU is Intel i9-14900HX; the RAM is 16GB; the computing resource is 1 NVIDIA RTX4060 GPU, the GPU driver version is 522.06; the deep learning framework is PyTorch 1.13.1, and the CUDA version is 11.8. The pre-training model is yolov8s.pt provided by the official.

[0036] As shown in Figure 1 , the specific implementation steps are as follows: Step 1: Constructing an electrical equipment defect dataset First, collect defect image data of electrical equipment, and the data sources include industrial cameras, unmanned aerial vehicles or fixed monitoring equipment, to ensure that the appearance of the equipment under different working conditions covers common fault parts. The collected defect types include surface damage, cracks, corrosion, looseness, etc. The collected raw images are preprocessed, including noise removal, brightness and contrast enhancement, image size unification and data enhancement, to improve the quality and feature saliency. Then, use a labeling tool to classify and label the defect targets in the images, and store them as YOLO format label files, to provide a data basis for subsequent model training and testing.

[0037] Step 2: Dataset analysis and division Analyze the constructed dataset to check whether the sample numbers of various defects are balanced to avoid class bias in the model training process. According to the training needs, randomly divide the entire dataset into a training set, a validation set and a test set in a ratio of 7:2:1, respectively, for training, validation and evaluation of the model.

[0038] Step 3: Constructing an improved YOLOv11n network model The existing YOLOv11n model mainly consists of a backbone network, a neck network and a detection head, as shown in Figure 2 . On the basis of the existing YOLOv11n network, the following core improvements are made, and the improved network architecture is shown in Figure 3 . 1. Replacement of the backbone network and lightweight design: The backbone network of the original YOLOv11n is replaced by EfficientNetV2. EfficientNetV2 realizes faster training speed and higher feature extraction efficiency while ensuring accuracy through its core Fused-MBConv module and improved compound model scaling strategy, especially suitable for small target defect fine-grained perception. The structures of Fused-MBConv and MBConv are as shown in Figure 4 The traditional MBConv module structure is an extended convolution, a depth separable convolution, a compressed convolution and an SE module. The Fused-MBConv structure omits the depth separable convolution and the phased expansion, and replaces it with a single convolution operation to speed up the training process and improve the low-level feature expression ability.

[0039] In the overall expansion strategy of the model, EfficientNetV2 adopts a compound scaling method by adjusting the network depth, width and input image resolution at the same time to obtain the best performance.

[0040] EfficientNetV2 also introduces a progressive learning strategy in the training method, which gradually increases the difficulty and resolution of the input image during model training. Unlike the traditional method of using high-resolution images and complex enhancement from the beginning, EfficientNetV2 starts with low-resolution images and light data enhancement, and gradually increases the resolution and enhancement intensity of the input image as the training round increases.

[0041] At the same time, the RFAConv module is introduced in the shallow feature extraction path in the backbone network, specifically located after the second stage of EfficientNetV2 and before feature fusion, to enhance the multi-scale receptive field of early feature maps. The module extracts spatial responses at different receptive field scales and introduces attention weights for weighted fusion, thereby improving the network's ability to express complex structures and multi-scale targets. The calculation formula is as follows: .

[0042] is the input feature map, represents using a 1x1 convolution operation to compress channel information, represents performing global average pooling on the input feature map to extract global context information, represents using a kxk convolution kernel to extract local features, represents batch normalization operation on the feature map, represents the activation function, denotes a batch normalization operation for calculating spatial attention weights, r denotes a receptive field, and f denotes a feature, denotes a receptive field attention weight, denotes a feature output of each scale receptive field branch, and F denotes a final output feature after fusion. The RFAConv module is constructed by combining multiple scale convolution kernels, including 3x3, 5x5, and 7x7, which are used to capture small target features of different scales. In the feature fusion stage, alignment is achieved by interpolation and channel concatenation, and the weighted fusion is performed after the spatial dimensions of the features of different scales are consistent.

[0043] 2. Embedding an efficient attention mechanism: The EMA attention mechanism is embedded before the last convolution layer in the detection head structure of the model. Unlike traditional attention modules that only perform weighting in the channel or spatial dimension, the EMA attention mechanism constructs multiple scale paths and uses local interaction to enhance semantic information while maintaining the fine-grained structure of feature expression. The structure is shown in Figure 6 .

[0044] For a given input feature map, the EMA first performs average pooling in the spatial dimension for each channel C to calculate the response degree of the entire channel. The expression formula is: .

[0045] denotes the pixel value of the i-th row and j-th column in channel C, H denotes the height of the feature map, and W denotes the width of the feature map, denotes the average value of all pixels in channel C.

[0046] Next, a linear transformation is used to normalize the responses of all channels to generate channel attention weights, which are then multiplied with the original input features channel by channel to obtain the weighted output. This mechanism can strengthen key channels and suppress redundant channels, and is particularly effective in multi-scale feature fusion. Compared with complex spatial attention mechanisms, EMA can achieve precise attention to target regions in images with fewer parameters and computational complexity, making it particularly suitable for high-precision scenarios such as small target detection and electrical equipment defect recognition. The linear transformation can be implemented through a fully connected layer or a 1x1 convolution, which has small computational complexity and is efficient in strengthening key feature channels and suppressing irrelevant or redundant information.

[0047] 3. Optimizing feature fusion and detection head: In the neck feature fusion path, the CARAFE module is used to replace the traditional fixed interpolation up-sampling method. The CARAFE module replaces the key up-sampling node in the neck FPN structure, and other up-sampling nodes remain unchanged. The CARAFE module mainly consists of two parts: an up-sampling kernel prediction module and a feature reorganization module. First, the input low-resolution feature map is sent to the up-sampling kernel prediction module, which extracts the context information of each position through a lightweight convolution operation, and adaptively generates a set of convolution kernels for up-sampling according to the content. These kernels are dynamically generated, and are no longer fixed weights in traditional interpolation methods, so they can better adapt to the structure and details of different regions in the image. Then, the feature reorganization module uses these content-aware convolution kernels to extract features within the neighborhood of the corresponding position in the original feature map, and reconstructs a high-resolution output feature map through a weighted manner. Each up-sampled position is calculated by the features of its surrounding area according to the predicted weights, which makes the reconstruction result more accurate, especially in edge, detail or small target area.

[0048] Further, the RepC3 reparameterization convolution module is introduced in the multi-scale fusion module of the detection head. The RepC3 reparameterization convolution module is a convolution module optimized based on the CSP structure, which combines the structure reparameterization idea. Through introducing a multi-branch structure to enhance the feature expression ability of the network during the training stage, and equivalently converting the multi-branch structure into a single-branch convolution operation during the inference stage, the training accuracy and inference speed are considered, and it is suitable for target detection scenarios with high requirements for efficiency and performance.

[0049] In the training stage, the convolution block in the RepC3 reparameterization convolution module is composed of multiple parallel paths, including standard convolution, lightweight convolution and identity mapping structures. These parallel paths each contain convolution layers and batch normalization operations. The calculation proportion of each parallel path in the training stage is set according to experimental experience: the standard convolution path accounts for about 50%, the lightweight convolution path accounts for about 30%, and the identity mapping path accounts for about 20%. The lightweight convolution path can be a depth separable convolution. In training, they respectively learn feature information of different scales and directions, and improve the network's perception of image spatial structure. The convolution operation of each parallel path can be represented in the form of normalized weights and biases after batch normalization, and the transformation formula is as follows: , .

[0050] represents the reparameterized convolution kernel, represents the weight of the original convolution kernel, represents the scaling factor in BatchNorm (batch normalization), denotes the variance of input features on a certain channel, denotes a small constant for preventing division by zero.

[0051] denotes the bias after reparameterization, denotes the bias term in the original convolutional layer, denotes the shift parameter of BatchNorm, denotes the mean of input features on a certain channel.

[0052] After training, RepC3 unifies all the convolutional kernels of different branches into an equivalent convolutional kernel and bias through a structural reparameterization operation. Multiple convolutional kernels of different sizes are aligned in the spatial dimension by padding, then added element-wise, and finally converted into a single standard convolutional layer. This fusion process does not change the calculation output of the model, but simplifies the originally complex multi-branch structure into a single-branch module that can be executed quickly. The output form during inference is also simplified as: .

[0053] denotes the output feature map, denotes the input feature map, denotes the fused convolutional kernel, denotes the fused bias term.

[0054] Such a design allows the model to maintain high expressiveness during training and good speed and hardware adaptability during deployment.

[0055] Step 4: Model Training The improved model constructed in step three is supervised trained using the divided training set and validation set. The model training uses the AdamW optimizer. The key parameter settings for training are shown in the following table: Table 1 Model Training Parameters

[0056] During training, the aforementioned pre-trained weights are used as the starting point, and the model weights are optimized jointly based on the bounding box regression loss and the class classification loss.

[0057] Among them, the bounding box regression loss uses an improved CIoU (Complete IoU) loss function, whose calculation formula is: . denotes the intersection over union of the predicted box and the true box, denotes the Euclidean distance between the center point of the predicted box and the center point of the true box, denotes the predicted bounding box, denotes the true bounding box, denotes the balance coefficient, represents the difference in the width-height ratio between the predicted box and the ground truth box.

[0058] The class loss adopts a cross-entropy loss function: where represents the total number of defect classes, and i represents the class index represents the true class label, represents the probability distribution predicted by the model.

[0059] The final total loss function is defined as: . and represents the weight coefficient of the positioning loss and the classification loss, and in the present application, .

[0060] The present embodiment adopts mAP50, i.e., the average precision mean when the intersection over union IoU threshold is 0.5, as the core evaluation index to monitor the performance of the model on the validation set in real time. For n samples of a certain classification, assuming that there are a positive examples, each positive example corresponds to a recall rate R value (1 / m, 2 / m,..., 1), the maximum accuracy P is calculated for each recall rate, and then the average of the a P values is calculated. The larger the mAP value, the smaller the deviation between the recognition result and the true value. If the mAP value changes significantly or decreases after multiple rounds of training, the parameters need to be fine-tuned, and the model effect can be improved through multiple repeated parameter tuning.

[0061] Step 5: Model testing and reasoning The trained model is used to infer the test set images of electrical equipment, and the model outputs the predicted box coordinates and the corresponding defect class label to locate the abnormal or defect area on the surface of the equipment.

[0062] Step 6: Model deployment and iteration If the detection results (such as mAP50, recall rate, etc.) of the model on the test set reach the expected precision requirement, the trained model can be deployed in the actual application scenario to realize intelligent identification of electrical equipment defects. If the detection performance does not meet the target standard, the model can be improved by optimizing the data set or adjusting the model structure parameters, and the model is continuously updated based on the training and evaluation results to continuously improve its detection accuracy and robustness, ensuring that the final system has stable and reliable application capabilities.

[0063] The comparative experiment used the same code debugging and testing environment as this invention. The platform was Windows 11 operating system, with an Intel i9-14900HX CPU, 16GB of RAM, and one NVIDIA RTX 4060 GPU (driver version 522.06). The deep learning framework was PyTorch 1.13.1, CUDA version 11.8, the pre-trained model was yolov8s.pt, and the development language was Python 3.8. The table below shows the results of the comparative experiment:

[0064] Furthermore, in the comparison of inference performance, the model of this invention achieved an average inference speed of 98 FPS at 1280×1280 resolution, which is only about 6% lower than the original YOLOv11n (104 FPS), maintaining high real-time performance while improving accuracy. The comparative experimental results show that the final model of this invention improves mAP by about 5.4% and recall by about 4% compared to the original YOLOv11n, achieving a good balance between accuracy and speed, verifying the effectiveness of the structural improvements. Crucially, in addressing the issue of missed detections of small targets, the final model improves recall by 4%, significantly higher than using only EfficientNetV2 or only CARAFE. This demonstrates the synergistic effect of the RFAConv module and the EMA attention mechanism, which together significantly reduce the missed detection rate of small defects. Regarding the optimization of the balance between accuracy and speed, this invention achieves an mAP improvement of over 5% while maintaining an average inference speed of 98 FPS. This excellent balance cannot be explained by a simple sum of the effects of each module; it stems from the deep adaptation between the lightweight foundation of EfficientNetV2, the inference acceleration of RepC3, and the detail preservation capabilities of CARAFE. The performance of this invention not only surpasses models improved by individual modules but also exceeds strong sub-combinations such as Comparison Group A, Comparison Group B, and Comparison Group C. This demonstrates that only by integrating all four improved modules as described in this invention can they achieve complementarity in feature extraction, receptive field enhancement, attention focusing, and detail reconstruction, ultimately maximizing the performance improvement in small target defect detection.

[0065] This invention addresses the challenges of detecting defects in electrical equipment and transmission lines, such as densely packed small targets with unique shapes and complex backgrounds. It optimizes the YOLOv11 model through several structural improvements to enhance its performance in identifying minute defects in electrical equipment images. First, the original YOLOv11 backbone is replaced with EfficientNetV2, leveraging its efficient feature extraction capabilities and lower computational cost to achieve a balance between model lightweighting and improved accuracy. Second, an RFAConv module is introduced into the shallow feature extraction path to enhance the perception of small targets through multi-scale receptive fields and attention mechanisms. Third, an EMA attention mechanism is embedded in the head structure to guide the model to focus more effectively on key target regions, improving the representational power of multi-scale fusion features. Finally, a CARAFE module is introduced into the neck feature fusion path to replace the traditional fixed interpolation upsampling method, achieving content-adaptive feature reconstruction to better preserve target edges and texture details. Furthermore, a RepC3 reparameterized convolution module is introduced into the multi-scale fusion module of the detection head. The aforementioned structural improvements enhance the accuracy of small target detection while maintaining high detection speed and good engineering deployment capabilities, making them suitable for various practical application scenarios such as power equipment inspection, industrial visual inspection, and intelligent monitoring of transmission lines.

[0066] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. An improved YOLOv11 electrical equipment defect recognition method suitable for small target detection, characterized in that, The method comprises the following steps: Step 1: collecting defect image data of electrical equipment, constructing a data set and performing classification annotation; Step 2: dividing the data set into a training set, a validation set and a test set; Step 3: constructing an improved YOLOv11n network model, which at least comprises the following improvements: Step 3.1, replacing the backbone network of the original YOLOv11n model with an EfficientNetV2 network; Step 3.2, introducing an RFAConv module in the shallow feature extraction path of the EfficientNetV2 backbone; Step 3.3, embedding an EMA attention mechanism in the detection head structure of the model; Step 3.4, introducing a CARAFE upsampling module in the neck feature fusion path of the model to replace the fixed interpolation upsampling method and realize content adaptive feature reconstruction; Step 4: using the training set and the validation set to supervise the training of the improved YOLOv11n model, combining the bounding box regression loss and the class loss to optimize the model weight, and obtaining a trained electrical equipment defect recognition model; the bounding box regression loss is used to measure the coincidence degree of the predicted box and the true defect region, and an improved intersection over union loss function is adopted; the class loss is used to constrain the classification result of the defect class, and a cross-entropy function is used to calculate the difference between the predicted and true classes; the bounding box regression loss and the class loss are weighted and summed in proportion to the weight to form the total loss, and the model is optimized in the reverse propagation process to simultaneously optimize the positioning and classification ability; Step 5: using the trained model to detect and identify defects in the electrical equipment test set image.

2. The improved YOLOv11 electrical equipment defect identification method suitable for small target detection of claim 1, wherein: The EfficientNetV2 backbone network adopts a structure containing a Fused-MBConv module, and in the overall expansion strategy of the model, a composite scaling method is adopted by simultaneously adjusting the network depth, width and input image resolution, and in the training process, a gradual learning strategy is adopted to gradually increase the difficulty and resolution of the input image from simple to complex in the model training process.

3. The improved YOLOv11 electrical equipment defect identification method suitable for small target detection of claim 1, wherein: The RFAConv module enhances feature perception in the following way: Extract spatial responses at different receptive field scales and introduce attention weights to weight and fuse the feature outputs of multi-scale receptive field branches to improve the network's expression ability for multi-scale small targets.

4. The improved YOLOv11 electrical equipment defect identification method suitable for small target detection of claim 1, wherein: The EMA attention mechanism is realized in the following way: For the input feature map, first perform average pooling on each channel in the spatial dimension to calculate the overall response degree of the channel; Then normalize the responses of all channels through linear transformation to generate channel attention weights; Finally, multiply the channel attention weights with the original input features channel by channel to obtain the weighted output.

5. The improved YOLOv11 electrical equipment defect identification method suitable for small target detection of claim 1, wherein: In step 3.4, a RepC3 reparameterization convolution module is further introduced in the multi-scale fusion module of the detection head.

6. The improved YOLOv11 electrical equipment defect identification method suitable for small target detection of claim 5, wherein: The RepC3 reparameterization convolution module optimizes in the following way: In the training stage, the RepC3 reparameterized convolution module comprises multiple parallel paths, at least including a standard convolution path, a lightweight convolution path and an identity mapping path, each parallel path comprising a convolution layer and a batch normalization operation; In the inference stage, the multiple parallel paths are fused into a single convolution layer through a structure reparameterization operation.

7. The improved YOLOv11 electrical equipment defect identification method suitable for small target detection of claim 6, wherein: In the inference stage of the RepC3 reparameterized convolution module, the fused convolution kernel weight is obtained by combining the convolution kernel weight of each parallel path with the scaling factor and variance parameter of its corresponding batch normalization layer; The fused bias is obtained by combining the bias of each path with the offset parameter and mean parameter of its corresponding batch normalization layer.

8. The improved YOLOv11 electrical equipment defect identification method suitable for small target detection of claim 1, wherein: The CARAFE up-sampling module comprises an up-sampling kernel prediction module and a feature recombination module, and the feature recombination is performed in the following manner: The up-sampling kernel prediction module adaptively generates a set of convolution kernels for up-sampling according to the input feature map content; The feature recombination module uses the convolution kernel generated by the up-sampling kernel prediction module to perform weighted calculation in the corresponding neighborhood of the input feature map to reconstruct the output feature map.

9. The improved YOLOv11 electrical equipment defect identification method suitable for small target detection of claim 1, wherein: The trained model is used to infer the test set images of electrical equipment, and the model outputs the prediction box coordinates and the corresponding defect category label to locate the abnormal or defect area on the surface of the equipment; if the model detection result meets the expected accuracy requirement, it is deployed in the actual application scene to realize intelligent identification of electrical equipment defects; If the detection performance does not meet the target standard, the model is continuously updated through optimization of the data set or adjustment of the model structure parameters, combined with the training and evaluation results.

10. The improved YOLOv11 electrical equipment defect identification method suitable for small target detection of claim 1, wherein: In step 2, the division ratio of the data set is training set: validation set: test set = 7:2:1.

Citation Information

Cited By

  • Trademark defect detection method based on improved YOLOv11 and generative network

    CN122023414A