1. Introduction
The ICM, a hot, diffuse plasma, constitutes the dominant baryonic component of galaxy clusters (Andreon and Hurn Reference Andreon and Hurn2010; Dai et al. Reference Dai2010; Kravtsov and Borgani Reference Kravtsov and Borgani2012). Its complex dynamics are driven by various astrophysical processes, including cluster mergers, AGN feedback, and large-scale structure formation, which generate turbulent motions, bulk flows, and coherent velocity patterns such as gas sloshing (Ascasibar and Markevitch Reference Ascasibar and Markevitch2006; Vazza et al. Reference Vazza2018; ZuHone et al. Reference ZuHone2018; Bambic and Reynolds Reference Bambic and Reynolds2019; Ichinohe et al. Reference Ichinohe2019).
Recent advances in X-ray spectroscopy, particularly through the calibration technique introduced by Sanders et al. (Reference Sanders2020), have enabled direct measurements of ICM line-of-sight (LOS) velocities with high precision. Applying this method to clusters such as Perseus, Virgo, and Ophiuchus has revealed a range of kinematic phenomena, including AGN-driven outflows and merger-induced bulk flows. Interpreting these observations requires comparison with predictions from cosmological hydrodynamical simulations (Gaspari et al. Reference Gaspari2014; Zhuravleva et al. Reference Zhuravleva2014; Mohapatra and Sharma Reference Mohapatra and Sharma2019). However, the high dimensionality and inherent complexity of both observational and simulated datasets pose a significant challenge for direct comparison.
In this work, we present a novel methodology that employs machine learning to address this problem. Specifically, we use Convolutional Neural Networks (CNNs) and Siamese architectures to construct a scalable framework for comparing observed LOS velocity maps with synthetic counterparts derived from simulations. This approach builds upon successful applications of similar techniques in other areas of astrophysics (Huertas-Company et al. Reference Huertas-Company2015; Domínguez Sánchez et al. Reference Domínguez Sánchez2018; Pearson Reference Pearson2019; Brunel et al. Reference Brunel2019; Zhang et al. Reference Zhang2022), and is designed to identify both kinematic and morphological similarities between observed and simulated ICM structures. In the following sections, we outline the core components of this method.
2. Galaxy Cluster Velocity Maps
To test our machine learning framework, we used LOS velocity maps from several galaxy clusters: Virgo (Gatuzz et al. Reference Gatuzz2022b, 2023b), Centaurus (Gatuzz et al. Reference Gatuzz2022a, Reference Gatuzz2023d), Ophiuchus (Gatuzz et al. Reference Gatuzz2023c,e), and A3266 (Gatuzz et al. Reference Gatuzz2024, Reference Gatuzz2025). These maps were derived from XMM-Newton EPIC observations, processed using a standardized data reduction and analysis pipeline. Briefly, the observations were reduced with SAS (version 19.1.0), including the selection of single-pixel events and the filtering of flaring time intervals. A critical aspect of the process involved the application of updated calibration files and the use of instrumental background lines to achieve a LOS velocity precision better than 100 km/s at the Fe-K line, following the method described in Sanders et al. (Reference Sanders2020). Point sources, including central AGN, were identified and excluded from the analysis. Spectral maps were generated by fitting X-ray spectra extracted from dynamically sized elliptical regions across each observation. The ICM emission was modeled using an apec thermal plasma component (Foster et al. Reference Foster2019), with additional components introduced in cases requiring more complex modeling, such as the multi-temperature structure observed in the Centaurus cluster. This procedure, which accounts for Galactic absorption and instrumental background contributions, yielded the LOS velocity maps that serve as inputs for our machine learning framework. Further details on the reduction and spectral analysis techniques can be found in the original references.
3. Machine Learning Methodology
We present a deep learning framework based on a Siamese Convolutional Neural Network (CNN) designed to compare velocity maps of the ICM. The objective is to identify kinematically similar fields by learning a robust representation, or embedding, for each input velocity map. The Siamese CNN consists of two identical branches with shared weights, facilitating similarity learning. Each branch functions as a feature extractor, composed of multiple convolutional layers that capture hierarchical spatial features, followed by max-pooling layers to reduce spatial dimensions. After the final convolutional block, a flattening layer and a fully connected dense layer convert the feature maps into a compact, fixed-length numerical vector-the embedding-which encodes the essential characteristics of the input map.
The network is trained using the triplet loss function (Schroff et al. Reference Schroff2015). During training, the network is presented with triplets: an anchor image (A), a positive image (P) that is similar to the anchor, and a negative image (N) that is dissimilar. The loss function adjusts the network’s weights via back propagation to minimize the distance between the anchor and positive embeddings while enforcing a margin between the anchor and negative embeddings. Once training is complete and the weights are optimized, the CNN branches act as fixed feature extractors. The observed velocity map from XMM-Newton is passed through one branch to generate its embedding vector, while each simulated velocity map is processed through the second branch to compute its corresponding embedding. A critical preprocessing step ensures all images are resampled to a uniform pixel resolution consistent with the XMM-Newton data.
To quantify similarity, we compute both the Euclidean distance and the cosine similarity between the embeddings of the observation and each simulation. The simulation with the smallest Euclidean distance (or, equivalently, the highest cosine similarity) is identified as the best match.
4. Validation Using Artificial Data
To assess the robustness and reliability of our Siamese CNN in identifying kinematic similarities, we conducted a series of validation tests using controlled artificial datasets. These tests serve as sanity checks to confirm that the network learns meaningful and distinctive representations of ICM velocity maps.
For each observed cluster-Virgo, Centaurus, Ophiuchus, and A3266-we generated a set of 1,000 artificial velocity maps. These maps were created by applying controlled perturbations to the original XMM-Newton observations, including random rotations, pixel-level noise additions, and minor distortions (see Figure 1). We then trained the Siamese CNN on a subset of this artificial dataset.
Examples from the artificial dataset generated for the Virgo cluster. These perturbed velocity maps were created by applying controlled transformations (e.g., rotation, noise) to the original XMM-Newton observation.

