A method and system for detecting small defective targets in high-resolution images of power scenes

Through the combination of progressive training and feature enhancement modules, the problem of low detection accuracy of small targets in power scenarios is solved, and efficient identification of extremely small defect targets is achieved, meeting the needs of intelligent inspection of the power grid.

CN119152194BActive Publication Date: 2025-04-15STATE GRID HUNAN ELECTRIC POWER CO LTD ELECTRIC POWER SCI RES INST +3
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411612266.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-04-15
Estimated Expiration
2044-11-13

AI Technical Summary

Technical Problem

The existing object detection algorithm has low detection accuracy in small targets in high-resolution images of power scenes, making it difficult to effectively identify small targets around 50x50 pixels.

Method used

The progressive training method is used to establish a small defect detection model, and the training image data sets at multiple resolutions are obtained by cropping high-resolution defect training images, and the resolution is gradually improved for model training. Combined with the hollow convolution feature context enhancement module and feature fusion design, the feature extraction capability of the model is enhanced.

Benefits of technology

The detection accuracy of small targets in power scenarios is improved, and extremely small defect targets in power images can be effectively identified, meeting the needs of intelligent inspection tasks of the power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152194B_ABST
    Figure CN119152194B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for detecting small defect targets in high-resolution images of power scenes, and relates to the field of power vision technology. When training a small defect detection model, a progressive training method is adopted, and the detection effect of small targets in common power scenes is better. Sampling is performed through a scoring network to ensure the accuracy of the model while avoiding complicated and redundant calculations, thereby ensuring the timeliness and accuracy of the entire model, and realizing end-to-end detection of targets in power scenes. In the scheme of the present invention, the current power equipment image is cropped with the target resolution to obtain multiple frames of current power image slices at the target resolution, the current power image slices are detected based on the small defect detection model formed after training, and after obtaining the defect inspection result, the frame coordinates of the defect detection result are mapped to the current power equipment image, and the detection accuracy of small targets in the power image is high, which can meet the requirements of intelligent power grid inspection tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric power vision technology, and in particular to a method and system for detecting small defective targets in high-resolution images of electric power scenes. Background Art

[0002] In power scenes, high-resolution images of power scenes collected by drones are usually used to detect small defective targets, such as damage to the tower top and missing pins. The resolution of high-resolution images of power scenes is generally 8000x6000 pixels, of which small targets are generally 50x50 pixels, and the proportion of small targets relative to the entire image is extremely small.

[0003] Target detection is one of the core issues in the field of computer vision. Its task is to find all targets (objects) in an image and determine their categories and locations. In recent years, with the development of Internet technology and artificial intelligence technology, the upgrade of hardware equipment, and the diversification and enrichment of needs such as autonomous driving, face detection, and video surveillance, target detection algorithms have become very mature. The current mainstream target detection algorithms can be divided into single-stage algorithms represented by the YOLO series, two-stage algorithms represented by Faster RCNN, and end-to-end detection algorithms represented by DETR. Different target detection algorithms perform differently in different scenarios, so different algorithms are often selected according to actual needs when applied. For application scenarios with high real-time requirements, lightweight single-stage algorithms can better cope with the task. Such algorithm models have a small number of parameters, a simple structure, and a short reasoning time on a single image. For scenarios with high accuracy requirements, two-stage algorithms or end-to-end algorithms are more suitable. Such algorithms have a large number of parameters and a complex model structure. Although the reasoning time is longer, they usually have higher detection accuracy.

[0004] Current detection algorithms perform well on life scene image datasets, such as COCO and VOC. However, the power scene images collected by drones have the characteristics of high resolution, extremely small size of targets to be identified, and complex background. Experimental verification shows that if the power scene defect dataset is used to directly train the existing target detection algorithm, its detection accuracy is very low.

