Improved insulator defect detection method based on YOLOv4-Tiny
By introducing channel attention network and bidirectional feature pyramid structure in YOLOv4-Tiny, combined with Focal loss function, the problems of missing detection, false detection and low accuracy in insulator image detection are solved, and higher detection accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202210710075.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2042-06-22
AI Technical Summary
The existing insulator image detection technology has problems such as missing detection, miss detection and low accuracy in defects, especially in complex backgrounds, which are difficult to effectively extract features.
Using an improved method based on YOLOv4-Tiny, the feature extraction capability is enhanced by introducing channel attention network and bidirectional feature pyramid structure, and Focal loss is used in the design of loss function to solve the problem of positive and negative sample imbalance.
It significantly improves the accuracy and robustness of insulator defect detection, reduces missed and missed detection, and improves detection accuracy.
Smart Images

Figure CN114972312B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision recognition, and in particular relates to an insulator defect detection method based on an improvement of YOLOv4-Tiny. Background Art
[0002] As an important component of all components of power transmission lines, insulators play the role of mechanical support and electrical insulation. Because they are exposed to outdoor operations for a long time, they are easily damaged by the surrounding harsh environment, human factors, mechanical losses, etc., and are one of the most common defective components in the power system. [1] If it is not discovered and repaired in time, it may cause immeasurable economic losses and casualties [2] Therefore, how to detect insulator defects accurately and quickly has always been a hot topic in academic research at home and abroad. Conventional inspections generally use the naked eye to judge whether the insulator is abnormal. Although the accuracy rate is good, there are problems such as low efficiency, lack of safety guarantee, and long inspection cycle. With the advancement of science and technology, the emergence of drone inspections, robot intelligent inspections, video monitoring systems and other technologies have made it possible to detect insulator defects through image processing. [3-5] .
[0003] The positioning of the insulator body and the identification of the defective part constitute the image-based insulator defect detection algorithm. After years of development, the positioning of insulators has made great progress and has a good positioning effect. For example, reference [6] proposed an algorithm for insulator recognition and positioning by combining the support vector machine classifier with the gradient oriented histogram (HOG) based on the characteristics of the insulator image. Reference [7] used the maximum inter-class variance method to segment the H and S components in the insulator HSV image to obtain the insulator foreground connected domain, and then statistically identified the insulator contour by the inclination angle and area distribution of the foreground contour. Finally, a feature detection algorithm was designed to detect and mark the defective parts of the insulator. Although the above-mentioned references can locate the insulator more accurately, the features in the feature analysis need to be manually designed, and there are problems such as poor anti-interference under complex backgrounds, and the identification of defective parts is heavily dependent on the semantic map or contour extraction effect after segmentation, which cannot cope with the complex situation of the insulator.
[0004] In recent years, the application of deep learning in various fields has made great progress, providing new ideas and algorithms for the detection of insulator defects, such as the classic R-CNN series [8-11] , YOLO series [12-14] , SSD series [15,16]Reference
[17] proposed a detection strategy of “segmentation-recognition-synthesis” to accurately segment the insulator and the defective part and obtain the defective area. The mask image of the insulator area is obtained through the optimized U-net model, and the defective part of the insulator is located based on the YOLOv4 model to achieve the detection of the target area. Reference
[18] proposed to use GhostNet to replace the CBL structure in the YOLOv5 network, and replaced the loss function with GIOU. The parameter size of the improved YOLOv5 model was significantly reduced, and the experimental results showed that the detection effect of the improved model was higher than that of the original YOLOv5. Reference
[19] added the SE attention network to the YOLOv5s model network to enhance the model's judgment ability and robustness on the insulator area. For the problem of insufficient training data, the mosaic data enhancement strategy was used to obtain enough data. Experimental results show that the improved YOLOv5s has higher detection indicators than mainstream detection algorithms. Some of the above deep learning algorithms can already accurately identify defective areas, and features do not need to be manually designed, but most of them only use the shallow features of the first few layers in the feature extraction network, and do not fully utilize the deep features, and lack the mutual fusion of shallow and deep features. When the defective area of the insulator image is small or the background is very complex, the effect will be unsatisfactory, especially when there are fewer pixels in the defective area, which is more difficult to extract features under the interference of complex background. Summary of the invention
[0005] The purpose of the present invention is to solve the problems of partial missed detection, false detection and low precision of defects in existing insulator image detection, and to provide an insulator defect detection method based on YOLOv4-Tiny improvement.
[0006] To achieve the above purpose, the technical solution of the present invention is: an improved insulator defect detection method based on YOLOv4-Tiny, which applies the channel attention network to the feature extraction network of YOLOv4-tiny, significantly enhancing the feature extraction ability of the backbone network. In the feature fusion stage, the original FPN is improved into a two-way feature pyramid structure with two feature fusion paths, so that features of different scales can be more fully integrated. Finally, in the design of the loss function, the Focal loss is used instead of the binary cross entropy loss function to solve the problem of imbalance in the number of positive and negative samples in the detection process.
[0007] Compared with the prior art, the present invention has the following beneficial effects:
[0008] This paper introduces deep learning technology into the field of insulator detection and proposes an insulator defect detection method based on improved YOLOv4-tiny (combining bidirectional feature pyramid with ECA attention mechanism). The main contributions and innovations of this paper are as follows:
[0009] 1) In order to solve the problem of insufficient fusion of deep features and shallow features, a bottom-up downsampling path is added to the feature pyramid of YOLOv4-tiny, so that the deep and shallow feature information can be further integrated, thereby improving the recognition ability of the insulator defect network.
[0010] 2) In order to solve the problem that complex background is not conducive to network feature extraction, the present invention introduces the ECA attention mechanism to solve it. Before feature fusion, the features are first passed through the attention network to enhance the feature extraction ability of the backbone network.
[0011] 3) To address the problem of imbalance in the number of positive and negative samples in target detection tasks, the present invention replaces the binary cross entropy loss function used in prediction category loss and prediction confidence loss with the Focal loss function, which significantly improves the detection accuracy of the model. The transfer learning method is introduced into the entire network training to achieve the purpose of improving defect detection, and finally an improved YOLOv4-tiny insulator recognition network is constructed. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 The figure is a flow chart of the method of the present invention.
[0013] Figure 2 It is a structural diagram of the detection method of the present invention.
[0014] Figure 3 This is the YOLOv4-Tiny structure diagram.
[0015] Figure 4 This is the ECA-Net structure diagram.
[0016] Figure 5 It is a characteristic pyramid structure.
[0017] Figure 6 It is a bidirectional FPN structure.
[0018] Figure 7 is the cosine annealing learning rate decay graph.
[0019] Figure 8 Provide image display of insulators and defects; Figure 8 (a) Normal insulator image, Figure 8 (b) Image of defective insulator.
[0020] Fig. 9 To display the test results; Fig. 9 (a) Unimproved YOLOv4-tiny detection results display, Fig. 9 (b) Display of the improved YOLOv4-tiny detection results of the present invention. DETAILED DESCRIPTION
[0021] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings.
[0022] like Figure 1 As shown in the figure, the present invention is an insulator defect detection method based on improved YOLOv4-tiny. First, the improved CSPDarknet53-Tiny backbone network is used to extract features of the input insulator image. The extracted feature vectors are composed into a feature matrix and then input into a bidirectional feature pyramid module after an efficient channel attention mechanism (Efficient Channel Attention for Deep Convolution Neural Networks) to achieve multi-scale fusion between (26,26,256) and (13,13,512) features. The large-scale features contain more position feature information and detail feature information. The information of the small-scale features is enhanced by fusion with the small-scale features. Targeted optimization is adopted for the insulator defect detection of small targets to achieve accurate recognition. The framework is as follows Figure 2 As shown.
[0023] 1. YOLOv4-tiny model
[0024] The YOLO (You Only Look Once) series of target detection models are widely used in industry due to their good performance and speed. The YOLOv4-Tiny model is a simplified version of YOLOv4
[20] . It is an object detection algorithm proposed by Alexey Bochkoviskiy et al. in 2020. Although the detection accuracy is not as good as YOLOv4, the detection speed has been significantly improved. The structure of YOLOv4-Tiny consists of a backbone network, feature fusion, and detection head, such as Figure 2 shown.
[0025] 1.1 Backbone Network
[0026] The role of the backbone network is to learn the distribution of target features. YOLOv4-Tiny uses the CSPDarkNet53-Tiny network as the backbone network, with the following structure: Figure 3 As shown in the figure, CSPDarknet53-Tiny consists of three DarknetConv2D_BN_Leaky modules and three Resblock_body modules. Figure 3It can be seen that for each time the input image with dimension (416,416,3) passes through the DarknetConv2D_BN_Leaky module, the number of feature channels doubles and the size is reduced by half. After the feature map is convolved through multiple layers of modules, the dimensions are (26,26,256) and (13,13,512) respectively. The feature map with a larger scale has a stronger ability to express details and is suitable for the detection of small targets, while the feature map with a smaller scale has a lower resolution but a larger receptive field and is suitable for the detection of large targets.
[0027] 1.2. Introducing ECA-Net
[0028] In the insulator inspection task, the background occupies the vast majority of the insulator image, while the insulator and its defective parts occupy very little of the entire image, which greatly hinders the effective feature extraction rate of the model, causing it to be often missed during inspection. However, missed detection is fatal to the insulator defect detection task, so how to better utilize the features of the insulator and its defects is extremely important, which will directly affect the final detection effect.
[0029] Many existing studies have shown that adding attention to deep learning networks can effectively improve model performance. For example, attention networks such as BAM
[21] , SENet
[22] , CBAM
[23] , GCNet
[24] , and FcaNet
[25] have all performed well in terms of performance improvement. However, most existing methods greatly increase the complexity of the model while achieving model performance improvements. Wang et al. proposed ECA-Net (ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks)
[26] in 2020. ECA-Net is a channel attention module that can achieve significant performance improvements with only a small number of parameters. Its structure is as follows: Figure 4 As shown. Figure 4 It can be seen that after performing global average pooling per channel without reducing the dimensionality, ECA captures local cross-channel interaction information by considering each channel and its k neighbors. ECA consists of a one-dimensional convolution with a kernel size of K, where K represents the coverage of local cross-channel interactions. In layman's terms, it is how many neighboring features near the channel C are involved in predicting the attention of this channel. An adaptive method is also proposed in ECA to determine the K used for each input, and its size is proportional to the number of channels. The calculation formula for the kernel size K is as follows:
[0030]
[0031] Among them, γ=2, b=1, Ch is the number of input channels, |*| odd Represents the nearest odd number.
[0032] 1.3 Feature Fusion Layer
[0033] Unlike YOLOv4, YOLOv4-Tiny abandons the additional SPP Net and PANet in pursuit of detection speed and model lightweight, and instead chooses FPN to replace the feature fusion step. Figure 5 As we know, the FPN module consists of a single convolution plus sampling. After (13,13,512) passes through a 1×1 convolution layer, the number of channels is reduced from 512 dimensions to 256 dimensions, thus obtaining the first output P1. Then P1 passes through a 1×1 convolution layer to reduce the number of channels to 128 dimensions, and then through nearest neighbor upsampling (scale_factor=2) the size of the feature map is doubled to (26,26,128), and finally the number of channels is merged with the high-level features to output P2.
[0034] 1.4 Improvement of feature fusion layer
[0035] Depend on Figure 5 It can be seen that YOLOv4-tiny uses a very simple feature fusion method that only includes one upsampling, which significantly improves its detection speed (about 6 to 8 times that of YOLOv4), but at the same time brings about the shortcomings of insufficient multi-scale feature fusion and low utilization of feature maps extracted by the backbone network. These shortcomings are not obvious when only large targets are detected. However, once the detection task contains more small targets or occluded targets, the performance of YOLOv4-tiny is not satisfactory, and missed detections or false detections often occur.
[0036] In order to solve and optimize the above-mentioned problems and limitations, and inspired by the Path Aggregation Network
[27] , the bidirectional feature pyramid proposed in the present invention adds a bottom-up downsampling branch to form a bidirectional FPN based on the original feature pyramid of YOLOv4-tiny. The feature map extracted by the backbone network first passes through the upsampling branch and then is output through the downsampling branch. The downsampling branch of the bidirectional FPN downsamples the shallow features so that their feature scale can match the scale of the deep features. Unlike PANet and FPN, the present invention replaces the conventional convolution layer with the depthwise separable convolution
[28] , which greatly reduces the number of parameters of the bidirectional FPN. The upsampling branch is used to upsample the deep feature map. The present invention uses the pixel shuffle operation (pixel shuffle) that is often used in super-resolution tasks to compress the number of channels of the feature map and increase the spatial scale so that its feature scale can match the scale of the shallow features. Unlike FPN, the present invention connects two features together by channel connection instead of adding each pixel. The advantage of this method is that it increases the amount of information contained in the feature and can solve the problem of lack of target feature information in small target detection. Since the original YOLOv4-tiny only has two feature matrices of different scales to be predicted, the present invention abandons the adaptive feature pooling layer in PANet, so that the improved feature pyramid can maximize the detection accuracy and speed without adding additional parameters. The structure is as follows Figure 6 shown.
[0037] 1.5. Feature prediction layer
[0038] Each feature layer in YOLOv4-Tiny corresponds to three prior frames, and the output of two feature layers indicates a total of six prior frames. The feature layer decodes the output feature matrix to obtain the predicted class and positioning frame. The prediction process is as follows: the image to be detected is divided into 13×13 or 26×26 grids, and each grid is responsible for the detection of an area. The IOU value of each grid is calculated with the prior frame. If the IOU value is greater than the set threshold, it is judged as 1, and if it is less than 0. Until the IOU value of the last grid is calculated, the candidate frame with the largest IOU value is finally screened out by the non-maximum suppression method to obtain the final prediction.
[0039] 1.6. Replacement of loss function
[0040] The loss function of YOLOv4-tiny consists of three parts: bounding box regression loss L loc , prediction category loss L clsAnd the prediction confidence loss L conf The overall loss L is defined as:
[0041] L=L loc +L cls +L conf
[0042] IOU is used to measure the accuracy of bounding box regression. Its size is determined by the ratio of the intersection area and the union area of the predicted box and the true box, and is defined as:
[0043]
[0044] The present invention uses CIOU as the bounding box regression loss. Compared with IOU loss, CIOU fully considers factors such as the distance between the center points of the prediction box and the penalty term αν, so that CIOU can converge well even when the intersection-over-union ratio is 0. The penalty for the aspect ratio of the bounding box is used to optimize the model's ability to adjust the prediction box, thereby achieving a better prediction box regression effect. The CIOU loss function is defined as:
[0045]
[0046] where b, b gt Represents the center point of the predicted box and the center point of the real box, ρ 2 (b,b gt ) represents the Euclidean distance between the center point of the predicted box and the real box, C 2 Represents the diagonal length of the minimum rectangular area where the real box and the predicted box intersect, α represents the weight function of the penalty term, and ν represents the aspect ratio of the bounding box. After calculating the bounding box regression loss, MSE or BCE is generally used to calculate the prediction category loss and prediction confidence loss. In order to classify the target object more accurately, the present invention replaces the original BCE loss function with a Focal loss function improved on the basis of the cross entropy loss function. The Focal loss function makes the model more focused on the detection of foreground objects by reducing the weight of simple samples, thereby avoiding the model from over-targeting the background class that occupies most of the image, making the distribution of positive and negative samples more uniform. Focal loss is defined as:
[0047] FL(p t )=-α t (1-p t ) γ log(p t )
[0048] in Indicates that when the object is the detection target class, p t is the original setting p. When the object is background class, p t1-p, this approach can effectively reduce the weight ratio of the background class. t represents the weight of positive and negative samples, γ represents the weight of difficult and easy samples, and only when α t =1, γ = 0, Focal loss is equivalent to cross entropy loss.
[0049] The improved loss function of the present invention uses CIoU loss as the bounding box regression loss and Focal loss as the prediction category loss and prediction confidence loss. Compared with the previous loss function, it not only improves the speed of prediction box regression, but also reduces the interference of the model due to the unevenness of positive and negative samples, thereby improving the overall robustness and detection accuracy of the model.
[0050] 2. Model training improvements
[0051] (1) Training strategy
[0052] The iterative strategy of model training adopted by the present invention is to use multi-stage transfer learning. Transfer learning
[29] is a method of applying a well-trained target recognition model with excellent recognition effect to another field for model training. First, the VOC dataset is used to train the YOLOv4-tiny model until it is fitted as a pre-trained model. The pre-trained model is used to transfer the image feature distribution of the source domain to the image of the target domain, and the common features between the two domains are mined. Secondly, the insulator dataset is used to train the model proposed by the present invention, and the training is divided into two stages. In the first stage, the backbone network is frozen. The frozen backbone network serves as a feature extractor and only participates in training but does not change the weight. In the second stage, the backbone network is unfrozen and the entire model is used for training. Since the feature fusion and detection head parts have been trained in the first stage, only a small learning rate is required for training in this stage, and the model is fine-tuned at the same time. The model saved after the training is completed can be used for the detection task of insulators and their defects.
[0053] (2) Learning rate setting
[0054] As the network needs to adjust fewer and fewer parameters during training, the required learning rate will also be smaller. The present invention divides the training into two stages. The first stage requires a larger learning rate. When it comes to the second stage, since the network has been partially adjusted in the first stage, a smaller learning rate is required. However, after the model has been trained for a period of time, the learning rate is likely to fall into a saddle surface, resulting in a local optimal situation. The present invention uses the cosine annealing learning rate to instantly increase the learning rate to the initial maximum value to break out of the saddle surface, so that the model can find the global optimal solution as much as possible. Its change process is as follows Figure 7As shown in the figure, we can see that the learning rate has an upper limit and a lower limit. The upper limit is the initial learning rate, and the lower limit is 0. As the training iterations increase, the learning rate first increases linearly to the initial learning rate, and then decreases to 0 in the form of a cosine function. This process is repeated until the training is completed. The advantage of using a cosine annealing learning rate is that it can enable the model to escape from the local optimal dilemma and turn to the global optimal, and find the best model effect as much as possible.
[0055] 3. Experimental data and evaluation
[0056] In order to verify the insulator detection performance of the present invention, the present invention uses 1000 normal insulator images and 50 synthetic insulator defect images with a resolution of 1152×864 collected by drone aerial photography as data sets, and all labels are in VOC2007 format. However, due to the small number of insulator defect images, the present invention uses data enhancement methods such as flipping, cropping, and brightness changes to amplify the defect images to obtain 965 defect images. The insulator image dataset consists of 1000 normal insulator images and 965 defective insulator images, of which 1768 were randomly selected as training sets and the remaining 197 were used as test sets. The test set has a total of 197 insulator images, including 279 normal insulators and 80 insulator defects. The normal insulator images are as follows: Figure 8 (a) and defective insulator image Figure 8 (b) as shown.
[0057] This invention uses four evaluation indicators to evaluate the final detection results, namely accuracy, precision, and recall. Accuracy is used to measure whether the algorithm can correctly find positive samples. Precision and recall can measure the ability of the algorithm to control false positives and missed positives. A high recall rate reflects a low missed positive rate, and a high precision represents a good ability of the algorithm to control the false positive rate. The specific evaluation indicators are as follows:
[0058]
[0059]
[0060]
[0061] Among them, TP refers to the correctly judged positive samples, TN refers to the correctly judged negative samples, FP refers to the incorrectly judged positive samples, FN refers to the incorrectly judged negative samples, and ALL refers to the sum of positive and negative samples. The area enclosed by precision and recall as coordinate axes is defined as the AP value, which can simultaneously measure the accuracy and recall of the algorithm when detecting an object. The larger the AP value, the better the effect of the algorithm. After calculating the AP values of all categories, the mAP value can be obtained by the formula:
[0062]
[0063] Where n is the total number of categories, AP i is the AP value of the ith category. If the mAP value is larger, it means that the algorithm has a better detection effect on all categories.
[0064] 4. Results and Analysis
[0065] During the detection process, the FP, TN and TF of each category are counted. Then the Accuracy, Precision and Recall of the corresponding category are calculated by formulas (2)-(4). The AP value is composed of a curve surrounded by Precision and Recall as coordinate axes. The AP values of normal insulators and defects are 96.25% and 94.14% respectively. After obtaining the AP value, the mAP value of the two categories can be calculated by formula (5) to be 95.19%.
[0066] The comparison of the performance of the improved YOLOv4-tiny method and different algorithms is shown in Table 1. The present invention compares the improved YOLOv4-tiny with the YOLOv4-tiny, Faster-RCNN, and YOLOv3 algorithms respectively. Through the AP and map of each category, it can be seen that the method proposed in the present invention has been significantly improved.
[0067] Table 1 Comparison of the performance of the improved YOLOv4-tiny method and different algorithms
[0068]
[0069] The detection effect of insulators and defects is as follows Fig. 9 As shown. Fig. 9 It can be seen from the first three rows that in order to increase the difficulty of algorithm detection, the present invention flips the original synthetic image and adds data enhancement such as Gaussian noise. The results show that the method proposed by the present invention ( Fig. 9 (b)) can accurately identify the insulator image under complex background, and can also locate and identify the defective part well. Fig. 9The performance of (a) is not satisfactory. When the image contains both defects and insulators, the original YOLOv4-tiny only detects the insulator string part and misses the defect part. The result graphs in the last three rows show that when both algorithms detect the insulator string and the defect part, the method proposed in the present invention can also obtain a higher confidence in the defect part and reduce the risk of false detection. This result shows that the improved YOLOv4-tiny method proposed in the present invention can accurately detect insulator defects.
[0070] 5. Summary
[0071] The present invention proposes an improved insulator defect detection method based on YOLOv4-tiny, aiming to solve the problems of missed detection, false detection and low precision of defective parts in existing insulator image detection. Aiming at the problem that image features cannot be effectively extracted, the feature extraction ability of the whole model is improved by introducing the ECA attention mechanism, and the simplified PANet structure is adopted in the multi-scale feature fusion part, so that the information of deep and shallow features can be fused multiple times. Focal loss is used to replace the confidence loss and classification loss to improve the problem of uneven distribution of positive and negative samples. The overall recognition and detection ability of the model for difficult samples in the data set is improved. Experimental results show that the mAP of the improved YOLOv4-tiny model is improved by 6 percentage points compared with the YOLOv4-tiny model, the AP of the insulator body is improved by 0.54 percentage points, and the AP of the defective part is improved by 11.44 percentage points. It can be seen from the test results that the performance of the model in missed detection and false detection is also significantly better than YOLOv4-tiny. In the future, how to ensure the improvement of accuracy while achieving the ideal detection speed requirements is still a problem worth studying.
[0072] References: [1] Cao Wen, Luan Mingjie, Shen Wei, et al. Effect of carbonization of insulator core rod on its electric field distribution characteristics[J]. Journal of Electric Machines and Control, 2018, 22(11): 89.
[0073] CAO Wen,LUAN Mingjie,SHEN Wei,et al.Effects of carbonization ofinsulator core rod on properties ofelectric field distribution[J].ElectriMachines and Control,2018,22(11):89.
[0074] [2]BARTON JP and INFIELD D G.Energy storage and its use withintermittent renewable energy[J].IEEE Transactions on Energy Conversion, 2004,19(2):441-448.
[0075] [3] Wu Xi, Wang Ziyi, Song Ke, Wang Hongxin, Xue Zhicheng, Li Zhixuan. Autonomous inspection system of transmission lines by drone based on Faster RCNN detector[J]. Electric Power Information and Communication Technology, 2020, 18(09): 8-15.
[0076] [4] Wang Yanru, Liu Haifeng, Li Lin, Liu Lanfang, Yang Zhenya. Application of image recognition technology based on edge intelligent analysis in online monitoring of transmission lines[J]. Electric Power Information and Communication Technology, 2019, 17(07): 35-40.
[0077] [5] Zhao Yongliang, Fu Xin, Wu Shangyuan, Guo Yang, Wang Yueyue, Wang Xiaobin, Bian Yingying, Yang Binming. Design and implementation of intelligent warehouse image recognition system based on computer vision[J]. Electric Power Information and Communication Technology, 2019, 17(12): 31-36.
[0078] [6] Li Yan. Insulator identification and location based on HOG features and SVM[J]. Journal of Transportation Engineering and Information, 2015, 13(04): 53-60.
[0079] [7] Zhang Shaoping, Yang Zhong, Huang Xiaoning, Wu Huaiqun, Gu Yuanzheng. Detection and location of self-explosion defects in glass insulators in aerial images[J]. Journal of Terahertz Science and Electronic Information, 2013, 11(04): 609-613.
[0080] [8] GIRSHICK R, DONAHUE J, DARRELL T, et al. Rich feature hierarchies for accurate object detection and semantic segmentation [C]. 2014 IEEE Conference on Computer Vision and Pattern Recognition, Columbus, USA, 2014: 580–587.
[0081] [9]GIRSHICK R.Fast R-CNN[C].2015IEEE International Conference onComputer Vision.Santiago,Chile,2015:1440–1448.
[0082]
[10] REN Shaoqing,HE Kaiming,GIRSHICK R,et al.Faster RCNN:Towardsreal-time object detection with region proposal networks[C].The 28thInternational Conference on Neural Information Processing Systems,Montreal,Canada,2015:91–99.
[0083]
[11] HE Kaiming,GKIOXARI G, P,et al.Mask RCNN[C].2017IEEEInternational Conference on ComputerVision,Venice,Italy,2017:2980–2988.
[0084]
[12] REDMON J,DIVVALA S,GIRSHICK R,et al.You only look once:Unified,real-time object detection[C].2016IEEE Conference on Computer Vision andPattern Recognition,Las Vegas,USA,2016:779–788.
[0085]
[13] REDMON J and FARHADI A.YOLO9000:Better,faster,stronger[C].2017IEEE Conference on ComputerVision andPattern Recognition,Honolulu,USA,2017:6517–6525.
[0086]
[14] REDMON J and FARHADI A.Yolov3:An incremental improvement[J].arXiv:1804.02767,2018.
[0087]
[15] LIU Wei,ANGUELOV D,ERHAN D,et al.SSD:Single shot MultiBoxdetector[C].The14th European Conference on ComputerVision,Amsterdam,theNetherlands,2016:21–37.
[0088]
[16] FU Chengyang, LIU Wei, RANGAA, et al. DSSD: Deconvolutional singleshot detector[J].arXiv:1701.06659,2017.
[0089]
[17] Tang Xiaoyu, Huang Jinbo, Feng Jiewen, Chen Xihe. Insulator image segmentation and defect detection based on U-net and YOLOv4[J]. Journal of South China Normal University (Natural Science Edition), 2020, 52(06): 15-21.
[0090]
[18] Wang Niantao, Wang Shuqing, Huang Jianfeng, Yao Ruotian, Liu Yifan. Insulator defect detection method based on improved YOLOv5 neural network [J / OL]. Laser Journal: 1-7 [2022-02-14]. https: / / kns-cnki-net.webvpn.fjut.edu.cn
[0091] / kcms / detail / 50.1085.TN.20220118.2009.002.html.
[0092]
[19] Tian Qing, Hu Rong, Li Zuoyong, Cai Yuanzheng, Yu Zhaochai. Insulator detection based on SE-YOLOv5s[J]. Journal of Intelligent Science and Technology, 2021, 3(03): 312-321.
[0093]
[20] Bochkovskiy A, Wang CY, Liao H. YOLOv4: Optimal Speed and Accuracy of Object Detection[J].2020.
[0094]
[21] Park J,Woo S,Lee JY,et al.BAM:BottleneckAttentionModule[J].2018.
[0095]
[22] Jie H,Li S,Gang S,et al.Squeeze-and-Excitation Networks[J].IEEETransactions on PatternAnalysis andMachine Intelligence,2017,PP(99).
[0096]
[23] Woo S,Park J,Lee J Y,et al.CBAM:Convolutional Block AttentionModule[J].Springer,Cham,2018.
[0097]
[24] Cao Y,Xu J,Lin S,et al.GCNet:Non-local Networks Meet Squeeze-Excitation Networks andBeyond[J].arXiv,2019.
[0098]
[25] QinZ,Zhang P,WuF,et al.FcaNet:Frequency ChannelAttentionNetworks[J].2020.
[0099]
[26] Wang Q,Wu B,Zhu P,et al.ECA-Net:Efficient Channel Attention forDeep Convolutional Neural Networks[C] / / 2020IEEE / CVF Conference on ComputerVision and Pattern Recognition(CVPR).IEEE,2020.
[0100]
[27] S.Liu,L.Qi,H.Qin,J.Shi and J.Jia,"Path Aggregation Network forInstance Segmentation,"2018IEEE / CVF Conference on Computer Vision and PatternRecognition,2018,pp.8759-8768.
[0101]
[28] Chollet F.Xception: Deep Learning with Depthwise SeparableConvolutions[J]. IEEE, 2017.
[0102]
[29] Shi Guangyu, Cao Jun, Zhang Yizhuo. Research on near-infrared recognition method of wood defects based on transfer learning[J]. Journal of Electric Machines and Control, 2020, 24(10): 159.
[0103] The above are preferred embodiments of the present invention. Any changes made according to the technical solution of the present invention, as long as the resulting functions do not exceed the scope of the technical solution of the present invention, belong to the protection scope of the present invention.
Claims
1. An improved insulator defect detection method based on YOLOv4-Tiny, characterized in that: The backbone network of YOLOv4-tiny is used to extract features of the input insulator image. The extracted feature vectors are combined into a feature matrix and then input into the feature fusion layer of YOLOv4-tiny after passing through the channel attention network to realize multi-scale feature fusion between features. Finally, the detection result is output by the detection head of YOLOv4-tiny. The feature fusion layer of YOLOv4-tiny improves FPN into a bidirectional feature pyramid structure with two feature fusion paths, that is, on the basis of the upsampling branch + convolution of FPN, a bottom-up downsampling branch is added to form a bidirectional FPN, and the convolution layer in the downsampling branch is replaced by a depth-separable convolution layer. The channel connection method of the bidirectional FPN is to connect the two features together. The feature map extracted by the backbone network first passes through the upsampling branch and then is output through the downsampling branch.
2. The insulator defect detection method based on YOLOv4-Tiny improvement according to claim 1 is characterized in that: The backbone network of the YOLOv4-tiny adopts the CSPDarknet53-Tiny network, which consists of three DarknetConv2D_BN_Leaky modules and three Resblock_body modules.
3. The insulator defect detection method based on YOLOv4-Tiny improvement according to claim 1 is characterized in that: The channel attention network adopts ECA-Net.
4. The insulator defect detection method based on the improved YOLOv4-Tiny according to claim 3 is characterized in that: In ECA-Net, an adaptive method is proposed to determine the kernel size K used for each input, whose size is proportional to the number of channels, and the calculation formula is as follows: Among them, γ=2, b=1, Ch is the number of input channels, |*| odd Represents the nearest odd number.
5. The insulator defect detection method based on YOLOv4-Tiny improvement according to claim 1 is characterized in that: The loss function of YOLOv4-tiny uses Focal loss instead of binary cross entropy loss function; the details are as follows: The loss function of YOLOv4-tiny consists of three parts: bounding box regression loss L loc , prediction category loss L cls And the prediction confidence loss L conf , the overall loss L is defined as: L=L loc +L cls +L conf IOU is used to measure the accuracy of bounding box regression. Its size is determined by the ratio of the intersection area and the union area of the predicted box and the true box, and is defined as: Use the CIOU loss function as the bounding box regression loss. The CIOU loss function is defined as: Where b, b gt Represents the center point of the predicted box and the center point of the real box, ρ 2 (b,b gt ) represents the Euclidean distance between the center point of the predicted box and the true box, C 2 Represents the diagonal length of the minimum rectangular area where the real box and the predicted box intersect, α represents the weight function of the penalty term, and ν represents the aspect ratio of the bounding box; After calculating the bounding box regression loss, the Focal loss function is used to calculate the prediction category loss and prediction confidence loss. The Focal loss function is defined as: FL(p t )=-a t (1-p t ) γ log(p t ) in Indicates that when the object is the detection target class, p t is the original setting p. When the object is background class, p t is 1-p, α t represents the weight of positive and negative samples, γ represents the weight of difficult and easy samples, and only when α t When γ = 1 and γ = 0, the Focal loss function is equivalent to the cross entropy loss.
6. The improved insulator defect detection method based on YOLOv4-Tiny according to claim 1 is characterized in that: The iterative strategy adopted for training the YOLOv4-Tiny model is to use multi-stage transfer learning: first, the VOC dataset is used to train the YOLOv4-tiny model until it is fitted as a pre-trained model, and the pre-trained model is used to migrate the image feature distribution of the source domain to the image of the target domain, and the common features between the two domains are mined; secondly, the YOLOv4-tiny model is trained using the insulator dataset, and the training is divided into two stages: the first stage is to freeze the backbone network, and the frozen backbone network is used as a feature extractor, which only participates in training but does not change the weight; the second stage is to unfreeze the backbone network and use the entire YOLOv4-tiny model for training.
7. The improved insulator defect detection method based on YOLOv4-Tiny according to claim 6 is characterized in that: The first stage requires a larger learning rate of 0.
001. When it reaches the second stage, the learning rate is set to a smaller 0.0001 because the network has been partially adjusted in the first stage. In order to prevent the learning rate from falling into the saddle surface and leading to a local optimal situation, the cosine annealing learning rate is used to instantly increase the learning rate to the initial maximum value to break out of the saddle surface, so that the YOLOv4-Tiny model can find the global optimal solution as much as possible, that is: as the training iterations increase, the learning rate is first increased linearly to the initial learning rate, and then decreased to 0 in the form of a cosine function, and this process is repeated until the training is completed.
Citation Information
Patent Citations
Automatic tracking and quality control method for iPSC and terminal equipment
CN112132001A
Traffic sign recognition method based on YOLO v4-tiny
CN112464910A