## 2 Methodology
### Deep Autoencoders: Latent Space Classification
 \tag{6}\]  
where \(\mathbf{h}^{(i)}(N+1\leq i\leq 2N)\) is the decoded hidden representation, \((\mathbf{W}^{(i)},\mathbf{b}^{(i)})\big{(}N+1\leq i\leq 2N)\) represent the network's weights and biases, and \(\varphi^{(i)}(N+1\leq i\leq 2N)\) are the activation functions for the decoder. The identification of anomalies, such as structural damage, with traditional autoencoders is based on the measurement of a reconstruction error between the input data, \(\mathbf{x}\), and the reconstructed output, \(\mathbf{\hat{x}}\), whenever the network has only been trained with non-anomalous data. However, this approach does not exploit the hierarchical nature of these models, which provides compact representations of the data and would allow for the detection of damage to smaller-dimension hidden spaces of the autoencoder. For the limiting case, the latent space captures the lowest-dimensional compressed space or, in other words, the main features of the input data. An exploration of the sampling points in the latent space gives insights into the distribution of the data. Latent space representations can be employed for damage detection by identifying those data points whose deviation regarding the learned patterns with healthy data is significant. In this work, unlike usual procedures, the proposed structural health indicators were directly built in the latent space of a deep autoencoder model instead of in the output layer. Figure 4: Typical architecture of a deep autoencoder. For this, a new unsupervised clustering approach based on the latent space was developed for damage monitoring purposes. Clustering is difficult to carry out in high dimensions. However, by means of the latent space, the high-dimensional impedance spectra, captured with the different PZT sensors installed on the monitored structure, can be represented in a lower-dimensional space. Each impedance observation, x, corresponding to any stage of the structure, is mapped to its latent compressed representation, z. In this way, latent representations of experimental observations of different classes are clearly delimited in a low-dimensional space. Subsequently, latent representations of new data emerging of the trained autoencoder configure a net around the learned examples from each class of the dataset. New data points with their variations are encompassed to these nets, on which a clustering or classification algorithm can be applied. By using a distance-based clustering algorithm, if a new data point is fed into the trained network, its distance to the existing cluster centers is measured to determine if it is added to a cluster or forms a new cluster representative of a new damage stage or an anomaly regarding the existing clusters. In this work, a nonspecific clustering algorithm was applied quantitatively. As will be seen in Section 3.5, only a visual analysis was performed. The preservation of the equivariance of the input data [38] through the encoding procedure is necessary for the identification process, since this allows for compressions while maintaining the similarity and dissimilarity among the classes. In this way, latent space representations of a deep autoencoder model, designed to extract the main damage-sensitive features from the impedance spectra captured with the different PZT sensors installed on the structure, are used as a preprocessing step for a subsequent clustering or classification step of the damage state of the structure.