Unsupervised track anomaly detection method and system

Through unsupervised deep learning methods, utilizing the area segmentation of key track components and the self-generated feature aggregation network, combined with the multivariate Gaussian fitting function and the anomaly score measurement function, high-precision detection of unknown foreign objects on the track is achieved, solving the problems of limited detection content and low accuracy in existing technologies and reducing labor costs.

CN120047726BActive Publication Date: 2025-09-30BEIJING JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510048442.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-09-30
Estimated Expiration
2045-01-13

AI Technical Summary

Technical Problem

Existing technologies for track anomaly detection have limited detection content, low detection accuracy, and reliance on manual inspections. They are unable to effectively detect track anomalies of unknown categories, and their robustness is particularly low in complex and changing scenarios.

Method used

An unsupervised track anomaly detection method is adopted. By acquiring track images, a pre-trained detection model is used for processing, including key component area segmentation, feature aggregation network and multivariate Gaussian fitting function, combined with an internal and external balanced anomaly score measurement function, to achieve abnormal image discrimination and positioning.

Benefits of technology

It improves the accuracy of track anomaly detection, reduces labor costs, and can accurately detect and locate unknown types of track foreign objects without the need for manual data labeling, thus supplementing the content of track inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047726B_ABST
    Figure CN120047726B_ABST
Patent Text Reader

Abstract

The present invention provides an unsupervised track anomaly detection method and system, which belongs to the field of track supervision technology based on computer vision, including: collecting track images from a bird's-eye view; using a track key component area segmentation module to achieve pixel-level segmentation and background simplification to generate a pseudo image of the key component; using a self-generated feature aggregation network to extract multi-scale features in the pseudo image to obtain a high-dimensional feature vector matrix; using a multivariate Gaussian fitting function to fit the high-dimensional feature vector matrix to obtain the optimal parameters of a normal image; designing an anomaly score measurement function with internal and external balance, calculating the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image, and calculating the anomaly score to achieve abnormal image discrimination and abnormal pixel location. The present invention solves the problem of incomplete coverage of track inspection content caused by limited annotated data categories, and realizes the detection of foreign objects of unknown categories on the track under the interference of complex background factors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of track supervision technology based on computer vision, and in particular to an unsupervised track anomaly detection method and system. Background Art

[0002] Tracks are an integral component of rail transit line equipment, guiding and carrying trains and crucial to train safety. Semi-open tracks are subject to constant natural erosion and loads, making key track components susceptible to various types of anomalies. Furthermore, tracks exposed to the open air often harbor static foreign objects of varying sizes and shapes, often located randomly. These anomalies, with their random occurrence probability, unstable location, and unknown type, pose a potential threat to the stable operation of trains. With the continuous expansion of rail transit operations, the accumulation of operating years, and rising labor costs, the limitations of traditional manual inspection methods for detecting these anomalies are becoming increasingly apparent. These methods are not only time-consuming and labor-intensive, but also suffer from poor detection accuracy. Therefore, in response to the demand for more comprehensive, more accurate, and more intelligent track inspections, research on intelligent and accurate unknown track anomaly detection is essential.

[0003] Current supervised anomaly detection methods based on video imagery focus on detecting abnormal defects in key rail components of known categories. While effective in field applications, they are significantly limited in scope due to the constraints imposed by training labels on the categories that can be detected. Traditional unsupervised machine vision processing methods primarily rely on the fixed and regular positions of key rail components. However, this reliance results in relatively low robustness when faced with the complex and ever-changing scenarios encountered in real-world applications. Furthermore, these methods vary widely, requiring flexible selection and combination to meet the needs of diverse image scenarios, which undoubtedly increases the difficulty of practical application. Summary of the Invention

[0004] The purpose of the present invention is to provide an unsupervised track anomaly detection method and system to solve at least one technical problem existing in the above background technology.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] In a first aspect, the present invention provides an unsupervised track anomaly detection method, comprising:

[0007] Acquire a track image from a bird's-eye view to be detected;

[0008] A pre-trained detection model is used to process the acquired track image from a bird's-eye view to obtain a detection result; wherein the pre-trained detection model includes a key component region segmentation unit, a feature aggregation network, a fitting network and a calculation unit; the key component region segmentation unit is used to perform pixel-level segmentation and background simplification on the track image to generate pseudo images of three key components: rails, sleepers and track plates; the feature aggregation network is used to extract and aggregate multi-scale features in the pseudo image to obtain a high-dimensional feature vector matrix; the fitting unit is used to fit the high-dimensional feature vector matrix using a multivariate Gaussian fitting function to obtain the optimal parameters of a normal image; the calculation unit is used to use an internally and externally balanced anomaly score measurement function to calculate the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image, calculate the anomaly score, and realize abnormal image discrimination and abnormal pixel positioning.

