# Cumulative Failure Rate Prediction of EDCU in Subway Vehicles Based on RF-CNN-LSTM Model
## 2 Basic Theory
### Introduction to CNN Principles
#### 2.2.2 CNN Section  
The CNN model in this paper mainly extracts the local features of the data and reduces data dimensionality through multi-layer convolution and pooling.  
Convolutional Layers  
The convolution operation is performed by multiplying each element of the convolution kernel with the corresponding region of the input data and then summing up these products to obtain the value of the corresponding position on the output feature map. The convolution operation can be visualized as the kernel sliding over the input data and performing a weighted sum operation at each position to generate a pixel value for the output feature map. This process is repeated over the entire input data until all positions are covered, ultimately generating the complete output feature map. The formula is as follows:  
\[(W*X)[i,j]=m\sum n\sum W[m,n]\cdot X[i+m,j+n] \tag{2}\]  
where \(W\) is the convolution kernel, \(X\) is the input data, \((W*X)[i,j]\) denotes the pixel value at position \((i,j)\) on the output feature map (i.e., the result of the convolution operation), \(W[m,n]\) denotes the weight of the convolution kernel \(W\) at position \((m,n)\), \(X[i+m,j+n]\) denotes the pixel value of the input data \(X\) at position \((i+m,j+n)\), \(m\) and \(n\) are the indexes of the convolution kernel throughout all positions of the convolution kernel, andand \(j\) are the indexes of the output feature map, indicating the output position currently being calculated.  
After each convolutional layer, an activation function is also introduced to provide nonlinear features to the data. The formula is as follows:  
\[f(x)=max(0,x) \tag{3}\]  
where \(x\) denotes the input value of the activation function, usually the sum of the weighted input and bias of a neuron.  
Pooling Layer  
MaxPooling is a downsampling technique used to reduce the size of the feature map while retaining the most important features. It mainly consists of three parts: dividing the region, taking the maximum value, and generating a new matrix. Dividing the region is to divide the input matrix X into multiple non-overlapping regions (pooling windows) of pool size; taking the maximum value is to take the maximum value of all the elements of each pooling window as the pooled value; generating a new matrix is to combine the maximum values of all the pooling windows into a new matrix, i.e., the pooled matrix, which is the matrix after pooling. The formula is as follows:  
\[MaxPool(X)[i,j]=m,n\in poolsizemaxX[i+m,j+n] \tag{4}\]  
where \(MaxPool(X)[i,j]\) denotes the value of the element located at position (\(i\), \(j\)) after applying the maximum pooling operation on the input matrix \(X\), \(X\) denotes the input matrix that usually denotes the feature or activation maps, \(i\) and \(j\) are the rows and columns indexes of the matrix after pooling; and \(m\) and \(n\) are the row and column offsets within the pooling window.  
By pooling the data, the feature dimensions can be reduced, reducing the amount of computation and the number of parameters while retaining important features and increasing the model generalization capability.