A power grid foreign matter real-time safety monitoring method and device

By optimizing the YOLOv5 model and adopting the SCA-YOLOv5 neural network algorithm, combined with data preprocessing, parameter fine-tuning, information distillation and knowledge distillation training, the real-time detection problem in power grid foreign object detection was solved, and efficient and real-time power grid safety monitoring was achieved.

CN118095367BActive Publication Date: 2026-11-03UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410317160.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-20
Publication Date
2026-11-03
Estimated Expiration
2044-03-20

AI Technical Summary

Technical Problem

Existing target detection algorithms struggle to achieve end-to-end real-time detection of foreign objects in power grids, primarily due to the large number of model parameters, high power consumption, computational load, and high latency in the data path of hardware devices. Furthermore, traditional power grid inspection relies on manual labor, which suffers from low efficiency and high risk.

Method used

The SCA-YOLOv5 neural network algorithm is adopted. Through data preprocessing, parameter fine-tuning, information distillation and knowledge distillation training, the YOLOv5 model is optimized to adapt to real-time detection of foreign objects in the power grid. Combined with the Distilled-C3 module and weighted box fusion method, a balance between detection accuracy, speed and computational load is achieved.

Benefits of technology

It enables real-time detection of small and medium-sized networks in power grid safety monitoring, improves detection capabilities, reduces latency, adapts to different hardware computing resources, and improves detection accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118095367B_ABST
    Figure CN118095367B_ABST
Patent Text Reader

Abstract

The application provides a kind of power grid foreign matter real-time safety monitoring method and device, by using improved SCA-YOLOv5 model, real-time monitoring is carried out to power grid foreign matter.The Distilled-C3 information distillation type structure used in the application can define network depth flexibly through parameter configuration, the structure includes two cases, can be selected flexible recombination and stacking, adapt to the computing resources of different hardware;In the power grid safety monitoring scene, the feature maps of two different model size networks are masked, and the small network is further distilled and trained, so that the detection ability of the model for dangerous objects such as fireworks and foreign matter in the power grid scene is improved, and the delay of the small model is low, so that real-time detection can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision technology, and in particular relates to a method and device for real-time safety monitoring of foreign objects in power grids. Background Technology

[0002] With the rapid development of my country's power grid construction, the scale of transmission lines has increased, and the amount of equipment has also increased accordingly, bringing new challenges to the safe operation of the power grid and urgently requiring new, efficient, and intelligent management methods. Foreign object detection on transmission lines, as a crucial component of the intelligent power grid inspection system, is of great significance to the safe and reliable operation of the power system. Currently, most high-voltage overhead transmission lines are bare conductors, insulated only by air. Therefore, suspended foreign objects such as kites, balloons, and greenhouse films can easily cause phase-to-ground or phase-to-phase short circuits, resulting in large-scale power outages and subsequent shutdown accidents. Furthermore, cranes and smoke can also easily cause safety accidents. Traditional power grid inspection relies on manual patrols, requiring climbing of towers, which presents numerous problems such as high operational difficulty, high risk, low efficiency, and poor real-time performance.

[0003] In recent years, drone technology and image recognition technology have made significant progress, bringing new tools and ideas to power line inspection. Image recognition technology can greatly improve inspection efficiency and is currently a popular research direction. Deep learning is widely used in fields such as speech, image, and text processing, and has achieved great benefits in industrial applications. In the field of object detection, the YOLO series of algorithms has developed rapidly, with its detection accuracy continuously improving. However, its network structure is becoming increasingly complex, with deeper layers and more parameters.

[0004] Against this backdrop, deploying currently effective object detection algorithms to mobile devices, embedded devices, and other devices makes it difficult to achieve end-to-end real-time detection. This is because the larger the number of model parameters, the higher the power consumption of the data path in the hardware device, the greater the computational load, the higher the latency, and some complex operators cannot be implemented in hardware. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention proposes an optimized version of YOLOv5, SCA-YOLOv5 (Scalable YOLOv5), suitable for real-time foreign object detection in power grids. SCA-YOLOv5 is a configurable neural network algorithm in terms of size and structure, and enables end-to-end applications. It balances detection accuracy, speed, and computational complexity, providing a comprehensive solution for real-time monitoring of power grid safety.

