Introduction

Derailments are a recurrent incident in developing nations, i.e., Bangladesh, Pakistan, India, Kenya, etc.1,2,3,4,5,6,7,8,9,10,11,12,13 These incidents often result in fatalities, injuries, and substantial economic losses, disrupting rail operations. Derailments typically occur due to disruptions in rail track continuity or defects in the track structure. Common causes include fractures, joint failures, weld failures, metal embrittlement, and gauge widening, etc.14,15,16,17,18,19 These discontinuities and faults can be attributed to both natural factors and human intervention. During political unrest or mass protests, protesters often remove rail tracks to disrupt transportation20,21,22,23. The public accessibility of railway tracks in developing nations facilitates such actions. Additionally, natural calamities like cyclones, heavy rainfall, and floods can contribute to rail track dislodgement or damage.

Derailments pose a substantial risk to the safety and economic well-being of developing nations. They can result in substantial financial losses due to damage to infrastructure, equipment, and loss of life. To address this critical issue, an automated real-time missing rail tracks detection system is essential.

This investigation focuses on formulating a robust and efficient methodology for identifying missing segments of the railway track in real-time. The system leverages the capabilities of LoRa technology to achieve long-range data transmission with high delivery ratios24,25. By analyzing the vibration characteristics of the rail track, the system can effectively identify discontinuities, such as uprooted or broken rails. To validate the effectiveness of the proposed solution, extensive experiments were conducted in a real-time railway environment. The results demonstrated that the system can accurately detect missing segments of the railway track with high precision. This research marks a significant advancement in the field of railway safety, as existing studies have yet to achieve similar capabilities26,27,28.

We introduce a novel approach for real-time identification of missing rail tracks, offering a promising solution to enhance railway safety and mitigate the devastating consequences of derailments. Ours is the first study to enable such sensing to the best of our knowledge.

Our findings lead us to the following contributions in this study.

  • We formulate a novel methodology and deployment topology for collecting and storing real-time vibration data from railway tracks.

  • We analyze the collected real vibration data. Through the analysis, we find that we can reduce the impact of noise on vibration through the notion of multi-sensor fusion, which is a novel finding to the best of our knowledge.

  • We employed machine learning algorithms tailored for resource-constrained embedded systems to analyze vibration data from multiple sensors. This allowed us to detect incoming trains from 1000 m away with over 95% accuracy.

  • Based on our previous findings, we introduce a novel multi-objective optimization framework to establish optimal sensor placement. We partition the railway network into segments and strategically deploy sensor nodes based on historical accident patterns.

  • We optimize sensor node deployment by balancing cost and derailment risk. We consider three deployment scenarios: 1-hop communication, 2-hop communication, and adapted 1-hop communication.

  • To assess the efficacy of our optimized sensor node deployment strategies, we analyze Pareto-optimal points and link-specific metrics, encompassing sensor count, cost, potential derailments, actual derailments, and averted derailments.

Related work and gap in the literature

This investigation encompasses diverse domains, including railway monitoring systems and rail track sensing systems, essential for developing the proposed real-time rail track monitoring system. Consequently, we identify relevant research studies from various perspectives. The subsequent subsections present an overview of these studies.

Literature review

Monitoring systems for rail tracks

Numerous researchers have dedicated their efforts to creating components and systems for modern railway functions. These studies primarily concentrate on detecting cracks, stress, small breakages, inclination, and other structural issues in railway tracks14,15,16,17,18,19,29,30,31,32,33,34. Many of these studies rely on conventional track circuit-based signaling35.

Efforts have also been made to monitor the overall railway infrastructure31,36,37,38. Some researchers have explored on-board track monitoring systems using machine vision. These systems acquire high-resolution images of the railway track and utilize pattern recognition algorithms to identify defects.39,40,41.

Sensing for rail tracks

Vibration sensing has been extensively investigated for structural health monitoring over time42,43,44,45. However, these methods are not well-suited for railway scenarios where the track experiences dynamic excitation from running trains.

One particular study explored vibration signals generated by a moving train46. While this study focused on detecting wildlife on the track, it didn’t provide a comprehensive solution for missing rail track detection.

Limited research has explored the use of voltage on rail tracks to detect missing blocks47. However, this approach is not practical in developing countries with publicly accessible tracks.

Existing studies for detecting missing rail tracks are often expensive and lack real-time capabilities, particularly in developing countries where derailments due to missing blocks are common.

Network optimization technique

We explore the realm of multi-objective optimization within the context of wireless sensor networks. Several studies, such as Raiconi et al.48, have explored optimizing factors, such as lifetime and connectivity within these networks. Additionally, multi-objective optimization approaches have been applied to address path optimization49,50, relay node placement51, target coverage52, sensor scheduling53,54, and convergence speed55.

However, existing research often overlooks cost and safety as critical objectives within the optimization framework for static wireless sensor networks. Iqbal et al.56 offers a detailed exploration of multi-objective optimization in this field. Nevertheless, a dearth of multi-objective optimization techniques tailored for linear sensor networks, such as railway or metro-rail networks and seawater monitoring networks, exists in the literature.

Tailored approaches for the developing countries

While a limited number of studies have investigated real-time solutions for identifying missing rails in developing countries26,27,28, these existing solutions have limitations. They have not extensively investigated diverse scenarios or conducted in-depth analysis of sensor data. These studies primarily focused on demonstrating that the vibration signal pattern of a rail track changes when a sensor is present. However, they failed to present a fully developed sensory system.

Background, motivation, and our research context

