Abstract

Turnout equipment is a key component to ensure the safe operation of trains. How to identify turnout faults is one of the important tasks of railway engineering departments and electrical departments. We used machine learning algorithm to analyze the similarity of mechanical characteristic data during turnout actions and then realized the intelligent diagnosis of turnout faults under the background of big data. We segmented the mechanical motion curve according to the characteristics of the original curve, calculated the similarity between the motion curve to be diagnosed and the template motion curve through the improved fast dynamic time warping algorithm (FastDTW), and diagnosed the fault according to the dynamically determined optimal threshold. Experiments show that the algorithm for predicting turnout faults based on improved FastDTW and time series segmentation algorithm is an accurate and effective method, which can improve the key technology of intelligent monitoring, early warning of the whole process of turnout movement, and more detailed analysis of the motion curve for the railway department.

1. Introduction

The reliability of railway infrastructure is facing severe challenges due to the continuous increase in the number of railway operating lines, operating speed, and traffic density, as well as the rapid growth of freight and passenger traffic. According to the “2020 Railway Statistical Bulletin” issued by the National Railway Administration, even under the severe situation of the new crown epidemic, railway passenger transportation recovered steadily and freight maintained growth in 2020, reaching 2.203 billion and 4.552 billion tons, respectively. On the existing railway infrastructure, this leads to higher carrying loads and the possibility of failure.

As one of the important railway electrical infrastructure, turnout is used to change the trajectory of trains from one line to another. Turnout equipment is a key component to ensure the safe operation of trains. Due to factors such as installation, the external environment (temperature, rain, snow, and foreign objects), and wear and tear, the equipment may not operate properly and even pose a threat to driving safety. According to statistics, the faults caused by turnout account for about 50% of the total equipment faults every year. Therefore, the primary task of relevant railway departments is to conduct intelligent diagnosis and early warning of railway turnout faults to reduce the operation and maintenance costs while maintaining the safety of the turnout equipment. At present, the staff at the railway site mainly rely on manual analysis of the electrical characteristic data of the turnout to judge the hidden danger of the turnout and deal with the fault of the turnout. The methods are relatively simple and intelligence is urgently needed.

In the aspect of turnout fault diagnosis, Yao et al. proposed a fault diagnosis method based on an improved deep forest and constructed a multilevel fault diagnosis system to classify the indistinguishable subsets of faults using case-based reasoning [1]. Guang et al. used Bayesian networks to evaluate the impact of weather on railway turnout, dispersed weather-related variables by minimizing entropy, and used causal noise models to improve the ability to train models on small data sets [2]. Shize et al. analyzed the action mechanism of a certain kind of turnout, establishing a turnout action model to simulate the operating current curve of turnout. Then, they used a large number of generated samples to train a turnout fault diagnosis model based on convolutional neural network (CNN), which can effectively identify faults based on curve pictures in various formats [3]. Wei et al. proposed a deep learning-based joint learning method for mechanical fault diagnosis. The model was locally trained on different clients. There was only model communication between the server and the client, instead of sharing private data. The method leveraged knowledge learned from multiple client data while maintaining data privacy [4]. Then, they proposed a general DA method for mechanical fault diagnosis problems, employing a deep adversarial learning scheme to bridge the domain gap under different operating conditions [5]. Analysis of the existing research shows that the monitoring data of the turnout in the actual operation process, such as operating current, have very few fault samples. The existing deep learning algorithms generally have problems such as insufficient number of samples and high model training time complexity. Moreover, most of the existing research methods for turnout fault diagnosis are aimed at the electrical characteristic data of the turnout, and there is no research on the mechanical characteristic data of the turnout.