[0006] To solve the above-mentioned technical problems, the specific technical solution of the present invention, a method and device for real-time safety monitoring of foreign objects in power grids, is as follows:

[0007] Step 1: Obtain the sample dataset and perform data preprocessing;

[0008] Obtain the sample dataset, use the sample dataset to pre-train the YOLOv5 neural network model, and then preprocess the image data in the power line dataset. Specifically, rotate, mirror, crop, translate, add noise, change brightness, and enhance mosaic effect on the image data.

[0009] Step 2: Fine-tune the parameters;

[0010] Fine-tuning of training parameters includes freezing some network layers and modifying warm-up factors, learning rate, momentum, and weight decay parameters.

[0011] Step 3: Information distillation processing;

[0012] The dataset was distilled using the SCA-YOLOv5 neural network model. The YOLOv5 neural network model contained multiple C3 modules. The Distilled-C3 modules were used to replace the C3 modules to perform information distillation, resulting in the SCA-YOLOv5 model.

[0013] The Distilled-C3 module is divided into the following two structures based on the number of channels:

[0014] The first type: The number of channels in the input feature map of the Distilled-C3 module is different from the number of channels in the output feature map; the structure of the Distilled-C3 module is divided into two branches. The main branch goes through a convolutional unit with a kernel size of 3×3, and then through n feature extraction modules; the side branch goes through a convolutional unit with a kernel size of 3×3 and a convolutional unit with a kernel size of 1×1. Finally, the data from the two branches are integrated and then go through a convolutional unit again.

[0015] The second method: The Distilled-C3 module has the same number of channels in its input feature map as its output feature map; the main branch goes through a 3×3 kernel convolutional unit, and then is divided into two branches according to the number of channels. One branch goes through the feature extraction module, and the other branch goes through a 1×1 convolutional unit. The branch containing the feature extraction module will be divided n times according to the number of times n is used; the side branch goes through a 3×3 kernel convolutional unit, and finally the data from the two branches are integrated and then go through a convolutional unit once more.

[0016] The YOLOv5 neural network model is divided into YOLOv5n, YOLOv5s, YOLOv5m, and YOLOv5l according to the number of feature extraction modules n, from smallest to largest.

[0017] After inference using the SCA-YOLOv5 model, N different prediction boxes and their confidence scores are obtained. Then, the weighted box fusion method is used to post-process the model output results.

[0018] Step 4: Knowledge distillation training;

[0019] The YOLOv5l model with a large number of feature extraction modules is used as the teacher model, while the YOLOv5n and YOLOv5s models with a smaller number of feature extraction modules are used as student models and trained separately. The number of feature extraction modules configured in YOLOv5n and YOLOv5s is different. The specific process is as follows: First, the teacher model is trained to convergence. Then, during the training of the student model, the inference process of the large model is performed simultaneously. The input data of the student model and the teacher model are the same, but the detection boxes output by the large model are more accurate. The masking module adjusts the output size of the student model and the teacher model to be consistent. Then, the output result of the student model is masked and the loss value is calculated using a loss function. Then, backpropagation is performed based on the loss value until the student model training reaches convergence, resulting in the trained SCA-YOLOv5 model.

[0020] Furthermore, the specific steps for post-processing the output results using the weighted box fusion method are as follows:

[0021] A1: Add each predicted bounding box of the YOLOv5 model to a single list B, which is sorted in descending order of confidence C;

[0022] A2: Generate empty lists L and F for the box cluster and the merged box, respectively; each position in list L can contain a group of boxes (or a single box) to form a cluster; each position in list F contains only one box, which is the merged box from the corresponding cluster in L;

[0023] A3: Loop through the predicted bounding boxes in a single list B and try to find a matching bounding box in list F; a match is defined as a bounding box that overlaps more with the predicted bounding box (IoU (predicted bounding box area overlap ratio) > THR (overlap threshold)).

[0024] A4: If no matching box is found, add the box from list B to the end of lists L and F as a new entry; continue matching the next box in list B.

[0025] If a matching box is found, add this box to list L and list F at the position corresponding to the matching box;

[0026] A5: Recalculate the coordinates and confidence scores of the predicted boxes at each position F[pos] in list F. Then, merge all the accumulated boxes in list L corresponding to the positions in list F, with a total of T boxes. The fusion formula is as follows:

[0027]

[0028]

[0029]

