Near-incident detection in railroad environments: lateral distance estimation from train-mounted monocular camera

Yilei Wang, Giacomo D'Amicantonio, Egor BondarevWorkshops @ CVPR 2025

Introduction

Railway environments represent high-risk zones where safety monitoring is paramount. In 2023, the Dutch railway system alone recorded approximately 200 serious incidents. While fixed surveillance is common at stations, the vast stretches of open track between them often remain unmonitored. To mitigate collision risks, operators require systems capable of detecting "near-misses"—situations where persons or objects are dangerously close to the train's path. Traditionally, identifying these events has been subjective, relying on driver judgment. This paper introduces the Near-Miss Detector (NMD), a monocular vision framework designed to provide objective, precise lateral distance measurements using cost-effective, train-mounted cameras.

The Challenge of Scale Ambiguity

While sensors like LiDAR or Radar offer precise distance data, their high cost and integration complexity make them difficult to deploy at scale. Monocular (single-camera) systems are more affordable but face the fundamental challenge of "scale ambiguity": the difficulty of determining if an object in a 2D image is small and nearby or large and distant. The NMD framework overcomes this by leveraging the known physical geometry of the railway environment as a dynamic reference.

The Near-Miss Detector (NMD) Framework

The NMD framework processes video through three parallel analysis streams to construct a comprehensive 3D understanding of the scene:

  1. Object Analysis: Employs YOLO-World for zero-shot object detection and Edge-SAM for precise instance segmentation, allowing the system to identify and outline potential hazards like pedestrians or vehicles.
  2. Track Analysis: Uses TEP-Net to detect the "ego-track" (the rails the train is currently occupying) and generate a precise track mask.
  3. Depth Estimation: Utilizes Depth-Anything V2 to produce a relative depth map of the environment.
The NMD system architecture showing the parallel processing pipeline and the lateral distance measurement module.

Dynamic Scale Calibration: The Track as a Ruler

The core innovation of NMD is its two-stage calibration method, which converts relative depth into real-world metric units by treating the railway track as a continuous geometric reference:

  • Near-field Calibration: Uses the standard spacing of railway sleepers (ties) to calibrate distances in the immediate vicinity of the train.
  • Far-field Calibration: Leverages the standard rail gauge (1.435m). Because the physical width of the tracks is constant, the system uses the apparent pixel width of the tracks at any given depth to calculate the real-world scale for that specific distance.
  • Fusion: A sigmoid-based weighting function blends these methods, prioritizing sleeper-based data for nearby objects and rail-gauge geometry for distant ones.

Experimental Results

The researchers evaluated the NMD framework using a specialized dataset of 680 high-resolution images with ground-truth lateral distance measurements derived from physical station infrastructure.

Visualization of the NMD output, showing object detection, track segmentation, and corresponding depth maps used for distance estimation.

Key findings include:

  • High Precision: The system achieved a mean lateral distance error of just 0.290m.
  • Reliability: Over 90% of distance estimates had an error of less than 0.5 meters, meeting the requirements for identifying dangerous proximity.
  • Safety Zone Performance: 67% of measurements were within the critical 2–3 meter safety zone from the track, where accuracy is most vital for accident prevention.
  • Efficiency: Parallel implementation improved processing efficiency by 11.2% over sequential methods, though depth estimation remains a primary computational bottleneck.

Conclusion and Future Work

The Near-Miss Detector demonstrates that monocular cameras, when combined with foundation models and geometric constraints, can serve as precise safety tools in railway environments. While the system performs exceptionally well on straight tracks, future work will focus on improving robustness for curved track geometries and optimizing the depth estimation component for real-time performance on edge hardware.

Summary updated

BibTeX
@inproceedings{wang2025near,
  author = {Yilei Wang and Giacomo D'Amicantonio and Egor Bondarev},
  title = {{Near-incident detection in railroad environments: lateral distance estimation from train-mounted monocular camera}},
  booktitle = {Workshops @ CVPR},
  year = {2025},
}
Figure