The switch machine of turnout is mainly maintained by the railway electrical department. At present, systems such as signal centralized monitoring and switch gap monitoring are generally used to monitor the electrical characteristics and working status of the switch machine. Among them, the centralized signal monitoring system only indirectly reflects the working state of the switch through the electrical characteristics of the switch machine (operating current curve) and lacks the monitoring of the key mechanical components of the switch. Turnout gap monitoring only monitors the gap size of the indicator rod in the switch machine and detects the result of the turnout action, and it cannot directly reflect the entire process of the turnout action. Gap monitoring adopts the method of video monitoring, which has insurmountable defects such as lens, illuminance, and flatness, the measurement accuracy is unstable, the installation is complicated, and the construction and maintenance are inconvenient. At present, the on-site personnel mainly rely on manual analysis of the switch current curve (electrical characteristic data) to judge the hidden danger of the switch and deal with the fault of the switch. The method is relatively simple, and the application of the mechanical characteristic data of the switch has no precedent. The railway track maintenance department is responsible for the maintenance of the infrastructure parts such as the basic rail and the tip rail of the turnout. At present, the high-speed railway public works infrastructure condition detection and monitoring system are generally used to dynamically detect the tracking status, rail status, roadbed status, crossings, etc. However, there is still a lack of monitoring functions for the position of the track bed and the crawling of the switch rail. Therefore, it is necessary to study the key technologies of monitoring and early warning of the mechanical characteristic data of the whole turnout action. This is conducive to comprehensive diagnosis and early warning analysis of turnouts, providing support for state repair and preventive repair of turnout equipment and providing a basis for joint analysis by the track maintenance department and the electrical department.

Based on this, this paper collects the data of the whole operation condition of the switch machine of turnout(whose types include ZD6 and S700K), including parameters such as the stroke of the friction connector, the stroke of the indicating rod, the vibration acceleration of the switch machine, and the inclination of the base direction. We improved the fast dynamic time warping algorithm (FastDTW), and used early eliminating FastDTW algorithm (EE-FastDTW), to analyze the changing trend of the speed curve of the switch machine, and studied the typical fault judgment method of the switch machine under big data, extracting and verifying the alarm threshold of the switch machine motion curve when the fault occurs. This method has higher computing performance and interpretability and is more suitable for the needs of practical work.

2. Dynamic Time Warping (DTW)

2.1. Dynamic Time Warping (DTW) Algorithm

Dynamic time warping (DTW) is one of the commonly used methods to measure the similarity of two time series. The basic idea of DTW is to find the best global alignment by extending and shortening two time series and then calculate the degree of similarity between them [6]. As shown in Figure 1, there are two solid lines representing time series A and time series B, in which the similar points are connected by dashed lines. DTW uses the sum of the distances between all similar points, that is, warp path distance, to measure the similarity between two time series.

Set the time serieswhere m and n are the lengths of time series A and B, respectively.

Warp path distance:where i represents the point i in A and j represents the point j in B.

It adopted the idea of dynamic programming to search for the warp path with the shortest distance, as shown in Figure 2.where D(i,j) represents the warp path distance between two time series with lengths i and j; d(i,j) represents the distance between the ith point in A and the jth point in B (we used Euclidean distance in this article).

Finally, the warp path distance is

2.2. Fast Dynamic Time Warping (FastDTW) Algorithm

Traditional DTW has O(n2) complexity, so it is very time-consuming to run on large datasets [7]. Therefore, we used FastDTW algorithm that improves on the traditional DTW, which performs well under O(n) complexity. FastDTW algorithm uses three steps of coarsening, projecting, and refining to speed up the search of the warp path.

2.2.1. Coarsening

It continuously reduces the time series to a series with half the original length, in which the coarsened data point is the average of its corresponding 2 refined data points.

2.2.2. Projecting

Find the warp path with the smallest distance under the previous condition.

2.2.3. Refining

It restores the time series to a series of two-times length and locally adjusts the warp path projected under the conditions of the previous step on this sequence.

FastDTW algorithm uses a multilevel bipartite graph algorithm to divide a graph into as small graph as possible. This multilevel method is used to find the best solution for each small graph. Due to the strategy of reducing the search space, FastDTW may not be able to obtain an accurate DTW distance. Therefore, when the refinement is performed, the R granularity can be expanded outward in a finer space to perform a more detailed search. The larger the R, the more accurate the warp path is obtained, but the complexity will also increase.

2.3. Fast Dynamic Time Warping Algorithm Based on Early Elimination (EE-FastDTW)