[0009] As a further limitation of the first aspect of the present invention, the training unit for regional segmentation of key track components includes: constructing a key track component segmentation dataset, specifically including three categories: rails, sleepers, and track plates; using a semantic segmentation algorithm, using the dataset for training, to achieve pixel segmentation of the three key track components, and obtaining a mask of the track image and a color palette corresponding to each of the three key components. component , component is the key component of the track; the mask pixel matching formula is used to obtain the pseudo images of rails, sleepers and track plates respectively.

[0010] As a further limitation of the first aspect of the present invention, the detection model is trained using a ResNet18 network as a backbone network; the feature maps of the first layer Layer1, the second layer Layer2, and the third layer Layer3 of the backbone network are selected as basic feature maps; the resolutions of the three feature maps are unified using a deconvolution upsampling method, and a splicing operation is performed to obtain a preliminary vector matrix Block1; based on a weighted self-generated feature mechanism, the fourth layer feature map Layer4 is generated using the above-mentioned Layer1, Layer2, and Layer3 feature maps, and a splicing operation is performed with the preliminary vector matrix Block1 to obtain a high-dimensional feature vector matrix Block2; the first 500 layers of the channel of Block2 are selected as the final feature vector matrix Block3.

[0011] As a further limitation of the first aspect of the present invention, the weighted self-generated feature mechanism includes: selecting the first 64 layers of the upsampled Layer2 and Layer3 feature map channels and assigning a weight of 0.4, and adding it to the selected Layer1 feature map with a weight of 0.2 to obtain the fourth layer feature map Layer4.

[0012] As a further limitation of the first aspect of the present invention, the multivariate Gaussian fitting function includes: taking n normal training images as a group, and dividing the input image into a pixel block grid, and the high-dimensional feature vector matrix of the normal pixel block at (i, j) x ij is the eigenvector value of the normal image (i, j); using the multivariate Gaussian distribution N(μ ij ,Σ ij ) for high-dimensional eigenvector matrices Perform fitting to obtain the optimal parameter μ ij and Σ ij .

[0013] As a further limitation of the first aspect of the present invention, the internal and external balanced anomaly score measurement function includes: designing an external square root measurement function D1 to calculate the difference score between the test image and the optimal parameter, where x ij ' is the eigenvector value of the test image (i, j);

[0014]

[0015] Use the internal Mahalanobis distance metric function D2 to calculate the difference score inside the test image;

[0016]

[0017] The internal and external balanced anomaly score measurement function D is the sum of the two weighted anomaly scores, and the final anomaly score is obtained: D = 0.8 × D1 + 0.2 × D2.

[0018] In a second aspect, the present invention provides an unsupervised track anomaly detection system, comprising:

[0019] An acquisition module, used to acquire a track image to be detected from a bird's-eye view;

[0020] The detection module is used to process the acquired bird's-eye view track image to be detected using a pre-trained detection model to obtain a detection result; wherein the pre-trained detection model includes a key component region segmentation unit, a feature aggregation network, a fitting network and a calculation unit; the key component region segmentation unit is used to perform pixel-level segmentation and background simplification of the track image to generate pseudo images of three key components: rails, sleepers and track plates; the feature aggregation network is used to extract and aggregate multi-scale features in the pseudo image to obtain a high-dimensional feature vector matrix; the fitting unit is used to fit the high-dimensional feature vector matrix using a multivariate Gaussian fitting function to obtain the optimal parameters of the normal image; the calculation unit is used to use an internal and external balanced anomaly score measurement function to calculate the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image, calculate the anomaly score, and realize abnormal image discrimination and abnormal pixel positioning.

[0021] In a third aspect, the present invention provides a non-transitory computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the unsupervised track anomaly detection method as described in the first aspect is implemented.

[0022] In a fourth aspect, the present invention provides a computer device comprising a memory and a processor, wherein the processor and the memory communicate with each other, the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the unsupervised track anomaly detection method as described in the first aspect.

[0023] In a fifth aspect, the present invention provides an electronic device comprising: a processor, a memory, and a computer program; wherein the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory so that the electronic device executes instructions for implementing the unsupervised track anomaly detection method as described in the first aspect.

[0024] The beneficial effects of the present invention are as follows: utilizing the unique spatial position distribution law of the track scene, before the entire track image is detected for anomalies, the track key component area segmentation module is used to reduce the interference of complex background factors on the detection of unknown foreign objects, thereby preparing for subsequent anomaly detection; using an unsupervised deep learning method, a self-generated feature aggregation network is constructed, a high-dimensional feature vector matrix with semantic information and local information is extracted and aggregated, the optimal parameter fitting is achieved through a multivariate Gaussian fitting function, and then the track abnormal image discrimination and abnormal pixel positioning are accurately achieved using an internally and externally balanced anomaly score measurement function; the detection accuracy is high, and no manual annotation data is required for training. Only normal track data is used to achieve accurate detection and positioning of unknown categories of foreign objects on the track, which well supplements the track inspection content, greatly reduces labor costs, and solves the problem of low anomaly detection accuracy caused by the small number of track abnormality samples.

