Insulator defect detection method, system, electronic device and readable storage medium

By using a multi-head self-attention encoding and decoding model combined with a deep convolutional neural network in the power grid scenario to extract insulator detection and defect detection features, the problem of insufficient insulator defect detection accuracy in power grid aerial images is solved and efficient insulator detection is achieved.

CN113298789BActive Publication Date: 2024-08-30POWER RES INST OF STATE GRID SHAANXI ELECTRIC POWER CO LTD +3
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110592644.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-28
Publication Date
2024-08-30
Estimated Expiration
2041-05-28

AI Technical Summary

Technical Problem

In the existing technology, the accuracy of the insulator defect detection model in UAV aerial images in the power grid scenario is insufficient, and the features of the insulator defect images are not obvious, which increases the difficulty of detection.

Method used

A coding and decoding model based on multi-head self-attention is used, combined with a deep convolutional neural network, to design insulator detection and foreground segmentation modules. The multi-head self-attention mechanism and feed-forward network are used to extract image features, perform insulator target detection and defect detection, and build a unified The self-attention stacking model is trained end-to-end.

Benefits of technology

It improves the accuracy and efficiency of insulator detection, reduces post-processing steps, and avoids the need to manually set candidate frames. It is suitable for complex aerial image scenes in power grid scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113298789B
    Figure CN113298789B
Patent Text Reader

Abstract

The present invention discloses an insulator defect detection method, system, electronic device and readable storage medium. The insulator defect detection method comprises the following steps: inputting the detected power grid aerial image into a pre-trained insulator defect detection model, and outputting the insulator defect detection result of the detected power grid aerial image through the pre-trained insulator defect detection model; the insulator defect detection model comprises: an insulator detection and foreground segmentation module, which is used to obtain a regional image containing only insulators according to the input power grid aerial image; an insulator defect detection module, which is used to determine whether the insulator has defects and output the insulator defect detection result according to the obtained regional image containing only insulators by using an image classification network based on multi-head self-attention. The present invention can complete the classification task of insulator defect detection of power grid aerial images, and can specifically solve the technical problem of model accuracy in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image object detection, and relates to the field of insulator defect detection in power grid scenarios, and in particular to an insulator defect detection method, system, electronic device and readable storage medium. Background Art

[0002] With the rapid development of smart grids, the monitoring and maintenance of grid system security has become increasingly important. In the inspection equipment of power grids, insulators are used in large quantities and in many types. They mainly play the role of electrical insulation and mechanical fixation. They are also fault-prone components. Therefore, defect detection of insulators is a key link in maintaining the security of the power grid and requires special attention. Thanks to the vigorous development of drone intelligent inspection and computer vision technology, defect detection based on aerial images has become a reality.

[0003] At present, due to the lack of aerial image datasets of power grids, the research on insulator defect detection models based on aerial data has not been carried out in large quantities; moreover, since the image features of insulator defects are not obvious and the location of defects is uncertain, the difficulty of defect detection is increased. Generally speaking, the existing defect detection methods are divided into traditional methods and deep convolutional neural network methods. The performance of traditional methods is limited by the slow progress of traditional feature extraction methods. In recent years, as deep learning has achieved good results in many visual tasks, the introduction of defect detection methods based on deep convolutional neural networks has promoted the development of this field and surpassed traditional methods in performance. In addition, computer vision tasks such as image classification and target detection based on multi-head self-attention have also made breakthrough progress in the past two years.

[0004] However, different defect detection methods are applicable to different data. For drone aerial images in power grid scenarios, there is an urgent need for a new insulator defect detection method based on visual perception in drone aerial images in power grid scenarios. Summary of the invention

[0005] The purpose of the present invention is to provide an insulator defect detection method, system, electronic device and readable storage medium to solve one or more of the above-mentioned technical problems. The present invention can complete the classification task of insulator defect detection in power grid aerial images, and can specifically solve the technical problem of model accuracy in the prior art.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] An insulator defect detection method of the present invention comprises the following steps:

