DOI: 10.5281/zenodo.7924874
title: Vision-Based Obstacle Detection on Rail Tracks

description: <strong>Acknowledgement and Disclaimers</strong> These data are a product of a research activity conducted in the context of the RAILS (Roadmaps for AI integration in the raiL Sector) project. RAILS has received funding from the Shift2Rail Joint Undertaking (JU) under the European Union’s Horizon 2020 research and innovation programme under grant agreement n. 881782 Rails. The JU receives support from the European Union’s Horizon 2020 research and innovation program and the Shift2Rail JU members other than the Union. The information and views set out in this description are those of the author(s) and do not necessarily reflect the official opinion of Shift2Rail Joint Undertaking. The JU does not guarantee the accuracy of the data included in this dataset. Neither the JU nor any person acting on the JU’s behalf may be held responsible for the use which may be made of the information contained therein. This "dataset" has been created for scientific purposes only to study the potentials of Deep Learning (DL) approaches when used to analyse Video Data in order to detect possible obstacles on rail tracks and thus avoid collisions. The authors DO NOT ASSUME any responsibility for the use that other researchers or users will make of these data. <strong>Objectives of the Study</strong> RAILS defined some pilot case studies to develop Proofs-of-Concept (PoCs), which are conceived as benchmarks, with the aim of providing insight towards the definition of technology roadmaps that could support future research and/or the deployment of AI applications in the rail sector. In this context, the main objectives of the specific PoC "Vision-Based Obstacle Detection on Rail Tracks" were to investigate: i) solutions for the generation of synthetic data, suitable for the training of DL models; and ii) the potential of DL applications when it comes to detecting any kind of obstacles on rail tracks while exploiting video data from a single RGB camera. <strong>A Brief Overview of the Approach</strong> A multi-modular approach has been proposed to achieve the objectives mentioned above. The resulting architecture includes the following modules: The Rails Detection Module (RDM) detects rail tracks. The output of the RDM is used by the ODM and ADM. The Object Detection Module (ODM) detects obstacles whose type is known in advance. The Anomaly Detection Module (ADM) identifies any possible anomaly on rail tracks. These include obstacles whose type is not known in advance. The Obstacle Detection Module merges the outputs from the ODM and the ADM. The Distance Estimation Module estimates the distance of objects and anomalies from the train. The research was specifically oriented at implementing the RDM-ADM pipeline. Indeed, the object detection approaches that would be used to implement the ODM have been widely investigated by the research community, instead, to the best of our knowledge, limited work has been done in the rails field in the context of anomaly detection. The RDM has been realised by adopting a <em>Semantic Segmentation</em> approach based on <em>U-Net</em>; while, to develop the ADM, a <em>Vector-Quantized Variational Autoencoder</em> trained in <em>Unsupervised </em>mode was leveraged. Further details can be found in the RAILS "Deliverable D2.3: WP2 Report on experimentation, analysis, and discussion of results". <strong>Steps to implement the RDM-ADM pipeline and description of shared Data</strong> The following list reports all the steps that have been performed to implement the RDM-ADM pipeline; the words in bold-italic refer to the files that are shared within this dataset: A Railway Scenario was generated in MathWorks' RoadRunner. A video (<strong><em>FreeTrackVideo</em></strong>) was recorded by simulating an RGB camera mounted in front of the train; no obstacles on rail tracks were considered in this phase. 2000 frames (<strong><em>FreeTrack2KFrames</em></strong>) were extracted from the aforementioned video. The video contains 4143 frames, however, only 2000 (each other frame starting from the first one) were taken into account due to training time and GPU RAM constraints. Only 10% of the 2000 frames were manually labelled (i.e., 200 frames, a frame every 10 frames) by exploiting LabelMe; these frames were then subdivided into training and validation sets (<strong><em>InitialLabelledSet</em></strong>). Hence, a Semi-Automatic labelling algorithm was developed by leveraging self-training and transfer learning. This algorithm made it possible to label all the FreeTrack2KFrames starting from the InitialLabelledSet. The resulting labels can be found in <strong><em>FreeTrack2KLabels</em></strong>. Data Augmentation was then performed in order to introduce some aleatory in the dataset. Because of the same time and RAM constraints mentioned above, the FreeTrack2KFrames set of data was reduced further: 1600 frames were selected among the aforementioned 2000 and then 5 transformations (Bright, Dark, Rain, Shadow, and Sun Flare) were applied to obtain the dataset (<em><strong>FreeTrack16TrainSet</strong>, <strong>FreeTrack16ValSet</strong>, <strong>FreeTrack16TestSet</strong></em>) that was used to train, validate, and test the RDM. Once the RDM was trained, the FreeTrackVideo was processed to obtain the masked frames that were then used to build the dataset(s) to train, validate, and test the ADM. The ADM was studied by considering two different datasets: the <em>Non-Anomaly Dataset</em> (<strong><em>NAD</em></strong>), which basically contains all the frames of the FreeTrackVideo once processed by the RDM; and the <em>Augmented Non-Anomaly Dataset (<strong>A-NAD</strong>)</em>, which contains 9000 frames, 1500 of which were extracted from the NAD, while the remaining 7500 were obtained by applying the same transformations mentioned above. Lastly, when both the RDM and the ADM were trained, the performances of the whole RDM-ADM pipeline were tested on the <strong><em>WithCarVideo</em></strong> which depicts the same scenario as the FreeTrackVideo but it also depicts a car laying on the rail tracks (i.e., an obstacle).