DTW finds warping paths through dynamic programming, and the time complexity is O(mn). When the length of the time series is long, the efficiency of the algorithm is very low. Usually, the way to speed up DTW is to limit the path search range, data abstraction, indexing, etc. FastDTW adopts the method of limiting the path search range and data abstraction to accelerate DTW, which is an improved algorithm that reduces the time complexity of DTW. FastDTW can find an approximately optimal twisted path between two time series, the time-consuming increases linearly with the input time series, and the time complexity is about O(n).

The principle of the early eliminating algorithm is relatively simple and easy to understand. It is also improved by further restricting the search range of paths. Its core idea is, in the calculation of the DTW distance in each loop, if the difference ds_ij between the two points to be calculated is greater than the set judgment value, then the corresponding relationship of this pair of points is excluded in advance in the global search so that they will not participate in subsequent calculations. After that, this calculation is stopped and the distance calculation for the next pair of points is started. According to this principle, the effect of saving computing time can be achieved. This method does not need to calculate the cumulative distance of all cells within the search radius when calculating the FastDTW matrix, through which to further reduce the computational cost of the FastDTW algorithm.

An example is used to further illustrate the role early eliminating plays in FastDTW. Figure 3 is the distance matrix between two time series A and B. The FastDTW search range (radius r = 1) is shown in gray, and the value in each cell corresponds to the difference between each pair of data points (Euclidean distance is chosen to calculate in this article).

Assume that the value of the early eliminating judgment val is 30. Since ds(2,1), ds(3,1), ds(4,1), ds(6,2), ds(7,3), and ds(5,5) are all greater than val, these cells are excluded. That is, they do not participate in the calculation of all subsequent FastDTW cumulative distance matrices. After eliminating, the part that needs to be calculated in the cumulative distance matrix of FastDTW is shown in the gray part in Figure 4.

The specific improvement process of FastDTW based on early eliminating is shown in Algorithm 2.

(i)Input: time series A and B, search radius r,and value of the early eliminating judgment val
(ii)Output: warp path path and warp path distance dist
(1) function EE-DTW(A, B, and val)
(2)  l_A←length(A)
(3)  l_B←length(B)
(4)  D←Matrix(l_A, l_B)//initialize the DTW cumulative distance matrixand let the initial value of all elements be equal to 0
(5)  D[0, 0]←euclidean_distance(A[0], B[0])//use Euclidean distance to calculate the difference between two points
(6)  for i = 1 ⟶ i = l_A do//calculate the DTW distance of the bottom row
(7)   D[i, 0]←D[i-1, 0]+euclidean_distance(A[i], B[0])
(8)  end for
(9) for j = 1 ⟶ j = l_A do//calculate the DTW distance of the leftmost column
(10)   D[0, j]←D[0, j-1]+euclidean_distance(A[0], B[j])
(11)  end for
(12) for i = 1 ⟶ i = l_A do//calculate the remaining DTW distance
(13)   for j = 1 ⟶ j = l_B do
(14)    ds(i, j)←euclidean_distance(A[i], B[j])
(15)    if ds(i,j) > val then
(16)     eliminating((i, j))
(17)     continue//eliminate the point (i, j), jump out of this loop
(18)     end if
(19)     D[i, j]←ds(i, j)+min(D[i-1, j], D[i, j-1], D[i-1, j-1])
(20)    end for
(21)  end for
(22)  (path, dist)←searching on D
(23)  return path and dist
(24) end function
(25) function EE-FastDTW(A, B, r, value)
(26)  while length(A)> r+1 or length(B)> r+1 do
(27)  lp_A←sampling(A)//continuously sample seriesand get low-precision series
(28)  lp_B←sampling(B)
(29)  end while;
(30)  pathand dist = DTW(lp_A,lp_B)//obtain DTW path and distance under low precision
(31)  while hp_A ! = A do//resume the series
(32)   hp_A←restoring(lp_A)
(33)   hp_B←restoring(lp_B)
(34)   (path, dist)←EE-DTW(hp_A, hp_B, value)
(35)  //Search DTW path and distance within the radius r
(36)  end while
(37)  return pathand dist
(38) end function

3. Intelligent Diagnosis of Turnout Fault Based on EE-FastDTW

