betaFeedback

WorksPhysics and Astronomy

A deep learning approach to member identification and mass estimation in galaxy clusters

Abstract

Accurate dynamical mass estimates of galaxy clusters are essential for studies of cluster formation and evolution and for cosmological applications. However, interloper galaxies, which are not gravitationally bound to the cluster but are incorrectly identified as members, can bias dynamical mass measurements and increase uncertainties. We developed a probabilistic deep-learning framework for cluster member identification and dynamical mass estimation and tested sensitivity to cluster miscentring and radially dependent incompleteness in controlled mock experiments. We used mock galaxy cluster catalogues to train a two-stage model. A long short-term memory (LSTM) network assigns membership probabilities to galaxies arranged by projected phase-space proximity. These probabilities construct membership-weighted projected phase-space density maps, from which a Bayesian neural network (BNN) infers cluster masses and predictive uncertainties. The LSTM membership probabilities are well calibrated and form an isoprobability envelope in projected phase space, with the ⟨pmem⟩=0.5\langle p_{\rm mem}\rangle = 0.5 contour broadly tracing the empirical member–interloper transition. A threshold of pth=0.5p_{\rm th} = 0.5 balances member completeness and purity, with high completeness within Rproj<r200R_{\rm proj} < r_{200}. Membership weighting lowers the residual scatter of the fiducial BNN mass estimator, BNN2DMem\mathrm{BNN}^{\mathrm{Mem}}_{\mathrm{2D}}, to σε=0.120σ_ε= 0.120, a 19.5% reduction relative to the unweighted baseline, although predictive uncertainties are not uniformly calibrated across BNN models. Using the brightest cluster galaxy rather than the gravitational centre lowers the median inferred mass by up to 47.6%, with larger reductions at larger centring offsets. By contrast, removing 40% of eligible non-central galaxies within r200r_{200} lowers it by 6.1% relative to complete catalogues.

Introduction

As the most massive gravitationally bound structures in the Universe, galaxy clusters occupy the nodes of the cosmic web. Their gravitational potentials are dominated by dark matter, while galaxies and the intracluster medium provide observable tracers of the underlying mass distribution. Accurate measurements of cluster masses and mass distributions are therefore essential for studying cluster formation and evolution and for constraining cosmological parameters [55, 52, 68, 19, 47]. Owing to their broad astrophysical and cosmological significance, galaxy clusters are major science targets of successive generations of wide-field surveys, including the Sloan Digital Sky Survey (SDSS) [5, 69], the Dark Energy Survey (DES) [1, 53], the Euclid survey [16, 15], the Vera C. Rubin Observatory’s Legacy Survey of Space and Time (LSST) [29], and the upcoming China Space Station Telescope (CSST) survey [21, 73].

Various observational probes have been developed to constrain galaxy cluster masses. Gravitational lensing probes the projected mass distribution through the distortion of background galaxy images by the cluster gravitational field [28] (Du et al. 2015; Du & Fan 2014). X-ray observations of the hot intracluster medium can be used to infer cluster masses, commonly under the assumption of hydrostatic equilibrium [14]. The Sunyaev–Zel’dovich effect, arising from inverse Compton scattering between cosmic microwave background photons and hot electrons in the intracluster medium, provides another important mass proxy [48]. Alternatively, the positions and line-of-sight (LOS) velocities of cluster galaxies can be used to trace the cluster gravitational potential through their dynamics. Such dynamical approaches are particularly valuable for probing cluster mass distributions to large cluster-centric radii, where some gas-based observables become increasingly difficult to measure [18].

To estimate cluster masses from member galaxies, a straightforward approach is to apply scaling relations between the total mass enclosed within a characteristic radius and the velocity dispersion of member galaxies, which are physically motivated by the virial theorem (Munari et al. 2013; Evrard et al. 2008; Sohn et al. [61]). Under assumptions about the tracer density and velocity anisotropy profiles, the cluster mass distribution can also be constrained through the Jeans equation [64]. Unlike methods based primarily on galaxy velocity dispersions, the caustic technique [11] exploits the projected phase-space distribution of cluster galaxies, defined by projected cluster-centric radius and LOS velocity, to estimate the radial escape-velocity profile and thereby infer the cluster mass profile [58]. Although these approaches provide valuable constraints on cluster masses, their accuracy can be affected by assumptions about the dynamical state, velocity anisotropy, geometry, or mass distribution of clusters. A common challenge for galaxy-based dynamical methods is interloper contamination, in which foreground or background galaxies projected along the LOS are mistakenly identified as cluster members.

Interlopers can distort the inferred dynamical properties and projected phase-space distribution of galaxy clusters, thereby biasing dynamical mass estimates [9, 71] (Ferragamo et al. 2020). Additional galaxy information and more sophisticated selection methods can improve the separation of cluster members from interlopers. For example, galaxy positions combined with single-band photometric information can be used to identify galaxy clusters and estimate their richness [50]. With multi-band photometric data, galaxy membership probabilities can be estimated more accurately, enabling the construction of cluster catalogues with improved purity and completeness [51]. When spectroscopic information is available, projected phase-space information provides additional leverage for identifying cluster members. For example, Serra & Diaferio [57] showed that the caustic method, which uses galaxy positions and LOS velocities, can effectively separate interlopers from cluster members.

Recently, machine-learning and deep-learning techniques have emerged as data-driven alternatives for dynamical cluster mass estimation, allowing cluster masses to be inferred directly from galaxy phase-space information. For instance, Ntampaka et al. [40] introduced a support distribution machine (SDM) that learns from the joint distribution of galaxy LOS velocities and projected cluster-centric distances, reducing the 68% scatter of the fractional mass error from 0.87 for the standard MM–σv\sigma_v scaling relation to 0.46. Ho et al. (2019) subsequently developed convolutional neural network (CNN) estimators using LOS velocities alone or together with projected radii, achieving mass-estimation accuracies of 0.174 dex and 0.132 dex, respectively. Approximate Bayesian extensions of these models were later developed to characterise predictive uncertainties (Ho et al. 2021), while Kodi Ramamohan et al. (2021) further incorporated 2D projected galaxy positions and LOS velocities using a 3D CNN. These studies demonstrate the effectiveness of machine learning for dynamical cluster mass estimation. However, interloper contamination remains a challenge in these data-driven approaches. Given the ability of machine-learning methods to extract complex patterns from galaxy phase-space distributions, they may also help address this issue.

In this study, we developed a deep-learning framework that incorporates probabilistic galaxy membership into dynamical cluster mass inference, with the aim of reducing the impact of interloper contamination and improving mass-estimation precision. Following the methodology of Ho et al. (2019), we generated mock observational data for galaxy clusters. Models based on long short-term memory (LSTM) networks have been applied to a variety of astronomical problems, including broad absorption line detection in quasar spectra (Li et al. 2025) and photometric redshift estimation from wavelength-ordered, multi-band flux sequences [37, 10]. In our study, we constructed an LSTM network [27] to estimate individual galaxy membership probabilities, with galaxies ordered according to their proximity in projected phase space. The predicted membership probabilities were subsequently incorporated into the projected phase-space distribution used by a Bayesian neural network (BNN) to infer cluster masses and their predictive uncertainties. We further investigated the role of galaxy magnitude information in both membership identification and cluster mass estimation.

To approximate realistic observational conditions, we imposed an rr-band AB apparent-magnitude limit of 21 on the mock galaxy catalogues. We further assessed the robustness of our framework through two additional tests, examining the effects of cluster miscentring and radially dependent data incompleteness on mass inference. Finally, as an initial application to observed systems, we applied our method to a sample of observed clusters with SDSS spectroscopic data and compared the inferred masses with literature estimates from weak-lensing, X-ray, and dynamical analyses.

The remainder of this paper is structured as follows. In Sect. 2, we describe the generation of the datasets used for training and testing. Section 3 introduces the LSTM and BNN models and describes their architectures and training procedures. In Sect. 4, we present our results. We summarise our main conclusions in Sect. 5.

Data

Mock galaxy catalogue

We extracted mock galaxies from the catalogue of Pei et al. [44], who applied a modified version of the semi-analytic model L-GALAXIES [24] to JiuTian-1G (hereafter JT1G), a large-volume dark-matter-only N-body simulation. The JT1G simulation contains 614436144^3 particles within a cubic box with a side length of 1 h−1Gpc1\ h^{-1}\mathrm{Gpc}. The simulation adopts the cosmological parameters ΩΛ=0.6889\Omega_{\Lambda}=0.6889, Ωm=0.3111\Omega_m=0.3111, Ωb=0.0490\Omega_b=0.0490, h=0.6766h=0.6766 and σ8=0.8102\sigma_8=0.8102 [49]. It traces particles from redshift z=127z=127 to z=0z=0, and stores 128 snapshots with an average time interval of approximately 100 Myr between adjacent snapshots. The mass resolution of this simulation is 3.72×108h−1M⊙3.72\times10^8h^{-1}M_\odot. Dark matter haloes and substructures in JT1G are identified using the friends-of-friends (FoF) and SUBFIND algorithms [63, 62].

Pei et al. [44] improved the L-GALAXIES model [24] by addressing its time convergence problem. By applying the modified L-GALAXIES model to the JT1G simulation, they generated mock galaxy catalogues that successfully reproduce the stellar mass function out to redshift z≃3z\simeq3 and meet the requirements for realistic forecasts for next-generation large-scale surveys such as Euclid, LSST, and CSST. In this work, we adopted the galaxy catalogue with CSST rr-band magnitudes and selected relatively bright galaxies to achieve a sample depth comparable to that expected for future spectroscopic galaxy surveys.

Mock cluster observations

We followed the methodology introduced in Ho et al. (2019) to generate mock cluster catalogues using the simulation data described in Sect. 2.1. Specifically, we adopted the simulation data from snapshot 116, which corresponds to a redshift of z≃0.13z \simeq0.13. We selected FoF haloes with mass M200≥1013.5h−1M⊙M_{200} \geq10^{13.5}h^{-1}M_{\odot} and subhalo richness N≥10N \geq10 as candidate clusters, where M200M_{200} denotes the mass enclosed by a radius r200r_{200} within which the mean density is 200 times the critical density of the Universe. We adopted the gravitational centre, defined as the position of minimum gravitational potential, as the ‘true’ cluster centre. Galaxies were selected as subhaloes with stellar mass M⋆≥109.5h−1M⊙M_{\star} \geq10^{9.5}h^{-1}M_{\odot}, and the subhalo richness NN was computed using galaxies satisfying this stellar-mass cut. This selection yields 80,849 cluster candidates at z≃0.13z \simeq0.13, from which the training and test samples are drawn. To avoid missing galaxies for clusters close to the boundary of the periodic simulation box, we constructed a periodically padded galaxy catalogue by copying slices of galaxies from the opposite sides of the box. The padding width is 120 h−1Mpch^{-1}\mathrm{Mpc} on each face.

For each mock cluster observation, we assigned a random LOS and placed a mock observer such that the cluster lies at the comoving distance corresponding to the snapshot redshift z≃0.13z \simeq0.13. The LOS unit vector z^los\hat{z}_{\mathrm{los}} is defined from the observer to the cluster centre, and two orthonormal basis vectors perpendicular to it are denoted by x^los\hat{x}_{\mathrm{los}} and y^los\hat{y}_{\mathrm{los}}. We calculated the projected positions of galaxies relative to the gravitational centre of the target cluster as

xproj=[r−(r⋅z^los)z^los]⋅x^los,(1)x_{\mathrm{proj}} = [\boldsymbol{r} - (\boldsymbol{r} \cdot\hat{z}_{\mathrm{los}})\hat{z}_{\mathrm{los}}] \cdot\hat{x}_{\mathrm{los}}, \tag*{(1)}
yproj=[r−(r⋅z^los)z^los]⋅y^los,(2)y_{\mathrm{proj}} = [\boldsymbol{r} - (\boldsymbol{r} \cdot\hat{z}_{\mathrm{los}})\hat{z}_{\mathrm{los}}] \cdot\hat{y}_{\mathrm{los}}, \tag*{(2)}

where r\boldsymbol{r} is the comoving position vector from the cluster gravitational centre to the target galaxy. The projected radius is then Rproj=(xproj2+yproj2)1/2R_{\mathrm{proj}} = (x_{\mathrm{proj}}^2 + y_{\mathrm{proj}}^2)^{1/2}. We retained galaxies within a fixed projected aperture of Rproj≤4 h−1MpcR_{\mathrm{proj}} \leq4\,h^{-1}\mathrm{Mpc}. This aperture was chosen to be large enough to include the cluster outskirts and the nearby projected environment, where infalling galaxies and interlopers are expected to appear across different systems.