[0030] Where C is the confidence score. and This represents the length and width of the i-th prediction box at a single position p in list F;

[0031] The confidence score of the merged box is set to the average confidence score of all the boxes that form it. The coordinates of the merged box are the weighted sum of the coordinates of the boxes that form it, where the weight is the confidence score of the corresponding box. Boxes with higher confidence scores contribute more to the coordinates of the merged box than boxes with lower confidence scores.

[0032] A6: After all the boxes in list B have been processed, rescale the confidence score of each position in list F, specifically by multiplying it by the number of boxes in a cluster and then dividing it by the total number N.

[0033] Furthermore, the loss function formula is as follows:

[0034]

[0035] in, It is the detection loss value of the small model itself, while It is the difference between the feature maps of two models obtained through masking. It is a balancing factor.

[0036]

[0037] Where W, H, and C are the width, height, and number of channels of the feature map, respectively; s' and t' are the feature maps of the student and teacher models, scaled to the same size and calculated at the position with width i, height j, and the c-th channel; and I is the binary mask. .

[0038] The present invention also provides a real-time safety monitoring device for foreign objects in the power grid, including a camera, a system board, and a display. The device operates as follows: after the camera captures an image, it transmits the image data to the system board. The system board runs a trained SCA-YOLOv5 model, obtains the result after model inference, and outputs the output data to the display in real time.

[0039] The beneficial effects of this invention are as follows:

[0040] 1. The Distilled-C3 information distillation structure used in this invention can flexibly define the network depth through parameter configuration. This structure includes two cases, which can be flexibly recombined and stacked to adapt to the computing resources of different hardware.

[0041] 2. In the scenario of power grid safety monitoring, the feature maps of two networks with different model sizes are masked, and the smaller network is further trained by knowledge distillation. The larger model is used to train the smaller model, which improves the model's ability to detect dangerous objects such as smoke and foreign objects in the power grid scenario. At the same time, the smaller model has low latency and can achieve real-time detection. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of the C3 module in the original YOLOv5;

[0043] Figure 2 This is a schematic diagram of the Distilled-C3 module of the present invention;

[0044] Figure 3 Comparison chart of WBF and NMS;

[0045] Figure 4 A framework diagram for knowledge distillation training;

[0046] Figure 5 This is a flowchart of an implementation example;

[0047] Figure 6 This is a hardware connection diagram for the monitoring device. Detailed Implementation

[0048] To better understand the purpose, structure, and function of this invention, the following detailed description of a method and apparatus for real-time safety monitoring of foreign objects in a power grid, in conjunction with the accompanying drawings, is provided.

[0049] A method for real-time safety monitoring of foreign objects in a power grid, comprising the following steps:

[0050] Step 1: Obtain the sample dataset;

[0051] COCO is a publicly available image dataset containing 200,000 images across 80 categories, with 500,000 object annotations. It is the most widely available object detection database. Compared to training a new network model from scratch, pre-training a YOLOv5 neural network model using the COCO dataset can accelerate model convergence. Furthermore, because the COCO dataset contains a wide variety of images and objects, it is applicable to various detection models, all of which can benefit from faster convergence through pre-training on the COCO dataset.

[0052] Step 2: Data preprocessing;

[0053] Because the datasets for power grid safety monitoring are limited and the scenarios are relatively simple, the trained networks exhibit poor generalization ability. Considering that real-world scenarios may involve cloudy, snowy, rainy, or obstructed conditions, data augmentation methods are employed.

[0054] To expand the dataset, the image data of the power line dataset was rotated, mirrored, cropped, and translated. To simulate complex real-world environments, noise was added, brightness was adjusted, and mosaic enhancement was applied to the dataset. By introducing interference into the image data for training, the robustness of the network model was enhanced, enabling the network to recognize multiple targets in complex environments.

[0055] Step 3: Fine-tune the parameters;

[0056] Fine-tuning the training parameters includes freezing some network layers and modifying the warm-up factor, learning rate, momentum, and weight decay parameters. Fine-tuning can save a lot of computational resources and time, improve computational efficiency, and may even improve accuracy.

[0057] Step 4: Information distillation processing;

