Electric power protection equipment detection network training method, application method and electronic equipment
By constructing a power protection equipment detection network with feature extraction, multi-scale fusion, and zoom loss modules, the problem of reduced detection accuracy caused by sample imbalance was solved, and higher detection accuracy was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUBEI UNIV OF TECH
- Filing Date
- 2023-07-17
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, the power protection equipment detection network ignores the imbalance between samples during the training process, resulting in reduced detection accuracy.
An initial power protection equipment detection network was constructed using a feature extraction module, a multi-scale fusion module, and a zoom loss module. The loss weight of the sample was determined by calculating the intersection-union ratio of the predicted box and the detection box. The weighted predicted loss was calculated based on the detection label and the confidence prediction value. The network parameters were adjusted until the loss no longer decreased.
By dynamically adjusting the sample loss weights, the problem of sample imbalance was solved, and the detection accuracy of the power protection equipment detection network was improved.
Smart Images

Figure CN116958580B_ABST
Abstract
Description
Training methods, application methods, and electronic equipment for power protection equipment testing networks Technical Field
[0001] This invention relates to the field of power safety operation testing, specifically to a network training method, application method, electronic device, and computer-readable storage medium for testing power protection equipment. Background Technology
[0002] With the significant increase in energy demand from production and daily life, ensuring safe power production has become a crucial issue. A major cause of power operation accidents is the lack of safety awareness among workers and the failure to properly wear protective equipment. While personnel supervision is commonly used to ensure safe power production, this method is resource-intensive and inefficient. Using target retrieval algorithms to detect protective equipment can effectively safeguard power production safety and personnel lives, while reducing labor costs.
[0003] Existing object detection algorithms are divided into traditional detection algorithms and deep learning detection algorithms. Traditional detection algorithms use conventional image processing methods and computer vision techniques to detect objects, such as edge detection, feature extraction, object classification, and non-maximum suppression. These typically require manual feature design, which is inconvenient and generally yields mediocre detection results. Deep learning-based object detection algorithms, on the other hand, do not require manual feature design. The detection network can autonomously learn object features from large amounts of data. Furthermore, deep learning object detection methods adaptively learn features from different objects and scenes, exhibiting far stronger generalization capabilities than traditional detection algorithms that are limited to specific scenarios. However, when training a power protection equipment detection network built using deep learning methods, there are significant differences in the performance of the training network across different samples, especially between positive and negative samples. The loss from positive samples contributes more to the overall loss of the network model, and existing technologies often overlook the imbalance between samples during training, leading to reduced network detection accuracy. Summary of the Invention
[0004] In view of this, it is necessary to provide a training method, application method, electronic device and computer-readable storage medium for a power protection equipment detection network, in order to solve the technical problem that the imbalance between samples is ignored in the prior art, which leads to a decrease in the accuracy of the network.
[0005] To address the above problems, this invention provides a training method for a power protection equipment detection network, the method comprising:
[0006] Obtain a power protection equipment detection dataset, which includes detection images, detection boxes, and detection labels;
[0007] An initial power protection equipment detection network is constructed, which includes: a feature extraction module, a multi-scale fusion module, a detection head, and a zoom loss module;
[0008] The detected image is used as the input of the initial power protection equipment detection network. The feature extraction module extracts features from the detected image to obtain a feature image. The multi-scale fusion module sequentially performs upsampling feature fusion and downsampling feature fusion on the feature image to obtain fused feature data. The detection head decodes the fused feature data to obtain a prediction box and a confidence prediction value.
[0009] The crossover ratio (CRO) of the predicted bounding box and the detected bounding box is calculated based on the zoom loss module. The loss weight of the sample is determined based on the CRO and the detection label. The weighted predicted loss is calculated based on the detection label, the confidence prediction value, and the loss weight. The initial power protection equipment detection network parameters are adjusted until the loss no longer decreases, thus obtaining a fully trained power protection equipment detection network.
[0010] Furthermore, obtain the power protection equipment testing dataset, including:
[0011] The detection image is obtained by acquiring images of power operation scenes and compressing them to the same pixel size.
[0012] The detection bounding box and detection label are marked on the detected image.
[0013] Furthermore, an initial power protection equipment testing network will be established, including:
[0014] A feature extraction module is constructed based on a pure convolutional network structure, a multi-scale fusion module is constructed based on a feature pyramid network structure and a path aggregation network structure, and a zoom loss module is constructed based on a zoom loss function.
[0015] Furthermore, the feature image includes a first feature image, a second feature image, and a third feature image; the step of extracting image features from the detected image based on the feature extraction module to obtain the feature image includes:
[0016] The detected image is passed through a convolutional layer, a normalization layer, and a pure convolutional basic module to obtain an initial feature image;
[0017] The initial feature image is passed through a first feature extraction layer to obtain a first feature image, the first feature image is passed through a second feature extraction layer to obtain a second feature image, and the second feature image is passed through a third feature extraction layer to obtain a third feature image.
[0018] Furthermore, the first feature extraction layer, the second feature extraction layer, and the third feature extraction layer are each composed of a downsampling module and a pure convolutional basic module;
[0019] The downsampling module consists of a normalization layer and a 2×2 convolution with a stride of 2;
[0020] The basic pure convolution module consists of depthwise separable convolutional layers, normalization layers, dimension-upgrading convolutional layers, dimension-reducing convolutional layers, anchor point scaling modules, and path deletion modules.
[0021] Furthermore, the fused feature data includes first fused feature data, second fused feature data, and third fused feature data; the step of sequentially performing upsampling feature fusion and downsampling feature fusion on the feature image based on the multi-scale fusion module to obtain fused feature data includes:
[0022] The first merged data is obtained by convolving the third feature image. The first merged data is then upsampled and merged with the second feature image to obtain the second merged data. The second merged data is then upsampled and merged with the first feature image to obtain the third merged data.
[0023] The first fused feature data is obtained by convolving the third merged data. The first fused feature data is then downsampled and merged with the second merged data, followed by convolving to obtain the second fused feature data. The second fused feature data is then downsampled and merged with the first merged data to obtain the third fused feature data.
[0024] Further, based on the zoom loss module, the intersection-over-union (IoU) ratio of the predicted bounding box and the detected bounding box is calculated. The loss weight of the sample is determined according to the IoU and the detection label. A weighted prediction loss is calculated based on the detection label, the confidence prediction value, and the loss weight. The initial parameters of the power protection equipment detection network are adjusted until the loss no longer decreases, resulting in a fully trained power protection equipment detection network, including:
[0025] The detected images are divided into positive and negative samples based on the detection labels.
[0026] Calculate the intersection-union ratio (IU) of the predicted bounding boxes and the detected bounding boxes of the positive samples, and adjust the loss weight of the positive samples based on the IU.
[0027] Set an adjustment factor, and reduce the loss weight of the negative samples based on the adjustment factor;
[0028] The predicted loss of the initial power protection equipment detection network is calculated based on the detection tags and the confidence prediction values.
[0029] The weighted predicted loss is calculated by weighting the predicted loss based on the loss weights of the positive and negative samples. The initial parameters of the power protection equipment detection network are adjusted until the loss no longer decreases, thus obtaining a fully trained power protection equipment detection network.
[0030] This invention also provides a method for applying a power protection equipment detection network, the method comprising:
[0031] Acquire images of the power operation to be tested;
[0032] The image of the power operation to be tested is input into a fully trained power protection equipment detection network to detect the power protection equipment. The fully trained power protection equipment detection network is determined according to any of the above-mentioned power protection equipment detection network training methods.
[0033] The power protection equipment testing network outputs the power protection equipment testing frame and testing results.
[0034] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the power protection equipment detection network training method as described above, and / or the power protection equipment detection network application method as described above.
[0035] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the power protection equipment detection network training method according to any one of the preceding claims, and / or the power protection equipment detection network application method according to the preceding claims.
[0036] Compared with the prior art, the beneficial effects of the above embodiments are as follows: In the power protection equipment detection network training method provided by the present invention, a power protection equipment detection dataset is first obtained, which includes detection images, detection boxes, and detection labels; then, an initial power protection equipment detection network is constructed, which includes a feature extraction module, a multi-scale fusion module, a detection head, and a zoom loss module; the detection images are used as input to the initial power protection equipment detection network, and feature images are obtained by feature extraction based on the feature extraction module; the feature images are then subjected to upsampling feature fusion and downsampling feature fusion sequentially based on the multi-scale fusion module to obtain fused feature data; the fused feature data is then decoded based on the detection head to obtain prediction boxes and confidence prediction values; finally, the intersection-union ratio (IUGR) of the prediction boxes and the detection boxes is calculated based on the zoom loss module, and the loss weight of the samples is determined according to the IUGR and the detection labels; the weighted prediction loss is calculated according to the detection labels, confidence prediction values, and loss weights; the parameters of the initial power protection equipment detection network are adjusted until the loss no longer decreases, thus obtaining a fully trained power protection equipment detection network. Compared with existing technologies, this invention determines the loss weights of positive and negative samples separately through a zoom loss module, and calculates the weighted predicted loss based on the obtained loss weights, thereby solving the problem of imbalance between samples and improving the detection accuracy of the power protection equipment detection network. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 is a schematic flowchart of an embodiment of the power protection equipment detection network training method provided by the present invention;
[0039] Figure 2 is a schematic diagram of the multi-scale fusion module in the power protection equipment detection network according to an embodiment of the present invention;
[0040] Figure 3 is a schematic flowchart of an embodiment of the power protection equipment detection network application method provided by the present invention;
[0041] Figure 4 is a schematic diagram of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0043] It should be understood that the accompanying drawings are not drawn to scale. The flowcharts used in this invention illustrate operations implemented according to some embodiments of the invention. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or performed simultaneously. Furthermore, those skilled in the art, guided by the content of this invention, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0044] Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor systems and / or microcontroller systems.
[0045] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0046] Figure 1 is a schematic flowchart of an embodiment of the power protection equipment detection network training method provided by the present invention. As shown in Figure 1, the power protection equipment detection network training method includes:
[0047] S101. Obtain the power protection equipment detection dataset, which includes detection images, detection boxes, and detection labels;
[0048] S102. Construct an initial power protection equipment detection network, which includes: a feature extraction module, a multi-scale fusion module, a detection head, and a zoom loss module.
[0049] S103. The detected image is used as the input of the initial power protection equipment detection network. Based on the feature extraction module, the detected image is used to extract features to obtain a feature image. Based on the multi-scale fusion module, the feature image is used to perform upsampling feature fusion and downsampling feature fusion in sequence to obtain fused feature data. Based on the detection head, the fused feature data is decoded to obtain a prediction box and a confidence prediction value.
[0050] S104. Calculate the intersection-union ratio (IUU) of the predicted bounding box and the detected bounding box based on the zoom loss module. Determine the loss weight of the sample based on the IUU and the detection label. Calculate the weighted predicted loss based on the detection label, the confidence prediction value, and the loss weight. Adjust the initial power protection equipment detection network parameters until the loss no longer decreases, and obtain a fully trained power protection equipment detection network.
[0051] Specifically, in the power protection equipment detection network training method provided by this invention, a power protection equipment detection dataset is first acquired, which includes detection images, detection boxes, and detection labels. Then, an initial power protection equipment detection network is constructed, comprising a feature extraction module, a multi-scale fusion module, a detection head, and a zoom loss module. The detection images are used as input to the initial power protection equipment detection network. Feature extraction is performed on the detection images using the feature extraction module to obtain feature images. The feature images are then subjected to upsampling feature fusion and downsampling feature fusion sequentially using the multi-scale fusion module to obtain fused feature data. The fused feature data is decoded using the detection head to obtain prediction boxes and confidence prediction values. Finally, the intersection-union ratio (IUGR) of the prediction boxes and the detection boxes is calculated using the zoom loss module. The loss weight of the samples is determined based on the IUGR and the detection labels. A weighted prediction loss is calculated based on the detection labels, confidence prediction values, and loss weights. The parameters of the initial power protection equipment detection network are adjusted until the loss no longer decreases, resulting in a fully trained power protection equipment detection network. In summary, this invention determines the loss weights of positive and negative samples respectively through a zoom loss module, and calculates the weighted predicted loss based on the obtained loss weights, thereby solving the problem of imbalance between samples and improving the detection accuracy of the power protection equipment detection network.
[0052] In a specific embodiment of the present invention, obtaining a power protection equipment detection dataset includes:
[0053] The detection image is obtained by acquiring images of power operation scenes and compressing them to the same pixel size.
[0054] The detection bounding box and detection label are marked on the detected image.
[0055] Specifically, in this embodiment, the power protection equipment detection dataset is derived from images taken in power operation scenarios. The images are compressed and resized to 416×416×3 to obtain the detection images. A labeling tool is used to annotate the detection labels of all images and to annotate the detection boxes of the target areas in the positive samples.
[0056] In a specific embodiment of the present invention, constructing an initial power protection equipment detection network includes:
[0057] A feature extraction module is constructed based on a pure convolutional network structure, a multi-scale fusion module is constructed based on a feature pyramid network structure and a path aggregation network structure, and a zoom loss module is constructed based on a zoom loss function.
[0058] Specifically, in the embodiments, a lightweight power protection equipment detection network is constructed. The feature extraction module of the power protection equipment detection network is built with a ConvNext pure convolutional network structure, the multi-scale fusion module consists of a feature pyramid network structure and a path aggregation network structure, and the zoom loss module uses the Varifocal loss function as the target classification loss and confidence loss to solve the problems of imbalance between samples and unreasonable weight allocation of positive and negative samples.
[0059] In a specific embodiment of the present invention, the feature image includes a first feature image, a second feature image, and a third feature image; the step of extracting image features from the detected image based on the feature extraction module to obtain the feature image includes:
[0060] The detected image is passed through a convolutional layer, a normalization layer, and a pure convolutional basic module to obtain an initial feature image;
[0061] The initial feature image is passed through a first feature extraction layer to obtain a first feature image, the first feature image is passed through a second feature extraction layer to obtain a second feature image, and the second feature image is passed through a third feature extraction layer to obtain a third feature image.
[0062] In a specific embodiment of the present invention, the first feature extraction layer, the second feature extraction layer and the third feature extraction layer are each composed of a downsampling module and a pure convolutional basic module;
[0063] The downsampling module consists of a normalization layer and a 2×2 convolution with a stride of 2;
[0064] The basic pure convolution module consists of depthwise separable convolutional layers, normalization layers, dimension-upgrading convolutional layers, dimension-reducing convolutional layers, anchor point scaling modules, and path deletion modules.
[0065] Specifically, in the feature extraction module built with the ConvNext pure convolutional network structure, the 416×416×3 size detection image, after being compressed, is first passed through a convolutional layer, a Layer Norm normalization layer, and a basic ConvNext pure convolutional module to output 104×104×96 output features. Then, the detection image is continuously feature extracted through three identical feature extraction layers—the first feature extraction layer, the second feature extraction layer, and the third feature extraction layer—to obtain three sets of first, second, and third feature images of different sizes: 52×52×192, 26×26×384, and 13×13×768. Each of the three feature extraction layers consists of a downsampling module and a pure convolutional module. The downsampling layer consists of a normalization layer and a 2×2 convolution with a stride of 2. The pure convolutional module adopts an inverted bottleneck structure. First, it uses a depthwise separable convolution with a kernel size of 7×7 and a stride of 1. Then, it uses a 1×1 convolution to increase the dimensionality of the features. Next, it uses a 1×1 convolution to reduce the dimensionality. Finally, it performs Layer Scale anchor scaling and Drop Path deletion operations on the features to prevent overfitting by the pure convolutional module.
[0066] Compared with existing technologies, this invention improves the feature extraction step using pure convolutional basic modules. First, the inverted bottleneck layer structure reduces the loss of feature information during downsampling. Second, through depthwise separable convolutional layers and grouped convolutions, the network achieves a better balance between parameter quantity and accuracy. Finally, the pure convolutional basic modules significantly reduce the use of activation functions and normalization layers, which helps improve the accuracy of the network and reduces the number of floating-point operations.
[0067] In a specific embodiment of the present invention, the fused feature data includes first fused feature data, second fused feature data, and third fused feature data; the step of obtaining fused feature data by sequentially performing upsampling feature fusion and downsampling feature fusion on the feature image based on the multi-scale fusion module includes:
[0068] The first merged data is obtained by convolving the third feature image. The first merged data is then upsampled and merged with the second feature image to obtain the second merged data. The second merged data is then upsampled and merged with the first feature image to obtain the third merged data.
[0069] The first fused feature data is obtained by convolving the third merged data. The first fused feature data is then downsampled and merged with the second merged data, followed by convolving to obtain the second fused feature data. The second fused feature data is then downsampled and merged with the first merged data to obtain the third fused feature data.
[0070] Specifically, Figure 2 is a schematic diagram of the structure of the multi-scale fusion module in an embodiment of the present invention. As shown in Figure 2, the multi-scale fusion module consists of a feature pyramid network structure (FPN) and a path aggregation network structure (PAN). For the feature image obtained by the feature extraction module, FPN performs upsampling operation on the features after convolution, and fuses the upsampled features with the feature image of the same dimension to obtain merged data. PAN performs downsampling operation on the merged data after convolution, and fuses the downsampled features with the merged data of the same dimension to obtain fused feature data. In the training process of this embodiment, the third feature image is first convolved to obtain the first merged data. The first merged data is upsampled and then merged with the second feature image to obtain the second merged data. The second merged data is then upsampled and then merged with the first feature image to obtain the third merged data. Then, the third merged data is convolved to obtain the first fused feature data. The first fused feature data is downsampled and then merged with the second merged data to obtain the second fused feature data. The second fused feature data is then downsampled and then merged with the first merged data to obtain the third fused feature data. Finally, the fused feature data are all convolved to obtain three sets of features: 52×52×33, 26×26×33, and 13×13×33. These features are then fed into the detection head, which decodes them to obtain the corresponding prediction boxes and confidence prediction values.
[0071] Compared with existing technologies, the multi-scale fusion module of the present invention uses a feature pyramid network structure to upsample and fuse features, and a path aggregation network structure to downsample and fuse features, thereby fusing high-resolution and low-resolution feature maps to enhance the detection capability of targets at different scales.
[0072] In a specific embodiment of the present invention, the intersection-over-union ratio (IoU) of the predicted bounding box and the detected bounding box is calculated based on the zoom loss module; the loss weight of the sample is determined based on the IoU and the detection label; a weighted predicted loss is calculated based on the detection label, the confidence prediction value, and the loss weight; and the initial parameters of the power protection equipment detection network are adjusted until the loss no longer decreases, resulting in a fully trained power protection equipment detection network, including:
[0073] The detected images are divided into positive and negative samples based on the detection labels.
[0074] Calculate the intersection-union ratio (IU) of the predicted bounding boxes and the detected bounding boxes of the positive samples, and adjust the loss weight of the positive samples based on the IU.
[0075] Set an adjustment factor, and reduce the loss weight of the negative samples based on the adjustment factor;
[0076] The predicted loss of the initial power protection equipment detection network is calculated based on the detection tags and the confidence prediction values.
[0077] The weighted predicted loss is calculated by weighting the predicted loss based on the loss weights of the positive and negative samples. The initial parameters of the power protection equipment detection network are adjusted until the loss no longer decreases, thus obtaining a fully trained power protection equipment detection network.
[0078] Specifically, in the power protection equipment dataset, most images suffer from sample imbalance, affecting the accuracy and reliability of actual detection. To address this issue, the zoom loss module establishes a Varifocal loss function to comprehensively calculate the classification loss and confidence loss of the power protection equipment detection network, thereby adjusting the loss weights of the samples. The Varifocal loss formula is as follows:
[0079]
[0080] Where p is the confidence prediction value for power protection equipment detection, ranging from 0 to 1; q is the IOU (Intersection over Union) value between the predicted bounding box and the actual detection bounding boxes in the dataset in positive samples, used to weight positive samples; q takes a value of 0 in negative samples; r and a are both scaling factors, p r As a learnable adjustment factor, it is used to reduce the weight of negative samples, thereby decreasing the contribution of background samples to the loss. For positive samples, the loss weight is adjusted by the intersection-union ratio of the predicted and detected boxes; for negative samples, the weight is adjusted by the adjustment factor p. r The loss weight for negative samples is reduced, but the loss weight for positive samples is not reduced in the same way. This increases the loss weight for positive samples, making the power protection equipment detection network focus more on positive samples. Finally, the parameters of the power protection equipment detection network are adjusted based on the calculated predicted loss, and training continues until the loss no longer decreases, resulting in a fully trained power protection equipment detection network.
[0081] Compared with existing technologies, this invention uses the variable loss function as the prediction loss for network training, dynamically adjusts the loss weights of samples, balances the effect of the detection network in handling different target categories, and solves the problem of imbalance between samples.
[0082] In summary, the feature extraction module improved by using a pure convolutional basic module can reduce the loss of feature information during downsampling, achieving a better balance between parameter quantity and accuracy, and improving the accuracy of the network. The multi-scale fusion module fuses high-resolution and low-resolution feature maps through sequential upsampling feature fusion and downsampling feature fusion, enhancing the detection capability of targets at different scales. The zoom loss function dynamically adjusts the loss weights of samples to balance the effect of the detection network in processing different target categories, solves the problem of imbalance between samples, and obtains a more accurate power protection equipment detection network, providing a more reliable guarantee for power safety production.
[0083] This invention also provides a method for applying a power protection equipment detection network, as shown in Figure 3. Figure 3 is a flowchart illustrating an embodiment of the power protection equipment detection network application method provided by this invention, including:
[0084] S301. Acquire the image of the power operation to be tested;
[0085] S302. Input the power operation image to be tested into a fully trained power protection equipment detection network to detect the power protection equipment, wherein the fully trained power protection equipment detection network is determined according to the power protection equipment detection network training method described above.
[0086] S303, the power protection equipment testing network outputs the power protection equipment testing frame and testing results.
[0087] In this embodiment of the invention, firstly, an image of the power operation to be tested is acquired; then, the power protection equipment detection network trained above is used to output the power protection equipment detection frame and detection results from the power operation image.
[0088] It should be noted that the detection results output by the power protection equipment detection network include the detection frames and confidence prediction values for various types of power protection equipment and workers. The confidence prediction value is used as the basis for determining whether workers are wearing power protection equipment. Therefore, in practical applications, confidence thresholds can be set for various detection targets according to actual needs. When the confidence prediction value of a worker or power protection equipment is higher than the confidence threshold, it is considered that the power protection detection network has detected the worker or power protection equipment.
[0089] The present invention also provides an electronic device 400, as shown in FIG4. FIG4 is a schematic diagram of an embodiment of the electronic device provided by the present invention. The electronic device 400 includes a processor 401, a memory 402 and a computer program stored in the memory 402 and executable on the processor 401. When the processor 401 executes the program, it implements the power protection equipment detection network training method and / or the power protection equipment detection network application method as described above.
[0090] In a preferred embodiment, the electronic device further includes a display 403 for displaying the process by which the processor 401 executes the power protection equipment detection network training method and / or the power protection equipment detection network application method as described above.
[0091] The processor 401 may be an integrated circuit chip with signal processing capabilities. The processor 401 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP) or an application-specific integrated circuit (ASIC). It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can also be a microprocessor or any conventional processor.
[0092] The memory 402 may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Secure Digital (SD card), Flash Card, etc. The memory 402 stores programs, and the processor 401 executes these programs upon receiving execution instructions. The process definition methods disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 401, or implemented by the processor 401.
[0093] The display 403 can be an LED display, an LCD display, or a touch screen display, etc. The display 403 is used to display various information from the electronic device 400.
[0094] It is understood that the structure shown in Figure 4 is only a schematic diagram of one possible structure of the electronic device 400, and the electronic device 400 may also include more or fewer components than those shown in Figure 4. The components shown in Figure 4 may be implemented using hardware, software, or a combination thereof.
[0095] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the power protection equipment detection network training method and / or the power protection equipment detection network application method as described above.
[0096] Generally, computer instructions for implementing the methods of the present invention can be carried on any combination of one or more computer-readable storage media. Non-transitory computer-readable storage media can include any computer-readable medium except for signals that are temporarily propagating themselves.
[0097] Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0098] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A training method for a power protection equipment detection network, characterized in that, The method includes: acquiring a power protection equipment detection dataset, the dataset including detection images, detection boxes, and detection labels; constructing an initial power protection equipment detection network, the initial network including a feature extraction module, a multi-scale fusion module, a detection head, and a zoom loss module; using the detection images as input to the initial network, performing feature extraction on the images to obtain feature images based on the feature extraction module, performing upsampling feature fusion and downsampling feature fusion on the feature images based on the multi-scale fusion module to obtain fused feature data, decoding the fused feature data based on the detection head to obtain prediction boxes and confidence prediction values; calculating the intersection-over-union ratio (IoU) of the prediction boxes and detection boxes based on the zoom loss module, determining the loss weight of the samples based on the IoU and the detection labels, calculating the weighted prediction loss based on the detection labels, confidence prediction values, and loss weights, and adjusting the parameters of the initial network until the loss no longer decreases, thus obtaining a fully trained network. A power protection equipment detection network; the process of calculating the intersection-union ratio (IU) of the predicted bounding box and the detected bounding box based on the zoom loss module, determining the loss weight of the sample based on the IU and the detection label, calculating the weighted prediction loss based on the detection label, the confidence prediction value, and the loss weight, and adjusting the initial power protection equipment detection network parameters until the loss no longer decreases, to obtain a fully trained power protection equipment detection network, includes: dividing the detected image into positive and negative samples based on the detection label; calculating the IU of the predicted bounding box and the detected bounding box of the positive sample, adjusting the loss weight of the positive sample based on the IU; setting an adjustment factor, reducing the loss weight of the negative sample based on the adjustment factor; calculating the prediction loss of the initial power protection equipment detection network based on the detection label and the confidence prediction value; weighting the prediction loss based on the loss weight of the positive and negative samples to obtain the weighted prediction loss, adjusting the initial power protection equipment detection network parameters until the loss no longer decreases, to obtain a fully trained power protection equipment detection network.
2. The power protection equipment detection network training method according to claim 1, characterized in that, The process of acquiring the power protection equipment detection dataset includes: acquiring images of power operation scenarios and compressing them to the same pixel size to obtain detection images; and labeling the detection frames and detection labels corresponding to the detection images.
3. The power protection equipment detection network training method according to claim 1, characterized in that, The construction of the initial power protection equipment detection network includes: a feature extraction module based on a pure convolutional network structure, a multi-scale fusion module based on a feature pyramid network structure and a path aggregation network structure, and a zoom loss module based on a zoom loss function.
4. The power protection equipment testing network training method according to claim 1, characterized in that, The feature image includes a first feature image, a second feature image, and a third feature image; the step of extracting image features from the detection image based on the feature extraction module to obtain the feature image includes: passing the detection image through a convolutional layer, a normalization layer, and a pure convolutional basic module to obtain an initial feature image; passing the initial feature image through a first feature extraction layer to obtain a first feature image; passing the first feature image through a second feature extraction layer to obtain a second feature image; and passing the second feature image through a third feature extraction layer to obtain a third feature image.
5. The power protection equipment testing network training method according to claim 4, characterized in that, The first feature extraction layer, the second feature extraction layer, and the third feature extraction layer are each composed of a downsampling module and a pure convolutional basic module; the downsampling module consists of a normalization layer and a 2×2 convolution with a stride of 2; the pure convolutional basic module consists of a depthwise separable convolutional layer, a normalization layer, an up-dimensional convolutional layer, an down-dimensional convolutional layer, an anchor scaling module, and a path deletion module.
6. The power protection equipment detection network training method according to claim 4, characterized in that, The fused feature data includes first fused feature data, second fused feature data, and third fused feature data; The method of obtaining fused feature data by sequentially performing upsampling feature fusion and downsampling feature fusion on the feature image based on the multi-scale fusion module includes: convolving the third feature image to obtain first merged data; upsampling the first merged data and merging it with the second feature image, then convolving it to obtain second merged data; upsampling the second merged data and merging it with the first feature image to obtain third merged data; convolving the third merged data to obtain first fused feature data; downsampling the first fused feature data and merging it with the second merged data, then convolving it to obtain second fused feature data; downsampling the second fused feature data and merging it with the first merged data to obtain third fused feature data.
7. A method for applying a power protection equipment detection network, characterized in that, The method includes: acquiring a power operation image to be tested; inputting the power operation image to be tested into a fully trained power protection equipment detection network to detect power protection equipment, wherein the fully trained power protection equipment detection network is determined according to the power protection equipment detection network training method according to any one of claims 1 to 6; and the power protection equipment detection network outputs a power protection equipment detection frame and a detection result.
8. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the power protection equipment detection network training method as described in any one of claims 1 to 6, and / or the power protection equipment detection network application method as described in claim 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the power protection equipment detection network training method according to any one of claims 1 to 6, and / or the power protection equipment detection network application method according to claim 7.
Citation Information
Patent Citations
Power transmission line target detection and identification method based on feature fusion
CN114445706A
Kitchen garbage target detection method and system based on category balance loss function
CN115761259A