## 2 Materials and Methods
### Autoencoder Anomaly Detection Model  
An autoencoder is a self-supervised learning technique with a neural network structure designed to effectively compress data into a lower-dimensional space and reconstruct it with minimized error. It is widely used for various purposes, such as dimensionality reduction, data compression, noise removal, and feature extraction [23]. By leveraging the characteristics of autoencoders, the model can learn only the non-LVSD data patterns and detect anomalies using the reconstruction errors that occur when the trained model reconstructs the input data.  
As shown in Figure 4a, the model consists of an encoder and a decoder, each containing four convolutional layers. Figure 4b illustrates the internal structure of the Conv Block and UpConv Block, which are the convolutional layers used in the model.  
At the center of the four convolutional layers in both the encoder and decoder lies the latent space. The encoder maps the input data to the latent space, extracting features from the input data and compressing high-dimensional data into low-dimensional data. The latent space refers to the low-dimensional space created after the input data passes through the encoder and is compressed. This space serves as a latent representation that captures the essential features of the input data, which is a core part of the autoencoder. The decoder's role is to reconstruct the input data from the information in the latent space, using the latent representations to reconstruct the input data.  
The usefulness of the trained autoencoder model was verified using mean squared error (MSE). This method calculates the reconstruction error between the original signal (input data) and the reconstructed signal (output data). A smaller MSE indicates a smaller difference between the input data and the reconstructed data, implying that the autoencoder more accurately reconstructs the input data. Figure 5 shows a comparison graph of the MSE distribution between non-LVSD and LVSD patients. The difference in the distribution position between the non-LVSD and the LVSD group data shows that the anomaly detection autoencoder was well-trained. This clear separation indicates that the autoencoder successfully learned to reconstruct non-LVSD ECG patterns and produced higher reconstruction errors when processing LVSD data, which differ significantly from non-LVSD training data.  
Figure 6 compares the original and autoencoder-reconstructed graphs for a single lead subject. It shows little difference between the original and reconstructed signals in the non-LVSD group, while there is a noticeable difference between the 2 signals in the LVSD group. This indicates that the autoencoder model reconstructs non-LVSD data more accurately than LVSD data, suggesting that the difference in reconstruction errors between LVSD and non-LVSD data can be effectively utilized to identify distinctive features of each signal.  
Figure 4: The architecture of the Autoencoder Anomaly Detection Model: (**a**) the structure of Conv Block and UpConv Block; (**b**) the structure of the Autoencoder Model.  
Figure 5: A comparison graph of mean squared error distribution between the original and restored version.