A traction substation visual anomaly detection method

By using a masked autoencoder structure and a scene-specific memory module-based anomaly detection network, the robustness and accuracy issues in traction substation monitoring scenarios are resolved, enabling efficient anomaly detection and adaptive updates.

CN122492584APending Publication Date: 2026-07-31SOUTHWEST JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTHWEST JIAOTONG UNIV
Filing Date
2026-04-27
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies for anomaly detection in traction substation monitoring scenarios lack robustness, do not pay sufficient attention to key areas, and have limited cross-scenario generalization capabilities, making it difficult to meet the requirements for detection accuracy, stability, and real-time performance.

Method used

An anomaly detection network employing a mask autoencoder structure combines a key region priority mask and a candidate anomaly mask. Anomaly detection is performed through image block segmentation and a scene-specific memory module. The network is trained using image block reconstruction error and a region reweighting loss function, and incorporates local consistency optimization and adaptive updates for candidate anomaly regions.

Benefits of technology

It improves the accuracy and robustness of anomaly detection in traction substation monitoring scenarios, adapts to different machine positions and environmental changes, and achieves accurate detection and real-time response to anomalies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122492584A_ABST
    Figure CN122492584A_ABST
Patent Text Reader

Abstract

This invention proposes a visual anomaly detection method for traction substations. It relates to the field of traction substation monitoring technology, and constructs a masked autoencoder anomaly detection model based on the reconstruction of the normal background under the current input frame conditions. During the training phase, the input image is divided into image blocks and encoded with a high proportion of masking. The corresponding clean background image is used as the supervision target. Priority masking is applied to key equipment areas, visibility constraints are imposed on synthetic anomaly areas, and scene-specific memory is combined to learn the normal background representation under different monitoring positions. During the detection phase, the global anomaly score is calculated using the difference information between the reconstructed result and the input image. The anomaly score is refined by combining local consistency analysis of candidate target areas, achieving frame-by-frame anomaly detection in traction substation monitoring videos.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of intelligent monitoring, computer vision, artificial intelligence, and pattern recognition in traction power supply systems. Background Technology

[0002] Traction substations are a crucial component of railway traction power supply systems, and their operational status directly impacts line power supply safety and train reliability. In practice, traction substations typically deploy fixed-position monitoring cameras to continuously capture video feeds of critical equipment areas within the station. Because these environments are typically outdoors, the monitoring footage often includes not only real anomalies but also normal environmental variations such as changes in lighting, rain and snow, slight vibrations, shadow fluctuations, and background disturbances. Therefore, utilizing computer vision technology for anomaly detection in traction substation video monitoring footage is of great significance for improving substation operational safety, reducing maintenance costs, and achieving intelligent operation and maintenance.

[0003] Currently, anomaly detection technology based on video analytics has become an important research direction in the field of intelligent surveillance. Existing technologies typically utilize normal samples for learning and modeling, and then determine anomalies based on the degree of deviation between the test video and the normal pattern during the detection phase. Various anomaly detection methods have been proposed, focusing on spatiotemporal information modeling in video scenes, normal behavioral feature representation, and anomaly area perception and localization. These methods can combine the appearance information, motion change information, and scene context information of video frames to identify and analyze abnormal events, and to some extent improve anomaly detection capabilities in complex scenes. Simultaneously, these technologies also emphasize the comprehensive utilization of local key areas, target behavior states, and scene semantic information to improve the accuracy and stability of anomaly detection results. However, in practical applications, existing technologies remain susceptible to environmental factors such as slight camera shake, weather changes, shadow fluctuations, dynamic background interference, and complex target changes. They generally suffer from insufficient robustness, inadequate attention to key areas, limited cross-scene generalization ability, and high complexity in model training and deployment. Therefore, they struggle to meet the application requirements for accuracy, stability, and real-time anomaly detection in fixed monitoring scenarios of traction substations. Summary of the Invention