In the following section, we dig into the comprehensive sensing and communication model applicable to the real-time rail anomaly detection system initially explored in26 and27. Subsequently, we discuss the shortcomings of existing research within the context of our investigation.

Sensing the rail tracks

This research proposes a distributed sensor network for real-time monitoring of rail track conditions. Each sensor node consists of two primary components: a sensory unit and a control module. These static nodes are strategically placed along the railway tracks to capture vibration data generated by approaching trains.

As a train approaches, it produces vibration signals that are detected by the sensor nodes. These nodes collect essential information about the vibration patterns, which can be analyzed to assess the integrity of the rail tracks. Discontinuities in the rail track modify the transmission of vibrations, yielding valuable information regarding the track’s condition. The collected vibration data is transmitted to the control module, where it undergoes rigorous analysis using advanced signal processing and machine learning techniques. By examining the patterns and characteristics of the vibration data, the control module can accurately detect any faults or anomalies in the rail track.

Once the analysis is complete, the control module sends a notification to the train, providing information about the condition of the rail track ahead. This timely notification enables the train operator to take appropriate measures, such as reducing speed or stopping the train if necessary, to prevent derailments.

The railway track is composed of metal rail tracks, typically measuring around 120 m in length, connected by fishplates as illustrated in Fig. 1a. Trains operate on these tracks at speeds ranging from 60 to 90 km/h57. Based on field studies, stopping a train traveling at approximately 80 km/h requires a stopping distance of around 400 m. As the train moves, it generates vibrations that propagate along the continuous track. Our proposed device is designed to capture and analyze these vibrations to detect any discontinuities in the track.

Fig. 1
figure 1

Rail tracks in Bangladesh.

When a rail track is uprooted, as depicted in Fig. 1b, vibration signals do not propagate effectively along the track. This difference in vibration patterns can be exploited by our device to identify discontinuities. The device will analyze the collected vibration data to detect any mismatch with the expected vibration characteristics of a continuous track. By identifying these mismatches, the system can accurately detect discontinuities in the rail track at a distance of approximately 1 km or more from the sensing device. This early detection allows for sufficient time to stop the train before an accident occurs.

Why do the existing studies fail to our context?

While the studies26,27 have explored real-time wireless sensory systems for railway applications, they have not addressed the specific challenge of detecting missing rail tracks. These studies lacked methodologies for sensing and analyzing the vibration patterns of approaching trains, limiting their ability to accurately classify healthy and uprooted rail tracks. Moreover, they focused solely on detecting signal changes, neglecting the importance of vibration classification.

One of the key objectives of this research is to develop a system capable of detecting and classifying vibration patterns associated with healthy and uprooted rail tracks. This goal is particularly challenging due to the potential interference from various sources, including pedestrians, animals, and vehicles.

To overcome these limitations, this research proposes a novel approach with several enhancements. Unlike previous studies that deployed a single sensor per node in a zigzag pattern, our design utilizes multiple sensors per node arranged in parallel on both rail tracks. This configuration enables simultaneous monitoring of both tracks and reduces the risk of false positives caused by external vibrations. Additionally, the integration of machine learning algorithms allows for more accurate discrimination between train vibrations and other sources of noise.

Methodology of our research

In the following section, we outline a proposed architecture for the rail track sensory system, aligning with the framework outlined in26 and27. Figure 2 depicts the simplified representation of the proposed model. We strategically deploy sensors on both rails of the railway track, with each sensor powered by a battery.

Fig. 2
figure 2

Simplified concept of the proposed sensory system.

Figures 2, and 3 present the architectural blueprint of our proposed real-time rail track anomaly detection system. For clarity, electrical wires and power sources have been excluded from the diagram. The system comprises two primary components: one sensory unit and one control module. The sensory unit utilizes one piezoelectric sensor and one amplifier to acquire vibration data from the railway track. Several sensory modules are strategically positioned on opposite rail tracks to gather data from both rail tracks, constituting a sensor node.

Fig. 3
figure 3

Proposed sensory system model.

The inspector node, representing the approaching train, is positioned approximately 1200 m away from the sensor node. This configuration allows the sensory unit to effectively capture vibrations from the train at a significant distance. The sensor node collects essential information about the vibration patterns generated by the approaching train. By analyzing these patterns, the system can detect any abnormalities indicative of rail track discontinuities. The collected data is then transmitted to the control module for further processing. Leveraging advanced signal processing and machine learning techniques, the control module analyzes the vibration data to identify any faults or anomalies in the rail track.

Sensory system architecture

Figure 4a depicts the proposed networking and sensory system architecture for a real-time rail track anomaly detection system. The proposed system comprises two distinct modules: (a) the rail track module and (b) the inspector node (train module).

The rail track module is equipped with a sensory module, a control module, and a communication module. The sensory module is strategically located on adjacent rail tracks to acquire vibration data from both tracks. These pairs of sensing modules are positioned at a distance of 1 km apart. The inspector node, symbolizing the train, is positioned 1 km from the initial pair of sensor nodes. This arrangement ensures that the system can monitor a 2 km cumulative distance from the inspector node to the most distant sensor node pair.

Communication system architecture

For the communication module, we apply a practical networking solution that facilitates low-cost, long-range communication for real-time identification of missing or defective rail tracks in developing nations25. According to25, we employ LoRa modules24 for the communication between the modules. To circumvent obstacles within the Fresnel zone clearance, we strategically position the LoRa module atop a 3.65-m-tall pole, since the height of the train is 3.65 m. Figure 4b, c illustrate alternative communication architectures and paradigms for the system. The system utilizes a two-hop communication protocol and comprises three nodes: the inspector node (train), the parent node (nearest node to the inspector node, i.e., the query node), and the child node (positioned at 1000 m from the parent node). An Inspector Node on the train queries a Parent Node, which then forwards the query to a Child Node located 1000 m further. Each node analyzes vibration data and transmits reports to the preceding node. This multi-hop approach enables the Inspector Node to receive critical track condition information from a significant distance ahead, providing sufficient time for the train to respond to potential hazards. Algorithm 1 shows the process of detect missing rail tracks.