[0025] Additional advantages of the present invention will be more clearly given in the following description or learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1Flowchart of the unsupervised track anomaly detection method according to an embodiment of the present invention

[0028] Figure 2 This is a diagram showing the effect of the unsupervised track anomaly detection method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and are not to be construed as limiting the present invention.

[0030] Those skilled in the art will understand that unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which this invention belongs.

[0031] It should also be understood that terms, such as those defined in commonly used dictionaries, should be understood to have a meaning consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless as defined herein.

[0032] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a," "an," "said," and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or groups thereof.

[0033] In the description of this specification, reference to the terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Those skilled in the art may combine and integrate different embodiments or examples described in this specification, as well as features of different embodiments or examples, unless otherwise contradictory.

[0034] To facilitate understanding of the present invention, the present invention is further explained below with reference to specific embodiments in conjunction with the accompanying drawings. However, the specific embodiments do not constitute a limitation on the embodiments of the present invention.

[0035] Those skilled in the art should understand that the drawings are merely schematic diagrams of embodiments, and the components in the drawings are not necessarily necessary for implementing the present invention.

[0036] This paper provides an unsupervised track anomaly detection method that uses an onboard camera to capture track images from a bird's-eye view. A key component region segmentation module simplifies the background of the track image to generate pseudo images of key components. A self-generated feature aggregation network and a multivariate Gaussian fitting function are then used to parameterize features, obtaining the optimal parameters for the normal image and a high-dimensional feature vector matrix for the test image. Finally, a balanced internal and external anomaly score metric is used to achieve high-precision detection of unknown foreign objects on the track.

[0037] Example 1

[0038] In this embodiment 1, an unsupervised track anomaly detection system is first provided, including: an acquisition module for acquiring a track image to be detected from a bird's-eye view; a detection module for processing the acquired track image from a bird's-eye view to be detected using a pre-trained detection model to obtain a detection result; wherein the pre-trained detection model includes a key component region segmentation unit, a feature aggregation network, a fitting network and a calculation unit; the key component region segmentation unit is used to perform pixel-level segmentation and background simplification on the track image to generate pseudo images of three key components: rails, sleepers and track plates; the feature aggregation network is used to extract and aggregate multi-scale features in the pseudo image to obtain a high-dimensional feature vector matrix; the fitting unit is used to fit the high-dimensional feature vector matrix using a multivariate Gaussian fitting function to obtain optimal parameters of a normal image; the calculation unit is used to use an internally and externally balanced anomaly score measurement function to calculate the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image, calculate the anomaly score, and realize abnormal image discrimination and abnormal pixel positioning.

[0039] In this embodiment, the above-mentioned system is used to implement an unsupervised track anomaly detection method, including: using an acquisition module to acquire a track image from a bird's-eye view to be detected; for example, using a drone-mounted track image acquisition device to acquire a track image from a bird's-eye view. Using a detection module to process the acquired track image from a bird's-eye view to be detected using a pre-trained detection model to obtain a detection result; wherein the pre-trained detection model includes a key component region segmentation unit, a feature aggregation network, a fitting network, and a calculation unit; the key component region segmentation unit is used to perform pixel-level segmentation and background simplification of the track image to generate pseudo images of three key components: rails, sleepers, and track plates; the feature aggregation network is used to extract and aggregate multi-scale features in the pseudo image to obtain a high-dimensional feature vector matrix; the fitting unit is used to fit the high-dimensional feature vector matrix using a multivariate Gaussian fitting function to obtain the optimal parameters of the normal image; the calculation unit is used to use an internally and externally balanced anomaly score measurement function to calculate the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image, calculate the anomaly score, and achieve abnormal image discrimination and abnormal pixel location.

[0040] In this embodiment, training the detection model specifically includes the following steps:

[0041] The mounted track image acquisition device acquires track images from a bird's-eye view;

[0042] A track key component region segmentation module (key component region segmentation unit) is used to achieve pixel-level segmentation and background simplification, generating pseudo images of three key components: rails, sleepers, and track plates. A self-generated feature aggregation network is used to extract and aggregate multi-scale features in the pseudo images to obtain a high-dimensional feature vector matrix. A fitting unit fits the high-dimensional feature vector matrix using a multivariate Gaussian fitting function to obtain the optimal parameters of the normal image. A balanced anomaly score measurement function is designed to calculate the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image, and the anomaly score is calculated to achieve abnormal image discrimination and abnormal pixel location.