For galaxies satisfying the projected-radius cut, we computed the LOS velocity relative to the cluster centre as

vlos=[vgal(P,los)−vcen(P,los)]+[vgal(H)−vcen(H)],(3)v_{\mathrm{los}} = [v_{\mathrm{gal}}^{(\mathrm{P,los})} - v_{\mathrm{cen}}^{(\mathrm{P,los})}] + [v_{\mathrm{gal}}^{(\mathrm{H})} - v_{\mathrm{cen}}^{(\mathrm{H})}], \tag*{(3)}

where v(P,los)v^{(\mathrm{P,los})} is the peculiar velocity projected along the LOS, and v(H)v^{(\mathrm{H})} is the Hubble-flow velocity inferred from the comoving distance to the observer. The subscripts ‘gal’ and ‘cen’ denote the target galaxy and the cluster centre, respectively. We further required ∣vlos∣≤3000 km s−1|v_{\mathrm{los}}| \leq3000\ \mathrm{km\ s}^{-1}. This relatively broad velocity window was chosen to retain high-velocity cluster members and galaxies in the infall region, while excluding very distant foreground and background galaxies. Together with the projected-radius cut, this selection defines a broad projected phase-space window containing both members and interlopers, allowing the network to learn membership classification in the presence of projection-induced contamination. Galaxies were labelled as members if they belong to the same FoF group as the target cluster and as interlopers otherwise. The FoF membership of galaxies is based on spatial linking and does not guarantee that all members are gravitationally bound to the cluster ([63, 7]).

Figure 1 illustrates the projected phase-space distributions of galaxies in a single galaxy cluster viewed along two different lines of sight. The figure shows that the apparent distribution of galaxies in the RprojR_{\mathrm{proj}}–vlosv_{\mathrm{los}} plane depends on the LOS projection. Interlopers can occupy a broad region of the projected phase space, thereby complicating the identification of cluster members and introducing additional uncertainties into cluster mass estimation. This motivates the use of auxiliary galaxy information to mitigate the impact of interlopers on mass inference. We therefore tested whether galaxy magnitude and inferred membership probability provide additional predictive information for cluster mass estimation.

Projected phase-space distributions of galaxies in a single galaxy cluster viewed along two different lines of sight

Figure 1. Projected phase-space distributions of galaxies in a single galaxy cluster viewed along two different lines of sight. The blue and red points denote cluster members and interlopers, respectively. The marker size encodes the stellar mass, M⋆M_\star, with the larger symbols corresponding to more massive galaxies.

To mimic observational limitations, we constructed a dataset with an rr-band AB apparent-magnitude limit of 21, corresponding to a brighter cut than the nominal SDSS rr-band depth for point sources of ∼22.2\sim22.2 (Adelman-McCarthy et al. [3]). The left panel of Figure 2 illustrates the distribution of galaxies based on their projected positions, with each point representing a galaxy and coloured by its apparent magnitude.

Figure 2. Effect of the adopted cluster centre on the projected phase-space distribution. Left: Projected positions of galaxies in the field of view, with the points coloured by their rr-band apparent magnitude, capped at mr=21m_r = 21. The star marks the gravitational centre, defined as the position of minimum gravitational potential within the cluster, while the cross marks the BCG. Middle and right: Gaussian KDEs of the projected phase-space PDF in the RprojR_{\rm proj}–vlosv_{\rm los} plane, using the gravitational centre and the BCG as the adopted centre, respectively. Both cluster members and interlopers are included in the KDE estimates.

Dataset

To reduce sensitivity to the underlying cluster mass function during training, we constructed a training set with an approximately flat mass distribution over the range 1013.510^{13.5}–1015.25 h−1M⊙10^{15.25}\,h^{-1}M_{\odot}, following Ho et al. (2019). In the mass range 101410^{14}–1015 h−1M⊙10^{15}\,h^{-1}M_{\odot}, we randomly assigned 70% of the clustered candidates to the training set and reserved the remaining 30% for the main test set. This cluster-level split ensures that different LOS projections of the same underlying cluster do not appear in both the training and test samples (Kodi Ramanah et al. [31]). To obtain an approximately flat training set distribution in log⁡10M200\log_{10} M_{200}, we divided the logarithmic mass range into 30 equal-width bins, targeting approximately 583 mock realisations per bin. We used one random LOS per selected halo in well-populated bins with M200<1014.37 h−1M⊙M_{200} < 10^{14.37}\,h^{-1}M_{\odot}, and up to approximately 195 LOS realisations per halo in the highest-mass bin. Multiple LOS projections increase the diversity of viewing orientations and help prevent the training set from being dominated by the more abundant low-mass clusters. However, projections of the same halo are not independent and do not increase the halo-to-halo diversity at the high-mass end. The cluster-level split described above prevents information leakage arising from projections of the same halo appearing in both the training and main test sets. Nevertheless, the limited number of independent high-mass clusters may limit the generalisability of predictions for the rarest systems. For the main test set, each cluster in the reserved 30% sample was projected along the three orthogonal Cartesian axes (xx, yy, and zz), yielding three mock realisations per cluster. For each cluster projection, galaxies were labelled as either members or interlopers according to their FoF group membership.

Accurately identifying the centre of a galaxy cluster is challenging because different centre definitions, such as the position of the brightest cluster galaxy (BCG), the X-ray peak, and the minimum of the gravitational potential, do not always coincide. Within the mass range of the main test set, 6,335 cluster candidates have an rr-band BCG that does not coincide with the galaxy located at the gravitational centre. To quantify the impact of mis-centring on model performance, we randomly selected 1,000 of these clusters and generated paired mock observations for each: one centred on the gravitational centre and the other adopting the rr-band BCG as the cluster centre. These paired samples constitute the off-centre test set. Figure 2 illustrates how this recentring affects the projected phase-space distribution of galaxies in one example cluster. In this case, the BCG is offset from the gravitational centre by 0.324 h−1Mpch^{-1}\mathrm{Mpc} in projection. The two right-hand panels show that the adopted centre may change the structure in the phase-space plane, potentially biasing the inferred cluster mass.

In addition to centre offsets, incomplete galaxy sampling caused by blending, instrumental limitations, observational strategies, or other observational constraints can also affect the accuracy of the network predictions. To quantify the impact of data incompleteness, we randomly selected 1,000 clusters from the main test set and constructed missing-data test sets by removing fixed fractions of galaxies from specified radial annuli. Specifically, we considered missing fractions of 10%, 20%, and 40%, applied separately within the projected-radius intervals 0<Rproj/r200<10 < R_{\rm proj}/r_{200} < 1, 1<Rproj/r200<21 < R_{\rm proj}/r_{200} < 2, and 2<Rproj/r200<32 < R_{\rm proj}/r_{200} < 3. For each cluster, this yields nine missing-data realisations, one for each combination of missing fraction and projected radial interval. The mass distributions of the different datasets are shown in Figure 3.

Figure 3. Mass distributions of the datasets. The solid curves show the number of mock cluster realisations in each mass bin, while the dashed dark-blue curve shows the number of unique haloes contributing to the training set. The same 30 equal-width bins spanning 13.5–15.25 in log⁡10[M200/(h−1M⊙)]\log_{10}[M_{200}/(h^{-1}M_{\odot})] are used for all datasets, with only non-empty bins shown. For the training set, an approximately flat mass distribution is constructed by varying both the number of selected haloes and the number of random LOS realisations per halo across the mass range. The missing-data and off-centre test sets are described in Sect. 2.3.

In summary, we constructed a training set containing 17,489 mock realisations, a main test set containing 13,569 mock realisations generated from 4,523 distinct underlying clusters, an off-centre test set containing 1,000 clusters to assess the impact of cluster miscentring, and a set of missing-data test samples to evaluate the effect of radial incompleteness under different missing fractions.

Method

In the Lambda cold dark matter (Λ\LambdaCDM) paradigm, galaxy clusters assemble hierarchically and grow approximately inside-out ([34]). As a result, galaxies located closer to the cluster centre are, in a statistical sense, more likely to have been accreted earlier, while genuine member galaxies tend to occupy coherent structures in projected phase space under the cluster gravitational potential. Motivated by this physical picture, we represented each cluster as an ordered pseudo-sequence, starting from the central galaxy and proceeding according to phase-space proximity. Although this sequence is not a true temporal sequence, it encodes local continuity in projected position–velocity space, allowing the LSTM to exploit contextual information among neighbouring galaxies when assigning membership probabilities. The resulting probabilistic member sample was then used for downstream cluster mass inference.

Long short-term memory (LSTM)

Long short-term memory networks are recurrent neural networks designed to model sequential data by regulating information flow through gated memory cells [27, 65]. For an input sequence {x(t)}\{x^{(t)}\}, an LSTM updates the hidden state h(t)h^{(t)} and cell state c(t)c^{(t)} through input, forget, and output gates:

i(t)=σ(Wi,xx(t)+Wi,hh(t−1)+bi),(4)i^{(t)} = \sigma\left(W_{i,x}x^{(t)} + W_{i,h}h^{(t-1)} + b_i\right), \tag*{(4)}
f(t)=σ(Wf,xx(t)+Wf,hh(t−1)+bf),(5)f^{(t)} = \sigma\left(W_{f,x}x^{(t)} + W_{f,h}h^{(t-1)} + b_f\right), \tag*{(5)}
c~(t)=tanh⁡(Wc,xx(t)+Wc,hh(t−1)+bc),(6)\tilde{c}^{(t)} = \tanh\left(W_{c,x}x^{(t)} + W_{c,h}h^{(t-1)} + b_c\right), \tag*{(6)}
c(t)=f(t)⊙c(t−1)+i(t)⊙c~(t),(7)c^{(t)} = f^{(t)} \odot c^{(t-1)} + i^{(t)} \odot\tilde{c}^{(t)}, \tag*{(7)}
o(t)=σ(Wo,xx(t)+Wo,hh(t−1)+bo),(8)o^{(t)} = \sigma\left(W_{o,x}x^{(t)} + W_{o,h}h^{(t-1)} + b_o\right), \tag*{(8)}
h(t)=o(t)⊙tanh⁡(c(t)).(9)h^{(t)} = o^{(t)} \odot\tanh\left(c^{(t)}\right). \tag*{(9)}

Here, σ\sigma is the sigmoid activation function, ⊙\odot denotes element-wise multiplication, and the weights WW and biases bb are learnt during training. The candidate cell state c~(t)\tilde{c}^{(t)} is an internal quantity of the standard LSTM update.

In our application, x(t)x^{(t)} represents the feature vector of the tt-th galaxy in the ordered pseudo-sequence. The LSTM therefore assigns membership probabilities using not only the features of individual galaxies, but also contextual information from neighbouring galaxies in the sequence. Since genuine cluster members are expected to form coherent structures in projected phase space, whereas interlopers are less strongly constrained by the cluster potential, this sequential representation was designed to provide contextual information that may help the network distinguish members from contaminants.

The hidden-state updates of an LSTM depend on the order of the input sequence, making the galaxy ordering an important part of the model construction. To construct the input sequence, we adopted a simple iterative nearest-neighbour sorting algorithm in projected phase space. The sequence started from the central galaxy, and each subsequent galaxy was selected as the nearest remaining galaxy to the previously selected one.

We normalised the projected coordinates by the aperture radius, Rcut=4h−1 MpcR_{\mathrm{cut}} = 4h^{-1}\,\mathrm{Mpc}, as well as the LOS velocity using a robust median absolute deviation (MAD) estimate. Specifically, we define

ξ=xprojRcut,η=yprojRcut,ulos=vlos−v~losσlos,(10)\xi= \frac{x_{\mathrm{proj}}}{R_{\mathrm{cut}}}, \qquad\eta= \frac{y_{\mathrm{proj}}}{R_{\mathrm{cut}}}, \qquad u_{\mathrm{los}} = \frac{v_{\mathrm{los}}-\tilde{v}_{\mathrm{los}}}{\sigma_{\mathrm{los}}}, \tag*{(10)}