[0008] Inputting the aerial image of the inspected power grid into a pre-trained insulator defect detection model, and outputting the insulator defect detection result of the aerial image of the inspected power grid through the pre-trained insulator defect detection model;

[0009] The insulator defect detection model includes:

[0010] The insulator detection and foreground segmentation module is used to obtain the area image containing only the insulators according to the input power grid aerial image;

[0011] The insulator defect detection module is used to determine whether the insulator has defects based on the acquired regional image containing only the insulator, and output the insulator defect detection result by using the image classification network based on multi-head self-attention.

[0012] A further improvement of the present invention is that, in the insulator detection and foreground segmentation module, the step of obtaining a region image containing only insulators according to the input power grid aerial image specifically comprises:

[0013] According to the input power grid aerial image, the encoding and decoding model based on multi-head self-attention is used to detect the insulator target and obtain the insulator detection result;

[0014] According to the insulator detection result, the foreground of the insulator is segmented to obtain a regional image containing only the insulator in the aerial image of the power grid.

[0015] A further improvement of the present invention is that the step of performing target detection on insulators based on the input power grid aerial image by using a multi-head self-attention based encoding and decoding model to obtain the insulator detection result specifically includes:

[0016] The obtained aerial image frames are fed into a deep convolutional neural network to extract image features and obtain a feature map;

[0017] The obtained feature map is divided into multiple sub-feature maps of fixed size, and flattened into a linear sub-feature map sequence in one dimension; the sub-feature map sequence and the position of the sub-feature map in the original feature map are encoded to form a complete linear input sequence;

[0018] Using a multi-head self-attention module and a feedforward network module, extracting features from the linear input sequence so that the features contain semantic and position information of the context within the frame, and obtaining processed features;

[0019] Using self-attention and attention mechanism, the processed features are decoded through multiple alternating multi-head self-attention modules, multi-head attention modules and feedforward network modules combined with output position encoding, and feature results with the same dimension as the query object are output;

[0020] The feature results are input into a predictive feed-forward network to generate a final insulator class label and a bounding box set, and obtain the insulator detection result in the aerial image frame.

[0021] A further improvement of the present invention is that the obtained aerial image frame is sent to a deep convolutional neural network to extract the features of the image, and a feature map is obtained.

[0022] The deep convolutional neural network uses ResNet as the backbone network for feature extraction, and replaces the conventional 3×3 convolutions of Conv3 to Conv5 in ResNet with deformable convolutions.

[0023] A further improvement of the present invention is that, in the insulator defect detection module, based on the acquired regional image containing only the insulator, an image classification network based on multi-head self-attention is used to determine whether the insulator has defects and output the insulator defect detection result:

[0024] (1) Divide the acquired regional image containing only the insulator into multiple sub-images of fixed size, and flatten them one-dimensionally into a linear sub-image sequence;

[0025] (2) The linear sub-graph sequence obtained in step (1) is combined with the position encoding of the sub-graph in the insulator image and a learnable classification flag to form a complete linear input sequence;

[0026] (3) A multi-head self-attention mechanism is used to extract features from the linear input sequence obtained in step (2), so that the features contain the semantic and position information of the context within the frame, and the processed features and the learned classification flags are obtained. The final output of the classification is performed according to the classification flags to obtain the insulator defect detection result.

[0027] A further improvement of the present invention is that the step of obtaining the pre-trained insulator defect detection model comprises:

[0028] Based on the given labeled power grid aerial image dataset, a training dataset is constructed;

[0029] Based on the training data set, the batch gradient descent algorithm is used to train and optimize the model to obtain a trained insulator defect detection model; wherein, the initial learning rate of feature extraction is 1e-5, the initial learning rate of the encoding and decoding model is set to 1e-4, and the weight decay rate is 1e-4; the gradient update method uses the gradient descent algorithm with momentum, and the momentum value is set to 0.9.

[0030] A further improvement of the present invention is that the specific steps of constructing a training data set based on a given labeled power grid aerial image data set include:

