Railway abnormal target detection system and method, computer equipment and medium
By using a feature comparison method of binocular camera and feature memory bank in railway detection, the problem of identifying unknown abnormal targets in the prior art is solved, and efficient and accurate railway abnormal target detection is achieved, adapting to complex environments and reducing data labeling costs.
Patent Information
- Application Number
- CN202510526576.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-08
AI Technical Summary
It is difficult for existing railway detection technology to effectively identify abnormal targets that do not appear in the training data in an open environment, and the monocular camera cannot accurately calculate distance information, resulting in missed and false alarms.
The vehicle-mounted binocular camera is used to collect the color texture and depth information of the railway scene, extract the bounded area through semantic segmentation, combine the feature memory bank and feature comparison module for abnormal detection, and use the parallax to calculate the three-dimensional information of the target to construct an abnormal sample feature library for comparison and judgment.
It improves the accuracy and robustness of detection, reduces the false alarm rate, and can identify multiple unknown abnormal targets without abnormal samples, adapt to complex open environments, reduces data labeling costs, and meets the needs of real-time vehicle-mounted applications.
Smart Images

Figure CN120451646A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of railway safety detection, and in particular to a railway abnormal target detection system, method, computer equipment and medium. Background Art
[0002] Railway lines operate in open environments, where intrusion by foreign objects (such as people, falling rocks, and mudslides) poses a serious threat to train safety. Existing deep learning-based image object detection algorithms typically rely on large amounts of annotated data, particularly anomalous samples. However, the sporadic nature of abnormal events in railway environments makes comprehensive collection of anomalous samples extremely difficult, making it difficult for existing detection algorithms to effectively identify anomalous objects that do not appear in the training data.
[0003] Furthermore, while existing technologies utilize onboard cameras for abnormal object recognition, most use monocular visible light or infrared cameras. Relying solely on image information from a single perspective can lead to missed detections and false positives, making accurate target perception impossible. Monocular cameras also cannot accurately calculate distance information, preventing the distance between the target and the vehicle from being determined during the detection process. Therefore, existing technologies have significant limitations in accurately detecting complex foreign object intrusions in open railway environments. Summary of the Invention
[0004] The purpose of the present invention is to provide a railway abnormal target detection system, method, computer equipment and medium. The system obtains a record library containing normal scene features by analyzing normal railway scenes, and locates abnormal targets by comparing the features extracted from the image to be detected with the features in the memory library.
[0005] To achieve the above objectives, the present invention provides a railway abnormal target intrusion image detection system, comprising:
[0006] Onboard camera, used to collect color, texture, and depth information of railway scenes;
[0007] Image preprocessing module, used to extract the area within the railway limit;
[0008] An onboard computing device, equipped with an anomaly detection model, is used to process image data and run an anomaly detection algorithm;
[0009] The anomaly detection model consists of two parts. The first part is the feature memory library, which is used to store the features of images without anomalies. The second part is the feature comparison module, which compares the data collected by the camera with the data in the memory library to obtain the anomaly detection results.
[0010] Preferably, the onboard camera is a binocular camera, which calculates the three-dimensional information of the target in the railway scene by using parallax and triangulation and geometric relationships and simultaneously collects the color and texture of the target.
[0011] Preferably, the feature memory is constructed by extracting features from the non-abnormal image using a feature extractor and utilizing the non-abnormal features;
[0012] The feature comparison module uses a feature extractor to extract features from the image processed by the image preprocessing module, and compares the extracted features with the features in the feature memory to locate abnormal targets.
[0013] The present invention also provides a method for detecting abnormal railway targets, comprising the following steps:
[0014] Use a vehicle-mounted binocular camera to collect railway scene images and depth information, where the depth information is calculated through parallax and triangulation;
[0015] The image preprocessing module preprocesses the collected images and extracts the area within the railway limit;
[0016] A feature memory library is constructed using the normal image data. The feature memory library extracts and stores features of the normal image through a feature extractor.
[0017] Extract features from the image to be detected, compare the extracted features with the features in the feature memory library, and determine the feature differences;
[0018] Determine whether there is an abnormal target based on the feature difference and output the location of the abnormal target.
[0019] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory is used to store instructions, and the processor is used to execute the instructions to implement the above-mentioned railway abnormal target detection method.
[0020] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for detecting abnormal railway targets as described above is implemented.
[0021] Therefore, the present invention adopts the above-mentioned railway abnormal target detection system, method, computer device and medium, and the beneficial technical effects are as follows:
[0022] (1) The use of binocular cameras improves the richness of information.
[0023] The present invention uses a binocular camera to extract information about the environment, including color, texture, and depth information, effectively improving feature richness, improving the accuracy of detecting abnormal targets while reducing false alarms.
[0024] (2) Detection can be achieved without the need for abnormal samples.
[0025] The present invention constructs an abnormal feature library using only normal images, without relying on a large number of difficult-to-obtain abnormal samples, and can effectively detect various abnormal targets, thus solving the problem of difficulty in collecting abnormal samples in the railway environment.
[0026] (3) Improve detection accuracy and robustness.
[0027] Railway scenes are highly similar. By building a feature library using non-abnormal samples, we can fully explore the common features of railway scenes. The feature comparison method can be used to quickly and accurately locate the position of abnormal targets in the image.
[0028] (4) Adapt to complex and open environments.
[0029] The present invention addresses the complex problem of foreign object intrusion in open railway environments. By constructing a feature library using only positive samples, it can effectively deal with a variety of unknown abnormal targets, has strong generalization capabilities, and meets the needs of actual application scenarios.
[0030] (5) Reduce data annotation costs.
[0031] Since a large number of abnormal samples are not required for training, the present invention significantly reduces the workload and cost of data annotation, while simplifying the model training process and improving the practicality and scalability of the system.
[0032] (6) Strong real-time performance, meeting the needs of vehicle-mounted applications.
[0033] The overall system architecture is simple and efficient. It can run in real time on on-board equipment, quickly detect abnormal targets ahead of the railway, provide timely warnings for train operation safety, and improve the safety and reliability of railway operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is a workflow diagram of a railway abnormal target intrusion image detection system according to the present invention;
[0035] Figure 2 Build a process for the feature library. DETAILED DESCRIPTION
[0036] The technical solution of the present invention is further described below with reference to the accompanying drawings and embodiments.
[0037] Unless otherwise defined, technical or scientific terms used in the present invention shall have the same meaning as commonly understood by one of ordinary skill in the art to which the present invention belongs.
[0038] Example 1
[0039] like Figure 1 As shown in the figure, this is a workflow diagram of a railway abnormal target intrusion image detection system of the present invention. The system hardware mainly consists of two parts. The first part is an on-board binocular camera for image acquisition, and the second part is an on-board computing device for processing binocular camera data and an anomaly detection model for running an anomaly detection algorithm.
[0040] In the data preprocessing stage, a semantic segmentation model is first used to classify each pixel in the image. The bounded area is extracted based on the corresponding category of the bounded area, and the area inside the bounded area is focused on detection as the key detection area. Then, a binocular camera is used to obtain the depth information of different objects in the scene and obtain an image containing depth information. The specific process is as follows:
[0041]
[0042] Where Z represents the depth of the target, f represents the focal length of the camera, B represents the baseline distance between the two cameras, and d represents the parallax.
[0043] Select some of the anomaly-free images that have been preprocessed to build an anomaly-free sample library. After the anomaly-free sample library is built, use the feature extraction network to extract features from the samples. The extraction process is as follows: Figure 2 shown.
[0044] The size of the sample is H×W×4, where H represents the height of the image, W represents the width of the image, and 4 represents the number of channels, representing RGBD respectively. Feature comparison is performed by dividing each sample into feature blocks of size P×P, and the size of each feature block is H p , W P Represent the height and width of the feature block respectively, and the feature block f is obtained after changing its size p , whose shape is H P ×W P ×4. Then, a multi-layer perceptron is used to compress the channel dimension to 512, and the final feature block is obtained: p ′=mlp(f p )∈R 1×512 , and finally the feature obtained for each image is f′ img ∈R P×P×512 , there are N samples in the feature library, and the feature size of the feature library is f bank ∈R P×P×512×N In order to improve the calculation speed, the PCA algorithm is used to calculate f bank Perform dimensionality reduction and obtain the final feature memory library as
[0045] In the anomaly detection stage, features f are first extracted from the camera image. img, whose shape is P×P×128, where P×P is the number of feature blocks. Finally, the similarity is used to measure the feature f img and feature memory The difference between them is calculated as follows:
[0046]
[0047] in, Represents feature differences. The final detection result is the normalized output of feature differences:
[0048]
[0049] in, express The minimum value of express The maximum value of result represents the normalized result, whose shape is P×P, by setting the threshold s th , if the result has a value greater than s th , it is considered that there are abnormal targets in the area.
[0050] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0051] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0052] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0053] It is worth noting that the contents not elaborated in detail in the present invention are all prior art and are well known to those skilled in the art.
[0054] Therefore, the present invention adopts the above-mentioned railway abnormal target detection system, method, computer equipment and medium. The system obtains the normal scene feature distribution by analyzing the normal railway scene. When faced with abnormal features, based on the learning of the normal feature distribution, the location of the abnormal target can be determined by distinguishing feature responses, feature comparison and other methods.
[0055] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A railway abnormal target detection system, characterized in that: include: Onboard camera, used to collect color, texture, and depth information of railway scenes; Image preprocessing module, used to extract the area within the railway limit; An onboard computing device, equipped with an anomaly detection model, is used to process image data and run an anomaly detection algorithm; The anomaly detection model consists of two parts. The first part is the feature memory library, which is used to store the features of images without anomalies. The second part is the feature comparison module, which compares the data collected by the camera with the data in the memory library to obtain the anomaly detection results.
2. A railway abnormal target detection system according to claim 1, characterized in that: The onboard camera is a binocular camera that uses parallax and triangulation to calculate the three-dimensional information of targets in the railway scene using geometric relationships and simultaneously collects the target's color and texture.
3. The railway abnormal target detection system according to claim 1, characterized in that: The feature memory is constructed by extracting features from images without abnormalities using a feature extractor and using the features without abnormalities to construct a feature memory; The feature comparison module uses a feature extractor to extract features from the image processed by the image preprocessing module, and compares the extracted features with the features in the feature memory to locate abnormal targets.
4. A railway abnormal target detection method, characterized in that: The following steps are involved: Use a vehicle-mounted binocular camera to collect railway scene images and depth information, where the depth information is calculated through parallax and triangulation; The image preprocessing module preprocesses the collected images and extracts the area within the railway limit; A feature memory library is constructed using the normal image data. The feature memory library extracts and stores features of the normal image through a feature extractor. Extract features from the image to be detected, compare the extracted features with the features in the feature memory library, and determine the feature differences; Determine whether there is an abnormal target based on the feature difference and output the location of the abnormal target.
5. A computer device, characterized in that: It includes a memory and a processor, the memory is used to store instructions, and the processor is used to execute the instructions to implement the railway abnormal target detection method as claimed in claim 4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the railway abnormal target detection method according to claim 4 is implemented.
Citation Information
Patent Citations
Rail anomaly detection method and system based on depth feature comparison
CN118552919A
Railway wagon anomaly detection method and system
CN118840611A
Component inspection method and inspection system
WO2020031984A1
Defect inspection method, device and system
WO2024114487A1