Unsupervised anomaly detection method and system for substation equipment
By utilizing Canny edge detection and ResNet architecture to generate multi-scale features in substation equipment anomaly detection, and combining them with a lightweight reconstruction network for anomaly scoring, the problems of scarce anomaly samples and complex fault modes are solved, achieving efficient and accurate equipment status detection.
Patent Information
- Application Number
- CN202511340767.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-09-19
AI Technical Summary
In substation equipment anomaly detection, there are few abnormal samples, high data collection and labeling costs, and it is difficult to cope with complex fault modes.
By acquiring a sample set containing normal and abnormal states, the Canny edge detection algorithm is used to generate feature space conditional vectors and reconstruct the samples. The ResNet architecture is used to generate multi-scale features, which are then optimized by loss function and weighted mapping to obtain optimized feature maps. These optimized feature maps are then input into a lightweight reconstruction network to obtain pixel-by-pixel anomaly scores. Finally, max pooling is used to generate image-level anomaly scores to determine whether the device status is abnormal.
It enables efficient and accurate anomaly detection without requiring a large amount of labeled data, improving the efficiency and accuracy of substation equipment detection and ensuring stable equipment operation.
Smart Images

Figure CN120833525B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of substation equipment monitoring technology, and in particular to a method and system for unsupervised anomaly detection of substation equipment. Background Technology
[0002] Substation equipment is the core of the power system, responsible for voltage conversion, power distribution, and control. However, this equipment is susceptible to minor faults such as cracks, material degradation, or blockages. Failure to detect these faults in a timely manner can lead to system failure or serious consequences. Traditional anomaly detection methods, such as single-class classification or novelty detection based on support vector machines, rely on large amounts of labeled data. However, in the substation environment, anomaly samples are scarce, data acquisition and labeling are costly, and they struggle to handle complex fault modes. In recent years, unsupervised and self-supervised methods in deep learning have shown potential by modeling the normal behavior of unlabeled data.
[0003] However, generating realistic synthetic data and accurately locating anomalies remains a challenge. While Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs) can generate data, the samples lack the fine-grained realism required for industrial applications. Diffusion models have attracted attention due to their ability to generate high-quality, structurally consistent samples, but their application in substation equipment anomaly detection still needs optimization to adapt to data scarcity and complex fault modes. Summary of the Invention
[0004] The purpose of this invention is to provide an unsupervised anomaly detection method and system for substation equipment, which aims to solve the problems of the scarcity of anomaly samples, high data acquisition and labeling costs, and difficulty in dealing with complex fault modes in traditional substation equipment anomaly detection.
[0005] In a first aspect, the present invention provides a method for unsupervised anomaly detection of substation equipment, the method comprising:
[0006] A first sample set containing normal and abnormal substation equipment status is obtained, a feature space condition vector is generated based on the first sample set, and the first sample set is reconstructed based on the feature space condition vector to obtain reconstructed samples.
[0007] The reconstructed samples and the first sample set are combined to obtain a dataset. Multi-scale features are generated based on the dataset, and the multi-scale features are optimized to obtain an optimized feature map.
[0008] The optimized feature map is input into the lightweight reconstruction network to obtain the anomaly score for each sample. Max pooling is then performed on the anomaly score, and the image-level anomaly score is obtained based on the max pooling result.
[0009] Determine whether the image-level anomaly score is greater than a first preset threshold;
[0010] If the image-level anomaly score is greater than the first preset threshold, the substation equipment is determined to be in an abnormal state.
[0011] In some embodiments, the step of obtaining a first sample set containing normal and abnormal substation equipment states, and generating a feature space condition vector based on the first sample set includes:
[0012] Suppose that the normal sample set contained in the first sample set is represented as follows: ,use Edge detection algorithm generates binary edge map :
[0013] ;
[0014] in, express Edge detection algorithms obtain edge maps through smoothing, gradient calculation, and thresholding. ;
[0015] edge map Input encoding network Generate feature space condition vectors :
[0016] .
[0017] In some embodiments, the step of reconstructing the first sample set based on the feature space condition vector to obtain reconstructed samples includes:
[0018] Define any sample in the first sample set as the initial sample. Using forward diffusion on the initial sample Gaussian noise is added incrementally to generate a noisy sample sequence:
[0019] ;
[0020] in, For a given time t-1, the image By using a fixed noise level, we obtain... t Sample of time The probability distribution; It follows a Gaussian distribution. The noise intensity is a predefined value during the diffusion process. It is the identity matrix;
[0021] Utilizing the enhanced U-Net network, according to t Sample of time and feature space condition vector Generate reconstructed samples:
[0022] ;
[0023] in, In a given sample and edge feature condition vector Under these conditions, the denoising network predicts the reconstructed samples from the previous time step. The conditional probability distribution; and These are the reconstructed mean and covariance predicted by the network, respectively. The mean of the reconstructed samples predicted by the network. For network parameters, This is the covariance matrix of the reconstructed samples predicted by the network, used to describe the uncertainty of the reconstructed samples.
[0024] In some embodiments, the step of summing the reconstructed samples and the first sample set to obtain a dataset, and generating multi-scale features based on the dataset, includes:
[0025] The ResNet architecture is used as the backbone network for feature extraction, and the dataset is input into the backbone network to generate the first feature extraction feature. k Multiscale features of layers :
[0026] ;
[0027] in, K represents the backbone network, where K is the total number of layers in the backbone network, and each layer includes multiple channels. The height of the feature map at layer k ,width and number of channels X is the dataset.
[0028] In some embodiments, the step of optimizing the multi-scale features to obtain an optimized feature map includes:
[0029] definition Multi-scale features The corresponding number i The 2D feature maps of each channel are generated, and the 2D feature map of each sample type is input into a pre-constructed loss function to obtain the optimal feature map. :
[0030] ;
[0031] in, For the k-th layer i The selection loss function for each channel It is the Frobenius norm. The number of normal samples. The number of abnormal samples. It is a hyperparameter that adjusts the loss weights for normal and abnormal samples. For the nth reconstructed sample, For the first n The normal sample at the ... k Layer i 2D feature map of each channel, For the first n The reconstructed sample at the th ... k Layer i 2D feature maps of each channel, For the m-th anomalous sample in the k-th layer... i 2D feature maps of each channel;
[0032] For optimal features Perform weighted mapping:
[0033] ;
[0034] in, For FAO mapping functions, For parameters, This is the optimized feature map.
[0035] In some embodiments, the step of inputting the optimized feature map into a lightweight reconstruction network to obtain an anomaly score for each sample includes:
[0036] The pixel-by-pixel anomaly score is obtained using the following formula:
[0037] ;
[0038] in, For the pixel positions in the optimized feature map ( m , n The value of ) pixel position ( m , n The reconstructed eigenvalues of ) To rebuild the network in a lightweight manner, pixel position ( m , n Abnormal scores, Anomaly scoring for the sample.
[0039] In some embodiments, the step of performing max pooling on the anomaly score and obtaining an image-level anomaly score based on the max pooling result includes:
[0040] Max pooling is performed according to the following formula:
[0041] ;
[0042] in, for In the position ( i , j Perform max pooling anomaly scoring on the window centered at ) For position ( i , j () is the central window;
[0043] The image-level anomaly score is calculated using the following formula:
[0044] ;
[0045] in, For image-level anomaly scoring, Select a specific pixel position on the k-th layer The highest score on the scale.
[0046] Secondly, the present invention provides an unsupervised anomaly detection system for substation equipment, the system comprising:
[0047] The sample reconstruction module is used to obtain a first sample set containing normal and abnormal substation equipment status, generate a feature space condition vector based on the first sample set, and reconstruct the first sample set based on the feature space condition vector to obtain reconstructed samples.
[0048] The feature optimization module is used to summarize the reconstructed samples and the first sample set to obtain a dataset, generate multi-scale features based on the dataset, and optimize the multi-scale features to obtain an optimized feature map.
[0049] The pooling module is used to input the optimized feature map into the lightweight reconstruction network to obtain the anomaly score of each sample, perform max pooling on the anomaly score, and obtain the image-level anomaly score based on the max pooling result.
[0050] The scoring detection module is used to determine whether the image-level anomaly score is greater than a first preset threshold.
[0051] The equipment anomaly determination module is used to determine that the substation equipment is in an abnormal state if the image-level anomaly score is greater than a first preset threshold.
[0052] Thirdly, the present invention provides a storage medium that stores one or more programs, which, when executed by a processor, implement the above-described unsupervised anomaly detection method for substation equipment.
[0053] Fourthly, the present invention provides an electronic device, the electronic device comprising a memory and a processor, wherein:
[0054] The memory is used to store computer programs;
[0055] When the processor executes the computer program stored in the memory, it implements the above-mentioned unsupervised anomaly detection method for substation equipment.
[0056] Compared with the prior art, the present invention has the following advantages:
[0057] This invention acquires a first sample set containing both normal and abnormal states, uses the Canny edge detection algorithm to generate feature space conditional vectors and reconstruct the samples, then aggregates them and uses a ResNet architecture to generate multi-scale features. After loss function optimization and weighted mapping, an optimized feature map is obtained, which is then input into a lightweight reconstruction network to obtain pixel-by-pixel anomaly scores. Max pooling is then used to obtain image-level anomaly scores, thereby determining whether the substation equipment is in an abnormal state. This method combines multiple advanced algorithms, forming a complete and efficient detection process from sample processing to feature extraction, optimization, and score calculation. It requires no large amount of labeled data, accurately detects abnormal states of substation equipment, improves detection efficiency and accuracy, and ensures the stable operation of substation equipment. Attached Figure Description
[0058] Figure 1 This is a flowchart of an unsupervised anomaly detection method for substation equipment proposed in an embodiment of the present invention;
[0059] Figure 2 This is a schematic diagram of the structure of an unsupervised anomaly detection system for substation equipment proposed in an embodiment of the present invention.
[0060] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, 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. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art. The terms "comprising" and similar expressions used herein mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, but does not exclude other elements or objects.
[0062] like Figure 1 As shown, an embodiment of the present invention proposes an unsupervised anomaly detection method for substation equipment, the method comprising steps S101 to S105, wherein:
[0063] Step S101: Obtain a first sample set containing normal and abnormal substation equipment status, generate a feature space condition vector based on the first sample set, and reconstruct the first sample set based on the feature space condition vector to obtain reconstructed samples;
[0064] It should be noted that the first sample set contains a small number of high-resolution images of normal and abnormal states, typically 512×512 pixels in size. For example, 50 to 100 normal and abnormal images of substation equipment (such as transformers and circuit breakers) are collected. These images are acquired under different lighting conditions and shooting angles to ensure the robustness of the model. Each image is adjusted to a resolution of 512×512 pixels, and the pixel values are normalized to the range [0,1].
[0065] Furthermore, in some embodiments, the method for generating feature space conditional vectors and reconstructing samples is exactly the same for normal samples and abnormal samples. Therefore, taking normal samples as an example, it is assumed that the normal sample set contained in the first sample set is represented as follows: ,use Edge detection algorithm generates binary edge map :
[0066] ;
[0067] in, express Edge detection algorithms obtain edge maps through smoothing, gradient calculation, and thresholding. It reflects the edge features of the input image.
[0068] edge map Input encoding network Generate feature space condition vectors :
[0069] .
[0070] In addition, it should be noted that coding networks It contains four convolutional layers, with a kernel size of [missing information]. stride The number of channels are 16, 32, 64, and 128, respectively, and the ReLU activation function is used with Gaussian initialization of the weights.
[0071] Furthermore, in some embodiments, any sample in the first sample set is redefined as the initial sample. That is, the sample at time 0 or time step, and then forward diffusion is used to process the initial sample. Gaussian noise is added incrementally to generate a noisy sample sequence:
[0072] ;
[0073] in, For a given time t-1, the image By using a fixed noise level, we obtain... t Sample of time The probability distribution; It follows a Gaussian distribution. The noise intensity is a predefined value during the diffusion process. It is an identity matrix.
[0074] Then, using the enhanced U-Net network, according to t Sample of time and feature space condition vector Generate reconstructed samples:
[0075] ;
[0076] in, In a given sample and edge feature condition vector Under these conditions, the denoising network predicts the reconstructed samples from the previous time step. The conditional probability distribution; and These are the reconstructed mean and covariance predicted by the network, respectively. The mean of the reconstructed samples predicted by the network. For network parameters, This is the covariance matrix of the reconstructed samples predicted by the network, used to describe the uncertainty of the reconstructed samples.
[0077] In summary, traditional reconstruction-based anomaly detection methods typically learn the pixel distribution of normal samples directly, neglecting the structural information of the image. Therefore, this invention uses edge features extracted through Canny edge detection as a conditional vector for the diffusion process, guiding the model to pay more attention to the structural consistency of the image during reconstruction. This enables the model to more accurately capture structural anomalies, such as connections or missing components that should not be present in substation equipment. Compared to traditional pixel-level reconstruction, this embodiment can more effectively detect structural anomalies and reduce false positives caused by factors such as lighting and noise.
[0078] Step S102: Summarize the reconstructed samples and the first sample set to obtain a dataset, generate multi-scale features based on the dataset, and optimize the multi-scale features to obtain an optimized feature map;
[0079] It should be noted that in this step, a pre-trained ResNet-50 model is used to extract multi-scale features from the input image. Specifically, the ResNet architecture is used as the backbone network for feature extraction, and the dataset is input into the backbone network to generate the first feature extraction feature. k Multiscale features of layers :
[0080] ;
[0081] in, K represents the backbone network, where K is the total number of layers in the backbone network. Each layer has a different resolution and channel depth, and each layer includes multiple channels. The height of the k-th layer feature map ,width and number of channels The output feature maps of different layers have different sizes. As the network depth increases, the spatial size of the features usually decreases while the number of channels increases. X is the dataset.
[0082] Next, define Multi-scale features The corresponding number i The 2D feature maps of each channel are generated, and the 2D feature map of each sample type is input into a pre-constructed loss function to obtain the optimal feature map. :
[0083] ;
[0084] in, For the k-th layer i The selection loss function for each channel It is the Frobenius norm. The number of normal samples. The number of abnormal samples. It is a hyperparameter that adjusts the loss weights for normal and abnormal samples. For the nth reconstructed sample, For the first n The normal sample at the ... k Layer i 2D feature map of each channel, For the first n The reconstructed sample at the th ... k Layer i 2D feature maps of each channel, For the m-th anomalous sample in the k-th layer... i 2D features of each channel.
[0085] For optimal features Perform weighted mapping:
[0086] ;
[0087] in, For FAO mapping functions, For parameters, This is the optimized feature map.
[0088] In summary, traditional feature optimization methods, such as using pre-trained convolutional neural networks to extract features, often treat all features in a "one-size-fits-all" manner, failing to consider the varying contributions of different features to anomaly detection. The innovation of this embodiment lies in its adaptability. After extracting multi-scale features through ResNet, the FAO module dynamically optimizes the feature representation using a novel feature selection loss function, enabling the model to automatically learn and select the features most useful for anomaly detection. This means the model can ignore irrelevant interfering features and focus more on discriminative features. Compared to traditional feature extraction methods, the FAO module can more effectively extract and optimize discriminative features, improving the accuracy and robustness of anomaly detection, especially under complex backgrounds and noisy interference.
[0089] Step S103: Input the optimized feature map into the lightweight reconstruction network to obtain the anomaly score for each sample, perform max pooling on the anomaly score, and obtain the image-level anomaly score based on the max pooling result.
[0090] It should be noted that this step mainly involves comparing the extracted multi-scale features with a pre-stored "normal sample reference feature," typically by calculating the residuals or distances (such as Euclidean distance) between them to generate anomaly scores. Specifically, the pixel-by-pixel anomaly score is obtained according to the following formula:
[0091] ;
[0092] in, For the pixel positions in the optimized feature map ( m , n The value of ) pixel position ( m , n The reconstructed eigenvalues of ) To rebuild the network in a lightweight manner, pixel position ( m , n Abnormal scores, Anomaly scoring for the sample.
[0093] In addition, max pooling is performed according to the following formula:
[0094] ;
[0095] in, for In the position ( i , j Perform max pooling anomaly scoring on the window centered at ) For position ( i , j () is the central window;
[0096] The image-level anomaly score is calculated using the following formula:
[0097] ;
[0098] in, For image-level anomaly scoring, Select a specific pixel position on the k-th layer The highest score on the scale.
[0099] In summary, anomaly scores are calculated by comparing the residuals between the optimized features and pre-stored "normal sample reference features." Then, pixel-level anomaly score maps are generated using max pooling and average pooling operations, and the final anomaly determination is made based on the global aggregation results. This unsupervised method does not require pre-labeled anomaly samples, reducing its dependence on data and making it suitable for situations where anomaly samples are difficult to obtain in practical applications.
[0100] Step S104: Determine whether the image-level anomaly score is greater than a first preset threshold;
[0101] Step S105: If the image-level anomaly score is greater than the first preset threshold, the substation equipment status is determined to be abnormal.
[0102] It should also be noted that if the image-level anomaly score is less than or equal to the first preset threshold, the substation equipment is determined to be in normal condition.
[0103] Furthermore, it should be noted that this embodiment achieves an image AUROC of 0.86 on the reconstructed dataset. High-quality synthetic normal samples are generated through edge-guided diffusion (EGD). This effectively solves the problem of sample scarcity in substation equipment anomaly detection. Ablation experiments show that configurations using only real data have low performance, while adding EGD improves performance by approximately 19%, verifying the superiority of synthetic samples generated by Canny edge maps in terms of structural consistency and diversity, and significantly enhancing the model's generalization ability. Furthermore, the overall anomaly detection method further improves performance through Feature Adaptive Optimization (FAO). FAO employs multi-scale feature selection and reconstruction (Max & Avg mode, residual retention ratio). The three-layer residual configuration effectively reduces feature redundancy and enhances the ability to distinguish between normal and abnormal samples. Ablation experiments show that, compared with the configuration without FAO, the performance is improved by approximately 19% (Image AUROC 0.861). Compared with traditional methods (such as Isolation Forest, Autoencoder, One-Class SVM, etc.), this method outperforms traditional methods in Image AUROC by 14%, 12%, and 11%, respectively, demonstrating accurate detection capabilities for complex fault modes such as cracks and material degradation.
[0104] In summary, this invention acquires a first sample set containing both normal and abnormal states, uses the Canny edge detection algorithm to generate feature space conditional vectors and reconstruct the samples, then aggregates them using a ResNet architecture to generate multi-scale features. After loss function optimization and weighted mapping, an optimized feature map is obtained, which is then input into a lightweight reconstruction network to obtain pixel-by-pixel anomaly scores. Max pooling is then used to obtain image-level anomaly scores, thereby determining whether the substation equipment is in an abnormal state. This method combines multiple advanced algorithms, forming a complete and efficient detection process from sample processing to feature extraction, optimization, and score calculation. It requires no large amount of labeled data, accurately detects abnormal states of substation equipment, improves detection efficiency and accuracy, and ensures the stable operation of substation equipment.
[0105] like Figure 2 As shown, an embodiment of the present invention also proposes an unsupervised anomaly detection system for substation equipment, the system comprising:
[0106] The sample reconstruction module 10 is used to acquire a first sample set containing normal and abnormal substation equipment status, generate a feature space condition vector based on the first sample set, and reconstruct the first sample set based on the feature space condition vector to obtain reconstructed samples.
[0107] The feature optimization module 20 is used to summarize the reconstructed samples and the first sample set to obtain a dataset, generate multi-scale features based on the dataset, and optimize the multi-scale features to obtain an optimized feature map.
[0108] Pooling module 30 is used to input the optimized feature map into the lightweight reconstruction network to obtain the anomaly score of each sample, perform max pooling on the anomaly score, and obtain the image-level anomaly score based on the max pooling result.
[0109] The scoring detection module 40 is used to determine whether the image-level anomaly score is greater than a first preset threshold.
[0110] The equipment anomaly determination module 50 is used to determine that the substation equipment status is abnormal if the image-level anomaly score is greater than a first preset threshold.
[0111] In another aspect, the present invention also proposes a storage medium on which one or more programs are stored, which, when executed by a processor, implement the above-described unsupervised anomaly detection method for substation equipment.
[0112] In another aspect, the present invention also proposes an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so as to realize the above-mentioned unsupervised anomaly detection method for substation equipment.
[0113] Those skilled in the art will understand that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain stored, communicated, propagated, or transmitted programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0114] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0115] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0116] While embodiments of the present invention have been described in detail above, it will be apparent to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations fall within the scope and spirit of the invention as set forth in the claims. Furthermore, the invention described herein may have other embodiments and can be implemented or carried out in various ways.
Claims
1. A method for unsupervised anomaly detection in substation equipment, characterized in that, The method includes: Obtain a first sample set containing information on substation equipment in normal and abnormal states, and then utilize the first sample set... The edge detection algorithm generates a feature space condition vector, and reconstructs the first sample set based on the feature space condition vector to obtain reconstructed samples; The reconstructed samples and the first sample set are combined to obtain a dataset. Multi-scale features are generated based on the dataset, and the multi-scale features are optimized to obtain an optimized feature map. The ResNet architecture is used as the backbone network for feature extraction, and the dataset is input into the backbone network to generate the first feature extraction feature. k Multiscale features of layers : ; in, K represents the backbone network, where K is the total number of layers in the backbone network, and each layer includes multiple channels. The height of the feature map at layer k ,width and number of channels X is the dataset; definition Multi-scale features The corresponding number i The 2D feature maps of each channel are generated, and the 2D feature map of each sample type is input into a pre-constructed loss function to obtain the optimal feature map. : ; in, For the k-th layer i The selection loss function for each channel It is the Frobenius norm. The number of normal samples. The number of abnormal samples. It is a hyperparameter that adjusts the loss weights for normal and abnormal samples. For the nth reconstructed sample, For the first n The normal sample at the ... k Layer i 2D feature map of each channel, For the first n The reconstructed sample at the th ... k Layer i 2D feature maps of each channel, For the m-th outlier sample in the k-th layer... i 2D feature maps of each channel; For optimal features Perform weighted mapping: ; in, For FAO mapping functions, For parameters, The optimized feature map; The optimized feature map is input into the lightweight reconstruction network to obtain the anomaly score for each sample. Max pooling is then performed on the anomaly score, and the image-level anomaly score is obtained based on the max pooling result. Determine whether the image-level anomaly score is greater than a first preset threshold; If the image-level anomaly score is greater than the first preset threshold, the substation equipment is determined to be in an abnormal state.
2. The method for unsupervised anomaly detection of substation equipment according to claim 1, characterized in that, The step of obtaining a first sample set containing normal and abnormal substation equipment statuses, and generating a feature space condition vector based on the first sample set, includes: Suppose that the normal sample set contained in the first sample set is represented as follows: ,use Edge detection algorithm generates binary edge map : ; in, express Edge detection algorithms obtain edge maps through smoothing, gradient calculation, and thresholding. ; edge map Input encoding network Generate feature space condition vectors : 。 3. The unsupervised anomaly detection method for substation equipment according to claim 2, characterized in that, The step of reconstructing the first sample set based on the feature space condition vector to obtain reconstructed samples includes: Define any sample in the first sample set as the initial sample. Using forward diffusion on the initial sample Gaussian noise is added incrementally to generate a noisy sample sequence: ; in, For a given time t-1, the image By using a fixed noise addition, we obtain t Time sample The probability distribution; It follows a Gaussian distribution. The noise intensity is a predefined value during the diffusion process. It is the identity matrix; Utilizing the enhanced U-Net network, according to t Time sample and feature space condition vector Generate reconstructed samples: ; in, In a given sample and edge feature condition vector Under these conditions, the denoising network predicts the reconstructed samples from the previous time step. The conditional probability distribution; and These are the reconstructed mean and covariance predicted by the network, respectively. The mean of the reconstructed samples predicted by the network. For network parameters, This is the covariance matrix of the reconstructed samples predicted by the network, used to describe the uncertainty of the reconstructed samples.
4. The unsupervised anomaly detection method for substation equipment according to claim 3, characterized in that, The step of inputting the optimized feature map into the lightweight reconstruction network to obtain the anomaly score for each sample includes: The pixel-by-pixel anomaly score is obtained using the following formula: ; in, For the pixel positions in the optimized feature map ( m , n The value of ) pixel position ( m , n The reconstructed eigenvalues of ) To rebuild the network in a lightweight manner, pixel position ( m , n Abnormal scores, Anomaly scoring for the sample.
5. The unsupervised anomaly detection method for substation equipment according to claim 4, characterized in that, The step of performing max pooling on the anomaly score and obtaining an image-level anomaly score based on the max pooling result includes: Max pooling is performed according to the following formula: ; in, for In position Anomaly scoring is performed on the central window after max pooling. For position The central window; The image-level anomaly score is calculated using the following formula: ; in, For image-level anomaly scoring, Select a specific pixel position on the k-th layer The highest score on the scale.
6. A substation equipment unsupervised anomaly detection system, characterized in that, The system includes: The sample reconstruction module is used to obtain a first sample set containing information on normal and abnormal substation equipment states, and to utilize the first sample set... The edge detection algorithm generates a feature space condition vector, and reconstructs the first sample set based on the feature space condition vector to obtain reconstructed samples; The feature optimization module is used to summarize the reconstructed samples and the first sample set to obtain a dataset, generate multi-scale features based on the dataset, and optimize the multi-scale features to obtain an optimized feature map. The ResNet architecture is used as the backbone network for feature extraction, and the dataset is input into the backbone network to generate the first feature extraction feature. k Multiscale features of layers : ; in, K represents the backbone network, where K is the total number of layers in the backbone network, and each layer includes multiple channels. The height of the feature map at layer k ,width and number of channels X is the dataset; definition Multi-scale features The corresponding number i The 2D feature maps of each channel are generated, and the 2D feature map of each sample type is input into a pre-constructed loss function to obtain the optimal feature map. : ; in, For the k-th layer i The selection loss function for each channel It is the Frobenius norm. The number of normal samples. The number of abnormal samples. It is a hyperparameter that adjusts the loss weights for normal and abnormal samples. For the nth reconstructed sample, For the first n The normal sample at the ... k Layer i 2D feature map of each channel, For the first n The reconstructed sample at the th ... k Layer i 2D feature maps of each channel, For the m-th outlier sample in the k-th layer... i 2D feature maps of each channel; For optimal features Perform weighted mapping: ; in, For FAO mapping functions, For parameters, The optimized feature map; The pooling module is used to input the optimized feature map into the lightweight reconstruction network to obtain the anomaly score of each sample, perform max pooling on the anomaly score, and obtain the image-level anomaly score based on the max pooling result. The scoring detection module is used to determine whether the image-level anomaly score is greater than a first preset threshold. The equipment anomaly determination module is used to determine that the substation equipment is in an abnormal state if the image-level anomaly score is greater than a first preset threshold.
7. A storage medium, characterized in that, The storage medium stores one or more programs that, when executed by a processor, implement the unsupervised anomaly detection method for substation equipment as described in any one of claims 1-5.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor, wherein: The memory is used to store computer programs; When the processor executes the computer program stored in the memory, it implements the unsupervised anomaly detection method for substation equipment as described in any one of claims 1-5.
Citation Information
Patent Citations
Abnormality detection method and device, electronic equipment and computer readable storage medium
CN113688890A
Railway wagon connecting pull rod chain fracture fault identification method
CN115170890A