Fig. 4
figure 4

Proposed overall system model.

Algorithm 1
figure a

Rail Track Monitoring and Communication

GIS-based derailment dataset preparation for sensor deployment

In the following section, we discuss the dataset preparation process from the Bangladesh Railway map and historical derailment incidents in Bangladesh.

Railway map preprocessing

This research utilizes a Geographic Information System (GIS) to create a comprehensive dataset representing the Bangladesh railway network58. GIS is a valuable tool for analyzing spatial data and identifying relationships between different geographic features. The initial GIS depiction of the railway network in Bangladesh, as shown in Fig. 5, contains numerous links, some of which are relatively short, isolated, or even obsolete. To address these inconsistencies, the map underwent a cleaning and processing process. Short links with lengths less than 1000 m were merged into larger links, and isolated links were connected to create a continuous network. This resulted in a reduction of links from 640 to 52. Figure 6 illustrates the cleaned map, and Fig. 7 highlights the distinct links in different colors.

Fig. 5
figure 5

Bangladesh Railway’s GIS map before preprocessing.

Fig. 6
figure 6

Bangladesh Railway’s GIS map after preprocessing.

Fig. 7
figure 7

Bangladesh Railway’s processed GIS map.

It is noteworthy that certain regions of the Western zone were absent from the original map, as illustrated in Fig. 8. These missing sections were identified and excluded from the dataset. To accurately repair these missing parts, further analysis and input from experienced technical personnel, along with precise data from the Bangladesh Railway, would be necessary. Key features were extracted from each rail track within the cleaned map, including coordinates and link lengths.

Fig. 8
figure 8

Excluded regions of the refined GIS map of the Bangladesh Railway.

Preparation of derailment dataset

To assess the efficacy of the sensor node deployment strategies, we construct an event dataset utilizing historical derailment incidents from 2008 to 201559. Table 1 outlines the allocation of these derailments among the four railway divisions (Lalmonirhat, Paksey, Dhaka, and Chittagong), which are divided into two railway zones (West zone, and East zone). Link-wise derailment probabilities were assigned based on the observed distribution of derailments within each division. Since detailed link-wise statistics were not available, the total probability for a division was evenly distributed among its links. Table 2 presents the calculated link-wise derailment probabilities.

Table 1 Zone-specific derailment and accident statistics (2008 to 2015)59.
Table 2 Derailment probability for individual railway links in Bangladesh based on historical incidents (2008 to 2015)59.

A random binary sequence was created for each link, signifying the probability of derailment-inducing events. The length of the vector was determined by the number of segments within the link, with each segment corresponding to 100 m. A value of ‘1’ in the vector indicated the presence of a potential derailment event at that specific location. By combining the event vectors for all links, a comprehensive vector representing potential derailment locations across the entire railway map was created. Three separate vectors were generated to ensure unbiased optimization and improve the robustness of the evaluation process.

Sensor deployment optimization

In the subsequent section, we explore the challenge of strategically positioning an appropriate number of sensor nodes along the railway tracks to prevent derailments throughout Bangladesh.

Sensor placement strategies

Our work explores three distinct sensor node deployment strategies categorized by the number of communication hops, i.e., 1-hop, 2-hop, and adapted 1-hop. This section provides a detailed analysis of these sensor node deployment scenarios.

Sensor deployment in 1-hop communication scenario

In the 1-hop scenario, an incoming train transmits a query to the adjacent sensor node, situated roughly 1000 m ahead. The sensor node analyzes vibrations to detect potential derailment risks and responds to the train. However, this scenario has limitations. Despite having a sensor node nearby, derailments can still occur within the first 300 m of the train due to the required braking distance. Additionally, the sensor node’s sensitivity from 1000 m may lead to erroneous information, potentially resulting in derailments. Figure 9 illustrates the system architecture for 1-hop communication, showcasing the interaction between the sensor node and the approaching train.

Fig. 9
figure 9

Basic schematic of the sensory system with 1-hop communication.

Sensor deployment in 2-hop communication scenario

In the 2-hop scenario, an incoming train transmits a query to the proximate sensor node (i.e., parent node) at a distance of 500 m. The parent node subsequently relays this query to the subsequent sensor node (i.e., child node) situated 500 m away. Both nodes analyze vibrations to identify potential derailment hazards. The child node then transmits its analysis to the parent node, which in turn responds to the train with an aggregated assessment. This 2-hop approach enables the monitoring of a more extensive section of the track, potentially mitigating the risk of derailments within the initial 300-m segment. However, the sensitivity of the sensor nodes at 500 and 1000 m remains a concern, as it can lead to erroneous information and potential derailments. Figure 10 visually represents the system architecture for 2-hop communication, showcasing the interaction between the sensor nodes and the approaching train.

Fig. 10
figure 10

Basic schematic of the sensory system with 2-hop communication.

Sensor deployment in adapted 1-hop communication scenario

In the 1-hop communication scenario, a vulnerability exists within the critical zone (the first 300 m) for an approaching train. While the 2-hop scenario addresses this limitation, it necessitates a denser sensor node deployment, consequently increasing the associated costs. To achieve a balance between these considerations, an adapted 1-hop approach is proposed.

