An insulator anomaly detection method, device, equipment and storage medium
By processing insulator images with Gaussian filters and target gradient sharpening operators, and combining deformable convolution and knowledge distillation paradigms for detection, the limitations of existing insulator detection technologies are overcome, achieving efficient and accurate insulator anomaly detection and improving production safety.
Patent Information
- Application Number
- CN202511375285.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-09-25
AI Technical Summary
Existing insulator detection methods rely on large-scale labeled image data, which is costly to acquire, has a long labeling cycle, insufficient model generalization ability, and uses a single image preprocessing method. These methods fail to effectively integrate multi-scale information and edge gradient features, lack network structure design to adapt to complex backgrounds and differences in various types of insulator structures, and have unstable abnormal feature modeling and reconstruction mechanisms. Furthermore, they are weak in identifying some fine-grained defects.
A Gaussian filter is used to remove high-frequency noise, and a target gradient sharpening operator is used to extract edge information. Deformable convolution is used for dimensionality reduction, and image reconstruction is performed using target teacher and student models. The detection score is determined by combining the knowledge distillation paradigm to achieve insulator anomaly detection.
It improves the efficiency and accuracy of insulator anomaly detection, enhances the safety of the production process, strengthens the adaptability to complex backgrounds and various types of insulator structures, and improves the ability to identify fine-grained defects.
Smart Images