[0058] The YOLOv5 neural network model consists of a backbone, a neck region, and a detection head. The results from the backbone network are transmitted to the neck region, where they are processed and then output as detection data via the detection head. The main structure of the backbone and neck regions is the C3 module, which is composed of multiple stacked C3 modules. A detailed structural diagram of the C3 module is shown below. Figure 1 As shown, it contains 3 standard convolutional layers and n Bottlenecks (feature extraction modules) (the number n is a configurable parameter). By configuring different parameters, four different sizes of YOLOv5 models can be obtained, with the number of parameters increasing from smallest to largest: YOLOv5n, YOLOv5s, YOLOv5m, and YOLOv5l. The C3 module has a structure divided into two branches: one (the main branch) uses multiple stacked Bottlenecks and two standard convolutional layers, and the other (the side branch) only goes through a basic convolutional module. Finally, the two branches are concatenated.

[0059] We first optimized the C3 module in YOLOv5, proposing a distilled information structure called Distilled-C3, which forms the SCA-YOLOv5 model. Information distillation refers to continuously improving the information extraction capability of a certain branch or channel by repeatedly splitting the channel and then extracting and integrating features. This increases the network's feature extraction capability while reducing the number of parameters. The Distilled-C3 structure is as follows: Figure 2 As shown, the Distilled-C3 module is divided into two types based on the number of channels:

[0060] The first type: such as Figure 2 As shown on the left, the number of channels in the input feature map of the entire Distilled-C3 module is different from the number of channels in the output feature map. The structure of the Distilled-C3 module is divided into two branches. The main branch goes through a convolutional unit with a kernel size of 3×3, and then through n Bottlenecks (the value of n is modified by the parameters in the configuration file). The side branch goes through a convolutional unit with a kernel size of 3×3 and a convolutional unit with a kernel size of 1×1. Finally, the data from the two branches are integrated and then go through a convolutional operation unit.

[0061] The second type: such as Figure 2 As shown on the right, the input feature map of the entire Distilled-C3 module has the same number of channels as the output feature map. The main branch goes through a convolutional unit with a kernel size of 3×3, and then divides the main branch into two branches according to the number of channels. One branch goes through a Bottleneck unit, and the other branch goes through a 1×1 convolutional unit. The branch containing the Bottleneck unit will be divided n times according to the number of times n. The side branch goes through a convolutional unit with a kernel size of 3×3, and finally the data from the two branches are integrated and then go through a convolutional operation unit once more.

[0062] The Distilled-C3 module allows for scaling configuration of depth n, and the two structures can be flexibly adjusted.

[0063] The output of a detection-type neural network model consists of thousands of predicted bounding boxes, classes, and confidence scores. These predicted boxes often overlap, requiring filtering to ultimately yield a single detection box, class, and confidence score for each location. This process is called post-processing. YOLOv5 uses Non-Maximum Suppression (NMS) in its post-processing stage. However, the NMS box filtering process depends on the choice of a single predicted box overlap threshold, which can negatively impact model performance. Therefore, it was replaced with Weighted Box Fusion (WBF).

[0064] Assuming the model predicts bounding boxes from the input image, obtaining N distinct predicted boxes and their confidence scores, and then uses a weighted bounding box fusion method for post-processing, the specific steps of the WBF method are as follows:

[0065] A1: Add each predicted bounding box of the model to a single list B, which is sorted in descending order of confidence C;

[0066] A2: Generate empty lists L and F for the box cluster and the merged box, respectively; each position in list L can contain a group of boxes (or a single box) to form a cluster; each position in list F contains only one box, which is the merged box from the corresponding cluster in L. The equation for generating the merged box will be introduced later.

[0067] A3: Loop through the predicted boxes in a single list B and try to find a matching box in list F; a match is defined as a box that overlaps more with the predicted box (IoU (predicted box area overlap ratio) > THR (overlap threshold)); in the experiment, THR = 0.55 is close to the optimal threshold.

[0068] A4: If no matching box is found, add the box from list B to the end of lists L and F as a new entry; continue matching the next box in list B.

[0069] If a matching box is found, add this box to list L and list F at the position corresponding to the matching box.

[0070] A5: Recalculate the coordinates and confidence scores of the predicted boxes at each position F[pos] in list F. Then, merge all the accumulated boxes in list L corresponding to the positions in list F, with a total of T boxes. The fusion formula is as follows:

[0071]

[0072]

[0073]

[0074] Where C is the confidence score. and This represents the length and width of the i-th prediction box at a single position p in list F.