[0005] Small target detection is a difficult problem in the classic target detection task. Targets with a pixel ratio of less than 3% are usually defined as small targets, while the MS COCO dataset defines targets with a resolution of less than 32 pixels × 32 pixels as small targets. Compared with large / medium targets, small targets have lower resolution and less information, making it difficult to extract discriminative features, making them very difficult to identify. In the prior art, there is a technical problem of low efficiency in small target detection and recognition in power scenarios.

[0006] In view of this, it is necessary to propose a defect small target detection method and system for high-resolution images of power scenes, so as to identify small targets in high-resolution images of power scenes collected by drones, so as to solve or at least partially solve the above technical problems. Summary of the invention

[0007] The main purpose of the present invention is to provide a method and system for detecting small defective targets in high-resolution images of power scenes, aiming to solve the technical problem of low detection accuracy of existing target detection algorithms for small targets in power images.

[0008] To achieve the above object, the present invention provides a method for detecting small defect targets in high-resolution images of power scenes, comprising the steps of: S100, establishing a small defect detection model at a target resolution;

[0009] S200, cropping the current power equipment image with a target resolution to obtain multiple frames of current power image slices at the target resolution;

[0010] S300, detecting the current power image slice based on the small defect detection model to obtain a defect detection result;

[0011] S400, performing coordinate mapping processing on the frame coordinates of the defect detection result, and mapping the frame coordinates of the defect detection result to the current power equipment image;

[0012] Wherein, step S100 specifically includes:

[0013] S101, cropping high-resolution defect training images at different resolutions to obtain training image datasets at multiple resolutions;

[0014] S102, determining the training image data set at the minimum resolution as the current model training data set;

[0015] S103, loading the current model training data set into the power grid defect detection pre-training model, and outputting a multi-layer original feature map from the backbone network;

[0016] S104, a feature context enhancement module based on dilated convolution obtains local context features and enhances the shallow feature map in the multi-layer original feature map output by the backbone network to obtain an enhanced feature map (multi-level feature map);

[0017] S105, fusing the multi-layer enhanced feature maps (multi-level feature maps) into the high-level feature maps in the multi-layer original feature maps to form a fused feature map;

[0018] S106, generating a true value supervision mask according to the current model training data set, supervising the fused feature map based on the true value supervision mask to obtain a feature enhancement map, and obtaining a mask supervision loss based on the true value supervision mask and the predicted mask;

[0019] S107, input the feature enhancement map into the feature screening module, use the scoring network to evaluate the feature information of each spatial position, and obtain the top m% with higher scores and p% of irrelevant vectors as the screened key feature vectors, where: ,in ;

[0020] S108, inputting the key feature vector into the multi-layer encoder structure of the Transformer model for feature integration, and outputting the prediction result using the multi-layer decoder based on the output of the encoder and the cross attention technology;

[0021] S109, comparing the prediction result with the true value of the label to calculate the classification loss and the box regression loss, and the classification loss, the box regression loss and the mask supervision loss together constitute the total loss, and updating the model parameters of the power grid defect detection pre-training model after back propagation;

[0022] S110, repeating steps S103 to S109 for multiple rounds of training until a preset termination condition is met;

[0023] S111, determine whether the training of all training image data sets is completed. If the training of all training image data sets is not completed, obtain a training image data set with better resolution and enter step S103 until the training of the training image data set corresponding to the target resolution is completed; if the training of all training image data sets is completed, determine that the pre-trained model with updated model parameters is a small defect detection model.

[0024] Further, in step S100,

[0025] A 600×600 pixel window is used to slide and slice the high-resolution defect training image for training to obtain a 600×600 training image dataset, and a training model 1 is obtained after training with the 600×600 training image dataset and the first preset negative sample dataset and updating the model parameters;

[0026] A 1000×1000 pixel window is used to slide and slice the high-resolution defect training image for training to obtain a 1000×1000 training image dataset, and the 1000×1000 pixel dataset and the second preset negative sample dataset are used to train the training model 1 as the pre-training model and update the model parameters to obtain the training model 2;

