## 3 Materials and Methods
### Fault Detection and Classification  
The fault detection approach in this paper is envisioned as a binary classification problem. Two key elements in fault detection are multi-step prediction by the LSTM autoencoder and the selected features based on their importance from the feature importance analysis described in earlier segments. The multi-step-ahead prediction of a sensor signal is performed by the LSTM autoencoder, which works as a sequence-to-sequence model. Using this autoencoder model, \(n\) time steps will be predicted using the past \(m\) time step values. The autoencoder is trained with normal data following the steps listed in Algorithm 1. Once the model is trained, it is evaluated using fault observations from the sensor signals. For an input window of \(n\) time steps, the trained model will predict \(m\) time steps in the future. In the next step, these predicted data points are used to compute the features that were selected on the basis of their importance using the SHAP analysis described earlier. Utilizing the calculated features for multiple windows in the fault samples and information on the point of fault injection from the fault dataset generation step, a dataset is created that consists of only two classes: no-fault and fault. The fault class encompasses all three types of fault considered in this work. This makes fault detection a binary classification scheme that classifies the feature vector resulting from the future prediction horizon from the LSTM multi-step prediction model. The calculation and utilization of the features for the prediction horizon are necessary because of the range in the sensor signal amplitude. For example, if we consider the bias fault scenario, at the fault's location, the signal increases to a value higher than normal. Now, there may be some instances where the amplitude after the occurrence of the fault may equal or even be smaller than the maximum sensor reading observed in a sample of the sensor recordings. This has been observed in a few research papers that compare some threshold value with the multi-step predicted value to identify the occurrence of a fault. As mentioned, normal sensor recordings might acquire higher or similar values for some instances of a fault, and this reason prevents us from setting a threshold, because in such a case, some fault instances might go undetected. If the threshold is set to a higher or lower value, a normal instance might be determined as faulty. Additionally, three different types of fault are considered in this work, so it is hard to set a fixed threshold for different types of fault because fault patterns differ from each other. Once a fault is detected, the next step is fault classification, and again, ML classifiers are used. However, at this stage, it becomes a multiclass problem. Utilizing prior information about fault-injected time steps from synthetic fault data generation, another dataset is constructed in which the faults are given different labels according to their type. Therefore, this dataset contains three classes: bias, drift, and stuck faults. As a predicted horizonis detected as a fault by the preceding classifier, it is provided to the second classifier to determine the type of fault that occurred.