## 3 Methodology
### Model Description
Furthermore, it uses a latent space of 16 dimensions as a reflection of compressed representation in seismic data. Finally, we extract the embeddings from the encoder by using the trained model to predict the compressed features for each data point. These embeddings now represent the seismic data compactly, keeping only the most salient information and removing the noise. This stage is critical for reducing the size of the feature space and boosting computational efficiency and the capability of the model to learn robust patterns from the data. We employed t-SNE visualization (Figure 4), which reveals unambiguous clustering of latent representations associated with label categories. This suggests that the compressed features represent significant, organized patterns connected to the underlying data. The t-SNE figure illustrates discrete clusters within the latent space, with the color denoting the value of the 'Label' column. The disparity between high and low label values from dark purple to yellow demonstrates that the model's learned latent characteristics are meaningfully ordered and associated with the labels. Therefore, this gives weight to the hypothesis that the latent space includes essential, discriminative information. The autoencoder-based model innovatively handles the challenge of traditional models that struggle with imbalanced datasets by learning a compact, 16-dimensional latent representation that captures key properties for liquefaction detection without being biased toward more prevalent soil conditions. Then, the generated embeddings from the autoencoder are fed as input for the next stacked classification model architecture, which includes an MLP classifier and an XGB classifier. The above base models capture intricate relations and patternsassociated with liquefaction, even on imbalanced datasets. Consequently, the last meta-model also became another MLP classifier that combines the base model predictions in a wise balance between rare cases of liquefaction events. The goal of this stacking approach is to facilitate higher detection accuracy by combining several algorithms' capabilities to improve effectiveness in finding odd events that might have been missed by individual models. With the extracted embeddings, we start the classification stage with the aim of mitigating the class imbalance inherent in seismic datasets. In this direction, we employed a stacking ensemble that combines several base models for improved prediction. We combined Multi-Layer Perceptron (MLP) and XGBoost (XGB) classifiers. These base models make predictions used as inputs to feed into the final meta-model, which is an MLP, to yield the final prediction. The stacking approach allows a model to combine the strengths of an MLP for the modeling of complex nonlinear relationships with those of XGBoost for structured data with imbalances. Another strategy is to assign class weights that penalize misclassifications of under-represented classes during training. The weight puts more importance on correctly predicting instances from the minority class, consequently turning out a model that is much fairer and more accurate. Figure 3: Autoencoder embedding architecture. Then, we evaluated different performance metrics of the proposed stacked ensemble model on imbalanced datasets. These metrics provide insight into a model's ability to discriminate between classes. We also trained a single, separate MLP model for benchmarking purposes. By taking its results and comparing them to the performance of the stacked ensemble model, we were able to measure the increase in performance. Thus, the flowchart encapsulates a sophisticated, multi-step process of seismic data analysis, embedding, and deep learning with ensemble learning for microtremor classification.