## 2 The Proposed DCLNN Method for Failure Time Prediction
### Dynamic Time Warping  
The failure time series of escalators are different, and the raw data always have defects (such as disturbances), which are less effective when used directly in the prediction of neural networks. Considering the time delay and local similarity of the failure time series of different escalators, dynamic time warping (DTW) is introduced to pre-process before data modeling [22], and the over-sampling characteristics of data under the space defined by DTW can effectively reduce the impact of the mutated data on the accuracy of the model while increasing the data capacity and finally improve the prediction accuracy of the NN model. An intuitive example is given in Figure 2. The principles of DTW can be further explained as follows:Given two time series \(X\) and \(Y\), whose lengths are, respectively, \(|X|\) and \(|Y|\), the warping path can be given,  
\[W=w_{1},w_{2},\ldots,w_{k},\text{ where }\max(|X|,|Y|)\leq k\leq|X|+|Y| \tag{6}\]  
\[w_{k}=(i,j),\text{ where }i\text{ is the coordinate in }X\text{ and }j\text{ is the coordinate in }Y \tag{7}\]  
The warping path \(W\) must start from \(w_{1}=(1,1)\) and end with \(w_{k}=(|X|,|Y|)\) to ensure every coordinate in \(|X|\) and \(|Y|\) would be considered. Besides, the coordinate \(i\) and \(j\) in \(w(i,j)\) of the warping path must be monotonically increasing, which can be constrained by the following equation  
\[w_{k}=(i,j),w_{k+1}=(i^{\prime},j^{\prime}),i\leq i^{\prime}\leq i+1,j\leq j^{ \prime}\leq j+1 \tag{8}\]  
The warping path needs to satisfy continuity and monotonicity. According to this, Equation (8) represents the three directions that are in the next optimal path searching. This process can be shown in Figure 3. DTW always searches forward for the closest distance in three directions: Horizontal, vertical, and diagonal upward, to maintain the continuity and monotonicity.  
For the failure time of the escalator, such a warping path in DTW is physically meaningful. No new values will be added to the original data after DTW with the reference time series.  
Finally, the wanted warping path is the shortest path in all possible warping paths  
\[D(i,j)=Dist(i,j)+\min[D(i-1,j),D(i,j-1),D(i-1,j-1)] \tag{9}\]  
DTW is a typical optimization problem. It uses a time warping function that satisfies certain conditions to describe the time correspondence between the test template and the reference template,  
Figure 3: Diagram of dynamic time warping.  
Figure 2: Potential searching directions.  
and solves the warping function corresponding to the minimum cumulative distance when the two templates match. In addition, the constraint here is the search direction shown in Figure 3[26], DTW always searches forward for its nearest distance from three directions: Horizontal direction, vertical direction, and diagonal upward direction. These three directions are consistent with the basic law of the failure time series: (i) The horizontal direction indicates the same failure time; (ii) the vertical direction indicates sudden failure; (iii) the diagonal line indicates the stable development direction of the failure time. It is this constraint that allows the warping time series to learn the inherent failure development information of 'good data' while maintaining the original basic physical meaning of itself. Meanwhile, for short time series prediction, DTW can increase the sample capacity for its oversampling characteristics, especially to increase the sample capacity where the data are abrupt, so that the modeling of the disturbance in the neural network can obtain more attention to reduce the influence of disturbance to the whole data model.