Figure 1 Long description
Panel A: A heat map titled 'Original Velocity Map' displays velocity distributions in a galaxy cluster. The x and y axes represent spatial coordinates, while the color scale on the right indicates velocity values ranging from -1000 to 1000 kilometers per second. Blue regions indicate lower velocities, and red regions indicate higher velocities, with a spiral pattern visible. Panel B: A heat map titled 'Perturbed Map 1' shows a modified version of the original velocity map with slight variations in the velocity distribution. The same color scale and spatial coordinates are used. Panel C: A heat map titled 'Perturbed Map 2' presents another modified version of the original velocity map, with different perturbations affecting the velocity distribution. The color scale and spatial coordinates remain consistent. Panel D: A heat map titled 'Perturbed Map 3' displays yet another perturbed version of the original velocity map, with distinct variations in the velocity pattern. The color scale and spatial coordinates are the same as in the previous panels.
To evaluate performance, we queried the trained model with the original (unperturbed) observational map and searched for its closest match among a validation set containing the 1000 perturbed maps along with the original. In every case, the model correctly identified the original observation as the best match-returning the smallest embedding distance and highest similarity score. This outcome confirms that the Siamese CNN has successfully learned to recognize the intrinsic kinematic patterns of the ICM, even when subjected to small but realistic variations.
To further support these findings, we employed t-Distributed Stochastic Neighbor Embedding (t-SNE) to visualize the embedding space. This dimensionality reduction technique projects high-dimensional embedding vectors into a 2D space while preserving local structures. In these t-SNE plots, each point represents the embedding of one artificial velocity map. As shown in Figure 2, the embeddings of the 1000 perturbed Virgo maps form a compact cluster tightly surrounding the embedding of the original observation. This visualization demonstrates that the network has learned a coherent representation of the underlying ICM kinematics-grouping similar structures together while separating dissimilar ones in the embedding space.
t-SNE projection of the embedding space for the Virgo cluster. The plot shows that the best matching correspond to the original observation, demonstrating that the Siamese CNN learns consistent kinematic representations.

5. Conclusion
In this work, we have introduced a novel machine learning framework for the comparative analysis of ICM kinematics. Our approach leverages a Siamese CNN trained with a triplet loss function to learn meaningful and robust representations of velocity maps derived from X-ray observations. This architecture is specifically designed to identify and quantify similarities between different kinematic fields.
To validate the effectiveness of our method, we performed a series of controlled tests using artificially perturbed datasets based on real XMM-Newton observations. The model consistently identified the original, unperturbed maps as the closest match, demonstrating its ability to capture the essential kinematic features. These results were further supported by t-SNE visualizations, which showed that embeddings of the perturbed maps clustered tightly around those of the originals-providing strong evidence that the network has learned to distinguish meaningful patterns in the data.
This framework offers a scalable and automated solution for matching observations with simulations, addressing a key challenge in the comparison of high-dimensional, complex astrophysical datasets. It serves as a powerful tool for linking X-ray observations with theoretical models of cluster formation and evolution.
In a forthcoming paper, we will apply this methodology to cosmological hydrodynamical simulations from the IllustrisTNG suite (Springel et al. Reference Springel2018), providing a comprehensive analysis of how observed ICM velocity structures compare to those predicted by state-of-the-art simulations.