[0031] Obtain annotated power grid aerial image dataset and construct an initial training dataset;

[0032] Based on the initial training data set, data augmentation is performed by random horizontal mirroring, adding random perturbations and noise to the input images, and thus a final training data set is constructed.

[0033] An insulator defect detection system of the present invention comprises:

[0034] An input and detection module, used for inputting the aerial image of the inspected power grid into a pre-trained insulator defect detection model, and outputting the insulator defect detection result of the aerial image of the inspected power grid through the pre-trained insulator defect detection model;

[0035] The insulator defect detection model includes:

[0036] The insulator detection and foreground segmentation module is used to obtain the area image containing only the insulators according to the input power grid aerial image;

[0037] The insulator defect detection module is used to determine whether the insulator has defects based on the acquired regional image containing only the insulator, and output the insulator defect detection result by using the image classification network based on multi-head self-attention.

[0038] An electronic device of the present invention comprises: a processor; a memory for storing computer program instructions; when the computer program instructions are loaded and run by the processor, the processor executes any one of the above-mentioned insulator defect detection methods of the present invention.

[0039] A readable storage medium of the present invention stores computer program instructions, wherein when the computer program instructions are loaded and executed by a processor, the processor executes any one of the above-mentioned insulator defect detection methods of the present invention.

[0040] Compared with the prior art, the present invention has the following beneficial effects:

[0041] The insulator defect detection method of UAV aerial images based on visual perception in a power grid scenario provided by the present invention takes power grid aerial image data as input; for the network structure, on the basis of the multi-head self-attention encoding-decoding method, it pays more attention to improving the detection accuracy and detection efficiency of the target.

[0042] Under the framework of multi-head self-attention, the present invention designs and constructs various sub-modules in the insulator defect detection model of drone aerial images, and unifies all modules to form a unified spatial encoding and decoding structure based on the multi-head self-attention network, which the present invention calls a "self-attention superposition model". The overall structure can be trained end-to-end to obtain an insulator defect detection model for drone aerial images in power grid scenarios. For complex scenes in aerial images, the present invention enhances high-level features by modeling remote contextual relationships through a self-attention-based encoding-decoding model. In terms of defect detection, the present invention again uses a self-attention-based encoding-decoding model to classify whether the insulator is defective or not.

[0043] For drone aerial images, the number of insulators in an image is usually small (mostly within 5); in view of the data characteristics that there are few targets to be detected in an image, the present invention uses self-attention in the decoder link to extract the correlation of its own sequence information, and uses the feature sequence output by the encoder as conditional information to train the randomly initialized M query objects as the input of the decoder. This method uses set prediction to avoid repeated detection. Compared with the sliding window mode of the traditional detection algorithm or the candidate box mode based on the two-stage target detection method, the present invention does not need to use post-processing processes such as non-maximum suppression, nor does it need to manually set the size and proportion of the candidate box and other features, thereby improving the detection efficiency.

[0044] Insulators that have electrical isolation and mechanical fixation functions on the power grid usually have non-fixed shapes and large differences. Therefore, the present invention uses modulated deformable convolution operations in the feature extraction link to perform feature learning with strong robustness. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art; obviously, the drawings described below are some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 It is a schematic flowchart of a method for detecting insulator defects using drone aerial images based on visual perception in a power grid scenario in an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical effect and technical solution of the embodiment of the present invention clearer, the technical solution in the embodiment of the present invention is clearly and completely described below in conjunction with the drawings in the embodiment of the present invention; it is obvious that the described embodiment is a part of the embodiment of the present invention. Based on the embodiment disclosed in the present invention, other embodiments obtained by ordinary technicians in this field without making creative work should all fall within the scope of protection of the present invention.

[0048] An embodiment of the present invention provides a method for detecting insulator defects in drone aerial images in a power grid scenario based on visual perception, which completes insulator defect detection in drone aerial images in a power grid scenario based on drone aerial image data and a defect detection model in the power grid scenario.