[0043] Track key component area segmentation module, including:

[0044] Construct a segmentation dataset of key track components, including rails, sleepers, and track plates;

[0045] A semantic segmentation algorithm is used to achieve pixel segmentation of the three key track components, obtaining the track image mask and the color palette corresponding to the three key components. component , component is the key component of the track, rail is the rail, sleeper is the sleeper, and railplate is the track plate;

[0046]

[0047] Using the mask pixel matching formula, the pseudo images of rails, sleepers and track plates are obtained respectively. Where Image(i,j) is the pixel value of the track image at (i,j), Image component (i, j) is the pixel value of the key component pseudo image at (i, j).

[0048]

[0049] Self-generated feature aggregation network, including:

[0050] ResNet18 network is used as the backbone network;

[0051] The feature maps of the first layer Layer1, the second layer Layer2, and the third layer Layer3 of the backbone network are selected as basic feature maps, with feature map resolutions of 32×32, 16×16, and 8×8 respectively;

[0052] Use deconvolution upsampling to unify the resolution of the three feature maps to 32×32 and perform concatenation to obtain the preliminary vector matrix Block1, where TC is the deconvolution operation and torch.cat is the concatenation operation;

[0053] Block1=torch.cat[Layer1,TC(Layer2),TC(Layer3)]

[0054] Design a weighted self-generated feature mechanism, use the above-mentioned Layer1, Layer2 and Layer3 feature maps to generate the fourth layer feature map Layer4, and perform a splicing operation with the preliminary vector matrix Block1 to obtain the high-dimensional feature vector matrix Block2;

[0055] Block2=torch.cat(Block1,Layer4)

[0056] To reduce the amount of calculation, the first 500 layers of the channel of Block2 are selected as the final eigenvector matrix Block3.

[0057] The self-generated feature mechanism of empowerment includes:

[0058] Select the first 64 layers of the upsampled Layer2 and Layer3 feature map channels and assign a weight of 0.4;

[0059] Select the Layer1 feature map and assign it a weight of 0.2, and add it to the above two items to obtain the fourth layer feature map Layer4.

[0060] Layer4=0.2×Layer1+0.4×TC(Layer2)(64)+0.4×TC(Layer3)(64)

[0061] Multivariate Gaussian fitting functions, including:

[0062] Take n normal training images as a group and divide the input image into a pixel block grid. The high-dimensional feature vector matrix of the normal pixel block at (i, j) is xij is the eigenvector value at (i, j) of the normal image;

[0063] Using the multivariate Gaussian distribution N(μ ij ,Σ ij ) for high-dimensional eigenvector matrices Perform fitting to obtain the optimal parameter μ ij and Σ ij .

[0064] The anomaly score measurement function of internal and external balance includes:

[0065] Design an external square root metric function D1 to calculate the difference score between the test image and the optimal parameter, where x ij ' is the eigenvector value of the test image (i, j);

[0066]

[0067] Use the internal Mahalanobis distance metric function D2 to calculate the difference score inside the test image;

[0068]

[0069] The internal and external balanced anomaly score measurement function D is the sum of the two weighted anomaly scores to obtain the final anomaly score.

[0070] D=0.8×D1+0.2×D2

[0071] Example 2

[0072] This second embodiment provides an unsupervised track anomaly detection method. An onboard camera is used to capture track images from a bird's-eye view. A key component region segmentation module simplifies the background of the track image to generate a pseudo image of the key components. A self-generated feature aggregation network and a multivariate Gaussian fitting function are then used to parameterize the features. The optimal parameters for the normal image and a high-dimensional feature vector matrix for the test image are obtained. Finally, a balanced internal and external anomaly score metric is used to achieve high-precision detection of unknown foreign objects on the track.

[0073] like Figure 1As shown in FIG, the unsupervised track anomaly detection method includes the following steps:

[0074] Step 1: The mounted track image acquisition device acquires track images from a bird's-eye view. The images basically include key components such as rails, sleepers, and track plates.

[0075] Step 2: Use the track key component region segmentation module to perform pixel-level segmentation and background simplification, generating pseudo images of the three key components: rails, sleepers, and track plates. Each pseudo image contains only one key component, and the background pixel values ​​are all 0.

[0076] The step 2 specifically includes the following steps:

[0077] Step 2.1: Construct a segmentation dataset of key track components. The specific categories include rails, sleepers, and track plates. Use Labelme software for pixel-level annotation.

[0078] Step 2.2: Use a semantic segmentation algorithm to train and validate the track key component segmentation dataset to achieve pixel segmentation of the three track key components, obtain the track image mask and the color palette corresponding to the three key components. component , component is the key component of the track, rail is the rail, sleeper is the sleeper, and railplate is the track plate;