Figure CN120876470B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power technology, and in particular to a method, apparatus, equipment, and storage medium for detecting insulator anomalies. Background Technology
[0002] Currently, with the ever-expanding scale of power systems, transmission lines, as critical channels for power transmission, directly impact the safety and efficiency of the entire power grid. In the transmission line structure, insulators bear the dual responsibility of electrical isolation and mechanical connection, making them crucial components for ensuring the safe operation of the lines. Because insulators are exposed to the outdoor environment year-round, they are susceptible to various factors such as rain, snow, wind, sand, salt spray corrosion, dust accumulation, and bird damage, leading to structural aging, surface contamination, metal corrosion, and mechanical breakage. In severe cases, this can result in creepage, flashover, or even insulation failure, threatening power grid operation and personnel safety. Therefore, improving the efficiency of insulator inspection and the accuracy of fault identification has become a key technological requirement in the development of smart grids.
[0003] Traditional manual inspection methods are limited by the working environment, efficiency, and subjective judgment, making it difficult to meet the high-frequency, high-precision inspection requirements of large-scale power transmission systems. In recent years, visual inspection solutions combining UAV inspection platforms and image recognition algorithms have gradually become the mainstream trend. In particular, after the widespread application of deep learning models in image recognition tasks, many methods have begun to use convolutional neural networks to perform target detection and defect analysis on insulators in acquired images, offering higher automation and stronger environmental adaptability compared to traditional methods.
[0004] Currently, supervised learning-based insulator image recognition technologies typically rely on large-scale labeled image data to train deep neural network models, enabling the classification and identification of insulator targets and their defects. While these methods achieve high detection accuracy on standard datasets or in specific scenarios, they also have significant limitations: First, acquiring a large number of defect samples is costly and time-consuming, especially in scenarios with rare defects or multiple structural types, making it difficult to build a complete training sample library; second, the models lack generalization ability, and their performance tends to decline when the detection environment or insulator structure changes, affecting their deployment and application in practical engineering.
[0005] Furthermore, while some existing methods incorporate image domain transformation enhancement models to improve the adaptability of input features or construct memory matrix structures to strengthen the model's ability to remember features of normal samples, thereby improving the sensitivity to detect abnormal patterns, current unsupervised detection methods still suffer from the following shortcomings: image preprocessing methods are simplistic and fail to effectively integrate multi-scale information and edge gradient features; the network structure lacks design to adapt to complex backgrounds and differences in various insulator structures; and the modeling and reconstruction mechanisms for abnormal features are still not stable enough, exhibiting weak ability to identify some fine-grained defects.
[0006] As can be seen from the above, how to improve the efficiency of insulator anomaly detection is an urgent problem to be solved. Summary of the Invention
[0007] In view of this, the purpose of this invention is to provide an insulator anomaly detection method, apparatus, device, and storage medium, which can improve the anomaly detection process of insulators, thereby enhancing the safety of the production process. The specific solution is as follows:
[0008] Firstly, this application provides a method for detecting insulator anomalies, including:
[0009] A Gaussian filter is used to remove high-frequency noise from the image of the insulator to be tested, resulting in a compressed result. The compressed result is then subjected to scale compression and restoration to obtain an intermediate scale image. Finally, the intermediate scale image is fused with the original grayscale image corresponding to the image of the insulator to be tested to obtain a fused result.
[0010] The fusion result is processed using a target gradient sharpening operator to obtain image edge information. Based on the image edge information and the fusion result, the image to be processed is determined. Then, the image to be processed is divided to obtain several feature images. The deformable convolution and the dimensionality reduction path corresponding to the image to be processed are used to perform dimensionality reduction processing on each feature image to obtain feature vectors.
[0011] The feature vectors are input into the target teacher model and the target student model for image reconstruction to obtain the reconstructed image; the target teacher model includes a pre-defined convolutional layer and a bilinear interpolation combination for structural reconstruction of the feature vectors; the target student model includes a feature memory mechanism for dimensionality upscaling and focused reconstruction of the feature vectors;
[0012] The pixel-level feature differences between the reconstructed image and the image of the insulator to be detected are determined. The feature information exchange method and loss function in the knowledge distillation paradigm are used to determine the detection score corresponding to the image of the insulator to be detected based on the feature differences. Based on the detection score, it is determined whether the insulator corresponding to the image of the insulator to be detected is abnormal.
[0013] Optionally, the step of using a Gaussian filter to perform high-frequency noise removal processing on the image of the insulator to be detected to obtain a compression result, and performing scale compression and restoration operations on the compression result to obtain an intermediate scale map, and fusing the intermediate scale map with the original grayscale image corresponding to the image of the insulator to be detected to obtain a fusion result, includes:
[0014] The Gaussian filter in the OpenCV library is used to remove high-frequency noise from the image of the insulator to be detected based on preset filter parameters, and the compressed result is obtained.
[0015] Even rows and even columns in the result to be compressed are discarded using row and column sampling to obtain the image to be restored. Zero-value pixel columns and zero-value pixel rows are then inserted into each pixel of the image to be restored to obtain an intermediate scale image.
[0016] The original grayscale image corresponding to the image of the insulator to be detected is determined, and the Gaussian filter is used to suppress artifacts and noise in the intermediate scale image to obtain the suppression result. The suppression result is then weighted and fused with the original grayscale image to obtain the fusion result.
[0017] Optionally, the step of processing the fusion result using a target gradient sharpening operator to obtain image edge information, and determining the image to be processed based on the image edge information and the fusion result, includes:
[0018] Two first-order convolution kernels based on derivatives are constructed to obtain a horizontal gradient sharpening kernel and a vertical gradient sharpening kernel. The horizontal gradient sharpening kernel and the vertical gradient sharpening kernel are then subjected to two-dimensional convolution operations with the fusion result to obtain a horizontal gradient image corresponding to the horizontal gradient sharpening kernel and a vertical gradient image corresponding to the vertical gradient sharpening kernel.
[0019] The horizontal gradient image and the vertical gradient image are merged using a preset norm merging method to obtain a gradient magnitude map. The gradient magnitude map is then normalized based on a preset gradient intensity value to obtain a normalization result.
[0020] The first weight and the second weight corresponding to the normalization result and the fusion result are determined respectively, and the normalization result and the fusion result are weighted and superimposed based on the first weight and the second weight to obtain the image to be processed.
[0021] Optionally, the step of dividing the image to be processed into several feature images, and using deformable convolution and the dimensionality reduction path corresponding to the image to be processed to perform dimensionality reduction processing on each feature image to obtain a feature vector, includes:
[0022] The image to be processed is divided into several feature images according to a preset size, and the structural characteristics corresponding to the image to be processed are determined; wherein the feature images do not overlap.
[0023] A structure-adaptive dimensionality reduction center is constructed using a preset structure-aware compression center. The deformable convolution and preset spatial dynamic control mechanism in the structure-adaptive dimensionality reduction center are used to determine the dimensionality reduction path corresponding to the image to be processed based on the structural characteristics.
[0024] The first deformable convolution is used to perform downsampling on each feature image based on the center point position of the convolution sliding window, the set of sampling points corresponding to the feature image, the preset offset, the preset weight and the dimensionality reduction path, to obtain the feature map and the residual feature branch.
[0025] The feature map is subjected to fine-grained structural information extraction using a second deformable convolution to obtain fine-grained structural information. The fine-grained structural information is then processed using a standard convolution and a preset regularization rule to obtain a regularization result. The convolutional layer sizes corresponding to the first deformable convolution and the second deformable convolution are different.
[0026] The residual feature branches are fused element-wise by addition to each other to obtain an element fusion result. The ReLU activation function is then used to perform a nonlinear mapping on the element fusion result to obtain a feature vector.
[0027] Optionally, the step of inputting the feature vector into the target teacher model and the target student model for image reconstruction to obtain the reconstructed image includes:
[0028] The feature vector is input into the target teacher model, and bilinear interpolation, local feature modeling, static connection breaking between channels, and channel number determination are performed sequentially on the feature vector using a convolutional layer and a preset channel shuffling mechanism to obtain the vector to be processed.
[0029] A memory matrix is constructed based on a preset dimension and a preset storage structure, comprising several memory units for storing context information; each memory unit corresponds one-to-one with each row vector in the memory matrix;
[0030] The vector to be processed is input into the target student model to generate a soft addressing vector based on the vector to be processed using a preset attention mechanism, and the weights corresponding to the soft addressing vector are determined. Then, a preset activation function is used to perform a nonlinear transformation on the soft addressing vector to obtain a normalized vector.
[0031] The image size corresponding to the insulator image to be detected and the slice size corresponding to the feature image are determined. Hyperparameters are determined based on the image size and the slice size. The normalized vector and the memory matrix are multiplied and combined based on the weights and the hyperparameters to generate a reconstructed image.
[0032] Optionally, determining the pixel-level feature differences between the reconstructed image and the image of the insulator to be detected, utilizing the feature information exchange method and loss function in the knowledge distillation paradigm, and determining a detection score corresponding to the image of the insulator to be detected based on the feature differences, and determining whether the insulator corresponding to the image of the insulator to be detected is abnormal based on the detection score, includes:
[0033] The reconstructed image is compared with the image of the insulator to be detected at the pixel level to obtain pixel-level feature differences. Then, the feature differences are processed by a preset encoder, a preset regularizer, a preset generator, and a preset discriminator to obtain intermediate results.
[0034] The intermediate state result is optimized using the feature information exchange method and MSE loss function in the knowledge distillation paradigm to obtain the first optimized result;
[0035] The first optimization result is processed by using a preset generation loss function to optimize image quality, resulting in a second optimization result. The second optimization result is then processed by using the preset discriminator to maximize the average value of the image of the insulator to be detected and the reconstructed image, resulting in a third optimization result.
[0036] The third optimization result is processed using a preset inference loss function and a preset discrimination loss function to obtain a detection score corresponding to the image of the insulator to be detected, and the detection score is used to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal.
[0037] Optionally, after determining whether the insulator corresponding to the image of the insulator to be detected is abnormal based on the detection score, the method further includes:
[0038] Determine the batch size and weight decay coefficient to suppress overfitting, and construct an optimizer based on the batch size and the weight decay coefficient;
[0039] Determine the initial learning rate and the number of iterations, and use a node-based annealing strategy to process the target teacher model and the target student model based on the initial learning rate and the number of iterations to obtain a new target teacher model and target student model;
[0040] Based on the characteristics of the dataset corresponding to the insulator image to be detected, the loss functions of teacher model structure reconstruction loss, student path model reconstruction loss, feature distillation loss, generator reconstruction consistency loss, and discriminator loss are determined and processed to obtain a new loss function.
[0041] Secondly, this application provides an insulator anomaly detection device, comprising:
[0042] The fusion result determination module is used to perform high-frequency noise removal processing on the image of the insulator to be detected using a Gaussian filter to obtain a compression result, and to perform scale compression and restoration operations on the compression result to obtain an intermediate scale map, and to fuse the intermediate scale map with the original grayscale map corresponding to the image of the insulator to be detected to obtain a fusion result;
[0043] The feature vector determination module is used to process the fusion result using a target gradient sharpening operator to obtain image edge information, and to determine the image to be processed based on the image edge information and the fusion result. Then, the image to be processed is divided to obtain several feature images, and each feature image is dimensionality reduced using deformable convolution and the dimensionality reduction path corresponding to the image to be processed to obtain feature vectors.
[0044] The image reconstruction determination module is used to input the feature vector into the target teacher model and the target student model for image reconstruction to obtain a reconstructed image; the target teacher model includes a preset convolutional layer and a bilinear interpolation combination for structural reconstruction of the feature vector; the target student model includes a feature memory mechanism for dimensionality upscaling and focused reconstruction of the feature vector;
[0045] The detection score determination module is used to determine the pixel-level feature differences between the reconstructed image and the image of the insulator to be detected, so as to use the feature information exchange method and loss function in the knowledge distillation paradigm and determine the detection score corresponding to the image of the insulator to be detected based on the feature differences, so as to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal based on the detection score.
[0046] Thirdly, this application provides an electronic device, comprising:
[0047] Memory, used to store computer programs;
[0048] A processor is used to execute the computer program to implement the aforementioned insulator anomaly detection method.
[0049] Fourthly, this application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned insulator anomaly detection method.
[0050] As can be seen from the above, before performing insulator anomaly detection, this application needs to use a Gaussian filter to remove high-frequency noise from the image of the insulator to be detected, obtaining a compressed result. Then, scale compression and restoration operations are performed on the compressed result to obtain an intermediate scale image. This intermediate scale image is then fused with the original grayscale image corresponding to the image of the insulator to be detected, yielding a fused result. The fused result is then processed using a target gradient sharpening operator to obtain image edge information. Based on the image edge information and the fused result, the image to be processed is determined. The image to be processed is then divided into several feature images, and deformable convolution and the dimensionality reduction path corresponding to the image to be processed are used to reduce the dimensionality of each feature image. The image is processed to obtain feature vectors. These feature vectors are then input into the target teacher model and the target student model for image reconstruction, resulting in a reconstructed image. The target teacher model includes a pre-defined convolutional layer and a bilinear interpolation combination for structural reconstruction of the feature vectors. The target student model includes a feature memory mechanism for dimensionality upscaling and focused reconstruction of the feature vectors. The pixel-level feature differences between the reconstructed image and the image of the insulator to be detected are determined. The feature information exchange method and loss function in the knowledge distillation paradigm are used to determine the detection score corresponding to the image of the insulator to be detected based on the feature differences. The detection score is then used to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal.
[0051] Therefore, this application first uses a Gaussian filter to remove high-frequency noise from the image of the insulator to be detected, obtaining a compressed result. This compressed result is then scaled and restored to obtain an intermediate scale image. This intermediate scale image is then fused with the original grayscale image corresponding to the insulator image to obtain a fused result. Next, a target gradient sharpening operator is used to process the fused result to obtain image edge information. Based on this edge information and the fused result, the image to be processed is determined. This image is then divided into several feature images, and deformable convolution and the corresponding dimensionality reduction path are used to reduce the dimensionality of each feature image, obtaining feature vectors. Subsequently, these feature vectors are input into the target teacher model and the target student model for image reconstruction, obtaining a reconstructed image. Finally, the pixel-level feature differences between the reconstructed image and the image of the insulator to be detected are determined. The feature information exchange method and loss function in the knowledge distillation paradigm are used to determine the detection score corresponding to the image of the insulator to be detected based on the feature differences. This detection score is then used to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal. This improves the detection of insulator anomalies during the anomaly detection process, thereby enhancing the safety of the production process. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0053] Figure 1 This is a flowchart of an insulator anomaly detection method disclosed in this application;
[0054] Figure 2 This is a schematic diagram of a specific overall architecture for insulator anomaly detection disclosed in this application;
[0055] Figure 3 This is a flowchart of a specific preprocessing algorithm for constructing a multi-level image structure perception mechanism using scale decomposition and gradient fusion disclosed in this application;
[0056] Figure 4 This is a schematic diagram of the feature layer of a specific adaptive distillation reconstruction network disclosed in this application;
[0057] Figure 5 This is a schematic diagram of a specific structural adaptive dimensionality reduction unit and memory matrix disclosed in this application; wherein, Figure 5 (a) is a schematic diagram of the structure of the adaptive dimensionality reduction unit. Figure 5 (b) is a schematic diagram of the memory matrix structure;
[0058] Figure 6 This is a schematic diagram of the structure of an insulator anomaly detection device disclosed in this application;
[0059] Figure 7 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0060] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0061] Currently, supervised learning-based insulator image recognition technologies typically rely on large-scale labeled image data to train deep neural network models for classification and identification of insulator targets and their defects. While these methods achieve high detection accuracy on standard datasets or in specific scenarios, they also have significant limitations: firstly, acquiring a large number of defect samples is costly and the labeling cycle is long; secondly, the model's generalization ability is insufficient. Furthermore, although some existing methods incorporate image domain transformation enhancement models in preprocessing and network structure, current unsupervised detection methods still suffer from the following shortcomings: image preprocessing methods are simplistic and fail to effectively integrate multi-scale information and edge gradient features; the network structure lacks design to adapt to complex backgrounds and the structural differences of various insulator types; and the modeling and reconstruction mechanisms for anomalous features are still not stable enough, resulting in weak identification capabilities for some fine-grained defects. Therefore, this application provides an insulator anomaly detection method that can improve the anomaly detection process of insulators, thereby enhancing the safety of the production process.
[0062] See Figure 1 As shown, this embodiment of the invention discloses an insulator anomaly detection method, including:
[0063] Step S11: Use a Gaussian filter to remove high-frequency noise from the image of the insulator to be tested to obtain a compression result. Perform scale compression and restoration operations on the compression result to obtain an intermediate scale image. Then, fuse the intermediate scale image with the original grayscale image corresponding to the image of the insulator to be tested to obtain a fusion result.
[0064] In this embodiment, the overall architecture diagram for insulator anomaly detection is as follows: Figure 2 As shown: This application embodiment requires the sequential execution of key processes such as image preprocessing, feature encoding, image reconstruction (decoding), and anomaly detection. In the encoding stage, a Structure Adaptive Subsampling Unit (SASU, a node-based simulated annealing algorithm) is used as a dimensionality reduction layer to enhance the representation ability of irregular structural boundaries. In the reconstruction stage, a teacher-student dual-path collaborative mechanism is introduced to achieve parallel optimization of structure restoration and difference enhancement. In the student path, some dimensionality-upgrading layers integrate a focusing adaptive sampling unit to improve the accuracy and efficiency of the reconstruction effect.
[0065] This embodiment includes five core modules: a scale decomposition and gradient fusion preprocessing algorithm (SDGF) to enhance key edges and structural contours in the image; an encoder; and an encoder. The regularizer is responsible for encoding the preprocessed image into latent structural features. (Teacher path decoder), used to reconstruct standard structure images and establish discrimination benchmarks; generator (Student path decoder) Under the teacher's guidance, students complete the enhanced expression of structural difference features; discriminator It distinguishes the structural differences between the input image and the generated result.
[0066] In this embodiment, the process of constructing a multi-level image structure perception mechanism using scale decomposition and gradient fusion preprocessing algorithms is as follows: Figure 3 As shown, a model input image with clear structural representation is generated through upsampling and subsampling combined with a gradient enhancement strategy. The specific process is as follows: First, the input image is initially smoothed using a Gaussian filter from the OpenCV (Open Source Computer Vision Library) library. The filter kernel size is 5×5, and the SigmaX parameter is set to 1.4, aiming to remove high-frequency noise generated during imaging and improve image quality, laying the foundation for subsequent structure extraction. Then, a scale compression and restoration operation is performed: first, row and column sampling is used to directly discard even-numbered rows and columns for rapid dimensionality reduction; finally, zero-value pixel columns and rows are inserted to the right and below each pixel to restore the image, preserving the original structural information while introducing scale differences. After the scale compression and restoration operation, Gaussian filtering is applied again in the intermediate feature layer to suppress artifacts and noise introduced by the sampling operation, while enhancing the continuity of local structural contours. It is worth noting that the intermediate feature map retains the main contour information of the insulator's main body region, which is particularly suitable for normal samples without high-temperature anomalies, guiding the model to focus on modeling standard structures during the training phase. Finally, the intermediate-scale image and the original grayscale image are weighted and fused to achieve complementary enhancement of low-level details and high-level structures. Furthermore, a gradient sharpening operator is introduced during the fusion process to extract key edge information from the image and generate an intelligent model input image with prominent structures and low background interference, effectively improving the overall detection system's sensitivity and discrimination accuracy for abnormal regions.
[0067] Specifically, a Gaussian filter is used to remove high-frequency noise from the image of the insulator to be tested, resulting in a compressed image. This compressed image is then scaled and restored to obtain an intermediate scale image. Finally, the intermediate scale image is fused with the original grayscale image corresponding to the insulator to be tested, yielding a fused result. This process can include: using a Gaussian filter from the OpenCV library with preset filter parameters to remove high-frequency noise from the image of the insulator to be tested, resulting in a compressed image; discarding even-numbered rows and columns in the compressed image using row and column sampling, resulting in a restored image; inserting columns and rows of zero-value pixels into each pixel of the restored image, resulting in an intermediate scale image; determining the original grayscale image corresponding to the insulator to be tested; using a Gaussian filter to suppress artifacts and noise in the intermediate scale image, resulting in a suppressed image; and then weighted and fused the suppressed image with the original grayscale image to obtain the fused result.
[0068] It is worth mentioning that the gradient sharpening operator can effectively highlight the contour regions in an image in the grayscale domain, and the process is as follows: First, two first-order convolution kernels based on derivatives are defined, namely the horizontal gradient sharpening kernel. and vertical gradient sharpening kernel And the formula is defined as follows:
[0069] ;
[0070] Furthermore, in this embodiment, the two sharpening convolution kernels are respectively convolved with the grayscale feature map in two dimensions, which can further obtain gradient images in the corresponding two directions. and And the expression is as follows:
[0071] ;
[0072] in, It is a grayscale feature map; This is a gradient feature map in the horizontal direction; This is the gradient feature map in the vertical direction.
[0073] Subsequently, in this embodiment, the gradient information of the two directions can be merged in the form of L2 norm, and the merging formula is as follows:
[0074] ;
[0075] in, This is the gradient strength value after merging the gradient information in the horizontal and vertical directions.
[0076] Then, based on gradient strength values The gradient magnitude map is normalized to improve image contrast. Then, the normalized feature map is weighted and superimposed with the original image to obtain the final output image, as shown in the following formula:
[0077] ;
[0078] in, To establish a fusion weighting factor, in one specific implementation, the fusion weighting factor is set to 0.6, and This is the final output image (output feature map).
[0079] Step S12: Process the fusion result using the target gradient sharpening operator to obtain image edge information, and determine the image to be processed based on the image edge information and the fusion result. Then, divide the image to be processed to obtain several feature images, and use deformable convolution and the dimensionality reduction path corresponding to the image to be processed to perform dimensionality reduction processing on each feature image to obtain feature vectors.
[0080] In this embodiment, a schematic diagram of the feature layers of the adaptive distillation reconstruction network is shown below. Figure 4 As shown, the Adaptive Distillation Reconstruction Network (ADRN) is a reconstructive neural architecture for unlabeled anomaly detection tasks. It is designed to guide the transfer of structural knowledge and model the differential patterns of anomalies by constructing a dual-pathway collaborative optimization architecture. Notably, the ADRN does not rely on anomalous samples or external label information; instead, it builds a discrimination mechanism based on structural differences by learning to reconstruct the structure of normal samples.
[0081] Specifically, the fusion result is processed using a target gradient sharpening operator to obtain image edge information. Based on the image edge information and the fusion result, the image to be processed is determined. This process may include: constructing two derivative-based first-order convolution kernels to obtain a horizontal gradient sharpening kernel and a vertical gradient sharpening kernel; performing two-dimensional convolution operations between the horizontal and vertical gradient sharpening kernels and the fusion result to obtain a horizontal gradient image corresponding to the horizontal gradient sharpening kernel and a vertical gradient image corresponding to the vertical gradient sharpening kernel; merging the horizontal and vertical gradient images using a preset norm merging method to obtain a gradient magnitude map; normalizing the gradient magnitude map based on a preset gradient intensity value to obtain a normalized result; determining the first weight and second weight corresponding to the normalized result and the fusion result, respectively; and performing a weighted superposition operation on the normalized result and the fusion result based on the first weight and the second weight to obtain the image to be processed.
[0082] In this embodiment, the structural diagrams of the adaptive dimensionality reduction unit and the memory matrix are as follows: Figure 5As shown, where, Figure 5 (a) is a schematic diagram of the structure of the adaptive dimensionality reduction unit. Figure 5 (b) is a schematic diagram of the memory matrix. Specifically, the structure adaptive dimensionality reduction unit includes a structure-aware compression module embedded in the downsampling stage of the encoder to enhance the ability to preserve irregular structural features (such as the complex contours of insulators) while improving the robustness of edge representation under high background interference.
[0083] Subsequently, before entering the main encoding process, the image is first divided into segments of size [size missing]. Non-overlapping feature patches are used to perform finer-grained dimensionality reduction and feature extraction operations on local regions while maintaining the structural integrity of the original image, providing basic units for subsequent spatial adaptive processing. SASU uses Deformable Convolution (DCNv2) as its core operation. By introducing a spatial dynamic adjustment mechanism, it breaks through the limitation of the fixed receptive field in traditional convolution during the convolution process, enabling the model to adaptively determine the dimensionality reduction path based on the structural characteristics of the image itself. The formula for deformable convolution is shown below:
[0084] ;
[0085] in, and Input and output feature maps; It is the position of the center point of the convolution sliding window; It is the set of sampling points in a standard convolution kernel; It is the learned offset, and the coordinates of the sampling point can be dynamically adjusted; These are learnable weights used to control the degree to which offset points participate in the convolution weighting.
[0086] It's worth noting that the dimensionality reduction process in SASU consists of a multi-level convolutional structure: First, initial downsampling (feature residual branch) is performed: the input features are initially downsampled through a deformable convolution with a stride of 2, resulting in a size-compressed feature map; this process preserves key structural responses and generates residual feature branches as a reference for subsequent fusion. Then, feature supplementation and refinement are performed: the residual results are input into a deformable convolution with a stride of 1 to further extract fine-grained structural information; subsequently, a 3×3 standard convolution is superimposed to enhance local contextual semantics; the resulting output is then normalized using regularization (such as BatchNorm). Finally, structural enhancement fusion is performed: the regularized output is fused with the initial residual path features using element-wise addition; finally, a ReLU (Rectified Linear Unit) activation function is used to perform non-linear mapping, enhancing the response capability to significant structures such as edges.
[0087] Specifically, the image to be processed is divided into several feature images, and each feature image is dimensionality reduced using deformable convolution and the dimensionality reduction path corresponding to the image to be processed to obtain feature vectors. This may include: dividing the image to be processed into several feature images according to a preset size, and determining the structural characteristics corresponding to the image to be processed; wherein the feature images do not overlap; constructing a structure-adaptive dimensionality reduction center using a preset structure-aware compression center, and using the deformable convolution in the structure-adaptive dimensionality reduction center and a preset spatial dynamic adjustment mechanism to determine the dimensionality reduction path corresponding to the image to be processed based on the structural characteristics; using a first deformable convolution and based on the center point position of the convolution sliding window and the feature vectors... The feature images are downsampled using a set of sampling points corresponding to the feature images, a preset offset, preset weights, and a dimensionality reduction path to obtain feature maps and residual feature branches. A second deformable convolution is used to extract fine-grained structural information from the feature maps, and then the fine-grained structural information is processed using standard convolution and preset regularization rules to obtain a regularization result. The first and second deformable convolutions correspond to convolutional layers of different sizes. The residual feature branches are then fused element-wise using addition to obtain an element-fusion result, and the ReLU activation function is used to perform a non-linear mapping on the element-fusion result to obtain a feature vector.
[0088] Step S13: Input the feature vector into the target teacher model and the target student model for image reconstruction to obtain the reconstructed image; the target teacher model includes a preset convolutional layer and a bilinear interpolation combination for structural reconstruction of the feature vector; the target student model includes a feature memory mechanism for dimensionality upscaling and focused reconstruction of the feature vector.
[0089] In this embodiment, after obtaining the feature vector output by the encoder, the feature vector needs to be sent to the teacher path respectively. With student path Decoding is then performed. Specifically: the teacher path structure consists of a traditional dimensionality-upgrading module combining convolutional layers and bilinear interpolation, primarily used to provide structural reconstruction references for "normal samples" and not involved in anomaly detection; the student path introduces a memory mapping reconstruction module (MemMap-Gen), embedding a feature memory mechanism while performing dimensionality upgrading and focused reconstruction tasks to enhance the model's anomaly sensitivity. MemMap-Gen consists of two parts: a focused adaptive sampling unit and a memory matrix.
[0090] In one specific implementation, the steps for performing the focus adaptive sampling unit are as follows: upsampling (bilinear interpolation) with a magnification of 2 is used to restore resolution; then, a 3×3 convolutional layer (with a stride of 1 and no bias) is used to enhance local feature modeling; furthermore, a channel shuffle mechanism is used to break the static connections between channels to enhance cross-channel information flow; finally, a 1×1 convolution (with a layer stride of 1 and no bias) is used to fine-tune the number of output channels to align it with the interface of subsequent modules.
[0091] In this embodiment, the input feature vector can be used to... With memory queue Joint processing is used to achieve dynamic addressing of memory addresses, and the process is as follows: First, based on Generate a soft addressing vector Subsequently, a nonlinear transformation is applied using the ReLU activation function to enhance feature representation. Then, the normalized addressing vector is... The final target feature representation is generated by multiplying and combining it with the memory matrix. The memory matrix is constructed as a [missing information]. Storage structure, dimensions With the encoded feature vector Consistent. Specifically, each row vector in the aforementioned memory matrix... This represents an independent memory unit used to store long-term context information. Final output. By accessing all memory units The weighted sum is obtained by weighting the soft addressing vector. The resulting weights, each a non-negative number, are calculated as follows:
[0092] ;
[0093] in, These are hyperparameters determined based on image size and slice size.
[0094] In one specific implementation, the addressing strategy is an addressing strategy determined based on an attention mechanism, so as to utilize the addressing strategy for computation. and The module summarizes each item The similarity is used to construct attention weights. The calculation formula is as follows:
[0095] ;
[0096] ;
[0097] It is worth mentioning that the ReLU function needs to be used to optimize the attention weights W to increase the sparsity of the addressing weights, further preventing abnormal regions from being reconstructed well. The calculation formula is shown below:
[0098] ;
[0099] in, For ReLU function, For preset positive number terms, it is usually set to between.
[0100] Specifically, the process of inputting feature vectors into the target teacher model and the target student model for image reconstruction to obtain the reconstructed image can include: inputting feature vectors into the target teacher model, using convolutional layers and a preset channel shuffling mechanism to sequentially perform bilinear interpolation, local feature modeling, static connection breaking between channels, and channel number determination operations on the feature vectors to obtain the vector to be processed; constructing a memory matrix based on preset dimensions and a preset storage structure, including several memory units for storing context information; each memory unit corresponds one-to-one with each row vector in the memory matrix; inputting the vector to be processed into the target student model, using a preset attention mechanism and generating a soft-addressed vector based on the vector to be processed, and determining the weights corresponding to the soft-addressed vector; then using a preset activation function to perform a nonlinear transformation on the soft-addressed vector to obtain a normalized vector; determining the image size corresponding to the insulator image to be detected and the slice size corresponding to the feature image, determining hyperparameters based on the image size and slice size, and multiplying and combining the normalized vector with the memory matrix based on the weights and hyperparameters to generate the reconstructed image.
[0101] Step S14: Determine the pixel-level feature differences between the reconstructed image and the image of the insulator to be detected, and use the feature information exchange method and loss function in the knowledge distillation paradigm to determine the detection score corresponding to the image of the insulator to be detected based on the feature differences, so as to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal based on the detection score.
[0102] In this embodiment, during the model training phase, the MemMap-Gen module activates and uses only a portion of the memory units in each round to participate in feature reconstruction. This effectively limits the redundancy of memory queries and promotes the autonomous evolution of each memory unit into a representative structural prototype. Notably, the sparse addressing strategy significantly enhances the discriminative power of the memory matrix, resulting in a sparse and stable feature space distribution within its internal storage structure. During the model inference phase, because normal samples have fully participated in memory modeling during training, their structural features can highly match the prototypes in the memory matrix, thus achieving high-fidelity reconstruction output. In contrast, abnormal samples, due to significant structural deviations, cannot find effective matching units in the memory matrix, resulting in a substantial decrease in reconstruction capability and ultimately manifesting as significant reconstruction errors. The spatial distribution of these errors can be used to accurately locate abnormal regions, becoming an important basis for unsupervised detection judgment.
[0103] It's worth noting that the discriminator is used to calculate the anomaly score of the currently detected object by comparing pixel-level feature differences between the input image and the reconstructed image. This is done during the encoder process. Regularizer (decoder-teacher path) Generator (decoder - student path) ), Discriminator After definition, outlier scores need to be calculated, and the formula for determining outlier scores is as follows:
[0104] ;
[0105] in, For the Sigmoid function, and These are the mean and standard deviation of the outlier scores for a single sample, respectively.
[0106] In this embodiment, five loss functions need to be considered for joint update. Then, the MSE loss function is used, and the reconstructed image based on the teacher-student path is compared with the input image. The differences between them are optimized, and the loss function is as follows:
[0107] ;
[0108] ;
[0109] Subsequently, this application embodiment needs to utilize the feature information exchange method in the knowledge distillation paradigm to optimize the intermediate layer of the teacher-student model. Feature map The loss is calculated, and the expression for the distance loss function is as follows:
[0110] ;
[0111] Then, a generation loss function similar to that in f-AnoGAN is used to optimize the quality of the student model's reconstructed images, and the expression is as follows:
[0112] ;
[0113] It is worth mentioning that the discriminator is used to explore the maximization of the average value between the features of the input image and the reconstructed image, and the expression is as follows:
[0114] ;
[0115] Specifically, determining the pixel-level feature differences between the reconstructed image and the image of the insulator to be detected, and using the feature information exchange method and loss function in the knowledge distillation paradigm to determine the detection score corresponding to the image of the insulator to be detected based on the feature differences, and using the detection score to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal, can include: comparing the reconstructed image and the image of the insulator to be detected pixel by pixel to obtain pixel-level feature differences, and then using a preset encoder, a preset regularizer, a preset generator, and a preset discriminator to process the feature differences to obtain an intermediate result; using the feature information exchange method and MSE loss function in the knowledge distillation paradigm to optimize the intermediate result to obtain a first optimized result; using a preset generation loss function to perform image quality optimization processing on the first optimized result to obtain a second optimized result, and using a preset discriminator to maximize the average value of the image of the insulator to be detected and the reconstructed image in the second optimized result to obtain a third optimized result; using a preset inference loss function and a preset discriminant loss function to process the third optimized result to obtain a detection score corresponding to the image of the insulator to be detected, and using the detection score to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal.
[0116] In this embodiment, during model training, the Adam optimizer is used to perform gradient calculation and parameter update operations. In one specific implementation, the batch size is set to 16, and the weight decay coefficient is 1e-5 to suppress overfitting risk. For the student path generator and discriminator, the initial learning rate is set to 1e-4, and the training process iterates for 200 epochs on a self-built dataset. Notably, to achieve efficient convergence and steady-state transfer of the model, a node-based simulated annealing strategy is introduced during training: the learning rate is decayed to 1 / 5 of the initial value in epochs 50 and 100, respectively, to effectively control the amplitude of training perturbations in later stages and improve the model's convergence stability. It is also worth mentioning that, considering the teacher model only acts as a regularizer during training, providing structural guidance without participating in inference, no bias term is used in its network to avoid redundant parameters affecting the reconstructed expression.
[0117] It is worth mentioning that the loss function used during model training consists of a weighted average of multiple sub-items, and the weight coefficients of each item can be fine-tuned according to the characteristics of the dataset. A specific implementation configuration is shown below: Set to 0.01 (Teacher path structure reconstruction loss), Set to 10 (student path structure reconstruction loss), Set to 0.001 (characteristic distillation loss), Set to 0.005 (generator reconstruction consistency loss), The discriminator loss is set to 0.005. Subsequently, a multi-loss fusion strategy is employed to balance reconstruction accuracy, feature consistency, and anomaly sensitivity. This maintains the generation quality while improving the ability to identify weak structural anomalies. The expression for data processing using the loss function of the EMFR-AD algorithm, which includes inference loss and discriminator loss, is shown below:
[0118] ;
[0119] Specifically, after determining whether the insulator corresponding to the image to be detected is abnormal based on the detection score, the process may further include: determining the batch size and weight decay coefficient to suppress overfitting, and constructing an optimizer based on the batch size and weight decay coefficient; determining the initial learning rate and number of iterations, and using a node-based annealing strategy to process the target teacher model and target student model based on the initial learning rate and number of iterations to obtain new target teacher models and target student models; and determining the teacher model structure reconstruction loss, student path model reconstruction loss, feature distillation loss, generator reconstruction consistency loss, and discriminator loss based on the characteristics of the dataset corresponding to the image to be detected, and processing the loss function to obtain a new loss function.
[0120] As can be seen from the above, the embodiments of this application first need to use a Gaussian filter to remove high-frequency noise from the image of the insulator to be detected, to obtain the compression result, and then perform scale compression and restoration operations on the compression result to obtain an intermediate scale map. The intermediate scale map is then fused with the original grayscale image corresponding to the image of the insulator to be detected to obtain a fusion result. Then, the fusion result is processed using a target gradient sharpening operator to obtain image edge information. Based on the image edge information and the fusion result, the image to be processed is determined. Then, the image to be processed is divided to obtain several feature images. The deformable convolution and the dimensionality reduction path corresponding to the image to be processed are used to perform dimensionality reduction processing on each feature image to obtain feature vectors. Subsequently, the feature vectors are input into the target teacher model and the target student model for image reconstruction to obtain the reconstructed image. Finally, the pixel-level feature differences between the reconstructed image and the image of the insulator to be detected are determined. The feature information exchange method and loss function in the knowledge distillation paradigm are used to determine the detection score corresponding to the image of the insulator to be detected based on the feature differences. Based on the detection score, it is determined whether the insulator corresponding to the image of the insulator to be detected is abnormal. This improves the detection of insulator anomalies during the insulator anomaly detection process, thereby enhancing the safety of the production process.
[0121] Accordingly, see Figure 6 As shown, this application also provides an insulator anomaly detection device, comprising:
[0122] The fusion result determination module 11 is used to perform high-frequency noise removal processing on the image of the insulator to be detected using a Gaussian filter to obtain a compression result, and to perform scale compression and restoration operations on the compression result to obtain an intermediate scale map, and to fuse the intermediate scale map with the original grayscale map corresponding to the image of the insulator to be detected to obtain a fusion result;
[0123] The feature vector determination module 12 is used to process the fusion result using the target gradient sharpening operator to obtain image edge information, and to determine the image to be processed based on the image edge information and the fusion result. Then, the image to be processed is divided to obtain several feature images, and each feature image is dimensionality reduced using deformable convolution and the dimensionality reduction path corresponding to the image to be processed to obtain feature vectors.
[0124] The image reconstruction determination module 13 is used to input the feature vector into the target teacher model and the target student model for image reconstruction to obtain a reconstructed image; the target teacher model includes a preset convolutional layer and a bilinear interpolation combination for structural reconstruction of the feature vector; the target student model includes a feature memory mechanism for dimensionality upscaling and focused reconstruction of the feature vector;
[0125] The detection score determination module 14 is used to determine the pixel-level feature differences between the reconstructed image and the image of the insulator to be detected, so as to use the feature information exchange method and loss function in the knowledge distillation paradigm and determine the detection score corresponding to the image of the insulator to be detected based on the feature differences, so as to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal based on the detection score.
[0126] As can be seen from the above, before performing insulator anomaly detection in this embodiment, it is first necessary to use a Gaussian filter to remove high-frequency noise from the image of the insulator to be detected, obtain a compression result, and then perform scale compression and restoration operations on the compression result to obtain an intermediate scale image. The intermediate scale image is then fused with the original grayscale image corresponding to the image of the insulator to be detected to obtain a fusion result. Then, the fusion result is processed using a target gradient sharpening operator to obtain image edge information. Based on the image edge information and the fusion result, the image to be processed is determined. Then, the image to be processed is divided to obtain several feature images. The deformable convolution and the dimensionality reduction path corresponding to the image to be processed are used to perform dimensionality reduction processing on each feature image to obtain feature vectors. Subsequently, the feature vectors are input into the target teacher model and the target student model for image reconstruction to obtain a reconstructed image. Finally, the pixel-level feature differences between the reconstructed image and the image of the insulator to be detected are determined. The feature information exchange method and loss function in the knowledge distillation paradigm are used to determine the detection score corresponding to the image of the insulator to be detected based on the feature differences. Based on the detection score, it is determined whether the insulator corresponding to the image of the insulator to be detected has an anomaly. This improves the detection of insulator anomalies during the insulator anomaly detection process, thereby enhancing the safety of the production process.
[0127] In some specific embodiments, the fusion result determination module 11 may specifically include:
[0128] The unit for determining the compression result is used to perform high-frequency noise removal processing on the image of the insulator to be detected using the Gaussian filter in the OpenCV library and based on preset filter parameters, so as to obtain the compression result.
[0129] The intermediate scale map determination unit is used to discard even-numbered rows and even-numbered columns in the result to be compressed using row and column sampling method to obtain the image to be restored, and to insert zero-value pixel columns and zero-value pixel rows into each pixel in the image to be restored to obtain the intermediate scale map.
[0130] The fusion result determination subunit is used to determine the original grayscale image corresponding to the image of the insulator to be detected, and to use the Gaussian filter to perform artifact and noise suppression operations on the intermediate scale image to obtain the suppression result. The suppression result is then weighted and fused with the original grayscale image to obtain the fusion result.
[0131] In some specific embodiments, the feature vector determination module 12 may specifically include:
[0132] The vertical gradient image determination unit is used to construct two derivative-based first-order convolution kernels to obtain a horizontal gradient sharpening kernel and a vertical gradient sharpening kernel. The horizontal gradient sharpening kernel and the vertical gradient sharpening kernel are then subjected to two-dimensional convolution operations with the fusion result to obtain a horizontal gradient image corresponding to the horizontal gradient sharpening kernel and a vertical gradient image corresponding to the vertical gradient sharpening kernel.
[0133] The normalization result determination unit is used to merge the horizontal gradient image and the vertical gradient image using a preset norm merging method to obtain a gradient magnitude map, and to perform a normalization operation on the gradient magnitude map based on a preset gradient intensity value to obtain a normalization result.
[0134] The image to be processed determination unit is used to determine the first weight and the second weight corresponding to the normalization result and the fusion result, respectively, and to perform a weighted superposition operation on the normalization result and the fusion result based on the first weight and the second weight to obtain the image to be processed.
[0135] In some specific embodiments, the feature vector determination module 12 may specifically include:
[0136] An image segmentation unit is used to segment the image to be processed according to a preset size to obtain several feature images and determine the structural characteristics corresponding to the image to be processed; wherein the feature images do not overlap.
[0137] The dimension reduction path determination unit is used to construct a structure-adaptive dimension reduction center using a preset structure-aware compression center, and to determine the dimension reduction path corresponding to the image to be processed based on the structural characteristics by utilizing the deformable convolution and preset spatial dynamic adjustment mechanism in the structure-adaptive dimension reduction center.
[0138] An image downsampling unit is used to perform downsampling operations on each of the feature images using a first deformable convolution and based on the center point position of the convolution sliding window, the set of sampling points corresponding to the feature image, a preset offset, a preset weight, and the dimensionality reduction path, to obtain a feature map and a residual feature branch.
[0139] The regularization processing result determination unit is used to perform fine-grained structural information extraction on the feature map using the second deformable convolution to obtain fine-grained structural information, and to process the fine-grained structural information using standard convolution and preset regularization processing rules to obtain a regularization processing result; wherein, the convolutional layer sizes corresponding to the first deformable convolution and the second deformable convolution are different.
[0140] The feature vector determination subunit is used to perform element-wise addition fusion operation on the residual feature branches to obtain the element fusion result, and to perform nonlinear mapping on the element fusion result using the ReLU activation function to obtain the feature vector.
[0141] In some specific embodiments, the reconstructed image determination module 13 may specifically include:
[0142] The vector to be processed unit is used to input the feature vector into the target teacher model, and use the convolutional layer and preset channel shuffling mechanism to sequentially perform bilinear interpolation, local feature modeling, static connection breaking between channels and channel number determination on the feature vector to obtain the vector to be processed.
[0143] A memory matrix determination unit is used to construct a memory matrix including several memory units for storing context information based on a preset dimension and a preset storage structure; each memory unit corresponds one-to-one with each row vector in the memory matrix;
[0144] The vector transformation unit is used to input the vector to be processed into the target student model, so as to generate a soft addressing vector based on the vector to be processed using a preset attention mechanism, determine the weights corresponding to the soft addressing vector, and then use a preset activation function to perform a nonlinear transformation on the soft addressing vector to obtain a normalized vector.
[0145] The hyperparameter determination unit is used to determine the image size corresponding to the insulator image to be detected and the slice size corresponding to the feature image, so as to determine the hyperparameters based on the image size and the slice size, and to multiply and combine the normalized vector with the memory matrix based on the weights and the hyperparameters to generate a reconstructed image.
[0146] In some specific embodiments, the detection score determination module 14 may specifically include:
[0147] The intermediate state result determination unit is used to compare the reconstructed image with the image of the insulator to be detected by pixels to obtain pixel-level feature differences, and then use a preset encoder, a preset regularizer, a preset generator and a preset discriminator to process the feature differences to obtain intermediate state results.
[0148] The first optimization result determination unit is used to optimize the intermediate result by using the feature information exchange method and MSE loss function in the knowledge distillation paradigm to obtain the first optimization result;
[0149] The second optimization result determination unit is used to perform image quality optimization processing on the first optimization result using a preset generation loss function to obtain a second optimization result, and to perform average value maximization processing on the second optimization result using the preset discriminator to compare the image of the insulator to be detected and the reconstructed image to obtain a third optimization result;
[0150] The detection score determination subunit is used to process the third optimization result using a preset inference loss function and a preset discrimination loss function to obtain a detection score corresponding to the image of the insulator to be detected, and to use the detection score to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal.
[0151] In some specific embodiments, the insulator anomaly detection device may further include:
[0152] An optimizer building unit is used to determine the batch size and weight decay coefficient for suppressing overfitting, so as to build an optimizer based on the batch size and the weight decay coefficient.
[0153] The model determination unit is used to determine the initial learning rate and the number of iterations, and to process the target teacher model and the target student model using a node-based annealing strategy based on the initial learning rate and the number of iterations to obtain a new target teacher model and target student model.
[0154] The loss function determination unit is used to determine the teacher model structure reconstruction loss, student path model reconstruction loss, feature distillation loss, generator reconstruction consistency loss, and discriminator loss based on the characteristics of the dataset corresponding to the insulator image to be detected. The loss functions are then processed to obtain a new loss function.
[0155] Furthermore, embodiments of this application also disclose an electronic device, Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the insulator anomaly detection method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0156] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0157] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0158] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the insulator anomaly detection method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0159] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed insulator anomaly detection method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0160] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0161] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0162] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0163] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 said element.
[0164] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for detecting insulator anomalies, characterized in that, include: A Gaussian filter is used to remove high-frequency noise from the image of the insulator to be tested, resulting in a compressed result. The compressed result is then subjected to scale compression and restoration to obtain an intermediate scale image. Finally, the intermediate scale image is fused with the original grayscale image corresponding to the image of the insulator to be tested to obtain a fused result. The fusion result is processed using a target gradient sharpening operator to obtain image edge information. Based on the image edge information and the fusion result, the image to be processed is determined. Then, the image to be processed is divided to obtain several feature images. The deformable convolution and the dimensionality reduction path corresponding to the image to be processed are used to perform dimensionality reduction processing on each feature image to obtain feature vectors. The feature vectors are input into the target teacher model and the target student model for image reconstruction to obtain the reconstructed image; the target teacher model includes a pre-defined convolutional layer and a bilinear interpolation combination for structural reconstruction of the feature vectors; the target student model includes a feature memory mechanism for dimensionality upscaling and focused reconstruction of the feature vectors; The pixel-level feature differences between the reconstructed image and the image of the insulator to be detected are determined. The feature information exchange method and loss function in the knowledge distillation paradigm are used to determine the detection score corresponding to the image of the insulator to be detected based on the feature differences. Based on the detection score, it is determined whether the insulator corresponding to the image of the insulator to be detected is abnormal.
2. The insulator anomaly detection method according to claim 1, characterized in that, The process involves using a Gaussian filter to remove high-frequency noise from the image of the insulator to be tested, obtaining a compressed result, and then performing scale compression and restoration operations on the compressed result to obtain an intermediate scale image. Finally, the intermediate scale image is fused with the original grayscale image corresponding to the image of the insulator to be tested to obtain a fusion result, including: The Gaussian filter in the OpenCV library is used to remove high-frequency noise from the image of the insulator to be detected based on preset filter parameters, and the compressed result is obtained. Even rows and even columns in the result to be compressed are discarded using row and column sampling to obtain the image to be restored. Zero-value pixel columns and zero-value pixel rows are then inserted into each pixel of the image to be restored to obtain an intermediate scale image. The original grayscale image corresponding to the image of the insulator to be detected is determined, and the Gaussian filter is used to suppress artifacts and noise in the intermediate scale image to obtain the suppression result. The suppression result is then weighted and fused with the original grayscale image to obtain the fusion result.
3. The insulator anomaly detection method according to claim 1, characterized in that, The step of processing the fusion result using a target gradient sharpening operator to obtain image edge information, and determining the image to be processed based on the image edge information and the fusion result, includes: Two first-order convolution kernels based on derivatives are constructed to obtain a horizontal gradient sharpening kernel and a vertical gradient sharpening kernel. The horizontal gradient sharpening kernel and the vertical gradient sharpening kernel are then subjected to two-dimensional convolution operations with the fusion result to obtain a horizontal gradient image corresponding to the horizontal gradient sharpening kernel and a vertical gradient image corresponding to the vertical gradient sharpening kernel. The horizontal gradient image and the vertical gradient image are merged using a preset norm merging method to obtain a gradient magnitude map. The gradient magnitude map is then normalized based on a preset gradient intensity value to obtain a normalization result. The first weight and the second weight corresponding to the normalization result and the fusion result are determined respectively, and the normalization result and the fusion result are weighted and superimposed based on the first weight and the second weight to obtain the image to be processed.
4. The insulator anomaly detection method according to claim 1, characterized in that, The image to be processed is divided into several feature images, and each feature image is subjected to dimensionality reduction processing using deformable convolution and the dimensionality reduction path corresponding to the image to be processed, to obtain a feature vector, including: The image to be processed is divided into several feature images according to a preset size, and the structural characteristics corresponding to the image to be processed are determined; wherein the feature images do not overlap. A structure-adaptive dimensionality reduction center is constructed using a preset structure-aware compression center. The deformable convolution and preset spatial dynamic control mechanism in the structure-adaptive dimensionality reduction center are used to determine the dimensionality reduction path corresponding to the image to be processed based on the structural characteristics. The first deformable convolution is used to perform downsampling on each feature image based on the center point position of the convolution sliding window, the set of sampling points corresponding to the feature image, the preset offset, the preset weight and the dimensionality reduction path, to obtain the feature map and the residual feature branch. The feature map is subjected to fine-grained structural information extraction using a second deformable convolution to obtain fine-grained structural information. The fine-grained structural information is then processed using a standard convolution and a preset regularization rule to obtain a regularization result. The convolutional layer sizes corresponding to the first deformable convolution and the second deformable convolution are different. The residual feature branches are fused element-wise by addition to each other to obtain an element fusion result. The ReLU activation function is then used to perform a nonlinear mapping on the element fusion result to obtain a feature vector.
5. The insulator anomaly detection method according to claim 1, characterized in that, The step of inputting the feature vector into the target teacher model and the target student model for image reconstruction to obtain the reconstructed image includes: The feature vector is input into the target teacher model, and bilinear interpolation, local feature modeling, static connection breaking between channels, and channel number determination are performed sequentially on the feature vector using a convolutional layer and a preset channel shuffling mechanism to obtain the vector to be processed. A memory matrix is constructed based on a preset dimension and a preset storage structure, comprising several memory units for storing context information; each memory unit corresponds one-to-one with each row vector in the memory matrix; The vector to be processed is input into the target student model to generate a soft addressing vector based on the vector to be processed using a preset attention mechanism, and the weights corresponding to the soft addressing vector are determined. Then, a preset activation function is used to perform a nonlinear transformation on the soft addressing vector to obtain a normalized vector. The image size corresponding to the insulator image to be detected and the slice size corresponding to the feature image are determined. Hyperparameters are determined based on the image size and the slice size. The normalized vector and the memory matrix are multiplied and combined based on the weights and the hyperparameters to generate a reconstructed image.
6. The insulator anomaly detection method according to claim 1, characterized in that, The step of determining the pixel-level feature differences between the reconstructed image and the image of the insulator to be detected, utilizing the feature information exchange method and loss function in the knowledge distillation paradigm, and determining a detection score corresponding to the image of the insulator to be detected based on the feature differences, and determining whether the insulator corresponding to the image of the insulator to be detected is abnormal based on the detection score, includes: The reconstructed image is compared with the image of the insulator to be detected at the pixel level to obtain pixel-level feature differences. Then, the feature differences are processed by a preset encoder, a preset regularizer, a preset generator, and a preset discriminator to obtain intermediate results. The intermediate state result is optimized using the feature information exchange method and MSE loss function in the knowledge distillation paradigm to obtain the first optimized result; The first optimization result is processed by using a preset generation loss function to optimize image quality, resulting in a second optimization result. The second optimization result is then processed by using the preset discriminator to maximize the average value of the image of the insulator to be detected and the reconstructed image, resulting in a third optimization result. The third optimization result is processed using a preset inference loss function and a preset discrimination loss function to obtain a detection score corresponding to the image of the insulator to be detected, and the detection score is used to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal.
7. The insulator anomaly detection method according to any one of claims 1 to 6, characterized in that, After determining whether the insulator corresponding to the image of the insulator to be detected is abnormal based on the detection score, the method further includes: Determine the batch size and weight decay coefficient to suppress overfitting, and construct an optimizer based on the batch size and the weight decay coefficient; Determine the initial learning rate and the number of iterations, and use a node-based annealing strategy to process the target teacher model and the target student model based on the initial learning rate and the number of iterations to obtain a new target teacher model and target student model; Based on the characteristics of the dataset corresponding to the insulator image to be detected, the loss functions of teacher model structure reconstruction loss, student path model reconstruction loss, feature distillation loss, generator reconstruction consistency loss, and discriminator loss are determined and processed to obtain a new loss function.
8. An insulator anomaly detection device, characterized in that, include: The fusion result determination module is used to perform high-frequency noise removal processing on the image of the insulator to be detected using a Gaussian filter to obtain a compression result, and to perform scale compression and restoration operations on the compression result to obtain an intermediate scale map, and to fuse the intermediate scale map with the original grayscale map corresponding to the image of the insulator to be detected to obtain a fusion result; The feature vector determination module is used to process the fusion result using a target gradient sharpening operator to obtain image edge information, and to determine the image to be processed based on the image edge information and the fusion result. Then, the image to be processed is divided to obtain several feature images, and each feature image is dimensionality reduced using deformable convolution and the dimensionality reduction path corresponding to the image to be processed to obtain feature vectors. The image reconstruction determination module is used to input the feature vector into the target teacher model and the target student model for image reconstruction to obtain a reconstructed image; the target teacher model includes a preset convolutional layer and a bilinear interpolation combination for structural reconstruction of the feature vector; the target student model includes a feature memory mechanism for dimensionality upscaling and focused reconstruction of the feature vector; The detection score determination module is used to determine the pixel-level feature differences between the reconstructed image and the image of the insulator to be detected, so as to use the feature information exchange method and loss function in the knowledge distillation paradigm and determine the detection score corresponding to the image of the insulator to be detected based on the feature differences, so as to determine whether the insulator corresponding to the image of the insulator to be detected is abnormal based on the detection score.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the insulator anomaly detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the insulator anomaly detection method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Traction substation outdoor insulator abnormity detection method
CN111507975A
Face super-resolution reconstruction method and system based on dual generalized distillation
CN116452424A