3.1. Mechanical Motion Curve of Turnout Switch Machine

The mechanical structure of the turnout is complex, the operating conditions are special, and it has a great impact on the line operation and driving safety. Therefore, it has become one of the most vulnerable assets and the key monitoring and maintenance object of the railway. Switch machine is mainly maintained by railway electrical departments. At present, centralized signal monitoring and switch gap monitoring systems are generally used to monitor the electrical characteristics and working status of the switch machines. In the signal centralized monitoring system, the switch machine electrical characteristic (action current curve) is used to reflect the working status of the turnout indirectly. The switch gap monitoring only monitors the gap size of the lever in the switch machine. It detects the result of the switch action and does not directly reflect the entire process of the switch action. The study of the action process of the switch machine has certain reference significance for fault diagnosis, which is conducive to the comprehensive diagnosis and early warning analysis of turnout and provides help for the state repair and preventive repair of the turnout equipment [1].

The mechanical motion curve of the turnout switch machine includes the main lever motion curve, the auxiliary lever motion curve, and the friction coupler motion curve. We mainly studied the main lever motion curve and used the switch motion distance data to generate the speed curve for analysis. We chose the normal mechanical motion curves collected from different switch equipment on the railway sites as the standard curves. If there is a big difference between the curve to be tested and the template curve, it indicates that the equipment is very likely to have a fault during this operation, so that the fault diagnosis of the turnout can be realized. Figure 3 shows the mechanical motion curve of the switch machine. The forward and reverse motion curves are similar. We took the forward direction as an example for research.

In Figure 5, it can be seen that the speed curve of the turnout starts from the unlocking action, and the change is more complicated during the switching action. After a period of obvious jitter, it enters a short nonprocess run, followed by a relatively smooth continuous variable motion. Finally, the speed drops rapidly during the locking action. The above description exactly corresponds to the three actions of turnout unlocking, switching, and locking, which accurately reflects the movement process of the turnout. We only described in detail the steps of the fault diagnosis method for the forward turnout motion curve. The fault diagnosis method for the reverse turnout motion curve is similar, so we did not go into details here.

3.2. Generating Velocity Curve

We sampled the railway turnout equipment at an interval of 40 ms to obtain real turnout operating condition data, and the time of each data is mainly concentrated in 5–6s.

Since the main lever motion curve in the original data only contains the motion distance curve, the first-order derivative of the distance curve is required to obtain the velocity curve.

3.3. Time Series Segmentation

Due to the instability and nonuniqueness of the whole process of the switch movement, the mechanical movement data of the switch machine are different at different moments on different devices of the same model, or even on the same device under normal working conditions. The main performance of the difference is the translation in the time domain. More importantly, for an action record data, the data of each period usually correspond to the different actual movement states of the monitored turnout in one movement. In intelligent turnout diagnosis, it is necessary to segment this type of time series to mine the internal information of the data [8]. Time series data segmentation method is beneficial to the railway field staff to compare and analyze the mechanical characteristic curve of the turnout in a more detailed manner.

We used a segmentation algorithm with a fixed number of segments in a time series based on important points in the series, referring to the idea of binary tree level traversal [9]. We determined the order of segmentation according to the linear fitting error, extracted important data points under a given number of segments, and quickly realized the segmentation of the time series [10].

The parameter setting of this method is relatively simple, and the time complexity is not high. The visualization effect of the time series data set is good, and the main characteristics of the time series can be accurately described. This method divides the number of segment points more accurately, thus making the adjustment more flexible. At the same time, it can more accurately reflect the overall characteristics of the time series curve, greatly improve the segmentation efficiency, and facilitate a more detailed analysis of the motion curve of the switch machine.

3.3.1. Important Points in the Series

Important point is the turning point where the trend of the time series changes. The changing trends of the time series on both sides of the important points are significantly different, and the changing trends of the time series located between two adjacent important points are the same or roughly similar. Therefore, the important points can be regarded as the nodes of the time series segmentation .

We used the following two factors to search for and measure the importance of a point.(1)After a round of segmentation, the linear fitting error of the time series segment where the point is located (for the first search and segmentation, the original time series is used as the initial segment),(2)The difference d between this point and its corresponding position on the linear fitting line of time series segment on which the point is located, as is shown in Figure 6.Specifically,