[0079]

[0080] Step 2.3, using the mask pixel matching formula, with the foreground as a single key component and the background pixel value as 0, obtain the pseudo images of rail, sleeper and track plate respectively. Where Image(i,j) is the pixel value of the track image at (i,j), Image component (i, j) is the pixel value of the key component pseudo image at (i, j);

[0081]

[0082] Step 3: Use a self-generated feature aggregation network to extract and aggregate multi-scale features in the pseudo image and parameterize them to obtain a high-dimensional feature vector matrix;

[0083] The step 3 specifically includes the following steps:

[0084] Step 3.1: Use the ResNet18 network pre-trained on the ImageNet dataset as the backbone network.

[0085] Step 3.2: Select the backbone network’s first layer Layer1, second layer Layer2, and third layer Layer3 feature maps as basic feature maps. The feature map resolutions are 32×32, 16×16, and 8×8, and the number of channels are 64, 128, and 256, respectively.

[0086] In step 3.3, the resolution of the three feature maps is unified to 32×32 using the deconvolution upsampling method, and the concatenation operation is performed to obtain the preliminary vector matrix Block1, where TC is the deconvolution operation and torch.cat is the concatenation operation.

[0087] Block1=torch.cat[Layer1,TC(Layer2),TC(Layer3)]

[0088] Step 3.4: Design a weighted self-generated feature mechanism, select the first 64 layers of the upsampled Layer2 and Layer3 feature map channels, and assign a weight of 0.4;

[0089] Step 3.5: Select the Layer1 feature map and assign it a weight of 0.2. Add it to the above two items to obtain the fourth layer feature map Layer4.

[0090] Layer4=0.2×Layer1+0.4×TC(Layer2)(64)+0.4×TC(Layer3)(64)

[0091] Step 3.6, the fourth layer feature map Layer4 is concatenated with the preliminary vector matrix Block1 to obtain the high-dimensional feature vector matrix Block2;

[0092] Block2=torch.cat(Block1,Layer4)

[0093] Step 3.7, to reduce the amount of calculation, select the first 500 layers of the channel of Block2 as the final eigenvector matrix Block3;

[0094] Step 4: Use the multivariate Gaussian fitting function to fit the high-dimensional eigenvector matrix to obtain the optimal parameters of the normal image;

[0095] The step 4 specifically includes the following steps:

[0096] Step 4.1: Take n normal training images as a group and divide the input image into a pixel block grid. The high-dimensional feature vector matrix of the normal pixel block at (i, j) is x ij is the eigenvector value of the normal image (i, j);

[0097] Step 4.2, using the multivariate Gaussian distribution N(μ ij ,Σ ij ) for high-dimensional eigenvector matrices Perform fitting to obtain the optimal parameter μ ij and Σ ij ;

[0098]

[0099] Step 5: Design an anomaly score measurement function that is internally and externally balanced, calculate the difference between the optimal parameters of the normal image and the high-dimensional eigenvector matrix of the test image, and calculate the anomaly score to achieve abnormal image discrimination and abnormal pixel location;

[0100] The step 5 specifically includes the following steps:

[0101] Step 5.1, design the external square root metric function D1, focus on the absolute difference between the test image and the optimal parameter, and calculate the difference score between the test image and the optimal parameter, where x ij ' is the eigenvector value of the test image (i, j);

[0102]

[0103] Step 5.2, use the internal Mahalanobis distance metric function D2, focus on the correlation between the internal test images, and calculate the difference score of the pixel distribution within the test image;

[0104]

[0105] In step 5.3, the internal and external balanced anomaly score measurement function D is calculated by summing the two weighted anomaly scores to obtain the final anomaly score, which serves as the basis for the final abnormal image discrimination and abnormal pixel location.

[0106] D=0.8×D1+0.2×D2

[0107] Example 3

[0108] This embodiment 3 provides an unsupervised track anomaly detection method, including the following steps:

[0109] Step 1: The mounted track image acquisition device acquires track images from a bird's-eye view. The images basically include key components such as rails, sleepers, and track plates.

[0110] Step 2: Use the track key component region segmentation module to perform pixel-level segmentation and background simplification, generating pseudo images of the three key components: rails, sleepers, and track plates. Each pseudo image contains only one key component, and the background pixel values ​​are all 0.

[0111] The step 2 specifically includes the following steps:

[0112] Step 2.1: Construct a segmentation dataset of key track components. The specific categories include rails, sleepers, and track plates. Use Labelme software for pixel-level annotation.

[0113] Step 2.2: Use a semantic segmentation algorithm to train and validate the track key component segmentation dataset to obtain the optimal weights, achieve pixel segmentation of the three track key components, and obtain the track image mask and the color palette corresponding to the three key components. component , component is the key component of the track, rail is the rail, sleeper is the sleeper, and railplate is the track plate;