[0004] The purpose of this invention is to provide a visual anomaly detection method for traction substations, which can effectively meet the application requirements of accuracy, stability and real-time performance in fixed monitoring scenarios of traction substations.

[0005] The objective of this invention is achieved through the following technical solution: A method for detecting visual anomalies in traction substations, the method comprising the following steps: Step 1: Construction and preprocessing of traction substation video dataset; Videos from fixed monitoring stations in traction substations are collected and decomposed into a sequence of frame images arranged chronologically. Frame images are stored separately for each monitoring station or scene, with each monitoring station corresponding to an independent frame image directory. Training data includes normal frame image sequences, synthetic abnormal frame image sequences, and pixel-level abnormal region masks corresponding one-to-one with the synthetic abnormal frame image sequences. Test data includes the frame image sequences to be detected and frame-by-frame image label files aligned with the frame image sequences. For each frame image, it is regularized to a preset input resolution and pixel normalization is performed. The input resolution is set to 320×640, and pixel values ​​are normalized to the [-1,1] range. For input images, a single-frame image RGB input mode is used, i.e., the number of network input channels is 3, the number of network output channels is 3, and the output only represents the normal background image corresponding to the input frame image. Furthermore, for scenes with more than one monitoring station, a mapping relationship between the monitoring station name and scene number is established and saved as a scene mapping file so that scene-specific modeling can be performed for different monitoring stations during the training and inference phases. Step 2: Constructing the key region priority mask and candidate anomaly mask; The first type is the key area priority mask, used for priority mask generation during the training and testing phases. The key area priority mask corresponds to the monitoring equipment area or key monitoring area in the traction substation monitoring screen and is stored as a single-channel pixel-level mask. This type of mask can be obtained through manual annotation, rule configuration, or offline pre-generation, and is saved according to the monitoring location and frame image number index. It is used to prioritize the areas to be masked after image block division. The second type is the candidate anomaly mask, used for local consistency optimization and anomaly score refinement during the inference phase. The candidate anomaly mask is obtained offline by combining a target detector with an instance-level background modeling method, and is cached frame by frame according to the video image sequence to avoid sequential online calculations during the data loading phase. The target detector uses a Detic zero-shot detector. The generated candidate anomaly masks are cached according to the monitoring location and frame image number for rapid loading during the inference phase. The candidate anomaly mask is used in conjunction with the global anomaly results output by the reconstruction network for consistency optimization and anomaly score refinement of candidate anomaly regions. Step 3: Construction of the anomaly detection network; The traction substation anomaly detection network adopts a masked autoencoder structure, consisting of an input layer, an encoding layer, a memory fusion layer, a decoding layer, and an output layer. The input layer receives pre-processed RGB monitoring images with a size of 320×640 pixels. Both the input and output layers are 320×640×3, and the output is a reconstructed image of a normal background consistent with the current input frame conditions. The input image is divided into a regular image block grid, and image block feature sequences are obtained through convolutional embedding. The image block size is set to 16×16 pixels, thus the input image forms a 20×40 image block grid, with a total of 800 image blocks. After convolutional embedding, each image block is mapped to a 1024-dimensional feature vector, forming an image block sequence representation. In the masking stage, semantically guided priority masks are applied to the image blocks, and the masked image blocks are replaced with masked marker vectors while maintaining their integrity. A grid topology is used to enable joint modeling of image patch grids by the encoding and decoding layers. The encoding layer consists of 24 Transformer encoding modules with 16 multi-head attention heads. The decoding layer consists of 8 Transformer decoding modules with a decoder embedding dimension of 512 and 16 decoding attention heads. The decoded output is linearly mapped to restore image patch-level pixel predictions, with each image patch corresponding to a prediction dimension of 768. A scene-specific memory module is set between the encoding and decoding layers. The scene-specific memory module establishes an independent memory bank according to the monitoring position or scene number, performs memory retrieval and feature fusion on the encoded image patch features, and forms an enhanced representation that conforms to the normal pattern of the corresponding scene. The scene-specific memory module can establish positional association with the spatial region where the image patch is located, so that the image patch features and the scene memory of the corresponding region are jointly modeled. Step 4: Training the anomaly detection network; The anomaly detection network is trained using the dataset constructed in step one. For each training sample, image patch segmentation and priority masking are performed first. Then, the masked images are input into the encoding layer, memory fusion layer, and decoding layer respectively to obtain normal background reconstruction results. The loss function during the training phase is based on the image patch reconstruction error and incorporates information on the monitoring equipment area and the abnormal area to construct a weighted training objective. The loss includes: reconstruction loss for the masked image patch, region reweighting loss for the key equipment area and the abnormal area, background recovery constraint term for the visible abnormal area, and constraint term for the scene-specific memory attention distribution. Through the training process, the network learns the normal background representation under the current input frame image conditions and forms a normal pattern modeling result for scenes with more than one monitoring position. Step 5: Image Input; In real-time processing, real-time video images are acquired from the traction substation monitoring system, and frame images are extracted as input. In offline processing, the acquired historical monitoring video is decomposed into an image sequence, and images are extracted frame by frame in chronological order as input. The input images are subjected to size regularization and normalization processing consistent with step one. When the input image is empty, the detection process is terminated. When the input image is not empty, the process proceeds to step six to perform traction substation anomaly detection. Step Six: Traction Substation Anomaly Detection; The test frame image is input into the anomaly detection network constructed in step three and trained in step four. First, priority masking is performed on the key regions constructed in step two in the test frame. Then, a normal background reconstruction image with the same conditions as the current input frame image is generated through the encoding layer, scene-specific memory module, and decoding layer. Image block-level difference calculation is performed on the input image and the reconstructed image to obtain the reconstruction error of each image block. According to the preset aggregation rule, a set of high-response image blocks is extracted from the reconstruction error to obtain the global anomaly score of the frame image. The global anomaly score represents the degree of difference between the current frame image and its normal background reconstruction result. After obtaining the global anomaly score, the anomaly detection result is optimized in step seven. Step 7: Optimize anomaly detection results; In the inference phase, this invention uses the candidate anomaly mask constructed in step two to optimize the global anomaly score obtained in step six: when there are valid candidate anomaly regions in the input frame image, the image block error statistics within the candidate region and the image block error statistics of the outer ring region of the candidate region are calculated; if the error within the candidate region is significantly higher than the error in the outer ring region, it is considered that the candidate region and the reconstruction error are consistent. Furthermore, a second mask inference is performed on the candidate anomaly region: the pixels of the candidate region in the input image are replaced with the mean or zero of the pixels outside the candidate region, and then a network forward reconstruction is performed again. The larger value of the errors in the two candidate regions is taken as the result. Local evidence is used to improve sensitivity to occlusion or complex foreground perturbations. When there are no effective candidate anomaly regions in the input frame image, the global anomaly score obtained in step six is ​​directly used as the anomaly detection result of the current frame, and the process proceeds to step eight. In specific implementation, the scoring refinement satisfies the following rules: when the error in the candidate region is greater than the global anomaly score, the non-negative part of the difference between the two is taken as the increment, multiplied by a preset coefficient, and then superimposed on the global anomaly score. This superposition is only performed when conditions such as the area of ​​the candidate region and the difference between the errors inside and outside the region are met. After the anomaly detection result is optimized, the process proceeds to step eight to perform adaptive updates of the anomaly detection network. Step 8: Adaptive update of the anomaly detection network; During anomaly detection, input images that are judged to be normal after processing in steps six and seven and whose anomaly scores meet the preset update conditions are taken as high-confidence normal samples. The high-confidence normal samples undergo the same preprocessing as in step one and are classified according to the monitoring position or scene number to form an updated dataset. The updated dataset is input into the anomaly detection network, and the scene-specific memory module and the anomaly detection network are adaptively updated to update the normal background representation under the current monitoring position or scene. After the update is completed, the process returns to step five to continue anomaly detection for subsequent input images.