Among them, (x1,y1), (xi,yi), and (xk,yk) are the coordinates of the starting point, the point to be calculated, and the end point of one search, respectively.

The larger the error, the greater the volatility and the higher the priority of the time-series segment; the smaller the error, the smaller the volatility of the time-series segment, and it can be placed at the back of the queue for later search. The larger the d, the greater the possibility that this point will serve may be, and the less likely it will be the turning as a turning point in the time series trend; the smaller the d, the more gradual the change of this point in the time series trend.

3.3.2. Time Series Segmentation Algorithm Based on Important Points

Because the duration of each action of the switch is not exactly equal and the duration of each set of real data is not exactly equal. To ensure the correct match between the time series of the curve to be diagnosed and the template curve, the real data, each of which contains between 125 and 150 collection points, were further subdivided, so as to clarify the moment of the fault occurrence and to provide a more detailed basis for the analysis after the fault occurs. The segmentation process of the fixed segment number of time series is as follows:(1)Set time seriesSet a queue Q to temporarily store those points that need to be checked.First of all, x1 to xm was searched. Under the initial condition, that is, when the queue Q to be checked was empty, the indices of x1 and xm were assigned to the start point and end point in Q. The point to be segmented segpoint with the largest d was obtained by the measurement method of the important points.(2)The sum of squares of residuals after linear fitting of the time series searched in the previous step was checked whether it was greater than the predetermined error value e. If the conditions were not met, the search was over. If the conditions were met, segpoint was added to the important point set P. At segpoint, the searched series was divided into two new series, and the two new series were sorted according to the value of the fitting error in descending order and then put into queue Q.(3)The length of the important points set was checked to whether it reached the number of segments given in advance. If it was satisfied, the search was ended, and the important points set P and the series after the segmentation were output. If not, the next series to be checked will be searched in Q.

Step 2 and Step 3 were repeated until the conditions for the number of segments were met or all point pairs in the entire queue Q to be checked had been traversed. At this point, the segmentation process was complete.

The specific algorithm is described as follows.

Input: time series X,fitting error value e,and number of segments number
Output: important points collection of time series P
(1) function SEGMENTATION(X,e,k)
(2)  It Queue(Q)//initialize the queue to be checked, which follows the first-in first-out principle
(3)  in Queue(stapoint, endpoint)//start point stapoint and end point enter the Q
(4)  while Q is not null and length (FPIP) < number-1 do
(5)   (stapoint, endpoint)←out Queue()//take out the series to be tested
(6)   (segpoint, error)←calculate pip(stapoint, endpoint)
(7)  //calculate the farthest point segpoint that deviates from the linear fitting of the series to be tested, and then return the regression coefficient error
(8)    if error > e then//continue to segment series with poor fitting result
(9)    P←segpoint//important point joins the collection
(10)(Left_err,Right_err)←calculate error (stapoint, segpoint,endpoint)
(11)//calculate the regression coefficients of the subseries on both sides of important point
(12)    if Left_err >Right_err then
(13)     In Queue (stapoint,segpoint)
(14)     InQueue(segpoint,endpoint)
(15)    else
(16)     InQueue(segpoint,endpoint)
(17)     InQueue( stapoint,segpoint)
(18)    end if
(19)   end if
(20)  end while
(21)  return P
(22) end function

Standard speed curve S, speed curve to be tested T were knownwhere m and n are the lengths of S and T, respectively.

First, we found the index set SP of the important points of the template speed curve. We set the number of segments k = 4, and divided S into 4 series

Similarly, we found the index set T-P of the important points of the speed curve to be detected, set the number of segments k = 4 and divided T into 4 series

3.4. Fault Judgment Based on EE-FastDTW
3.4.1. Warp Path and Distance Calculation

The segments S and T can be expressed as