[0114]

[0115] Step 2.3, using the mask pixel matching formula, with the foreground as a single key component and the background pixel value as 0, obtain the pseudo images of rail, sleeper and track plate respectively. Where Image(i,j) is the pixel value of the track image at (i,j), Image component (i, j) is the pixel value of the key component pseudo image at (i, j);

[0116]

[0117] Step 3: Use a self-generated feature aggregation network to extract and aggregate multi-scale features in the pseudo image and parameterize them to obtain a high-dimensional feature vector matrix;

[0118] The step 3 specifically includes the following steps:

[0119] In step 3.1, the ResNet18 network pre-trained on the ImageNet dataset is used as the backbone network. The network consists of five stages. Stage 0 is a convolutional layer and a pooling layer. Stages 1 to 4 are residual blocks with different numbers of channels.

[0120] Step 3.2: Select the backbone network’s first layer Layer1, second layer Layer2, and third layer Layer3 feature maps as basic feature maps. The feature map resolutions are 32×32, 16×16, and 8×8, and the number of channels are 64, 128, and 256, respectively.

[0121] In step 3.3, deconvolution upsampling is used to unify the resolution of the three feature maps to 32×32. For Layer2, a 17×17 convolution kernel with a step size of 1 is used, and for Layer3, an 18×18 convolution kernel with a step size of 2 is used. Layer2' and Layer3' are generated respectively, and concatenated to obtain the preliminary vector matrix Block1. TC is the deconvolution operation and torch.cat is the concatenation operation.

[0122] Layer2′=TC(Layer2,k=[17,17],s=[1,1],p=[0,0])

[0123] Layer3′=TC(Layer3,k=[18,18],s=[2,2],p=[0,0])

[0124] Block1=torch.cat[Layer1,Layer2′,Layer3′]

[0125] Step 3.4: Design a weighted self-generated feature mechanism, select the first 64 layers of the Layer2' and Layer3' feature map channels, and assign a weight of 0.4;

[0126] Step 3.5: Select the Layer1 feature map and assign it a weight of 0.2. Add it to the above two items to get the fourth layer feature map Layer4, which has 64 channels.

[0127] Layer4=0.2×Layer1+0.4×Layer2′(64)+0.4×Layer3′(64)

[0128] Step 3.6, the fourth layer feature map Layer4 is concatenated with the preliminary vector matrix Block1 to obtain the high-dimensional feature vector matrix Block2 with 512 channels.

[0129] Block2=torch.cat(Block1,Layer4)

[0130] Step 3.7, to reduce the amount of calculation, select the first 500 layers of the channel of Block2 as the final eigenvector matrix Block3;

[0131] Step 4: Use the multivariate Gaussian fitting function to fit the high-dimensional eigenvector matrix to obtain the optimal parameters of the normal image;

[0132] The step 4 specifically includes the following steps:

[0133] Step 4.1: Take n normal training images as a group and divide the input image into a pixel block grid. The high-dimensional feature vector matrix of the normal pixel block at (i, j) is x ij is the eigenvector value of the normal image (i, j);

[0134] Step 4.2, using the multivariate Gaussian distribution N(μ ij ,Σ ij ) for high-dimensional eigenvector matrices Perform fitting to obtain the optimal parameter μ ij and Σ ij , f z (x) is the probability density function of the multivariate Gaussian distribution, Z represents a random vector composed of n random variables, the mean vector of the random vector is μ, the covariance matrix of the random vector is ∑, and det is the determinant;

[0135]

[0136]

[0137] Step 5: Design an anomaly score measurement function that is internally and externally balanced, calculate the difference between the optimal parameters of the normal image and the high-dimensional eigenvector matrix of the test image, and calculate the anomaly score to achieve abnormal image discrimination and abnormal pixel location;

[0138] The step 5 specifically includes the following steps:

[0139] Step 5.1, design the external square root metric function D1, focus on the absolute difference between the test image and the optimal parameter, and calculate the difference score between the test image and the optimal parameter, where x ij ' is the eigenvector value of the test image (i, j);

[0140]

[0141] Step 5.2, use the internal Mahalanobis distance metric function D2, focus on the correlation between the internal test images, and calculate the difference score of the pixel distribution within the test image;

[0142]

[0143] In step 5.3, the internal and external balanced anomaly score measurement function D is calculated by summing the two weighted anomaly scores to obtain the final anomaly score, which serves as the basis for the final abnormal image discrimination and abnormal pixel location.

[0144] D=0.8×D1+0.2×D2