[0006] Advantages and Positive Effects: This invention proposes an anomaly detection method for traction substation monitoring scenarios. This method utilizes the concept of mask autoencoder reconstruction to detect anomalies in traction substation monitoring images. The monitoring image is divided into image blocks of fixed size and high-proportion mask reconstruction learning is performed. After training, during the anomaly detection process, the anomaly detection network performs forward processing on the input image and generates a corresponding anomaly-free reconstructed image. The anomaly detection result is then obtained by comparing the input image with the anomaly-free reconstructed image, thereby completing the anomaly detection task for the operating status of traction substation equipment. This invention combines the structural characteristics of equipment areas in traction substation monitoring scenarios, introduces a priority mask and region weighting mechanism, and improves adaptability to different camera positions and environments through scene memory fusion. This enables more accurate detection of anomalies in traction substation monitoring images. Furthermore, based on the detection results, a candidate anomaly region local optimization and scoring enhancement strategy is introduced to improve the robustness of anomaly detection. For high-confidence normal samples in the detection results, the scene-specific memory module and the anomaly detection network can be adaptively updated to continuously update the normal background representation under different camera positions and environmental conditions. Furthermore, the method of this invention can handle different traction substation scenarios, different environments, and different lighting background conditions. In practical applications, it is only necessary to construct or enhance the traction substation monitoring dataset according to the specific situation and configure the relevant parameters appropriately to achieve accurate detection of traction substation anomalies, thus having strong scene adaptability. Attached Figure Description