[0049] The above method of the embodiment of the present invention can complete the classification task of insulator defect detection in power grid aerial images, and can specifically solve the technical problem of model accuracy in the prior art.

[0050] See also Figure 1 In the embodiment of the present invention, the steps of constructing the insulator defect detection model include:

[0051] Step 1: Build a dataset. Build a dataset of drone aerial images in power grid scenarios.

[0052] Step 2: Insulator detection: The insulator is detected based on the multi-head self-attention encoding and decoding model to obtain the detection results.

[0053] Step 3: Insulator foreground segmentation: Based on the detection results obtained in step 2, the insulator foreground is segmented to obtain a regional image containing only the insulator.

[0054] Step 4: Insulator defect detection: Use the multi-head self-attention based image classification network (encoding and decoding network) to determine whether the insulator is defective.

[0055] Step 5: Model integration: Integrate the modules formed in steps 2 to 4 above to form an insulator defect detection model based on visual perception of drone aerial images in a power grid scenario.

[0056] In the embodiment of the present invention, step 1 specifically includes: step 1.1, constructing a training data set based on a given labeled drone aerial image data set.

[0057] In the embodiment of the present invention, step 2 specifically includes:

[0058] Step 2.1, feature acquisition. The obtained aerial image frames are fed into a deep convolutional neural network to extract the features of the image and obtain a feature map;

[0059] Step 2.2, feature expansion. Divide the feature map obtained in step 2.1 into multiple sub-feature maps of fixed size, and flatten them into a linear sub-feature map sequence in one dimension; encode the sub-feature map sequence and the position of the sub-feature map in the original feature map to form a complete linear input sequence;

[0060] Step 2.3, feature encoding. Using the multi-head self-attention module and the feedforward network module, the linear input sequence obtained in step 2.2 is subjected to feature extraction, so that the features contain the semantic and position information of the intra-frame context, and the processed features are obtained;

[0061] Step 2.4, feature decoding. Using the self-attention and attention mechanism, the features obtained in step 2.3 are decoded through multiple alternating multi-head self-attention modules, multi-head attention modules and feedforward network modules combined with output position encoding, and the feature results with the same dimension as the query object are output;

[0062] Step 2.5, predict output: The feature results are input into a predictive feed-forward network to generate the final insulator class label and bounding box set, and obtain the detection result of the insulator defect in the image.

[0063] In the embodiment of the present invention, step 4 specifically includes:

[0064] Step 4.1, dividing the insulator region image obtained in step 3 into a plurality of sub-images of fixed size, and flattening the sub-images in one dimension into a linear sub-image sequence;

[0065] Step 4.2, based on the linear sub-image sequence obtained in step 4.1, a complete linear input sequence is formed by combining the position encoding of the sub-image in the insulator image and a learnable classification flag;

[0066] In step 4.3, a multi-head self-attention mechanism is used to extract features from the linear input sequence obtained in step 4.2, so that the features contain the semantic and position information of the context within the frame, and the processed features and the learned classification flags are obtained, and the final output of the classification is performed according to the classification flags.

[0067] The insulator defect detection model for drone aerial images based on visual perception in the power grid scenario provided by the present invention takes the aerial image data of the power grid as input. For the network structure, on the basis of the multi-head self-attention encoding-decoding method, it pays more attention to improving the detection accuracy of the target. Insulators that have electrical isolation and mechanical fixation for the power grid are usually not fixed in shape and have large differences. In the feature extraction link, the present invention uses modulated deformable convolution operations to perform feature learning with strong robustness. For complex scenes in aerial images, the present invention models remote contextual relationships through an encoding-decoding model based on self-attention to enhance high-level features. In terms of defect detection, the present invention again uses an encoding-decoding model based on self-attention to classify whether the insulator is defective or not. In summary, the present invention designs and constructs each submodule in the drone aerial image insulator defect detection model under the framework of multi-head self-attention, and unifies all modules to form a unified spatial encoding-decoding structure based on a multi-head self-attention network, which the present invention calls a "self-attention superposition model". The overall structure can be trained end-to-end to obtain an insulator defect detection model for drone aerial images in the power grid scenario.