[0027] A 1500×1500 pixel window is used to slide and slice the high-resolution defect training image used for training to obtain a 1500×1500 training image dataset, and the 1500×1500 pixel dataset and the third preset negative sample dataset are used to train the training model 2 as the pre-training model and update the model parameters to obtain a small defect detection model;

[0028] Among them, the target resolution is a pixel resolution of 1500×1500; if there is a defective target at the current position in the training image data set, the position is marked in the current image coordinate system of the current image.

[0029] Furthermore, in step S104, a feature context enhancement module based on dilated convolution performs context enhancement processing on shallow features of the first three layers of the feature map output by the backbone network.

[0030] Furthermore, in step S105, the feature fusion process is expressed as ,

[0031] in, Represents the output fused feature map, is the feature map after context enhancement, represents a standard 3×3 convolution, is the batch normalization operation, represents the Relu activation function, is the learnable weight parameter, and n is the total number of feature maps in the process of feature fusion.

[0032] Furthermore, in step S106, a true value supervision mask is generated according to the current model training data set as supervision of the fused feature map;

[0033] The fused feature map passes through a module consisting of convolution and activation function, and outputs the predicted mask;

[0034] Multiply the original feature map in the multi-level feature map with the predicted mask to obtain the output feature map;

[0035] Among them, the true value supervision mask is used to supervise the predicted mask, and the MSE loss of the two is calculated.

[0036] Furthermore, the process of multiplying the original feature map in the multi-level feature map with the predicted mask to obtain the output feature map is expressed as ,

[0037] in, represents the fused feature map, F is the output feature map, represents 3×3 convolution and Relu modules, represents the Sigmoid function, represents the Hadamard product.

[0038] Furthermore, using the formula Calculate the total loss, where They are classification loss, box regression loss and mask supervision loss respectively. are the weights of classification loss, box regression loss and mask supervision loss respectively.

[0039] Furthermore, if the number of rounds of training reaches a preset number, it is determined that a preset termination condition is met.

[0040] The present invention also provides a small defect target detection system for high-resolution images of power scenes, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the steps of the above-mentioned small defect target detection method for high-resolution images of power scenes.

[0041] Compared with the prior art, the defect small target detection method for high-resolution images of power scenes provided by the present invention has the following beneficial effects:

[0042] The present invention provides a method for detecting small defective targets in high-resolution images of power scenes. When training a small defect detection model, a progressive training method is adopted. First, a training image data set with a lower pixel is used for training, and then a training image data set with a higher pixel is used for training in sequence, until a small defect detection model is obtained by training a training image data set corresponding to the target resolution. The progressive training of the multi-scale training image data set ensures the continuity of model training. The design of feature fusion fully retains the feature information of small targets in the information transmission process, so that the detection effect of small targets in common power scenes is better. Sampling is performed through a scoring network to ensure the accuracy of the model while avoiding complicated and redundant calculations, thereby ensuring the timeliness and accuracy of the entire model, and realizing end-to-end detection of targets in power scenes. In the scheme of the present invention, the current power equipment image is cropped with the target resolution to obtain multiple frames of current power image slices at the target resolution, the current power image slice is detected based on the small defect detection model formed after training, and the frame coordinates of the defect detection result are mapped to the current power equipment image after obtaining the defect inspection result. The detection accuracy of small targets in the power image is high, which can meet the requirements of intelligent power grid inspection tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0044] Figure 1 It is a flow chart of the defect small target detection method for high-resolution images of power scenes of the present invention;

[0045] Figure 2 for Figure 1 A schematic diagram of the process of establishing a small defect detection model at a target resolution;

[0046] Figure 3 This is an example schematic diagram of cutting a high-resolution defect training image in the defect small target detection method for high-resolution images of power scenes of the present invention; wherein a is a schematic diagram before slicing, and b is a schematic diagram after slicing;

[0047] Figure 4 Schematic diagram of the principle of small defect detection in training a small defect detection model of the present invention, wherein a is a schematic diagram of the model and b is a schematic diagram of the network structure;

[0048] Figure 5 It is a schematic diagram of the principle of the feature weighted fusion module in the training small defect detection model of the present invention;

[0049] Figure 6 A schematic diagram of the principle of training a truth mask feature supervision module in a small defect detection model of the present invention;

[0050] Figure 7 This is a schematic diagram of the principles of the scoring network and feature sampling module in the small defect detection model trained in the present invention.

[0051] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0055] Please refer to Figure 1 and Figure 2 The present invention provides a method for detecting small defect targets in high-resolution images of power scenes, comprising the steps of:

[0056] S100, building a small defect detection model at target resolution;

[0057] S200, cropping the current power equipment image with a target resolution to obtain multiple frames of current power image slices at the target resolution;

[0058] S300, detecting the current power image slice based on the small defect detection model to obtain a defect detection result;

[0059] S400, performing coordinate mapping processing on the frame coordinates of the defect detection result, and mapping the frame coordinates of the defect detection result to the current power equipment image;

[0060] Wherein, step S100 specifically includes:

[0061] S101, cropping high-resolution defect training images at different resolutions to obtain training image datasets at multiple resolutions;

[0062] S102, determining a training image dataset at a minimum resolution as a current model training dataset;

[0063] S103, loading the current model training data set into the power grid defect detection pre-training model, and outputting a multi-layer original feature map from the backbone network;

[0064] S104, a feature context enhancement module based on dilated convolution obtains local context features and enhances the shallow feature map in the multi-layer original feature map output by the backbone network to obtain an enhanced feature map (multi-level feature map);

[0065] S105, fusing the multi-layer enhanced feature maps (multi-level feature maps) into the high-level feature maps in the multi-layer original feature maps to form a fused feature map;

[0066] S106, generating a true value supervision mask according to the current model training data set, supervising the fused feature map based on the true value supervision mask to obtain a feature enhancement map, and obtaining a mask supervision loss based on the true value supervision mask and the predicted mask;

[0067] S107, input the feature enhancement map into the feature screening module, use the scoring network to evaluate the feature information of each spatial position, and obtain the top m% with higher scores and p% of irrelevant vectors as the screened key feature vectors, where: ,in ;

[0068] S108, inputting the key feature vector into the multi-layer encoder structure of the Transformer model for feature integration, and outputting the prediction result using the multi-layer decoder based on the output of the encoder and the cross attention technology;

[0069] S109, comparing the prediction result with the true value of the label to calculate the classification loss and the box regression loss, and the classification loss, the box regression loss and the mask supervision loss together constitute the total loss, and updating the model parameters of the power grid defect detection pre-training model after back propagation;

[0070] S110, repeating steps S103 to S109 for multiple rounds of training until a preset termination condition is met;

[0071] S111, determine whether the training of all training image data sets is completed. If the training of all training image data sets is not completed, obtain a training image data set with better resolution and enter step S103 until the training of the training image data set corresponding to the target resolution is completed; if the training of all training image data sets is completed, determine that the pre-trained model with updated model parameters is a small defect detection model.

[0072] The present invention provides a method for detecting small defect targets in high-resolution images of power scenes. When training a small defect detection model, a progressive training method is adopted. First, a training image data set with a lower pixel is used for training, and then a training image data set with a higher pixel is used for training in sequence, until a small defect detection model is obtained by training a training image data set corresponding to the target resolution. The progressive training of the multi-scale training image data set ensures the continuity of model training. The design of feature fusion fully retains the feature information of small targets in the information transmission process, so the detection effect of small targets in common power scenes is better. Sampling is performed through a scoring network to ensure the accuracy of the model while avoiding complicated and redundant calculations, thereby ensuring the timeliness and accuracy of the entire model, and realizing end-to-end detection of targets in power scenes. In the scheme of the present invention, the current power equipment image is cropped with the target resolution to obtain a multi-frame current power image data set at the target resolution, the current power image data set is detected based on the small defect detection model formed after training, and the frame coordinates of the defect detection result are mapped to the current power equipment image after obtaining the defect inspection result. The detection accuracy of small targets in the power image is high, which can meet the requirements of intelligent power grid inspection tasks.

[0073] It can be understood that the high-resolution defect training image can be a defect image with missing pins, or a defect image with other defects such as tower top damage.

[0074] It is understandable that in the present invention, when training and acquiring a small defect detection model, a high-resolution defect training image can be cropped at three different resolutions to obtain a training image data set at three resolutions; a high-resolution defect training image can be cropped at four different resolutions to obtain a training image data set at four resolutions; a high-resolution defect training image can also be cropped at five different resolutions to obtain a training image data set at five resolutions, which is not specifically limited here. It is understandable that when cropping a high-resolution defect training image, the resolution of the last cropping is the target resolution, and the target resolution in this embodiment is 1500×1500 pixel resolution.

[0075] Further, in step S100, a 600×600 pixel window is used to slide and slice the high-resolution defect training image for training to obtain a 600×600 training image data set, and the 600×600 training image data set and the first preset negative sample data set are used for training and the model parameters are updated to obtain the training model 1; a 1000×1000 pixel window is used to slide and slice the high-resolution defect training image for training to obtain a 1000×1000 training image data set, and the 1000×1000 pixel data set and the second preset negative sample data set are used to train the model 1 After training the pre-trained model and updating the model parameters, the training model 2 is obtained; a 1500×1500 pixel window is used to slide and slice the high-resolution defect training image used for training to obtain a 1500×1500 training image data set, and a 1500×1500 pixel data set and a third preset negative sample data set are used to train the training model 2 as the pre-trained model and update the model parameters to obtain a small defect detection model; wherein, the target resolution is a pixel resolution of 1500×1500; if there is a defect target at the current position in the training image data set, the position is marked in the current image coordinate system of the current image. Specifically, the high-resolution image is cropped, and image data sets of different resolutions are constructed to prepare for subsequent model training, and the model is progressively trained based on data sets of different resolutions. The resolution of the power scene images collected by drones is usually very large, and some of the targets to be detected are extremely small. According to experiments, if the original image is directly used as training data to train the detection model, the detection effect for most targets in the power scene is very poor. Therefore, appropriate data preprocessing methods and model training strategies need to be adopted to solve the above problems.

[0076] Please refer to Figure 3In the present invention, in the specific implementation, a cropping method based on a sliding window is designed to slice the high-resolution defect training image, and a fixed-size window is set to slide and slice on the original image. If there is a target at the current position, it is recorded in a new annotation file. In addition, in order to ensure the recall rate of the final model, some pure background images are retained to add appropriate negative samples. In the existing training model, if a low-resolution (small-size) data set is used to train the model, the recognition effect is better, but it will lead to too high a number of detections of the whole image and low detection efficiency; if a higher-resolution (large-size) data set is directly used to train the model, the detection effect is not good. Therefore, the present invention adopts a progressive training method of data set resolution from small to large. First, training is performed based on a 600×600 training image data set to obtain training model 1, and then a 1000×1000 pixel data set is used to train model 1 as a pre-training model to obtain training model 2. Finally, a 1500×1500 pixel data set is used to train model 2 as a pre-training model to obtain a small defect detection model.

[0077] Furthermore, in step S104, a feature context enhancement module based on dilated convolution performs context enhancement processing on shallow features of the first three layers of the feature map output by the backbone network.

[0078] Please refer to Figure 4 and Figure 5 In the process of obtaining the fused feature map, ResNet50 is selected as the backbone network of the model to extract the original multi-scale feature information from the input image. There are many limitations in the feature information of the original feature map output by the backbone network. The high-level features are rich in semantic information but the resolution is too low to represent the feature information of small targets; the shallow feature maps have high resolution but lack semantic information and have too much noise. In the present invention, a feature enhancement module based on dilated convolution is designed to enhance the features in the original feature map obtained by the backbone network and fully extract the contextual information in the feature map. Specifically, since the high-level feature map has strong semantic feature information, only the shallow features of the first three layers are subjected to contextual enhancement.

[0079] Optionally, the feature context enhancement module is composed of a plurality of dilated convolutions with different dilation rates, and the dilated convolutions can fully extract the context information in the feature map.

[0080] Optionally, in order to fully retain target features of various scales while retaining higher semantic information, the obtained multi-level feature maps (multi-layer enhanced feature maps) are fused into higher resolution shallow feature maps to form fused feature maps. The fused feature maps contain both high-resolution detail feature information from the shallow feature maps and robust semantic information from the deep feature maps.

[0081] Specifically, the process of feature fusion is expressed as ,in, Represents the output fused feature map, is the feature map after context enhancement, represents a standard 3×3 convolution, is the batch normalization operation, represents the Relu activation function, is a learnable weight parameter, and n is the total number of feature maps in the feature fusion process. In the present invention, the multi-level feature maps are fused into the second-layer feature map in the feature fusion module, and the fused feature map contains both high-resolution detail feature information from the shallow feature map and robust semantic information from the deep feature map.

[0082] Furthermore, the process of multiplying the original feature map in the multi-level feature map with the predicted mask to obtain the output feature map is expressed as ,in, represents the fused feature map, F is the output feature map, represents 3×3 convolution and Relu modules, represents the Sigmoid function, represents the Hadamard product.

[0083] Furthermore, in step S106, a true value supervision mask is generated according to the current model training data set as supervision for the fused feature map; the fused feature map is passed through a module consisting of a convolution and an activation function to output a prediction mask; the original feature map in the multi-level feature map is multiplied by the prediction mask to obtain an output feature map; wherein the true value supervision mask is used to supervise the prediction mask, and the MSE loss of the two is calculated.

[0084] Please refer to Figure 6 In the specific implementation, a true value supervision mask is generated according to the original data set as the supervision of the enhanced feature map to suppress the background noise information in the feature map and further enhance the effective receptive field area of ​​the feature. In the existing methods, the parameter update of the model is usually achieved by the gradient back propagation of the error between the final prediction result and the true value. However, as the number of network parameters increases, this single method cannot achieve good learning for all parameters. In this regard, the present invention designs a feature supervision branch to supervise the fused features based on the true value generation mask, such as Figure 6 As shown. The fused feature map passes through a module composed of convolution and activation function, outputs the prediction mask, and then multiplies the original feature map with the prediction mask to obtain the output feature map. ,in, represents the fused feature map, F is the output feature map, represents 3×3 convolution and Relu modules, represents the Sigmoid function, Represents the Hadamard product. In addition, the true value mask generated by the true value supervises the predicted mask and calculates the MSE loss of the two. This loss will be used as part of the final loss and back-propagated to update the parameters. ,in is the predicted mask, is the mask generated based on the true value.

[0085] Please refer again Figure 4 , Figure 5 and Figure 6 , Figure 4 In the figure a, f4, f3, f2, and f1 are the multi-layer feature maps in step S103, and f4out, f3out, f2out, and f1out are the multi-layer feature maps in step S104. The multi-layer feature maps in step S104 are obtained by enhancing the multi-layer feature maps in S103. Figure 5 The enhanced feature map corresponding to the downsampling in is f1out, and the enhanced feature maps corresponding to the upsampling are f4out, f3out, and f2out.

[0086] Furthermore, the feature enhancement map is input into the feature screening module, and the scoring network is used to evaluate the feature information of each spatial position, and the top m% with higher scores and p% of irrelevant vectors are obtained as the screened key feature vectors, where m∈[15,25], . In the specific implementation, the above-mentioned feature map is input into the feature screening module, and a scoring network is used to evaluate the feature information of each spatial position, and the top 20% with higher scores are used as the screened feature vectors to participate in subsequent calculations. Through observation of the data, it is concluded that the targets in the power scene generally have the characteristics of small size and sparse distribution in the image, so most of the spatial areas in the feature map are background parts. In order to ensure the full retention of small target features, the present invention uses a shallow feature map with higher resolution as the input feature of the Transformer module in the end-to-end detection algorithm. Therefore, in order to reduce redundant calculations, the feature map is further processed. The present invention designs a scoring module to evaluate the enhanced feature map F in the above text, and only selects the top 20% of the feature vectors as the discriminative feature vectors based on the generated information score map, and then samples 10% from the remaining irrelevant vectors, and inputs them into the Transformer module together with the discriminative feature vectors for subsequent prediction. The structure of the scoring network and the feature sampling module is as follows. Figure 7 shown.

[0087] Furthermore, the key feature vector is input into the multi-layer encoder structure of the Transformer model for feature integration, and the prediction result is output using a multi-layer decoder based on the encoder output and the cross-attention technology. In this embodiment, the screened key feature vector is input into the multi-layer encoder structure of the Transformer for final feature integration, and then the prediction result is directly output using a multi-layer decoder based on the encoder output and the cross-attention technology. Finally, the prediction result is combined with the true value to calculate the classification loss and box regression loss, and together with the supervision loss, it constitutes the total loss, which is used to iteratively update the parameters of the entire model. The final prediction loss function includes category prediction loss, bounding box loss, and feature mask prediction loss. ,in They are classification loss, bounding box loss and feature prediction mask loss, respectively. are the weights of the three respectively. The cross entropy loss is adopted, and its formula is: ,in is the true value, is the prediction result of the model. SmoothL1 loss is used, and its formula is:

[0088]

[0089] After calculating the loss of the prediction results, the AdamW optimizer is used to iteratively optimize the model parameters to reduce model loss and improve accuracy.

[0090] The present invention also provides a defect small target detection system for high-resolution images of power scenes, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to perform the steps of the above-mentioned defect small target detection method for high-resolution images of power scenes. It should be understood by those skilled in the art that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0091] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for detecting small defective targets in high-resolution images of power scenes, characterized in that: Includes steps: S100, building a small defect detection model at target resolution; S200, cropping the current power equipment image with a target resolution to obtain multiple frames of current power image slices at the target resolution; S300, detecting the current power image slice based on the small defect detection model to obtain a defect detection result; S400, performing coordinate mapping processing on the frame coordinates of the defect detection result, and mapping the frame coordinates of the defect detection result to the current power equipment image; Wherein, step S100 specifically includes: S101, cropping high-resolution defect training images at different resolutions to obtain training image datasets at multiple resolutions; S102, determining the training image data set at the minimum resolution as the current model training data set; S103, loading the current model training data set into the power grid defect detection pre-training model, and outputting a multi-layer original feature map from the backbone network; S104, obtaining local context features based on the feature context enhancement module of the dilated convolution to enhance the shallow feature maps in the multi-layer original feature maps output by the backbone network to obtain multi-layer enhanced feature maps; S105, fusing the multi-layer enhanced feature maps into the high-level feature maps in the multi-layer original feature maps to form a fused feature map; S106, generating a true value supervision mask according to the current model training data set, supervising the fused feature map based on the true value supervision mask to obtain a feature enhancement map, and obtaining a mask supervision loss based on the true value supervision mask and the predicted mask; S107, input the feature enhancement map into the feature screening module, use the scoring network to evaluate the feature information of each spatial position, and obtain the top m% with higher scores and p% of irrelevant vectors as the screened key feature vectors, where: ,in ; S108, inputting the key feature vector into the multi-layer encoder structure of the Transformer model for feature integration, and outputting the prediction result using the multi-layer decoder based on the output of the encoder and the cross attention technology; S109, comparing the prediction result with the true value of the label to calculate the classification loss and the box regression loss, and the classification loss, the box regression loss and the mask supervision loss together constitute the total loss, and updating the model parameters of the power grid defect detection pre-training model after back propagation; S110, repeating steps S103 to S109 for multiple rounds of training until a preset termination condition is met; S111, determine whether the training of all training image data sets is completed. If the training of all training image data sets is not completed, obtain a training image data set with better resolution and enter step S103 until the training of the training image data set corresponding to the target resolution is completed; if the training of all training image data sets is completed, determine that the pre-trained model with updated model parameters is a small defect detection model.

2. The defect small target detection method for high-resolution images of power scenes according to claim 1 is characterized in that: In step S100, A 600×600 pixel window is used to slide and slice the high-resolution defect training image for training to obtain a 600×600 training image dataset, and a training model 1 is obtained after training with the 600×600 training image dataset and the first preset negative sample dataset and updating the model parameters; A 1000×1000 pixel window is used to slide and slice the high-resolution defect training image for training to obtain a 1000×1000 training image dataset, and the 1000×1000 pixel dataset and the second preset negative sample dataset are used to train the training model 1 as the pre-training model and update the model parameters to obtain the training model 2; A 1500×1500 pixel window is used to slide and slice the high-resolution defect training image used for training to obtain a 1500×1500 training image dataset, and the 1500×1500 pixel dataset and the third preset negative sample dataset are used to train the training model 2 as the pre-training model and update the model parameters to obtain a small defect detection model; Wherein, the target resolution is a pixel resolution of 1500×1500; If there is a defective target at the current position in the training image data set, the position is marked in the current image coordinate system of the current image.

3. The defect small target detection method for high-resolution images of power scenes according to claim 1 is characterized in that: In step S104, The feature context enhancement module based on dilated convolution performs context enhancement on the shallow features of the first three layers of the feature map output by the backbone network.

4. The defect small target detection method for high-resolution images of power scenes according to claim 1 is characterized in that: In step S105, The process of feature fusion is expressed as , in, Represents the output fused feature map, is the feature map after context enhancement, represents a standard 3×3 convolution, is the batch normalization operation, represents the Relu activation function, is the learnable weight parameter, and n is the total number of feature maps in the process of feature fusion.

5. The defect small target detection method for high-resolution images of power scenes according to claim 4 is characterized in that: In step S106, Generate a true value supervision mask based on the current model training data set as supervision for the fused feature map; The fused feature map passes through a module consisting of convolution and activation function, and outputs the predicted mask; Multiply the original feature map in the multi-level feature map with the predicted mask to obtain the output feature map; Among them, the true value supervision mask is used to supervise the predicted mask, and the MSE loss of the two is calculated.

6. The defect small target detection method for high-resolution images of power scenes according to claim 5 is characterized in that: The process of multiplying the original feature map in the multi-level feature map with the predicted mask to obtain the output feature map is expressed as , in, represents the fused feature map, F is the output feature map, represents 3×3 convolution and Relu modules, represents the Sigmoid function, represents the Hadamard product.

7. The defect small target detection method for high-resolution images of power scenes according to claim 1 is characterized in that: Using formula Calculate the total loss, where They are classification loss, box regression loss and mask supervision loss respectively. are the weights of classification loss, box regression loss and mask supervision loss respectively.

8. The defect small target detection method for high-resolution images of power scenes according to claim 1 is characterized in that: If the number of rounds of training reaches the preset number, it is determined that the preset termination condition is met.

9. A small defect detection system for high-resolution images of power scenes, characterized by: The method comprises a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the steps of the method for detecting small defective targets in high-resolution images of power scenes as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Target detection method based on multi-scale attention

    CN115620127A

  • Pedestrian detection method and system, electronic equipment and readable medium

    CN116453154A