# Research on Distributed Fault Diagnosis Model of Elevator Based on PCA-LSTM
## 2 PCA-LSTM Based Fault Prediction Model
### Long Short-Term Memory's Introduction to Neural Networks (LSTM)  
The Long Short-Term Memory Neural Network (LSTM) represents an advancement over the traditional Recurrent Neural Network (RNN) architecture, and it is specifically engineered to overcome the challenges of vanishing and exploding gradients that are  
Figure 1: Proportion of variance explained by principal components in elevator experiment data, justifying the 85% threshold. commonly encountered when training RNNs with long sequence data. By incorporating memory cells that enable the retention and manipulation of information over extended sequences, LSTMs provide a more robust framework for capturing temporal dependencies without losing significant gradients throughout the learning process. A key enhancement in LSTM is the addition of three control gates based on the RNN architecture: the input gate, output gate, and forget gate. The overall structure of the LSTM is illustrated in Figure 2.  
Regarding the configuration of the Long Short-Term Memory (LSTM) network, we designed the network architecture to align with the time series characteristics of the elevator fault data. Given the time dependency and periodic variations in the elevator data, we opted for a two-layer LSTM structure to enhance the model's learning capability. Each layer contains 100 neurons, a number that was determined through testing various model capacities and that demonstrated optimal performance in fault diagnosis. Furthermore, to address potential nonlinear relationships and complex temporal dynamics, we conducted a detailed hyperparameter tuning of the LSTM model. This included selecting the learning rate (initially set to 0.001) and implementing a gradual decay strategy to optimize the training process. This choice of network parameters ensures the model's ability to capture complex patterns within the elevator fault data while avoiding overfitting and ensuring the generalizability of the model. The retention of the state from the previous moment to the current cell state is controlled via the forget gate. The forget gate filters the memory content and decides whether the stored data should be retained or discarded. Its computation is as follows:  
\[f_{t}=\sigma\left(W_{xf}x_{t}+W_{hf}h_{t-1}+b_{f}\right) \tag{11}\]  
In the equation, \(f_{t}\) is the output of the forget gate, \(\sigma\) is the activation function, which is chosen as the Sigmoid function, which outputs a range between 0 and 1, used to represent the degree of openness of the gate. \(W_{xf}\) is the weight matrix between the current input and the forget gate, \(x_{t}\) is the current input state, \(W_{hf}\) is the weight matrix between the historical output and the forget gate, \(h_{t-1}\) is the output state of the previous moment, and \(b_{f}\) is the bias term for the forget gate. The input gate is used to update the cell state, determining whether the cell can remember new information. The state of the previous moment and the current input information are fed into the activation function, yielding an output value between 0 and 1. This output decides the update of information. A value of 0 indicates unimportance, while 1 indicates importance. The state of the previous moment and the current input information from the previous step are also processed using the tanh function. The information is  
Figure 2: Structure of the LSTM. compressed between \(-1\) and \(1\), yielding the candidate cell state. The output of the input gate is as follows:  
\[i_{t}=\sigma(W_{xi}x_{t}+W_{hi}h_{t-1}+b_{i}) \tag{12}\]  
In the equation, \(i_{t}\) is the output of the input gate, \(W_{xi}\) is the weight matrix between the input and the input gate, \(W_{hi}\) is the weight matrix between the historical output and the input gate, and \(b_{i}\) is the bias term for the input gate.