Power equipment defect classification method based on unmanned aerial vehicle and related device
By combining UAVs with convolutional downsampling and Transformer encoders to classify power equipment defects, the problems of low efficiency and high cost in traditional methods are solved, and efficient and accurate power equipment defect identification and intelligent management are achieved.
Patent Information
- Application Number
- CN202511490431.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-02-17
AI Technical Summary
Traditional power equipment defect detection methods are inefficient, costly, and difficult to adapt to new defect types. They also require a lot of manual annotation and model retraining, making it difficult to meet the requirements of high real-time performance and high reliability in power inspection.
A UAV-based method for classifying power equipment defects is adopted. Local semantic features are extracted through convolutional downsampling and Transformer encoder, and image retrieval technology is combined to identify defect types. A lightweight image library is constructed and supports zero-shot recognition and new category expansion.
It significantly improves identification accuracy and system robustness, reduces labor costs and risks, supports rapid identification of new defect types, adapts to the diversity and changes of power equipment, and enhances the intelligent management level of power systems.
Smart Images

Figure CN121544520A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and more particularly to a method and apparatus for classifying defects in power equipment based on unmanned aerial vehicles (UAVs). Background Technology
[0002] Traditional power equipment defect detection relies on manual inspections or deep learning algorithms such as object detection or image classification. Manual inspections are inefficient, risky, and costly. Currently used deep learning methods typically require large amounts of manually labeled sample data and supervised training to obtain classifiers or detectors for automatic defect identification. However, power equipment defects are diverse, and new fault forms constantly emerge over time due to the use of new materials or changes in the external environment. This leads to existing models having insufficient generalization ability and difficulty in covering new defect types. Furthermore, traditional methods often require re-collecting samples, labeling data, and retraining the model when identifying new defect categories. This process is not only cumbersome and costly but also slow, failing to meet the high real-time and high reliability requirements of power equipment inspections. Summary of the Invention
[0003] The following is an overview of the topics described in detail in this article.
[0004] The purpose of this application is to at least partially solve one of the technical problems existing in the related technologies. The embodiments of this application provide a method and related apparatus for classifying defects in power equipment based on unmanned aerial vehicles.
[0005] An embodiment of the first aspect of this application, a method for classifying defects in power equipment based on unmanned aerial vehicles (UAVs), is characterized by comprising: Acquire images of power equipment; The power equipment image is convolutionally downsampled to obtain a first feature. Multiple local regions with the highest attention scores in the first feature are selected as primitives. The primitives are encoded to obtain encoded features, which include local semantic features and global retrieval vectors. The defect type of the power equipment image is determined based on the similarity between the encoded features and the defect image sample, wherein the defect image sample is labeled with a defect type tag.
[0006] According to certain embodiments of the first aspect of this application, defect image samples with the same defect type label are grouped into the same group.
[0007] According to certain embodiments of the first aspect of this application, the defective image samples are assigned to a new category group, and defective image samples with unknown defect types are assigned to the new category group.
[0008] According to certain embodiments of the first aspect of this application, the primitives retain the geometric and textural features of the defective area of the power equipment and remove redundant background features.
[0009] According to certain embodiments of the first aspect of this application, encoding the primitives to obtain encoded features includes: The primitives are encoded using a Transformer encoder to obtain encoded features; The Transformer encoder includes a multi-head self-attention module with multiple layers stacked.
[0010] According to certain embodiments of the first aspect of this application, determining the defect type of the power equipment image based on the similarity between the encoded features and defect image samples includes: Calculate the cosine similarity between the encoded features and various defect image samples; The defect type corresponding to the defect image sample with the highest cosine similarity is taken as the defect type of the power equipment image.
[0011] According to certain embodiments of the first aspect of this application, determining the defect type of the power equipment image based on the similarity between the encoded features and defect image samples includes: Calculate the cosine similarity between the encoded features and various defect image samples; Based on the cosine similarity from high to low, the defect types corresponding to the top k defect image samples are selected as candidate defect types. Based on the power equipment image, expert identification is performed to determine the defect type of the power equipment image from the candidate defect types.
[0012] According to certain embodiments of the first aspect of this application, determining the defect type of the power equipment image based on the similarity between the encoded features and defect image samples includes: When the similarity between the encoded features and each defect image sample is less than a preset similarity threshold, the defect type of the power equipment image is set to an unknown defect type.
[0013] According to a second aspect of this application, an electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the UAV-based power equipment defect classification method as described in the first aspect of this application.
[0014] According to a third aspect of this application, a computer storage medium stores computer-executable instructions for performing the UAV-based power equipment defect classification method as described in the first aspect of this application.
[0015] The above-mentioned solution has at least the following beneficial effects: It significantly improves recognition accuracy and system robustness through image retrieval technology and cross-image matching mechanisms. By extracting structurally perceptual features from suspected defect areas and performing cross-image matching at the local detail level, it can accurately identify defect images that exhibit significant deformation due to differences in angle, lighting, and material. This not only solves the problems of low recognition efficiency, strong sample dependence, and difficulty in category expansion in power inspection tasks, but also significantly improves the level of intelligent management of the power system and reduces labor costs and risks. Attached Figure Description
[0016] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0017] Figure 1 This is a flowchart illustrating the steps of a method for classifying defects in power equipment. Figure 2 This is a diagram illustrating the sub-steps for determining the defect type of an electrical equipment image based on the similarity between encoded features and defect image samples. Figure 3 This is a flowchart illustrating the steps of the Top-K category sorting and candidate output mechanism; Figure 4 This is a flowchart illustrating the steps of the unknown class identification and confidence threshold mechanism. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0019] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, or the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0020] The embodiments of this application will be further described below with reference to the accompanying drawings.
[0021] Embodiments of this application provide a method and related apparatus for classifying defects in power equipment based on unmanned aerial vehicles (UAVs).
[0022] Reference Figure 1 The method for classifying defects in power equipment includes, but is not limited to, the following steps: Step S100: Obtain an image of the power equipment; Step S200: Convolution downsampling is performed on the power equipment image to obtain the first feature. Multiple local regions with the highest attention scores in the first feature are selected as primitives, and the primitives are encoded to obtain the encoded features. Step S300: Determine the defect type of the power equipment image based on the similarity between the encoded features and the defect image sample, wherein the defect image sample is labeled with a defect type label.
[0023] Before classifying defects in power equipment, a defect image library and feature indexing system are constructed.
[0024] In the defect image library, defect image samples with the same defect type label are grouped together.
[0025] Based on a large amount of image data collected by the power operation and maintenance department during previous inspections, a power equipment defect image library was constructed. The construction of this image library does not require pixel-level annotation or bounding box annotation, nor does it require complex division of training and test sets; it only requires simple classification and archiving of images according to defect type. Each category corresponds to a defect tag, such as insulators (cracks, damage, contamination), conductors (corrosion, foreign object entanglement, broken strands), and towers (rust, loose screws), etc. To ensure the scalability and generalization ability of the image library, image sources can include, but are not limited to: samples with confirmed defects from historical inspection images; standard defect samples manually photographed or selected by experts; typical defect images generated by simulation systems; and third-party image data platforms or shared resources from enterprises. Each type of image sample is grouped into the same group by folder or tag. The entire image library does not require additional manual annotation work, nor does it require modeling of the image structure, texture, or positional relationships. This lightweight image library construction method greatly reduces system construction costs and the barrier to entry.
[0026] Defective image samples are assigned to new category groups, and defective image samples with unknown defect types are assigned to these new category groups. When a new type of defect is encountered, its image sample can be added to a new category folder or label set to incrementally expand the image library. The entire recognition system does not require retraining or structural modification, demonstrating strong scalability.
[0027] Each type of defect image is denoted as a set: .
[0028] In step S100, during power line inspection, a drone equipped with high-resolution imaging equipment acquires images of areas such as power transmission lines and substation equipment. To ensure the accuracy and efficiency of identification, the system first performs preliminary preprocessing on the acquired raw images to extract image areas containing suspected defects.
[0029] The image detection process is not limited; defect images can be obtained through existing target detection algorithms or manual screening. Regardless of the method used, the system input is always one or more pre-located defect image fragments—images containing only the defect structure region, with an image size suitable for subsequent recognition processing. These defect images, as input to the algorithm, will enter the subsequent feature extraction and image retrieval modules to complete the defect type identification task. By focusing on the local defect region, background interference information can be effectively avoided, improving the accuracy and efficiency of subsequent image retrieval.
[0030] For step S200, the power equipment image is convolutionally downsampled to obtain the first feature. Multiple local regions with the highest attention scores in the first feature are selected as primitives, and the primitives are encoded to obtain the encoded features.
[0031] The encoding features include local semantic features and global retrieval vectors.
[0032] Specifically, traditional image feature extraction methods mostly employ fixed-size slices or uniform receptive field convolutional networks for feature encoding. This approach ignores the complexity of the image's internal structure, especially in power line inspection images, where defect areas often exhibit complex details and irregular shapes. Therefore, simple uniform convolutional methods are insufficient to effectively capture their semantic expression. To achieve accurate classification of defect images, a structure-aware image encoder is used to extract deep semantic features from defect images. This encoder effectively captures the texture, edge, and structural information of defect areas in the image and constructs a discriminative image representation, serving as the basis for subsequent image retrieval and similarity matching.
[0033] The structure-aware image encoder includes a learnable visual segmentation module and a Transformer encoder.
[0034] For the learnable visual segmentation module, the goal is to extract a set of structurally differentiated primitives from the input defect image. Through lightweight convolutional feature analysis and an attention mechanism, highly discriminative local regions are dynamically selected as primitives from the image. Convolutional downsampling is performed on the power equipment image to obtain the first feature, and the multiple local regions with the highest attention scores from the first feature are selected as primitives. The attention score is calculated based on an attention scoring function.
[0035] The primitive is represented as: The primitives retain the geometric and textural features of the defective areas of the power equipment, while removing redundant background features.
[0036] For the Transformer encoder, primitives are encoded to obtain encoded features. The Transformer encoder is driven by retrieval vectors and can further integrate local structural information to form a unified image representation.
[0037] The input to a Transformer consists of n structural primitives and one special retrieval primitive. This is used to capture the global semantics of the entire graph. The input sequence is in the form of: .
[0038] The Transformer encoder consists of L stacked multi-head self-attention modules. The encoding process is represented as follows: Local semantic features are obtained. The search terms are used as the image embedding vector to obtain the global search vector, i.e.: .
[0039] This vector will be used for subsequent image similarity calculations and defect category inference. This structure-aware image encoder can fully extract detailed features and semantic information from defective images, compressing the image into a discriminative vector representation in the feature space. This encoder has the following advantages: enhanced local structure modeling capabilities, applicable to detail-dependent defects such as cracks and breaks; compressed image information redundancy, reducing background interference; fusion of global retrieval vectors and local semantic features, improving the classification discriminative power of the image representation; strong versatility, adaptability to new image types, and ease of cross-category inference and zero-shot identification. This module provides a structured, low-dimensional, and semantically expressive feature vector representation for subsequent image retrieval and defect classification.
[0040] For step S300, traditional image matching methods often rely on simple global feature similarity calculations, such as Euclidean distance or cosine similarity. This approach ignores local structural differences between images and heterogeneous details across samples. Especially in power line inspection tasks, defective images may have factors such as occlusion, angle changes, and lighting interference, making it easy to misjudge based solely on global matching. By using a local-global alignment mechanism, through cross-image primitive alignment and relational reasoning networks, the similarity between two images is modeled at the local semantic level, ultimately achieving more discriminative category reasoning.
[0041] After processing by a structure-aware image encoder, the input power equipment images and various sample images from the image library are transformed into a unified feature representation, specifically including a global retrieval vector and several local semantic features. To achieve accurate classification between defect images and image library samples, a semantic alignment and similarity inference mechanism between images enables the determination of defect category based solely on image-level similarity without relying on label supervision.
[0042] Reference Figure 2 The method for determining the defect type of a power equipment image based on the similarity between the encoded features and defect image samples includes the following steps: Step S311, calculating the cosine similarity between the encoded features and various types of defect image samples; Step S312, taking the defect type corresponding to the defect image sample with the highest cosine similarity as the defect type of the power equipment image.
[0043] Suppose that the input defect image, after being structure-aware encoding, forms a primitive sequence as follows: The primitive sequence formed by defective image samples in the image library is as follows: The similarity between the two is defined as: .
[0044] Finally, a local matching similarity matrix of size m×n can be constructed as follows: .
[0045] The sparsity of the attention distribution is controlled by a temperature factor. Finally, the similarity of all primitive pairs is aggregated into a single matching representation vector using attention pooling, as follows: Where σ represents the Sigmoid function, and the output value s∈[0,1] represents the probability that two images belong to the same defect category. During the testing phase, the system calculates the above similarity score between the input image and all samples in the image library, and selects the category with the highest score as the final recognition result.
[0046] Let the highest score of the k-th class image in the image library be: The predicted defect type is: .
[0047] Through the aforementioned matching and inference mechanism, semantic alignment, structural difference perception, and similarity quantification between images are effectively achieved, offering the following significant advantages: support for fine-grained structural alignment between images, adapting to image matching across various angles, sizes, and deformations; joint modeling of global and local information for more accurate and robust matching; output of continuous probability scores, supporting Top-K recommendation, confidence threshold filtering, and an "unknown class" early warning mechanism; and replacement of traditional classifiers to construct a new paradigm retrieval system capable of inference without training. This module is the core of supporting zero-shot recognition and dynamic expansion of new classes, breaking through the dependence of traditional models on fixed training sets and providing structured, highly robust, and highly scalable technical support for the intelligent classification of power defect images.
[0048] A weakly supervised classification strategy based on image retrieval is adopted, which identifies and judges the defect category by matching the similarity between the input image and samples of each category in the image library. This strategy not only reduces the dependence on manual annotation and model training, but also has the capabilities of zero-shot recognition, category scalability, confidence control, Top-K output, and unknown class warning.
[0049] Reference Figure 3 For the Top-K category ranking and candidate output mechanism, the defect type of the power equipment image is determined based on the similarity between the encoded features and the defect image samples, including the following steps: Step S321, calculate the cosine similarity between the encoded features and the defect image samples of each category; Step S322, sort the defect types of the top k defect image samples according to the cosine similarity from high to low, and select the defect types corresponding to the top k defect image samples as candidate defect types; Step S323, perform expert identification based on the power equipment image, and determine the defect type of the power equipment image from the candidate defect types.
[0050] In cases where images are blurry, structurally incomplete, or have overlapping occlusions, an image may simultaneously approximate multiple categories. This is addressed through a Top-K output mechanism. Output the top K most similar categories to facilitate rapid subsequent judgment based on expert experience and avoid false positives and false negatives.
[0051] Reference Figure 4 For the unknown class identification and confidence threshold mechanism, the defect type of the power equipment image is determined based on the similarity between the encoded features and the defect image samples, including the following steps: Step S331, when the similarity between the encoded features and each defect image sample is less than the preset similarity threshold, the defect type of the power equipment image is set to the unknown defect type.
[0052] Considering the possibility of novel, unseen defects in power systems, a similarity-based unknown class identification mechanism is used to reduce the risk of misjudgment. Let the similarity threshold be... If the maximum score for all categories is less than this threshold, it will be automatically classified as an unknown category. This mechanism ensures the system's robustness in open-world conditions and supports the screening of unknown samples, expert review, and sample accumulation.
[0053] Regarding zero-shot recognition capability and category expansion mechanism: Traditional classification models often require retraining the network model once a new category is introduced, which incurs high costs in industrial practice. A true zero-shot recognition capability is achieved through an image retrieval mechanism: simply adding images of new category defects to the image library is sufficient for new category recognition without requiring model structure modifications or retraining. The specific process is as follows: maintaining a constantly updatable defect image library; organizing and archiving new category images; and matching all image inputs with both new and old images through vector retrieval to complete inference. This mechanism ensures the system possesses strong dynamic incremental learning capabilities, adapting to the constantly evolving reality of power equipment defects.
[0054] This UAV-based power equipment defect classification method features a flexible and easily expandable image retrieval and classification framework applicable to various scenarios: inspection centers can deploy complete models using standard servers; field maintenance personnel can use edge devices (such as portable AI terminals and mobile workstations) for identification; it supports offline image library preloading for independent operation in offline environments; and its user-friendly image input and output interface facilitates integration into UAV inspection platforms or power fault management systems. Compared to traditional manual inspection or supervised classifier systems, this method significantly reduces human intervention and modeling costs while substantially improving identification efficiency, accuracy, and adaptability to new defects, making it suitable for intelligent and automated deployment of power grid equipment defect identification.
[0055] While achieving automatic image classification, this method possesses powerful zero-shot recognition capabilities, effectively addressing the key challenges of "diverse categories, few samples, rapid changes, and strong dependencies" in power defect identification. Compared to traditional methods, it offers the following advantages: First, this method does not rely on a large number of manually labeled samples; defect images only need to be simply organized by category, significantly reducing the system's construction threshold and sample preparation costs. After encoding image features, the system can directly compare similarity with a defect image database without needing to build a dedicated classifier for each type of defect, completely eliminating the dependence on labeled data in traditional supervised learning.
[0056] Secondly, it supports zero-shot recognition and possesses excellent model expansion and scenario generalization capabilities. In traditional methods, once a new category is added, the entire model often needs to be retrained, resulting in low deployment efficiency and high maintenance costs. However, in this system, new defect images can be added to the image library to achieve new category recognition, truly realizing a "plug-and-play" recognition system, which is very suitable for future-oriented intelligent power inspection tasks.
[0057] By introducing image retrieval technology and cross-image matching mechanisms, the recognition accuracy and system robustness are significantly improved. By extracting structurally perceptual features from suspected defective areas and performing cross-image matching at the local detail level, it can accurately identify defective images with large deformations due to differences in angle, lighting, and material. Compared with traditional classifiers, it has stronger anti-perturbation capabilities and adaptability to real-world scenarios.
[0058] Furthermore, this system requires only one general-purpose model to complete all defect identification tasks, resulting in low computational costs, flexible deployment, and stable operation. Users can deploy this model at the inspection center workstation or on-site using portable terminals (such as tablets or embedded edge devices), greatly reducing the system limitations that rely on computing resources or network connections, and truly propelling power inspection tasks from "manual image screening" to "intelligent image understanding."
[0059] It not only solves the core pain points in power inspection tasks such as low identification efficiency, strong sample dependence, and difficulty in category expansion, but also significantly improves the level of intelligent management of the power system and reduces labor costs and risks.
[0060] Embodiments of this application provide an electronic device. The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the UAV-based power equipment defect classification method described above.
[0061] This electronic device can be any smart terminal, including computers.
[0062] In general, for the hardware structure of electronic devices, the processor can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, to execute relevant programs and implement the technical solutions provided in the embodiments of this application.
[0063] The memory can be implemented in the form of read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory and is called and executed by the processor.
[0064] Input / output interfaces are used to implement information input and output.
[0065] The communication interface is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0066] The bus transmits information between various components of a device, such as the processor, memory, input / output interfaces, and communication interfaces. The processor, memory, input / output interfaces, and communication interfaces communicate with each other within the device via the bus.
[0067] Embodiments of this application provide a computer storage medium. The computer storage medium stores computer-executable instructions for executing the UAV-based power equipment defect classification method described above.
[0068] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium. In the foregoing description of this specification, references to terms such as "one embodiment," "another embodiment," or "some embodiments," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of this application. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0069] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0070] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0071] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0072] If the integrated unit is implemented as 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 this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0073] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed between each other may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms. Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
[0074] The above is a detailed description of the preferred embodiments of this application, but this application is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A method for classifying defects in power equipment based on unmanned aerial vehicles (UAVs), characterized in that, include: Acquire images of power equipment; The power equipment image is convolutionally downsampled to obtain a first feature. Multiple local regions with the highest attention scores in the first feature are selected as primitives. The primitives are encoded to obtain encoded features, which include local semantic features and global retrieval vectors. The defect type of the power equipment image is determined based on the similarity between the encoded features and the defect image sample, wherein the defect image sample is labeled with a defect type tag.
2. The method for classifying power equipment defects based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, Defect image samples with the same defect type label are grouped together.
3. The method for classifying power equipment defects based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The defective image samples are assigned to a new category group, and defective image samples with unknown defect types are assigned to the new category group.
4. The method for classifying power equipment defects based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The primitives retain the geometric and textural features of the defective areas of the power equipment and remove redundant background features.
5. The method for classifying power equipment defects based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, The process of encoding the primitives to obtain encoded features includes: The primitives are encoded using a Transformer encoder to obtain encoded features; The Transformer encoder includes a multi-head self-attention module with multiple layers stacked.
6. The method for classifying power equipment defects based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, Determining the defect type of the power equipment image based on the similarity between the encoded features and the defect image samples includes: Calculate the cosine similarity between the encoded features and various defect image samples; The defect type corresponding to the defect image sample with the highest cosine similarity is taken as the defect type of the power equipment image.
7. The method for classifying power equipment defects based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, Determining the defect type of the power equipment image based on the similarity between the encoded features and the defect image samples includes: Calculate the cosine similarity between the encoded features and various defect image samples; Based on the cosine similarity from high to low, the defect types corresponding to the top k defect image samples are selected as candidate defect types. Based on the power equipment image, expert identification is performed to determine the defect type of the power equipment image from the candidate defect types.
8. The method for classifying power equipment defects based on unmanned aerial vehicles (UAVs) according to claim 1, characterized in that, Determining the defect type of the power equipment image based on the similarity between the encoded features and defect image samples includes: When the similarity between the encoded features and each defect image sample is less than a preset similarity threshold, the defect type of the power equipment image is set to an unknown defect type.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the UAV-based power equipment defect classification method as described in any one of claims 1 to 8.
10. A computer storage medium, characterized in that, The device stores computer-executable instructions for performing the UAV-based power equipment defect classification method as described in any one of claims 1 to 8.