This adapted 1-hop communication scheme involves the train transmitting a query to the sensor node positioned 1000 m ahead. Notably, the train intentionally disregards the sensor node situated within the critical 300-m zone. The sensor node then analyzes the vibrations and transmits a response to the train containing track status information. This scenario ensures a minimum inter-sensor distance of 700 m. By targeting the second-closest sensor node, the adapted 1-hop communication strategy helps to mitigate the risk of derailments within the critical zone. However, a pertinent concern remains regarding the sensitivity of the sensor node located at 700 m, as it could still lead to the transmission of erroneous information and potentially contribute to derailments. Figure 11 visually depicts the system architecture for adapted 1-hop communication, illustrating the interaction between the sensor nodes and the approaching train.

Fig. 11
figure 11

Basic schematic of the sensory system with adapted 1-hop communication.

Problem statement

To optimize sensor node deployment, we divide the GIS map of the Bangladesh railway network into 52 segments or links, with each link further segmented into 100-m segments. Three deployment scenarios were considered: 1-hop (10 segments), 2-hop (5 segments), and adapted 1-hop (7 segments). A binary sequence was generated for each link to signify sensor node deployment. Each segment within a link corresponded to an index in the vector, with ‘1’ indicating sensor presence. By combining these link-wise vectors, a comprehensive sensor node deployment plan for the entire railway network is generated.

To achieve optimal sensor allocation, various approaches were explored. An equal distribution of sensor nodes across the network, while ensuring full coverage, could be a viable strategy. However, this approach might lead to redundant sensor placement in areas with low derailment risk. Alternatively, focusing on accident-prone areas could improve efficiency but might overlook other vulnerable sections. The aim is to achieve a balance between safety and cost by minimizing deployment costs while maximizing safety through probabilistic modeling of derailment scenarios.

By carefully considering these factors and optimizing the sensor node deployment, the system aims to achieve the most effective and cost-efficient solution for preventing derailments.

Cost minimization

The cost of sensor node deployment is directly influenced by the total number of sensors deployed on the railway network. A reduction in the number of sensors leads to lower overall costs. Conversely, increasing the number of sensors can enhance safety but comes at a higher cost. Equation 1 represents the total cost of the sensor network. In this equation, \(P_i\) denotes the ith individual within the population of size P, while \(C_i\) represents the cost associated with the ithindividual during the optimization process. The length and unit cost (in USD) of each individual are denoted by l, and k, respectively.

$$\begin{aligned} C_i = k \sum _{j=1}^l P_i[j] \end{aligned}$$
(1)
Vulnerabilities minimization

The vulnerability of a sensor node deployment refers to the potential number of train derailments that could occur under simulated conditions. The goal is to minimize vulnerability while considering the cost of deployment.

Three equations (Eqs. 2, 3, 4) characterize the vulnerability of the sensor network for the three types of deployment strategies (i.e., 1-hop communication, 2-hop communication, and adapted 1-hop communication). In these equations, \(P_i\) represents the individual sensor node, \(D_i\) represents its vulnerability, l is the link length, k is the unit cost, E is the event vector for derailments, EC is the event vector for critical zone derailments, and F is the sensor failure rate. By analyzing these equations, we can assess the effect of different sensor node deployment strategies on the overall vulnerability of the railway network.

1-hop communication-based sensor node deployment:

$$\begin{aligned} D_i = \sum _{j=1}^l E[j] \times \Bigg (P_i[j] \times \bigg (EC[j] + \Big (F[j] \times \overline{EC[j]}\Big )\bigg ) + \overline{P_i[j]}\Bigg ) \end{aligned}$$
(2)

2-hop communication-based sensor node deployment:

$$\begin{aligned} D_i = \sum _{j=1}^l E[j] \times \Bigg (P_i[j] \times \bigg (\Big (P_i[j-1] \times F[j-1]\Big ) + \overline{P_i[j-1]} \times \Big (EC[j] + F[j] \times \overline{EC[j]}\Big )\bigg ) + \overline{P_i[j]}\Bigg ) \end{aligned}$$
(3)

Adapted 1-hop communication-based sensor node deployment:

$$\begin{aligned} D_i = \sum _{j=1}^l E[j] \times \Bigg (\bigg (P_i[j] \times F[j]\bigg ) + \overline{P_i[j]}\Bigg ) \end{aligned}$$
(4)

Proposed solution

We utilize the Non-dominated Sorting Genetic Algorithm II (NSGA-II)60, to address the formulated multi-objective optimization problem. We generate an initial population, taking into account the parameters of the sensory and communication modules. Each individual within the population represented a distinct sensor node deployment topology on the railway network. The fitness of each individual was assessed through an iterative process, and genetic operators (selection, crossover, and mutation) were applied until the desired fitness criteria were fulfilled. Figure 12 illustrates the flowchart of this optimization approach.

Fig. 12
figure 12

Visual representation of our proposed solution methodology.

Generating initial population

An initial population of n random binary vectors was created to start the optimization process. A larger value of n typically leads to a more thorough exploration of the solution space. For this research, a value of 100 was chosen for n.

Selection: NSGA-II

We select the Non-dominated Sorting Genetic Algorithm II (NSGA-II) as the meta-heuristic algorithm for individual selection and evolution. NSGA-II is a renowned multi-objective genetic algorithm known for its efficiency and effectiveness. In contrast to single-objective optimization techniques, the NSGA-II concurrently optimizes multiple objectives without sacrificing any solution.

Given the multi-objective nature of the sensor node deployment problem, NSGA-II’s emphasis on non-dominated solutions and its explicit diversity preservation mechanism makes it well-suited for this application.