[0068] See also Figure 1 , an embodiment of the present invention provides a method for detecting insulator defects in a power grid scenario based on visual perception using drone aerial images, and the specific steps are described in detail as follows:

[0069] Step S1: Construct a data set. The data set is generally a self-made data set of aerial images of power grids that are annotated frame by frame. A training data set is established based on the given annotated aerial image data. Since the insulator defect data in the power grid scenario is scarce, before model training, data augmentation can be performed by random horizontal mirroring, adding random perturbations and noise to the input images, etc., to obtain richer training data.

[0070] Step S2: Insulator detection: The image frames in the data set are subjected to insulator-based target detection.

[0071] S21 Feature acquisition. The obtained aerial image frame is sent to a deep convolutional neural network to extract the image features and obtain a feature map. In the embodiment of the present invention, a residual network (Residual Net, referred to as ResNet) is selected as the backbone network for feature extraction for model pre-training, and the conventional 3×3 convolution of Conv3 to Conv5 in ResNet is replaced by deformable convolution. This step prepares for subsequent feature encoding and decoding. The size of the input frame x img ∈R H×W×C , where H is the height of the video frame image, W is the width of the video frame image, and C is the number of channels of the video frame image.

[0072] S22 Feature expansion. The obtained feature map is divided into multiple sub-feature maps of fixed size, and flattened into a linear sub-feature map sequence in one dimension. The sub-feature map sequence and the position of the sub-feature map in the original feature map are encoded to form a complete linear input sequence; the obtained feature map is reduced in dimension by 1×1 convolution, and the number of original channels is reduced from C0 to d model (d model Less than C0, such as C0 = 2048, d model =512). The size of the feature map after processing is The above characteristics Figure 1 The dimension is flattened into a linear sequence of subgraphs, and a positional code consistent with the sequence dimension is added to each subgraph.

[0073] S23 Feature encoding. Using the multi-head self-attention module and the feedforward network module, the linear input sequence obtained in step S22 is subjected to feature extraction, so that the features contain the semantics and position information of the context within the frame, and the processed features are obtained. Specifically, the input sequence obtained in step S22 is subjected to feature extraction of the correlation degree of its own sequence information and position information using the multi-head self-attention module; the residual connection is used to retain the original information flow, and layer normalization is performed; wherein, the multi-head attention module MultiHead(Q, K, V) = Concat(head1, ..., head h )W O , where h represents the number of heads in the multi-head self-attention, that is, the number of self-attention layers.

[0074] S24 feature decoding. Using self-attention and attention mechanisms, the features obtained in step S23 are decoded through multiple alternating multi-head self-attention modules, multi-head attention modules and feedforward network modules combined with output position encoding, and feature results with the same dimension as the query object are output; the decoder uses self-attention to extract the correlation of its own sequence information, and uses the feature sequence output by the encoder as conditional information on the decoder to learn and train the randomly initialized M query objects as the input of the decoder (where M is a hyperparameter, which should be set to be much larger than the number of targets in a picture, with a typical value of 100); the attention module and the feedforward network module are used alternately, and the residual connection is used after each attention module and feedforward network module to retain the original information flow, and layer normalization is performed. The query object is added to the input of each attention layer for learning and training; the paired relationship between the query object and the feature is learned and trained, and finally a result with the same dimension as the query object is obtained, that is, the M query objects that have been learned;

[0075] S25 predicts output. The processed features are input into a predictive feedforward network to generate a final insulator class label and bounding box set, and obtain the detection result of the insulator in the image (i.e., obtain the coordinates / position of the insulator in the image).

[0076] Step S3, insulator foreground segmentation: According to the insulator detection result, the insulator foreground area is segmented.

[0077] Step S4, insulator defect detection. Use a multi-head self-attention based image classification network to determine whether the insulator has defects, specifically including:

