Method for detecting discharge trace of power distribution insulator and related equipment
By constructing fine-grained text prompts and cross-modal feature fusion technology, the problems of sample scarcity and manual dependence in the detection of discharge traces in distribution insulators have been solved, achieving efficient and accurate discharge trace identification and localization, and improving detection efficiency and interpretability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI ZHONGKE LEINAO INTELLIGENCE TECH CO LTD
- Filing Date
- 2026-03-25
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, the detection of discharge traces in distribution insulators relies on human experience, resulting in low detection efficiency and high safety risks. Traditional image processing methods are sensitive to changes in lighting and background and lack generalization ability. Deep learning-based methods face difficulties in model training when discharge trace samples are scarce and lack adaptability and semantic understanding for unknown discharge patterns.
We construct a fine-grained set of text prompts, combine spatial location enhancement and cross-modal feature fusion, and use deformable convolution and semantic denoising techniques to achieve discharge trace recognition and pixel-level localization under zero-sample and few-sample conditions. This integrates image features and text semantic information, reducing reliance on manual annotation.
It enables accurate detection and pixel-level localization of discharge traces even when samples are scarce, improving detection efficiency, accuracy, and interpretability, ensuring that every insulator defect is effectively checked, and reducing reliance on manual judgment.
Smart Images

Figure CN121904056B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of intelligent inspection and defect detection technology of power equipment, specifically involving a method for detecting discharge traces on distribution insulators, a system for detecting discharge traces on distribution insulators, an electronic device, and a computer-readable storage medium. Background Technology
[0002] Distribution insulators are core components in power distribution networks that ensure insulation between conductors and towers. Surface discharge marks on these insulators are a significant early sign of insulation degradation. Failure to detect and address them promptly and accurately can easily lead to flashovers, tripping, or even large-scale power outages. Currently, manual inspections rely heavily on the experience of maintenance personnel, resulting in low efficiency, high safety risks, and inconsistent judgment standards among different personnel, making it difficult to guarantee consistent detection. Traditional image processing detection methods are sensitive to changes in lighting and background, lack generalization ability, and cannot adapt to the diversity of discharge mark morphologies. Deep learning-based detection methods rely on large-scale labeled samples; the scarcity of discharge mark samples makes model training difficult, and they suffer from poor adaptability to unknown discharge morphologies and a lack of semantic understanding of the anomalies. Therefore, a corresponding detection scheme is urgently needed to address these problems. Summary of the Invention
[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method for detecting discharge traces in distribution insulators, which can solve problems such as insufficient model generalization ability due to sample scarcity, reliance on human experience for detection, low anomaly location accuracy, and lack of interpretability.
[0004] To achieve the above objectives, a first aspect of the present invention proposes a method for detecting discharge traces on distribution insulators, comprising: constructing a set of text prompt words describing the normal state and the abnormal state containing discharge traces of the insulator; wherein the text prompt words for the abnormal state contain text descriptions of fine-grained semantics for different discharge traces; locating the foreground region of the insulator in the image to be detected, and spatially enhancing the text prompt words in the set of text prompt words based on the position information of the foreground region of the insulator to generate enhanced text prompt words carrying position information; encoding the enhanced text prompt words to obtain normal text feature vectors and abnormal text feature vectors; extracting global image features and first local image patch features at multiple levels from the image to be detected; calculating the global image features and the normal text feature vectors and... The similarity of abnormal text feature vectors is used to perform semantic denoising on normal and abnormal text feature vectors, resulting in denoised normal and abnormal text feature vectors. For each first local image patch feature, deformable convolution is applied to the first local image patch feature for adaptive sampling and feature transformation to obtain the first local feature representation of the first local image patch feature. The similarity between the first local feature representation and the denoised normal and abnormal text feature vectors is calculated to generate normal similarity maps and abnormal similarity maps. Cross-layer fusion of the normal and abnormal similarity maps is performed to obtain a zero-sample anomaly localization heatmap. The pixel-level position of discharge traces on the insulator surface is determined based on the zero-sample anomaly localization heatmap, and the discharge trace detection result is output.
[0005] In some embodiments, the method further includes: using normal insulator images without discharge traces as normal samples; extracting second local image block features at multiple levels from the normal samples to construct a normal feature memory; calculating the minimum matching distance between the first local image block features at multiple levels of the image to be detected and the corresponding second local image block features in the normal feature memory to generate a few-sample anomaly alert map; fusing the few-sample anomaly alert map with a zero-sample anomaly localization heatmap to obtain an enhanced final anomaly localization map; determining the pixel-level position of discharge traces on the insulator surface based on the final anomaly localization map, and outputting the discharge trace detection result.
[0006] In some embodiments, spatial enhancement is performed on text prompts in the text prompt word set based on the location information of the insulator foreground region to generate enhanced text prompts carrying location information, including: discretizing the foreground region into multiple sub-regions, concatenating the location phrases of the sub-regions with the text prompts of the abnormal state, and generating enhanced text prompts.
[0007] In some embodiments, the similarity between global image features and normal text feature vectors and abnormal text feature vectors is calculated, and semantic denoising is performed on normal text feature vectors and abnormal text feature vectors based on the similarity, including: setting a first similarity threshold and a second similarity threshold, determining text feature vectors that simultaneously satisfy the condition that the similarity with normal text feature vectors is higher than the first similarity threshold and the similarity with abnormal text feature vectors is higher than the second similarity threshold as redundant features and removing them, to obtain denoised normal text feature vectors and abnormal text feature vectors.
[0008] In some embodiments, applying deformable convolution to the features of the first local image block for adaptive sampling and feature transformation includes: using multiple deformable convolution modules with different parameters to process the features of the first local image block at the same level or different levels respectively, to obtain multiple sets of first local feature representations; wherein, the multiple deformable convolution modules with different parameters are used to adapt to discharge traces of different scales and shapes.
[0009] In some embodiments, extracting second local image patch features from multiple levels of normal samples to construct a normal feature memory includes: for each level, collecting all second local image patch features of all normal samples at the level to form a set of memory for the level; calculating the minimum matching distance between the first local image patch features of the image to be detected at multiple levels and the second local image patch features of the corresponding level in the normal feature memory, including: for the first local image patch features of the image to be detected at the current level, calculating the cosine distance between the first local image patch features and all second local image patch features in the corresponding set of memory for the level, and taking the minimum value as the anomaly score of the first local image patch features; generating anomaly score maps level by level, and merging the anomaly score maps of each level into a few-sample anomaly hint map.
[0010] In some embodiments, the few-sample anomaly alert map and the zero-sample anomaly location heatmap are fused to obtain an enhanced final anomaly location map, including: performing Gaussian filtering on the zero-sample anomaly location heatmap and the few-sample anomaly alert map respectively; and performing pixel-level weighted averaging or adding the filtered zero-sample anomaly location heatmap and the few-sample anomaly alert map according to preset weights to obtain the final anomaly location map.
[0011] The method for detecting discharge traces on distribution insulators according to embodiments of this application includes: constructing a set of text prompt words to describe the normal state and the abnormal state containing discharge traces of the insulator; wherein the text prompt words for the abnormal state contain text descriptions of fine-grained semantics for different discharge traces; locating the foreground region of the insulator in the image to be detected, and spatially enhancing the text prompt words in the set of text prompt words based on the position information of the foreground region of the insulator to generate enhanced text prompt words carrying position information; encoding the enhanced text prompt words to obtain normal text feature vectors and abnormal text feature vectors; extracting global image features and first local image patch features at multiple levels from the image to be detected; and calculating the global image features, normal text feature vectors, and abnormal text feature vectors. The similarity of the data is used to perform semantic denoising on the normal and abnormal text feature vectors, resulting in denoised normal and abnormal text feature vectors. For each first local image patch feature, deformable convolution is applied to the first local image patch feature for adaptive sampling and feature transformation to obtain the first local feature representation of the first local image patch feature. The similarity between the first local feature representation and the denoised normal and abnormal text feature vectors is calculated to generate normal similarity maps and abnormal similarity maps. Cross-layer fusion is performed on the normal similarity maps and abnormal similarity maps to obtain a zero-sample anomaly localization heatmap. The pixel-level position of the discharge traces on the insulator surface is determined based on the zero-sample anomaly localization heatmap, and the discharge trace detection result is output. Therefore, this method can solve problems such as insufficient model generalization ability due to scarce samples, reliance on human experience for detection, low accuracy of anomaly localization, and lack of interpretability. By constructing fine-grained text semantic prompts and combining spatial location enhancement and cross-modal feature fusion, it can identify and locate various discharge traces at the pixel level. It can quickly lock anomaly areas and match the corresponding defect types and location information, ensuring that every insulator defect can be effectively checked. At the same time, by integrating image features and text semantic information, it eliminates the need for a large amount of manual annotation or on-site inspection and judgment, thus improving the efficiency, accuracy, and interpretability of discharge trace detection.
[0012] To achieve the above objectives, a second aspect of the present invention proposes a discharge trace detection system for distribution insulators, comprising: a construction module configured to construct a set of text prompt words describing the normal state and the abnormal state containing discharge traces of the insulator; wherein the text prompt words for the abnormal state contain text descriptions of fine-grained semantics for different discharge traces; a localization module configured to locate the foreground region of the insulator in the image to be detected, and spatially enhance the text prompt words in the text prompt word set according to the position information of the foreground region of the insulator to generate enhanced text prompt words carrying position information; an encoding module configured to encode the enhanced text prompt words to obtain normal text feature vectors and abnormal text feature vectors; an extraction module configured to extract global image features and first local image patch features at multiple levels from the image to be detected; and a calculation module configured to calculate global image features. The system employs several modules: a first local image block feature vector and a second local image feature vector. The first local image block feature vector is used to perform semantic denoising based on the similarity between the feature vector and the normal and abnormal text feature vectors, resulting in denoised normal and abnormal text feature vectors. A transformation module is configured to apply deformable convolution to each first local image block feature for adaptive sampling and feature transformation, obtaining a first local feature representation. The similarity between this first local feature representation and the denoised normal and abnormal text feature vectors is calculated, generating a normal similarity map and an abnormal similarity map. The normal and abnormal similarity maps are then fused across layers to obtain a zero-sample anomaly localization heatmap. A detection module is configured to determine the pixel-level location of discharge traces on the insulator surface based on the zero-sample anomaly localization heatmap and output the discharge trace detection results.
[0013] A discharge trace detection system for distribution insulators according to an embodiment of this application includes: a construction module configured to construct a set of text prompt words describing the normal state and the abnormal state containing discharge traces of the insulator; wherein the text prompt words for the abnormal state contain text descriptions of fine-grained semantics for different discharge traces; a positioning module configured to locate the foreground region of the insulator in the image to be detected, and spatially enhance the text prompt words in the set of text prompt words based on the position information of the foreground region of the insulator to generate enhanced text prompt words carrying position information; an encoding module configured to encode the enhanced text prompt words to obtain normal text feature vectors and abnormal text feature vectors; an extraction module configured to extract global image features and multiple levels of first local image patch features of the image to be detected; and a calculation module configured to calculate the global image features and normal text feature vectors. The similarity between the current feature vector and the abnormal text feature vector is used to perform semantic denoising on the normal text feature vector and the abnormal text feature vector based on the similarity, resulting in denoised normal text feature vectors and abnormal text feature vectors; the transformation module is configured to apply deformable convolution to the first local image block feature for each first local image block feature to perform adaptive sampling and feature transformation, obtain the first local feature representation of the first local image block feature, calculate the similarity between the first local feature representation and the denoised normal text feature vector and abnormal text feature vector, generate a normal similarity map and an abnormal similarity map, and perform cross-layer fusion on the normal similarity map and the abnormal similarity map to obtain a zero-sample anomaly localization heatmap; the detection module is configured to determine the pixel-level position of the discharge trace on the insulator surface based on the zero-sample anomaly localization heatmap, and output the discharge trace detection result. Therefore, this application can solve the problems of insufficient model generalization ability due to sample scarcity, reliance on human experience for detection, low anomaly localization accuracy, and lack of interpretability. By constructing fine-grained text semantic prompts and combining spatial location enhancement and cross-modal feature fusion, it can identify and locate various discharge traces at the pixel level. It can quickly lock anomaly areas and match the corresponding defect types and location information, ensuring that every insulator defect can be effectively checked. At the same time, by integrating image features and text semantic information, it eliminates the need for a large amount of manual annotation or on-site inspection and judgment, thus improving the efficiency, accuracy, and interpretability of discharge trace detection.
[0014] To achieve the above objectives, a third aspect of the present invention provides an electronic device, comprising: a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and when the program or instructions are executed by the processor, implement the steps of the method for detecting discharge traces on distribution insulators as described in any of the preceding claims.
[0015] The electronic device according to the embodiments of this application, by executing the above-described method for detecting discharge traces in distribution insulators, can solve problems such as insufficient model generalization ability due to scarce samples, reliance on human experience for detection, low accuracy of anomaly localization, and lack of interpretability. By constructing fine-grained text semantic prompts and combining spatial location enhancement and cross-modal feature fusion, it can identify and locate various types of discharge traces at the pixel level, quickly lock abnormal areas and match corresponding defect types and location information, ensuring that every insulator defect can be effectively checked. At the same time, by integrating image features and text semantic information, it eliminates the need for extensive manual annotation or on-site inspection and judgment, thus improving the efficiency, accuracy, and interpretability of discharge trace detection.
[0016] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the method for detecting discharge traces in distribution insulators as described in any of the preceding claims.
[0017] According to the computer-readable storage medium of the present invention, by executing the above-described method for detecting discharge traces in distribution insulators, the problem of insufficient model generalization ability due to sample scarcity, reliance on human experience for detection, low anomaly localization accuracy, and lack of interpretability can be solved. By constructing fine-grained text semantic prompts and combining spatial location enhancement and cross-modal feature fusion, various types of discharge traces can be identified and located at the pixel level. Abnormal areas can be quickly located and the corresponding defect type and location information can be matched to ensure that every insulator defect can be effectively checked. At the same time, by integrating image features and text semantic information, there is no need to rely on a large amount of manual annotation or on-site inspection and judgment, which improves the efficiency, accuracy, and interpretability of discharge trace detection.
[0018] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0019] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0020] Figure 1 This is a flowchart illustrating a method for detecting discharge traces on power distribution insulators according to an embodiment of this application.
[0021] Figure 2 This is a schematic diagram illustrating the generation of normal / abnormal text feature vectors in a method for detecting discharge traces on power distribution insulators according to an embodiment of this application.
[0022] Figure 3This is a flowchart illustrating the zero-sample anomaly localization process of a discharge trace detection method for distribution insulators in an embodiment of this application.
[0023] Figure 4 This is a flowchart illustrating the few-sample anomaly localization process of a discharge trace detection method for distribution insulators in an embodiment of this application.
[0024] Figure 5 This is a schematic diagram of a discharge trace detection system for power distribution insulators according to an embodiment of this application;
[0025] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.
[0026] Reference numerals: Distribution insulator discharge trace detection system 500, construction module 501, positioning module 502, encoding module 503, extraction module 504, calculation module 505, transformation module 506, detection module 507, processor 610, memory 620, input / output interface 630, communication interface 640, bus 650. Detailed Implementation
[0027] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0028] It should be understood that the steps described in the method embodiments of this application may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this application is not limited in this respect.
[0029] As described in the background section, distribution insulators are key components in power distribution networks that ensure line insulation. Surface discharge marks on their surfaces are an important early indicator of insulation performance degradation. Failure to identify them in time can easily lead to flashover, tripping, or even large-scale power outages. Currently, commonly used detection methods in the industry mainly include manual inspection, traditional image processing detection, and automated detection based on deep learning. Manual inspection relies on the visual judgment and experience of on-site personnel, using pole climbing, binoculars, or drone images for manual verification. However, the judgment standards are inconsistent, inspection efficiency is low, and safety risks are high. Traditional image processing methods perform anomaly analysis based on shallow features such as color, texture, and edges of insulator images, but they are sensitive to lighting and background interference and cannot adapt to the diverse forms of discharge marks. Deep learning-based detection methods train network models using large-scale labeled samples to identify and locate insulator defects. However, model training is difficult in scenarios where discharge mark samples are scarce, the ability to adapt to unknown or novel discharge forms is weak, and there is a lack of semantic understanding of the essence of the anomalies.
[0030] To address the aforementioned shortcomings, the discharge trace detection method for distribution insulators of this invention, through designs such as text prompt construction, spatial location enhancement, semantic denoising, multi-scale deformable cross-modal interaction, and few-sample feature fusion, can solve problems such as insufficient model generalization ability due to scarce samples, reliance on human experience for detection, low anomaly localization accuracy, and lack of interpretability. It achieves accurate detection and pixel-level localization of discharge traces in distribution insulators under zero-sample conditions, ensuring the safe and stable operation of distribution lines.
[0031] The following is for reference. Figures 1-4 This application describes a method for detecting discharge traces on power distribution insulators according to embodiments of the present application.
[0032] like Figure 1 The diagram shown is a flowchart illustrating a method for detecting discharge traces on power distribution insulators according to an embodiment of this application.
[0033] Step S101: Construct a set of text prompt words to describe the normal state and abnormal state containing discharge traces of the insulator; wherein, the text prompt words for the abnormal state contain text descriptions of fine-grained semantics of different discharge traces.
[0034] Specifically, the text prompt word set is divided into two categories of prompt words: those representing the defect-free normal operation of insulators and those representing the abnormal state with discharge traces. The text prompt words for the abnormal state, combined with the actual defect manifestations of discharge traces in distribution insulators, can be described as fine-grained semantics of different types of discharge traces. This includes a text description set of various fine-grained abnormal semantics such as arc ablation and surface carbonization, corresponding to the characteristic attributes of various types of discharge traces.
[0035] Step S102: Locate the foreground region of the insulator in the image to be detected. Based on the position information of the foreground region of the insulator, perform spatial enhancement on the text prompts in the text prompt set to generate enhanced text prompts carrying position information.
[0036] As an optional embodiment, based on the location information of the foreground region of the insulator, spatial enhancement is performed on the text prompts in the text prompt word set to generate enhanced text prompts carrying location information, including: discretizing the foreground region into multiple sub-regions, concatenating the location phrases of the sub-regions with the text prompts of the abnormal state, and generating enhanced text prompts.
[0037] Specifically, for the input image Anomaly detection is performed using a localization model. The foreground region corresponding to the insulator is detected, and its outer bounding box is determined. The anomaly score for the insulator region within the bounding box is calculated using standard methods. For the background region outside the bounding box, the anomaly score is calculated and then multiplied by a parameter. To reduce the interference of the background area on the detection results, the foreground area where the insulator is located is divided into nine sub-regions based on the center point coordinates of the positioning box: upper left, middle left, lower left, upper middle, center, lower middle, upper right, middle right, and lower right. The position information of these sub-regions is then integrated into the original text prompts, giving the text prompts specific image spatial information and generating enhanced text prompts with location indication. For example, "The insulator has dark brown surface carbonization traces along the edge of the shed" can be transformed into "In the upper left corner of the image, the insulator has dark brown surface carbonization traces along the edge of the shed".
[0038] It should be noted that the localization model can use target detection models such as YOLO series, Faster R-CNN, and DINO series. YOLO series can quickly find insulators in images and mark their location. Faster R-CNN is a high-precision target detection model that can identify insulators in images and lock their location range. DINO series can find insulators more accurately in complex backgrounds and has a more stable localization effect.
[0039] Step S103: Encode the enhanced text prompts to obtain normal text feature vectors and abnormal text feature vectors.
[0040] Specifically, the enhanced normal-state text prompts and the enhanced abnormal-state text prompts are respectively input into the selected text encoder. The semantic and spatial information of the prompts is deeply extracted, integrated, and vectorized, and finally two types of feature vectors are output. Among them, the enhanced normal-state text prompts are encoded to obtain normal text feature vectors. The enhanced abnormal status text prompts are encoded to obtain abnormal text feature vectors. The encoding formula is as follows:
[0041]
[0042]
[0043] in, These are normal text prompt words. This is an error message. For text encoders, For normal text feature vectors, This is the feature vector of the abnormal text.
[0044] It should be noted that text encoders such as CLIP, BETR, FastText, and ELMo can be used. CLIP is a text encoder that matches images and text and can extract semantic features of text. BETR can deeply understand the context and fine-grained semantics of text and parse the detailed description of discharge traces. FastText can quickly convert text prompts into stable feature vectors. ELMo can extract the contextual semantic features of text and has good encoding performance for discharge trace text with different expressions.
[0045] Step S104: Extract global image features and first local image patch features at multiple levels from the image to be detected.
[0046] Specifically, considering the requirements for detecting discharge traces on distribution insulators, an image feature extraction network with a depth of no less than 24 layers is selected. Using the input image to be detected as the processing object, inference is performed through the selected feature extraction network. On the one hand, global image features representing the overall information of the entire image to be detected are extracted. Discharge traces may be characterized by their tiny size, uneven distribution, and diverse morphology, making it difficult to rely solely on global features. It is difficult to capture local abnormal details. The first local image patch features of the corresponding layer are extracted at different layers of the feature extraction network (such as layers 6, 12, 18, and 24). The shallow features capture basic details such as texture and color of the insulator surface, which is suitable for the initial recognition of small discharge traces. The deep features capture the semantic information of the image, which is suitable for the recognition of large-scale and complex discharge traces. The intermediate layer features realize the transition between deep and shallow features and the feature expression of discharge traces at different scales.
[0047] It should be noted that the image feature extraction network can use no fewer than 24 layers, such as DETR, deformable DETR, VIT, CLIP, etc. Such models can capture shallow details and deep semantic features of images, and are suitable for the detection needs of discharge traces with diverse shapes and varying scales.
[0048] Step S105: Calculate the similarity between the global image features and the normal text feature vector and the abnormal text feature vector. Based on the similarity, perform semantic denoising on the normal text feature vector and the abnormal text feature vector to obtain the denoised normal text feature vector and abnormal text feature vector.
[0049] As an optional embodiment, the similarity between global image features and normal text feature vectors and abnormal text feature vectors is calculated, and semantic denoising is performed on normal text feature vectors and abnormal text feature vectors based on the similarity, including: setting a first similarity threshold and a second similarity threshold, determining text feature vectors that simultaneously satisfy the condition that the similarity with normal text feature vectors is higher than the first similarity threshold and the similarity with abnormal text feature vectors is higher than the second similarity threshold as redundant features and removing them, to obtain denoised normal text feature vectors and abnormal text feature vectors.
[0050] Specifically, such as Figure 2 The diagram shown illustrates the generation of normal / abnormal text feature vectors in a method for detecting discharge traces on distribution insulators according to an embodiment of this application. It utilizes global image features... Compared with normal text feature vectors respectively Abnormal text feature vectors Cosine similarity is calculated by pre-setting a first similarity threshold and a second similarity threshold, where the first similarity threshold corresponds to global image features. Compared with normal text feature vectors The comparison criteria, the second similarity threshold corresponds to global image features. With abnormal text feature vectors The comparison criteria determine the semantic relevance and discriminative power of text features based on similarity results. The similarity calculation formula is as follows:
[0051]
[0052]
[0053] in, For global image features, For normal text feature vector similarity, This represents the similarity of feature vectors of anomalous texts.
[0054] This will simultaneously satisfy the characteristics of normal text feature vectors Similarity higher than the first similarity threshold and with the feature vector of abnormal text Text feature vectors with similarity scores higher than the second similarity threshold are identified as redundant and interfering features that could easily cause confusion and are removed, ultimately yielding the denoised normal text feature vectors. and the denoised abnormal text feature vector The formula for calculating the overlapping area is as follows:
[0055]
[0056] in, This represents the overlapping regions of similarity distribution.
[0057] Step S106: For each first local image block feature, apply deformable convolution to the first local image block feature for adaptive sampling and feature transformation to obtain the first local feature representation of the first local image block feature. Calculate the similarity between the first local feature representation and the denoised normal text feature vector and abnormal text feature vector to generate a normal similarity map and an abnormal similarity map. Perform cross-layer fusion on the normal similarity map and the abnormal similarity map to obtain a zero-sample anomaly localization heatmap.
[0058] As an optional embodiment, adaptive sampling and feature transformation are performed by applying deformable convolution to the features of the first local image block, including: using multiple deformable convolution modules with different parameters to process the features of the first local image block at the same level or different levels respectively to obtain multiple sets of first local feature representations; wherein, multiple deformable convolution modules with different parameters are used to adapt to discharge traces of different scales and shapes.
[0059] Specifically, such as Figure 3 The diagram illustrates the zero-sample anomaly localization process of a discharge trace detection method for distribution insulators according to an embodiment of this application. Deformable convolution is applied to the first local image block features at each level for adaptive sampling and feature transformation, capturing the local texture and morphological details of the discharge traces. Since discharge traces exhibit differences in scale and shape, such as arc ablation and surface carbonization, multiple deformable convolution modules with different parameters are used to process the first local image block features at the same or different levels. This allows modules with different parameters to adapt to the feature differences of various discharge traces, obtaining multiple sets of first local feature representations. Each set of first local feature representations is then compared with the denoised normal text feature vector. Denoising abnormal text feature vectors The similarity is then summarized to obtain the normal similarity parameters for each level. and anomaly similarity parameter The calculation formula is as follows:
[0060]
[0061] in For deformable convolution, For patch characteristics, where The range is , For upsampling, This indicates the softmax operation, table This indicates a normalization operation.
[0062] Then, the normal similarity parameters at each level and anomaly similarity parameter Perform cross-layer fusion to obtain a global normal similarity map. Similarity map of anomalies Among them, normal similarity map Similarity map of anomalies It can be represented as:
[0063]
[0064]
[0065] For normal similarity graphs Similarity map of anomalies Cross-layer fusion was performed to calculate a zero-sample anomaly localization heatmap. , can be represented as:
[0066]
[0067] The final probability of discharge traces appearing in different areas of the insulator surface is presented.
[0068] Step S107: Determine the pixel-level location of discharge traces on the insulator surface based on the zero-sample anomaly localization thermal map, and output the discharge trace detection results.
[0069] Specifically, a probability threshold is set to adapt to the discharge trace detection scenario. This threshold can be adjusted based on the fine-grained type of discharge trace. For example, if the area of arc ablation anomaly is large and the features are more obvious, the threshold can be appropriately lowered to avoid missed detection. If the surface carbonization anomaly is mostly a small spot with relatively hidden features, the threshold can be appropriately increased to reduce background noise interference. By filtering out areas with a probability higher than the threshold in the thermal map, the pixel-level anomaly locations of discharge traces on the insulator surface are identified. The discharge trace detection results are then output in conjunction with subsequent image-level anomaly analysis.
[0070] As an optional embodiment, the method further includes: using normal insulator images without discharge traces as normal samples; extracting second local image block features at multiple levels from the normal samples to construct a normal feature memory; calculating the minimum matching distance between the first local image block features at multiple levels of the image to be detected and the corresponding second local image block features in the normal feature memory to generate a few-sample anomaly alert map; fusing the few-sample anomaly alert map with the zero-sample anomaly localization heatmap to obtain an enhanced final anomaly localization map; determining the pixel-level position of discharge traces on the insulator surface based on the final anomaly localization map, and outputting the discharge trace detection result.
[0071] Specifically, normal insulator images are selected as normal samples. An appropriate feature extraction network is used to extract second local image patch features at multiple levels in layers 6, 12, 18, and 24. These features are then organized to construct a normal feature memory, which needs to cover multi-scale features such as shallow texture and deep semantics of normal insulators. Within the foreground region of the insulator, the minimum matching distance between the first local image patch features at each level of the image to be detected and the corresponding second local image patch features in the normal feature memory is calculated. The smaller the minimum matching distance, the closer the local region is to the features of a normal insulator; conversely, the greater the minimum matching distance, the more likely an anomaly is to exist. By weighted fusion of the matching results of each layer, a few-sample anomaly warning image is generated. This is a few-sample anomaly indicator. It can highlight local areas that differ significantly from normal features, and provide a small sample anomaly indication image. Heatmap of zero-sample anomaly localization Feature fusion is performed to obtain an enhanced final anomaly localization map. The pixel-level location of the discharge trace is accurately determined based on the final anomaly localization map. Combined with the anomaly type description, the discharge trace detection result containing the anomaly location and anomaly type is output.
[0072] As an optional embodiment, extracting second local image patch features from multiple levels of normal samples to construct a normal feature memory bank includes: for each level, collecting all second local image patch features of all normal samples at the level to form a level memory bank set; calculating the minimum matching distance between the first local image patch features of the image to be detected at multiple levels and the second local image patch features of the corresponding level in the normal feature memory bank, including: for the first local image patch features of the image to be detected at the current level, calculating the cosine distance between the first local image patch features and all second local image patch features in the corresponding level memory bank set, and taking the minimum value as the anomaly score of the first local image patch features; generating anomaly score maps level by level, and merging the anomaly score maps of each level into a few-sample anomaly prompt map.
[0073] Specifically, such as Figure 4The diagram shown is a flowchart illustrating the few-sample anomaly localization process of a discharge trace detection method for distribution insulators according to an embodiment of this application. The cosine distance between a first local image block feature at multiple levels of the image to be detected and all second local image block features in the corresponding level's memory set is calculated using the following formula:
[0074]
[0075] For the first In the memory of each stage, the smaller the cosine distance, the higher the similarity between the local image patch features and the normal sample features, and the lower the probability of anomaly. The larger the cosine distance, the more obvious the difference between the two, and the higher the probability of anomaly. The minimum value is taken as the anomaly score of the first local image patch features. Anomaly score maps are generated layer by layer. The shallow anomaly score map captures minor anomalies such as surface texture and color of the insulator (such as slight carbonization spots), while the deep anomaly score map captures large-scale anomalies at the semantic level (such as large-area arc ablation areas). The anomaly score maps of each level are adaptively weighted and fused to obtain a few-sample anomaly hint map. The calculation formula is as follows:
[0076]
[0077] As an optional embodiment, the few-sample anomaly alert map and the zero-sample anomaly location heatmap are fused to obtain the enhanced final anomaly location map, including: performing Gaussian filtering on the zero-sample anomaly location heatmap and the few-sample anomaly alert map respectively; and performing pixel-level weighted averaging on the filtered zero-sample anomaly location heatmap and the few-sample anomaly alert map, or adding them according to preset weights, to obtain the final anomaly location map.
[0078] Specifically, the few-sample anomaly alert image and the zero-sample anomaly localization heatmap are processed with Gaussian filtering to smooth the pixel grayscale changes in both images and remove isolated noise points and false anomaly regions. The zero-sample anomaly localization heatmap may contain a small number of false high-probability pixels unrelated to actual discharge traces due to slight deviations in text semantic matching. The few-sample anomaly alert image may contain isolated high-anomaly score pixels due to slight deviations in the normal feature memory. Gaussian filtering can weaken noise interference while preserving the edge contours of the core anomaly region. The weighted average value of the filtered few-sample anomaly alert image and the zero-sample anomaly localization heatmap is calculated pixel by pixel, or they are added according to preset weights to obtain the final anomaly localization image. The calculation formula is expressed as follows:
[0079]
[0080] in, It is a Gaussian filter. It is a hyperparameter that controls the smoothness.
[0081] global image features The input adapter unifies the dimensionality and cross-modal semantics of global features and text features, eliminates the differences in feature distribution between the two, and obtains adapted features. The calculation formula is expressed as follows:
[0082]
[0083] in, It is a fully connected layer. For activation layer, This is the adapted feature layer.
[0084] Will The similarity scores are calculated between the anomaly feature vector and the denoised normal text feature vector, respectively, to obtain the image-level anomaly score (a quantified score for determining whether there are discharge traces in the entire image). The calculation formula is as follows:
[0085]
[0086] in, Image-level anomaly score, This is a normalization function used to map the similarity results between global image features and text features to a probability distribution in the [0,1] interval, thereby achieving probabilistic distinction between normal and abnormal categories.
[0087] Select the abnormal text features with the highest similarity and generate the corresponding text description that best matches the image anomaly.
[0088] In summary, the discharge trace detection method for distribution insulators provided in this application includes: constructing a set of text prompt words to describe the normal state and abnormal state containing discharge traces of the insulator; wherein, the text prompt words for the abnormal state contain text descriptions of fine-grained semantics for different discharge traces; locating the foreground region of the insulator in the image to be detected, and spatially enhancing the text prompt words in the text prompt word set based on the position information of the foreground region of the insulator to generate enhanced text prompt words carrying position information; encoding the enhanced text prompt words to obtain normal text feature vectors and abnormal text feature vectors; extracting global image features and first local image patch features at multiple levels from the image to be detected; and calculating the global image features, normal text feature vectors, and abnormal text features. The similarity of vectors is used to perform semantic denoising on normal and abnormal text feature vectors, resulting in denoised normal and abnormal text feature vectors. For each first local image patch feature, deformable convolution is applied to the first local image patch feature for adaptive sampling and feature transformation to obtain the first local feature representation of the first local image patch feature. The similarity between the first local feature representation and the denoised normal and abnormal text feature vectors is calculated to generate normal similarity maps and abnormal similarity maps. Cross-layer fusion is performed on the normal similarity maps and abnormal similarity maps to obtain a zero-sample anomaly localization heatmap. The pixel-level position of discharge traces on the insulator surface is determined based on the zero-sample anomaly localization heatmap, and the discharge trace detection result is output. Therefore, this method can solve problems such as insufficient model generalization ability due to scarce samples, reliance on human experience for detection, low accuracy of anomaly localization, and lack of interpretability. By constructing fine-grained text semantic prompts and combining spatial location enhancement and cross-modal feature fusion, it can identify and locate various discharge traces at the pixel level. It can quickly lock anomaly areas and match the corresponding defect types and location information, ensuring that every insulator defect can be effectively checked. At the same time, by integrating image features and text semantic information, it eliminates the need for a large amount of manual annotation or on-site inspection and judgment, thus improving the efficiency, accuracy, and interpretability of discharge trace detection.
[0089] It should be noted that the method of this embodiment can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method of this embodiment, and the multiple devices will interact with each other to complete the above method.
[0090] It should be noted that the above description describes some embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0091] refer to Figure 5 This is a schematic diagram of a discharge trace detection system for power distribution insulators in an embodiment of this application.
[0092] The discharge trace detection system 500 for power distribution insulators includes: a construction module 501, a positioning module 502, an encoding module 503, an extraction module 504, a calculation module 505, a transformation module 506, and a detection module 507.
[0093] The construction module 501 is configured to construct a set of text prompt words describing the normal state and the abnormal state containing discharge traces of an insulator; wherein the text prompt words for the abnormal state contain text descriptions of fine-grained semantics for different discharge traces; the localization module 502 is configured to locate the foreground region of the insulator in the image to be detected, and perform spatial enhancement on the text prompt words in the text prompt word set based on the position information of the foreground region of the insulator to generate enhanced text prompt words carrying position information; the encoding module 503 is configured to encode the enhanced text prompt words to obtain normal text feature vectors and abnormal text feature vectors; the extraction module 504 is configured to extract global image features and first local image patch features at multiple levels from the image to be detected; the calculation module 505 is configured to calculate the global image features, normal text feature vectors, and abnormal text feature vectors. The text feature vector similarity is used to perform semantic denoising on normal and abnormal text feature vectors to obtain denoised normal and abnormal text feature vectors. The transformation module 506 is configured to apply deformable convolution to adaptive sampling and feature transformation for each first local image block feature to obtain the first local feature representation of the first local image block feature. The similarity between the first local feature representation and the denoised normal and abnormal text feature vectors is calculated to generate a normal similarity map and an abnormal similarity map. The normal similarity map and the abnormal similarity map are fused across layers to obtain a zero-sample anomaly localization heatmap. The detection module 507 is configured to determine the pixel-level position of the discharge traces on the insulator surface based on the zero-sample anomaly localization heatmap and output the discharge trace detection result.
[0094] Positioning module 502 is also configured as follows:
[0095] Based on the location information of the insulator's foreground region, spatial enhancement is performed on the text cues in the text cue word set to generate enhanced text cues carrying location information, including:
[0096] The foreground region is discretized into multiple sub-regions, and the location phrases of the sub-regions are concatenated with the text prompts of the abnormal state to generate enhanced text prompts.
[0097] The computing module 505 is also configured as follows:
[0098] Calculate the similarity between global image features and normal text feature vectors and abnormal text feature vectors. Based on the similarity, perform semantic denoising on the normal text feature vectors and abnormal text feature vectors, including:
[0099] A first similarity threshold and a second similarity threshold are preset. Text feature vectors that simultaneously satisfy the condition that their similarity to normal text feature vectors is higher than the first similarity threshold and their similarity to abnormal text feature vectors is higher than the second similarity threshold are judged as redundant features and removed, thus obtaining denoised normal text feature vectors and abnormal text feature vectors.
[0100] Transformer module 506 is also configured as follows:
[0101] Adaptive sampling and feature transformation are performed by applying deformable convolution to the features of the first local image patch, including:
[0102] Multiple deformable convolutional modules with different parameters are used to process the first local image patch features at the same or different levels to obtain multiple sets of first local feature representations;
[0103] Among them, multiple deformable convolutional modules with different parameters are used to adapt to discharge traces of different scales and shapes.
[0104] Detection module 507 is also configured as follows:
[0105] Images of normal insulators that do not contain discharge traces are used as normal samples;
[0106] Extract second local image patch features from multiple levels of normal samples to construct a normal feature memory bank;
[0107] Calculate the minimum matching distance between the first local image patch features of multiple levels of the image to be detected and the second local image patch features of the corresponding level in the normal feature memory, and generate a few-sample anomaly warning image;
[0108] The few-sample anomaly alert map and the zero-sample anomaly localization heatmap are fused to obtain the enhanced final anomaly localization map;
[0109] The pixel-level location of discharge traces on the insulator surface is determined based on the final anomaly location map, and the discharge trace detection results are output.
[0110] Optionally, the detection module 507 is also configured as follows:
[0111] Extract second-level local image patch features from multiple levels of normal samples to construct a normal feature memory, including:
[0112] For each level, all second local image patch features of all normal samples at the level are collected to form a memory set for the level.
[0113] Calculate the minimum matching distance between the first local image patch features at multiple levels of the image to be detected and the corresponding second local image patch features at the same level in the normal feature memory, including:
[0114] For the first local image patch feature of the image to be detected at the current level, calculate the cosine distance between the first local image patch feature and all second local image patch features in the corresponding level memory set, and take the minimum value as the anomaly score of the first local image patch feature;
[0115] Anomaly score maps are generated hierarchically, and the anomaly score maps at each level are merged into a few-sample anomaly alert map.
[0116] Optionally, the detection module 507 is also configured as follows:
[0117] The few-sample anomaly warning map and the zero-sample anomaly localization heatmap are fused to obtain the enhanced final anomaly localization map, including:
[0118] Gaussian filtering was applied to the zero-sample anomaly location heatmap and the few-sample anomaly indication map, respectively.
[0119] The filtered zero-sample anomaly location heatmap and the few-sample anomaly alert map are then subjected to pixel-level weighted averaging, or added together according to preset weights, to obtain the final anomaly location map.
[0120] The discharge trace detection system for distribution insulators provided in this application can solve problems such as insufficient model generalization ability due to scarce samples, reliance on human experience for detection, low accuracy of anomaly localization, and lack of interpretability. By constructing fine-grained text semantic prompts and combining spatial location enhancement and cross-modal feature fusion, it can identify and locate various discharge traces at the pixel level. It can quickly lock abnormal areas and match the corresponding defect types and location information, ensuring that every insulator defect can be effectively checked. At the same time, by integrating image features and text semantic information, it eliminates the need for extensive manual annotation or on-site inspection and judgment, thus improving the efficiency, accuracy, and interpretability of discharge trace detection.
[0121] refer to Figure 6The diagram below is a block diagram of an electronic device according to some embodiments of the present invention. It illustrates a more specific hardware structure of an electronic device provided in this application embodiment. The device may include: a processor 610, a memory 620, an input / output interface 630, a communication interface 640, and a bus 650. The processor 610, memory 620, input / output interface 630, and communication interface 640 are internally connected to each other via the bus 650.
[0122] The processor 610 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0123] The memory 620 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 620 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 620 and is called and executed by the processor 610.
[0124] The input / output interface 630 is used to connect input / output modules to enable information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0125] The communication interface 640 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0126] Bus 650 includes a pathway for transmitting information between various components of the device, such as processor 610, memory 620, input / output interface 630, and communication interface 640.
[0127] It should be noted that although the above-described device only shows the processor 610, memory 620, input / output interface 630, communication interface 640, and bus 650, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0128] The electronic devices described above are used to implement the corresponding discharge trace detection method for distribution insulators in any of the foregoing embodiments, and have the beneficial effects of the corresponding discharge trace detection method embodiments for distribution insulators, which will not be repeated here.
[0129] Based on the same concept, corresponding to the discharge trace detection method for distribution insulators provided in any of the above embodiments, this application also provides a computer-readable storage medium storing a program or instructions, which, when executed by a processor, implements the discharge trace detection method for distribution insulators as described in the first aspect.
[0130] The aforementioned computer-readable storage medium can be any available medium or data storage device that a computer can access, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).
[0131] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the corresponding power distribution insulator discharge trace detection method in any of the foregoing embodiments, and have the beneficial effects of the corresponding power distribution insulator discharge trace detection method embodiments, which will not be repeated here.
[0132] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0133] From the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of computer software products plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk, etc.) and includes several instructions to cause the terminal or network-side device to execute the methods described in the various embodiments of this application.
[0134] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other implementations under the guidance of this application without departing from the spirit and scope of the claims. All of these implementations are within the protection scope of this application.
Claims
1. A method for detecting discharge traces on distribution insulators, characterized in that, include: Construct a set of text cue words to describe the normal state and abnormal state containing discharge traces of an insulator; wherein the text cue words for the abnormal state contain text descriptions of fine-grained semantics for different discharge traces; Locate the foreground region of the insulator in the image to be detected, and perform spatial enhancement on the text prompts in the text prompt set based on the position information of the foreground region of the insulator to generate enhanced text prompts carrying position information; The enhanced text prompts are encoded to obtain normal text feature vectors and abnormal text feature vectors; Extract global image features and first local image patch features at multiple levels from the image to be detected; Calculate the similarity between the global image features and the normal text feature vector and the abnormal text feature vector, and perform semantic denoising on the normal text feature vector and the abnormal text feature vector based on the similarity to obtain the denoised normal text feature vector and abnormal text feature vector. For each of the first local image patch features, deformable convolution is applied to the first local image patch features for adaptive sampling and feature transformation to obtain the first local feature representation of the first local image patch features. The similarity between the first local feature representation and the denoised normal text feature vector and abnormal text feature vector is calculated to generate a normal similarity map and an abnormal similarity map. The normal similarity map and the abnormal similarity map are fused across layers to obtain a zero-sample anomaly localization heatmap. The pixel-level location of discharge traces on the insulator surface is determined based on the zero-sample anomaly localization heatmap, and the discharge trace detection results are output.
2. The method for detecting discharge traces on distribution insulators according to claim 1, characterized in that, The method further includes: Images of normal insulators that do not contain discharge traces are used as normal samples; Extract second local image patch features from multiple levels of the normal samples to construct a normal feature memory library; Calculate the minimum matching distance between the first local image patch features of multiple levels of the image to be detected and the second local image patch features of the corresponding level in the normal feature memory, and generate a few-sample anomaly warning image; The few-sample anomaly alert map is fused with the zero-sample anomaly localization heatmap to obtain the enhanced final anomaly localization map; The pixel-level positions of discharge traces on the insulator surface are determined based on the final anomaly location map, and the discharge trace detection results are output.
3. The method for detecting discharge traces on distribution insulators according to claim 2, characterized in that, The step of spatially enhancing the text prompts in the text prompt word set based on the position information of the foreground region of the insulator to generate enhanced text prompts carrying position information includes: The foreground region is discretized into multiple sub-regions, and the location phrases of the sub-regions are concatenated with the text prompts of the abnormal state to generate the enhanced text prompts.
4. The method for detecting discharge traces on distribution insulators according to claim 3, characterized in that, The step of calculating the similarity between the global image features and the normal text feature vector and the abnormal text feature vector, and performing semantic denoising on the normal text feature vector and the abnormal text feature vector based on the similarity, includes: A first similarity threshold and a second similarity threshold are preset. Text feature vectors that simultaneously satisfy the condition that their similarity to the normal text feature vector is higher than the first similarity threshold and their similarity to the abnormal text feature vector is higher than the second similarity threshold are determined as redundant features and removed, thus obtaining the denoised normal text feature vector and the abnormal text feature vector.
5. The method for detecting discharge traces on distribution insulators according to claim 1, characterized in that, The step of applying deformable convolution to the features of the first local image patch for adaptive sampling and feature transformation includes: Multiple deformable convolutional modules with different parameters are used to process the first local image patch features at the same or different levels to obtain multiple sets of the first local feature representations. Among them, the multiple deformable convolutional modules with different parameters are used to adapt to discharge traces of different scales and shapes.
6. The method for detecting discharge traces on distribution insulators according to claim 2, characterized in that, The step of extracting second local image patch features at multiple levels from the normal samples and constructing a normal feature memory bank includes: For each level, all second local image patch features of all normal samples at that level are collected to form a memory bank set for that level. The calculation of the minimum matching distance between the first local image patch features of multiple levels of the image to be detected and the second local image patch features of the corresponding level in the normal feature memory includes: For the first local image patch feature of the image to be detected at the current level, calculate the cosine distance between the first local image patch feature and all second local image patch features in the corresponding level memory set, and take the minimum value as the anomaly score of the first local image patch feature; Anomaly score maps are generated level by level, and the anomaly score maps at each level are merged into the few-sample anomaly alert map.
7. The method for detecting discharge traces on distribution insulators according to claim 2, characterized in that, The step of fusing the few-sample anomaly alert map with the zero-sample anomaly localization heatmap to obtain the enhanced final anomaly localization map includes: Gaussian filtering is applied to both the zero-sample anomaly localization heatmap and the few-sample anomaly alert map. The filtered zero-sample anomaly location heatmap and the few-sample anomaly alert map are then subjected to pixel-level weighted averaging, or added together according to preset weights, to obtain the final anomaly location map.
8. A system for detecting discharge traces on power distribution insulators, characterized in that, include: The construction module is configured to construct a set of text cue words for describing the normal state of an insulator and the abnormal state containing discharge traces; wherein the text cue words for the abnormal state contain text descriptions of fine-grained semantics for different discharge traces. The positioning module is configured to locate the foreground region of the insulator in the image to be detected, and to perform spatial enhancement on the text prompts in the text prompt set based on the position information of the foreground region of the insulator, thereby generating enhanced text prompts carrying position information; The encoding module is configured to encode the enhanced text prompt words to obtain normal text feature vectors and abnormal text feature vectors; The extraction module is configured to extract global image features and first local image patch features at multiple levels from the image to be detected; The calculation module is configured to calculate the similarity between the global image features and the normal text feature vector and the abnormal text feature vector, and to perform semantic denoising on the normal text feature vector and the abnormal text feature vector based on the similarity to obtain the denoised normal text feature vector and abnormal text feature vector. The transformation module is configured to apply deformable convolution to the first local image patch features for each first local image patch feature to perform adaptive sampling and feature transformation, obtain a first local feature representation of the first local image patch features, calculate the similarity between the first local feature representation and the denoised normal text feature vector and abnormal text feature vector, generate a normal similarity map and an abnormal similarity map, and perform cross-layer fusion on the normal similarity map and the abnormal similarity map to obtain a zero-sample anomaly localization heatmap; The detection module is configured to determine the pixel-level location of discharge traces on the insulator surface based on the zero-sample anomaly localization heatmap, and output the discharge trace detection results.
9. An electronic device, characterized in that, include: A processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method for detecting discharge traces on distribution insulators as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method for detecting discharge traces in distribution insulators as described in any one of claims 1 to 7.