Crossover: binary uniform crossover

The binary uniform crossover operator was implemented to merge the genetic information of two-parent individuals, producing new offspring. This operator randomly selects genes (bits) from each parent chromosome to generate the offspring.

Mutation

To ensure genetic diversity and prevent premature convergence, a mutation operator was introduced. Mutation involves randomly modifying genes within a chromosome. A mutation rate of 40% was used, with options for randomly modifying gene sequences, flipping bits, or leaving the string unchanged.

Duplicate elimination

After applying crossover and mutation, duplicate individuals were eliminated from the population. This step prevents redundant individuals from entering the next generation, ensuring a diverse and efficient evolutionary process. If duplicates were found, additional mating processes were initiated until a unique population was obtained.

The experiments

This section illustrates our experimentation setups regarding both sensor data collection and sensor deployment optimization.

Experimentation for data collection from rail tracks and analysis

To assess the performance of the proposed system in real-world scenarios, we conduct a series of comprehensive experiments. This section outlines the experimental setup and the diverse scenarios considered, followed by a detailed discussion of data collection and analysis.

Hardware development and construction

The sensor node comprises two primary components: one control module and one sensory module. For this experiment, the sensory modules were deployed separately to collect vibration data. Piezoelectric sensors were chosen to detect vibrations on the railway track, and an ATmega328P microcontroller was used to process the collected data. An external 11-volt DC battery powered the module. Initially, the module was designed with a single sensor. However, based on experimental observations, the design was iteratively refined by incorporating multiple sensors. Figure 13 illustrates the simplified block diagrams of various module versions, including the final hardware configuration. Sensor data collected from all piezoelectric sensors is amplified to ensure compatibility with the microcontroller’s analog-to-digital converter (ADC). This amplification step enhances the signal quality and improves the accuracy of subsequent analysis.

Fig. 13
figure 13

The sensor module.

Experimental setup

The sensor nodes were strategically deployed at the Banani Railway Station in Dhaka, Bangladesh. Figure 14a illustrates the experimental zone within the railway station, highlighting the specific section of the rail tracks where the sensors were placed. A total of 15 sensors were deployed along the rail tracks within the designated zone, covering a distance of approximately 2000 m. These sensors collected vibration data, which was then aggregated for analysis. Figure 14b provides a visual representation of the real-world deployment of the experimental setup at Banani Railway Station.

Fig. 14
figure 14

Experimentation setup at Banani Railway Station.

Diverse scenarios and derailment emulation

To ensure comprehensive evaluation, our research considered various scenarios, encompassing different train types (meter-gauge, broad-gauge, passenger, and freight) and potential external factors (pedestrian or vehicle movement on rails). These explorations guided the evolution of our current system design. Derailments can result in discontinuities on the rails, potentially leading to trains being positioned on the opposite side of the discontinuity. To accurately assess and emulate such scenarios, we considered various configurations, including a train on the adjacent rail track, sensors disconnected from the rail and placed on the ground, or a derailed rail block, vehicles crossing the rail tracks, and individuals walking on the rails, etc. Our primary focus is to accurately differentiate between healthy and faulty rail tracks. A healthy track typically exhibits a standard, predictable vibration pattern. However, a defective, faulty, or derailed track yields a significantly different vibration profile, showing discontinuities. While measuring vibrations on a healthy track is relatively straightforward, identifying faults poses a greater challenge. The reviewer is correct that the ability to detect approaching trains is only significant when linked to track defects. However, it is neither feasible nor permissible to intentionally damage operational tracks for experimental purposes. Therefore, we create an environment where we strategically placed spare tracks beside the operational ones placing the sensors on those tracks to simulate scenarios involving missing rail tracks. This approach allows us to gather critical data without compromising the integrity and safety of the active railway system. Figure 15 shows the actual deployment of the sensory nodes in various scenarios.

Fig. 15
figure 15

Images of the actual deployment in various scenarios.

Experimentation for optimized sensor deployment

We utilize a Ubuntu 22.0461 desktop equipped with a 12th Gen Intel i5-1240P CPU and 16 GB of main memory. Additionally, we employ the Anaconda environment62, incorporating the pymoo 0.6.1.3 framework with Python 3.1263,64. For the processing of the railway GIS map, we use QGIS 3.34.1165. Our experimental setup considers the three deployment strategies, i.e., 1-hop communication, 2-hop communication, and adapted 1-hop communication. Subsequently, a comprehensive comparison of the performance of these deployment scenarios is provided. The optimization process balances two competing objectives, i.e., minimizing deployment costs (sensor count) and minimizing network jeopardy (number of derailments). NSGA-II algorithm generates a Pareto front illustrating the trade-off between these objectives.

Results and analysis

This section presents the outcomes of our experimentation regarding both sensor data collection and sensor deployment optimization. In addition to the experimental results, we provide an in-depth analysis of our findings.

Data collection and analysis

We collected real vibration data from railway tracks over two years under diverse operating conditions. To enhance data quality and generalization, a feature-based data collection approach was employed, utilizing statistical parameters such as mean, median, mode, skew, kurtosis, and standard deviation.

A decision-tree-based classification algorithm, Bonsai66, was selected as the machine learning model for this research. Bonsai was chosen due to its exceptional performance and low computational complexity, making it well-suited for real-time decision-making applications. The ability to achieve a reasonable degree of accuracy while minimizing memory and power consumption was a key consideration in selecting Bonsai for this project. Its capacity to perform real-time inference even on a 2 kB memory platform highlights its suitability for our target hardware.

The vibration sensory data collection and analysis is presented in the following three cases:

