Cold region insulator fault video image detection method based on channel pruning Yolov4-Tiny network
Through the Yolov4-Tiny network based on channel pruning, combined with Quality Focal Loss and batch normalized layer scale factors, the problems of slow convergence and structural redundancy in the training of traditional insulator fault detection models are solved, and fault detection and detection of insulator videos are realized. Ice coating and ice flash identification improves detection efficiency and accuracy.
Patent Information
- Application Number
- CN202410670833.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-28
AI Technical Summary
The traditional insulator fault detection model training has a slow convergence rate and redundant structure and parameters. It can only detect faults on insulator images, but cannot detect videos, and cannot identify fault conditions such as ice coating and ice flash.
The Yolov4-Tiny network based on channel pruning is used to construct a sparse training loss function through the Quality Focal Loss classification loss function and the batch normalization layer scale factor to perform basic training, sparse training and fine-tuning training, reduce model parameters, and achieve insulator video fault detection.
It speeds up the convergence rate of model training, improves the balance and robustness of insulator fault detection, enables fault detection on images and videos of cold region insulators, accurately detects faults such as icing and ice flash, compresses the model volume, and improves Detection efficiency.
Smart Images

Figure CN118537646A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer vision. Background Art
[0002] In recent years, the scale of my country's power system has continued to expand. As a key component for the safety of power transmission and distribution of transmission lines, the safety monitoring of insulators cannot be underestimated. The traditional method of insulator monitoring is mainly manual line inspection, but manual inspection has the characteristics of poor real-time performance and high cost, and often fails to detect insulator failures in time, seriously endangering people's lives and property. In addition, China's northern transmission lines are easily affected by ice and snow in winter, causing ice flash on insulators, and the automatic identification method for insulator ice coverage needs to be studied in depth.
[0003] Traditional insulator fault detection models generally have the following problems: First, the training convergence rate of traditional insulator fault detection models is slow, and the model accuracy is easily affected by the imbalance of the number of various insulator state images in the data set; second, the traditional insulator fault detection model can only detect faults on insulator images, but cannot detect faults on insulator streaming videos, which limits the scope of model use and is less intuitive; third, the detection model based on deep learning has achieved great success in fault identification, but the traditional deep learning image detection model has structural and parameter redundancy and large model size, resulting in waste of computing resources and storage space. Therefore, it is of great significance to effectively compress the size of the model while ensuring recognition accuracy. Fourth, most of the existing insulator detection models are aimed at insulator faults in general environments, and cannot detect fault states such as insulator icing and insulator ice flash. Therefore, an insulator fault video detection method with the advantages of richer information and more accurate detection effect needs to be studied urgently. Summary of the invention
[0004] The purpose of the present invention is to solve the problems that the traditional insulator fault detection model has a slow training convergence rate, has structural and parameter redundancy, and can only perform fault detection on insulator images but cannot detect videos. The present invention provides a cold-region insulator fault video image detection method based on a Yolov4-Tiny network with channel pruning.
[0005] A video image detection method for insulator faults in cold regions based on Yolov4-Tiny network with channel pruning, the method comprising:
[0006] 1. Training phase
[0007] Dataset construction: obtain cold-region insulator images, generate insulator state category labels in each insulator image, and use each insulator image and its corresponding insulator state category label as a training sample to form a dataset;
[0008] Basic training of fault detection model: The fault detection model is implemented using the Yolov4-Tiny network. A basic training loss function is constructed based on the QualityFocal Loss classification loss function. Each training sample in the data set is input into the fault detection model for basic training.
[0009] Sparse training: Based on the Quality Focal Loss classification loss function and the batch normalization layer scale factor, a sparse training loss function is constructed, and each training sample in the data set is input into the fault detection model after basic training for sparse training;
[0010] Channel pruning and fine-tuning training: After channel pruning of the fault detection model after sparse training, a fine-tuning training loss function is constructed based on the QualityFocal Loss classification loss function, and each training sample in the data set is input into the fault detection model after channel pruning for fine-tuning training;
[0011] (II) Reasoning stage:
[0012] When the object to be detected is an image, the image to be detected is input into the fine-tuned fault detection model for fault prediction, and a predicted image marked with the insulator state category is output to complete the insulator fault detection;
[0013] When the object to be detected is a video, the video to be detected is frame-decomposed to obtain a group of images to be detected arranged in chronological order, and the group of images to be detected are sequentially input into the fine-tuned fault detection model in chronological order for fault prediction, and the predicted images marked with insulator status categories are output in sequence, and all the output predicted images are spliced in chronological order to obtain the predicted video, thereby completing the insulator fault detection.
[0014] Preferably, the insulator status categories include normal, iced, broken, flashover and post-flashover damaged.
[0015] Preferably, the basic training loss function and the fine-tuning training loss function are the same loss function, and the expressions of their loss functions are:
[0016] L QBF-det =λ loc L loc +λ QFL-cls L QFL-cls +λ conf L conf ;
[0017]
[0018]
[0019]
[0020] Where: L QBF-det is the loss function for basic training or fine-tuning training; L loc is the bounding box regression loss function; L QFL-cls is the Quality Focal Loss classification loss function; L conf is the confidence loss function; loc is the weight coefficient of the bounding box regression loss function; QFL-cls is the weight coefficient of the Quality Focal Loss classification loss function; conf is the weight coefficient of the confidence loss function; IOU is the intersection-over-union ratio of the predicted box area to the real box area; ρ is the distance between the center point of the predicted box and the center point of the real box; d is the diagonal distance of the minimum rectangular area containing the predicted box and the real box; w d and h d are the width and height of the real box respectively; w and h are the width and height of the predicted box respectively; e is the Euler constant; s c is the classification score of the prediction box; β = 2 is a hyperparameter; s 2 is the number of grids on feature maps of different scales; M is the number of prior boxes; i is the number of grid indices; j is the number of prior box indices; is the logical number that the j-th prior box of the i-th grid is a positive sample. If the j-th prior box of the i-th grid is a positive sample, then The logical value of is 1, otherwise The logical value of is 0; is the logical number that the j-th prior box of the i-th grid is a negative sample. If the j-th prior box of the i-th grid is a negative sample, then The logical value of is 1, otherwise The logical value of is 0; are the predicted values of the confidence level of the target in the i-th grid; C i is the true value of the confidence that there is a target in the i-th grid; noobj is the penalty term of the confidence loss function.
[0021] Preferably, Where: P f is the predicted box area; R f is the actual frame area.
[0022] Preferably, the expression of the sparse training loss function is:
[0023]
[0024] Where: L sis the sparse training loss function, L QBF-det is the loss function for basic training or fine-tuning training, α is the attenuation factor for sparse training, ξ is the number of layer indicators, is the number of channel indicators, φ is the total number of layers of the model, τ ξ is the total number of channels in the ξth layer, is the first layer The batch normalization layer scale factor size of the channels, ||·|| represents the norm.
[0025] Preferably, the specific process of performing channel pruning is:
[0026] Set the global channel pruning rate and the minimum channel retention rate of the batch normalization layer;
[0027] Perform channel pruning on all batch normalization layers in the sparsely trained fault detection model simultaneously;
[0028] The channel pruning rule is as follows: sort the batch normalization layer scale factors corresponding to all channels on all batch normalization layers in the Yolov4-Tiny network from small to large, and prune the channels corresponding to the batch normalization layer scale factors from small to large. After each channel is pruned, calculate the channel retention rate of the batch normalization layer where the pruned channel is located. When the channel retention rate of the batch normalization layer where the pruned channel is located is less than or equal to the set minimum channel retention rate of the batch normalization layer, the current batch normalization layer will no longer prune channels. At the same time, after each channel is pruned, count the total number of currently pruned channels. When the total number of pruned channels reaches the global channel pruning rate, stop pruning channels.
[0029] Preferably, the frame decomposition of the video to be detected is implemented by dividing the video to be detected into pictures according to a set frame rate based on a cv2 library program to form a plurality of images to be detected arranged in chronological order.
[0030] Preferably, the accuracy evaluation index for fine-tuning the fault detection model after channel pruning is selected as the average accuracy rate mAP of all categories, specifically:
[0031]
[0032]
[0033]
[0034]
[0035] Where: k is the number of state indicators; N = 5 is the total number of detection states; AP k is the average accuracy of detecting the k-th class of states; kRecall is the accuracy of detecting the k-th state; k is the recall rate of detecting the k-th state; Pr k (Recall k ) is based on Precision k is the independent variable, Recall k is a function of the dependent variable; TP k is the number of correctly detected states of the kth class; FP k is the number of missed detections of the k-th state; FN k is the number of false detections of the kth state, and the categories of the first to fifth states are normal, iced, broken, flashover, and post-flashover damage, respectively.
[0036] Preferably, the LabelImg image annotation tool is used to create the insulator state category label, and the insulator state category label is a data file in TXT format.
[0037] Preferably, the expression of the batch normalization layer is:
[0038]
[0039] Where: y is the output of the batch normalization layer, γ is the scale factor vector in the batch normalization layer; x is the input of the batch normalization layer; is the mean of the input features of the batch; σ 2 is the variance of the input features of the batch; ε is the auxiliary constant in the batch normalization layer; β BN is the bias factor in the batch normalization layer.
[0040] Advantages of the present invention:
[0041] 1. The present invention constructs a basic training loss function of the fault detection model implemented by the Yolov4-Tiny network based on the Quality Focal Loss classification loss function, which accelerates the convergence rate of the model training and improves the balance and robustness of insulator fault detection;
[0042] 2. The model of the present invention can not only detect faults on images of cold-region insulators, but also on streaming videos of cold-region insulators;
[0043] 3. Based on the model improvement of the Quality Focal Loss classification loss function, the present invention designs a sparse training loss function of the Yolov4-Tiny insulator fault detection model based on the batch normalization layer scale factor, and reduces the model parameters and compresses the model size by performing channel pruning on the insulator fault detection model after sparse training.
[0044] 4. The present invention is mainly used for accurately detecting common faults of insulators in cold regions, such as insulator icing, insulator ice flash, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flow chart of the video image detection method of insulator fault in cold regions based on Yolov4-Tiny network with channel pruning;
[0046] Figure 2 This is the YOLOv4-tiny network structure diagram;
[0047] Figure 3 This is the distribution change diagram of the batch normalization scale factor of the sparse training process;
[0048] Figure 4 It is the change diagram of each indicator in the fine-tuning training process; among them, Figure 4 a is the change chart of the Precision index in the fine-tuning training process, where Precision is the accuracy rate; Figure 4 b is the Recall index change diagram during the fine-tuning training process, where Recall is the recall rate; Figure 4 b is the mAP indicator change diagram during the fine-tuning training process;
[0049] Figure 5 The detection result of the insulator image in a normal state detected by the fault detection model after fine-tuning and training obtained by the method of the present invention;
[0050] Figure 6 The detection result of detecting an image of an insulator in a broken state by using the fine-tuned fault detection model obtained by the method of the present invention;
[0051] Figure 7 The detection result of the insulator image in the damaged state after flashover detected by the fine-tuned fault detection model obtained by the method of the present invention;
[0052] Figure 8 The detection results of the insulator images in ice-covered and broken states detected by the fine-tuned and trained fault detection model obtained by the method of the present invention;
[0053] Fig. 9 The invention discloses a detection result of an insulator image in ice-covered and flashover states using a fine-tuned and trained fault detection model obtained by the method of the invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0056] See also Figure 1 , describing this embodiment, the cold region insulator fault video image detection method based on Yolov4-Tiny network with channel pruning described in this embodiment, the method comprises:
[0057] 1. Training phase
[0058] Dataset construction: obtain cold-region insulator images, generate insulator state category labels in each insulator image, and use each insulator image and its corresponding insulator state category label as a training sample to form a dataset;
[0059] Basic training of fault detection model: The fault detection model is implemented using the Yolov4-Tiny network. A basic training loss function is constructed based on the QualityFocal Loss classification loss function. Each training sample in the data set is input into the fault detection model for basic training.
[0060] Sparse training: Based on the Quality Focal Loss classification loss function and the batch normalization layer scale factor, a sparse training loss function is constructed, and each training sample in the data set is input into the fault detection model after basic training for sparse training;
[0061] Channel pruning and fine-tuning training: After channel pruning of the fault detection model after sparse training, a fine-tuning training loss function is constructed based on the QualityFocal Loss classification loss function, and each training sample in the data set is input into the fault detection model after channel pruning for fine-tuning training;
[0062] (II) Reasoning stage:
[0063] When the object to be detected is an image, the image to be detected is input into the fine-tuned fault detection model for fault prediction, and a predicted image marked with the insulator state category is output to complete the insulator fault detection;
[0064] When the object to be detected is a video, the video to be detected is frame-decomposed to obtain a group of images to be detected arranged in chronological order, and the group of images to be detected are sequentially input into the fine-tuned fault detection model in chronological order for fault prediction, and the predicted images marked with insulator status categories are output in sequence, and all the output predicted images are spliced in chronological order to obtain the predicted video, thereby completing the insulator fault detection.
[0065] The insulator state category label produced in the training stage may include the size of the frame where the insulator as a whole is located, specifically the width and height, and the insulator state category in the frame; the category label also includes the size of the frame of the insulator fault area, specifically the width and height, and the insulator state category in the frame. Therefore, the predicted image marked with the insulator state category output in the inference stage can reflect the state category of the frame where the insulator as a whole is located in the image, and the fault category of the frame where the insulator local fault area is located.
[0066] The detection method of this embodiment can not only detect faults in images of cold-region insulators, but also detect faults in videos of cold-region insulators, thereby improving the intuitiveness of fault detection. In this embodiment, a basic training loss function of a fault detection model implemented by a Yolov4-Tiny network is constructed based on the Quality Focal Loss classification loss function, which accelerates the convergence rate of model training and improves the balance and robustness of insulator fault detection. Then, sparse training is performed on the fault detection model after basic training, and a sparse training loss function is constructed based on the Quality Focal Loss classification loss function and a batch normalization layer scale factor to perform sparse training, so that after sparse training, the scaling factor on the channel that is not important to the prediction result approaches 0, so as to facilitate subsequent channel pruning. Channel pruning is performed on the insulator fault detection model after sparse training, which reduces the parameters of the model and compresses the volume of the model, and then fine-tuning training is performed to further improve the prediction accuracy of the fault detection model finally obtained.
[0067] In this embodiment, the Yolov4-Tiny network is subjected to basic training, sparse training and fine-tuning training in sequence, and corresponding training is performed under the constraints of the corresponding constructed loss functions. The specific training process can be achieved through existing technologies, and specifically, the model parameters can be continuously corrected until the training is completed according to the classification results in the predicted image output by the model under the constraints of its corresponding loss function during the training process, that is, the predicted insulator state category is compared with the label data.
[0068] The present invention is mainly used to accurately detect common faults of insulators in cold regions, such as insulator icing, insulator ice flashover, etc. Therefore, the insulator status categories include normal, icing, broken, flashover, and post-flashover damage.
[0069] In specific applications, the insulator image data includes five types of images: normal state, iced state, broken state, flashover state, and damaged state after flashover. When making the cold-region insulator image dataset, some pictures can be rotated and flipped to expand the number of datasets, 90% of the dataset can be used as a training set, and the remaining 10% as a test set, so that the cold-region insulator fault video image detection method based on the channel pruned Yolov4-Tiny network can identify the insulators in the video and image and the four fault states that are prone to occur in cold regions.
[0070] Yolov4-Tiny network is an existing technology, and its specific structure can be found in Figure 2 ; Figure 2 In it, Conv is the convolution layer, BN is the batch normalization layer, Leaky RELU is the residual layer, and Concat is the connection layer.
[0071] Furthermore, the basic training loss function and the fine-tuning training loss function are the same loss function, and the expressions of their loss functions are:
[0072] L QBF-det =λ loc L loc +λ QFL-cls L QFL-cls +λ conf L conf ;
[0073]
[0074]
[0075]
[0076] Where: L QBF-det is the loss function for basic training or fine-tuning training; L loc is the bounding box regression loss function; L QFL-cls is the Quality Focal Loss classification loss function; L conf is the confidence loss function; loc is the weight coefficient of the bounding box regression loss function; QFL-cls is the weight coefficient of the Quality Focal Loss classification loss function; conf is the weight coefficient of the confidence loss function; IOU is the intersection-over-union ratio of the predicted box area to the real box area; ρ is the distance between the center point of the predicted box and the center point of the real box; d is the diagonal distance of the minimum rectangular area containing the predicted box and the real box; w d and h d are the width and height of the real box respectively; w and h are the width and height of the predicted box respectively; e is the Euler constant; sc is the classification score of the prediction box; β = 2 is a hyperparameter; s 2 is the number of grids on feature maps of different scales; M is the number of prior boxes; i is the number of grid indices; j is the number of prior box indices; is the logical number that the j-th priori box of the i-th grid is a positive sample. A positive sample refers to the priori box with the largest intersection-over-unit ratio with a real box among all the priori boxes. If the j-th priori box of the i-th grid is a positive sample, then The logical value of is 1, otherwise The logical value of is 0; is the logical number that the j-th priori box of the i-th grid is a negative sample. A negative sample refers to a priori box whose intersection-over-union ratio with all real boxes is less than 0.5. The threshold of 0.5 can be set manually according to the actual situation. If the j-th priori box of the i-th grid is a negative sample, then The logical value of is 1, otherwise The logical value of is 0; are the predicted values of the confidence level of the target in the i-th grid; C i is the true value of the confidence that there is a target in the i-th grid; noobj is the penalty term of the confidence loss function.
[0077] In this preferred embodiment, the advantage of using the same loss function for the basic training loss function and the fine-tuning training loss function is that the convergence rate of the model fine-tuning training can be accelerated, and the balance and robustness of the insulator fault detection of the model after fine-tuning training can be improved. The insulator state category corresponding to the area selected by the prediction box is the prediction result of the model, and the insulator state category corresponding to the domain selected by the real box is the label data.
[0078] Furthermore, Where: P f is the predicted box area; R f is the actual frame area.
[0079] Furthermore, the expression of the constructed sparse training loss function is given as:
[0080]
[0081] Where: L s is the sparse training loss function, L QBF-det is the loss function for basic training or fine-tuning training, α is the attenuation factor for sparse training, ξ is the number of layer indicators, is the number of channel indicators, φ is the total number of layers of the model, τ ξ is the total number of channels in the ξth layer, is the first layer The batch normalization layer scale factor size of the channels, ||·|| represents the norm.
[0082] In this preferred embodiment, compared with the traditional sparse training loss function, the constructed sparse training loss function can accelerate the convergence rate of model sparse training while ensuring the sparse effect, and improve the balance and robustness of insulator fault detection of the model after sparse training.
[0083] Furthermore, the specific process of channel pruning is as follows:
[0084] Set the global channel pruning rate and the minimum channel retention rate of the batch normalization layer;
[0085] Perform channel pruning on all batch normalization layers in the sparsely trained fault detection model simultaneously;
[0086] The channel pruning rule is as follows: sort the batch normalization layer scale factors corresponding to all channels on all batch normalization layers in the Yolov4-Tiny network from small to large, and prune the channels corresponding to the batch normalization layer scale factors from small to large. After each channel is pruned, calculate the channel retention rate of the batch normalization layer where the pruned channel is located. When the channel retention rate of the batch normalization layer where the pruned channel is located is less than or equal to the set minimum channel retention rate of the batch normalization layer, the current batch normalization layer will no longer prune channels. At the same time, after each channel is pruned, count the total number of currently pruned channels. When the total number of pruned channels reaches the global channel pruning rate, stop pruning channels.
[0087] Furthermore, the frame decomposition of the video to be detected is realized by dividing the video to be detected into pictures according to a set frame rate based on the cv2 library program to form a plurality of images to be detected arranged in chronological order.
[0088] Furthermore, the accuracy evaluation index for fine-tuning the fault detection model after channel pruning is selected as the average accuracy mAP of all categories, specifically:
[0089]
[0090]
[0091]
[0092]
[0093] Where: k is the number of state indicators; N = 5 is the total number of detection states; AP k is the average accuracy of detecting the k-th class of states; k Recall is the accuracy of detecting the k-th state; kis the recall rate of detecting the k-th state; Pr k (Recall k ) is based on Precision k is the independent variable, Recall k The Precision-Recall function of the dependent variable; TP k is the number of correctly detected states of the kth class; FP k is the number of missed detections of the k-th state; FN k is the number of false detections of the kth state, and the categories of the first to fifth states are normal, iced, broken, flashover, and post-flashover damage, respectively.
[0094] Furthermore, the LabelImg image annotation tool is used to produce the insulator status category label, and the insulator status category label is a data file in TXT format.
[0095] Furthermore, the expression of the batch normalization layer is:
[0096]
[0097] Where: y is the output of the batch normalization layer, γ is the scale factor vector in the batch normalization layer; x is the input of the batch normalization layer; is the mean of the input features of the batch; σ 2 is the variance of the input features of the batch; ε = 10 -5 is an auxiliary constant in the batch normalization layer to prevent σ 2 = 0, the batch normalization layer has no output; β BN is the bias factor in the batch normalization layer.
[0098] Principle analysis: First, a dataset is constructed using images of cold-region insulators in five states: normal, iced, broken, flashover, and damaged after flashover, in preparation for subsequent model training. Second, the appropriate number of rounds and batch size are selected to perform basic training of the Yolov4-Tiny network based on the cold-region insulator image dataset, where the loss function of the basic training is constructed based on the Quality Focal Loss classification loss function. Third, the model is sparsely trained, where the loss function of the sparse training is constructed based on the Quality Focal Loss classification loss function and the batch normalization layer scale factor. Fourth, in order to crop the channels that have less impact on the detection accuracy of the model and compress the size of the model, the model is channel pruned. Fifth, in order to make the model parameter setting after pruning more reasonable and restore the detection accuracy, the model is fine-tuned, where the loss function of the fine-tuning training is set the same as the basic training loss function. Sixth, the image or video of the cold-region insulator to be detected is input into the detection model. Finally, the state category of the insulator is obtained based on the detected image or video frame.
[0099] The effectiveness of the present invention is verified by applying the cold-region insulator fault video image detection method based on the Yolov4-Tiny network of channel pruning described in the present invention:
[0100] The overall flow chart of the present invention is as follows: Figure 1 As shown. The YOLOv4-tiny network structure diagram is as follows Figure 2 The distribution of the scale factor of the batch normalization layer in the sparse training process changes as shown in Figure 3 As shown. Figure 3 It can be concluded that since the scale factor of the batch normalization layer is introduced in the sparse training loss function, as the number of sparse training rounds increases, the scale factors of the batch normalization layer that have little impact on the prediction effect are mostly concentrated near 0, reflecting the adequacy of sparse training and laying a good foundation for the subsequent channel pruning strategy based on the size of the scale factor.
[0101] Table 1 is a data comparison of the fault detection model after basic training and the fault detection model after fine-tuning training of the present invention, which proves that the fault detection model after fine-tuning training has an accuracy drop of only less than 0.03 compared with the fault detection model after basic training, deletes 35.2% of the channels, compresses the model size by 62.0%, reduces the number of parameters in the model, and improves the computational efficiency.
[0102] Table 1
[0103]
[0104]
[0105] Figure 4To fine-tune the change diagram of each indicator in the training process; Figure 4 It can be concluded that during the fine-tuning training process, with the increase in the number of sparse training rounds, the trends of the three indicators of precision, recall and mAP gradually increase and then stabilize. After the three indicators stabilize, precision, recall and mAP can all maintain large values, which improves the detection accuracy of the model.
[0106] Figures 5 to 9 The fault identification results of the images to be detected by the detection method of the present invention are respectively given in the figure. According to the predicted images marked with the insulator status categories output by the fault detection model, it can be clearly seen that the status categories of each insulator are predicted and marked, and the confidence of the prediction results is given. The predicted status category is the same as the actual status category, which proves the effectiveness of the detection method of the present invention. Figures 5 to 9 In the term “Insulator”, “Broken” means broken, “Flashover Damage” means flashover damage, “Ice Covered” means ice covering, and “Flashover” means flashover.
[0107] Although the present invention is described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the present invention. It should therefore be understood that many modifications may be made to the exemplary embodiments and that other arrangements may be devised without departing from the spirit and scope of the present invention as defined by the appended claims. It should be understood that the various dependent claims and features described herein may be combined in a manner different from that described in the original claims. It should also be understood that features described in conjunction with individual embodiments may be used in other described embodiments.
Claims
1. A video image detection method for insulator faults in cold regions based on Yolov4-Tiny network with channel pruning. It is characterized in that The method includes:
1. Training phase Dataset construction: obtain cold-region insulator images, generate insulator state category labels in each insulator image, and use each insulator image and its corresponding insulator state category label as a training sample to form a dataset; Basic training of fault detection model: The fault detection model is implemented using the Yolov4-Tiny network. A basic training loss function is constructed based on the QualityFocal Loss classification loss function. Each training sample in the data set is input into the fault detection model for basic training. Sparse training: Based on the Quality Focal Loss classification loss function and the batch normalization layer scale factor, a sparse training loss function is constructed, and each training sample in the data set is input into the fault detection model after basic training for sparse training; Channel pruning and fine-tuning training: After channel pruning of the fault detection model after sparse training, a fine-tuning training loss function is constructed based on the QualityFocal Loss classification loss function, and each training sample in the data set is input into the fault detection model after channel pruning for fine-tuning training; (II) Reasoning stage: When the object to be detected is an image, the image to be detected is input into the fine-tuned fault detection model for fault prediction, and a predicted image marked with the insulator state category is output to complete the insulator fault detection; When the object to be detected is a video, the video to be detected is frame-decomposed to obtain a group of images to be detected arranged in chronological order, and the group of images to be detected are sequentially input into the fine-tuned fault detection model in chronological order for fault prediction, and the predicted images marked with insulator status categories are output in sequence, and all the output predicted images are spliced in chronological order to obtain the predicted video, thereby completing the insulator fault detection.
2. According to claim 1, the cold region insulator fault video image detection method based on Yolov4-Tiny network with channel pruning, It is characterized in that Insulator condition categories include normal, iced, broken, flashover, and post-flashover damaged.
3. According to claim 1, the cold region insulator fault video image detection method based on Yolov4-Tiny network with channel pruning, It is characterized in that The basic training loss function and the fine-tuning training loss function are the same loss function, and the expressions of their loss functions are: L QBF-det =λ loc L loc +λ QFL-cls L QFL-cls +λ conf L conf ; Where: L QBF-det is the loss function for basic training or fine-tuning training; L loc is the bounding box regression loss function; L QFL-cls is the Quality Focal Loss classification loss function; L conf is the confidence loss function; loc is the weight coefficient of the bounding box regression loss function; QFL-cls is the weight coefficient of the Quality Focal Loss classification loss function; conf is the weight coefficient of the confidence loss function; IOU is the intersection-over-union ratio of the predicted box area to the real box area; ρ is the distance between the center point of the predicted box and the center point of the real box; d is the diagonal distance of the minimum rectangular area containing the predicted box and the real box; w d and h d are the width and height of the real box respectively; w and h are the width and height of the predicted box respectively; e is the Euler constant; s c is the classification score of the prediction box; β = 2 is a hyperparameter; s 2 is the number of grids on feature maps of different scales; M is the number of prior boxes; i is the number of grid indices; j is the number of prior box indices; is the logical number that the j-th prior box of the i-th grid is a positive sample. If the j-th prior box of the i-th grid is a positive sample, then The logical value of is 1, otherwise The logical value of is 0; is the logical number that the j-th prior box of the i-th grid is a negative sample. If the j-th prior box of the i-th grid is a negative sample, then The logical value of is 1, otherwise The logical value of is 0; are the predicted values of the confidence level of the target in the i-th grid; C i is the true value of the confidence that there is a target in the i-th grid; noobj is the penalty term of the confidence loss function.
4. According to claim 3, the cold region insulator fault video image detection method based on Yolov4-Tiny network with channel pruning, It is characterized in that Where: P f is the predicted box area; R f is the actual frame area.
5. According to claim 1, the cold region insulator fault video image detection method based on Yolov4-Tiny network with channel pruning, It is characterized in that The expression of the sparse training loss function is: Where: L s is the sparse training loss function, L QBF-det is the loss function for basic training or fine-tuning training, α is the attenuation factor for sparse training, ξ is the number of layer indicators, is the number of channel indicators, φ is the total number of layers of the model, τ ξ is the total number of channels in the ξth layer, is the first layer The batch normalization layer scale factor size of the channels, ||·|| represents the norm.
6. The method for detecting cold region insulator fault video images based on Yolov4-Tiny network with channel pruning according to claim 1, It is characterized in that The specific process of channel pruning is as follows: Set the global channel pruning rate and the minimum channel retention rate of the batch normalization layer; Perform channel pruning on all batch normalization layers in the sparsely trained fault detection model simultaneously; The channel pruning rule is as follows: sort the batch normalization layer scale factors corresponding to all channels on all batch normalization layers in the Yolov4-Tiny network from small to large, and prune the channels corresponding to the batch normalization layer scale factors from small to large. After each channel is pruned, calculate the channel retention rate of the batch normalization layer where the pruned channel is located. When the channel retention rate of the batch normalization layer where the pruned channel is located is less than or equal to the set minimum channel retention rate of the batch normalization layer, the current batch normalization layer will no longer prune channels. At the same time, after each channel is pruned, count the total number of currently pruned channels. When the total number of pruned channels reaches the global channel pruning rate, stop pruning channels.
7. The method for detecting cold region insulator fault video images based on Yolov4-Tiny network with channel pruning according to claim 1, It is characterized in that The implementation method of frame decomposition of the video to be detected is: based on the cv2 library program, the video to be detected is divided into pictures according to the set frame rate to form a plurality of images to be detected arranged in chronological order.
8. The method for detecting cold region insulator fault video images based on Yolov4-Tiny network with channel pruning according to claim 1, It is characterized in that The accuracy evaluation index for fine-tuning the fault detection model after channel pruning is selected as the average accuracy mAP of all categories, specifically: Where: k is the number of state indicators; N = 5 is the total number of detection states; AP k is the average accuracy of detecting the k-th class of states; k Recall is the accuracy of detecting the k-th state; k is the recall rate of detecting the k-th state; Pr k (Recall k ) is based on Precision k is the independent variable, Recall k is a function of the dependent variable; TP k is the number of correctly detected states of the kth class; FP k is the number of missed detections of the k-th state; FN k is the number of false detections of the kth state, and the categories of the first to fifth states are normal, iced, broken, flashover, and post-flashover damage, respectively.
9. The method for detecting cold-region insulator fault video images based on Yolov4-Tiny network with channel pruning according to claim 1, It is characterized in that The LabelImg image annotation tool is used to create the insulator status category label, and the insulator status category label is a data file in TXT format.
10. The method for detecting cold region insulator fault video images based on Yolov4-Tiny network with channel pruning according to claim 6, It is characterized in that The expression of the batch normalization layer is: Where: y is the output of the batch normalization layer, γ is the scale factor vector in the batch normalization layer; x is the input of the batch normalization layer; is the mean of the input features of the batch; σ 2 is the variance of the input features of the batch; ε is the auxiliary constant in the batch normalization layer; β BN is the bias factor in the batch normalization layer.
Citation Information
Patent Citations
Method for identifying insulator defects by pruning YOLOv3 with small on-site sample size
CN110705397A
Insulator defect detection method based on improved YOLOv5 convolutional neural network
CN112819804A
Target detection network batch normalization layer pruning method and device, equipment and medium
CN115953652A
Cited By
Business influence driven parameter fine tuning and adaptive structure pruning-based fault prediction method and system
CN121350511A