[0075] The confidence score of the merged box is set to the average confidence score of all the boxes that form it. The coordinates of the merged box are the weighted sum of the coordinates of the boxes that form it, where the weight is the confidence score of the corresponding box. Boxes with higher confidence scores contribute more to the coordinates of the merged box than boxes with lower confidence scores.

[0076] A6: After all the boxes in list B have been processed, rescale the confidence score of each position in list F. Specifically, multiply by the number of boxes in a cluster and then divide by the total number N. If the number of boxes in a cluster is small, it means that the object at that position is difficult to predict, so the confidence score for this situation needs to be reduced.

[0077] A comparison of the two methods, nonmaximum suppression and weighted box fusion, is shown in the figure below. Figure 3 As shown. Non-maximum suppression method selects the closest detection box to the ground truth box from multiple detection boxes, while weighted box fusion calculates the average position of multiple detection boxes with high overlap as the final detection box, resulting in a more accurate detection box.

[0078] Step 5: Knowledge Distillation Training

[0079] To obtain a small model with strong detection capabilities, a knowledge distillation training method was employed. This method comprises two models: a student model and a teacher model. The student model is the small model used in the actual reasoning process, while the teacher model is a high-performance large model. Knowledge distillation refers to allowing the small model to learn the detection capabilities of the large model.

[0080] We use the SCA-YOLOv5l model as the teacher model, and the optimized SCA-YOLOv5n and SCA-YOLOv5s as student models for training. The basic framework diagram is as follows. Figure 4 As shown. The specific process is as follows: First, the teacher model is trained to convergence. Then, during the training of the student model, the inference process of the larger model is performed simultaneously. The input data for both models is the same, but the detection boxes output by the larger model are more accurate. The mask module adjusts the output sizes of the student and teacher models to be consistent. Then, the output mask is processed, and the loss value is calculated using a loss function. Backpropagation is then performed based on the loss value until the training reaches convergence, resulting in a trained model for real-time monitoring of foreign objects in the power grid. The loss function incorporates the difference in object detection between the teacher and student models for the same image. The loss function formula is as follows:

[0081]

[0082] in, It is the detection loss value of the small model itself, while It is the difference between the feature maps of the teacher model and the student model obtained through masking. It is a balancing factor.

[0083]

[0084] Where W, H, and C are the width, height, and number of channels of the feature map, respectively; s' and t' are the feature maps of the student and teacher models, scaled to the same size and calculated at the position with width i, height j, and the c-th channel; and I is the binary mask. .

[0085] Figure 5The example operation uses an original image size of 640×480. We first obtain the COCO dataset and then pre-train the network model using it. Next, we draw bounding boxes on the power line dataset images. Due to the limited number of images in the dataset and to simulate complex real-world environments, we augmented the dataset using data augmentation. We then train the YOLOv5l model on the power line dataset. Finally, we perform knowledge distillation training on the SCA-YOLOv5 model, fine-tuning the model parameters during training. After training, the model is converted to ONNX format, compiled into a binary file, and simulations are performed to obtain the running results and computational resource utilization. The optimized SCA-YOLOv5n model achieves a detection speed of 34fps and an accuracy of 89%.

[0086] To illustrate the effectiveness of this method, multiple evaluation indicators were selected for comparison. The formula for calculating the accuracy is as follows:

[0087]

[0088] The recall rate is calculated using the following formula:

[0089]

[0090] Among them, TP (True Positive): a correct positive example, an instance that is a positive class and is also judged as a positive class; FN (False Negative): a false negative example, a false negative example, an instance that is a positive class but is judged as a false class; FP (False Positive): a false positive example, a false positive example, an instance that is a false class but is judged as a positive class; TN (True Negative): a correct negative example, an instance that is a false class and is also judged as a false class.

[0091] The table below lists the performance improvements achieved by each optimization method:

[0092] Model P R MAP-50 YOLOv5s 0.808 0.700 0.746 YOLOv5s+① 0.838 0.769 0.818 YOLOv5s+①② 0.896 0.845 0.884 YOLOv5s+①②③ 0.942 0.919 0.937 YOLOv5l+① 0.939 0.922 0.956

[0093] Among them, ① refers to the post-processing of pre-training + data augmentation + WBF; ② refers to the replacement of the original C3 module with the Distilled-C3 module; ③ refers to the use of knowledge distillation processing.

