A lightweight risk target detection method and device for power remote sensing data
By optimizing the YOLOv5 model and introducing depthwise separable convolution, CIoU algorithm, and Focal loss, the problems of low computational efficiency and false positives/false negatives in power remote sensing target detection are solved, achieving efficient and lightweight target detection that is suitable for power remote sensing equipment.
Patent Information
- Application Number
- CN202411890025.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-12-20
AI Technical Summary
Existing deep learning methods have low computational efficiency and a large number of model parameters in power remote sensing target detection, making them difficult to deploy efficiently on devices with limited hardware resources. They also suffer from false positives and false negatives.
We employ a lightweight YOLOv5 model, combining depthwise separable convolution and CIoU nonmaximum suppression algorithm to optimize the network structure and loss function. We train the model using a multi-task loss function, introduce Focal loss to balance sample contributions, and use various data augmentation strategies to improve the model's robustness.
While ensuring detection accuracy, it reduces computational complexity and storage requirements, improves the deployment efficiency of the model in low-resource environments, reduces false positives and false negatives, and is suitable for mobile devices and edge computing devices.
Smart Images

Figure CN119723059B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computational models, and in particular to a lightweight risk target detection method for power remote sensing data. Background Technology
[0002] As an important means of power inspection, power remote sensing technology has been widely used in the monitoring and maintenance of power facilities such as transmission lines and substations. It has overcome many limitations of traditional manual inspection in large-scale power facility inspections, such as high cost, low efficiency and human error.
[0003] With the maturity of deep learning technology, remote sensing image target detection methods based on convolutional neural networks have gradually replaced traditional target detection methods. However, existing deep learning methods often neglect computational efficiency and lightweight models while pursuing accuracy, which is particularly prominent in power remote sensing applications. The real-time requirements of power remote sensing scenarios and the limitations of equipment hardware resources make efficient and lightweight target detection models a key research focus. How to reduce computational overhead and model latency while ensuring model detection accuracy has become a critical challenge for power remote sensing target detection technology. Summary of the Invention
[0004] To address the aforementioned problems, the present invention aims to provide a lightweight risk target detection method for power remote sensing data, which solves the problems of large number of target model parameters, low computational efficiency, and high deployment difficulty in power remote sensing scenarios.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] Technical Solution 1
[0007] A lightweight risk target detection method for power remote sensing data includes the following steps: acquiring power remote sensing image data and annotating risk information on the images; preprocessing the annotated images to enhance their diversity; constructing a risk target prediction model: based on the YOLOv5 model, a depthwise separable convolution mechanism is introduced into its backbone network for feature extraction and feature fusion; the image is divided into several grids and input into the prediction model, which predicts the bounding box position and category of targets falling into the grids, with multiple bounding boxes predicted for each grid; using a CIoU-based nonmaximum suppression algorithm, the multiple predicted bounding boxes for each grid are filtered to remove overlapping predicted bounding boxes, resulting in the best selected bounding box; and then, the position and category of the target are determined.
[0008] More preferably, the depthwise separable convolution mechanism comprises two parts: channel-wise convolution and pointwise convolution. For the input feature map, channel-wise convolution is performed first, with one convolution kernel responsible for one channel. The outputs of all convolution kernels are concatenated to obtain the final output, without changing the number of channels during this process.
[0009] P dw =D k ×D k ×M×D F ×D F
[0010] Among them, M×D F ×D F D represents the size of the input feature map. F ×D F The height and width of the input feature map are represented by D, M represents the number of channels in the input feature matrix, and the kernel size is D. k ×D k Channel-wise convolution is followed by point-wise convolution, using a 1×1 convolution kernel. The number of output channels varies with the number of convolution kernels, as shown in the following formula:
[0011] P pw =M×N×D F ×D F
[0012] Where N represents the number of convolution kernels, pointwise convolution not only enables the network to flexibly change the dimension of the output channels, but also enables feature fusion between channels in the feature maps output by channelwise convolution.
[0013] More preferably, the predicted bounding box output by the prediction model includes the following attribute information: (x,y), (w,h), confidence s, multiple categories of the target, and the probability of each category; where (x,y) represents the coordinates of the center of the predicted bounding box relative to the grid cell, (w,h) represents the width and height of the predicted bounding box, the confidence s reflects whether the target exists within the bounding box and the accuracy of the predicted bounding box, and the category represents the risk level of the identified power facility. Based on the CIoU nonmaximum suppression algorithm, the predicted bounding box is selected according to the degree of overlap, taking into account the center point distance and aspect ratio, and the optimal bounding box expression is as follows:
[0014]
[0015] Among them, s i The confidence score of each predicted bounding box output by the prediction model is represented by M, where M is the highest-scoring predicted bounding box. i For one of the remaining candidate predicted bounding boxes, N i The set threshold;
[0016] More preferably, a multi-task loss function is used to optimize the prediction model, including a classification loss L. cls Confidence loss L obj And the regression loss of the prediction box L loc The total loss function formula for the prediction model is: L = λ1L cls +λ2L obj +λ3L loc λ1, λ2, and λ3 are preset weight values for model training. The prediction model is trained using a power remote sensing image dataset, the loss function is calculated, and the model is continuously trained and optimized.
[0017] More preferably, the confidence loss L obj It can be expressed as the following formula:
[0018]
[0019] Where s is the confidence level, with a value between [0,1]. The value of s represents the presence of the target corresponding to the true label and can only be 0 or 1. β is a fixed weight coefficient. The larger the β, the greater the contribution of positive samples and the smaller the contribution of negative samples. τ is an adaptive decay coefficient that applies to the probability magnitude. Simple samples with larger s values are given a greater decay force to reduce their contribution and make the network focus on learning difficult samples.
[0020] More preferably, the predicted box regression loss L loc To measure the positional difference between the predicted bounding box and the ground truth bounding box, a more robust CIoU is used to accommodate different sizes and shapes of power equipment targets, expressed as follows:
[0021]
[0022] Where IoU represents the intersection-union ratio between the ground truth bounding box and the predicted bounding box, ρ 2 (b,b gt ) represents the Euclidean distance between the center points of the ground truth bounding box and the predicted bounding box, c 2 α is the Euclidean distance between the diagonals of the minimum bounding rectangles of the real bounding box and the predicted bounding box, α is the weight parameter, v is used to measure the similarity in aspect ratio, and w gt h gt is the width and height of the true bounding box, and w and h are the width and height of the predicted bounding box.
[0023] More preferably, the category loss L cls The accuracy of target category prediction is measured using the binary cross-entropy loss function:
[0024]
[0025] Among them, yi p(y) represents 0 or 1. i The output is the label y. i The probability of.
[0026] Based on the same inventive concept, the present invention also provides a lightweight risk target detection device for power remote sensing data.
[0027] Technical Solution Two
[0028] A lightweight risk target detection device for power remote sensing data includes a memory storing an executable program and a processor, wherein the processor runs the program and executes the steps described in technical solution one.
[0029] The present invention has the following beneficial effects:
[0030] 1. This invention optimizes the network structure and loss function of the YOLOv5 model, adopts depthwise separable convolution, reduces the computational cost and number of parameters of the model, improves real-time performance, and enables the model to run efficiently in low-resource environments. It is particularly suitable for deployment on mobile devices and edge computing devices, with high deployment efficiency.
[0031] 2. This invention effectively solves the problems of misjudgment and missed detection in high-density target detection and complex background by introducing a non-maximum suppression method based on CIoU, and further optimizes the accuracy of target detection and positioning.
[0032] 3. This invention introduces Focal loss, which can better balance the contribution of various samples in the dataset.
[0033] 4. This invention employs various data augmentation strategies to improve the robustness and adaptability of the model, ensuring that the model can maintain good detection performance under different environmental and lighting conditions.
[0034] 5. This invention enhances the model's ability to detect risk targets in power remote sensing images. While ensuring high accuracy, it significantly reduces computational costs and storage requirements, providing more efficient and reliable technical support for intelligent risk monitoring in power inspections. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of the process of the present invention. Detailed Implementation
[0036] To address the problems of large parameter count, low computational efficiency, and difficult deployment of target detection models in power remote sensing scenarios, this invention provides a highly efficient and lightweight method for detecting risky targets. The invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0037] Example 1
[0038] See Figure 1 A lightweight risk target detection method for power remote sensing data includes the following steps:
[0039] Step 1: Collect remote sensing image data of power facilities and annotate risk information on the images. To achieve risk management of power facilities, comprehensive remote sensing image data of power facilities covering different geographical regions and diverse environmental conditions are collected. The targets of data collection include, but are not limited to, key power facilities such as power lines, substations, power towers, and power equipment. During the collection process, ensure that the images cover various weather and lighting conditions to comprehensively represent environmental changes that may affect the safety of power facilities. Specifically, the collected remote sensing images include the following important dimensions: weather conditions, lighting conditions, geographical location, and equipment type. All images are annotated with detailed risk location bounding boxes, i.e., the true bounding boxes as described below, and different risk levels (C) are assigned according to the specific conditions of the power facilities. The risk level can be comprehensively assessed based on factors such as the aging of the facilities, historical fault records, and external environmental influences. After the data collection is completed, it is divided into training and testing sets in a reasonable proportion. The training set accounts for 70% of the dataset and is used for model training and optimization; the testing set accounts for 30% and is used for model validation and evaluation. When partitioning the data, ensure that all types of scenarios (different weather, lighting, equipment types, etc.) in the training and testing sets are fully represented to ensure the fairness and accuracy of training and evaluation.
[0040] Step 2: Preprocess the labeled images to ensure good diversity of data input to the prediction model. Preprocessing is performed using Mosaic data augmentation, adaptive image scaling, and adaptive bounding box calculation. Mosaic data augmentation involves stitching together four images through random scaling, cropping, and arrangement to enrich the training data and improve the network's robustness. Adaptive bounding box calculation uses cluster centers calculated from the sample data as initial bounding boxes. Adaptive image scaling adds minimal black borders to the scaled image, changing its aspect ratio to achieve a standard size and further accelerating the network's inference speed.
[0041] Step 3: Construct a risk target prediction model. For target recognition tasks using power remote sensing images, a lightweight model design is required. Therefore, this invention is based on the YOLOv5 model, introducing a lightweight depthwise separable convolution mechanism into its backbone network for feature extraction and feature fusion. The depthwise separable convolution mechanism specifically comprises two parts: channel-wise convolution and pointwise convolution. For the input feature map, channel-wise convolution is performed first, with one convolution kernel responsible for one channel. The outputs of all convolution kernels are concatenated to obtain the final output. The number of channels remains unchanged during this process, expressed as: P dw =Dk ×D k ×M×D F ×D F ; where M×D F ×D F D represents the size of the input feature map. F ×D F The height and width of the input feature map are represented by D, M represents the number of channels in the input feature matrix, and the kernel size is D. k ×D k Channel-wise convolution is followed by point-wise convolution, using a 1×1 convolution kernel. The number of output channels varies with the number of convolution kernels, expressed as: P pw =M×N×D F ×D F Where N represents the number of convolution kernels, pointwise convolution not only enables the network to flexibly change the dimension of the output channels, but also enables feature fusion between channels in the feature maps output in channelwise convolution.
[0042] Step 4: After dividing the image into several grids, input them into the prediction model. For each grid, perform a single forward pass through the prediction model, simultaneously predicting the bounding box position and category of the target falling into the grid. Each grid predicts B bounding boxes. Each predicted bounding box includes the following attribute information: (x,y), (w,h), confidence s, multiple categories of the target, and the probability of each category; where (x,y) represents the coordinates of the center of the predicted bounding box relative to the grid cell, (w,h) represents the width and height of the predicted bounding box, the confidence s reflects whether there is a target within the predicted bounding box and the accuracy of the predicted bounding box, and the category represents the identified target, i.e., the risk level of the power facility.
[0043] Step 5: Filtering Predicted Bounding Boxes. Multiple overlapping bounding boxes may exist within the predicted bounding boxes, representing the same target. To eliminate redundant predicted bounding boxes, a CIoU-based non-maximum suppression algorithm is used. Taking into account center distance and aspect ratio, the optimal bounding box is selected based on the degree of overlap. The calculation formula is as follows:
[0044]
[0045] Among them, s i This represents the confidence level of each predicted bounding box output by the prediction model, where M is the predicted bounding box with the highest confidence level, and b i For one of the remaining candidate predicted bounding boxes, N i For a given threshold, IoU represents the intersection-union ratio between the candidate predicted bounding box and the ground truth bounding box. ρ represents the intersection-union ratio (IoU) between the predicted bounding box with the highest confidence and the candidate bounding box. 2 (M,bi The distance () represents the Euclidean distance between the center points of the predicted bounding box with the highest confidence and the candidate predicted bounding boxes. It is the Euclidean distance between the diagonals of the smallest bounding rectangles of the predicted bounding box with the highest confidence and the candidate predicted bounding boxes, where α is the weight parameter. Used to measure similarity in aspect ratio, w m h m represents the width and height of the predicted bounding box with the highest confidence score, while w and h represent the width and height of the candidate predicted bounding boxes. CIoU is used to evaluate the geometrical fit between the predicted bounding box with the highest confidence score and the candidate predicted bounding boxes. It considers both the distance between their center points and diagonal distances, as well as their geometric shapes, such as aspect ratios. Therefore, it can more accurately measure the similarity between the predicted bounding box with the highest confidence score and the candidate predicted bounding boxes, especially when the target shape and size are irregular. Two predicted bounding boxes with far center points and high IoU may be located on different targets and will not be deleted, thus reducing the probability of missed target detection.
[0046] The location and category of the target are determined based on the attribute information of the best predicted bounding box selected, where the category with the highest probability can be selected as the output category.
[0047] Step 6: Optimize the prediction model using a multi-task loss function, including classification loss L. cls Confidence loss L obj And the regression loss of the prediction box L loc The total loss function formula for the prediction model is: L = λ1L cls +λ2L obj +λ3L loc λ1, λ2, and λ3 are preset weight values for model training. The prediction model is trained using a power remote sensing image dataset, the loss function is calculated, and the model is continuously trained and optimized.
[0048] Confidence loss L obj The confidence loss measures whether the predicted bounding box correctly predicts the target and penalizes the confidence of the background box. To avoid excessive negative samples affecting model optimization, this invention employs Focal Loss for the confidence loss. By reducing the weight of loss information on easily classified samples, the model focuses more on difficult-to-classify samples during training, thus partially alleviating the problem of positive and negative sample imbalance caused by the small proportion of the target and the dense prediction of multiple bounding boxes during detection. The confidence loss L... obj The formula is as follows:
[0049]
[0050] Where s is the confidence level of the predicted bounding box, with a value between [0,1]. The value of s represents the presence of the target corresponding to the true label and can only be 0 or 1. β is a fixed weight coefficient. The larger the β, the greater the contribution of positive samples and the smaller the contribution of negative samples. τ is an adaptive decay coefficient that applies to the probability magnitude. Simple samples with larger s values are given a greater decay force to reduce their contribution and make the network focus on learning difficult samples.
[0051] The regression loss of the prediction box L loc To measure the positional difference between the predicted bounding box and the ground truth bounding box, a more robust CIoU is used to accommodate different sizes and shapes of power equipment targets, expressed as follows:
[0052]
[0053] Where IoU represents the intersection-union ratio between the ground truth bounding box and the predicted bounding box, ρ 2 (b,b gt ) represents the Euclidean distance between the center points of the ground truth bounding box and the predicted bounding box, c 2 α is the Euclidean distance between the diagonals of the minimum bounding rectangles of the real bounding box and the predicted bounding box, α is the weight parameter, v is used to measure the similarity in aspect ratio, and w gt h gt is the width and height of the ground truth bounding box, and w and h are the width and height of the predicted bounding box. This loss considers the distance between the center point and the diagonal distance between the ground truth bounding box and the predicted bounding box, thus more accurately measuring the similarity between two bounding boxes, especially when the target shape and size are irregular.
[0054] The category loss L cls The accuracy of target category prediction is measured using the binary cross-entropy loss function:
[0055]
[0056] Among them, y i p(y) represents 0 or 1. i The output is the label y. i The probability of prediction. As a loss function, binary cross-entropy is used to evaluate the quality of the prediction result. When the label y is 1, the value of the loss function should approach 0 as the predicted value p(y) approaches 1. Conversely, the value of the loss function becomes very large as the predicted value p(y) approaches 0. The loss is small when the predicted value is close to the label value, and large when the predicted value is far from the label value.
[0057] This invention establishes a standardized workflow for target detection in power system remote sensing images by introducing a highly efficient and lightweight risk target detection method based on YOLOv5. The lightweight depthwise separable convolution mechanism maintains detection accuracy while reducing computational complexity and storage requirements, enabling the model to run efficiently in low-resource environments, making it particularly suitable for deployment on mobile devices and edge computing devices. Simultaneously, the non-maximum suppression technique based on CIoU effectively solves the problem of missed detections in high-density target detection using traditional methods, further improving the accuracy of target localization and ensuring the precise identification of key risk targets in power facilities. Furthermore, the introduction of Focal loss better balances the contribution of various samples in the dataset. Deploying the pre-trained model to a remote sensing monitoring platform for power systems enables risk warning and level monitoring.
[0058] Based on the same inventive concept, the present invention also provides an implementation method of the electronic device corresponding to Embodiment 1, as detailed in Embodiment 2.
[0059] Example 2
[0060] A lightweight risk target detection device for power remote sensing data includes a memory storing an executable program and a processor, wherein the processor runs the program and performs the steps described in Embodiment 1.
[0061] Since the electronic device described in this embodiment is the device used to implement the method in Embodiment 1 of this application, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment based on the method described in Embodiment 1 of this application. Therefore, how the electronic device implements the method in Embodiment 1 of this application will not be described in detail here. Any device used by those skilled in the art to implement the method in Embodiment 1 of this application falls within the scope of protection of this application.
[0062] The above description is merely a specific embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A lightweight risk target detection method for power remote sensing data, characterized in that: The method comprises the following steps: Collecting power remote sensing image data and labeling risk information on the image; Preprocessing the labeled image to make the image diverse; Constructing a risk target prediction model: based on the YOLOv5 model, introducing a depth separable convolution mechanism into the backbone network to extract and fuse features of the image; Dividing the image into a plurality of grids and inputting the image into the risk target prediction model, the risk target prediction model predicting the position and category of the target falling into the grid, and each grid predicting a plurality of bounding boxes; Using a CIoU-based non-maximum suppression algorithm to screen the plurality of predicted bounding boxes of each grid, filter the overlapping predicted bounding boxes, obtain the best bounding box after screening, and then determine the position and category of the target; The prediction bounding box output by the risk target prediction model comprises attribute information as follows: , (w, h), a confidence s, a plurality of categories of the target, and a probability of each category; wherein represents the coordinates of the center of the prediction bounding box relative to the grid unit, (w, h) represents the width and height of the prediction bounding box, the confidence s reflects whether there is a target in the bounding box and the accuracy of the prediction bounding box, and the category represents the risk level of the identified power facility. The CIoU-based non-maximum suppression algorithm screens the predicted bounding boxes, and under the condition of considering the center point distance and the aspect ratio, the best bounding box is screened according to the overlapping degree, and the expression is as follows: ; ; ; ; wherein, a confidence score of each predicted bounding box representing a risk target prediction model output, is the predicted bounding box with the highest confidence score, is one of the remaining candidate predicted bounding boxes, is a set threshold value, represents an intersection over union of the candidate predicted bounding box and the ground truth bounding box, represents an intersection over union of the predicted bounding box with the highest confidence score and the candidate bounding box, represents an Euclidean distance between the center points of the predicted bounding box with the highest confidence score and the candidate predicted bounding box, is an Euclidean distance of the diagonal of the minimum enclosing rectangle of the predicted bounding box with the highest confidence score and the candidate predicted bounding box, is a weight parameter, is used to measure the aspect ratio similarity of the predicted bounding box with the highest confidence score and the candidate predicted bounding box, , is the width and height of the predicted bounding box with the highest confidence score, , is the width and height of the candidate predicted bounding box; The risk target prediction model is optimized by using a multi-task loss function, including a classification loss , a confidence loss , and a prediction box regression loss , and the total loss function formula of the risk target prediction model is: , wherein , , are respectively a first weight value, a second weight value, and a third weight value preset for model training, the risk target prediction model is trained by using a power remote sensing image data set, the loss function is calculated, and model training and optimization are continuously performed; the confidence loss is expressed as the following formula: ; wherein, is a confidence value, taking a value between , is a target existence condition corresponding to a true label, taking only 0 or 1, is a fixed weight coefficient, the greater the contribution provided by the positive sample increases, and the negative sample contribution decreases, is an adaptive decay coefficient for the probability size.
2. The lightweight risk target detection method for power remote sensing data according to claim 1, characterized in that: The depth separable convolution mechanism includes two parts of channel-wise convolution and point-wise convolution, for the input feature map, first perform channel-wise convolution, one convolution kernel is responsible for one channel, and the outputs of all convolution kernels are spliced to obtain the final output, and the channel number is not changed in the process: ; wherein, is the size of the input feature map, represents the height and width of the input feature map, represents the number of channels of the input feature matrix, and the size of the convolution kernel is After channel-by-channel convolution and point-by-point convolution, a 1x1 convolution kernel is used, and the number of output channels varies with the number of convolution kernels, as shown in the following formula: ; wherein, denotes the number of convolution kernels.
3. The lightweight risk target detection method for power remote sensing data according to claim 1, characterized in that: the predicted bounding box regression loss The position difference between the predicted bounding box and the real bounding box is measured and represented as follows: ; ; ; wherein, represents the Euclidean distance between the center points of the real and predicted bounding boxes, is the Euclidean distance of the diagonal of the minimum enclosing rectangle of the real and predicted bounding boxes, is used to measure the aspect ratio similarity of the real and predicted bounding boxes, , are the width and height of the real bounding box.
4. The lightweight risk target detection method for power remote sensing data according to claim 1, characterized in that: the classification loss The binary cross-entropy loss function is represented as follows: ; wherein represents 0 or 1, is the probability that the output is the label .
5. A lightweight risk target detection device for power remote sensing data, characterized in that: The computer program product comprises a memory having stored therein an executable program and a processor, wherein the processor executes the program to perform the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Workpiece category and pose estimation method based on YOLOv4-tiny model
CN115100136A
Lightweight garbage detection method based on improved YOLOv3
CN115908833A