# Deep Autoencoder Framework for Classifying Damage Mechanisms in Repaired CFRP
## 2 Materials and Methods
### Methods
#### 2.2.2 Deep Autoencoder (DAE)
[PERSON] and [PERSON] showed that the reconstruction quality of an autoencoder can help determine the optimal bottleneck size [42]. [PERSON] emphasized the importance of maintaining data quality during dimensionality reduction [43], and [PERSON] et al. demonstrated how compact bottleneck representations improve feature robustness and interpretation [44]. The model then transitions into an expansion phase, where neuron counts increase from 128 to 425 across three layers, each with a ReLU activation, reconstructing the data around the compressed features from the bottleneck. The final layer, with 715 neurons, produces the regression output. The output dimensions match the input, illustrating the network's ability to handle complex regression tasks, including compression and expansion. Hyperparameters such as the number of layers, activation functions, and learning rates were fine-tuned using grid search to optimize reconstruction accuracy and clustering performance, further validating the chosen architecture. \begin{table}
\begin{tabular}{c c} \hline \hline
**Layers** & **Descriptions** \\ \hline Input Layer & 5120 \(\times\) 715 \\ \hline Fully Connected Layer 1 & 425 units \\  & ReLu layer \\ \hline Fully Connected Layer 2 & 256 units \\  & ReLu layer \\ \hline Fully Connected Layer 3 & 128 units \\  & ReLu layer \\ \hline Fully Connected Layer 4 & 4 units \\  & ReLu layer (latent features) \\ \hline Fully Connected Layer 5 & 128 units \\  & ReLu layer (reshape) \\ \hline Fully Connected Layer 6 & 256 units \\  & ReLu layer \\ \hline Fully Connected Layer 7 & 425 units \\  & ReLu layer \\ \hline Fully Connected Layer 8 & 715 units \\  & Regression layer \\ \hline Output & 5120 \(\times\) 715 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Configuration of the deep autoencoder model. The encoding process effectively transforms the input, denoted as \(z^{(l-1)}\), into a compact hidden representation \(z^{(l)}\), and this process can be expressed as follows:  
\[z^{(l)}=\alpha_{1}(b+Wz^{(l-1)}), \tag{1}\]  
In Equation (1), \(\alpha_{1}\) is the activation function of the rectified linear unit (ReLu) that represents the nonlinear mapping between the input \(z^{(l-1)}\) and the output \(z^{(l)}\), from the input layer to the fourth layer, with \(w\) as the weight matrix and \(b\) as the bias vector, respectively. The dimensionality of inputs decreases in proportion to the number of neurons in the bottleneck hidden layer, where the dominant features that represent information content in the input data are automatically extracted [45]. Subsequently, the decoder utilizes the bottleneck hidden layer to reconstruct the initial input through mapping by the activation function Relu \(\alpha_{2}\). \[\hat{x}^{(l)}=\alpha_{2}(\hat{b}+\hat{W}\hat{z}^{(l-1)}), \tag{2}\]  
where \(\hat{x}^{(l)}\) and \(\hat{z}^{(l-1)}\) are the output and input from the fourth layer to the eighth layer in the decoder network, and its parameters include the weight matrix \(\hat{w}\) and offset vector \(\hat{b}\). Consider a scenario in which we have raw data \(X\in\mathbb{R}^{N\times n}\), where each row \(x_{i}\) represents an individual sample within a collection of samples. In the training process, the root mean squared error (RMSE) metric is used for a given collection \(x_{i}\) containing \(n\) data points. The primary objective of the loss function is to minimize the discrepancy between the reconstructed output \(\hat{x}_{i}\) and the original input \(x_{i}\). \[L_{RMSE}=\sqrt{\frac{1}{N}\sum_{i=1}^{N}\big{|}\big{|}x_{i}-\hat{x}_{i}\big{|} \big{|}^{2}_{2}}, \tag{3}\]  
With \(\hat{x}_{i}\) is the \(i\)-th reconstructed sample. The latent feature from the bottleneck layer is used for classifying the damage modes. This process is explained in detail in the subsequent sections.