## 4 Damage Detection Framework
### Proposed Framework  
The damage detection framework consists of two distinct phases: the training phase (TP) and the inspection phase (IP). The TP involves the preprocessing of the training dataset, feature construction from the training dataset, the determination of the hyperparameters (number of neurons, activation function, etc. ), the training of the autoencoder model, the computation of the Mahalanobis sample mean vector and sample covariance matrix, and finally the determination of a user-defined threshold. These actions are performed offline to establish a reference baseline for damage detection with which the new points are compared. The preprocessing uses a min-max scaler in the training data, while the feature construction uses the appropriate number of samples from the time series and feeds it into the autoencoder. In the TP, the user can compute the Mahalanobis distances of the training data and hence use them to derive information to help determine the threshold. On the other hand, the IP refers to the active deployment of the trained model for real-time processing, constantly calculating the Mahalanobis distance from the provided data. The procedures of preprocessing and feature construction are repeated in this phase in the same way as in the TP. Figure 6: Time series of phase A current under healthy (black) and damaged (blue) conditions. The health condition of the structure is assessed by comparing the computed Mahalanobis distance to the user-defined threshold set during the TP. If the Mahalanobis distance is less than or equal to the threshold, the condition is categorized as healthy. Conversely, the condition is classified as damaged if the distance is higher. Overall, this framework allows for automated decision-making, and the whole procedure is presented in Figure 7. The framework is implemented in the Python scripting language, and the TensorFlow [24] open-source library is utilized to train the neural networks. The training phase was divided into four tasks. **TP Task 1: Feature Construction. ** This task generated features sensitive to damage from the preprocessed time series data, such as the phase current or voltage. A synchronized window technique selected m samples from each time series, forming a sequential feature vector with n components. **TP Task 2: Autoencoder Configuration. ** This task involved determining the input and output layer dimensions based on the feature vectors, typically including two layers between the input and bottleneck layers and between the bottleneck and output layers. Users can choose the number of neurons in these layers, following a guideline of reducing neurons from input to bottleneck and increasing from bottleneck to output. All layers except the output layer can have customizable activation functions, with the output layer using a rectified linear unit (ReLU). **TP Task 3: Mahalanobis Distance Calculation. ** This task calculates the sample mean vector and covariance using the Mahalanobis distance, which measures the dissimilarity based on the reconstruction error from a lower-dimensional error vector (k) relative to the feature vector (nxm). This distance relies on two hyperparameters, the sample mean and covariance matrix derived from k-dimensional error vectors in the training set, maintaining the framework's unsupervised nature. **TP Task 4: User-Defined Threshold. ** Users can set decision thresholds based on intuition or statistical methods, potentially using the Mahalanobis distances from the training phase. After model training, the inspection phase began with the collection of a new time series dataset matching the sample length from TP Task 1. These data were used to create a feature vector for the autoencoder's reconstruction. The statistical distance between the reconstructed and original feature vectors was evaluated to assess the health status through a decision-making framework. The inspection phase included five tasks. **IP Task 1: Data Acquisition.