[0078] S41 divides the insulator region graph into multiple subgraphs of fixed size and flattens them into a linear subgraph sequence in one dimension. In the original graph, the size of each graph is: x∈R H×W×C , where H is the height of the video frame image, W is the width of the video frame image, and C is the number of channels of the video frame image. After being expanded into a one-dimensional linear subgraph sequence, x s ∈R N×(PxP×C) , where x s represents a sub-image sequence. P is the width and height of the sub-image. is the number of subgraphs.

[0079] S42 adds a position code to each subgraph of the sequence obtained in step S41 to obtain a new sequence, and adds a learnable classification flag to the sequence to obtain a complete input sequence.

[0080] S43 uses a multi-head self-attention mechanism to extract features from the linear input sequence obtained in step S42, so that the features contain the semantics and position information of the context within the frame, obtain the processed features and the learned classification flags, and perform the final output of classification according to the classification flags; specifically: first, the input sequence obtained in step S42 is alternately subjected to L times (L is a hyperparameter, with a typical value of 6) using the multi-head self-attention module and the multi-layer perception module for feature extraction; in the multi-head self-attention module, z′ l =MSA(LN(z l-1 ))+z l-1 , where MSA represents multi-head self-attention operation, LN represents regularization, and z′ l represents the extracted network, +z l-1 The operations are represented using a residual network. The multi-layer perception module is a feed-forward neural network, such as a fully connected network.

[0081] S44 classifies the classification flags learned in step S43 and outputs the final classification.

[0082] Step S5: model integration. Combine the above submodules to form an insulator defect detection model for drone aerial images based on visual perception in the power grid scenario; perform end-to-end training on the encoding and decoding structure, feature extraction module and self-attention module. In the specific implementation, firstly combine the model, link the modules involved in the above steps, construct a joint framework based on Detection Transformer (DETR) and Vision Transformer (ViT), and unify the training parameter model. In the specific implementation, for the weights of each layer of the encoding part of the encoding and decoding model, the parameters can be initialized by loading the pre-trained model on the static image data set. The multi-head self-attention module, the feature extraction of objects with variable shapes and the final output module are assigned to the parameters by setting a general initialization strategy, such as Xavier initialization, MSRA initialization, etc. The present invention adopts the Xavier initialization method. During the model training process, the model optimization uses a batch gradient descent algorithm. The initial learning rate of feature extraction is 1e-5, the initial learning rate of the self-attention encoding-decoding model is set to 1e-4, and the weight decay rate is 1e-4. The gradient update method uses the gradient descent algorithm with momentum, and the momentum value is set to 0.9. Multi-card GPU workstations or computing clusters are used for parallel computing to accelerate the model training process; using the trained model, given the video frames to be detected, insulator defect detection in the power grid scenario can be achieved.

[0083] In summary, the embodiments of the present invention disclose a detection method that ensures the accuracy of insulator defect detection through an investigation of an aerial image insulator defect detection method and the application of a multi-head self-attention encoding and decoding network to target detection and image classification.

[0084] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0085] 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 generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0086] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0088] The above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, a person skilled in the art can still modify or make equivalent substitutions to the specific implementations of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention are within the scope of protection of the claims of the present invention to be approved.

Claims