Case-1

For the initial sensory system, we adopted the design proposed in27. Each sensory node comprised a single vibration sensor, equipped with necessary filters and amplifiers, and an Arduino Uno unit. This analysis encompasses a wide range of scenarios, including vibration data from incoming trains at distances greater than 1200 m. Label-1 data was assigned to vibration data from approaching trains, while label-0 data represented vibrations from adjacent trains, pedestrians, vehicles, or external objects impacting the rails.

In this initial configuration, a single sensor was used to collect data. The block diagram of the sensor node for Case 1 is illustrated in Fig. 13a . For feature calculation, a window size of 50 time-series vibration data points was employed. Table 3 presents the average results of 5-fold cross-validation for the machine learning model. It’s important to note that our cross-validation scheme ensured that training and testing folds were independent, avoiding data leakage.

As observed in Table 3, there was a significant performance degradation (approximately 50%) for data collected from distances exceeding 800 m. This decline can be attributed to the limitations of a single sensor in capturing meaningful vibrations from distant trains, coupled with the detrimental effects of noise on the data.

Table 3 Bonsai’s performance with vibration data across various distances in Case-1.

Case-2

To enhance the performance of our system, we implement a multi-sensor fusion approach. While our proposed system primarily relies on vibration sensors to detect track anomalies, the integration of multi-sensor fusion techniques can further enhance the system’s accuracy and reliability. By combining data from multiple sensor modalities, a more comprehensive understanding of track conditions can be achieved. Multi-sensor fusion algorithms (Algorithm 2), hlcan be employed to effectively combine information from different sensors and reduce the impact of noise and uncertainty. By fusing data from multiple sensors, the system can achieve higher accuracy and robustness in detecting and classifying track defects. Additionally, multi-sensor fusion can help to compensate for the limitations of individual sensors and improve the overall reliability of the system. We modified the initial design to incorporate six vibration sensors, with three sensors strategically placed on each rail rod. The block diagram illustrating this configuration is presented in Fig. 13b . hlThis strategy effectively reduces noise and strengthens weak vibration signals.

Algorithm 2
figure b

Multi-Sensor Fusion

To evaluate the impact of multi-sensor fusion, we conduct experiments similar to Case-1. However, this time, we utilize all six sensors and combine data from different tracks. Due to technical and placement issues encountered during data collection, a four-sensor combination was not feasible as at least one sensor consistently provided inaccurate readings.

The results demonstrate that the machine learning model exhibited superior performance when using a larger number of sensors, validating our hypothesis. Table 4 summarizes the average 5-fold cross-validation results for each sensor combination.

Table 4 Bonsai performance on Case-2 dataset with varying distance and sensor combinations.

Despite these positive outcomes, there is a limitation to our experimental setup. As depicted in Fig. 14b, the Bangladeshi railway system employs three rails on each track, differentiating between meter gauge and broad gauge lines67. Our experiments were confined to meter gauge lines, neglecting the scenario of trains on broad gauge lines.

Case-3

Building upon the insights gained from the previous case studies, we develop a more robust sensory system design. To address the limitations of the earlier design, we incorporate additional sensors to cover all three rail rods.

This enhanced system utilizes a total of 15 vibration sensors, distributed evenly across the three lines. We use an Arduino Mega board, equipped with 15 analog input pins, to interface with all the sensors, eliminating the need for additional hardware.

Figure 13c illustrates the block diagram of this improved sensory system architecture. This enhanced design ensures comprehensive coverage of the rail tracks and improves the system’s ability to detect missing rail tracks under various conditions.

To identify the optimal sensor configuration for our system, we conducted experiments with various combinations of sensors. The experimental setup remained consistent with previous studies, focusing on vibrations sensed from distances exceeding 800 m. Table 5 summarizes the outcomes of these experiments, providing insights into the performance of different sensor combinations.

Table 5 Bonsai performance on Case-3 at distances beyond 800 m.

To address the issue of faulty data, we implement a moving average technique with a window size of 20. This technique effectively improves the data quality, as evidenced by the increased Pearson’s correlation coefficient. The positive impact of this data preprocessing step is reflected in the improved performance of the machine learning model, as demonstrated in Table 6.

Table 6 Bonsai performance on Case-3 with moving average on 4 sensors.

The results demonstrate that aggregating data from multiple sensors can significantly enhance the performance of the sensory system. By combining data from four sensors, we attain the peak accuracy in identifying incoming trains within the distance range of 800–1000 m. Figure 16 illustrates the accuracy of detecting an incoming train from varying distances using different sensor vibration aggregation techniques.

Fig. 16
figure 16

Accuracy of detecting an incoming train from different distances with varying numbers of sensors.

The enhanced performance can be ascribed to the characteristics of vibration data. In the process of real-time data acquisition, certain sensors may display suboptimal performance owing to diverse technical factors. Aggregating data from four sensors effectively mitigates the impact of faulty sensors, leading to more reliable and accurate results. This reduction in the effect of faulty sensors is particularly pronounced when using four-sensor fusion compared to fewer sensors.

The ability to achieve higher accuracy at distances between 800 and 1000 m allows us to constrain the sensory distance within this range for the current setup. This optimization ensures that the system can effectively detect incoming trains within a practical operating range. Sensor fusion is a valuable technique for improving the performance of the sensory system by reducing the influence of faulty sensors. By aggregating data from four sensors, we were able to achieve the highest accuracy and optimize the sensory distance for the current system configuration.

Cost analysis

