A method and system for retrieving power images
By using the Swin-Transformer triple attention collaborative network and a distributed feature index library, the problems of multi-granularity feature representation and task generalization in power equipment image retrieval are solved, achieving high-precision power image retrieval with low false detection rate and supporting efficient retrieval under multiple tasks.
Patent Information
- Application Number
- CN202511543630.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-10-28
AI Technical Summary
Existing deep learning models suffer from problems such as the inability to express multi-granularity features, fragmented channel-space modeling, and lack of task generalization mechanisms in power equipment image retrieval. These issues result in insufficient retrieval accuracy and robustness, failing to meet the high-efficiency, accurate, and widespread requirements of power systems.
A triple attention collaborative network with Swin-Transformer as the backbone is adopted, which combines a spectral sensing channel attention module and a multi-scale spatial attention module. Through a few-sample contrastive distillation training strategy, a distributed feature index library is established to achieve multi-scale feature fusion and unified representation across tasks.
It significantly improves the accuracy and robustness of power image retrieval, reduces the false detection rate, enhances the model's generalization ability and computational efficiency, and supports efficient retrieval under multi-task conditions.
Smart Images

Figure CN121009203B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power image retrieval technology, and particularly relates to a method and system for retrieving power images. Background Technology
[0002] With the deepening of the digital transformation strategy of the power system, intelligent inspection of transmission and substation equipment has become a core link in ensuring the safe and stable operation of the power grid. Currently, mobile inspection platforms, represented by unmanned aerial vehicles (UAVs) and inspection robots, have become the core data source for power inspection, continuously generating a large amount of power equipment image data. These massive amounts of power images / power equipment images contain information such as equipment operating status, potential defects and hidden dangers, and environmental changes, and are the core carrier for building a digital archive of the entire life cycle of equipment.
[0003] To fully leverage the value of this image data and achieve a strategic transformation from "passive emergency repair" to "proactive operation and maintenance," building a precise, efficient, and intelligent power image retrieval system has become a rigid requirement for the industry. The core objective of this system is to be able to retrieve, within milliseconds, all relevant images containing the same equipment entity or similar defect patterns from a massive historical and real-time image database based on query requirements for specific equipment (such as insulator strings, tension clamps, surge arresters, etc.) or specific defects (such as insulator spontaneous explosion, hardware corrosion, conductor strand breakage, etc.). This capability plays an irreplaceable and crucial role in the intelligent verification and accurate tracing of equipment defects, the cross-period dynamic comparison and analysis of operational status, the knowledge accumulation and reuse of typical defect cases, and even the prediction of equipment health status based on historical data. It is not only a powerful tool for improving operation and maintenance efficiency and reducing labor costs, but also a core technological support for achieving lean equipment management, assisting intelligent decision-making, and ensuring the inherent safety of the power grid.
[0004] However, current mainstream deep learning-based image retrieval methods, whether the classic convolutional neural network (CNN) architecture or the emerging original vision transformer (Vision Transformer) model, all exhibit significant limitations when applied to the specific scenario of aerial images of power equipment. They struggle to meet the aforementioned business requirements of high precision, high efficiency, and high generalization, resulting in the following problems:
[0005] First, there is the problem of multi-granularity feature representation failure and scale discontinuity. Aerial images of power equipment are characterized by complex backgrounds (often containing a large amount of vegetation, buildings, and mountain interference) and a huge range of target scales (from macroscopic entire towers to microscopic insulators, pins, and equalizing rings). Existing CNN models rely heavily on fixed-size convolutional kernels for local feature extraction. While their shallow features have high spatial resolution, they lack semantic information and are difficult to effectively represent small parts. Deep features, although semantically rich, suffer from a severe decrease in spatial resolution due to pooling operations, resulting in the loss of a large amount of key details of small targets, forming a scale discontinuity dilemma of "no semantics in shallow layers and no precision in deep layers." Although the original Vision Transformer has an advantage in modeling long-range dependencies in images due to its global self-attention mechanism, its isotropic processing and equal weighting of image patches make the features of small but critical equipment components (such as missing pins or small cracks) easily submerged or diluted by complex background information. Existing multi-scale feature fusion schemes (such as Feature Pyramid Networks, FPN) typically employ only simple upsampling and element-wise addition / concatenation operations, lacking an explicit modeling mechanism for the hierarchical and structured relationships between the tower structure (macro) - insulator string (meso) - fittings / pins (micro) . This makes it difficult for the model to construct a highly discriminative cross-granularity joint feature representation, ultimately resulting in a high misclassification rate (misclassification as similar structures) for image pairs with similar overall tower structures but vastly different states of key local components (e.g., the entire tower has a consistent appearance but a certain string of insulators has spontaneously exploded), severely limiting the accuracy of retrieval. Furthermore, the inter-patch operations of Vit further burden computational resources, and limited computing power restricts the computational accuracy and training depth of Vit.
[0006] Secondly, the fragmented channel-space modeling and insufficient utilization of spectral characteristics are problematic. Mainstream retrieval models (such as the widely used ResNet as a feature extractor, supplemented by classifiers like SVM) often perform equal weighting or simple linear combination of RGB three-channel information, failing to fully explore and utilize the unique spectral reflectance characteristics of power equipment materials. For example, ceramic insulators, galvanized metal fittings, silicone rubber composite insulation materials, and oxidized and corroded areas exhibit spectral response patterns that are significantly different from natural backgrounds (such as green vegetation, bare soil, and water bodies) in specific wavelength bands. This crude utilization of channel information significantly reduces the model's ability to distinguish target equipment in scenarios with complex and varied backgrounds (such as dense vegetation cover, soil reflection, and shadow interference). Existing methods typically simply stack or independently design channel attention (such as the SENet module) and spatial attention mechanisms, lacking a joint modeling mechanism for collaborative optimization and deep interaction between channel and spatial domain information. This fragmentation makes it difficult for the model to adaptively focus on key spectral channels and key spatial regions related to power equipment. When faced with strong interference backgrounds, the false positive rate often exceeds 35%, significantly reducing the reliability of the retrieval system.
[0007] Third, the lack of task generalization mechanisms and feature space fragmentation are significant problems. Current power image retrieval applications often train and maintain multiple independent specialized models for different business objectives (such as precise defect retrieval, equipment inventory, and family defect analysis). This approach suffers from severe feature space fragmentation. Models fine-tuned for specific tasks (such as defect detection) learn feature representations that are highly specialized to the discrimination boundary of that task. This leads to significant semantic gaps in the feature vectors extracted from the same equipment entity in different task libraries (such as defect image libraries vs. equipment inventory image libraries). Experimental data shows that the cosine similarity is generally below 0.4. This not only results in a huge waste of model storage, computing resources, and maintenance costs, but also makes cross-task knowledge transfer and information linkage (e.g., quickly locating equipment with defects in inventory images, or associating basic equipment information in defect images) extremely difficult, hindering the deep integration and mining of data value and the realization of one-stop intelligent operation and maintenance. Existing models generally lack a unified, compatible, and scalable feature encoding architecture and adaptive task adaptation mechanism, making it impossible to efficiently support diverse downstream retrieval needs in a single model.
[0008] In summary, how to overcome the technical bottlenecks of existing deep learning models in multi-granularity feature fusion, channel-space collaborative perception, and cross-task unified representation, and design intelligent retrieval core technologies that are suitable for ultra-large-scale power images, have strong discriminative power, high robustness, and broad task generalization, has become a key scientific problem and engineering challenge that urgently needs to be tackled in the field of intelligent operation and maintenance in the power industry. Summary of the Invention
[0009] To address the problems existing in the prior art, this invention proposes a method and system for retrieving power images.
[0010] The technical solution of the present invention is as follows:
[0011] A method for retrieving power images, comprising:
[0012] Power images covering various power scenarios are preprocessed, including size normalization, data augmentation, and defect-oriented enhancement.
[0013] Feature vectors of preprocessed power images are extracted using a triple attention collaborative network with Swin-Transformer as the backbone and embedded with a spectral sensing channel attention module and a multi-scale spatial attention module. The triple attention collaborative network is trained using a few-sample contrastive distillation training strategy that considers power semantic triple sampling and joint loss function.
[0014] The feature vectors are normalized and dimensionality is reduced using spectral-sensitive PCA, and a distributed feature index library is established.
[0015] The feature vector extracted from the power image to be retrieved through the triple attention collaborative network is used as the query vector. The similarity is calculated with all feature vectors in the distributed feature index library, and the similarity is sorted from high to low. Finally, the sorted search results are output.
[0016] Furthermore, the specific methods for the preprocessing include:
[0017] Receive power images covering various power scenarios and build a spatiotemporally aligned image library;
[0018] Perform bilinear interpolation on the power images in the image library, scale to a fixed size while maintaining the aspect ratio, and fill the boundaries with zero values, with a fill rate of less than or equal to 15%.
[0019] Perform CutMix hybrid enhancement for local feature perception of power equipment, and combine LAB spatial color dithering to improve illumination robustness;
[0020] A mask is dynamically generated for high-frequency defects in power images and a random background is embedded.
[0021] Furthermore, the triple attention collaborative network first performs patching and windowing on the input image through the PatchPartition module of the Swin Transformer, and then constructs feature maps of different scales sequentially through the four stages of the Swin Transformer.
[0022] At the end of each stage, a spectral sensing channel attention module is inserted. This spectral sensing channel attention module performs global average pooling, one-dimensional convolution with an adaptive kernel size, and sigmoid activation on the output feature map of each stage to generate a channel weight vector. This channel weight vector is multiplied with the original output feature map channel by channel to obtain a channel-enhanced feature map.
[0023] In the multi-scale spatial attention module embedded at the output of the fourth stage of the Swin Transformer, the input feature map is uniformly divided into multiple mutually exclusive subgroups along the channel dimension, and each subgroup learns local semantics in an independent parameter space. Subsequently, two differential branches are deployed in parallel within each subgroup, combining horizontal and vertical global average pooling, and aggregating channel context through 1×1 convolution to construct a lightweight channel descriptor branch for capturing short-range neighborhood responses. The second branch uses a 3×3 convolution branch to extract medium- and long-range spatial dependencies in an equivalent receptive field expansion manner.
[0024] After feature transformation within each of the two branches, spatial attention weights are generated using the Softmax function and then multiplied by matrix with the feature map provided by the other path to model long-range global dependencies. The output features of the two branches are concatenated and fused with a 1×1 convolution, and then a two-dimensional spatial attention weight map is generated using the Sigmoid activation function. This weight map is multiplied pixel-by-pixel with the original input feature map to achieve adaptive recalibration in the spatial domain. Finally, the enhancement results of all subgroups are concatenated along the channel dimension to form a joint representation enhancement feature map that combines local detail awareness with global context consistency.
[0025] Furthermore, the few-sample contrastive distillation training strategy employs a dynamic joint loss function of hard triplet loss and cross-entropy loss and performs power semantic triplet sampling, where the anchor point and positive sample are images of the same power equipment at different times or angles, dynamically controls the sample ratio, and uses elastic feature caching to manage negative samples.
[0026] Furthermore, the specific methods for normalizing the feature vectors and performing spectrally sensitive PCA dimensionality reduction, and establishing a distributed feature index library, include:
[0027] The eigenvectors are L2-normalized and then compressed using spectrally sensitive PCA.
[0028] Construct the Faiss-IVF4096_SQ8 index to form a distributed feature index library.
[0029] Furthermore, the specific method for using the feature vector extracted from the power image to be retrieved via the triple attention collaborative network as the query vector, calculating the similarity with all feature vectors in the distributed feature index library, sorting them from high to low similarity, and finally outputting the sorted retrieval results includes:
[0030] First, the power image to be retrieved is input into a triple attention collaborative network, which outputs the corresponding feature vector.
[0031] Next, the feature vector corresponding to the power image to be retrieved is compared with the candidate feature vectors in the distributed feature index library to perform vector-wise cosine similarity calculation. The normalized similarity score is obtained by the ratio of the vector dot product to the L2 norm. Then, the priority queue algorithm based on max heap is called to complete the global Top-K sorting to ensure that the returned sequence is strictly arranged in descending order of similarity.
[0032] The final output sequence of power images maintains semantic consistency with the retrieved power images.
[0033] A power image retrieval system includes a preprocessing module, a feature extraction and training module, a feature index database establishment module, and a similarity calculation module;
[0034] The preprocessing module is used to preprocess power images covering multiple power scenarios. The preprocessing includes size normalization, data augmentation, and defect-oriented enhancement.
[0035] The feature extraction and training module is used to extract feature vectors from the preprocessed power image using a triple attention collaborative network with Swin-Transformer as the backbone and embedded with a spectral sensing channel attention module and a multi-scale spatial attention module. The triple attention collaborative network is trained using a few-sample contrastive distillation training strategy that considers power semantic triple sampling and joint loss function.
[0036] The feature index library establishment module is used to normalize the feature vectors and perform spectral-sensitive PCA dimensionality reduction, and to establish a distributed feature index library.
[0037] The similarity calculation module is used to take the feature vector extracted from the power image to be retrieved through the triple attention collaborative network as the query vector, calculate the similarity with all feature vectors in the distributed feature index library, sort them from high to low similarity, and finally output the sorted search results.
[0038] An electronic device includes a memory and a processor, the memory storing a computer program, the processor being configured to invoke and run the computer program stored in the memory to perform the method as described in any of the preceding methods.
[0039] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] This invention provides a method and system for retrieving power images. The method, through a triple attention collaborative network, addresses the problems of insufficient multi-scale feature perception and coarse utilization of channel / spatial information, significantly improving retrieval accuracy and robustness. The spectral sensing channel attention module (ECA module) in the triple attention collaborative network enhances the ability to capture the spectral response of key materials (such as corrosion) in power equipment through grouped adaptive convolution; the multi-scale spatial attention module (EMA module), through a parallel multi-branch structure, achieves precise focusing on cross-granularity features of the entire tower and its components. The two modules work together to enhance the spectral sensing channel, focus on multi-scale space, maintain computational efficiency, improve the model's retrieval accuracy for small targets, and reduce the false detection rate for highly similar equipment.
[0042] This invention's Triple Attention Collaborative Network addresses the challenges of training difficult models and weak generalization ability in scenarios with scarce samples by employing a few-sample contrastive distillation training strategy, significantly reducing the model's dependence on labeled data. Furthermore, it enhances the model's discriminative ability through anchor point-positive sample-negative sample combinations and dynamic hard example mining. Attached Figure Description
[0043] Figure 1 This is a flowchart illustrating the power image retrieval method of the present invention in an embodiment.
[0044] Figure 2 This is a schematic diagram of the ECA module structure of the present invention in an embodiment;
[0045] Figure 3 This is a schematic diagram of the EMA module structure of the present invention in an embodiment;
[0046] Figure 4 This is one of the schematic diagrams of the search results in the embodiment;
[0047] Figure 5 This is the second schematic diagram of the search results in the example;
[0048] Figure 6 This is the third illustration of the search results in the example. Detailed Implementation
[0049] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0050] Example 1:
[0051] The present invention provides a method for retrieving power images, such as... Figures 1-3 As shown, it includes the following steps:
[0052] S1. Preprocessing of power images covering multiple power scenarios, including size normalization, data augmentation, and defect-oriented enhancement;
[0053] S2. The feature vector of the preprocessed power image is extracted using a triple attention collaborative network with Swin-Transformer as the backbone and embedded with a spectral sensing channel attention module and a multi-scale spatial attention module. The triple attention collaborative network adopts a channel, spatial and multi-scale triple collaborative enhancement architecture and is trained by a few-sample contrastive distillation training strategy that considers power semantic triple sampling and joint loss function.
[0054] S3. Normalize the feature vectors and perform spectral-sensitive PCA dimensionality reduction, and establish a distributed feature index library;
[0055] S4. The feature vector extracted from the power image to be retrieved through the triple attention collaborative network is used as the query vector. The similarity is calculated with all feature vectors in the distributed feature index library, and the similarity is sorted from high to low. Finally, the sorted search results are output.
[0056] Furthermore, specific preprocessing methods include:
[0057] Multi-source data acquisition: Receive multi-source power images covering various power scenarios, and construct a spatiotemporally aligned image library, also known as a power image database;
[0058] Power images are images covering multiple categories of power equipment and typical weather, lighting, and occlusion conditions. These power images have different shooting times, GPS, and equipment IDs, and can be obtained from various data sources such as inspection drones, fixed cameras, inspection robots, and power grid PMS systems. Power images can be semantically labeled according to a three-level tagging system of "equipment-environment-defect" to form a scalable power image database.
[0059] The power image data preprocessing workflow includes the following three key steps:
[0060] Size normalization flow: Bilinear interpolation is performed on power images in the image library to scale them to a fixed size while maintaining the original aspect ratio, thus eliminating scale inconsistencies caused by sensor differences. Zero-value padding is used at the boundaries during scaling, with a padding rate not exceeding 15%, to avoid image distortion.
[0061] Enhanced flow: The CutMix hybrid enhancement method is introduced to enhance the model's ability to perceive local features of power equipment, with the hyperparameter β set to 0.4; at the same time, the illumination robustness of the image is enhanced by dithering in the LAB color space, with the parameters set such that the luminance component ΔL is less than or equal to 20 and the color component variation does not exceed 8.
[0062] Defect-oriented enhancement: For high-frequency defects in power images (such as insulator bursting, wire clamp corrosion, etc.), a mask is dynamically generated and embedded into a random background (such as conductors, tower materials, etc.), thereby improving the model's generalization ability in complex scenes.
[0063] Furthermore, in this invention, a triple attention collaborative network is used as the feature extraction network. This feature extraction network first performs patching and windowing on the input image through the Patch Partition module of the Swin Transformer, and then constructs feature maps of different scales in sequence through the four stages of the Swin Transformer.
[0064] The Swin-Transformer skeleton employs a hierarchical window attention mechanism, dividing the input power image into non-overlapping local windows. Cross-window information interaction is achieved through Shift-Window Multi-Head Self-Attention (SW-MSA), thereby capturing long-range dependencies without increasing secondary complexity. In terms of feature dimensionality reduction and channel expansion at each stage, the network deploys Patch Merging operations at the end of each stage: concatenating adjacent 2×2 pixel blocks along the channel dimension and mapping them to a higher dimension through a linear projection layer, thereby compressing the spatial resolution by four times and expanding the channel dimension by two times. This process stacks hierarchically, forming a bottom-up multi-scale feature pyramid. Its hierarchical features preserve fine-grained local textures while aggregating long-range semantic dependencies, providing a rich multi-scale input base for the subsequent ECA-EMA attention module.
[0065] At the end of each stage, a spectral sensing channel attention module, namely the Efficient Channel Attention module or ECA module, is inserted. The ECA module uses grouped adaptive 1D convolution to divide the channels into an electrical material-related group (ceramic / glass / composite insulator) and a background group, and learns the convolution kernel size (k=3 / 5 / 7) for each group. The output channel weight vector wc enhances the near-infrared channel response of the rusted area, with a weight increase of 1.8±0.3 times. Specifically, the spectral sensing channel attention module performs global average pooling (to obtain feature vectors), one-dimensional convolution with adaptive kernel size (to obtain channel-enhanced feature vectors), and sigmoid activation operation on the output feature maps of each stage to generate channel weight vectors. Subsequently, the channel weight vectors are multiplied with the original feature map channel by channel to enhance the key information channels while suppressing redundant channels, thereby obtaining a more discriminative channel-enhanced feature map.
[0066] The fourth-stage output embeds a multi-scale spatial attention module, the Efficient Multi-scale Attention module, or EMA module. The multi-scale spatial attention module follows the design paradigm of grouping-parallelism-fusion, adopts a parallel branch structure, captures pin-level local small features and tower-shaped global feature modeling; and strengthens the response of defective regions and maintains structural integrity through a cross-spatial aggregation mechanism.
[0067] First, the input feature map is uniformly divided into multiple mutually exclusive subgroups along the channel dimension, and each subgroup learns local semantics in an independent parameter space. Then, two differential branches are deployed in parallel within each subgroup: First, a lightweight channel descriptor branch is constructed by combining horizontal and vertical global average pooling and aggregating channel context through 1×1 convolutions to capture short-range neighborhood responses; the second branch uses a 3×3 convolution branch to extract medium- and long-range spatial dependencies in an equivalent receptive field expansion manner.
[0068] After feature transformation within each of the two branches, spatial attention weights are generated using the Softmax function and then multiplied by a matrix (Matmul) with the feature map provided by the other path to model long-range global dependencies. The output features from both branches are concatenated and fused with a 1×1 convolution, then a two-dimensional spatial attention weight map is generated using the Sigmoid activation function. This weight map is then reweighted pixel-by-pixel with the original input feature map to achieve adaptive recalibration in the spatial domain. Finally, the enhanced results of all subgroups are concatenated along the channel dimension to form a joint representation enhancement feature map that combines local detail awareness with global contextual consistency. This provides a multi-scale feature base with enhanced discriminative power for subsequent retrieval tasks.
[0069] Specifically, the feature maps are subjected to H-average pooling, W-average pooling, and 3×3 convolution, respectively.
[0070] The H average pooling result and the W average pooling result are concatenated and then convolved with 1×1. The sigmoid activation function is applied to each of them. The result is then combined with the original feature map and processed by the reweight module. After processing by the reweight module, the result is then processed by GroupNorm, average pooling and Softmax, and finally combined with the 3×3 convolution result and entered into the first Matmul module for further processing.
[0071] The 3×3 convolution result is further processed by average pooling and softmax, and then combined with the result from the reweight module before entering the second Matmul module for further processing.
[0072] The results of the first Matmul module and the second Matmul module are combined with the meta-feature map after a Sigmoid activation operation to obtain an enhanced feature map.
[0073] The resulting feature extraction network, such as Figure 1 As shown, its structure includes, in sequence, a Patch Partition module, four sequentially connected processing stages (Stage 1 to Stage 4), and an EMA module at the end. Each stage consists of an ECA module and a corresponding layer, where Stage 1, Stage 2, Stage 3, and Stage 4 correspond to Layer 1, Layer 2, Layer 3, and Layer 4, respectively. Each layer is composed of several Swin Transformer basic units stacked together. A Swin Transformer block typically consists of a multilayer perceptron (MLP), windowed self-attention (W-MSA) or shifted-window self-attention (SW-MSA), and a layer normalization layer (LN) connected in series. It is responsible for multi-scale feature extraction and transformation, gradually constructing a feature map with rich semantic information.
[0074] Furthermore, the few-sample contrastive distillation training strategy employs a dynamic joint loss function of hard triplet loss and cross-entropy loss, thereby maximizing the utilization of image information and group label information, constraining the distance between samples of the same subject, and performing power semantic triple sampling, where anchor points and positive samples are images of the same power equipment at different times or angles. The sample ratio is dynamically controlled and negative samples are managed using elastic feature caching, for example, anchor point:positive sample:negative sample = 1:1:2, and 60% of the negative samples are difficult samples to mine online.
[0075] Furthermore, the difficult-to-load samples include power equipment of different phases on the same tower and similar power equipment across towers; among them, power equipment of different phases on the same tower, such as A-phase and B-phase clamps, and similar power equipment across towers, such as tension clamps and suspension clamps, have an inclination angle difference of less than 5°.
[0076] The elastic feature cache uses a queue-style negative sample storage. In each training session, while ensuring the proportion of samples extracted from hard examples, other existing negative sample queues are randomly sampled and popped to ensure the diversity of training samples and reduce GPU cache pressure.
[0077] Furthermore, specific methods for normalizing feature vectors and performing spectrally sensitive PCA dimensionality reduction, and for establishing a distributed feature index library, include:
[0078] Normalization and dimensionality reduction: L2-normalization is performed on the feature vector, and spectral-sensitive PCA compression is used to retain the sensitive frequency bands of power equipment; for example, the network outputs a 768-dimensional feature vector, which is compressed to 256 dimensions after L2-normalization and spectral-sensitive PCA, with a variance retention rate of more than 93%.
[0079] A distributed index library is built, constructing the Faiss-IVF4096_SQ8 index to form a distributed feature index library. Combined with GPU quantization acceleration, it supports millisecond retrieval of tens of thousands of images.
[0080] Furthermore, the specific method for using the feature vector extracted from the power image to be retrieved via the triple attention collaborative network as the query vector, calculating its similarity with all feature vectors in the distributed feature index library, and sorting them from high to low similarity to finally output the sorted retrieval results includes:
[0081] During the retrieval phase, the power image to be retrieved is first input into the triple attention collaborative network, and the corresponding feature vector is output as the query vector.
[0082] Next, the feature vector corresponding to the power image to be retrieved is compared with the candidate feature vectors in the distributed feature index library to perform vector-wise cosine similarity calculation. The normalized similarity score is obtained by the ratio of the vector dot product to the L2 norm. Then, the priority queue algorithm based on max heap is called to complete the global Top-K sorting to ensure that the returned sequence is strictly arranged in descending order of similarity.
[0083] The final output power image sequence maintains semantic consistency with the retrieved power images, effectively supporting subsequent defect verification, status assessment, and closed-loop operation and maintenance decisions.
[0084] Example 2:
[0085] The present invention provides a power image retrieval system, comprising a preprocessing module, a feature extraction and training module, a feature index database establishment module, and a similarity calculation module;
[0086] The preprocessing module is used to preprocess power images covering various power scenarios. The preprocessing includes size normalization, data augmentation, and defect-oriented enhancement.
[0087] The feature extraction and training module is used to extract feature vectors from preprocessed power images using a triple attention collaborative network with Swin-Transformer as the backbone and embedded with a spectral sensing channel attention module and a multi-scale spatial attention module. The triple attention collaborative network is trained using a few-sample contrastive distillation training strategy that considers power semantic triple sampling and joint loss function.
[0088] The feature index library building module is used to normalize feature vectors and perform spectral-sensitive PCA dimensionality reduction, and to build a distributed feature index library.
[0089] The similarity calculation module is used to take the feature vector extracted from the power image to be retrieved through the triple attention collaborative network as the query vector, calculate the similarity with all feature vectors in the distributed feature index library, sort them from high to low similarity, and finally output the sorted search results.
[0090] Example 3:
[0091] An electronic device according to the present invention includes a memory and a processor. The memory stores a computer program, and the processor is used to call and run the computer program stored in the memory to perform the method as described in the above embodiments.
[0092] The present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above embodiments.
[0093] Example 4:
[0094] This example applies the retrieval method and system of the present invention to the equipment status retrieval process of an ultra-high voltage substation, as detailed below:
[0095] 1) Implementation plan deployment architecture;
[0096] A three-tiered intelligent collaborative architecture of "end-edge-cloud" was constructed at the 500kV ultra-high voltage hub substation, realizing data closed loop and optimal allocation of computing power, configured as follows:
[0097] The edge perception layer deploys inspection drones and orbital robots equipped with high-precision positioning modules (RTK-GNSS), and carries a lightweight retrieval model compressed using TensorRT deep quantization, reducing the model size to 38% of the original. Through dynamic pruning and INT8 quantization techniques, real-time device feature extraction is achieved on the NVIDIA Jetson AGX Orin edge computing unit, with single-frame processing latency strictly controlled to less than or equal to 50ms, meeting the real-time requirements of the "Technical Specification for Power Inspection Robots" (Q / GDW 12068-2020).
[0098] The substation-level intelligent layer deploys a heterogeneous computing server cluster (2×NVIDIA A100 GPUs + 4×AMD EPYC CPUs) locally to build a multimodal feature knowledge base for all substation equipment, covering 12 core equipment categories such as circuit breakers, disconnect switches, and current transformers. It adopts a hierarchical graph storage architecture, using equipment spatial coordinates (GIS latitude and longitude) as the primary key, and linking them to equipment ledger parameters, historical defect records, and multi-period feature vectors. It supports millisecond-level nearest neighbor retrieval, and the ANN algorithm index construction latency is less than 15 minutes.
[0099] In the cloud-based collaboration layer, the provincial main data center synchronizes feature indexes from each station through a dedicated encrypted power channel, establishing a cross-regional spatiotemporal joint retrieval engine. Employing a distributed ElasticSearch+Kafka stream processing framework, it achieves second-level response times for hundreds of millions of image feature vectors, supporting cross-site historical data comparison and defect tracking for the same device throughout its entire lifecycle (planning-construction-operation).
[0100] 2) Typical application scenario: Intelligent tracing and proactive defense of power transmission equipment faults;
[0101] Scenario: A 500kV line suffered an insulator flashover fault due to a lightning strike, requiring investigation into potential hazards in equipment from the same batch.
[0102] Intelligent search process:
[0103] Precise data acquisition: The drone automatically hovers to the faulty tower based on laser point cloud positioning and obtains local high-definition images of the insulator string (224×224 pixels, spatial resolution up to 0.5cm / pixel) through an adaptive ROI cropping algorithm.
[0104] Feature construction: Multi-scale deep hash features (256-bit binary encoding) are extracted from edge devices and transmitted to the local server via the site's 5G private network;
[0105] Cross-period matching: The server initiates a multi-level index joint query: Level 1 retrieval: Match images from the past 3 years in the same tower's historical database (cosine similarity threshold greater than 0.9); Level 2 retrieval: Associate with the same model of equipment in the provincial defect database (cross-site retrieval response time less than 800ms);
[0106] Knowledge mining: Accurately matched flashover cases of insulators of the same model and associated them with the common defect of "equipotential ring installation misalignment" in the maintenance records;
[0107] Decision-making closed loop: Based on the search results, generate equipment health early warning map and trigger proactive operation and maintenance strategies: conduct precise re-testing of the same batch of towers with relevant deployment locations throughout the province using ultraviolet imaging; replace insulator strings with potential hazards, with a total of 87 strings replaced; optimize the installation process standard of equalizing rings to comply with clause 4.2.3 of the revised "Fitting Installation Operation Manual".
[0108] Results analysis:
[0109] Defect early prevention mechanism: By constructing a predictive maintenance closed loop of "feature retrieval - defect association - batch traceability", the discovery node of typical insulation defects is brought forward from the post-fault traceability to the latent period warning, with an average lead time of greater than or equal to 14 months.
[0110] Resource reuse rate: The single model supports 6 types of tasks, including equipment inventory, defect retrieval, and status assessment. Feature space compatibility verification shows that the cross-task cosine similarity is greater than 0.82.
[0111] Standard-driven effect: The "defect-process-standard" feedback chain driven by search results promotes the iterative updates of three maintenance procedures, forming a technical standard feedback mechanism. Some search results are shown below. Figures 4-6 As shown.
[0112] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for retrieving power images, characterized in that, include: Power images covering various power scenarios are preprocessed, including size normalization, data augmentation, and defect-oriented enhancement. Feature vectors of preprocessed power images are extracted using a triple attention collaborative network with Swin-Transformer as the backbone and embedded with a spectral sensing channel attention module and a multi-scale spatial attention module. The triple attention collaborative network is trained using a few-sample contrastive distillation training strategy that considers power semantic triple sampling and joint loss function. The feature vectors are normalized and dimensionality is reduced using spectral-sensitive PCA, and a distributed feature index library is established. The feature vector extracted from the power image to be retrieved through the triple attention collaborative network is used as the query vector. The similarity is calculated with all feature vectors in the distributed feature index library, and the similarity is sorted from high to low. Finally, the sorted search results are output. The triple attention collaborative network first performs patching and windowing on the input image through the Patch Partition module of Swin-Transformer, and then constructs feature maps of different scales in sequence through the four stages of Swin-Transformer. At the end of each stage, a spectral sensing channel attention module is inserted. This spectral sensing channel attention module performs global average pooling, one-dimensional convolution with an adaptive kernel size, and sigmoid activation on the output feature map of each stage to generate a channel weight vector. This channel weight vector is multiplied with the original output feature map channel by channel to obtain a channel-enhanced feature map. In the multi-scale spatial attention module embedded at the output of the fourth stage of the Swin-Transformer, the input feature map is uniformly divided into multiple mutually exclusive subgroups along the channel dimension, and each subgroup learns local semantics in an independent parameter space. Subsequently, two differential branches are deployed in parallel within each subgroup, combining horizontal and vertical global average pooling, and aggregating channel context through 1×1 convolution to construct a lightweight channel descriptor branch for capturing short-range neighborhood responses. The second branch uses a 3×3 convolution branch to extract medium- and long-range spatial dependencies in an equivalent receptive field expansion manner. After feature transformation within the two branches, spatial attention weights are generated using the Softmax function, and then matrix multiplication is performed with the feature map provided by the other path to model long-range global dependencies. The output features from the two branches are concatenated and fused with a 1×1 convolution, and then a two-dimensional spatial attention weight map is generated by the Sigmoid activation function. This weight map is multiplied pixel by pixel with the original input feature map to achieve adaptive recalibration in the spatial domain. Finally, the enhancement results of all subgroups are concatenated along the channel dimension to form a joint representation enhancement feature map that combines local detail awareness with global context consistency.
2. The method for retrieving power images according to claim 1, characterized in that, The specific methods for the preprocessing include: Receive power images covering various power scenarios and build a spatiotemporally aligned image library; Perform bilinear interpolation on the power images in the image library, scale to a fixed size while maintaining the aspect ratio, and fill the boundaries with zero values, with a fill rate of less than or equal to 15%. Perform CutMix hybrid enhancement for local feature perception of power equipment, and combine LAB spatial color dithering to improve illumination robustness; A mask is dynamically generated for high-frequency defects in power images and a random background is embedded.
3. The method for retrieving power images according to claim 1, characterized in that, The few-sample contrastive distillation training strategy employs a dynamic joint loss function of hard triplet loss and cross-entropy loss and performs power semantic triplet sampling. The anchor point and positive sample are images of the same power equipment at different times or angles. The sample ratio is dynamically controlled and negative samples are managed using elastic feature caching.
4. The method for retrieving power images according to claim 1, characterized in that, The specific methods for normalizing feature vectors, performing spectral-sensitive PCA dimensionality reduction, and establishing a distributed feature index library include: The eigenvectors are L2-normalized and then compressed using spectrally sensitive PCA. Construct the Faiss-IVF4096_SQ8 index to form a distributed feature index library.
5. The method for retrieving power images according to claim 1, characterized in that, The specific method for using the feature vector extracted from the power image to be retrieved via the triple attention collaborative network as the query vector, calculating the similarity with all feature vectors in the distributed feature index, sorting them from high to low similarity, and finally outputting the sorted retrieval results includes: First, the power image to be retrieved is input into a triple attention collaborative network, which outputs the corresponding feature vector. Next, the feature vector corresponding to the power image to be retrieved is compared with the candidate feature vectors in the distributed feature index library to perform vector-wise cosine similarity calculation. The normalized similarity score is obtained by the ratio of the vector dot product to the L2 norm. Then, the priority queue algorithm based on max heap is called to complete the global Top-K sorting to ensure that the returned sequence is strictly arranged in descending order of similarity. The final output sequence of power images maintains semantic consistency with the retrieved power images.
6. A power image retrieval system, characterized in that, It includes a preprocessing module, a feature extraction and training module, a feature index library establishment module, and a similarity calculation module; The preprocessing module is used to preprocess power images covering multiple power scenarios. The preprocessing includes size normalization, data augmentation, and defect-oriented enhancement. The feature extraction and training module is used to extract feature vectors from the preprocessed power image using a triple attention collaborative network with Swin-Transformer as the backbone and embedded with a spectral sensing channel attention module and a multi-scale spatial attention module. The triple attention collaborative network is trained using a few-sample contrastive distillation training strategy that considers power semantic triple sampling and joint loss function. The feature index library establishment module is used to normalize the feature vectors and perform spectral-sensitive PCA dimensionality reduction, and to establish a distributed feature index library. The similarity calculation module is used to take the feature vector extracted from the power image to be retrieved through the triple attention collaborative network as the query vector, calculate the similarity with all feature vectors in the distributed feature index library, sort them from high to low similarity, and finally output the sorted search results. The triple attention collaborative network first performs patching and windowing on the input image through the Patch Partition module of Swin-Transformer, and then constructs feature maps of different scales in sequence through the four stages of Swin-Transformer. At the end of each stage, a spectral sensing channel attention module is inserted. This spectral sensing channel attention module performs global average pooling, one-dimensional convolution with an adaptive kernel size, and sigmoid activation on the output feature map of each stage to generate a channel weight vector. This channel weight vector is multiplied with the original output feature map channel by channel to obtain a channel-enhanced feature map. In the multi-scale spatial attention module embedded at the output of the fourth stage of the Swin-Transformer, the input feature map is uniformly divided into multiple mutually exclusive subgroups along the channel dimension, and each subgroup learns local semantics in an independent parameter space. Subsequently, two differential branches are deployed in parallel within each subgroup, combining horizontal and vertical global average pooling, and aggregating channel context through 1×1 convolution to construct a lightweight channel descriptor branch for capturing short-range neighborhood responses. The second branch uses a 3×3 convolution branch to extract medium- and long-range spatial dependencies in an equivalent receptive field expansion manner. After feature transformation within the two branches, spatial attention weights are generated using the Softmax function, and then matrix multiplication is performed with the feature map provided by the other path to model long-range global dependencies. The output features from the two branches are concatenated and fused with a 1×1 convolution, and then a two-dimensional spatial attention weight map is generated by the Sigmoid activation function. This weight map is multiplied pixel by pixel with the original input feature map to achieve adaptive recalibration in the spatial domain. Finally, the enhancement results of all subgroups are concatenated along the channel dimension to form a joint representation enhancement feature map that combines local detail awareness with global context consistency.
7. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor being configured to invoke and run the computer program stored in the memory to perform the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 5 above.
Citation Information
Patent Citations
Inspection method, device and equipment based on digital airspace system and medium
CN119989283A
Aluminum profile surface defect detection method based on DMSA-Swinin-Unet network model
CN120339262A