Railway external environment anomaly detection method and system based on global feature correlation
By using a global feature correlation method, multi-level features of railway external environment images are obtained, a global correlation matrix is constructed for feature fusion and data augmentation, and anomaly detection is performed using a feature processing network. This solves the problem that traditional methods have difficulty in identifying small anomalies in complex environments, and achieves higher robustness and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA RAILWAY DESIGN GRP CO LTD
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-07
AI Technical Summary
Traditional methods for detecting anomalies in railway external environment images are highly dependent on feature selection, making it difficult to effectively cope with complex terrain environments. They are also susceptible to noise and redundant information, and struggle to accurately identify minute anomalies.
A railway external environment anomaly detection method based on global feature correlation is adopted. By acquiring multi-level features, constructing a global correlation matrix, performing feature fusion and data augmentation, and using a feature processing network for anomaly detection, including feature compression and recovery, and training is performed using cosine similarity and mean square error loss functions.
It improves the ability to detect minute anomalies in complex environments, enhances robustness and detection accuracy, and can effectively identify abnormal parts in the external environment of railways.
Smart Images

Figure CN122048946B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent railway monitoring technology, and in particular relates to a method and system for detecting anomalies in the external environment of railways based on global feature correlation. Background Technology
[0002] Anomaly detection is an advanced technology in railway external environment monitoring, playing a crucial role in railway construction and safety maintenance. Railway external environment images typically cover vast geographical areas and contain complex terrain information; therefore, accurately detecting and identifying anomalous changes is essential for improving the accuracy and reliability of data analysis. Traditional image anomaly detection methods usually rely on techniques such as statistical analysis and threshold segmentation. These methods identify anomalous areas by analyzing spectral or spatial features in the images. However, traditional methods have several significant limitations: they are highly dependent on feature selection, struggle to effectively handle complex terrain environments, and are susceptible to noise and redundant information. Deep neural networks possess powerful feature extraction capabilities, automatically learning multi-level feature representations from railway external environment images, thereby achieving more accurate and robust anomaly detection in complex environments.
[0003] Compared with traditional methods, anomaly detection methods based on deep neural networks can automatically learn features to adapt to diverse scenarios without relying on hand-crafted features. They can effectively integrate global and local information and improve the detection capability of minor anomalies. Therefore, this invention aims to provide such methods. Summary of the Invention
[0004] To address the problems existing in the background art, the present invention aims to provide a method for detecting anomalies in the external environment of railways based on global feature correlation.
[0005] The present invention adopts the following technical solution:
[0006] A railway external environment anomaly detection method based on global feature correlation, the method comprising the following steps:
[0007] The processing methods for images of the railway's external environment include:
[0008] Obtain multi-level features of an image;
[0009] The acquired multi-level features are adjusted to the same resolution and concatenated along the channel dimension to obtain concatenated features that fuse multi-level information. The correlation matrix between the feature vector at each position of the concatenated features and the feature vectors at all positions is calculated to obtain the global correlation matrix. The global correlation matrix is then fused with the multi-level concatenated features to obtain a fused feature with enhanced global correlation.
[0010] Data augmentation and amplification are performed on the fusion features with enhanced global correlation to obtain the fusion features with enhanced global correlation after data augmentation and amplification. ;
[0011] A feature processing network is constructed, and the feature processing network is trained using the feature recovery loss function to obtain the trained network, which is able to reconstruct the feature distribution of a normal image.
[0012] When using a trained feature processing network to detect abnormal areas in railway external environment images, the processed railway external environment image is input into the trained feature processing network. The network then compresses and restores the fusion features obtained from data augmentation and global correlation enhancement to obtain the restored fusion features. The detection of abnormal parts in railway external environment images is achieved by judging whether the feature recovery error is higher than the threshold.
[0013] Furthermore, the feature processing network includes a cascaded feature compressor and feature restorer. It reduces the feature dimension through a convolutional neural network, performs global information perception and aggregation in the low-dimensional latent space through a Transformer layer, and finally restores the feature dimension through a convolutional neural network.
[0014] Furthermore, when training the feature processing network, normal railway external environment images are used as samples. During the forward propagation stage, the samples are processed to obtain fused features of data augmentation and global correlation enhancement, which are then input into the feature processing network to calculate the output restored fused features. Fusion features with data augmentation and augmentation followed by global relevance enhancement The loss between samples is reduced; the feature processing network parameters are continuously updated through the backpropagation algorithm, enabling the feature processing network to reconstruct the feature distribution of normal samples.
[0015] Furthermore, the feature recovery loss function ,in, , Let these represent the cosine similarity loss function and the mean squared error loss function, respectively. , ,in, Represents the cosine similarity function. This represents the mean square error function.
[0016] Furthermore, the acquired multi-level features are adjusted to the same resolution and concatenated along the channel dimension to obtain concatenated features that fuse multi-level information. The correlation matrix between the feature vector at each position of the concatenated features and the feature vectors at all positions is calculated to obtain the global correlation matrix. The global correlation matrix is then fused with the multi-level concatenated features to obtain the globally correlated enhanced fused features.
[0017] Using bilinear interpolation Operators and feature splicing The operation formula adjusts multi-level features to the same resolution and concatenates them along the channel dimension, fusing features from different levels to obtain the fused concatenated features. ;
[0018] The 3D stitched matrix is flattened using matrix flattening operations. Flattening yields a two-dimensional feature matrix The correlation matrix is obtained by matrix multiplication. ;Will Restored to its original spatial shape ,in, The matrix flattening operation represents the correlation matrix and splicing features that restore the original spatial shape. By concatenating along the channel dimension, a fusion feature with enhanced global correlation is obtained. .
[0019] Furthermore, the method for obtaining multi-level features of an image is as follows:
[0020] The image is preprocessed by size normalization, and then directly input into the WideResNet50 neural network pre-trained on the ImageNet dataset, according to the formula... Get Image The first, second, and third level features, where f represents the feature extraction network. , , These are the features obtained at levels 1, 2, and 3, respectively. , , h1, h2, and h3 represent the heights of the first, second, and third level feature matrices, respectively; w1, w2, and w3 represent the widths of the first, second, and third level feature matrices, respectively; and d1, d2, and d3 represent the number of channels of the first, second, and third level feature matrices, respectively.
[0021] Furthermore, data augmentation and amplification are performed on the fusion features that enhance global correlation, resulting in fusion features with enhanced global correlation after data augmentation and amplification. The method is as follows:
[0022] The noise generation function samples samples with a mean of 0 and a variance of . Gaussian noise matrix Fusion features with enhanced global relevance Addition for data augmentation and amplification is represented as follows: ,in, This represents a fusion feature of data augmentation and the resulting global relevance enhancement.
[0023] A railway external environment anomaly detection system based on global feature correlation includes:
[0024] The railway external environment image processing module is used to process railway external environment images. The processing methods include:
[0025] Obtain multi-level features of an image;
[0026] The acquired multi-level features are adjusted to the same resolution and concatenated along the channel dimension to obtain concatenated features that fuse multi-level information. The correlation matrix between the feature vector at each position of the concatenated features and the feature vectors at all positions is calculated to obtain the global correlation matrix. The global correlation matrix is then fused with the multi-level concatenated features to obtain a fused feature with enhanced global correlation.
[0027] Data augmentation and amplification are performed on the fusion features with enhanced global correlation to obtain the fusion features with enhanced global correlation after data augmentation and amplification. ;
[0028] The feature processing network construction and training module is used to construct the feature processing network, train the feature processing network through the feature recovery loss function, and obtain the trained network, so that the trained network can reconstruct the feature distribution of the normal image.
[0029] The railway external environment image anomaly detection module is used to detect anomalies in railway external environment images using a trained feature processing network. It inputs the processed railway external environment image into the trained feature processing network, compresses and restores the fusion features obtained from data augmentation and global correlation enhancement, and obtains the restored fusion features. The detection of abnormal parts in railway external environment images is achieved by judging whether the feature recovery error is higher than the threshold.
[0030] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the railway external environment anomaly detection method based on global feature correlation as described above.
[0031] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the railway external environment anomaly detection method based on global feature correlation as described above.
[0032] The beneficial technical effects of this invention are as follows:
[0033] This invention first acquires multi-level features from railway external environment images to obtain rich detailed textures and contextual semantic information. Then, it aligns and stitches features from different levels using bilinear interpolation to construct a global correlation matrix. By calculating the correlation between any two spatial locations in the correlation matrix, the global contextual dependencies of the image are effectively captured. Finally, a parallel feature compression and reconstruction network consisting of an encoder and a decoder is constructed. The stitched features are used as the input to this network, and the detection of defect locations is achieved based on the reconstruction error. The multi-level features provide good representation capabilities for defects of different sizes and types. Compared with traditional single-level autoencoder networks, the parallel feature compression and reconstruction network improves the quality of single-level feature reconstruction and enhances robustness by performing parallel compression and reconstruction of features from different levels and fusing multi-level features in the latent space. This provides a new approach for solving surface defect detection based on feature reconstruction. Attached Figure Description
[0034] Figure 1 This is a flowchart of the railway external environment anomaly detection method based on global feature correlation in an embodiment of the present invention;
[0035] Figure 2(a) is a cross-sectional image of a defective cable in Embodiment 1 of the present invention;
[0036] Figure 2(b) is a schematic diagram of Figure 2(a) after anomaly detection using the method of Example 1. Detailed Implementation
[0037] The railway external environment anomaly detection method and system based on global feature correlation provided by the present invention will be further described clearly and completely below with reference to the accompanying drawings:
[0038] Example 1
[0039] like Figure 1 As shown in the figure, the railway external environment anomaly detection method based on global feature correlation provided in this embodiment includes the following steps:
[0040] Step S1: Acquire images of the railway's external environment and use a pre-trained deep neural network to obtain multi-level features of the images; specifically, this includes the following steps:
[0041] A single image of the railway's external environment to be detected is acquired, and the image is normalized and scaled to a width and height of 256 pixels. The preprocessed image is then directly input into a WideResNet50 neural network pre-trained on the ImageNet dataset.
[0042] When extracting features from an image, according to the formula Acquiring images of the railway's external environment The first, second, and third level features, where f represents the feature extraction network. , , These are the features obtained at levels 1, 2, and 3, respectively. , , h1, h2, and h3 represent the heights of the feature matrices at levels 1, 2, and 3, respectively; w1, w2, and w3 represent the widths of the feature matrices at levels 1, 2, and 3, respectively; and d1, d2, and d3 represent the number of channels in the feature matrices at levels 1, 2, and 3, respectively. It should be noted that the features at level 1 are taken from the output of the first residual stage of the network, which has the highest spatial resolution and mainly captures subtle defect features such as local edges and textures in the railway environment. The features at level 2 are taken from the output of the second residual stage of the network, which extracts structural information at a medium scale. The features at level 3 are taken from the output of the third residual stage of the network, which has the largest receptive field and mainly captures semantic information and contextual features of large areas.
[0043] Step S2: Adjust the acquired multi-level features to the same resolution through bilinear interpolation, and stitch them together in the channel dimension to obtain stitched features that fuse multi-level information. Calculate the correlation matrix between the feature vector at each position of the stitched features and the feature vectors at all positions to obtain the global correlation matrix. Fuse the global correlation matrix with the multi-level stitched features to obtain a fused feature with enhanced global correlation.
[0044] Specifically, the steps include the following:
[0045] Step S21: First, use bilinear interpolation. Operator, according to the formula , This represents a feature concatenation operation along the channel dimension, adjusting the features at levels 1 and 3. , This makes the features of levels 1 and 3... , With Level 2 features Spatial resolution The features are identical and concatenated along the channel dimension, fusing features from different levels to obtain the fused concatenated features. ,and This indicates a multi-level stitched feature obtained by cascading and stacking the aligned three-layer features along the channel dimension. This represents the total number of channels in the concatenated feature vector. This step achieves spatial alignment, mapping, and fusion of features with different resolutions and receptive fields.
[0046] It should be noted that the second-level features are used as the benchmark because the second-level features are at an intermediate scale. They retain more spatial details than the third-level features and have stronger semantic information than the first-level features, making them the best balance point for feature fusion.
[0047] Step S22: Flatten the 3D stitching matrix using matrix flattening operation. Flattening yields a two-dimensional feature matrix The correlation matrix is obtained by matrix multiplication. ,in, This represents the degree of correlation or similarity between any two spatial feature vectors in an image. Essentially, this calculation computes the dot product of two vectors; a larger result indicates a smaller angle between them in high-dimensional space, meaning their directions are closer, and thus, a higher correlation or similarity. Restored to its original spatial shape ,in, Represents the matrix flattening operation. The correlation matrix representing the restored spatial shape is then combined with the splicing features. By concatenating along the channel dimension, a fusion feature with enhanced global correlation is obtained. ,in This step enhances the ability to discriminate abnormal information in complex backgrounds. Convolution operations are limited by the local receptive field and are difficult to capture long-distance dependencies. Through the above correlation matrix, a direct connection between any two locations in the image can be established, thereby enabling the identification of anomalies through local and global information.
[0048] Step S3: Add Gaussian noise of variable intensity to the globally correlated fusion features to perform data augmentation and amplification, obtaining the globally correlated fusion features after data augmentation and amplification. ;
[0049] Specifically, a noise generation function is used to sample and generate noise with a mean of 0 and a variance of . Gaussian noise matrix Fusion features with enhanced global relevance Addition for data augmentation and amplification is represented as follows: ,in, This represents a fusion feature of data augmentation and the resulting global correlation enhancement.
[0050] Step S4: Construct a feature processing network to compress and restore the fusion features obtained from data augmentation and amplification, resulting in restored fusion features. The feature processing network includes a feature compressor and a feature restorer.
[0051] Specifically, the feature processing network includes a cascaded feature compressor and a feature restorer. First, feature dimensionality reduction is performed using a convolutional neural network. Then, global information perception and aggregation are performed in the low-dimensional latent space using Transformer layers. Finally, feature dimensionality restoration is performed using a convolutional neural network. In this embodiment, the feature compressor consists of a cascaded convolutional feature compression module and a standard Transformer module. Each convolutional feature compression module consists of a convolutional layer, a batch normalization layer, and a non-linear activation layer. The convolutional kernel size is [missing information]. Each convolutional feature compression module has an output channel dimension that is half that of its input, while the standard Transformer module maintains the same output channel dimension as its input. The feature restorer consists of cascaded convolutional feature restore modules, each comprising a convolutional layer, a batch normalization layer, and a nonlinear activation layer, with a convolutional kernel size of [missing value]. The output channel dimension of each convolutional feature recovery module is twice the input feature channel dimension;
[0052] Step S5: Construct a feature recovery loss function and train the feature processing network constructed in step S4 to obtain the trained network, which is able to reconstruct the feature distribution of normal samples.
[0053] Specifically, the feature recovery loss function ,in, , Let these represent the cosine similarity loss function and the mean squared error loss function, respectively. , ,in, Represents the cosine similarity function. Represents the mean square error function;
[0054] When training the feature processing network in step S4, data preparation is first performed, using only normal railway external environment images as samples during the training phase. In the forward propagation phase, the normal samples are processed through steps S1 to S3 to obtain fusion features with enhanced global relevance after data augmentation and amplification. These fusion features are then input into the feature processing network, which consists of a feature compressor and a feature restorer. Finally, the restored fusion features are calculated as output. Fusion features with data augmentation and augmentation followed by global relevance enhancement The loss between them; the feature processing network parameters in step S4 are continuously updated through the backpropagation algorithm, so that the model can perfectly reconstruct the feature distribution of normal samples;
[0055] Step S6: When using the trained feature processing network to detect abnormal parts in railway external environment images, the detection of abnormal parts in railway external environment images is achieved by judging whether the feature recovery error is higher than the threshold.
[0056] Specifically, when detecting abnormal parts in railway external environment images, the image to be detected is first processed through steps S1-S3, and then the processed result is input into the trained feature processing network to obtain the reconstructed and fused features after processing by the feature processing network. The feature recovery error is calculated, which is the degree of difference between the input features and the reconstructed fused features at each spatial location. Since the network has not seen abnormal samples during training, when an image with defects is input, the abnormal parts cannot be accurately reconstructed, resulting in the feature recovery error of the region being significantly higher than the threshold. This enables the accurate localization and detection of abnormal parts in railway external environment images.
[0057] It should be noted that when training the feature processing network using only normal samples, the reconstructed features show a high cosine similarity to the input features, indicating that the model can accurately reconstruct normal samples. In contrast, the reconstructed features of abnormal samples show a lower cosine similarity to the input features, resulting in a larger feature recovery error, which is used to detect defects.
[0058] As an example, in this embodiment, as shown in Figure 2(a), a cross-sectional image of a defective cable is displayed, where the upper wires of the cable exhibit abnormal arrangement or breakage. Using the method of this invention, the calculated anomaly score is significantly higher in the upper region of the cable. As shown in Figure 2(b), the red area precisely covers the defect location, indicating a large reconstruction error in that area; the blue area represents the normal background. Experimental data demonstrates that even against a complex background with highly repetitive textures, such as that of a cable, this invention effectively suppresses background interference using global correlation enhancement features, achieving high-precision defect detection.
[0059] Example 2
[0060] This embodiment provides a railway external environment anomaly detection system based on global feature correlation, including:
[0061] The railway external environment image processing module is used to process railway external environment images. The processing methods include:
[0062] Obtain multi-level features of an image;
[0063] The acquired multi-level features are adjusted to the same resolution and concatenated along the channel dimension to obtain concatenated features that fuse multi-level information. The correlation matrix between the feature vector at each position of the concatenated features and the feature vectors at all positions is calculated to obtain the global correlation matrix. The global correlation matrix is then fused with the multi-level concatenated features to obtain a fused feature with enhanced global correlation.
[0064] Data augmentation and amplification are performed on the fusion features with enhanced global correlation to obtain the fusion features with enhanced global correlation after data augmentation and amplification. ;
[0065] The feature processing network construction and training module is used to construct the feature processing network, train the feature processing network through the feature recovery loss function, and obtain the trained network, so that the trained network can reconstruct the feature distribution of the normal image.
[0066] The railway external environment image anomaly detection module is used to detect anomalies in railway external environment images using a trained feature processing network. It inputs the processed railway external environment image into the trained feature processing network, compresses and restores the fusion features obtained from data augmentation and global correlation enhancement, and obtains the restored fusion features. The detection of abnormal parts in railway external environment images is achieved by judging whether the feature recovery error is higher than the threshold.
[0067] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the railway external environment anomaly detection method based on global feature correlation as described above.
[0068] Furthermore, the present invention adopts the following technical solution:
[0069] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the above-described method for detecting anomalies in the railway external environment based on global feature correlation.
[0070] From the above description of the embodiments, those skilled in the art will clearly understand that the facilities of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Embodiments of the present invention can be implemented using existing processors, or by dedicated processors used for this or other purposes for suitable systems, or by hardwired systems. Embodiments of the present invention also include non-transitory computer-readable storage media, comprising machine-readable media for carrying or having machine-executable instructions or data structures stored thereon; such machine-readable media can be any available medium accessible by a general-purpose or special-purpose computer or other machine with a processor. For example, such machine-readable media can include RAM, ROM, EPROM, EEPROM, CD-ROM or other optical disc storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store the required program code in the form of machine-executable instructions or data structures and is accessible by a general-purpose or special-purpose computer or other machine with a processor. When information is transmitted or provided to a machine via a network or other communication connection (hardwired, wireless, or a combination of hardwired and wireless), that connection is also considered a machine-readable medium.
[0071] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. A method for detecting anomalies in the external environment of railways based on global feature correlation, characterized in that, The method includes the following steps: The processing methods for images of the railway's external environment include: Obtain multi-level features of an image; The acquired multi-level features are adjusted to the same resolution and concatenated along the channel dimension to obtain concatenated features that fuse multi-level information. The correlation matrix between the feature vector at each position of the concatenated features and the feature vectors at all positions is calculated to obtain the global correlation matrix. The global correlation matrix is then fused with the multi-level concatenated features to obtain a fused feature with enhanced global correlation. Data augmentation and amplification are performed on the globally correlated fusion features to obtain the globally correlated fusion features after data augmentation and amplification. ; A feature processing network is constructed, and the feature processing network is trained using the feature recovery loss function to obtain the trained network, which is able to reconstruct the feature distribution of a normal image. When using a trained feature processing network to detect abnormal areas in railway external environment images, the processed railway external environment image is input into the trained feature processing network. The network then compresses and restores the fusion features obtained from data augmentation and global correlation enhancement to obtain the restored fusion features. The detection of abnormal parts in railway external environment images is achieved by judging whether the feature recovery error is higher than a threshold; The acquired multi-level features are adjusted to the same resolution and concatenated along the channel dimension to obtain a concatenated feature that integrates multi-level information. The correlation matrix between the feature vector at each position of the concatenated feature and the feature vectors at all positions is calculated to obtain a global correlation matrix. This global correlation matrix is then fused with the multi-level concatenated feature to obtain a globally correlated enhanced fused feature. Using bilinear interpolation Operators and feature splicing The operation involves adjusting multi-level features to the same resolution and concatenating them along the channel dimension. Features from different levels are then fused to obtain the fused, concatenated features. ; The 3D stitched matrix is flattened using matrix flattening operations. Flattening yields a two-dimensional feature matrix The correlation matrix is obtained by matrix multiplication. ;Will Restored to its original spatial shape ,in, The matrix flattening operation represents the correlation matrix and splicing features that restore the original spatial shape. By concatenating along the channel dimension, a fusion feature with enhanced global correlation is obtained. , This represents the concatenation operation of features along the channel dimension.
2. The railway external environment anomaly detection method based on global feature correlation according to claim 1, characterized in that, The feature processing network includes a cascaded feature compressor and feature restorer. It reduces the feature dimension through a convolutional neural network, performs global information perception and aggregation in the low-dimensional latent space through a Transformer layer, and finally restores the feature dimension through a convolutional neural network.
3. The railway external environment anomaly detection method based on global feature correlation according to claim 2, characterized in that, When training the feature processing network, normal railway external environment images are used as samples. During the forward propagation stage, the samples are processed to obtain fused features of data augmentation and global correlation enhancement after augmentation. These fused features are then input into the feature processing network to calculate the recovered fused features. Fusion features with data augmentation and augmentation followed by global relevance enhancement The loss between samples is reduced; the feature processing network parameters are continuously updated through the backpropagation algorithm, enabling the feature processing network to reconstruct the feature distribution of normal samples.
4. The railway external environment anomaly detection method based on global feature correlation according to claim 1, characterized in that, Feature recovery loss function ,in, , Let these represent the cosine similarity loss function and the mean squared error loss function, respectively. , ,in, Represents the cosine similarity function. This represents the mean square error function.
5. The railway external environment anomaly detection method based on global feature correlation according to claim 1, characterized in that, The method for obtaining multi-level features of an image is as follows: The image is preprocessed by size normalization, and then directly input into the WideResNet50 neural network pre-trained on the ImageNet dataset, according to the formula... Get Image The first, second, and third level features, where f represents the feature extraction network. , , These are the features obtained at levels 1, 2, and 3, respectively. , , h1, h2, and h3 represent the heights of the first, second, and third level feature matrices, respectively; w1, w2, and w3 represent the widths of the first, second, and third level feature matrices, respectively; and d1, d2, and d3 represent the number of channels of the first, second, and third level feature matrices, respectively.
6. The railway external environment anomaly detection method based on global feature correlation according to claim 1, characterized in that, Data augmentation and amplification are performed on the globally correlated fusion features to obtain the globally correlated fusion features after data augmentation and amplification. The method is as follows: The noise generation function samples samples with a mean of 0 and a variance of . Gaussian noise matrix Fusion features with enhanced global relevance Addition for data augmentation and amplification is represented as follows: ,in, This represents a fusion feature of data augmentation and the resulting global relevance enhancement.
7. A railway external environment anomaly detection system based on global feature correlation, used to implement the method described in any one of claims 1-6, characterized in that, include: The railway external environment image processing module is used to process railway external environment images. The processing methods include: Obtain multi-level features of an image; The acquired multi-level features are adjusted to the same resolution and concatenated along the channel dimension to obtain concatenated features that fuse multi-level information. The correlation matrix between the feature vector at each position of the concatenated features and the feature vectors at all positions is calculated to obtain the global correlation matrix. The global correlation matrix is then fused with the multi-level concatenated features to obtain a fused feature with enhanced global correlation. Data augmentation and amplification are performed on the globally correlated fusion features to obtain the globally correlated fusion features after data augmentation and amplification. ; The feature processing network construction and training module is used to construct the feature processing network, train the feature processing network through the feature recovery loss function, and obtain the trained network, so that the trained network can reconstruct the feature distribution of the normal image. The railway external environment image anomaly detection module is used to detect anomalies in railway external environment images using a trained feature processing network. It inputs the processed railway external environment image into the trained feature processing network, compresses and restores the fusion features obtained from data augmentation and global correlation enhancement, and obtains the restored fusion features. The detection of abnormal parts in railway external environment images is achieved by judging whether the feature recovery error is higher than the threshold.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the railway external environment anomaly detection method based on global feature correlation as described in any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the railway external environment anomaly detection method based on global feature correlation as described in any one of claims 1 to 6.