Cost constitutes a pivotal factor for the extensive deployment of any system. This research prioritizes the development of a cost-effective solution for real-time rail track detection. We explored alternative sensing technologies, including piezoelectric sensors, fiber optic sensors, strain gauges, and force-sensing resistors. Table 7 shows the comparative price of different sensors in both local and global market. Through our analysis, piezoelectric sensors emerged as the most cost-effective option for our specific application, particularly considering the scale and deployment requirements of our railtrack vibration monitoring system. Table 8 presents a detailed breakdown of component costs and the total estimated cost per unit. The proposed system has an estimated cost of 70 USD for each unit. The total cost can be decreased further through mass production and optimized manufacturing techniques. By prioritizing cost-effectiveness, this research aims to make the system accessible and practical for widespread adoption in the railway industry.

Table 7 Comparative price of various sensors.
Table 8 Hardware cost assessment.

Experimentation for optimized sensor deployment

Sensors deployment in 1-hop communication

Figure 17 depicts the Pareto front for the 1-hop communication scenario. The leftmost point represents the lowest cost deployment, but it also corresponds to the highest vulnerability. Conversely, the rightmost point represents the most expensive deployment with the least jeopardy. Five points are selected from the Pareto front for further analysis: the leftmost point, the 1st quartile, the 2nd quartile, the 3rd quartile, and the rightmost point. These points were sequentially labeled from 1st to 5th topology based on their cost.

Fig. 17
figure 17

Pareto-optimal front resulting from the 1-hop communication optimization.

To assess the optimization process’s convergence and efficiency, we employed the hypervolume metric. The hypervolume was assessed at each function evaluation using a reference point of (1000, 2000). Figure 18 illustrates the convergence throughout the optimization procedure, highlighting the changes in hypervolume with each iteration. This analysis provides valuable insights into the effectiveness of the optimization algorithm in exploring the solution space and finding optimal solutions.

Fig. 18
figure 18

Convergence behavior of the 1-hop communication optimization process across function evaluations.

To evaluate the performance of a set of non-dominated solutions within the context of multi-objective optimization, it is essential to consider both convergence and diversity. To assess these aspects within our optimization process, we employ a running metric across each generation. Figure 19 visually represents the convergence trend of the optimization process with each generation, offering valuable insights into the quality and distribution of the generated solutions on the Pareto front.

Fig. 19
figure 19figure 19

Convergence analysis of the 1-hop communication optimization process across generations.

Sensors deployment in 2-hop communication

Figure 20 illustrates the trade-off between cost and vulnerability in the 1-hop communication scenario. The leftmost point represents the lowest cost but highest vulnerability, while the rightmost point signifies the highest cost but lowest vulnerability. We selected five points from this Pareto front: the leftmost, 1st quartile, 2nd quartile, 3rd quartile, and rightmost points. These points were labeled sequentially from 1st to 5th topology based on their cost.

Fig. 20
figure 20

Pareto-optimal front resulting from the 2-hop communication optimization.

We assessed the hypervolume at each function evaluation using a reference point of (1000, 2000). Figure 21 illustrates the convergence for the optimization procedure, highlighting the changes in hypervolume with each iteration. This analysis provides valuable insights into the effectiveness of the optimization algorithm in exploring the solution space and finding optimal solutions.

Fig. 21
figure 21

Convergence behavior of the 2-hop communication optimization process across function evaluation.

To evaluate the quality and distribution of our generated solutions on the Pareto front, we employed a running metric throughout the optimization process. Figure 22 illustrates the generation-wise convergence, providing insights into the effectiveness of the optimization algorithm in exploring the solution space and finding optimal solutions.

Fig. 22
figure 22figure 22

Convergence analysis of the 2-hop communication optimization process across generations.

Sensors deployment in adapted 1-hop communication

Figure 23 illustrates the trade-off between cost and vulnerability in the adapted 1-hop communication scenario. The leftmost point represents the lowest cost but highest vulnerability, while the rightmost point signifies the highest cost but lowest vulnerability. We select five points from this Pareto front: the leftmost, 1st quartile, 2nd quartile, 3rd quartile, and rightmost points. These points are sequentially labeled from 1st to 5th topology based on their cost.

The hypervolume was computed at each function evaluation using a reference point of (1000, 2000). Figure 24 depicts the convergence behavior of the optimization process over time, offering valuable insights into its efficiency and effectiveness in navigating the solution space.

Fig. 23
figure 23

Pareto-optimal front resulting from the adapted 1-hop communication optimization.

Fig. 24
figure 24

Convergence behavior of the adapted 1-hop communication optimization process across function evaluation.

To evaluate the quality and distribution of the generated solutions on the Pareto front, we employ a running metric throughout the optimization process. Figure 25 illustrates the generation-wise convergence, providing insights into the effectiveness of the optimization algorithm in exploring the solution space and finding optimal solutions.

Fig. 25
figure 25figure 25

Convergence analysis of the adapted 1-hop communication optimization process across generations.

Discussion

The comparative analysis of existing literature reveals significant gaps in the real-time detection of railway track defects, particularly concerning the missing or uprooted rail track detection (Table 9). While previous studies have explored various techniques, including machine vision, acoustic emission, and micro-motion sensors, these approaches often rely on retrospective analysis or simulated environments. In contrast, our developed module introduces a novel approach by enabling real-time vibration data acquisition specifically tailored for railway track monitoring. Unlike existing methods that require trains to be positioned directly over defects, our module actively collects vibration data as trains approach, providing early warnings for potential derailments. This proactive methodology enhances the ability to detect imminent track issues and enables timely interventions to prevent accidents.

Table 9 Comparison of existing literature on rail track monitoring.