The warp path and distance between the speed curve to be diagnosed and the standard speed curve can be obtained by using EE-FastDTW algorithm. We give a detailed description of the fault diagnosis steps for the forward mechanical movement of the turnout:(i)Coarsening: keep reducing the dimension of standard speed curve and speed curve to be tested(ii)Projection: search for a warp path between the changed series(iii)Refinement: restore the dimension of the series on the path obtained in the previous step, and search for a warp path within the specified radius (in this paper, R = 2)

Repeat Step (iii) continuously to obtain the regular path distances dist1, dist2, dist3, and dist4 between S1 and T1, S2 and T2, S3 and T3, and S4 and T4.

Due to the different time lengths of the switching process of each action of the turnout, there are differences in the multiple data sampling lengths of the action curve obtained by the actual monitoring, which leads to the fact that even if there is no fault in different turnouts of the same model, the distance difference of the warping path obtained by the algorithm is relatively larger. It will reduce the effectiveness of the threshold and increase the difficulty of determining the threshold. In order to reduce the impact of the difference in data length on the results and thereby reduce the difficulty of determining the threshold, we averaged the distance, and finally got the warp path distance between S and T:where L is the number of data points of the motion curve to be tested.

3.4.2. Selection of Alarm Threshold

The warp path distance indicates the degree of difference between the curve to be tested and the standard curve. The smaller the distance, the higher the similarity of the two curves, and the larger the distance, the lower the similarity of the two curves. Therefore, by setting the threshold of the regular path distance, the health status of the turnout can be judged intelligently.

When the distance is greater than the threshold, it means that the turnout has a fault and requires early warning. When the distance is less than the threshold, it means that the turnout is operating normally.

4. Results and Analysis

We conducted experiments on 151 pieces of real data (whose types include ZD6 and S700 K) sampled at 40 ms intervals. The collected data are all the data of the turnout during normal operation, and a template curve is randomly selected from each model as the standard for judging whether the switch was faulty. According to the method described above, each curve is divided. A certain curve after segmentation is shown in Figure 7. Mainly, based on early eliminating FastDTW, we analyzed the warp path distance between the normal motion curve and the template motion curve of different types of turnouts, as shown in Figure 8. It can be seen from Figure 8 that the warp path distance is mainly concentrated between 0.5 and 4.0 mm/s, so we set threshold value to 4.1 mm/s.

Table 1 shows the comparison of the accuracy and running time of the DTW-based turnout fault diagnosis algorithm (TFD-DTW) and the early eliminating g FastDTW-based turnout fault diagnosis algorithm (TFD-EEFastDTW).

Through the calculation results, it can be seen that the use of the FastDTW-based intelligent diagnosis algorithm for railway turnout equipment can improve the operation efficiency while maintaining the prediction accuracy.

In addition, due to the different types of turnout equipment, the degree of employment and operating environment of even the same type of equipment is also different, resulting in differences in the best diagnostic thresholds for different turnouts. Therefore, in future research, it is necessary to conduct experiments on different devices to determine different optimal thresholds to achieve dynamic adjustment of the thresholds.

5. Conclusion

Aiming at the problem of railway turnout fault diagnosis, we took the mechanical movement data of the switch machine during the operation of turnout as input, and intelligently diagnosed the operating status of turnout through artificial intelligence algorithms such as dynamic programming and supervised learning. Experiments show that the FastDTW-based fault diagnosis algorithm and the DTW-based fault diagnosis algorithm have little difference in accuracy, but the former is better in terms of time efficiency. Therefore, in the context of big data, the FastDTW-based fault diagnosis algorithm is more suitable for the intelligent diagnosis of turnout with large data volume and higher requirements for efficiency.

In addition, without a large amount of sample data, our method can still efficiently and correctly diagnose the health status of turnout and has a wider range of applications. Due to the small number of fault data in our data set, it is also necessary to verify whether the dynamic threshold determined by the method in this paper is suitable for turnout equipment with different operating states. The determination of the specific fault type of turnout is also the direction of future research.

Data Availability

The original data of this article are nonpublic data provided by the China Academy of Railway Sciences.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This research was supported by the open project fund of The Center of National Railway Intelligent Transportation System Engineering and Technology (Contract no. RITS2021KF07), the China Academy of Railway Sciences. This research was also supported by the National Natural Science Foundation of China General Projects (Grant no. 61672002).