[0094] In power grid safety monitoring scenarios, there are high requirements for both detection speed and accuracy. Currently, there is no algorithm that combines both accuracy and speed, but SCA-YOLOv5 balances both. We deployed the SCA-YOLOv5 algorithm on hardware and compared six metrics—inference time, DDR (Double Data Rate Synchronous Dynamic Random Access Memory) usage, MAC (Computational Resource Utilization), precision, recall, and MAP-50 (Mean Average Precision)—using the original model's n and s sizes as baselines.

[0095] After optimized model training, accuracy improved by approximately 14% and recall improved by approximately 22% compared to the baseline. The parameter data are shown in the table below:

[0096] Model Time (ms) DDR (MB) Mac Ratio P (accuracy) R (Recall Rate) MAP-50 YOLOv5n (baseline) 30.16 131.05 18.51% 0.765 0.671 0.712 YOLOv5s (baseline) 68.32 292.45 30.11% 0.808 0.700 0.746 YOLOv5m 150.78 605.34 40.33% 0.851 0.728 0.791 SCA-YOLOv5s 71.56 269.09 41.34% 0.942 0.919 0.937 SCA-YOLOv5n 29.66 115.36 25.99% 0.892 0.835 0.873

[0097] Compared with other networks, the data of various indicators are shown in the table below: The SCA-YOLOv5 model has fewer parameters than other object detection models, but its precision, recall and MAP-50 (mean precision) are all more than 10% higher than other algorithms.

[0098] Model Parameter(M) P (accuracy) R (Recall Rate) MAP-50 YOLOv3 61.5 0.792 0.730 0.754 YOLOv4 52.5 0.787 0.723 0.759 YOLOv6 16.5 0.796 0.678 0.721 YOLOv8 11.2 0.789 0.687 0.728 SCA-YOLOv5n 2.4 0.892 0.835 0.873 SCA-YOLOv5s 9.6 0.942 0.919 0.937

[0099] The embodiment also provides an artificial intelligence-based power grid safety monitoring device, the hardware connection diagram of which is shown below. Figure 6 As shown, the device includes a camera, a system board, and a display. The specific operation is as follows: After the camera captures an image, the image data is transmitted to the system board via a MIPI interface. The chip in the system board runs a trained SCA-YOLOv5n model, obtains the result after model inference, and then draws a bounding box based on the result. The output data is then output to the display in real time via an HDMI cable. The entire video detection device, after being packaged in a box, can also be configured on various other smart devices.

[0100] It is understood that the present invention has been described through some embodiments, and those skilled in the art will recognize that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, under the teachings of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of the present invention.

Claims

1. A method for real-time safety monitoring of foreign objects in a power grid, characterized in that, Includes the following steps: Step 1: Obtain the sample dataset and perform data preprocessing; Obtain the sample dataset, use the sample dataset to pre-train the YOLOv5 neural network model, and then preprocess the image data in the power line dataset; Step 2: Fine-tune the parameters; Fine-tuning of training parameters includes freezing some network layers, modifying the warm-up factor, learning rate, momentum, and weight decay parameters; Step 3: Information distillation processing; The dataset was distilled using the SCA-YOLOv5 neural network model. The YOLOv5 neural network model contained multiple C3 modules. The Distilled-C3 modules were used to replace the C3 modules to perform information distillation, resulting in the SCA-YOLOv5 model. The Distilled-C3 module is divided into the following two structures based on the number of channels: The first type: The number of channels in the input feature map of the Distilled-C3 module is different from the number of channels in the output feature map; the structure of the Distilled-C3 module is divided into two branches, the main branch passes through a convolutional unit with a kernel size of 3×3, and then through n feature extraction modules; The side branch passes through a convolutional unit with a kernel size of 3×3 and a convolutional unit with a kernel size of 1×1. Finally, the data from the two branches are integrated and passed through a convolutional unit once more. The second method: The Distilled-C3 module has the same number of channels in its input feature map as its output feature map; the main branch goes through a 3×3 kernel convolutional unit, and then is divided into two branches according to the number of channels. One branch goes through the feature extraction module, and the other branch goes through a 1×1 convolutional unit. The branch containing the feature extraction module will be divided n times according to the number of times n is used; the side branch goes through a 3×3 kernel convolutional unit, and finally the data from the two branches are integrated and then go through a convolutional unit once more. The YOLOv5 neural network model is divided into YOLOv5n, YOLOv5s, YOLOv5m, and YOLOv5l according to the number of feature extraction modules n, from smallest to largest. Then, the weighted box fusion method is used to post-process the output to obtain N different prediction boxes and their confidence scores; Step 4: Knowledge distillation training; The SCA-YOLOv5l model with a larger number of feature extraction modules is used as the teacher model, while the SCA-YOLOv5n and SCA-YOLOv5s models with a smaller number of feature extraction modules are used as student models and trained separately. The number of feature extraction modules configured in SCA-YOLOv5n and SCA-YOLOv5s are different. The specific process is as follows: First, the teacher model is trained to convergence. Then, during the training of the student model, the inference process of the large model is performed simultaneously. The input data of the student model and the teacher model are the same, but the detection boxes output by the large model are more accurate. The masking module adjusts the output size of the student model and the teacher model to be consistent. Then, the output result of the student model is masked and the loss value is calculated using the loss function. Then, backpropagation is performed based on the loss value until the student model training reaches convergence, resulting in the trained SCA-YOLOv5 model. The neural network SCA-YOLOv5 model includes a backbone, a neck region, and a detection head. The output of the backbone is transmitted to the neck region, and after calculation, the detection result data is output through the detection head. The backbone and neck regions are composed of multiple Distilled-C3 modules stacked together.