[0007] Figure 1 This is a flowchart illustrating the technical process of the method of the present invention. Detailed Implementation

[0008] The method of the present invention can be used in different traction substation scenarios and can accurately detect visual anomalies in traction substation monitoring video images.

[0009] Specifically, when using the method of this invention to detect anomalies in traction substations, the video captured by the monitoring cameras in the traction substation is first decomposed into a sequence of frame images, and training and testing sets are established according to camera positions. Normal frame images during the training phase are stored in a directory divided by camera position. Some training samples use synthetic abnormal frames instead of normal frames as input, while simultaneously reading the corresponding pixel-level anomaly region mask. Subsequently, a key region priority mask is constructed based on the key equipment area, and a candidate anomaly mask is constructed based on the candidate target detection results. A mapping relationship between camera position names and scene numbers is established. In the network construction phase, an anomaly detection network is constructed using a mask autoencoder structure. The network input image size is 320×640, and the image patch size is 16×16, corresponding to a 20×40 image patch grid. The encoder embedding dimension is 1024, the encoding depth is 24 layers, and the number of multi-head attention heads is 16. The decoder embedding dimension is 512, the decoding depth is 8 layers, and the number of decoding attention heads is 16. The network introduces a scene-specific memory module between the encoding and decoding layers, enabling images from different camera angles to recall the normal mode memory corresponding to the scene during training and inference. During training, normal images or synthesized anomalous images are used as input, with the corresponding clean background image serving as the supervised target. The input image is processed through image patch segmentation and priority masking before being fed into the network. Model training is completed by incorporating image patch reconstruction error, region reweighting, structural constraints, and memory attention distribution constraints. During inference, the test frame undergoes the same preprocessing and priority mask generation as during training. The trained anomaly detection network is used to obtain a normal background reconstruction image under the current input frame conditions. A global anomaly score is obtained based on the image patch error between the input image and the reconstructed image. When a valid candidate anomalous region exists in the input frame, the local consistency statistic of the candidate region is further calculated. This statistic is then combined with the inference result of the local input mask of the candidate region to form a local anomaly score. Finally, the local anomaly score and the global anomaly score are refined and fused to output the anomaly score and anomaly determination result for that frame. For input images whose detection results are normal and whose anomaly scores meet the preset update conditions, they are treated as high-confidence normal samples and assigned to the incremental update dataset according to the camera position or scene number. Then, the scene-specific memory module and the anomaly detection network are adaptively updated. After the update is completed, the input images are continued to be detected for anomalies.