[0145] like Figure 2As shown in the figure, the unsupervised track anomaly detection algorithm proposed in this embodiment can achieve a detection accuracy of 97.82%. The innovation of this method is mainly reflected in the spatial distribution pattern of specific track scenarios. By constructing and using a track key component region segmentation module, self-generated feature aggregation, multivariate Gaussian distribution function, and internal and external balanced anomaly score measurement function, and utilizing a deep learning-based method, it reduces the interference of complex backgrounds on anomaly detection, significantly improves the accuracy of track anomaly detection, supplements the content of track unknown foreign object inspection, and provides strong technical support for track status inspection and maintenance.

[0146] Example 4

[0147] This embodiment 4 provides a non-transitory computer-readable storage medium, which is used to store computer instructions. When the computer instructions are executed by a processor, they implement the unsupervised track anomaly detection method as described above, comprising: obtaining a track image to be detected from a bird's-eye view; processing the obtained track image to be detected from a bird's-eye view using a pre-trained detection model to obtain a detection result; wherein the pre-trained detection model includes a key component region segmentation unit, a feature aggregation network, a fitting network, and a calculation unit; the key component region segmentation unit is used to perform pixel-level segmentation and background simplification on the track image to generate pseudo images of three key components: rails, sleepers, and track plates; the feature aggregation network is used to extract and aggregate multi-scale features in the pseudo images to obtain a high-dimensional feature vector matrix; the fitting unit is used to fit the high-dimensional feature vector matrix using a multivariate Gaussian fitting function to obtain optimal parameters of a normal image; and the calculation unit is used to calculate the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image using an internal and external balanced anomaly score measurement function, calculate the anomaly score, and achieve abnormal image discrimination and abnormal pixel location.

[0148] Example 5

[0149] This embodiment 5 provides a computer device, including a memory and a processor, wherein the processor and the memory communicate with each other, the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the unsupervised track anomaly detection method as described above, the method comprising: obtaining a track image from a bird's-eye view to be detected; processing the obtained track image from a bird's-eye view to be detected using a pre-trained detection model to obtain a detection result; wherein the pre-trained detection model comprises a key component region segmentation unit, a feature aggregation network, a fitting network, and a calculation unit; the key component region segmentation unit is used to perform pixel-level segmentation and background simplification on the track image to generate pseudo images of three key components: rails, sleepers, and track plates; the feature aggregation network is used to extract and aggregate multi-scale features in the pseudo images to obtain a high-dimensional feature vector matrix; the fitting unit is used to fit the high-dimensional feature vector matrix using a multivariate Gaussian fitting function to obtain optimal parameters of a normal image; and the calculation unit is used to calculate the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image using an internal and external balanced anomaly score measurement function, calculate the anomaly score, and achieve abnormal image discrimination and abnormal pixel location.

[0150] Example 6

[0151] Embodiment 6 provides an electronic device, comprising: a processor, a memory, and a computer program; wherein the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the unsupervised track anomaly detection method as described above, the method comprising: obtaining a track image from a bird's-eye view to be detected; processing the obtained track image from a bird's-eye view to be detected using a pre-trained detection model to obtain a detection result; wherein the pre-trained detection model comprises a key component region segmentation unit, a feature aggregation network, a fitting network, and a calculation unit; the key component region segmentation unit is configured to segment the track image at the pixel level and simplify the background to generate pseudo images of three key components: rails, sleepers, and track slabs; the feature aggregation network is configured to extract and aggregate multi-scale features in the pseudo images to obtain a high-dimensional feature vector matrix; the fitting unit is configured to fit the high-dimensional feature vector matrix using a multivariate Gaussian fitting function to obtain optimal parameters of a normal image; and the calculation unit is configured to calculate the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image using an internal and external balanced anomaly score measurement function, calculate the anomaly score, and implement abnormal image discrimination and abnormal pixel location.

[0152] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0153] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0154] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing device, and a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide the functions for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0156] Although the above describes the specific embodiments of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solutions disclosed in the present invention without the need for creative work should be included in the scope of protection of the present invention.

Claims

1. An unsupervised track anomaly detection method, characterized in that: include: Acquire a track image from a bird's-eye view to be detected; The obtained track image of the top view to be detected is processed using a pre-trained detection model to obtain a detection result; wherein the pre-trained detection model includes a key component area segmentation unit, a feature aggregation network, a fitting network and a calculation unit; the key component area segmentation unit is used to perform pixel-level segmentation and background simplification on the track image to generate pseudo images of three key components: rails, sleepers and track plates; the feature aggregation network is used to extract and aggregate multi-scale features in the pseudo image to obtain a high-dimensional feature vector matrix; the fitting network is used to fit the high-dimensional feature vector matrix using a multivariate Gaussian fitting function to obtain the optimal parameters of the normal image; the calculation unit is used to use an internal and external balanced anomaly score measurement function to calculate the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image, calculate the anomaly score, and realize abnormal image discrimination and abnormal pixel positioning; wherein the internal and external balanced anomaly score measurement function includes: designing an external square root measurement function D1 to calculate the difference score between the test image and the optimal parameter, where x ij ' is the eigenvector value of the test image (i, j); Use the internal Mahalanobis distance metric function D2 to calculate the difference score inside the test image; Among them, μ ij and Σ ij Indicates the use of multivariate Gaussian distribution N(μ ij ,Σ ij ) The optimal parameters are obtained by fitting the high-dimensional eigenvector matrix; the internal and external balanced anomaly score measurement function D is the sum of the two weighted anomaly scores, and the final anomaly score is obtained: D = 0.8 × D1 + 0.2 × D2.