where ξ\xi and η\eta are the normalised projected coordinates, ulosu_{\mathrm{los}} is the normalised LOS velocity, and v~los\tilde{v}_{\mathrm{los}} is the median LOS velocity of galaxies in the candidate cluster. The MAD-based LOS velocity scale is defined as

σlos=max⁡[1.4826 median⁡(∣vlos−v~los∣),300 km s−1].(11)\sigma_{\mathrm{los}} = \max\left[1.4826\,\operatorname{median}\left(\lvert v_{\mathrm{los}}-\tilde{v}_{\mathrm{los}}\rvert\right), 300\,\mathrm{km\,s^{-1}}\right]. \tag*{(11)}

The lower limit of 300 km s−1300\,\mathrm{km\,s^{-1}} was introduced to avoid unstable velocity normalisation when the MAD-based velocity scale is very small, especially in low-richness systems.

The phase-space distance between two galaxies was then computed as

d12=(ξ2−ξ1)2+(η2−η1)2+(ulos,2−ulos,1)2.(12)d_{12} = \sqrt{(\xi_2-\xi_1)^2 + (\eta_2-\eta_1)^2 + (u_{\mathrm{los},2}-u_{\mathrm{los},1})^2}. \tag*{(12)}

At each step, the remaining galaxy with the smallest phase-space distance from the last selected galaxy was appended to the sequence. To assess the effect of this sequence-construction choice, we also trained an otherwise identical LSTM using randomly ordered galaxy sequences, while retaining the same galaxy samples and input features. We compare the resulting membership predictions and downstream mass-estimation performance with those obtained using the fiducial ordering in Sect. 4.2.

For the galaxy at sequence position tt, the LSTM maps an input feature vector X(t)\mathbf{X}^{(t)} to a membership probability pmem(t)p_{\mathrm{mem}}^{(t)}. We grouped the input features as

X(t)=[Xpos,Xvel,Xcl,Xden,Xmag](t).(13)\mathbf{X}^{(t)} = \left[\mathbf{X}_{\mathrm{pos}},\mathbf{X}_{\mathrm{vel}},\mathbf{X}_{\mathrm{cl}},\mathbf{X}_{\mathrm{den}},\mathbf{X}_{\mathrm{mag}}\right]^{(t)}. \tag*{(13)}

The position-related features, Xpos\mathbf{X}_{\mathrm{pos}}, describe the projected location of each galaxy within the cluster-centred aperture. They include the normalised projected coordinates, ξ\xi and η\eta, the aperture-normalised projected radius ρ=Rproj/Rcut\rho= R_{\mathrm{proj}}/R_{\mathrm{cut}}, and the relative projected radius r50=Rproj/R50,obsr_{50} = R_{\mathrm{proj}}/R_{50,\mathrm{obs}}, where R50,obsR_{50,\mathrm{obs}} is the median projected radius of galaxies in the same aperture. The feature r50r_{50} measures the radial position of each galaxy relative to the observed radial scale of its candidate cluster.

The velocity-related features, Xvel\mathbf{X}_{\mathrm{vel}}, describe both the LOS velocity coordinate of each galaxy within the fixed velocity window and its velocity relative to the candidate cluster. We define the fixed-aperture normalised LOS velocity as

v^los=vlosvcut,vcut=3000 km s−1.(14)\hat{v}_{\mathrm{los}} = \frac{v_{\mathrm{los}}}{v_{\mathrm{cut}}}, \qquad v_{\mathrm{cut}} = 3000\ \mathrm{km\ s^{-1}}. \tag*{(14)}

The fixed-aperture velocity v^los\hat{v}_{\mathrm{los}} preserves the velocity-space position of each galaxy within the common LOS velocity window, whereas ulosu_{\mathrm{los}} measures its velocity offset relative to the median and internal velocity scale of the candidate cluster. We define the projected phase-space distance proxy as

dps=η2+v^los2.(15)d_{\mathrm{ps}} = \sqrt{\eta^2 + \hat{v}_{\mathrm{los}}^2}. \tag*{(15)}

We also included the dimensionless velocity-scale feature slos=σlos/vcuts_{\mathrm{los}} = \sigma_{\mathrm{los}}/v_{\mathrm{cut}}. The velocity-related input group is therefore

Xvel=[v^los,∣v^los∣,dps,ulos,∣ulos∣,slos].(16)\mathbf{X}_{\mathrm{vel}} = \left[\hat{v}_{\mathrm{los}}, |\hat{v}_{\mathrm{los}}|, d_{\mathrm{ps}}, u_{\mathrm{los}}, |u_{\mathrm{los}}|, s_{\mathrm{los}}\right]. \tag*{(16)}

To provide global information on the candidate cluster, we used the cluster-level observable feature vector Xcl=[log⁡10Ngal,f<1,f1−2]\mathbf{X}_{\mathrm{cl}} = [\log_{10} N_{\mathrm{gal}}, f_{<1}, f_{1-2}], where NgalN_{\mathrm{gal}} is the number of galaxies in the cluster-centred aperture, and f<1f_{<1} and f1−2f_{1-2} are the fractions of galaxies with Rproj<1 h−1MpcR_{\mathrm{proj}} < 1\ h^{-1}\mathrm{Mpc} and 1 h−1Mpc≤Rproj<2 h−1Mpc1\ h^{-1}\mathrm{Mpc} \leq R_{\mathrm{proj}} < 2\ h^{-1}\mathrm{Mpc}, respectively. These quantities summarise the richness and projected radial concentration of the candidate cluster, and were repeated for all galaxies in the same aperture when concatenated with the per-galaxy features at each sequence position.

The local-density features describe the local environment of each galaxy within the cluster-centred aperture. Genuine cluster members are expected to be embedded in the main cluster structure in projected phase space, whereas interlopers may appear as isolated objects or as part of distinct foreground/background structures. Thus, local density quantifies how strongly a galaxy is connected to a coherent phase-space environment, beyond its individual projected position and LOS velocity. For each galaxy, we computed kk-nearest-neighbour density estimates in two spaces, with nkpsn_k^{\mathrm{ps}} measuring the number density in the normalised projected phase space (ξ,η,ulos)(\xi,\eta,u_{\mathrm{los}}) and Σkxy\Sigma_k^{\mathrm{xy}} measuring the surface number density in the projected coordinate plane (ξ,η)(\xi,\eta).

Here, kk sets the neighbour scale, with smaller values probing compact local associations, while larger values trace more extended cluster-scale environments. Let dkpsd_k^{\mathrm{ps}} and dkxyd_k^{\mathrm{xy}} be the distances to the kkth nearest neighbour in these two spaces. We define

nkps=k(4π/3)(dkps+ϵ)3,Σkxy=kπ(dkxy+ϵ)2,(17)n_k^{\mathrm{ps}} = \frac{k}{(4\pi/3)(d_k^{\mathrm{ps}}+\epsilon)^3}, \qquad\Sigma_k^{\mathrm{xy}} = \frac{k}{\pi(d_k^{\mathrm{xy}}+\epsilon)^2}, \tag*{(17)}

where ϵ\epsilon prevents numerical divergence when the nearest-neighbour distance is very small. The density input vector is Xden=[log⁡10n5ps,log⁡10n10ps,log⁡10n20ps,log⁡10Σ10xy]\mathbf{X}_{\mathrm{den}} = [\log_{10} n_5^{\mathrm{ps}}, \log_{10} n_{10}^{\mathrm{ps}}, \log_{10} n_{20}^{\mathrm{ps}}, \log_{10} \Sigma_{10}^{\mathrm{xy}}]. Together, the different choices of kk and density spaces allow Xden\mathbf{X}_{\mathrm{den}} to characterise the galaxy environment hierarchically, from compact local associations to broader cluster-scale structures in both projected phase space and the sky plane.

The magnitude-related feature is the standardised rest-frame rr-band absolute magnitude,

Xmag=[M~r],M~r=⟨Mr⟩−MrσMr,(18)\mathbf{X}_{\mathrm{mag}} = [\widetilde{M}_r], \qquad\widetilde{M}_r = \frac{\langle M_r\rangle- M_r}{\sigma_{M_r}}, \tag*{(18)}

where MrM_r is the rest-frame rr-band AB absolute magnitude, and ⟨Mr⟩\langle M_r\rangle and σMr\sigma_{M_r} were computed using galaxies within the same cluster-centred aperture. This feature measures how much brighter or fainter a galaxy is relative to the mean magnitude scale of its aperture. We also trained a magnitude-independent LSTM variant by removing Xmag\mathbf{X}_{\mathrm{mag}} from the input vector.

Bayesian neural network

Bayesian neural networks place prior distributions on the network parameters and infer posterior distributions over the parameters from the data, thereby enabling predictive uncertainties to be estimated within a Bayesian framework (for a review, see [30]). In contrast to standard neural networks, which optimise a single set of deterministic parameters, BNNs treat the network parameters probabilistically.

For a given cluster system, we mapped the projected phase-space distribution of galaxies into a probability density function (PDF). Specifically, the membership-weighted 2D Gaussian kernel density estimate (KDE) was first computed as

P~(v^los,ρ)=∑j=1Ngalpmem,jKH[(v^los,ρ)−(v^los,j,ρj)].(19)\widetilde{P}(\hat{v}_{\mathrm{los}},\rho)=\sum_{j=1}^{N_{\mathrm{gal}}}p_{\mathrm{mem},j}K_{\mathbf{H}}\left[(\hat{v}_{\mathrm{los}},\rho)-(\hat{v}_{\mathrm{los},j},\rho_j)\right]. \tag*{(19)}

Here, pmem,jp_{\mathrm{mem},j} is the LSTM-predicted membership probability of galaxy jj, KHK_{\mathbf{H}} is a Gaussian kernel with bandwidth matrix H\mathbf{H}, and P~\widetilde{P} denotes the unnormalised KDE. The coordinates v^los\hat{v}_{\mathrm{los}} and ρ\rho are the LOS velocity and projected cluster-centric radius normalised by the corresponding selection limits, as defined above. The KDE was numerically normalised to unit integral over the same finite grid used for the BNN input, yielding the PDF P^(v^los,ρ)\hat{P}(\hat{v}_{\mathrm{los}},\rho), which was used as the BNN input map x\mathbf{x}.

Applying this procedure to all cluster systems gives a training dataset D={(xi,yi)}i=1N\mathcal{D}=\{(\mathbf{x}_i,y_i)\}_{i=1}^{N}, where xi\mathbf{x}_i is the KDE-based phase-space PDF map and yi=log⁡10[M200,i/(h−1M⊙)]y_i=\log_{10}\left[M_{200,i}/(h^{-1}M_{\odot})\right] is the corresponding logarithmic cluster mass.

Bayesian inference updates prior beliefs about the network parameters θ\boldsymbol{\theta} through Bayes’ theorem. Assuming that the targets are conditionally independent given the inputs and network parameters, the likelihood factorises as p(D∣θ)=∏i=1Np(yi∣xi,θ)p(\mathcal{D}\mid\boldsymbol{\theta})=\prod_{i=1}^{N}p(y_i\mid\mathbf{x}_i,\boldsymbol{\theta}), and the posterior distribution is