[0010] The method of this invention can be implemented by a computer program. The detection system software based on this method can be deployed on a PC or embedded system for anomaly detection applications in traction substation monitoring scenarios.

Claims

1. A method for detecting visual anomalies in traction substations, the method comprising the following steps: Step 1: Construction and Preprocessing of Traction Substation Video Dataset Collect the video of the fixed monitoring position of the traction substation, and decompose the video into a frame image sequence arranged in time sequence; store the frame images according to the monitoring positions or scenes, wherein each monitoring position corresponds to an independent frame image directory; the training data includes a normal frame image sequence, a synthetic abnormal frame image sequence, and a pixel-level abnormal area mask corresponding to the synthetic abnormal frame image sequence; the test data includes a frame image sequence to be detected and a frame-by-frame image label file aligned with the frame image sequence; For each frame of image, it is regularized to a preset input resolution and pixel normalization is performed. The input resolution is set to 320×640, and the pixel values ​​are normalized to the range of [-1,1]. For the input image, a single-frame image RGB input mode is adopted, that is, the number of network input channels is 3, the number of network output channels is 3, and the output only represents the normal background image corresponding to the input frame image. Furthermore, for scenarios with more than one monitoring position, a mapping relationship between the monitoring position name and the scene number is established and saved as a scene mapping file so that scene-specific modeling can be performed for different monitoring positions during the training and inference phases. Step 2: Constructing the Priority Mask for Key Regions and the Candidate Anomaly Mask The first type is the key area priority mask, used for priority mask generation during the training and testing phases. The key area priority mask corresponds to the monitoring equipment area or key monitoring area in the traction substation monitoring screen and is stored in the form of a single-channel pixel-level mask. This type of mask can be obtained through manual annotation, rule configuration, or offline pre-generation, and is saved according to the monitoring position and frame image number index. It is used to prioritize the determination of the area to be masked after the image block is divided. The second type is the candidate anomaly mask, used for local consistency optimization and anomaly score refinement during the inference phase. Candidate anomaly masks are obtained offline by combining object detectors with instance-level background modeling methods and are cached frame by frame according to the video image sequence to avoid sequential online calculations during the data loading stage; The target detector uses the Detic zero-shot detector; the generated candidate anomaly masks are cached according to the monitoring position and frame image number for fast loading during the inference stage; the candidate anomaly masks are used in conjunction with the global anomaly results output by the reconstruction network for consistency optimization of candidate anomaly regions and refinement of anomaly scores; Step 3: Construction of the Anomaly Detection Network The traction substation anomaly detection network adopts a masked autoencoder structure, consisting of an input layer, an encoding layer, a memory fusion layer, a decoding layer, and an output layer. The input layer receives a pre-processed RGB monitoring image with a size of 320×640 pixels. Both the input and output layers have dimensions of 320×640×3, and the output is a normal background reconstructed image consistent with the current input frame conditions. The input image is divided into a regular image block grid, and the image block feature sequence is obtained through convolutional embedding. The image block size is set to 16×16 pixels, so the input image forms a 20×40 image block grid, with a total of 800 image blocks. After convolutional embedding, each image block is mapped to a 1024-dimensional feature vector, forming an image block sequence representation. In the masking stage, semantically guided priority masks are applied to image patches. The masked image patches are replaced with mask marker vectors while maintaining the complete grid topology, enabling the encoding and decoding layers to jointly model the image patch grid. The encoding layer consists of 24 Transformer encoding modules with 16 multi-head attention heads. The decoding layer consists of 8 Transformer decoding modules with a decoder embedding dimension of 512 and 16 decoding attention heads. The decoded output is linearly mapped to restore image patch-level pixel predictions, with each image patch corresponding to a prediction dimension of 768. A scene-specific memory module is set between the encoding and decoding layers. The scene-specific memory module establishes an independent memory bank according to the monitoring position or scene number, performs memory retrieval and feature fusion on the encoded image patch features, and forms an enhanced representation that conforms to the normal pattern of the corresponding scene. The scene-specific memory module can establish positional associations with the spatial region where the image patch is located, enabling joint modeling of image patch features and the scene memory of the corresponding region. Step 4: Training the Anomaly Detection Network The anomaly detection network was trained using the dataset constructed in step one. For each training sample, image patch segmentation and priority masking are performed first, and then the masked image is input into the coding layer, memory fusion layer and decoding layer respectively to obtain the normal background reconstruction result; The loss function during the training phase focuses on image patch reconstruction error and incorporates information from monitoring equipment areas and abnormal areas to construct a weighted training objective. The loss includes: reconstruction loss for masked image patches, region reweighting loss for key equipment areas and abnormal areas, background recovery constraint for visible abnormal areas, and constraint for scene-specific memory attention distribution. Through the training process, the network learns the normal background representation under the current input frame image conditions and forms a normal pattern modeling result for scenes with more than one monitoring camera. Step 5: Image Input In real-time processing, real-time video images are acquired from the traction substation monitoring system, and frame images are extracted as input. In offline processing, the acquired historical monitoring video is decomposed into an image sequence, and images are extracted frame by frame in chronological order as input. The input images are subjected to size regularization and normalization processing consistent with step one. When the input image is empty, the detection process is terminated. When the input image is not empty, the process proceeds to step six to perform traction substation anomaly detection. Step Six: Traction Substation Anomaly Detection The test frame image is input into the anomaly detection network constructed in step three and trained in step four. First, priority masking is performed on the key regions constructed in step two in the test frame. Then, a normal background reconstruction image with the same conditions as the current input frame image is generated through the encoding layer, scene-specific memory module, and decoding layer. Image block-level difference calculation is performed on the input image and the reconstructed image to obtain the reconstruction error of each image block. According to the preset aggregation rule, a set of high-response image blocks is extracted from the reconstruction error to obtain the global anomaly score of the frame image. The global anomaly score represents the degree of difference between the current frame image and its normal background reconstruction result. After obtaining the global anomaly score, the anomaly detection result is optimized in step seven. Step 7: Optimize Anomaly Detection Results In the inference phase, this invention uses the candidate anomaly mask constructed in step two to optimize the global anomaly score obtained in step six: when there are valid candidate anomaly regions in the input frame image, the image block error statistics within the candidate region and the image block error statistics of the outer ring region of the candidate region are calculated; if the error within the candidate region is significantly higher than the error in the outer ring region, it is considered that the candidate region and the reconstruction error are consistent. Furthermore, a second mask inference is performed on the candidate anomaly region: the pixels of the candidate region in the input image are replaced with the mean or zero of the pixels outside the candidate region, and then a network forward reconstruction is performed again. The larger value of the errors in the two candidate regions is taken as the result. Local evidence is used to improve sensitivity to occlusion or complex foreground perturbations. When there are no effective candidate anomaly regions in the input frame image, the global anomaly score obtained in step six is ​​directly used as the anomaly detection result of the current frame, and the process proceeds to step eight. In specific implementation, the scoring refinement satisfies the following rules: when the error in the candidate region is greater than the global anomaly score, the non-negative part of the difference between the two is taken as the increment, multiplied by a preset coefficient, and then superimposed on the global anomaly score. This superposition is only performed when conditions such as the area of ​​the candidate region and the difference between the errors inside and outside the region are met. After the anomaly detection result is optimized, the process proceeds to step eight to perform adaptive updates of the anomaly detection network. Step 8: Adaptive Update of Anomaly Detection Network During anomaly detection, input images that are judged to be normal after processing in steps six and seven and whose anomaly scores meet the preset update conditions are taken as high-confidence normal samples. The high-confidence normal samples undergo the same preprocessing as in step one and are classified according to the monitoring position or scene number to form an updated dataset. The updated dataset is input into the anomaly detection network, and the scene-specific memory module and the anomaly detection network are adaptively updated to update the normal background representation under the current monitoring position or scene. After the update is completed, the process returns to step five to continue anomaly detection for subsequent input images.