2. The unsupervised track anomaly detection method according to claim 1, characterized in that: Training the regional segmentation unit for key track components includes: constructing a key track component segmentation dataset, specifically including three categories: rails, sleepers, and track plates; using a semantic segmentation algorithm and training on the dataset to achieve pixel segmentation of the three key track components, and obtaining the track image mask and the color palette corresponding to the three key components. component , component is the key component of the track; the mask pixel matching formula is used to obtain the pseudo images of rails, sleepers and track plates respectively.

3. The unsupervised track anomaly detection method according to claim 1, characterized in that: The detection model is trained using the ResNet18 network as the backbone network; the feature maps of the first layer Layer1, the second layer Layer2, and the third layer Layer3 of the backbone network are selected as basic feature maps; the resolutions of the three feature maps are unified using the deconvolution upsampling method, and a splicing operation is performed to obtain a preliminary vector matrix Block1; based on the weighted self-generated feature mechanism, the fourth layer feature map Layer4 is generated using the above-mentioned Layer1, Layer2, and Layer3 feature maps, and a splicing operation is performed with the preliminary vector matrix Block1 to obtain a high-dimensional feature vector matrix Block2; the first 500 layers of the channel of Block2 are selected as the final feature vector matrix Block3.

4. The unsupervised track anomaly detection method according to claim 3, characterized in that: The weighted self-generated feature mechanism includes: selecting the first 64 layers of the upsampled Layer2 and Layer3 feature map channels and assigning a weight of 0.4, adding it to the weight of 0.2 assigned to the Layer1 feature map to obtain the fourth layer feature map Layer4.

5. The unsupervised track anomaly detection method according to claim 1, characterized in that: Multivariate Gaussian fitting function, including: taking n normal training images as a group, and dividing the input image into a pixel block grid, the high-dimensional feature vector matrix of the normal pixel block at (i, j) x ij is the eigenvector value of the normal image (i, j); using the multivariate Gaussian distribution N(μ ij ,Σ ij ) for high-dimensional eigenvector matrices Perform fitting to obtain the optimal parameter μ ij and Σ ij .

6. An unsupervised track anomaly detection system, characterized in that: include: An acquisition module, used to acquire a track image from a bird's-eye view to be detected; The detection module is used to process the acquired track image from a bird's-eye view to be detected using a pre-trained detection model to obtain a detection result; wherein the pre-trained detection model includes a key component area segmentation unit, a feature aggregation network, a fitting network and a calculation unit; the key component area segmentation unit is used to segment the track image at the pixel level and simplify the background to generate pseudo images of three key components: rails, sleepers and track plates; the feature aggregation network is used to extract and aggregate multi-scale features in the pseudo image to obtain a high-dimensional feature vector matrix; the fitting network is used to fit the high-dimensional feature vector matrix using a multivariate Gaussian fitting function to obtain the optimal parameters of the normal image; the calculation unit is used to use an internal and external balanced anomaly score measurement function to calculate the difference between the optimal parameters of the normal image and the high-dimensional feature vector matrix of the test image, calculate the anomaly score, and realize abnormal image discrimination and abnormal pixel positioning; wherein the internal and external balanced anomaly score measurement function includes: designing an external square root measurement function D1 to calculate the difference score between the test image and the optimal parameter, where x ij ' is the eigenvector value of the test image (i, j); Use the internal Mahalanobis distance metric function D2 to calculate the difference score inside the test image; Among them, μ ij and Σ ij Indicates the use of multivariate Gaussian distribution N(μ ij ,Σ ij ) The optimal parameters are obtained by fitting the high-dimensional eigenvector matrix; the internal and external balanced anomaly score measurement function D is the sum of the two weighted anomaly scores, and the final anomaly score is obtained: D = 0.8 × D1 + 0.2 × D2.

7. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the unsupervised track anomaly detection method according to any one of claims 1 to 5 is implemented.

8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the processor and the memory communicate with each other, the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the unsupervised track anomaly detection method according to any one of claims 1 to 5.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to execute instructions for implementing the unsupervised track anomaly detection method according to any one of claims 1 to 5.