1. A method for detecting insulator defects, characterized in that: The following steps are involved: Inputting the aerial image of the inspected power grid into a pre-trained insulator defect detection model, and outputting the insulator defect detection result of the aerial image of the inspected power grid through the pre-trained insulator defect detection model; The insulator defect detection model includes: The insulator detection and foreground segmentation module is used to obtain the area image containing only the insulators according to the input power grid aerial image; An insulator defect detection module is used to determine whether the insulator has defects based on the acquired regional image containing only the insulator, and output the insulator defect detection result by using the image classification network based on multi-head self-attention; in, In the insulator detection and foreground segmentation module, the step of obtaining a regional image containing only insulators according to the input aerial image of the power grid specifically includes: performing target detection on insulators according to the input aerial image of the power grid using a multi-head self-attention-based encoding and decoding model to obtain an insulator detection result; performing foreground segmentation on the insulators according to the insulator detection result to obtain a regional image containing only insulators in the aerial image of the power grid; The step of performing target detection on insulators according to the input aerial image of the power grid using a coding and decoding model based on multi-head self-attention to obtain the insulator detection result specifically includes: sending the obtained aerial image frame into a deep convolutional neural network to extract the features of the image and obtain a feature map; dividing the obtained feature map into multiple sub-feature maps of fixed size, and flattening it into a linear sub-feature map sequence in one dimension; encoding the sub-feature map sequence and the position of the sub-feature map in the original feature map to form a complete linear input sequence; using a multi-head self-attention module and a feedforward network module, extracting features from the linear input sequence so that the features contain the semantics and position information of the context within the frame, and obtaining processed features; using a self-attention and attention mechanism, decoding the processed features through multiple alternating multi-head self-attention modules, multi-head attention modules and feedforward network modules combined with output position encoding, and outputting feature results of the same dimension as the query object; inputting the feature results into a predictive feedforward network to generate the final insulator subclass label and bounding box set, and obtaining the insulator detection result in the aerial image frame; In the insulator defect detection module, based on the acquired regional image containing only the insulator, an image classification network based on multi-head self-attention is used to determine whether the insulator has defects and output the insulator defect detection result: (1) Divide the acquired regional image containing only the insulator into multiple sub-images of fixed size, and flatten them one-dimensionally into a linear sub-image sequence; (2) The linear sub-graph sequence obtained in step (1) is combined with the position encoding of the sub-graph in the insulator image and a learnable classification flag to form a complete linear input sequence; (3) Using a multi-head self-attention mechanism, extract features from the linear input sequence obtained in step (2), so that the features contain the semantics and position information of the context within the frame, obtain the processed features and the learned classification flags, and perform the final classification output according to the classification flags to obtain the insulator defect detection result; Among them, in the step of decoding through multiple alternating multi-head self-attention modules, multi-head attention modules and feedforward network modules in combination with output position encoding, and outputting feature results of the same dimension as the query object, self-attention is used in the decoder to extract the correlation of its own sequence information, and the feature sequence output by the encoder is used as conditional information on the decoder to perform learning and training on M randomly initialized query objects as the input of the decoder, where M is a hyperparameter; attention modules and feedforward network modules are used alternately, and residual connections are used after each attention module and feedforward network module to retain the original information flow, and layer normalization is performed, and the query object is added to the input of each attention layer for learning and training; the paired relationship between the query object and the feature is learned and trained, and finally a result of the same dimension as the query object is obtained.

2. The insulator defect detection method according to claim 1, characterized in that: The obtained aerial image frame is sent to a deep convolutional neural network to extract the features of the image, and a feature map is obtained. The deep convolutional neural network uses ResNet as the backbone network for feature extraction, and replaces the conventional 3×3 convolutions of Conv3 to Conv5 in ResNet with deformable convolutions.

3. The insulator defect detection method according to claim 1, characterized in that: The steps of obtaining the pre-trained insulator defect detection model include: Based on the given labeled power grid aerial image dataset, a training dataset is constructed; Based on the training data set, the batch gradient descent algorithm is used to train and optimize the model to obtain a trained insulator defect detection model; wherein, the initial learning rate of feature extraction is 1e-5, the initial learning rate of the encoding and decoding model is set to 1e-4, and the weight decay rate is 1e-4; the gradient update method uses the gradient descent algorithm with momentum, and the momentum value is set to 0.

9.

4. The insulator defect detection method according to claim 3, characterized in that: The specific steps of constructing a training data set based on a given labeled power grid aerial image data set include: Obtain annotated power grid aerial image dataset and construct an initial training dataset; Based on the initial training data set, data augmentation is performed by random horizontal mirroring, adding random perturbations and noise to the input images, and thus a final training data set is constructed.