p(θ∣D)=p(D∣θ)p(θ)p(D)=p(θ)∏i=1Np(yi∣xi,θ)∫p(θ′)∏i=1Np(yi∣xi,θ′) dθ′.(20)p(\boldsymbol{\theta}\mid\mathcal{D})=\frac{p(\mathcal{D}\mid\boldsymbol{\theta})p(\boldsymbol{\theta})}{p(\mathcal{D})}=\frac{p(\boldsymbol{\theta})\prod_{i=1}^{N}p(y_i\mid\mathbf{x}_i,\boldsymbol{\theta})}{\int p(\boldsymbol{\theta}')\prod_{i=1}^{N}p(y_i\mid\mathbf{x}_i,\boldsymbol{\theta}')\,\mathrm{d}\boldsymbol{\theta}'}. \tag*{(20)}

In practice, exact evaluation of this posterior is generally intractable because the evidence term, p(D)=∫p(D∣θ)p(θ) dθp(\mathcal{D})=\int p(\mathcal{D}\mid\boldsymbol{\theta})p(\boldsymbol{\theta})\,\mathrm{d}\boldsymbol{\theta}, requires integration over the high-dimensional parameter space of the network. Variational inference addresses this difficulty by introducing a simpler variational distribution qϕ(θ)q_{\phi}(\boldsymbol{\theta}), parametrised by variational parameters ϕ\phi, to approximate the true posterior. The approximation is obtained by minimising the Kullback–Leibler (KL) divergence,

KL(qϕ(θ)∥p(θ∣D))=Eqϕ[log⁡qϕ(θ)p(θ∣D)].(21)\mathrm{KL}\left(q_{\phi}(\boldsymbol{\theta})\|p(\boldsymbol{\theta}\mid\mathcal{D})\right)=\mathbb{E}_{q_{\phi}}\left[\log\frac{q_{\phi}(\boldsymbol{\theta})}{p(\boldsymbol{\theta}\mid\mathcal{D})}\right]. \tag*{(21)}

Since log⁡p(D)=ELBO+KL(qϕ(θ)∥p(θ∣D))\log p(\mathcal{D})=\mathrm{ELBO}+\mathrm{KL}\left(q_{\phi}(\boldsymbol{\theta})\|p(\boldsymbol{\theta}\mid\mathcal{D})\right), minimising the KL divergence is equivalent to maximising the evidence lower bound (ELBO),

ELBO=Eqϕ(θ)[log⁡p(D∣θ)]−KL(qϕ(θ)∥p(θ)).(22)\mathrm{ELBO}=\mathbb{E}_{q_{\phi}(\boldsymbol{\theta})}\left[\log p(\mathcal{D}\mid\boldsymbol{\theta})\right]-\mathrm{KL}\left(q_{\phi}(\boldsymbol{\theta})\|p(\boldsymbol{\theta})\right). \tag*{(22)}

After training, predictions for a new input x∗\mathbf{x}^{*} were obtained by Monte Carlo sampling from the approximate posterior qϕ(θ)q_{\phi}(\boldsymbol{\theta}). The posterior predictive distribution is approximated as

p(y∗∣x∗,D)≈1n∑i=1np(y∗∣x∗,θi),θi∼qϕ(θ),(23)p(y^{*}\mid\mathbf{x}^{*},\mathcal{D})\approx\frac{1}{n}\sum_{i=1}^{n}p(y^{*}\mid\mathbf{x}^{*},\boldsymbol{\theta}_i),\qquad\boldsymbol{\theta}_i\sim q_{\phi}(\boldsymbol{\theta}), \tag*{(23)}

where nn is the number of Monte Carlo samples. For each sampled parameter set θi\boldsymbol{\theta}_i, the network outputs a Gaussian predictive distribution p(y∗∣x∗,θi)p(y^{*}\mid\mathbf{x}^{*},\boldsymbol{\theta}_i) with mean μi(x∗)\mu_i(\mathbf{x}^{*}) and standard deviation σi(x∗)\sigma_i(\mathbf{x}^{*}). The point prediction is then approximated by the Monte Carlo average of the predictive means,

yˉ(x∗)=1n∑i=1nμi(x∗).(24)\bar{y}(\mathbf{x}^{*})=\frac{1}{n}\sum_{i=1}^{n}\mu_i(\mathbf{x}^{*}). \tag*{(24)}

The total predictive variance is estimated as

Var⁡(y∗∣x∗,D)≈1n∑i=1nσi2(x∗)+1n∑i=1n[μi(x∗)−yˉ(x∗)]2,(25)\operatorname{Var}(y^{*}\mid\mathbf{x}^{*},\mathcal{D})\approx\frac{1}{n}\sum_{i=1}^{n}\sigma_i^{2}(\mathbf{x}^{*})+\frac{1}{n}\sum_{i=1}^{n}\left[\mu_i(\mathbf{x}^{*})-\bar{y}(\mathbf{x}^{*})\right]^{2}, \tag*{(25)}

where the first term represents the aleatoric uncertainty, and the second term represents the epistemic uncertainty.

Model architecture

The architecture of our model is depicted in Figure 4. We developed a lightweight LSTM for member identification. The input features were mapped into a higher-dimensional feature space of 128D. The model incorporates a bidirectional LSTM layer, consisting of two stacked LSTM blocks. The bidirectional structure allows the model to use contextual information from both directions along the sequence. The LSTM-extracted features were passed through a linear layer followed by a sigmoid activation, yielding a single output that represents the probability that a galaxy is a cluster member. The LSTM was trained using a binary cross-entropy (BCE) loss, which quantifies the difference between the predicted probabilities and the actual binary labels.

Figure 4. Schematic of the model architecture for membership-probability prediction and mass estimation. The BNN uses the membership-weighted phase-space PDF in (vlos,Rproj)(v_{\mathrm{los}}, R_{\mathrm{proj}}) as input, with Bayesian inference applied only at the final output stage through two Bayesian linear layers.

Our model incorporates a BNN to infer cluster masses and their associated predictive uncertainties. The input to the BNN is the normalised KDE-based phase-space PDF map x\mathbf{x} described in Sect. 3.2. In our fiducial model, this map was constructed using the LSTM-predicted membership probabilities as weights in the KDE, so that galaxies with higher membership probabilities contribute more strongly to the input phase-space distribution. The BNN uses a hybrid convolutional feature extractor. A deterministic 2D convolutional layer was first applied to the KDE input map, followed by a 1D convolutional layer, max pooling, dropout, and two deterministic fully connected layers. These layers extract compact representations of the phase-space PDF for mass inference. Bayesian inference was applied only at the final output stage, which consists of two Bayesian linear layers that predict the mean, μ\mu, and standard deviation, σ\sigma, of a Gaussian likelihood for the cluster mass, respectively. A softplus transformation was applied to the latter to ensure σ>0\sigma>0. This Bayesian output-layer treatment reduces the computational cost relative to placing priors on all network parameters, while still capturing predictive uncertainty [72]. The model was trained by minimising the negative ELBO, or equivalently by maximising the ELBO introduced in Sect. 3.2.

Training methodology

The LSTM was implemented in PyTorch3 and the BNN was developed using Pyro4 [8], a probabilistic programming library that extends PyTorch. We employed the AutoDiagonalNormal guide for variational inference, which approximates the posterior distribution of the parameters in the two Bayesian output layers with a diagonal Gaussian. In this formulation, each Bayesian parameter is assigned an independent Gaussian variational distribution whose mean and variance are learnt during training. We placed independent standard normal priors, N(0,1)\mathcal{N}(0,1), on the weights and biases of both the mean and standard-deviation output layers. The output of the latter was transformed using a softplus function to ensure a positive predictive standard deviation.

Before training, galaxies were labelled as 1 for members and 0 for interlopers. The input feature matrix was processed using zz-score normalisation, ensuring that each input feature had zero mean and unit variance. The LSTM and BNN networks were trained with batch sizes of 64 and 100, respectively, and a learning rate of 0.001. Both models were optimised using the Adam optimiser.

During training, we allocated 80% of the training set to model training and used the remaining 20% for validation.

To avoid overfitting, we implemented early stopping. For the LSTM, training was terminated if the validation loss did not improve for 50 consecutive epochs. For the BNN, which is more computationally demanding, early stopping was applied after 200 consecutive epochs without improvement in the validation loss. In addition, we adopted a learning-rate scheduler to facilitate model convergence. The learning rate was reduced by a factor of 0.1 if the validation loss did not improve for 30 consecutive epochs for the LSTM or 150 consecutive epochs for the BNN.

Results

Member identification

To assess the reliability of the predicted membership probabilities, we examined the calibration curve shown in Figure 5. The calibration curve was constructed by dividing the predicted membership-probability range, 0≤p^mem≤10\leq\hat{p}_{\mathrm{mem}}\leq1, into 20 equal-width bins, corresponding to a bin width of Δp=0.05\Delta p=0.05 and providing a compromise between resolving probability-dependent calibration variations and limiting sampling noise within individual bins, and comparing the mean predicted probability, ⟨p^mem⟩\langle\hat{p}_{\mathrm{mem}}\rangle, with the corresponding member fraction, fmemf_{\mathrm{mem}}, in each bin. A well-calibrated classifier should follow the one-to-one relation fmem=⟨pmem⟩f_{\mathrm{mem}}=\langle p_{\mathrm{mem}}\rangle, shown by the diagonal dashed grey line.

Figure 5. Calibration of the predicted membership probability, pmemp_{\mathrm{mem}}, on the main test set. The member fraction fmemf_{\mathrm{mem}} is measured in 20 fixed-width bins of predicted membership probability, pmemp_{\mathrm{mem}}, with each bin plotted at its weighted mean predicted probability, ⟨pmem⟩\langle p_{\mathrm{mem}}\rangle. The diagonal dashed grey line indicates perfect calibration. The curves compare galaxy-weighted, cluster-equal, and mass-split calibrations, where the mass split is M200=1014.5 h−1M⊙M_{200}=10^{14.5}\,h^{-1}M_\odot. Top: ECE values. Bottom: Calibration residual, Δcal=fmem−⟨pmem⟩\Delta_{\mathrm{cal}}=f_{\mathrm{mem}}-\langle p_{\mathrm{mem}}\rangle, for the galaxy-weighted and cluster-equal estimators, with dashed curves marking the point-wise 95% bootstrap confidence limits. The horizontal grey line indicates perfect calibration, Δcal=0\Delta_{\mathrm{cal}}=0.

We computed the calibration curve using two weighting schemes. In the galaxy-weighted case, each galaxy has a unit weight, wi=1w_i=1, so richer clusters contribute more strongly to the final curve. In the cluster-equal case, each galaxy i∈ci\in c was assigned wi=1/Ncw_i=1/N_c, where NcN_c is the number of galaxies in cluster cc. Thus, the total weight of cluster cc is ∑i∈cwi=1\sum_{i\in c}w_i=1, so each cluster contributes equally to the calibration curves. This reduces the impact of cluster richness on the calibration measurement. We also split the sample into low- and high-mass clusters at M200=1014.5h−1M⊙M_{200}=10^{14.5}h^{-1}M_\odot and computed cluster-equal calibration curves for each subsample to test whether the predicted membership probabilities show any mass-dependent calibration bias.

We quantified each calibration curve’s deviation from the perfect-calibration relation using the expected calibration error (ECE). The ECE is the sample-weighted average absolute mismatch between the mean predicted membership probability and the observed member fraction across probability bins:

ECE=∑bWb∣fb−⟨pmem⟩b∣,(26)\mathrm{ECE}=\sum_b W_b\left|f_b-\langle p_{\mathrm{mem}}\rangle_b\right|, \tag*{(26)}

where bb indexes the probability bins. For each bin, fbf_b and ⟨pmem⟩b\langle p_{\mathrm{mem}}\rangle_b are the member fraction and the mean predicted membership probability, computed using the same galaxy weights wiw_i as the corresponding calibration curve. The bin weight Wb=∑i∈bwi/∑iwiW_b=\sum_{i\in b}w_i/\sum_iw_i is the fraction of the total sample weight contained in bin bb; therefore, bins containing a larger fraction of the sample contribute more strongly to the ECE. We estimated the uncertainty in the calibration residuals using a non-parametric cluster-level bootstrap with 5,000 resamples. In each resample, clusters were drawn with replacement, with all associated LOS realisations and galaxies retained, and the calibration residual, Δcal,b=fmem,b−⟨p^mem⟩b\Delta_{\mathrm{cal},b}=f_{\mathrm{mem},b}-\langle\hat{p}_{\mathrm{mem}}\rangle_b, was recalculated in the original 20 fixed probability bins. The 2.5th and 97.5th percentiles of the resulting bootstrap residuals define the pointwise 95% confidence limits shown in the lower panel of Figure 5.

The predicted membership probabilities are well calibrated on the main test set. Both the galaxy-weighted and cluster-equal calibration curves closely follow the one-to-one relation over most of the probability range, with small ECE values of 0.006 and 0.003, respectively. The agreement between these two weighting schemes suggests that the calibration result is not dominated by richer clusters with larger galaxy counts. The lower panel of Figure 5 shows that the calibration residuals remain within ∣Δcal∣≲0.03|\Delta_{\mathrm{cal}}|\lesssim0.03 across the probability range, with the largest deviations occurring at intermediate predicted probabilities. The mass-split curves also remain close to the perfect-calibration relation, with ECE =0.003=0.003 for low-mass clusters and ECE =0.007=0.007 for high-mass clusters. Although the high-mass subsample shows a slightly larger calibration error, the deviations remain small in both mass bins, indicating no substantial mass-dependent calibration bias.

In projected phase space, the caustic amplitude A(Rproj)A(R_{\mathrm{proj}}) defines an approximate radius-dependent envelope in cluster-centric LOS velocity. Galaxies with ∣vlos∣≲A(Rproj)|v_{\mathrm{los}}|\lesssim A(R_{\mathrm{proj}}) are preferentially found in the member-dominated region, while the interloper fraction increases beyond this caustic-like envelope [57]. Since pmemp_{\mathrm{mem}} is a continuous measure of membership likelihood, a physically meaningful prediction should vary coherently across this transition. We therefore examined whether the isoprobability contours of the LSTM-predicted membership probability field trace a caustic-like probability envelope in the phase-space plane.

To construct this diagnostic, we stacked galaxies in the main test set in the normalised projected phase-space plane, (Rproj/r200,vlos/σlos)(R_{\mathrm{proj}}/r_{200},v_{\mathrm{los}}/\sigma_{\mathrm{los}}), denoted as (R,v)(R,v). The stacked map was computed over 0≤R<40\leq R<4 and −4≤v<4-4\leq v<4, using 30 bins in projected radius and 60 bins in signed LOS velocity. In each phase-space bin, we accumulated the summed predicted membership probability Sp(R,v)=∑ipmem,iS_p(R,v) = \sum_i p_{\mathrm{mem},i}, the summed member galaxy count Sy(R,v)=∑iyiS_y(R,v) = \sum_i y_i, and the total galaxy count N(R,v)N(R,v), where yi=1y_i = 1 for members and yi=0y_i = 0 for interlopers. To suppress statistical fluctuations, these three stacked maps were smoothed with a Gaussian kernel of width one bin before taking ratios. We thus define

⟨pmem⟩(R,v)=Spsm(R,v)Nsm(R,v),fmem(R,v)=Sysm(R,v)Nsm(R,v),(27)\langle p_{\mathrm{mem}}\rangle(R,v) = \frac{S_p^{\mathrm{sm}}(R,v)}{N^{\mathrm{sm}}(R,v)}, \qquad f_{\mathrm{mem}}(R,v) = \frac{S_y^{\mathrm{sm}}(R,v)}{N^{\mathrm{sm}}(R,v)}, \tag*{(27)}

where the superscript ‘sm’ denotes the smoothed maps. Bins with Ngal(R,v)<80N_{\mathrm{gal}}(R,v) < 80 were excluded. The resulting ⟨pmem⟩\langle p_{\mathrm{mem}}\rangle field is shown in Figure 6, together with the ⟨pmem⟩=0.8\langle p_{\mathrm{mem}}\rangle= 0.8, 0.5 and 0.2 isoprobability contours and the empirical fmem=0.5f_{\mathrm{mem}} = 0.5 contour, obtained by drawing the level set fmem(R,v)=0.5f_{\mathrm{mem}}(R,v) = 0.5 from the smoothed member-fraction map.

Figure 6. Stacked projected phase-space map of the mean LSTM membership probability, ⟨pmem⟩\langle p_{\mathrm{mem}}\rangle, for the main test set. The white contours show ⟨pmem⟩=0.2\langle p_{\mathrm{mem}}\rangle= 0.2, 0.5, and 0.8, while the dashed red contour marks the empirical member-fraction contour fmem=0.5f_{\mathrm{mem}} = 0.5.

The predicted probability field follows the expected caustic-like pattern. The mean membership probability, ⟨pmem⟩\langle p_{\mathrm{mem}}\rangle, is highest near the cluster centre and at low ∣vlos∣/σlos\lvert v_{\mathrm{los}}\rvert/\sigma_{\mathrm{los}}, before decreasing towards larger projected radii and larger velocity offsets. The three isoprobability contours describe a probabilistic membership envelope, with the ⟨pmem⟩=0.8\langle p_{\mathrm{mem}}\rangle= 0.8 contour enclosing the high-confidence member-dominated region and the ⟨pmem⟩=0.2\langle p_{\mathrm{mem}}\rangle= 0.2 contour tracing the lower-probability outskirts. The ⟨pmem⟩=0.5\langle p_{\mathrm{mem}}\rangle= 0.5 contour provides a probabilistic estimate of the member–interloper transition envelope. Its close agreement with the empirical fmem=0.5f_{\mathrm{mem}} = 0.5 contour suggests that the predicted membership probabilities are locally consistent with the member fraction in stacked projected phase space.

We also examined the performance of a thresholded member selection. For a given probability threshold pthp_{\mathrm{th}}, galaxies with pmem>pthp_{\mathrm{mem}} > p_{\mathrm{th}} were selected as members, while the remaining galaxies were classified as interlopers. We define correctly identified members as true positives (TPs) and correctly identified interlopers as true negatives (TNs). Misclassified members are defined as false negatives (FNs), whereas misclassified interlopers are defined as false positives (FPs). We quantified the thresholded selection using the member completeness fcomp=TP/(TP+FN)f_{\mathrm{comp}} = \mathrm{TP}/(\mathrm{TP} + \mathrm{FN}), the member purity fpur=TP/(TP+FP)f_{\mathrm{pur}} = \mathrm{TP}/(\mathrm{TP} + \mathrm{FP}), and the interloper rejection rate frej=TN/(TN+FP)f_{\mathrm{rej}} = \mathrm{TN}/(\mathrm{TN} + \mathrm{FP}). We also report the F1F_1 score, F1=2TP/(2TP+FN+FP)F_1 = 2\mathrm{TP}/(2\mathrm{TP} + \mathrm{FN} + \mathrm{FP}), which summarises the balance between member completeness and member purity.

Figure 7 shows the performance of the thresholded membership selection as a function of pthp_{\mathrm{th}}. We adopted pth=0.5p_{\mathrm{th}} = 0.5 as a natural operating point for the calibrated membership probabilities. As shown in Figure 7, this threshold provides a good balance between member completeness and purity, while the F1F_1 score remains near its maximum over a broad range of thresholds.

Figure 7. Performance of thresholded membership selection as a function of pthp_{\mathrm{th}}. Galaxies with pmem>pthp_{\mathrm{mem}} > p_{\mathrm{th}} were selected as members. The curves show the member completeness, member purity, interloper rejection rate, and F1F_1 score, with the vertical dashed line marking pth=0.5p_{\mathrm{th}} = 0.5.

Table 1 summarises the classification result at pth=0.5p_{\mathrm{th}} = 0.5 using a row-normalised confusion matrix. The model correctly recovers 84.4% of true members and rejects 92.6% of true interlopers, while 7.4% of interlopers are misclassified as members. This corresponds to fcomp=84.4%f_{\mathrm{comp}} = 84.4\%, fpur=83.0%f_{\mathrm{pur}} = 83.0\%, frej=92.6%f_{\mathrm{rej}} = 92.6\%, and F1=83.7%F_1 = 83.7\%. We also evaluated the threshold-independent ranking performance using the average precision, AP, and the area under the receiver operating characteristic curve, ROC-AUC. The former summarises the precision–recall performance over all probability thresholds, while the latter measures the overall separability between members and interlopers. The model achieves AP = 0.913 and ROC-AUC = 0.961, indicating strong threshold-independent ranking performance, with members preferentially assigned high membership probabilities and interlopers mostly assigned lower values.

Predicted memberPredicted interloper
True member84.4%15.6%
True interloper7.4%92.6%

Table 1. Confusion matrix for the thresholded membership selection at pth=0.5p_{\mathrm{th}} = 0.5.

Notes. The rows denote the true labels, and the columns denote the predicted labels. The percentages are normalised by the number of galaxies in each true class.

Rproj/r200R_{\mathrm{proj}}/r_{200}NclusterN_{\mathrm{cluster}}fmemf_{\mathrm{mem}}fcompf_{\mathrm{comp}}fpurf_{\mathrm{pur}}frejf_{\mathrm{rej}}
0.0–1.045230.993−0.041+0.0070.993^{+0.007}_{-0.041}1.000−0.019+0.0001.000^{+0.000}_{-0.019}0.998−0.029+0.0020.998^{+0.002}_{-0.029}0.000−0.000+0.9380.000^{+0.938}_{-0.000}
1.0–2.045230.885−0.283+0.0980.885^{+0.098}_{-0.283}0.674−0.200+0.1680.674^{+0.168}_{-0.200}0.923−0.206+0.0770.923^{+0.077}_{-0.206}0.500−0.500+0.4570.500^{+0.457}_{-0.500}
2.0–3.044820.200−0.200+0.5310.200^{+0.531}_{-0.200}0.000−0.000+0.1000.000^{+0.100}_{-0.000}0.000−0.000+0.1670.000^{+0.167}_{-0.000}0.750−0.519+0.2220.750^{+0.222}_{-0.519}

Table 2. Radial dependence of the thresholded membership selection at pth=0.5p_{\mathrm{th}} = 0.5.

Notes. The statistics were computed in independent bins of Rproj/r200R_{\mathrm{proj}}/r_{200}. The values denote medians over clusters, with uncertainties indicating the 16th–84th percentile range. The number of contributing clusters in each radial bin is also listed. For each metric, cluster–bin values with zero denominators were treated as undefined and excluded from the quoted summary statistics.

Table 2 summarises the radial dependence of the thresholded membership selection at pth=0.5p_{\mathrm{th}} = 0.5. Within Rproj<r200R_{\mathrm{proj}} < r_{200}, the selected sample is nearly complete and highly pure, indicating that the LSTM probabilities retain the dominant virial-region member population. The broad percentile range of frejf_{\mathrm{rej}} in this bin is mainly caused by the small number of interlopers in many clusters, together with cluster-to-cluster variation in how these few objects are classified.

Beyond r200r_{200}, the performance of the fixed probability threshold changes markedly with projected radius. At 1<Rproj/r200<21 < R_{\mathrm{proj}}/r_{200} < 2, the selection retains high purity at the expense of completeness. At 2<Rproj/r200<32 < R_{\mathrm{proj}}/r_{200} < 3, both member completeness and purity decrease substantially, while interloper rejection becomes more effective. These trends reflect the increasing dominance of interlopers in the projected outskirts and show that a fixed threshold of pth=0.5p_{\mathrm{th}} = 0.5 does not provide uniform classification performance across projected radius.

Mass estimation

To evaluate the performance of the BNN for cluster mass estimation, we used the posterior predictive mean as the point estimate. After training, the posterior predictive distribution for each input phase-space PDF was approximated by Monte Carlo sampling from the variational posterior qϕ(θ)q_{\phi}(\theta). In this work, each prediction was computed from NMC=1000N_{\mathrm{MC}} = 1000 posterior samples. The point estimate and predictive uncertainty were then computed from these samples using Eqs. (24) and (25), respectively.

We trained BNNs using several phase-space PDF constructions. The baseline BNN2D\mathrm{BNN}_{\mathrm{2D}} uses projected phase-space PDFs constructed from galaxy LOS velocities, vlosv_{\mathrm{los}}, and projected radii, RprojR_{\mathrm{proj}}, following the CNN2D\mathrm{CNN}_{\mathrm{2D}} architecture of Ho et al. (2019), with Bayesian inference applied to the final output stage. We also trained a reference model, BNN2DPure\mathrm{BNN}^{\mathrm{Pure}}_{\mathrm{2D}}, using ‘pure’ catalogues that contain only simulation-truth member galaxies. Our fiducial membership-weighted model, BNN2DMem\mathrm{BNN}^{\mathrm{Mem}}_{\mathrm{2D}}, uses the same 2D projected phase-space representation, but the input PDF is constructed with each galaxy weighted by the LSTM-predicted membership probability pmemp_{\mathrm{mem}}, as in Eq. (19). To isolate the role of magnitude information in the membership-prediction stage, we also trained an ablation model, BNN2DMem−m\mathrm{BNN}^{\mathrm{Mem-m}}_{\mathrm{2D}}. This model uses the same membership-weighted PDF construction, but the membership probabilities are predicted by an otherwise identical LSTM network with the magnitude feature removed. The subscript −m-m denotes the removal of the standardised magnitude feature from the membership model. Figure 8 illustrates the construction of the membership-weighted phase-space PDFs for three example clusters spanning a range of halo masses. As an additional comparison, we included BNN3DMag\mathrm{BNN}^{\mathrm{Mag}}_{\mathrm{3D}}, which incorporates normalised galaxy magnitude directly as a third coordinate in the KDE-based input PDF. Unlike the membership-weighted 2D PDF in Eq. (19), where pmemp_{\mathrm{mem}} enters as a galaxy weight, BNN3DMag\mathrm{BNN}^{\mathrm{Mag}}_{\mathrm{3D}} constructs a 3D PDF in (v~los,ρ,M~r)(\tilde{v}_{\mathrm{los}}, \rho, \tilde{M}_{r}), using a kernel KH[(v~los,ρ,M~r)−(v~los,j,ρj,M~r,j)]K_{\mathrm{H}} \left[ (\tilde{v}_{\mathrm{los}}, \rho, \tilde{M}_{r}) - (\tilde{v}_{\mathrm{los},j}, \rho_j, \tilde{M}_{r,j}) \right].

Figure 8. Examples of projected phase-space PDFs for three clusters spanning a range of halo masses. Columns: PDFs constructed from all galaxies, from members only, and from all galaxies weighted by the predicted membership probability, pmemp_{\mathrm{mem}}. The pmemp_{\mathrm{mem}}-weighted PDFs in the right column are used as inputs to the BNN mass-estimation model. For each row, the member-only and pmemp_{\mathrm{mem}}-weighted panels share the same colour scale.

Notes. The ECE was computed using the cluster-equal weighting defined in Sect. 4.1.

Figure 9 summarises the point-estimation performance of these models. The 2D-based models are broadly unbiased over the full mass range, with median predictions close to the one-to-one relation and median residuals generally centred near zero. By contrast, BNN3DMag\mathrm{BNN}^{\mathrm{Mag}}_{\mathrm{3D}} tends to underestimate cluster masses, as indicated by its slightly negative median residuals.

Figure 9. Point-estimation performance of the BNN mass-estimation models on the main test set. Top panels: Predicted mass as a function of true cluster mass. Bottom panels: Residuals, ϵ=log⁡10(Mpred/Mtrue)\epsilon= \log_{10}(M_{\mathrm{pred}}/M_{\mathrm{true}}). The dash-dotted black line marks the one-to-one relation, and the solid coloured curves show the median prediction or residual in bins of true mass. The shaded regions indicate the central 68% and 95% ranges. The residual scatter is reported as σϵ\sigma_{\epsilon} in each panel.

The residuals shown in Figure 9 are defined as ϵ=log⁡10(Mpred/Mtrue)\epsilon= \log_{10}(M_{\mathrm{pred}}/M_{\mathrm{true}}). For all models, the residual scatter decreases towards higher cluster masses, indicating more precise mass estimates in the high-mass regime. Interloper contamination increases the scatter, as shown by the broader residual distributions of the baseline BNN2D\mathrm{BNN}_{\mathrm{2D}} model compared with the idealised BNN2DPure\mathrm{BNN}^{\mathrm{Pure}}_{\mathrm{2D}} reference model. Relative to the baseline BNN2D\mathrm{BNN}_{\mathrm{2D}}, the models incorporating additional galaxy information all reduce the residual scatter. The fiducial membership-weighted model, BNN2DMem\mathrm{BNN}^{\mathrm{Mem}}_{\mathrm{2D}}, achieves the lowest scatter among the contaminated-catalogue models, with σϵ=0.120\sigma_{\epsilon} = 0.120, corresponding to a 19.5% reduction relative to the baseline BNN2D\mathrm{BNN}_{\mathrm{2D}}. The ablation model BNN2DMem−m\mathrm{BNN}^{\mathrm{Mem-m}}_{\mathrm{2D}} gives σϵ=0.127\sigma_{\epsilon} = 0.127, a 14.8% reduction, while the magnitude-augmented model BNN3DMag\mathrm{BNN}^{\mathrm{Mag}}_{\mathrm{3D}} gives σϵ=0.135\sigma_{\epsilon} = 0.135, a 9.4% reduction. Thus, using membership probabilities to weight the projected phase-space PDFs provides the strongest improvement in point-estimation precision, with the inclusion of magnitude information in the membership-prediction stage giving a modest additional gain.

To assess the effect of sequence construction, we compared the fiducial ordering with the random ordering described in Sect. 3.1. We reconstructed the membership-weighted KDE inputs from the random-order LSTM predictions and retrained the corresponding BNN2DMem\mathrm{BNN}^{\mathrm{Mem}}_{\mathrm{2D}}. As shown in Table 3, the two schemes yield comparable overall performance in membership identification and mass estimation, with the fiducial ordering giving a lower calibration error and a slightly smaller mass residual scat- @page 10/16 starts_mid=0 ends_mid=1 ter. Under the same training settings and stopping criterion, the random-order LSTM was trained for approximately 300 more epochs than the nearest-neighbour model. This suggests that the adopted ordering may facilitate optimisation.

OrderingAPECEσϵ\sigma_{\epsilon} (dex)
Nearest-neighbour0.9130.0030.120
Random0.9110.0090.124

Table 3. Effect of galaxy sequence ordering on membership identification and cluster mass estimation in the main test set.

Figure 10 shows the calibration curves for the predictive uncertainties of the different mass-estimation models. The curves compare the nominal confidence levels of the central predictive intervals with their empirical coverage fractions. Here, the intervals are constructed from the posterior predictive mean and the total predictive standard deviation using a Gaussian approximation to the posterior predictive distribution. The different mass-estimation models show distinct uncertainty-calibration behaviours. The baseline BNN2D\mathrm{BNN}_{2\mathrm{D}} and the magnitude-independent membership model BNN2DMem−m\mathrm{BNN}^{\mathrm{Mem}-m}_{2\mathrm{D}} remain relatively close to the ideal relation, although both show moderate under-coverage. The idealised BNN2DPure\mathrm{BNN}^{\mathrm{Pure}}_{2\mathrm{D}} model exhibits stronger under-coverage, while BNN3DMag\mathrm{BNN}^{\mathrm{Mag}}_{3\mathrm{D}} shows the largest deviation from ideal calibration. In contrast, the fiducial BNN2DMem\mathrm{BNN}^{\mathrm{Mem}}_{2\mathrm{D}} model systematically over-covers, indicating more conservative predictive intervals. These results show that improved point-estimation precision does not necessarily imply better uncertainty calibration.

Figure 10. Calibration curves for the predictive uncertainties of different cluster mass-estimation models on the main test set. The horizontal axis shows the nominal confidence level of the central predictive interval, and the vertical axis shows the observed coverage, defined as the fraction of test clusters whose true masses fall within that interval. The diagonal dashed line indicates ideal calibration.

To further characterise the predicted uncertainty scale, we examined the uncertainty-normalised residuals, ϵ~=ϵ/σpred\tilde{\epsilon} = \epsilon/\sigma_{\mathrm{pred}}. For an unbiased and well-calibrated Gaussian predictive distribution, ϵ~\tilde{\epsilon} should have a mean close to zero and a standard deviation close to unity. The normalised-residual statistics are consistent with the coverage behaviour described above, while also revealing departures from Gaussianity. In particular, the fiducial BNN2DMem\mathrm{BNN}^{\mathrm{Mem}}_{2\mathrm{D}} model has a narrower normalised-residual distribution, consistent with its conservative predictive intervals, whereas BNN3DMag\mathrm{BNN}^{\mathrm{Mag}}_{3\mathrm{D}} shows the broadest distribution and a non-zero mean residual. The non-zero skewness and excess kurtosis of several models further indicate that the normalised residual distributions are not strictly Gaussian, suggesting that the Gaussian approximation does not fully characterise the predictive uncertainties.

Model⟨ϵ~⟩\langle\tilde{\epsilon}\rangleσϵ~\sigma_{\tilde{\epsilon}}SkewnessExcess kurtosisP(∣ϵ~∣<1)P(|\tilde{\epsilon}| < 1)P(∣ϵ~∣<2)P(|\tilde{\epsilon}| < 2)P(∣ϵ~∣<3)P(|\tilde{\epsilon}| < 3)
BNN2DPure\mathrm{BNN}^{\mathrm{Pure}}_{2\mathrm{D}}0.1441.4090.3120.85854.6%85.7%96.0%
BNN2D\mathrm{BNN}_{2\mathrm{D}}−0.0421.2400.3751.68961.6%90.4%97.6%
BNN2DMem\mathrm{BNN}^{\mathrm{Mem}}_{2\mathrm{D}}0.0390.9220.8403.59976.2%96.7%99.4%
BNN2DMem−m\mathrm{BNN}^{\mathrm{Mem-m}}_{2\mathrm{D}}0.0981.2360.6722.14062.9%90.8%97.7%
BNN3DMag\mathrm{BNN}^{\mathrm{Mag}}_{3\mathrm{D}}−0.2671.7830.4194.01346.2%77.3%91.9%

Table 4. Summary statistics of the uncertainty-normalised residuals.

Notes. Here, ϵ~=ϵ/σpred\tilde{\epsilon} = \epsilon/\sigma_{\mathrm{pred}}, where ϵ=log⁡10(Mpred/Mtrue)\epsilon= \log_{10}(M_{\mathrm{pred}}/M_{\mathrm{true}}). For a well-calibrated Gaussian predictive distribution, ⟨ϵ~⟩≃0\langle\tilde{\epsilon}\rangle\simeq0, σϵ~≃1\sigma_{\tilde{\epsilon}} \simeq1, and both the skewness and excess kurtosis are close to zero.

Effects of miscentring and data incompleteness

In this subsection, we discuss employing the BNN2DMem\mathrm{BNN}^{\mathrm{Mem}}_{2\mathrm{D}} model to assess the effects of centre offset and galaxy incompleteness on cluster mass estimation. We assessed the sensitivity of the network to cluster miscentring using the mock off-centre test set described in Sect. 2.3. For each system, we compared predictions obtained from projections centred on the gravitational centre with those obtained after recentring the projection on the BCG. In relaxed systems, the BCG is generally expected to lie close to the gravitational centre, whereas significant offsets between the BCG or optical centre and other cluster-centre definitions are commonly associated with dynamically disturbed systems ([36, 56]). We denote the projected separation between the two adopted centres as Roff−centreR_{\mathrm{off-centre}}.

We divided the off-centre test set into three equal-number bins according to Roff−centreR_{\mathrm{off-centre}}, with bin boundaries at 0.2710.271 and 0.735 h−1 Mpc0.735\ h^{-1}\,\mathrm{Mpc}. We denote the cluster-mass predictions obtained from projections centred on the gravitational centre and on the BCG as MGCM_{\mathrm{GC}} and MBCGM_{\mathrm{BCG}}, respectively. Figure 11 compares these predictions with the true cluster masses for the three Roff−centreR_{\mathrm{off-centre}} bins. The MGCM_{\mathrm{GC}}–MtrueM_{\mathrm{true}} relation remains similar to that found for the main test set, with no strong systematic separation among the three Roff−centreR_{\mathrm{off-centre}} bins. The corresponding residual scatters are σϵ=0.113\sigma_{\epsilon} = 0.113, 0.1240.124, and 0.1230.123 for the low-, intermediate-, and high-offset bins, respectively. These values are comparable to σϵ=0.120\sigma_{\epsilon}=0.120 obtained for the main test set and show no clear monotonic trend with Roff−centreR_{\mathrm{off-centre}}. Thus, we find no clear degradation of the gravitational-centre-based predictions with increasing Roff−centreR_{\mathrm{off-centre}}. By contrast, systems in the largest Roff−centreR_{\mathrm{off-centre}} bin tend to have lower MBCGM_{\mathrm{BCG}} at fixed MtrueM_{\mathrm{true}}, particularly at the high-mass end. This behaviour is also seen in the MGCM_{\mathrm{GC}}–MBCGM_{\mathrm{BCG}} comparison, where the largest-offset systems more often lie below the one-to-one relation, indicating MGC>MBCGM_{\mathrm{GC}}>M_{\mathrm{BCG}}. At the high-mass end, the small number of systems within each Roff−centreR_{\mathrm{off-centre}} bin leads to broader percentile ranges. Quantitatively, relative to the predictions obtained from projections centred on the gravitational centre, the median mass changes are −16.8%-16.8\%, −26.0%-26.0\%, and −47.6%-47.6\% for the low-, intermediate-, and high-offset subsamples, respectively.

Figure 11. Mass comparisons for the off-centre test set, where MGCM_{\mathrm{GC}} and MBCGM_{\mathrm{BCG}} denote the mass predictions obtained from projections centred on the gravitational centre and on the BCG, respectively, using BNN2DMem^{\mathrm{Mem}}_{\mathrm{2D}}. The sample is divided into three equal-number bins according to Roff−centreR_{\mathrm{off-centre}}, defined as the projected separation between the gravitational centre and the BCG centre, with bin boundaries at 0.271 and 0.735 h−1 Mpch^{-1}\,\mathrm{Mpc}. The points indicate medians; the error bars indicate the 16th–84th percentile ranges; and dashed lines mark the one-to-one relations.

Overall, the predictions centred on the gravitational centre are relatively insensitive to Roff−centreR_{\mathrm{off-centre}}, while the BCG-centred predictions show larger deviations for systems with the largest projected separations. If Roff−centreR_{\mathrm{off-centre}} is interpreted as an indirect indicator of dynamical state, this contrast suggests that, for the present model and sample, the inferred masses are more sensitive to the choice of centre than to dynamical state. However, because Roff−centreR_{\mathrm{off-centre}} also directly quantifies BCG miscentring, the present comparison cannot fully disentangle the effects of dynamical state and centring.

In addition to off-centring, we also tested the impact of incomplete galaxy information on the mass estimates. We randomly selected 1,000 clusters from the main test set and artificially removed galaxies from different projected radial ranges at missing fractions of 0.1, 0.2, and 0.4. Figure 12 shows the prediction shift induced by incompleteness, measured as log⁡10(M^pred/Mpred)\log_{10}(\hat{M}_{\mathrm{pred}}/M_{\mathrm{pred}}), where MpredM_{\mathrm{pred}} and M^pred\hat{M}_{\mathrm{pred}} are the predictions from the original and incomplete catalogues, respectively. For the membership-weighted model, BNN2DMem^{\mathrm{Mem}}_{\mathrm{2D}}, the prediction shifts remain small across the tested radial ranges at missing fractions of 0.1 and 0.2. This suggests that incompleteness at these levels does not strongly perturb the membership-weighted mass estimation. With increasing incompleteness, however, the model begins to show a tendency towards lower predicted masses relative to the original catalogues. This effect is strongest when galaxies are removed from the inner region, indicating that the mass prediction is particularly sensitive to incompleteness within r200r_{200}. For the case with the strongest incompleteness in the central region, in which 40% of the eligible non-central galaxies within r200r_{200} are removed, the median inferred mass decreases by 6.1% relative to the complete catalogues.

Figure 12. Effect of radially dependent incompleteness on the BNN mass predictions. Top: Membership-weighted model, BNN2DMem_{2D}^{\mathrm{Mem}}. Bottom: Phase-space-only baseline, BNN2D_{2D}. The horizontal axis shows the true cluster mass, and the vertical axis shows log⁡10(M^pred/Mpred)\log_{10}(\hat{M}_{\mathrm{pred}}/M_{\mathrm{pred}}), where MpredM_{\mathrm{pred}} and M^pred\hat{M}_{\mathrm{pred}} are the predictions from the original and incomplete catalogues, respectively. Columns: Galaxy missing fractions of 0.1, 0.2, and 0.4. The different colours and marker shapes denote the radial ranges from which galaxies are removed: 0–1 r200r_{200}, 1–2 r200r_{200}, and 2–3 r200r_{200}. The symbols and error bars show the median and central 68% interval in each true-mass bin.

For comparison, the phase-space-only baseline BNN2D_{\mathrm{2D}} shows a stronger radius-dependent response under severe incompleteness. At a missing fraction of 0.4, removing inner galaxies also lowers the predicted mass, while removing galaxies from the outer region can shift the prediction upwards relative to the original catalogue. This opposite response may be related to the normalisation of the input phase-space PDF, because removing outer galaxies reduces the relative contribution of the outskirts and can make the remaining normalised PDF appear more centrally concentrated. The weaker response of BNN2DMem^{\mathrm{Mem}}_{\mathrm{2D}} indicates that membership weighting reduces, but does not eliminate, the impact of radially dependent incompleteness.

Application to observed clusters

To examine the behaviour of our model on observed systems, we performed an external consistency check using a sample of observed galaxy clusters. We first defined an observational parent pool based on the cluster compilation of Groener et al. (2016). From this catalogue, we selected systems with published M200M_{200} estimates in the range 101410^{14}–1015 M⊙10^{15}\,M_{\odot}, SDSS Data Release 17 (DR17) spectroscopic coverage [2], and redshifts z≤0.3z\leq0.3. We also required at least ten galaxies with spectroscopic redshifts within a BCG-centred aperture of Rproj≤0.5 h−1 MpcR_{\mathrm{proj}}\leq0.5\,h^{-1}\,\mathrm{Mpc}, ensuring a minimum level of central spectroscopic sampling. This selection yields a parent pool of 87 clusters.

From this parent pool, we constructed a test sample of 16 clusters, comprising eight deliberately selected systems spanning a range of astrophysical environments and dynamical states and eight randomly drawn clusters. The deliberately selected subsample includes four well-studied systems—Perseus, Coma, Abell 2142, and Abell 2199—the poorer system MKW 4 (O’Sullivan et al. 2003), the evolved off-axis merger Abell 119 (Watson et al. 2023), the unrelaxed merging cluster Abell 1132 (Wilber et al. 2018), and Abell 2061, which shows merger-related disturbances and forms part of the pre-merger Abell 2061–Abell 2067 system (Marini et al. 2004; Pignataro et al. 2024). For each cluster, we centred the system on the BCG and selected galaxies within a projected aperture of Rproj≤4 h−1 MpcR_{\mathrm{proj}} \leq4\,h^{-1}\,\mathrm{Mpc} and a LOS velocity window of ∣vlos∣≤3000 km s−1\lvert v_{\mathrm{los}}\rvert\leq3000\,\mathrm{km}\,\mathrm{s}^{-1}.

We then adopted the reported M200M_{200} values from recent observational studies as the literature masses, MlitM_{\mathrm{lit}}, for each system. The measurements were compiled from weak-lensing, X-ray, or dynamical analyses. We note that the resulting MlitM_{\mathrm{lit}} values are not derived from a single homogeneous analysis pipeline and therefore may include method-dependent systematic differences. Predicted masses, MpredM_{\mathrm{pred}}, were obtained using the same inference framework as in the simulations. For the SDSS spectroscopic application, we adopted the previously introduced BNN2DMem-m_{2D}^{\mathrm{Mem\text{-}m}} model, which excludes magnitude information from the LSTM membership-model inputs, thereby avoiding possible biases due to differences between the simulated CSST rr-band magnitudes and the SDSS photometric system.

Figure 13 compares the model-predicted masses with the adopted literature masses for the 16 observed clusters listed in Table 5. The residuals, defined as Δlog⁡M=log⁡Mpred−log⁡Mlit\Delta\log M = \log M_{\mathrm{pred}} - \log M_{\mathrm{lit}}, have a mean offset of −0.090±0.054-0.090 \pm0.054 dex and a sample standard deviation of 0.216 dex, where the uncertainty on the mean denotes the standard error. The negative mean offset suggests a modest tendency for the model to predict lower masses than the literature estimates; however, it remains consistent with zero at the 2σ2\sigma level within this limited sample. We further compared systems with literature masses derived from conventional galaxy-dynamical methods (Dyn., line-of-sight velocity dispersion, or Caustic) with the remaining systems. For the eleven systems in the dynamical subset, the mean offset is ⟨Δlog⁡M⟩dyn=−0.095±0.059\langle\Delta\log M\rangle_{\mathrm{dyn}} = -0.095 \pm0.059 dex, with a sample standard deviation of 0.196 dex. For the remaining five systems, whose literature estimates are listed as X-ray, the CHileAN Cluster galaxy Evolution Survey (CHANCES)/Multi-Epoch Nearby Cluster Survey (MENeaCS) catalogue, or weak lensing, the mean offset is −0.078±0.126-0.078 \pm0.126 dex, with a sample standard deviation of 0.281 dex. The two subsets have similar mean offsets, with a larger residual scatter in the remaining five systems.

Figure 13. Comparison between the predicted cluster masses MpredM_{\mathrm{pred}} from the BNN2DMem-m_{2D}^{\mathrm{Mem\text{-}m}} model and literature masses MlitM_{\mathrm{lit}} for the observational sample. Literature masses are reported as M200M_{200}. The dashed line denotes the one-to-one relation.

ClusterzzMpredM_{\mathrm{pred}}MlitM_{\mathrm{lit}}Lit. source
Perseus0.017015.018 ±\pm 0.06014.909−0.074+0.06314.909^{+0.063}_{-0.074}Dyn. (1)
Coma0.023014.778 ±\pm 0.07814.862−0.053+0.04514.862^{+0.045}_{-0.053}Dyn. (2)
Abell 21990.030014.703 ±\pm 0.08314.923−0.048+0.07014.923^{+0.070}_{-0.048}X-ray (3)
Abell 21420.090914.925 ±\pm 0.06414.965−0.016+0.01614.965^{+0.016}_{-0.016}X-ray (4)
MKW 40.020014.133 ±\pm 0.09513.817−0.073+0.06213.817^{+0.062}_{-0.073}X-ray (5)
Abell 20610.078314.237 ±\pm 0.13714.509LOSVD (6)
Abell 1190.044614.720 ±\pm 0.08314.722CHANCES/MENeaCS (7)
Abell 11320.136914.360 ±\pm 0.08814.421−0.004+0.00414.421^{+0.004}_{-0.004}Caustic (8)
Abell 10660.068914.508 ±\pm 0.06714.710Dyn. (9)
Abell 1291A0.051313.748 ±\pm 0.13213.830Dyn. (9)
Abell 24280.084013.911 ±\pm 0.13014.027−0.013+0.01214.027^{+0.012}_{-0.013}Caustic (8)
RXCJ1210.3+05230.076014.217 ±\pm 0.10713.860Caustic (10)
Abell 17730.077414.478 ±\pm 0.07214.810Dyn. (9)
Abell 20640.073714.176 ±\pm 0.08214.460Dyn. (9)
Abell 26700.076014.525 ±\pm 0.11114.608−0.009+0.00914.608^{+0.009}_{-0.009}Caustic (8)
ZwCl0104.4+00480.254013.925 ±\pm 0.11214.367−0.188+0.15914.367^{+0.159}_{-0.188}WL (11)

Table 5. Dynamical mass inference for observed clusters.

Notes. All masses are log⁡10[M200/(h−1M⊙)]\log_{10}[M_{200}/(h^{-1}M_\odot)]. Uncertainties in MpredM_{\mathrm{pred}} are 1σ1\sigma predictive uncertainties from the BNN2DMem−m_{2\mathrm{D}}^{\mathrm{Mem-m}}. Literature methods are abbreviated as X-ray, Dyn. (dynamical/kinematic), LOSVD (line-of-sight velocity dispersion), Caustic (caustic mass estimate), and WL (weak lensing). CHANCES (CHileAN Cluster galaxy Evolution Survey)/MENeaCS (Multi-Epoch Nearby Cluster Survey) denotes a homogeneous catalogue mass estimate based on the MENeaCS input catalogue. We adopt h=0.6766h = 0.6766, consistent with the JT1G cosmology.

References. (1) Aguerri et al. [4]; (2) Pedratti et al. [43]; (3) Babyk et al. [6]; (4) Ettori et al. [14]; (5) Sarkar et al. [54]; (6) Groener et al. [22]; (7) Sifón et al. [59]; (8) Pizzardo et al. [46]; (9) Kopylova & Kopylov [33]; (10) Smith et al. [60]; (11) Okabe & Smith [41].

Conclusion

We presented an LSTM-based framework for assigning membership probabilities to galaxies within a fixed projected aperture of Rproj=4h−1MpcR_{\mathrm{proj}} = 4 h^{-1}\mathrm{Mpc} around galaxy clusters. On the main test set, the predicted membership probabilities are well calibrated and show no substantial mass-dependent calibration bias. In projected phase space, these probabilities form a caustic-like membership envelope whose ⟨pmem⟩=0.5\langle p_{\mathrm{mem}}\rangle= 0.5 contour broadly traces the empirical member–interloper transition.

As a binary member-classification benchmark, adopting pth=0.5p_{\mathrm{th}} = 0.5 yields a good balance between completeness and purity on the main test set, with fcomp=84.4%f_{\mathrm{comp}} = 84.4\%, fpur=83.0%f_{\mathrm{pur}} = 83.0\%, and F1=83.7%F_1 = 83.7\%. The model also shows threshold-independent ranking performance, with AP = 0.913 and ROC-AUC = 0.961. The pth=0.5p_{\mathrm{th}} = 0.5 selection is nearly complete and highly pure within Rproj<r200R_{\mathrm{proj}} < r_{200}, but its performance varies substantially at larger projected radii, showing that a single global threshold does not provide a uniform balance between completeness and purity across projected radius.

The order sensitivity of recurrent architectures makes the construction of the input pseudo-sequence an important part of the LSTM design. Our adopted ordering is motivated by the local coherence of cluster galaxies in projected phase space. By iteratively connecting galaxies with similar projected positions and LOS velocities, the pseudo-sequence is intended to facilitate the use of local contextual information by the recurrent network. Nevertheless, this ordering should not be interpreted as a physical temporal sequence or as a reconstruction of the galaxies’ accretion histories. The comparison with random ordering shows similar overall performance in membership identification and mass estimation. This may partly reflect the fact that randomising the sequence changes the order and adjacency of the galaxies but leaves the feature values associated with each galaxy unchanged. In particular, the projected positions and normalised LOS velocities used to construct the fiducial ordering remain available to the model, together with local-density and cluster-level information. The bidirectional LSTM can still use contextual information from both directions along the sequence. We retain the nearest-neighbour ordering as a consistent procedure for constructing input sequences from simulated and observed galaxy catalogues. Whether other ordering schemes can further improve performance remains to be explored.

For cluster mass inference, we used the LSTM membership probabilities to construct membership-weighted projected phase-space PDFs as inputs to the BNN mass-estimation model. Among the contaminated-catalogue models, the fiducial BNN2DMem_{2\mathrm{D}}^{\mathrm{Mem}} model achieves the lowest residual scatter, σϵ=0.120\sigma_{\epsilon} = 0.120, corresponding to a 19.5% reduction relative to the unweighted BNN2D_{2\mathrm{D}} baseline. The magnitude-independent membership model, BNN2DMem−m_{2\mathrm{D}}^{\mathrm{Mem-m}}, yields a smaller improvement, while directly incorporating magnitude as a third KDE coordinate in BNN3DMag_{3\mathrm{D}}^{\mathrm{Mag}} is less effective than using it to refine the LSTM membership probabilities.

The predictive-uncertainty calibration varies across the mass-estimation models. The fiducial BNN2DMem_{2\mathrm{D}}^{\mathrm{Mem}} model achieves the best point-estimation precision among the contaminated-catalogue models but produces comparatively conservative predictive intervals, whereas the other models show varying degrees of under-coverage. The normalised-residual distributions also exhibit departures from Gaussianity, showing that improved mass precision does not necessarily imply well-calibrated predictive uncertainties. These departures from ideal uncertainty calibration may partly reflect the approximate Bayesian treatment adopted here, in which only the final output stage is treated probabilistically while the convolutional feature extractor remains deterministic, together with the limited flexibility of the mean-field variational posterior [67, 23, 20].

We further tested the model under two observationally motivated systematics: cluster miscentring and radially dependent incompleteness. For systems with large BCG–gravitational-centre offsets, BCG-centred predictions are typically lower than their gravitational-centre counterparts, showing that large centre offsets can affect the inferred masses. Radially dependent incompleteness produces increasingly large prediction shifts as the missing fraction increases, with the strongest effect occurring when galaxies are removed from within r200r_{200}. Both miscentring and incompleteness may also affect the inferred masses indirectly by altering the nearest-neighbour pseudo-sequence, making the sequence construction an additional channel through which observational systematics can propagate into the LSTM membership probabilities.

As an initial test on observed systems, we applied the magnitude-independent BNNMem−-m2D_{2\mathrm{D}} model to a sample of 16 nearby SDSS clusters spanning a range of masses and dynamical states. For this limited sample, the comparison with the adopted literature M200M_{200} estimates provides no strong evidence for a non-zero mean logarithmic mass offset. The observational comparison remains subject to differences between the idealised mock catalogues and real spectroscopic samples, including uncertainties in cluster centring, incomplete and non-uniform spectroscopic sampling, and survey selection effects. These results motivate further applications of the framework to larger and more representative observational cluster samples.

Acknowledgements. L.P.F. acknowledges support from the National Natural Science Foundation of China (NSFC; grant No. 12541302), the Innovation Program of Shanghai Municipal Education Commission (grant No. 2025GDZKZD04), and the China Manned Space Project (grant No. CMS-CSST-2025-A05). W.D. acknowledges support from the China Manned Space Project (grant Nos. CMS-CSST-2025-A02 and CMS-CSST-2025-A03). Z.J.L. acknowledges support from the National Natural Science Foundation of China (grant No. 12573009) and the scientific research grant from the China Manned Space Project (grant No. CMS-CSST-2025-A07).

References

  1. [1]Abbott, T. M. C., Adamów, M., Aguena, M., et al. 2021, ApJS, 255, 20
  2. [2]Abdurro’uf, Accetta, K., Aerts, C., et al. 2022, ApJS, 259, 35
  3. [3]Adelman-McCarthy, J. K., Agüeros, M. A., Allam, S. S., et al. 2007, ApJS, 172, 634
  4. [4]Aguerri, J. A. L., Agulli, I., Dalla Vecchia, C., Dominguez-Palmero, L., & Diaferio, A. 2020, MNRAS, 494, 1681
  5. [5]Almeida, A., Anderson, S. F., Argudo-Fernández, M., et al. 2023, ApJS, 267, 44
  6. [6]Babyk, I. V., Del Popolo, A., & Vavilova, I. B. 2014, Astron. Rep., 58, 587
  7. [7]Bett, P., Eke, V., Frenk, C. S., et al. 2007, MNRAS, 376, 215
  8. [8]Bingham, E., Chen, J. P., Jankowiak, M., et al. 2019, J. Mach. Learn. Res., 20, 1
  9. [9]Biviano, A., Murante, G., Borgani, S., et al. 2006, A&A, 456, 23
  10. [10]Chen, J., Luo, Z., Fu, L., et al. 2026, ApJS, 282, 46
  11. [11]Diaferio, A., Geller, M., & Rines, K. 2005, ApJL, 628, L97
  12. [14]Ettori, S., Ghirardini, V., Eckert, D., et al. 2019, A&A, 621, A39
  13. [15]Euclid Collaboration, Adam, R., Vannier, M., et al. 2019, A&A, 627, A23
  14. [16]Euclid Collaboration, Mellier, Y., Abdurro’uf, et al. 2025, A&A, 697, A1
  15. [18]Falco, M. 2013, PhD thesis, University of Copenhagen
  16. [19]Falco, M., Hansen, S. H., Wojtak, R., et al. 2014, MNRAS, 442, 1887
  17. [20]Foong, A. Y. K., Li, Y., Hernández-Lobato, J. M., & Turner, R. E. 2019, arXiv preprint arXiv:1906.11537arxiv.org/abs/1906.11537
  18. [21]Gong, Y., Miao, H., Zhou, X., et al. 2025, Sci. China Phys. Mech. Astron., 68, 280402
  19. [22]Groener, A. M., Goldberg, D. M., & Sereno, M. 2016, MNRAS, 455, 892
  20. [23]Harrison, J., Willes, J., & Snoek, J. 2024, in The Twelfth International Conference on Learning Representations
  21. [24]Henriques, B. M. B., White, S. D. M., Thomas, P. A., et al. 2015, MNRAS, 451, 2663
  22. [27]Hochreiter, S. & Schmidhuber, J. 1997, Neural Comput., 9, 1735
  23. [28]Hoekstra, H., Bartelmann, M., Dahle, H., et al. 2013, Space Sci. Rev., 177, 75
  24. [29]Ivezić, Ž., Kahn, S. M., Tyson, J. A., et al. 2019, ApJ, 873, 111
  25. [30]Jospin, L. V., Laga, H., Bouss aid, F., Buntine, W., & Bennamoun, M. 2022, IEEE Comput. Intell. Mag., 17, 29
  26. [31]Kodi Ramanah, D., Wojtak, R., Ansari, Z., Gall, C., & Hjorth, J. 2020, MNRAS, 499, 1985
  27. [33]Kopylova, F. G. & Kopylov, A. I. 2022, Astrophys. Bull., 77, 347
  28. [34]Kravtsov, A. V. & Borgani, S. 2012, ARA&A, 50, 353–409
  29. [36]Lopes, P. A. A., Trevisan, M., Lagana, T. F., et al. 2018, MNRAS, 478, 5473
  30. [37]Luo, Z., Li, Y., Lu, J., et al. 2024, MNRAS, 535, 1844
  31. [40]Ntampaka, M., Trac, H., Sutherland, D. J., et al. 2016, ApJ, 831, 135
  32. [41]Okabe, N. & Smith, G. P. 2016, MNRAS, 461, 3794
  33. [43]Pedratti, S., Pizzuti, L., Fossati, M., et al. 2026, A&A, 710, A218
  34. [44]Pei, W., Guo, Q., Li, M., et al. 2024, MNRAS, 529, 4958
  35. [46]Pizzardo, M., Di Gioia, S., Diaferio, A., et al. 2021, A&A, 646, A105
  36. [47]Planck Collaboration, Ade, P. A. R., Aghanim, N., et al. 2014, A&A, 571, A20
  37. [48]Planck Collaboration, Ade, P. A. R., Aghanim, N., et al. 2013, A&A, 550, A129
  38. [49]Planck Collaboration, Aghanim, N., Akrami, Y., et al. 2020, A&A, 641, A1
  39. [50]Ramella, M., Boschin, W., Fadda, D., & Nonino, M. 2001, A&A, 368, 776
  40. [51]Rozo, E., Rykoff, E. S., Becker, M., Reddick, R. M., & Wechsler, R. H. 2015, MNRAS, 453, 38
  41. [52]Rozo, E., Wechsler, R. H., Rykoff, E. S., et al. 2010, ApJ, 708, 645
  42. [53]Rykoff, E. S., Rozo, E., Hollowood, D., et al. 2016, ApJS, 224, 1
  43. [54]Sarkar, A., Su, Y., Randall, S. W., et al. 2021, MNRAS, 501, 3767
  44. [55]Schuecker, P., Böhringer, H., Collins, C. A., & Guzzo, L. 2003, A&A, 398, 867
  45. [56]Seppi, R., Comparat, J., Nandra, K., et al. 2023, A&A, 671, A57
  46. [57]Serra, A. L. & Diaferio, A. 2013, ApJ, 768, 116
  47. [58]Serra, A. L., Diaferio, A., Murante, G., & Borgani, S. 2011, MNRAS, 412, 800
  48. [59]Sifón, C., Figueroa, A., Haines, C. P., et al. 2025, A&A, 697, A92
  49. [60]Smith, R., Hwang, H. S., Kraljic, K., et al. 2023, MNRAS, 525, 4685
  50. [61]Sohn, J., Geller, M. J., Diaferio, A., & Rines, K. J. 2020, ApJ, 891, 129
  51. [62]Springel, V. 2005, MNRAS, 364, 1105
  52. [63]Springel, V., White, S. D. M., Tormen, G., & Kauffmann, G. 2001, MNRAS, 328, 726
  53. [64]van der Marel, R. P., Magorrian, J., Carlberg, R. G., Yee, H. K. C., & Ellingson, E. 2000, AJ, 119, 2038
  54. [65]Van Houdt, G., Mosquera, C., & Nápoles, G. 2020, Artif. Intell. Rev., 53, 5929
  55. [67]Watson, J., Andreas, L. N., Klink, P., Pajarinen, J., & Peters, J. 2021, in Proceedings of Machine Learning Research, Vol. 130, Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, ed. A. Banerjee & K. Fukumizu (PMLR), 1198–1206
  56. [68]Wen, Z., Han, J., & Liu, F. 2010, MNRAS, 407, 533
  57. [69]Wen, Z. L., Han, J. L., & Liu, F. S. 2012, ApJS, 199, 34
  58. [71]Wojtak, R. & Łokas, E. L. 2007, MNRAS, 377, 843
  59. [72]Zeng, J., Lesniakowski, A., & Álvarez, J. 2018, ArXiv, arXiv:1811.12535arxiv.org/abs/1811.12535
  60. [73]Zhang, Y., Chen, M., Wen, Z., & Fang, W. 2023, Res. Astron. Astrophys., 23, 045011

Paper details

vlnc:W_2t3xeytv
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents