Power grid defect detection method and device based on visual detection
By preprocessing the grid defect image data and improving the target detection network, the problem of poor practicality of the defect detection model in the prior art is solved, and efficient and accurate grid defect detection is achieved.
Patent Information
- Application Number
- CN202510165860.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art does not consider the characteristics of the image data when processing drone patrol image data, resulting in poor practicality of the defect detection model.
By preprocessing the grid defect image data, the training set and verification set are constructed, and the target detection network is improved based on the visual detection characteristics of the grid defect image to obtain the defect detection model. The model can fully learn the characteristics of each defect during the training process, and improve detection efficiency and accuracy.
It significantly improves the practicality of the defect detection model, ensures the effectiveness and adaptability of the model, and can quickly and accurately detect defect images in the power grid.
Smart Images

Figure CN120107188A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent inspection of electric power systems, and in particular to a method and device for detecting defects in an electric power grid based on visual inspection. Background Art
[0002] As the power system works for a long time, important facilities such as high-voltage transmission lines and substations are facing the impact of defects such as foreign matter adhesion, corrosion and rust. When the defects are serious, they may even cause the power system to fail to operate normally. In addition, if the power system is inspected for defects, there will be blind spots in high places and hidden corners, making it difficult to fully detect hidden dangers. To address these problems, the existing technology uses visual target detection technology that combines drones with computers. However, the working environment of high-voltage transmission lines and substations is complex, which leads to low efficiency of visual target detection technology when processing image data collected by drones.
[0003] Chinese patent, publication number: CN117496223A, publication date: February 2, 2024, discloses a lightweight insulator defect detection method and device based on deep learning, including: collecting sample images of insulators, annotating existing images, and then expanding sample images and automatically generating corresponding labels to construct a data set; randomly dividing the data set into a training set, a validation set and a test set; building a defective insulator detection model in an improved YOLOv5 model, training the training set to obtain a FA-YOLOv5 model, obtaining an evaluation model based on the validation set, and inputting the test set into the evaluation model to output the insulator defect detection result; and when building the defective insulator detection model, the invention has achieved the purpose of improving the model calculation efficiency by reducing the model weight and parameter compression model, but this results in poor practicality of the defective insulator detection model. Summary of the invention
[0004] The purpose of the present invention is to address the problem that the prior art does not consider the characteristics of the image data when processing drone inspection image data, resulting in poor practicality of the corresponding model; a power grid defect detection method and device based on visual detection are proposed, and a defect detection model is obtained by improving the target detection network based on the visual detection characteristics of the power grid defect image, which can ensure the effectiveness of the defect detection model, and pre-process the power grid defect image data to obtain a training set and a verification set. The training set is used to train the defect detection model to improve the comprehensive performance of the defect detection model, and the verification set is used to verify the defect detection model to ensure that the defect detection model fits the actual working conditions when the drone inspection takes images. The real-time operation data of the power grid can be quickly detected to find accurate defect images, which significantly improves the practicality of the defect detection model.
[0005] In a first aspect, a technical solution provided in an embodiment of the present invention is a method for detecting power grid defects based on visual detection, comprising the following steps: Preprocess the acquired power grid defect image data to obtain a training set and a verification set; The defect detection model is obtained by improving the target detection network based on the visual detection features of the power grid defect image. The training set is used as the input of the defect detection model for iterative training, and the performance of the defect detection model after iterative training is verified based on the verification set to obtain a power grid defect detection model; The real-time operation image data of the power grid is collected, and the real-time operation image data of the power grid is input into the power grid defect detection model to obtain the defect image.
[0006] In this scheme, the acquired power grid defect image data is preprocessed to obtain a training set and a verification set, and different types of defects in the power grid defect image data can be classified and processed, which is convenient for judging the number of images of different types of defects, and then the number of defect images that are too small is expanded in a targeted manner, so that the number of images of each defect meets the training requirements of the defect detection model. The defect detection model can fully learn the characteristics of each defect during the training process, effectively improve the efficiency and accuracy of the defect detection model when processing the same type of defect image again, and significantly improve the practicality of the defect detection model; select a suitable aggregation network structure based on the visual detection characteristics of the power grid defect image, A convolutional network structure, a target decoupling head and a loss function are used, and the feature module of the target detection network is trimmed by using the aggregation network structure and the convolutional network structure, the decoupling head of the target detection network is trimmed by using the target decoupling head, and the bounding box loss function of the target detection network is trimmed by using the loss function to obtain a defect detection model, thereby ensuring the effectiveness of the defect detection model and effectively improving the fitness of the power grid defect image data taken by drone inspections and the defect detection model; the performance of the iteratively trained defect detection model is verified based on the verification set to obtain a power grid defect detection model, which can ensure the effect of the iterative training process of the defect detection model and prevent the defect detection model from being overfitted or underfitted.
[0007] Preferably, the specific process of preprocessing the acquired power grid defect image data to obtain the training set and the verification set is: Based on the defect types, the power grid defect image data is quantitatively analyzed to obtain a classified image set, and the features of the images in the classified image set are extracted to obtain defect image features; Expanding the classified image set based on defect image features and quantity thresholds to obtain an expanded image set; The images in the expanded image set are annotated, and the annotated expanded image set is divided into a training set and a validation set based on a preset division ratio.
[0008] In this solution, images can be annotated manually, so that the corresponding defect detection model can more accurately learn the characteristics of different defects in the image data. The corresponding defect detection model can also better adapt to the needs of taking images in different working scenes during drone inspections, effectively improve the utilization rate of the image data, and avoid wasting the computing resources of the corresponding defect detection model on invalid or redundant information.
[0009] Preferably, the specific process of expanding the classified image set based on the defect image features and the quantity threshold to obtain the expanded image set is: Based on the quantity threshold, the image data in the classification image set are filtered to obtain a small number of image sets, and the images in the small number of image sets are divided into a first small number of image sets and a second small number of image sets based on defect image features; Performing an expansion operation on the images in the first small set of images based on a first expansion criterion to obtain a first expanded image subset; Based on the second expansion criterion, the image operation in the second small image set is expanded to obtain a second expanded image subset; the first expanded image subset, the second expanded image subset and the classified image set are sorted to obtain an expanded image set.
[0010] In this scheme, image data in a classified image set is screened based on a quantity threshold, and all image data in the classified image set whose quantity is less than the quantity threshold is found in units of categories. For example, if the classified image set includes a first category of images and a second category of images, wherein the quantity of the first category of images is less than the quantity threshold and the second category of image data is greater than or equal to the quantity threshold, the first category of images is marked as a small number of image sets; in addition, the defects contained in the image data are divided into removable defects and non-removable defects. When the defects in the image data are non-removable defects, a first expansion criterion is selected to expand them, specifically, one of rotation, mirroring or cropping is randomly selected to operate on the image, so as to achieve the purpose of data set expansion. When the defects in the image data are removable defects, a second expansion criterion is selected to expand them, specifically, the defects in the image are cut out, and then the style of the defects is expanded through the GAN generation method. Finally, the defects and the parts of the image that do not contain defects, or the same category of images that do not contain defects are spliced to achieve the purpose of data set expansion.
[0011] Preferably, the specific process of performing an expansion operation on the images in the first small number of image sets based on the first expansion criterion to obtain the first expanded image subset is: Randomly select an enhancement method, where the enhancement method at least includes rotation, mirroring, and cropping; When the enhancement method is rotation, rotating the images in the first small number of image sets to obtain rotated images; When the enhancement method is mirroring, mirroring the images in the first small number of image sets to obtain mirror images; When the enhancement method is cropping, cropping the images in the first small number of image sets to obtain cropped images; The rotated images, mirror images, cropped images and a small number of image sets are sorted to obtain a first expanded image subset.
[0012] Preferably, the specific process of performing an expansion operation on the images in the second small number of image sets based on the second expansion criterion to obtain the second expanded image subset is: Cutting the images in the second small number of image sets to obtain a defect atlas and a background atlas, and obtaining images of the same type as the images and without defects to obtain a defect-free image set; Defect expansion is performed based on the GAN generation method and defect atlas to obtain a defect expansion atlas; Image stitching is performed based on the defect extended atlas, the background atlas and the defect-free image set to obtain a second extended image subset.
[0013] Preferably, the specific process of improving the target detection network based on the visual detection features of the power grid defect image to obtain the defect detection model is as follows: Feature selection aggregation network structure, convolutional network structure, target decoupling head and loss function based on visual inspection of power grid defect images; Based on the aggregate network structure, the feature module in the target detection network is improved to obtain an aggregate feature module; Based on the convolutional network structure, the feature module in the target detection network is improved to obtain the convolutional feature module; Based on the target decoupling head, the decoupling head in the target detection network is improved to obtain a lightweight decoupling head. Based on the loss function, the bounding box loss function in the target detection network is improved to obtain a new bounding box loss function; The defect detection model is obtained by integrating the target detection network, the aggregation feature module, the convolution feature module, the lightweight decoupling head and the new bounding box loss function.
[0014] Preferably, the specific process of using the training set as the input of the defect detection model for iterative training is: A1. Adjust the training set based on the preset training batch to obtain a small batch training set, and initialize the parameter combination of the defect detection model; A2. Based on the training parameters, the small batch training set is input into the initialized defect detection model to obtain the training detection results; A3, calculating a training loss value according to the training detection result and a new bounding box loss function of the defect detection model; A4. Back-propagating and updating the parameter combination of the defect detection model based on the training loss value; Synchronously, whether to end the iterative training is determined based on the training loss value and the loss value threshold. If the training loss value is greater than or equal to the loss value threshold, it is determined to continue the iterative training and execute A1. If the training loss value is less than the loss value threshold, it is determined to end the iterative training and output the defect detection model corresponding to the training loss value.
[0015] Preferably, in the process of iteratively training the defect detection model using the training set as input, the training data of the defect detection model is stored in real time; The training data at least includes parameter combinations, training loss values, training test results and small batch training sets.
[0016] In this solution, the training data of the defect detection model is stored in real time, and the defect detection model can be reversed. When actual working conditions require, data characteristics change, etc., the corresponding model parameters can be directly extracted from the training data to adjust the defect detection model, thereby effectively improving the efficiency of the defect detection model in the face of complex image data and complex working conditions.
[0017] Preferably, the specific process of obtaining the power grid defect detection model by verifying the performance of the iteratively trained defect detection model based on the verification set is: Inputting the verification set into the iteratively trained defect detection model to obtain a verification test result, and calculating a verification index based on the verification test result and a verification index formula; Whether the performance of the defect detection model is qualified is judged based on the verification index and the index baseline. If the verification index is greater than the index baseline, the performance of the defect detection model is judged to be unqualified. If the verification index is less than or equal to the index baseline, the performance of the defect detection model is judged to be qualified, and the defect detection model with qualified performance is marked as a power grid defect detection model.
[0018] In a second aspect, a technical solution also provided in an embodiment of the present invention is a power grid defect detection device based on visual detection, comprising: a data processing module, a target detection module; The data processing module preprocesses the acquired power grid defect image data, and transmits the preprocessed power grid defect image data to the target detection module; The target detection module performs target detection on the input power grid defect image data based on the defect detection model and outputs the target detection result.
[0019] Beneficial effects of the present invention: (1) The present application pre-processes the acquired power grid defect image data to obtain a training set and a verification set, and can classify and process different types of defects in the power grid defect image data, so as to facilitate the determination of the number of images of different types of defects, and then specifically expand the number of defect images that are too small, so that the number of images of each defect meets the training requirements of the defect detection model. The defect detection model can fully learn the characteristics of each defect during the training process, effectively improve the efficiency and accuracy of the defect detection model when processing the same type of defect image again, and significantly improve the practicality of the defect detection model; (2) Based on the visual detection features of power grid defect images, the present application improves the corresponding structure of the target detection network to obtain a defect detection model, thereby ensuring the effectiveness of the defect detection model and effectively improving the adaptability of the power grid defect image data taken by drone inspections to the defect detection model; (3) The present application stores the training data of the defect detection model in real time and can perform reverse operations on the defect detection model. When actual working conditions, data feature changes, etc. occur, the corresponding model parameters can be directly extracted from the training data to adjust the defect detection model, thereby effectively improving the efficiency of the defect detection model in the face of complex image data and complex working conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only for the purpose of illustrating preferred embodiments and are not to be considered as limiting the present invention. Also, the same reference symbols are used throughout the drawings to represent the same parts.
[0021] Figure 1 A schematic diagram of a flow chart of a method for detecting power grid defects based on visual detection according to the present invention; Figure 2 It is a structural schematic diagram of a power grid defect detection device based on visual detection according to the present invention. DETAILED DESCRIPTION
[0022] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation method described herein is only an optimal embodiment of the present invention, which is only used to explain the present invention and does not limit the scope of protection of the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0023] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the drawings; the process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0024] Embodiment 1: like Figure 1 As shown, this embodiment provides a power grid defect detection method based on visual detection, comprising the following steps: Preprocess the acquired power grid defect image data to obtain a training set and a verification set; Specifically, a quantitative analysis is performed on the power grid defect image data based on the defect type to obtain a classified image set, and features of the images in the classified image set are extracted to obtain defect image features; Expanding the classified image set based on defect image features and quantity thresholds to obtain an expanded image set; Specifically, image data in the classified image set is filtered based on a quantity threshold to obtain a small number of image sets, and images in the small number of image sets are divided into a first small number of image sets and a second small number of image sets based on defect image features; Performing an expansion operation on the images in the first small set of images based on a first expansion criterion to obtain a first expanded image subset; Performing an expansion operation on the images in the second small image set based on a second expansion criterion to obtain a second expanded image subset; arranging the first expanded image subset, the second expanded image subset and the classified image set to obtain an expanded image set; Specifically, the process of performing an expansion operation on the images in the first small number of image sets based on the first expansion criterion to obtain the first expanded image subset is: Randomly select an enhancement method, where the enhancement method at least includes rotation, mirroring, and cropping; When the enhancement method is rotation, rotating the images in the first small number of image sets to obtain rotated images; When the enhancement method is mirroring, mirroring the images in the first small number of image sets to obtain mirror images; When the enhancement method is cropping, cropping the images in the first small number of image sets to obtain cropped images; Arranging the rotated images, mirror images, cropped images and a small number of image sets to obtain a first expanded image subset; Specifically, the process of performing an expansion operation on the images in the second small number of image sets based on the second expansion criterion to obtain the second expanded image subset is: Cutting the images in the second small number of image sets to obtain a defect atlas and a background atlas, and obtaining images of the same type as the images and without defects to obtain a defect-free image set; Defect expansion is performed based on the GAN generation method and defect atlas to obtain a defect expansion atlas; Performing image stitching based on the defect extended atlas, the background atlas, and the defect-free image set to obtain a second extended image subset; The images in the expanded image set are annotated, and the annotated expanded image set is divided into a training set and a validation set based on a preset division ratio.
[0025] In this embodiment, in order to address the problems of many types of defects and low image resolution in the real environment, at least 10,000 images of high-voltage transmission lines and substations are obtained through methods such as drone field photography and online search, and then the 10,000 images are screened based on clarity and defect types to leave 4,000 images. The defect types are set based on actual inspection requirements, and include at least ten types: missing insulators, flashover insulators, broken insulators, pole tower cracks, bird nests, foreign matter, rust, substation oil leakage, loose wire strands, and anti-vibration hammer defects. The image data at this time has roughly met the requirements, but the image data of some types account for a larger proportion, such as insulators and bird nests, while the image data of types such as pole tower cracks account for too small a proportion, which makes it inconvenient for the defect detection model to comprehensively learn the defect features of all types. Based on this, for types with too few numbers, that is, types with image data less than the number threshold, the defects contained in the image are selected based on whether they can be stripped. The image data whose number is less than the number threshold is divided into peelable images and non-peelable images. For example, when the defect is close to the main color in the image, it is a non-peelable image. When the image data is non-peelable image data, one of the rotation, mirroring or cropping methods is randomly selected to expand the image data. When the image data is peelable image data, the defects in the image are first extracted by the image cutting method, and then the extracted defects are expanded by the GAN generation method. Finally, the defects and the parts of the image that do not contain defects, or the same type of images that do not contain defects are spliced by the image stitching method to achieve image data expansion. At the same time, the expanded image data is manually annotated by the LabelImg tool, and the annotated image data is divided into a training set and a verification set in a ratio of 8:2, wherein the training set accounts for 80% and the verification set accounts for 20%.
[0026] The defect detection model is obtained by improving the target detection network based on the visual detection features of the power grid defect image. Specifically, the visual detection features of power grid defect images are used to select the aggregation network structure, convolutional network structure, target decoupling head and loss function; Based on the aggregate network structure, the feature module in the target detection network is improved to obtain an aggregate feature module; Based on the convolutional network structure, the feature module in the target detection network is improved to obtain the convolutional feature module; Based on the target decoupling head, the decoupling head in the target detection network is improved to obtain a lightweight decoupling head. Based on the loss function, the bounding box loss function in the target detection network is improved to obtain a new bounding box loss function; The defect detection model is obtained by integrating the target detection network, the aggregation feature module, the convolution feature module, the lightweight decoupling head and the new bounding box loss function.
[0027] In this embodiment, YOLOv5s is selected as the baseline model of the defect detection model after comprehensive consideration of performance, computational complexity, and actual engineering deployment. In order to improve the efficiency and accuracy of defect detection by YOLOv5s, the C3 module in the neck structure of YOLOv5s and part of the C3 modules in the backbone network are replaced with RepNCSPELAN4 modules using the aggregation network structure GELAN. The aggregation network structure GELAN is based on the Efficient Layer Aggregation Based on the YOLOv5s Decoupling Head (ELAN), the function of the ELAN, which originally only used stacked convolutional layers, was extended to a new architecture that can use any fast calculation; the anchor-free decoupling head of YOLOX was used as the target decoupling head to simplify the decoupling head of YOLOv5s to obtain a lightweight decoupling head. Specifically, the 1×1Conv dimension reduction convolution in the YOLOv5s decoupling head was deleted, the dimension of the detection head was scaled by the width coefficients of the trunk and the neck, and the extra 3×3 CBS convolution module in the two branches was deleted; the convolutional network structure PConv was used to replace the last two C3 modules of the YOLOv5s backbone network with FasterNet to reduce computational redundancy and reduce memory access. The working principle of the convolutional network structure PConv is: apply conventional Conv to a part of the input channel for spatial feature extraction, and keep the remaining channels unchanged. For continuous or regular memory access, the first or last A continuous channel is regarded as the representative of the entire feature map for calculation. Without losing generality, the input and output feature maps are considered to have the same number of channels, that is, only part of the channels of the input data are convolved, while the remaining channels remain as they are, and point-by-point convolution is performed subsequently to allow the feature information to flow through all channels to avoid information loss; the bounding box loss function CIOU in YOLOv5s is also changed to a new bounding box loss function EIOU to address the limitations of the bounding box loss function CIOU, such as the penalty term for the aspect ratio may be zero, and the penalty term only reflects the aspect ratio difference rather than the actual difference in width and height confidence. The new bounding box loss function EIOU includes three parts: IOU loss, distance loss, and height-width loss. Compared with the bounding box loss function CIOU which only considers the center point distance and aspect ratio, the addition of height-width loss in the new bounding box loss function EIOU alleviates the problem of comparing the actual difference in width and height between the target and the anchor box.
[0028] The training set is used as the input of the defect detection model for iterative training, and the performance of the defect detection model after iterative training is verified based on the validation set to obtain the power grid defect detection model.
[0029] In one embodiment, the specific process of using the training set as the input of the defect detection model for iterative training is: A1. Adjust the training set based on the preset training batch to obtain a small batch training set, and initialize the parameter combination of the defect detection model; A2. Based on the training parameters, the small batch training set is input into the initialized defect detection model to obtain the training detection results; A3, calculating a training loss value according to the training detection result and a new bounding box loss function of the defect detection model; A4. Back-propagating and updating the parameter combination of the defect detection model based on the training loss value; Synchronously, whether to end the iterative training is determined based on the training loss value and the loss value threshold. If the training loss value is greater than or equal to the loss value threshold, it is determined to continue the iterative training and execute A1. If the training loss value is less than the loss value threshold, it is determined to end the iterative training and output the defect detection model corresponding to the training loss value.
[0030] In this embodiment, the training batch is set to 16, and the training parameters include at least an initial learning rate set to 0.01, an initialization momentum set to 0.937, and a weight decay coefficient set to 0.0005. In addition, mosaic data enhancement and cutout data enhancement are enabled during the training process, and the size of the image data is strictly controlled to 640×640 pixels. A total of 150 epochs are trained to avoid the occurrence of local optimal situations. The training parameters can also be adjusted accordingly according to actual needs.
[0031] In one embodiment, during the process of iteratively training the defect detection model using the training set as input, the training data of the defect detection model is stored in real time; The training data at least includes parameter combinations, training loss values, training test results and small batch training sets.
[0032] In this embodiment, the training data of the defect detection model is stored in real time, and the defect detection model can be reversed. When actual working conditions require, data characteristics change, etc., the corresponding model parameters can be directly extracted from the training data to adjust the defect detection model, thereby effectively improving the efficiency of the defect detection model in the face of complex image data and complex working conditions.
[0033] In one embodiment, the specific process of obtaining the power grid defect detection model by verifying the performance of the iteratively trained defect detection model based on the verification set is: Inputting the verification set into the iteratively trained defect detection model to obtain a verification test result, and calculating a verification index based on the verification test result and a verification index formula; Whether the performance of the defect detection model is qualified is judged based on the verification index and the index baseline. If the verification index is greater than the index baseline, the performance of the defect detection model is judged to be unqualified. If the verification index is less than or equal to the index baseline, the performance of the defect detection model is judged to be qualified, and the defect detection model with qualified performance is marked as a power grid defect detection model.
[0034] In this embodiment, the verification indicators at least include precision P, recall rate R, average precision mAP for all categories, floating-point operations per second GFLOPs, F1 indicator and frames per second FPS. The indicator baseline is the indicator threshold set according to actual working conditions. In view of the fact that the calculation formula of the verification indicator is a prior art, no specific limitation is made in this embodiment; the precision P measures the accuracy of the theoretical model prediction, the recall rate R measures the model's detection ability for positive samples, the average precision mAP for all categories directly reflects the performance of the model, the floating-point operations per second GFLOPs shows the complexity of the model, the F1 indicator is an indicator for measuring the accuracy of the binary classification model, and takes into account the precision and recall of the classification model at the same time, and the frames per second FPS represents the number of milliseconds required for single image detection.
[0035] The real-time operation image data of the power grid is collected, and the real-time operation image data of the power grid is input into the power grid defect detection model to obtain the defect image.
[0036] Second, as Figure 2 As shown, a technical solution also provided in the embodiment of the present invention is a power grid defect detection device based on visual detection, comprising: a data processing module, a target detection module; The data processing module preprocesses the acquired power grid defect image data, and transmits the preprocessed power grid defect image data to the target detection module; The target detection module performs target detection on the input power grid defect image data based on the defect detection model and outputs the target detection result.
[0037] This embodiment has at least the following substantial effects: (1) The present application pre-processes the acquired power grid defect image data to obtain a training set and a verification set, and can classify and process different types of defects in the power grid defect image data, so as to facilitate the determination of the number of images of different types of defects, and then specifically expand the number of defect images that are too small, so that the number of images of each defect meets the training requirements of the defect detection model. The defect detection model can fully learn the characteristics of each defect during the training process, effectively improve the efficiency and accuracy of the defect detection model when processing the same type of defect image again, and significantly improve the practicality of the defect detection model; (2) Based on the visual detection features of power grid defect images, the present application improves the corresponding structure of the target detection network to obtain a defect detection model, thereby ensuring the effectiveness of the defect detection model and effectively improving the adaptability of the power grid defect image data taken by drone inspections to the defect detection model; (3) The present application stores the training data of the defect detection model in real time and can perform reverse operations on the defect detection model. When actual working conditions, data feature changes, etc. occur, the corresponding model parameters can be directly extracted from the training data to adjust the defect detection model, thereby effectively improving the efficiency of the defect detection model in the face of complex image data and complex working conditions.
[0038] The above specific embodiments are preferred embodiments of the present invention, and are not intended to limit the specific implementation scope of the present invention. The scope of the present invention includes but is not limited to the present specific embodiments. All equivalent changes made in accordance with the shape, structure, and method of the present invention are within the protection scope of the present invention.
Claims
1. A method for detecting power grid defects based on visual inspection, characterized in that: The method comprises the following steps: Preprocess the acquired power grid defect image data to obtain a training set and a verification set; The defect detection model is obtained by improving the target detection network based on the visual detection features of the power grid defect image. The training set is used as the input of the defect detection model for iterative training, and the performance of the defect detection model after iterative training is verified based on the verification set to obtain a power grid defect detection model; The real-time operation image data of the power grid is collected, and the real-time operation image data of the power grid is input into the power grid defect detection model to obtain the defect image.
2. A method for detecting power grid defects based on visual detection according to claim 1, characterized in that: The specific process of preprocessing the acquired power grid defect image data to obtain the training set and the verification set is as follows: Based on the defect types, the power grid defect image data is quantitatively analyzed to obtain a classified image set, and the features of the images in the classified image set are extracted to obtain defect image features; Expanding the classified image set based on defect image features and quantity thresholds to obtain an expanded image set; The images in the expanded image set are annotated, and the annotated expanded image set is divided into a training set and a validation set based on a preset division ratio.
3. A method for detecting power grid defects based on visual detection according to claim 2, characterized in that: The specific process of expanding the classified image set based on the defect image features and quantity threshold to obtain the expanded image set is: Based on the quantity threshold, the image data in the classification image set are filtered to obtain a small number of image sets, and the images in the small number of image sets are divided into a first small number of image sets and a second small number of image sets based on defect image features; Performing an expansion operation on the images in the first small set of images based on a first expansion criterion to obtain a first expanded image subset; Performing an expansion operation on the images in the second small image set based on a second expansion criterion to obtain a second expanded image subset; The first expanded image subset, the second expanded image subset and the classified image set are sorted to obtain an expanded image set.
4. A method for detecting power grid defects based on visual detection according to claim 3, characterized in that: The specific process of performing an expansion operation on the images in the first small image set based on the first expansion criterion to obtain the first expanded image subset is: Randomly select an enhancement method, where the enhancement method at least includes rotation, mirroring, and cropping; When the enhancement method is rotation, rotating the images in the first small number of image sets to obtain rotated images; When the enhancement method is mirroring, mirroring the images in the first small number of image sets to obtain mirror images; When the enhancement method is cropping, cropping the images in the first small number of image sets to obtain cropped images; The rotated images, mirror images, cropped images and a small number of image sets are sorted to obtain a first expanded image subset.
5. The method for detecting power grid defects based on visual detection according to claim 3, characterized in that: The specific process of performing an expansion operation on the images in the second small image set based on the second expansion criterion to obtain the second expanded image subset is: Cutting the images in the second small number of image sets to obtain a defect atlas and a background atlas, and obtaining images of the same type as the images and without defects to obtain a defect-free image set; Defect expansion is performed based on the GAN generation method and defect atlas to obtain a defect expansion atlas; Image stitching is performed based on the defect extended atlas, the background atlas and the defect-free image set to obtain a second extended image subset.
6. A method for detecting power grid defects based on visual detection according to claim 1, characterized in that: The specific process of improving the target detection network based on the visual detection features of the power grid defect image to obtain the defect detection model is as follows: Feature selection aggregation network structure, convolutional network structure, target decoupling head and loss function based on visual inspection of power grid defect images; Based on the aggregate network structure, the feature module in the target detection network is improved to obtain an aggregate feature module; Based on the convolutional network structure, the feature module in the target detection network is improved to obtain the convolutional feature module; Based on the target decoupling head, the decoupling head in the target detection network is improved to obtain a lightweight decoupling head. Based on the loss function, the bounding box loss function in the target detection network is improved to obtain a new bounding box loss function; The defect detection model is obtained by integrating the target detection network, the aggregation feature module, the convolution feature module, the lightweight decoupling head and the new bounding box loss function.
7. A method for detecting power grid defects based on visual detection according to claim 1, characterized in that: The specific process of iterative training using the training set as the input of the defect detection model is as follows: A1. Adjust the training set based on the preset training batch to obtain a small batch training set, and initialize the parameter combination of the defect detection model; A2. Based on the training parameters, the small batch training set is input into the initialized defect detection model to obtain the training detection results; A3, calculating a training loss value according to the training detection result and a new bounding box loss function of the defect detection model; A4. Back-propagating and updating the parameter combination of the defect detection model based on the training loss value; Synchronously, whether to end the iterative training is determined based on the training loss value and the loss value threshold. If the training loss value is greater than or equal to the loss value threshold, it is determined to continue the iterative training and execute A1. If the training loss value is less than the loss value threshold, it is determined to end the iterative training and output the defect detection model corresponding to the training loss value.
8. The method for detecting power grid defects based on visual detection according to claim 5, characterized in that: In the process of iterative training using the training set as the input of the defect detection model, the training data of the defect detection model is stored in real time; the training data at least includes parameter combinations, training loss values, training detection results and small batch training sets.
9. The method for detecting power grid defects based on visual detection according to claim 1, characterized in that: The specific process of obtaining the power grid defect detection model by verifying the performance of the iteratively trained defect detection model based on the verification set is as follows: Inputting the verification set into the iteratively trained defect detection model to obtain a verification test result, and calculating a verification index based on the verification test result and a verification index formula; Whether the performance of the defect detection model is qualified is judged based on the verification index and the index baseline. If the verification index is greater than the index baseline, the performance of the defect detection model is judged to be unqualified. If the verification index is less than or equal to the index baseline, the performance of the defect detection model is judged to be qualified, and the defect detection model with qualified performance is marked as a power grid defect detection model.
10. A power grid defect detection device based on visual detection, characterized in that: Including: data processing module, target detection module; The data processing module preprocesses the acquired power grid defect image data, and transmits the preprocessed power grid defect image data to the target detection module; The target detection module performs target detection on the input power grid defect image data based on the defect detection model and outputs the target detection result.
Citation Information
Patent Citations
Light-weight insulator defect detection method and device based on deep learning
CN117496223A