To evaluate the performance of Bonsai relative to other classification algorithms, we conducted experiments using Support Vector Machines, Decision Trees, k-Nearest Neighbors, and Logistic Regression. Additionally, considering the success of deep neural networks (DNNs) in sensor-driven classification activities, we trained the network proposed in68. For a fair comparison, all models were trained using the same dataset, focusing on the 4-sensor combination for the 800-1000m distance range from Case 3. Table 10 presents the mean of 5-fold cross-validation results for these models. While Bonsai demonstrated competitive performance compared to other computationally expensive algorithms, it achieved slightly lower accuracy than the DNN. However, Bonsai’s smaller memory requirement makes it a more suitable choice for our system, given the resource constraints.

Table 10 Performance analysis of ML models on Case-3 within 800–1000 m distance employing 4 sensors.

Further improvements in Bonsai’s performance can be achieved by incorporating additional sensors, but this would increase hardware complexity and processing time. Balancing these factors is crucial when determining the optimal sensor configuration for the system.

To evaluate the performance of the three deployment scenarios (i.e., 1-hop communication, 2-hop communication, and adapted 1-hop communication), we analyzed the convergence as well as the diversity of the solutions produced on the Pareto front. Figure 26 illustrates the convergence behavior of the optimization process for each scenario across generations.

Fig. 26
figure 26

Assessment of the time needed for sensor node deployment optimization across the three scenarios.

Among the three scenarios, adapted 1-hop communication emerges as the most efficient in terms of sensor node deployment. This scenario requires an expense of deploying approximately 77K USD to prevent over 65% of potential train accidents. In contrast, the 1-hop communication and 2-hop communication scenarios demand approximately 50K USD, and 96K USD, respectively, to prevent almost 33% and 20% of potential train accidents. A dense deployment of sensors, placing one every 1 km, would cost approximately 145K USD, potentially preventing most accidents but incurring significantly higher deployment and maintenance costs.

Therefore, adapted 1-hop communication offers a balanced approach, effectively preventing a significant number of accidents while minimizing deployment costs and maintenance requirements.

To enhance the system’s sustainability, we explored the feasibility of energy harvesting for powering the sensor nodes in harsh environments like open railway tracks. Our previous research70 investigated various energy harvesting techniques for resource-constrained devices in such settings, demonstrating promising outcomes. In future iterations of this real-time missing rail track detection system, we plan to integrate these energy harvesting solutions to minimize reliance on external power sources and enhance the system’s autonomy.

In addition, existing research efforts on real-time detection of missing rails in developing countries26,27,28 have shown promising initial results. However, these studies have limitations. They often lack comprehensive investigations into diverse scenarios, including variations in train speeds, environmental conditions, and different types of rail defects. Furthermore, these studies have focused primarily on demonstrating the feasibility of detecting changes in vibration patterns caused by missing rails, rather than developing a fully functional and robust sensing system. To address these challenges, our proposed system is designed with seamless integration into existing railway monitoring infrastructure as a key consideration. By leveraging the Bangladesh Railway’s Geographic Information System (GIS) map, we can strategically deploy sensor nodes at optimal locations, considering factors such as track curvature, gradient, traffic density, and the presence of critical infrastructure. This strategic placement ensures efficient data collection and minimizes disruptions to existing railway operations. Furthermore, the collected vibration data can be analyzed in real-time and then transmitted to the approaching train. This integration allows for the timely detection of track anomalies and facilitates rapid response by railway maintenance crews. The modular design of our system enhances its compatibility with existing hardware and software components within the railway infrastructure. This modularity enables the system to be easily adapted to specific requirements, such as integrating with existing data acquisition systems, communication networks, and control systems. By leveraging existing infrastructure and minimizing the need for extensive modifications, we aim to facilitate the smooth and efficient implementation of our system within the existing operational framework of the Bangladesh Railway.

Conclusion

In developing nations, derailments frequently occur, resulting in fatalities and property damage. These incidents are often attributed to dislodged or defective rail tracks. While existing literature explores various approaches, a real-time wireless sensory system capable of detecting faulty rail tracks from actual train vibrations remains elusive. Current research is constrained by a communication range of 600 m, which may be insufficient in practical scenarios. Moreover, optimizing sensor node deployment for cost-effectiveness and minimizing derailment risk is a critical challenge.

Our work introduces a novel, low-cost sensory system designed for detecting derailments in developing nations, e.g., Bangladesh. Our extensive research includes embedded system development, then field deployment of those systems, real data acquisition with those systems, and data analysis with the help of machine learning models. Our data collection spanned over two years. We meticulously gathered extensive vibration data from incoming trains at varying distances, along with data from diverse scenarios such as pedestrian and vehicle movement on tracks and simulated strikes.

This research optimizes sensor node deployment for real-time rail track detection, balancing cost and vulnerability. We employed a multi-objective optimization framework to identify the most effective strategy. We analyzed various deployment scenarios and found adapted 1-hop communication to be the most promising. Multi-sensor fusion technique shows enhanced accuracy as well as reduces the impact of faulty sensors. The findings provide valuable insights for future research and practical implementation in railway systems.

Through rigorous analysis, we discover that aggregating sensor data through multi-sensor fusion effectively reduces noise and enhances accuracy. This approach enabled us to achieve over 95% accuracy in detecting incoming trains from a distance of 1000 m. To our knowledge, this is the first study to propose such a method for real-time train vibration sensory and detection.

Future research directions include exploring energy-harvesting solutions and cybersecurity measures to enhance the system’s sustainability and security. Additionally, developing a more comprehensive Bangladesh railway infrastructure map and accident records would facilitate the creation of even more optimized sensor node deployment strategies.