2. The method for real-time safety monitoring of foreign objects in a power grid according to claim 1, characterized in that, The preprocessing includes rotating, mirroring, cropping, and translating the image data, adding noise, changing brightness, and enhancing mosaic effects.

3. The method for real-time safety monitoring of foreign objects in a power grid according to claim 1, characterized in that, The weighted bounding box fusion method is as follows: A1: Add each predicted bounding box of the SCA-YOLOv5 model to a single list B, which is sorted in descending order of confidence C; A2: Generate empty lists L and F for box clusters and merged boxes respectively; each position in list L contains a group of boxes or a single box, forming a cluster; each position in list F contains only one box, which is a merged box from the corresponding cluster in L; A3: Loop through the predicted boxes in a single list B and find the matching box in list F; a match is defined as a box that overlaps more with the predicted box, i.e., the area overlap rate of the predicted box is greater than the overlap threshold. A4: If no matching box is found, add the box from list B to the end of lists L and F as a new entry; continue matching the next box in list B; If a matching box is found, add this box to list L and list F at the position corresponding to the matching box; A5: Recalculate the predicted bounding box coordinates and confidence scores for each position in list F. Then, fuse all the accumulated predicted bounding boxes from list L corresponding to the positions in list F to obtain a fused bounding box; the number of predicted bounding boxes is T, and the fusion formula is as follows: Where C is the confidence score. and This represents the length and width of the i-th prediction box at a single position p in list F; The confidence score of the merged box is set to the average confidence score of all the boxes that form it, and the coordinates of the merged box are the weighted sum of the coordinates of the boxes that form it, where the weights are the confidence scores of the respective boxes. A6: After all boxes in list B have been processed, rescale the confidence score of each position in list F by multiplying it by the number of boxes in a cluster and then dividing it by the total number N.

4. The method for real-time safety monitoring of foreign objects in a power grid according to claim 1, characterized in that, The loss function formula is as follows: in, It is the detection loss value of the small model itself, while It is the difference between the feature maps of the student model and the teacher model obtained through masking. It is a balance factor: Where W, H, and C are the width, height, and number of channels of the feature map, respectively; s' and t' are the feature maps of the student and teacher models, scaled to the same size and calculated at the position with width i, height j, and the c-th channel; and I is the binary mask. .

5. A real-time safety monitoring device for foreign objects in a power grid, comprising a camera, a system board, and a display, characterized in that, The system board operates a real-time safety monitoring method for foreign objects in a power grid as described in any one of claims 1-4; the specific operation mode of the device is as follows: after the camera captures an image, the image data is transmitted to the system board, the system board runs the trained SCA-YOLOv5 model, the result is obtained after model inference, and the output data is output to the display in real time.

Citation Information

Patent Citations

  • SAR image ship detection method and system based on lightweight deep learning

    CN113469073A

  • Rapid pedestrian detection method based on knowledge distillation

    CN113569882A