Power transmission inspection small sample detection method based on improved DERT
By improving the DERT model combined with selection search algorithm and deep learning technology, the problem of inefficient detection in massive images and videos of traditional inspection methods is solved, and efficient and accurate transmission line inspection target detection is achieved.
Patent Information
- Application Number
- CN202411754482.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-04-04
AI Technical Summary
Traditional transmission inspection methods are inefficient in the detection of massive inspection images and videos and cannot be accurately detected.
A small sample detection method for transmission patrol based on improved DERT is adopted, and candidate areas are generated by selecting a search algorithm, and training and small sample fine-tuning is used to achieve real-time object detection. The improved DERT model includes backbone network, position encoding, encoder and decoder, adopts a multi-head deformable self-attention mechanism and a multi-head deformable cross-attention mechanism, and combines L1 loss, GIoU loss and cross-entropy loss for total loss calculation.
Realize efficient inspection under small sample conditions, significantly improve the accuracy, robustness and adaptability to small samples of transmission line patrol target detection, and effectively improve inspection efficiency and accuracy.
Smart Images

Figure CN119762749A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power systems, and in particular relates to a small sample detection method for power transmission inspection based on improved DERT. Background Art
[0002] Inspection of overhead transmission lines is an important means to ensure the safety of power transmission. According to the State Grid Corporation of China's Regulations on the Operation and Maintenance of Overhead Transmission Lines (State Grid (Operation and Inspection / 4) 305-2014), power components include foundations, insulators, hardware, grounding devices, towers, ground wires, channel environments, and ancillary facilities. However, due to the vast territory of my country, the wide distribution of lines, and the harsh natural conditions in some areas, traditional inspection methods have many problems, such as high labor intensity, low efficiency, and even the inability to conduct inspections in complex terrain. In recent years, the power grid has introduced new technologies such as drone inspections, robot inspections, and helicopter inspections for inspections, and has actively developed new inspection technologies. These new technologies have greatly reduced the difficulty of field inspections and generated a large amount of visual data. However, in the face of massive inspection images and videos, traditional manual inspection methods are inefficient and increase the workload. Therefore, some scholars have begun to study the automatic identification and annotation of key power components or specific faults in inspection aerial images. Since Krizhevsky's excellent performance in ImageNet, a wave of deep learning has been set off. The development of deep learning has promoted the progress of computer vision technology, and target detection has become an important research direction. Different from traditional artificial feature extraction methods, deep learning target detection algorithms are data-driven and have the advantages of high precision, multi-target detection, and strong robustness. Therefore, a target detection method based on deep learning is urgently needed to improve the efficiency of power transmission inspection.
[0003] The Chinese patent with publication number CN114332204A discloses a method, medium and system for detecting bird nests on overhead transmission lines, including: obtaining a plurality of first images of overhead transmission lines, wherein the overhead transmission lines in the first images have bird nests that are at least partially blocked by the overhead transmission lines; marking the positions of the bird nests in the plurality of first images to obtain a plurality of second images; training a Conditional DERT target detection model using the plurality of second images to obtain a trained Conditional DERT target detection model; real-time acquisition of a third image of the overhead transmission line; inputting the third image into the trained Conditional DERT target detection model, outputting a preset number of bounding boxes, and using the bounding boxes with confidence greater than a threshold as the final prediction box to obtain the position of the bird nest in the third image. The Conditional DERT target detection model described in the invention still uses the self-attention mechanism and cross-attention mechanism in the traditional DERT model to capture the local details and structural information of the image, which is not effective enough and has high computational complexity. Summary of the invention
[0004] The present invention provides a small sample detection method for power transmission inspection based on improved DERT, aiming to solve the problem that traditional inspection methods are inefficient and unable to accurately detect massive inspection images and videos.
[0005] In order to solve the above technical problems, the present invention provides a small sample detection method for power transmission inspection based on improved DERT, comprising the following steps:
[0006] S1: Collect the original image of the transmission line inspection, generate candidate areas according to the original image by selecting the search algorithm, and extract the corresponding candidate areas from the original image as training samples according to the coordinate information of the candidate areas.
[0007] S2: Establish an improved DERT model, use the candidate regions generated by the selection search algorithm to train the improved DERT model and perform small sample fine-tuning training to obtain a trained improved DERT model.
[0008] S3: Collect the inspection images of the transmission line to be inspected in real time, and use the trained improved DERT model to perform transmission line inspection target detection.
[0009] Preferably, the structure of the improved DERT model in step S2 specifically includes: a backbone network, a positional code, an encoder, and a decoder.
[0010] The backbone network is used to encode the input candidate region and extract features.
[0011] The position encoding is used to provide spatial position information for each feature.
[0012] The encoder is used to process the feature map extracted by the backbone network and generate a global feature representation.
[0013] The decoder is used to process the output features of the encoder and generate target detection results including target position and target category.
[0014] Preferably, the backbone network uses a ResNet network, and constructs multi-scale features based on the outputs of C3, C4, and C5 layers in ResNet to extract features of four different scales.
[0015] For the position encoding of features of four different scales, a scale-level embedding vector is introduced. The scale-level embedding vector is used to distinguish the position encoding of the same position of different features, and the corresponding scale-level embedding vector is added on the basis of the original position encoding.
[0016] Preferably, the attention mechanism in the encoder is a multi-head deformable self-attention mechanism, and the calculation formula of the multi-head deformable attention is specifically:
[0017]
[0018] In the formula, DeformAttn(z q ,p q ,x) is the feature representation of the deformable attention output. q is the query feature. q is the coordinate of the reference point. x is the feature representation. M is the number of attention heads, m is the index of the attention head, m∈[1,M]. m and W′ m are all linear transformation matrices. K is the total number of sampling points, k is the index of the sampling point, k∈[1,K]. mqk is the attention score of the kth sampling point in the mth attention head. Δp mqk is the position offset of the kth sampling point in the mth attention head.
[0019] The attention mechanisms in the decoder are multi-head self-attention mechanism and multi-head deformable cross attention mechanism, where the calculation formula of multi-head deformable cross attention is specifically:
[0020]
[0021] In the formula, is the feature representation of the multi-head deformable cross attention output. L is the total number of feature layers, l∈[1,L]. l is the feature representation of the lth layer. mlk is the attention score of the kth sampling point in the lth feature layer in the mth attention head. is the normalized two-dimensional coordinate. Denotes denormalization function of Δp mlqk Represents the position offset of the kth sampling point in the lth feature layer in the mth attention head.
[0022] Preferably, the total loss calculation of the improved DERT model during the training process is specifically as follows: using the weighted sum of L1 loss and GIoU loss to calculate the bounding box loss, using the cross entropy loss to calculate the category loss to construct a cost function, performing optimal matching on the cost matrix constructed by the bounding box loss and the category loss through the Hungarian matching algorithm, and calculating the total loss function based on the matching result after the matching is completed, wherein the total loss function includes the bounding box loss, the category loss, and the feature reconstruction loss;
[0023] The Hungarian matching algorithm for bipartite graph matching is expressed as:
[0024]
[0025] In the formula, is the predicted matching relationship; σ is the matching relationship; N is the total number of prediction results, i∈[1,N]; y i is the sample, y i =(b i ,c i ), c i represents the category label, b i represents the true bounding box; is the i-th prediction box matched; L match () is the matching loss function.
[0026] Preferably, the calculation formula of the matching loss function is specifically:
[0027]
[0028] In the formula, Define the probability of category c for the i-th matching prediction box; is an indicator function used to determine whether the category c of the current sample is empty; L box () is the bounding box loss; is the predicted bounding box.
[0029] Preferably, the calculation formula of the total loss function is specifically:
[0030]
[0031] In the formula, is the total loss function; It is the category loss weighting factor, which is mainly used to balance the loss value of the successfully matched prediction box and the unmatched prediction box. When the prediction box matches the candidate area that is cropped, on the contrary, is the proportion of matching; L cls () is the category loss function; is the i-th category matched; is the indicator function; L rec () is the feature reconstruction loss function; is the feature extracted from the input candidate region by the backbone network; is the target feature to be matched.
[0032] On the other hand, the present invention provides a small sample detection system for power transmission inspection based on improved DERT, including a data acquisition module, an improved DERT model training module and a real-time target detection module.
[0033] The data acquisition module is used to collect the original images of the transmission line inspection, generate candidate areas according to the original images by selecting the search algorithm, and extract the corresponding candidate areas from the original images as training samples according to the coordinate information of the candidate areas.
[0034] The improved DERT model training module is used to establish an improved DERT model, train the improved DERT model using the candidate regions generated by the selection search algorithm, and perform small sample fine-tuning training to obtain a trained improved DERT model.
[0035] The real-time target detection module is used to collect the inspection images of the transmission line to be inspected in real time, and use the trained improved DERT model to perform transmission line inspection target detection.
[0036] On the other hand, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the power transmission inspection small sample detection method based on improved DERT as described in any embodiment of the present invention is implemented.
[0037] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the improved DERT-based small sample detection method for power transmission inspection as described in any embodiment of the present invention is implemented.
[0038] Compared with the prior art, the present invention has the following technical effects:
[0039] 1. The method of the present invention uses the candidate area generated by the selection search algorithm and combines it with the self-attention mechanism of the improved DERT model. The model can fully learn the target features and location information, thereby achieving efficient detection under small sample conditions. By combining the improved deep learning model and the optimized training strategy, the transmission line inspection task can be carried out efficiently.
[0040] 2. The method of the present invention can significantly improve the accuracy, robustness and adaptability to small samples of power line inspection target detection based on DERT through a series of improvements to the DERT model, such as multi-scale feature extraction, deformable attention mechanism, optimized loss function design, etc. This enables the present invention to effectively improve inspection efficiency and accuracy in practical applications, especially in the complex task of power line inspection. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is an overall flow chart of the small sample detection method for power transmission inspection based on improved DERT according to the present invention;
[0042] Figure 2is a multi-scale feature extraction flow chart of the present invention;
[0043] Figure 3 It is a structural diagram of the encoder and decoder in the improved DERT model of the present invention;
[0044] Figure 4 This is a flow chart for implementing the deformable attention described in the present invention. DETAILED DESCRIPTION
[0045] In order to make the objectives, technical solutions and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in combination with specific embodiments of the present application and with reference to the accompanying drawings.
[0046] Embodiment 1
[0047] This embodiment provides a small sample detection method for power transmission inspection based on improved DERT, see Figure 1 As shown, the following steps are included:
[0048] S1: Collect the original image of the power transmission line inspection, generate candidate regions based on the original image through the selection search algorithm, and extract the corresponding candidate regions from the original image as training samples based on the coordinate information of the candidate regions. Specifically, generate candidate regions containing image entities from the original image through the selection search algorithm, and then crop the image entities according to the coordinate information of the candidate regions to obtain the Query Patch as the true value box, and add the features extracted by the backbone network to the Object Query in the improved DERT model during training. In this way, the Object Query will aggregate sequences with similar parts to the Query Patch during the attention interaction process, thereby guiding the Object Query to converge to the position of the Query Patch, and finally achieve the effect of accelerating the training of the improved DERT model.
[0049] S2: Establish an improved DERT model, use the candidate regions generated by the selective search algorithm to train the improved DERT model and perform small sample fine-tuning training to obtain a trained improved DERT model. Specifically, the DERT model is an end-to-end target detection network based on Transformer. It does not require a predefined prior anchor or a post-processing strategy of NMS to achieve end-to-end target detection. The DERT model transforms the target detection problem into a direct set prediction problem, getting rid of the prior knowledge and post-processing steps in the traditional target detection pipeline. This embodiment is improved based on the DERT model.
[0050] S3: Collect the inspection images of the transmission line to be inspected in real time, and use the trained improved DERT model to perform transmission line inspection target detection.
[0051] As a preferred implementation of this embodiment, the structure of the improved DERT model in step S2 specifically includes: a backbone network, a position encoding, an encoder, and a decoder. Figure 3 As shown in FIG. 1 , it is a schematic diagram of the structure of the encoder and decoder in the improved DERT model in this embodiment.
[0052] The backbone network is used to encode the input candidate region and extract features.
[0053] The position encoding is used to provide spatial position information for each feature.
[0054] The encoder is used to process the feature map extracted by the backbone network and generate a global feature representation. The structure of the encoder is specifically: a layer of multi-head deformable self-attention mechanism and a layer of feedforward neural network layer, and a sum normalization layer is added after each neural layer.
[0055] The decoder is used to process the output features of the encoder and generate target detection results including target position and target category. The structure of the decoder is specifically: a layer of multi-head self-attention mechanism, a layer of multi-head deformable cross attention mechanism and a layer of feedforward neural network layer. A layer of sum normalization layer is added after each neural layer, and finally the category and bounding box results are output through two layers of feedforward neural network layers.
[0056] As a preferred implementation of this embodiment, refer to Figure 2 As shown, the backbone network uses the ResNet network, and constructs multi-scale features based on the outputs of the C3, C4, and C5 layers in ResNet to extract features of four different scales to improve the small object detection effect. The position encoding of the feature is calculated by trigonometric functions and is expressed as:
[0057]
[0058] Where, PE (pos,2i) Position encoding for even dimensions; PE (pos,2i+1) is the position encoding of odd dimensions; pos is the position, i is the position encoding dimension; d model is the dimension of the model; 10000 is used to control the frequency range of position encoding.
[0059] The above position encoding can only distinguish the position of feature points at a single scale. In multi-scale features, feature points at different feature layers may have the same coordinates, so their position encodings cannot be distinguished. For the position encoding of features of four different scales, scale-level embedding vectors are introduced. The scale-level embedding vectors are used to distinguish the position encodings of the same position of different features, and the corresponding scale-level embedding vectors are added on the basis of the original position encoding. Specifically, the scale-level embedding vectors are randomly initialized and trained with the network, and are learnable.
[0060] As a preferred implementation of this embodiment, the attention mechanism in the encoder is a multi-head deformable self-attention mechanism, which reduces the computational complexity of the attention mechanism and accelerates model convergence, and makes it possible to input multi-scale image features.
[0061] Deformable attention is to calculate the attention of some sampling points based on the reference point and the offset. The reference point is the position of the query on the feature map, and the reference point plus the offset is the position of the sampling point. For its implementation process, see Figure 4 As shown. q is the query feature, which is a sequence of flattened image features in the encoder. q After linear transformation, an offset based on the reference point is obtained. The reference point in the encoder is the position of the image feature sequence in the image. In the decoder, the position of the reference point is obtained through the Object Query linear transformation. The attention weight is also obtained through z q It is obtained by linear transformation and then normalization. This embodiment retains the multi-head mechanism, which is obtained by passing through a linear layer and then performing a tensor deformation on its output. During attention calculation, each Query in the query vector Q matrix will sample K points in each feature layer. If there are L layers of features in total, a total of L×K points will be sampled in each head, and the attention weights are also normalized between these L×K points. Finally, the sequence corresponding to the sampling points in each attention head is taken out to calculate its weighted sum, and then the results of different attention heads are spliced together and linearly transformed again to obtain the final output.
[0062] The calculation formula of the multi-head deformable attention is specifically:
[0063]
[0064] In the formula, DeformAttn(z q ,p q ,x) is the feature representation of the deformable attention output. qis the query feature. q is the coordinate of the reference point. x is the feature representation. M is the number of attention heads, m is the index of the attention head, m∈[1,M]. m and W′ m are all linear transformation matrices. K is the total number of sampling points, k is the index of the sampling point, k∈[1,K]. mqk is the attention score of the kth sampling point in the mth attention head. Δp mqk is the position offset of the kth sampling point in the mth attention head.
[0065] The attention mechanisms in the decoder are multi-head self-attention mechanism and multi-head deformable cross attention mechanism, where the calculation formula of multi-head deformable cross attention is specifically:
[0066]
[0067] In the formula, is the feature representation of the multi-head deformable cross attention output. L is the total number of feature layers, l∈[1,L]. l is the feature representation of the lth layer. mlk is the attention score of the kth sampling point in the lth feature layer in the mth attention head. is the normalized two-dimensional coordinate. Denotes denormalization function of Δp mlqk Represents the position offset of the kth sampling point in the lth feature layer in the mth attention head.
[0068] As a preferred implementation of this embodiment, the total loss calculation of the improved DERT model during the training process is specifically as follows: the bounding box loss is calculated using the weighted sum of the L1 loss and the GIoU loss, and the category loss is calculated using the cross entropy loss to construct a cost function, and the cost matrix constructed by the bounding box loss and the category loss is optimally matched through the Hungarian matching algorithm. After the matching is completed, the total loss function is calculated based on the matching results, and the total loss function includes the bounding box loss, the category loss, and the feature reconstruction loss.
[0069] Input an image, and the improved DERT model will output N prediction results. Assuming y is the real set of targets to be detected, the set of N prediction results is expressed as:
[0070]
[0071] is the set of prediction results; is the i-th prediction result; is the set of prediction results for the input image.
[0072] The Hungarian matching algorithm for bipartite graph matching is expressed as:
[0073]
[0074] In the formula, is the predicted matching relationship. σ is the matching relationship. N is the total number of prediction results, i∈[1,N]. i is the sample, y i =(b i ,c i ), c i represents the category label, b i represents the ground-truth bounding box. is the i-th prediction box matched. match () is the matching loss function.
[0075] As a preferred implementation of this embodiment, the calculation formula of the matching loss function is specifically:
[0076]
[0077] In the formula, Define the probability of category c for the i-th matching prediction box. L is an indicator function used to determine whether the category c of the current sample is empty. box () is the bounding box loss. is the predicted bounding box.
[0078] The calculation formula of the bounding box loss function is specifically:
[0079]
[0080] In the formula, λ IOU , L1 All are hyperparameters; L IoU () is the GIoU loss function; ‖‖ 1 is the Manhattan distance.
[0081] For each prediction result, the matching loss is calculated as:
[0082]
[0083] Where, L Hungarian () is the total matching loss function.
[0084] As a preferred implementation of this embodiment, the calculation formula of the total loss function is specifically:
[0085]
[0086] In the formula, is the total loss function. It is the category loss weighting factor, which is mainly used to balance the loss value of the successfully matched prediction box and the unmatched prediction box. When the prediction box matches the candidate area that is cropped, on the contrary, is the proportion of matching; L cls () is the category loss function. is the i-th category matched. is the indicator function. rec () is the feature reconstruction loss function. is the feature extracted from the input candidate region by the backbone network. is the target feature to be matched.
[0087] The feature reconstruction loss function is mainly used to maintain the feature extraction capability of the backbone network. The calculation formula is expressed as:
[0088]
[0089] Where, L rec () is the feature reconstruction loss function.
[0090] Embodiment 2
[0091] Accordingly, this embodiment provides a small sample detection system for power transmission inspection based on improved DERT, including a data acquisition module, an improved DERT model training module and a real-time target detection module.
[0092] The data acquisition module is used to collect the original image of the transmission line inspection, generate candidate areas according to the original image by selecting a search algorithm, and extract the corresponding candidate areas from the original image as training samples according to the coordinate information of the candidate areas. This module is used to implement the function of step S1 in Example 1 and will not be repeated here.
[0093] The improved DERT model training module is used to establish an improved DERT model, train the improved DERT model using the candidate areas generated by the selection search algorithm and perform small sample fine-tuning training to obtain a trained improved DERT model. This module is used to implement the function of step S2 in Example 1 and will not be repeated here.
[0094] The real-time target detection module is used to collect the inspection images of the power transmission line to be detected in real time, and use the trained improved DERT model to perform transmission line inspection target detection. This module is used to implement the function of step S3 in the first embodiment, which will not be described in detail here.
[0095] Embodiment 3
[0096] This embodiment provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the power transmission inspection small sample detection method based on improved DERT as described in any embodiment of the present invention when executing the computer program.
[0097] Embodiment 4
[0098] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the power transmission inspection small sample detection method based on improved DERT as described in any embodiment of the present invention is implemented.
[0099] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0100] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0101] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0102] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.
[0103] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A small sample detection method for power transmission inspection based on improved DERT, characterized in that: The following steps are involved: S1: Collect the original image of the transmission line inspection, generate candidate areas according to the original image by selecting the search algorithm, and extract the corresponding candidate areas from the original image as training samples according to the coordinate information of the candidate areas; S2: Establish an improved DERT model, use the candidate regions generated by the selection search algorithm to train the improved DERT model and perform small sample fine-tuning training to obtain a trained improved DERT model; S3: Collect the inspection images of the transmission line to be inspected in real time, and use the trained improved DERT model to perform transmission line inspection target detection.
2. The power transmission inspection small sample detection method based on improved DERT according to claim 1 is characterized in that: The structure of the improved DERT model in step S2 specifically includes: a backbone network, a positional code, an encoder, and a decoder; The backbone network is used to encode the input candidate region and extract features; The position encoding is used to provide spatial position information for each feature; The encoder is used to process the feature map extracted by the backbone network to generate a global feature representation; The decoder is used to process the output features of the encoder and generate target detection results including target position and target category.
3. The power transmission inspection small sample detection method based on improved DERT according to claim 2 is characterized in that: The backbone network uses the ResNet network, and constructs multi-scale features based on the outputs of the C3, C4, and C5 layers in ResNet to extract features of four different scales; For the position encoding of features of four different scales, a scale-level embedding vector is introduced. The scale-level embedding vector is used to distinguish the position encoding of the same position of different features, and the corresponding scale-level embedding vector is added on the basis of the original position encoding.
4. The power transmission inspection small sample detection method based on improved DERT according to claim 2 is characterized in that: The attention mechanism in the encoder is a multi-head deformable self-attention mechanism, and the calculation formula of the multi-head deformable attention is specifically: In the formula, DeformAttn(z q ,p q ,x) is the feature representation of the deformable attention output; z q is the query feature; p q is the coordinate of the reference point; x is the feature representation; M is the number of attention heads, m is the index of the attention head, m∈[1,M]; W m and W′ m are all linear transformation matrices; K is the total number of sampling points, k is the index of the sampling point, k∈[1,K]; A mqk is the attention score of the kth sampling point in the mth attention head; Δp mqk is the position offset of the kth sampling point in the mth attention head; The attention mechanisms in the decoder are multi-head self-attention mechanism and multi-head deformable cross attention mechanism, where the calculation formula of multi-head deformable cross attention is specifically: In the formula, is the feature representation of the multi-head deformable cross attention output; L is the total number of feature layers, l∈[1,L]; x l is the feature representation of the lth layer; A mlk is the attention score of the kth sampling point in the lth feature layer in the mth attention head; is the normalized two-dimensional coordinate; Denotes denormalization function of Δp mlqk Represents the position offset of the kth sampling point in the lth feature layer in the mth attention head.
5. The power transmission inspection small sample detection method based on improved DERT according to claim 2 is characterized in that: The total loss calculation of the improved DERT model during the training process is specifically as follows: the bounding box loss is calculated by using the weighted sum of the L1 loss and the GIoU loss, the category loss is calculated by using the cross entropy loss to construct a cost function, the cost matrix constructed by the bounding box loss and the category loss is optimally matched by the Hungarian matching algorithm, and after the matching is completed, the total loss function is calculated based on the matching result, and the total loss function includes the bounding box loss, the category loss, and the feature reconstruction loss; The Hungarian matching algorithm for bipartite graph matching is expressed as: In the formula, is the predicted matching relationship; σ is the matching relationship; N is the total number of prediction results, i∈[1,N]; y i is the sample, y i =(b i ,c i ), c i represents the category label, b i represents the true bounding box; is the i-th prediction box matched; L match () is the matching loss function.
6. The power transmission inspection small sample detection method based on improved DERT according to claim 5 is characterized in that: The calculation formula of the matching loss function is specifically: In the formula, Define the probability of category c for the i-th matching prediction box; is an indicator function used to determine whether the category c of the current sample is empty; L box () is the bounding box loss; is the predicted bounding box.
7. The power transmission inspection small sample detection method based on improved DERT according to claim 5 is characterized in that: The calculation formula of the total loss function is specifically: In the formula, is the total loss function; It is the category loss weighting factor, which is mainly used to balance the loss value of the successfully matched prediction box and the unmatched prediction box. When the prediction box matches the candidate area that is cropped, on the contrary, is the matching ratio; L cls () is the category loss function; is the i-th category matched; is the indicator function; L rec () is the feature reconstruction loss function; is the feature extracted from the input candidate region by the backbone network; is the target feature to be matched.
8. A small sample detection system for power transmission inspection based on improved DERT, characterized in that: The system is used to implement the small sample detection method for power transmission inspection based on improved DERT as described in any one of claims 1 to 7, including a data acquisition module, an improved DERT model training module and a real-time target detection module; The data acquisition module is used to collect the original image of the transmission line inspection, generate the candidate area according to the original image by selecting the search algorithm, and extract the corresponding candidate area from the original image as the training sample according to the coordinate information of the candidate area; Improved DERT model training module, used to establish an improved DERT model, train the improved DERT model using the candidate regions generated by the selection search algorithm and perform small sample fine-tuning training to obtain a trained improved DERT model; The real-time target detection module is used to collect the inspection images of the transmission line to be inspected in real time, and use the trained improved DERT model to perform transmission line inspection target detection.
9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the power transmission inspection small sample detection method based on improved DERT as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the power transmission inspection small sample detection method based on improved DERT as claimed in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
High-transmittance Fresnel lens real-time detection method based on Deformable-DAB-DETR
CN117191821A
End-to-end weak satellite signal intelligent detection method
CN117459157A
Automatic driving target detection method based on incremental small sample learning
CN117612136A
Water surface target detection method and system based on improved Deformable DETR
CN118015255A
Method for classifying images using novel classes
GB2617440A