5. An insulator defect detection system, characterized in that: include: An input and detection module, used for inputting the aerial image of the inspected power grid into a pre-trained insulator defect detection model, and outputting the insulator defect detection result of the aerial image of the inspected power grid through the pre-trained insulator defect detection model; The insulator defect detection model includes: The insulator detection and foreground segmentation module is used to obtain the area image containing only the insulators according to the input power grid aerial image; An insulator defect detection module is used to determine whether the insulator has defects based on the acquired regional image containing only the insulator, and output the insulator defect detection result by using the image classification network based on multi-head self-attention; in, In the insulator detection and foreground segmentation module, the step of obtaining a regional image containing only insulators according to the input aerial image of the power grid specifically includes: performing target detection on insulators according to the input aerial image of the power grid using a multi-head self-attention-based encoding and decoding model to obtain an insulator detection result; performing foreground segmentation on the insulators according to the insulator detection result to obtain a regional image containing only insulators in the aerial image of the power grid; The step of performing target detection on insulators according to the input aerial image of the power grid using a coding and decoding model based on multi-head self-attention to obtain the insulator detection result specifically includes: sending the obtained aerial image frame into a deep convolutional neural network to extract the features of the image and obtain a feature map; dividing the obtained feature map into multiple sub-feature maps of fixed size, and flattening it into a linear sub-feature map sequence in one dimension; encoding the sub-feature map sequence and the position of the sub-feature map in the original feature map to form a complete linear input sequence; using a multi-head self-attention module and a feedforward network module, extracting features from the linear input sequence so that the features contain the semantics and position information of the context within the frame, and obtaining processed features; using a self-attention and attention mechanism, decoding the processed features through multiple alternating multi-head self-attention modules, multi-head attention modules and feedforward network modules combined with output position encoding, and outputting feature results of the same dimension as the query object; inputting the feature results into a predictive feedforward network to generate the final insulator subclass label and bounding box set, and obtaining the insulator detection result in the aerial image frame; In the insulator defect detection module, based on the acquired regional image containing only the insulator, an image classification network based on multi-head self-attention is used to determine whether the insulator has defects and output the insulator defect detection result: (1) Divide the acquired regional image containing only the insulator into multiple sub-images of fixed size, and flatten them one-dimensionally into a linear sub-image sequence; (2) The linear sub-graph sequence obtained in step (1) is combined with the position encoding of the sub-graph in the insulator image and a learnable classification flag to form a complete linear input sequence; (3) Using a multi-head self-attention mechanism, extract features from the linear input sequence obtained in step (2), so that the features contain the semantics and position information of the context within the frame, obtain the processed features and the learned classification flags, and perform the final classification output according to the classification flags to obtain the insulator defect detection result; Among them, in the step of decoding through multiple alternating multi-head self-attention modules, multi-head attention modules and feedforward network modules in combination with output position encoding, and outputting feature results of the same dimension as the query object, self-attention is used in the decoder to extract the correlation of its own sequence information, and the feature sequence output by the encoder is used as conditional information on the decoder to perform learning and training on M randomly initialized query objects as the input of the decoder, where M is a hyperparameter; attention modules and feedforward network modules are used alternately, and residual connections are used after each attention module and feedforward network module to retain the original information flow, and layer normalization is performed, and the query object is added to the input of each attention layer for learning and training; the paired relationship between the query object and the feature is learned and trained, and finally a result of the same dimension as the query object is obtained.

6. An electronic device comprising: processor; A memory for storing computer program instructions; characterized in that: When the computer program instructions are loaded and executed by the processor, the processor executes the insulator defect detection method according to any one of claims 1 to 4.

7. A readable storage medium storing computer program instructions, characterized in that: When the computer program instructions are loaded and executed by a processor, the processor executes the insulator defect detection method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Unmanned aerial vehicle variable-size target detection method based on multi-head self-attention mechanism

    CN111709397A

  • Instant software defect prediction method based on code representation learning

    CN111858323A

  • Unmanned aerial vehicle power grid inspection method and system based on embedded deep learning

    CN112668696A