Paper deep dive
Contrastive Metric Learning for Point Cloud Segmentation in Highly Granular Detectors
Max Marriott-Clarke, Lazar Novakovic, Elizabeth Ratzer, Robert J. Bainbridge, Loukas Gouskos, Benedikt Maier
Intelligence
Status: succeeded | Model: google/gemini-3.1-flash-lite-preview | Prompt: intel-v1 | Confidence: 94%
Last extracted: 3/26/2026, 1:46:56 AM
Summary
The paper introduces Contrastive Metric Learning (CML) as a novel approach for point-cloud segmentation in highly granular particle detectors, such as the CMS High Granularity Calorimeter. By learning a latent representation where hits from the same particle shower are embedded nearby and unrelated hits are separated, CML decouples representation learning from cluster formation. This method is compared against Object Condensation (OC) using identical graph neural network backbones. Results demonstrate that CML provides a more stable, separable embedding geometry, leading to improved reconstruction efficiency, purity, and energy resolution, particularly in high-multiplicity environments with significant shower overlap.
Entities (5)
Relation Signals (3)
Contrastive Metric Learning → appliedto → CMS High Granularity Calorimeter
confidence 95% · The proposed approach is evaluated on simulated electromagnetic (EM) and hadronic (HAD) showers in a detector model inspired by the CMS HGCAL.
Graph Neural Network → usedin → Contrastive Metric Learning
confidence 95% · Both learning objectives employ an identical GNN backbone to permit a direct comparison.
Contrastive Metric Learning → outperforms → Object Condensation
confidence 90% · CML produces a more stable and separable embedding geometry... while OC exhibits significant degradation.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:We propose a novel clustering approach for point-cloud segmentation based on supervised contrastive metric learning (CML). Rather than predicting cluster assignments or object-centric variables, the method learns a latent representation in which points belonging to the same object are embedded nearby while unrelated points are separated. Clusters are then reconstructed using a density-based readout in the learned metric space, decoupling representation learning from cluster formation and enabling flexible inference. The approach is evaluated on simulated data from a highly granular calorimeter, where the task is to separate highly overlapping particle showers represented as sets of calorimeter hits. A direct comparison with object condensation (OC) is performed using identical graph neural network backbones and equal latent dimensionality, isolating the effect of the learning objective. The CML method produces a more stable and separable embedding geometry for both electromagnetic and hadronic particle showers, leading to improved local neighbourhood consistency, a more reliable separation of overlapping showers, and better generalization when extrapolating to unseen multiplicities and energies. This translates directly into higher reconstruction efficiency and purity, particularly in high-multiplicity regimes, as well as improved energy resolution. In mixed-particle environments, CML maintains strong performance, suggesting robust learning of the shower topology, while OC exhibits significant degradation. These results demonstrate that similarity-based representation learning combined with density-based aggregation is a promising alternative to object-centric approaches for point cloud segmentation in highly granular detectors.
Tags
Links
- Source: https://arxiv.org/abs/2603.23356v1
- Canonical: https://arxiv.org/abs/2603.23356v1
Trouble viewing inline? Open PDF directly →
Full Text
48,613 characters extracted from source content.
Expand or collapse full text
Contrastive Metric Learning for Point Cloud Segmentation in Highly Granular Detectors Max Marriott-Clarke, 1 Lazar Novakovic, 2 Elizabeth Ratzer, 1 Robert J. Bainbridge, 1 Loukas Gouskos, 2, 3 and Benedikt Maier 1 1 Blackett Laboratory, Imperial College London, UK 2 Department of Physics & Astronomy, Brown University, USA 3 Brown Center for Theoretical Physics and Innovation (BCTPI), Brown University, USA (Dated: March 25, 2026) We propose a novel clustering approach for point-cloud segmentation based on supervised con- trastive metric learning (CML). Rather than predicting cluster assignments or object-centric variables, the method learns a latent representation in which points belonging to the same object are embedded nearby while unrelated points are separated. Clusters are then reconstructed using a density-based readout in the learned metric space, decoupling representation learning from cluster formation and enabling flexible inference. The approach is evaluated on simulated data from a highly granular calorimeter, where the task is to separate highly overlapping particle showers represented as sets of calorimeter hits. A direct comparison with object condensation (OC) is performed using identical graph neural network backbones and equal latent dimensionality, isolating the effect of the learning objective. The CML method produces a more stable and separable embedding geometry for both elec- tromagnetic and hadronic particle showers, leading to improved local neighbourhood consistency, a more reliable separation of overlapping showers, and better generalization when extrapolating to unseen multiplicities and energies. This translates directly into higher reconstruction efficiency and purity, particularly in high-multiplicity regimes, as well as improved energy resolution. In mixed- particle environments, CML maintains strong performance, suggesting robust learning of the shower topology, while OC exhibits significant degradation. These results demonstrate that similarity-based representation learning combined with density-based aggregation is a promising alternative to object- centric approaches for point cloud segmentation in highly granular detectors. I. INTRODUCTION Modern particle detectors increasingly rely on high- granularity sensor technologies that provide detailed spatial and timing measurements of energy deposits. The resulting data naturally form point clouds with ir- regular geometry and variable size. A central recon- struction task is the segmentation of these point clouds into groups of measurements originating from individ- ual particles. In high-granularity calorimeters such as the CMS High Granularity Calorimeter (HGCAL) 1 , this task is particularly challenging due to the frequent spa- tial and energetic overlap of particle showers, requiring algorithms capable of resolving complex and highly cor- related hit patterns. Graph neural networks (GNNs) have emerged as a powerful framework for point-cloud reconstruction in particle physics 2–4 . A widely used learned clustering approach built on this framework is object condensation (OC) 5 , in which the network predicts object-centric la- tent variables that guide cluster formation. By integrat- ing clustering into the training objective, OC achieves strong performance across a range of reconstruction tasks 5–8 . However, this formulation tightly couples rep- resentation learning to a specific clustering procedure. In dense environments, where multiple nearby show- ers compete for representative points, this coupling can lead to ambiguities in both the learned clustering coor- dinates and the assignment of hits to objects. In this work, we propose an alternative cluster- ing paradigm based on contrastive metric learning (CML) 9 . Rather than predicting object-level variables, the method learns a latent embedding in which hits from the same particle shower are placed nearby while hits from different showers are separated. Clustering is performed only after training and acts as a readout of the learned representation. This decoupling allows the embedding geometry to be optimized directly for pair- wise compatibility, without imposing constraints asso- ciated with a particular clustering mechanism. A key advantage of this formulation is that the con- trastive objective depends only on relative relationships between hits, rather than absolute object-level proper- ties 9 . In object-centric approaches, the network must learn representative points and clustering scales that are implicitly tied to the detailed morphology of particle showers. As a result, mis-modelling in simulation can propagate directly into the learned clustering variables. In contrast, CML requires only that hits from the same shower be more similar than those from different show- ers, making the learned representation less sensitive to variations in shower shape, energy response, and event composition. To extract clusters from the learned embedding, we introduce a density-based readout procedure tailored to metric spaces. This method identifies representative points from local neighbourhood structure and forms clusters without requiring explicit object-level predic- tions, ensuring consistency with the geometry induced by the contrastive objective. The proposed approach is evaluated on simulated electromagnetic (EM) and hadronic (HAD) showers in arXiv:2603.23356v1 [hep-ex] 24 Mar 2026 2 a detector model inspired by the CMS HGCAL. A direct comparison with OC is performed using identical GNN backbones and matched embedding dimensionality to isolate the impact of the learning objective. Representa- tion quality is assessed using embedding geometry met- rics, while reconstruction performance is evaluated us- ing physics-based observables including efficiency, pu- rity, and energy resolution. We find that CML produces a more structured embed- ding geometry, with improved separability particularly in the tails of the distance distributions where recon- struction failures typically occur. This leads to signifi- cant improvements in clustering performance in high- multiplicity environments with strong shower overlap. These results demonstrate that learning a similarity- based representation provides a robust alternative to object-centric clustering methods for high-granularity detectors and more generally for dense point-cloud seg- mentation problems. I. METHODS A. Model Architecture Both learning objectives employ an identical GNN backbone to permit a direct comparison. Differences be- tween methods are restricted to the task-specific output heads required by the respective loss functions. Each calorimeter hit is represented by a five- dimensional input feature vector (x,y,z,E,L), where (x,y,z) denote the hit position, E is the deposited energy, and L is the detector layer index. Further de- tails of the dataset and input representation are given in Section I. Events are treated as variable-size point clouds with no graph connectivity provided as input. Truth shower identifiers are stored separately and are used only for defining the learning objectives and evalu- ation metrics. No additional handcrafted high-level fea- tures are introduced, and we find that explicit feature normalisation has negligible impact on performance. The features are first projected into a learned latent space using a two-layer multilayer perceptron (MLP) with hidden dimension 64 and exponential linear unit (ELU) activations, producing a 64-dimensional repre- sentation. The encoded hit features are subsequently processed by three DynamicEdgeConv layers 10 , each constructed using a k-nearest-neighbour graph (k = 24) in the cur- rent latent feature space using Euclidean distance. A learnable edge function is applied and aggregated us- ing the permutation-invariant “max" operation.Be- cause the graph connectivity is recomputed after every DynamicEdgeConv layer, the neighbourhood structure evolves during training, allowing the network to jointly learn feature representations and a data-driven similar- ity metric between hits. Constructing the graph in latent feature space reduces sensitivity to the geometric con- straints imposed by the detector layout and enables in- teractions between hits across layers, which is important for capturing the longitudinal development of calorime- ter showers. After the shared DynamicEdgeConv backbone, the network separates into task-specific output heads. In both cases, features are processed by a two-layer MLP (64→32) with ELU activations and dropout (p = 0.1), applied identically across both heads.For the con- trastive objective, a final linear layer projects the 32- dimensional features to a 16-dimensional embedding used for metric learning.For object condensation, two parallel linear heads are applied to the same 32- dimensional features, predicting a per-hit condensation score β i ∈ (0, 1) and 16-dimensional clustering coordi- nates c i . The embedding dimensionality is matched be- tween the two methods to ensure a comparable latent space dimensionality. Both methods were also evalu- ated with a reduced four-dimensional embedding; the corresponding results are presented in Section V. Since all backbone layers (the input MLP, the three DynamicEdgeConv layers, and the shared output MLP), activation functions, and optimization hyperparameters are shared, differences in embedding structure and re- construction performance between the two methods can be primarily attributed to the choice of learning objec- tive. B. Contrastive Metric Learning CML is a class of methods 11–13 that learns a represen- tation space in which samples sharing the same seman- tic identity are embedded nearby, while unrelated sam- ples are separated. Rather than predicting discrete la- bels or cluster assignments, the objective directly shapes the geometry of the latent space, making the embed- ding itself the primary target of optimization.This paradigm is well suited to point-cloud segmentation in high-granularity detectors, where reconstruction de- pends on identifying compatible sets of hits rather than assigning them to predefined object templates. Such ob- jectives have been widely used in representation learn- ing and clustering tasks 12,14,15 , where downstream per- formance depends on the separability of learned fea- tures. We apply supervised contrastive learning at the hit level within individual events. For an event contain- ing N hits with embeddings z i N i=1 and corresponding shower labels y i N i=1 , positive pairs are defined as hits originating from the same simulated particle shower, while negative pairs correspond to hits from different showers within the same event. Comparisons across events are excluded since separate events do not share physically meaningful relationships. 3 The embeddings are ℓ 2 -normalized and compared us- ing cosine similarity s ij = z ⊤ i z j , constraining all repre- sentations to lie on the unit hypersphere. This encour- ages hits from the same shower to form compact regions in angular space while separating hits from different showers, thereby learning a discriminative similarity metric without requiring explicit cluster centres or as- signment variables. This formulation is advantageous in calorimeter reconstruction, where showers are spatially extended and frequently overlap, making object bound- aries inherently ambiguous. Since the DynamicEdge- Conv graph is constructed in the current latent feature space at each layer, the neighbourhood structure used for message passing evolves alongside the learned rep- resentation. For CML, this creates a coupling between the contrastive objective and the graph topology: as the embedding learns to place shower-compatible hits nearby, the graph increasingly connects hits from the same shower, reinforcing the representation. This feed- back between representation learning and graph con- struction may contribute to the stability of the CML em- beddings observed in Section V. The loss is given by the supervised contrastive (Sup- Con) objective 13 : L SupCon =− 1 |A| X i∈A 1 |P (i)| X p∈P (i) log exp z ⊤ i z p /τ P j,i exp z ⊤ i z j /τ , (1) where each hit i acts as an anchor (i.e., a reference point against which all other hits in the event are compared), A denotes the set of anchors with at least one positive sample, P (i) is the set of positive hits for anchor i (i.e., hits sharing the same shower label), and τ is a temper- ature parameter that controls the concentration of the embedding distribution on the hypersphere. Smaller τ sharpens the similarity distribution and encourages tighter clusters. In this work we use τ = 0.1. The loss aggregates over all positive and negative hits within each event rather than sampling pairs. Calorime- ter events typically contain many weak negatives and relatively few informative hard negatives, such that ran- dom sampling often yields low-information pairs. Ag- gregating over all pairs ensures that informative rela- tionships consistently contribute to the optimization. As shown in the SupCon formulation 13 , the gradient naturally emphasises hard positives and hard negatives, providing implicit hard pair mining. Although con- trastive methods often rely on large batch sizes to ob- tain sufficient negatives, the large number of hits within each event naturally provides a rich negative set, allow- ing each event to act as an effective training batch. C. Object Condensation Baseline The OC 5 is a learned clustering method that recon- structs particle candidates from detector hits using per- hit latent variables. The approach has been applied across a range of high-energy physics tasks 5,7,8,16 , and is adopted here as a baseline. For each hit i, the network predicts clustering coordi- nates c i ∈R d and a condensation score β i ∈ (0, 1). The coordinates define a latent clustering space, while β i identifies representative hits. Hits with large β act as condensation points around which compatible hits are grouped. In this work, the clustering space dimension is d = 16, matching the contrastive embedding dimension to ensure a comparable latent space dimensionality. The condensation score β is mapped to a positive charge q i = arctanh 2 (β i ) +q min ,(2) which determines the interaction strength in the clus- tering space. For each object k, the hit with the largest charge defines the condensation point α k = arg max i∈k q i ,(3) where k indexes the set of hits belonging to a given truth shower and K denotes the total number of showers in the event. Hits belonging to the same object are attracted to the condensation point, L att = 1 K K X k=1 1 |k| X i∈k q i q α k c i − c α k 2 ,(4) while hits from different objects are repelled within a finite radius, L rep = 1 K K X k=1 1 | ̄ k| X i<k q i q α k max 0, 1− c i − c α k .(5) A regularisation term encourages condensation points to attain high confidence, L β = 1 K K X k=1 1−β α k .(6) The total event loss is L OC = s att L att +s rep L rep +s coward L β .(7) In our implementation s att = s rep = s coward = 1.0 and q min = 0.1, following the default configuration of 5 . A limited scan of the loss weights was performed and found to produce negligible changes in reconstruction performance relative to the default configuration. The model learns latent variables that define clustering be- haviour, while the actual grouping of hits is performed at inference time using these learned quantities. For direct comparison, the OC model uses the same DynamicEdgeConv backbone described in Section I A, differing only in the output heads predicting β i and c i . 4 Training is performed event-wise with all hits assigned to their corresponding truth shower, consistent with the supervised setting used for contrastive learning. In con- trast to CML, which learns a global similarity metric, OC directly optimizes object-centric clustering variables in the latent space. In this formulation, clustering struc- ture is explicitly encoded through object-level attractors rather than emerging from pairwise representations. D. Clustering Clustering is performed after training and treated as a readout of the learned representation rather than part of the learning objective. All clustering is performed independently for each event. a. Agglomerative clustering. As a common baseline, agglomerative clustering 17 is applied directly to the learned embeddings produced by both CML and OC. We use Ward linkage with a Euclidean distance metric, which provides robust performance across both embed- ding spaces. The method does not require a fixed num- ber of clusters and naturally accommodates events with variable particle multiplicity. The number of clusters is determined by applying a distance threshold δ agg to the Ward linkage dendrogram: clusters separated by a dis- tance greater than δ agg are not merged. The value of δ agg is optimized on the auxiliary dataset and reported in Ta- ble I. Applying the same clustering algorithm to both embeddings enables comparison of the intrinsic quality of the learned representations, independent of method- specific inference procedures. b. Object condensation inference. For OC, clusters are obtained using the inference procedure associated with the OC loss 5 . Candidate condensation points are selected by thresholding the predicted scores β OC,i > t β and sorting in decreasing β OC . A greedy separation step enforces a minimum Euclidean distance t d between se- lected points in the learned clustering coordinate space c i ∈R 16 . Hits within radius t d of a condensation point are assigned to it, and any remaining hits are assigned to the nearest condensation point. The values of t β and t d are given in Table I. c. Density-based readout of metric embeddings. Con- trastive embeddings do not predict representative points. We therefore define a clustering readout operat- ing directly in the embedding space, deriving candidate centres from local neighbourhood structure rather than from a learned score. For each hit, a local density estimate is obtained from the distance to its k-th nearest neighbour d k (i). In this work we use the same value of k as in the DynamicEdge- Conv graph construction, although the two choices are conceptually independent. This distance is mapped to a score β CML,i = exp − d k (i) τ ! ,(8) where τ is the temperature parameter used in the con- trastive loss. This mapping is consistent with the sim- ilarity scaling used during training, assigning large scores to densely populated regions of the embedding. Candidate centres are selected by thresholding β CML,i > t β and enforcing a minimum separation t d . Clusters are formed by assigning hits within distance t d to each centre, followed by nearest-centre assignment for remaining hits. Here β CML,i plays a role analogous to the condensation score in OC, but is computed from the embedding rather than predicted by a network head. Unlike standard density-based methods such as DB- SCAN 18 and HDBSCAN 19 , which rely on fixed den- sity thresholds, the proposed readout operates on lo- cal neighbourhood structure in the learned embedding, making it compatible with spatially varying density across showers. d. Summary. Three clustering strategies are evalu- ated: shared agglomerative clustering applied to both embedding spaces, the native OC inference procedure, and the proposed density-based readout for contrastive embeddings.This design isolates the effect of the learned representation from the choice of clustering al- gorithm. I. EXPERIMENTAL SETUP A. Dataset The datasets used in this study are produced with a standalone Geant4 20 simulation closely resembling the HGCAL detector 21 . The calorimeter model comprises 50 longitudinal lay- ers: 28 electromagnetic (CE-E) followed by 22 hadronic (CE-H). The transverse cell size is 1 cm× 1 cm over a 100 cm×100 cm area, ensuring full shower containment. Energy deposits are calibrated in minimum-ionising- particle (MIP) units, with the simulated hit response consistent with test-beam observations 22,23 . Three training datasets are considered: an electro- magnetic (EM, electrons) sample, a hadronic (HAD, charged pions) sample, and a mixed sample contain- ing both particle types. The EM dataset contains 2–10 electrons per event with primary energies uniformly distributed between 30 and 400 GeV. The HAD dataset contains 2–7 pions per event in the same energy range. The mixed dataset contains an equal fraction of elec- trons and charged pions with 2–7 particles per event and primary energies between 30 and 250 GeV. For each configuration, 200 000 events are used for training and 50 000 for validation. Models are evaluated on independent test datasets containing between 1 and 30 particles per event with primary energies ranging from 30 to 600 GeV. Separate EM and HAD test samples are used. Models trained on the EM and HAD datasets are evaluated on their respec- tive particle types, while the model trained on the mixed 5 dataset is evaluated on both. In addition to the training, validation, and primary test datasets, an auxiliary optimization dataset is gen- erated for each training configuration with the same multiplicity and energy distributions as the correspond- ing training sample. These events are not used dur- ing network training and are used only to determine the clustering hyperparameters at inference time. Op- timal clustering thresholds are selected by maximising reconstruction performance on this dataset. For models trained on the EM and HAD samples, thresholds are de- termined separately. For the mixed model, a single set of thresholds is determined on the mixed optimization dataset and applied to both test samples. The resulting threshold values are summarised in Table I. TABLE I: Clustering thresholds. The parameter δ agg denotes the agglomerative clustering distance threshold, while t β and t d correspond to thresholds used in both the density-based readout and object condensation inference. Model Method δ agg t β t d EM CML80.4 0.45 OC6.75 0.1 0.25 HAD CML10 0.4 0.45 OC11 0.1 0.35 Mixed CML9.5 0.4 0.45 OC7.5 0.1 0.3 When multiple particles deposit energy in the same cell, their contributions are merged into a single hit, as in realistic detector readout. Each hit is assigned the label of the particle contributing the largest fraction of its deposited energy. The fractional contribution of the dominant particle is recorded to define hit purity, which is close to unity across the dataset. This quantity is not used as an input feature. All particles are generated within a cone of fixed opening angle, with a half-angle of 5 ◦ around the detec- tor axis. Consequently, increasing the event multiplicity leads to a systematic increase in local particle density within the calorimeter volume. This provides a con- trolled mechanism to vary the degree of shower over- lap, allowing reconstruction performance to be probed across regimes of increasing ambiguity and hit-level confusion. B. Training Details All models are trained using the Adam optimizer 24 with an initial learning rate of 3×10 −4 and a batch size of 16 events. The learning rate is reduced by a factor of 0.5 every 25 epochs, and training is performed for up to 100 epochs. Identical optimization settings, data splits, and initialization procedures are used for both CML and OC models, with differences arising only from the learning objective and corresponding output heads. Model selection is based on the validation loss eval- uated after each epoch on an independent validation set. The checkpoint with the lowest validation loss is retained, and early stopping is applied once no further improvement is observed. Training is performed using mixed-precision arith- metic with gradient scaling. All models are trained on a single GPU (NVIDIA Tesla V100, 32 GB, or NVIDIA H100, 80 GB), with consistent results observed across both hardware configurations. IV. EVALUATION A. Embedding Geometry Metrics The learned representations are evaluated indepen- dently of any clustering procedure by quantifying ge- ometric properties of the embedding space within each event. Such metrics are commonly used to assess rep- resentation quality in metric learning settings 25,26 . All quantities are computed using cosine similarity on ℓ 2 - normalized embeddings and averaged over events. a. Recall@k (R@k) For each hit, thek nearest neigh- bours in embedding space are identified. A hit is consid- ered correctly retrieved if at least one neighbour origi- nates from the same truth shower. The fraction of such hits defines R@k. We report R@1 and R@10, which probe whether compatible hits are placed as the closest neighbour and within the local neighbourhood, respec- tively. b. Contamination@10 (C@10). Local neighbour- hood purity is quantified as the fraction of the 10 nearest neighbours that originate from a different truth shower.Unlike Recall@k, which provides a binary criterion, this metric captures the continuous fraction of incorrect neighbours. Lower contamination indicates that local neighbourhoods correspond more closely to physically consistent showers. c. Pairwise separability. Positive (same-shower) and negative (different-shower) hit pairs are sampled and their cosine similarities compared. The area under the receiver operating characteristic (AUC) curve measures the probability that a positive pair has higher similar- ity than a negative pair, providing a global measure of separability in the embedding space. d. Intra- and inter-shower distances. To characterise the geometric structure of individual showers, the anal- ysis is restricted to the energetic core of each shower by retaining the highest-energy hits that together account for 95% of the total shower energy. This suppresses low- energy peripheral deposits while preserving the physi- cally relevant structure. Cosine distances d = 1− z ⊤ i z j are computed between hits. Intra-shower compactness is quantified by the 99 th percentile of same-shower pairwise distances, denoted 6 d Q99 intra , capturing the largest separations within a shower core. Inter-shower separation is measured as the median distance between hits from different showers, providing a robust estimate of typical separation between distinct objects. B. Reconstruction Metrics The performance of reconstructed particle candi- dates is evaluated using standard high-energy physics (HEP) metrics following the CMS TICL validation pro- cedure 27 . These quantities assess the physical quality of reconstructed objects rather than the learned represen- tation. a. Efficiency. A simulated particle is considered re- constructed if at least 70% of its deposited energy is con- tained within a single reconstructed object. The recon- struction efficiency is defined as ε = N matched sim N sim . b. Purity. Purity quantifies the extent to which a reconstructed object originates from a single simulated particle. This is evaluated using the Reco-to-Sim score S(r → s), defined for a reconstructed object r and simu- lated particle s as S(r→ s) = P hits max ( 0, f reco −f sim ) 2 E 2 P hits f 2 reco E 2 ,(9) where f reco and f sim are the fractional energy contri- butions of a hit to the reconstructed object and simu- lated particle, respectively, and E is the hit energy. The score is zero for a perfectly pure object and increases with contamination. A reconstructed object is consid- ered pure if there exists at least one simulated particle s for which S(r→ s) < 0.2. The purity is then defined as P = N pure reco N reco . c. Multiplicity ratio. To quantify the tendency of the clustering to split or merge objects, the ratio R N = N reco N sim is used, whereR N > 1 indicates object splitting andR N < 1 indicates merging. d. Energy resolution. For each simulated particle, the reconstructed object with the largest shared energy is selected as the match. Objects with S(r → s) > 0.5 are discarded as impure. The energy response is defined as r = E reco E sim , TABLE I: Embedding-geometry metrics for EM and HAD showers at representative multiplicities. CML consistently achieves higher Recall@k, lower contamination@10, and higher AUC than OC, with the performance gap increasing as multiplicity increases. Dataset N particles Method R@k C@10 AUC 110 EM 2 CML 0.941 0.992 0.067 0.956 OC0.935 0.989 0.072 0.944 15 CML 0.691 0.932 0.339 0.950 OC0.667 0.920 0.363 0.923 30 CML 0.572 0.886 0.467 0.945 OC0.536 0.871 0.503 0.918 HAD 2 CML 0.938 0.992 0.077 0.945 OC0.922 0.989 0.092 0.927 10 CML 0.744 0.943 0.286 0.927 OC0.698 0.927 0.330 0.889 20 CML 0.628 0.900 0.407 0.917 OC0.573 0.876 0.460 0.877 where E reco is the sum of the energies of the hits as- signed to the reconstructed object and E sim is the true particle energy. Within bins of E sim , the mean response μ is used to define a calibrated response r ′ = r/μ. The energy reso- lution is then defined as the effective sigma σ eff , given by half the minimum interval containing 68.3% of the r ′ distribution. For Gaussian distributions, σ eff is equiv- alent to the standard deviation, while remaining robust to non-Gaussian tails and outliers 28 . As a reference, we also compute the resolution of an ideal pattern-recognition algorithm that perfectly as- signs all hits to their truth shower, with no merging or splitting. The energy of each reconstructed object is taken as the sum of the energies of all hits assigned to the corresponding truth shower. This provides a lower bound on the achievable resolution given the detector response and the hit-level energy calibration, and is in- dependent of any clustering algorithm. V. RESULTS A. Embedding Geometry Embedding-level performance is evaluated separately for the EM and HAD datasets using the metrics defined in Section IV A. Results are reported at representative event multiplicities to probe behaviour as shower over- lap increases. Across both datasets, CML consistently outperforms OC, achieving higher Recall@k, lower contamina- tion@10, and higher AUC at all tested multiplicities (Ta- ble I). The performance gap is modest at low multi- plicity but increases steadily with shower density, indi- cating that CML preserves more stable local neighbour- 7 0.20.40.60.81.0 0 8 16 24 32 Density N particles = 2 Median: Inter 0.20.40.60.81.0 N particles = 15 0.20.40.60.81.0 N particles = 30 CML OC EM HAD 0.20.40.60.81.0 0 8 16 24 32 Density Q99: Intra 0.20.40.60.81.00.20.40.60.81.0 0.40.20.00.20.4 Metric value 0 8 16 24 Density Margin 0.40.20.00.20.4 Metric value 0.40.20.00.20.4 Metric value FIG. 1: Event-level embedding-geometry distributions for EM and HAD showers at increasing generated particle multiplicity (N particles ). Top: median inter-shower separation d median inter . Middle: intra-shower distance tail d Q99 intra . Bottom: separation margin∆ = d median inter −d Q99 intra . Narrow positive or near-zero margins indicate a well-defined clustering scale, while broad or negative margins indicate increasing ambiguity between showers. hood structure under increasing overlap. Figure 1 shows the corresponding embedding- geometry distributions. The top row presents the me- dian inter-shower separation d median inter , while the mid- dle row shows the intra-shower distance tail d Q99 intra . For CML, both quantities remain narrowly distributed across all multiplicities, indicating a stable embedding geometry with consistent distance scales both within and between showers. In contrast, OC produces much broader distributions, reflecting substantially larger event-to-event variability. The bottom row shows the separation margin ∆ = d median inter −d Q99 intra , which directly measures whether showers remain geo- metrically separable. For CML, the margin distribution remains narrow across all multiplicities, with a positive peak for EM showers and a near-zero peak for HAD showers. This indicates that EM showers are intrin- sically more separable, while HAD showers are more complex, but in both cases the clustering scale remains well defined. In contrast, OC produces broad and often nega- tive margin distributions. For EM showers, the mar- gin spans both positive and negative values, imply- ing strong overlap between intra- and inter-shower dis- tances. For HAD showers, the margin is systematically negative and becomes increasingly broad with multi- plicity. In both cases, no single distance threshold can separate showers consistently across events. Overall, the advantage of CML arises primarily from controlling the tails of the distance distributions rather than shifting their central values. By maintaining com- pact intra-shower structure together with stable inter- shower separation, CML produces embeddings that re- main reliably clusterable even in dense environments. 8 B. Reconstruction Performance Reconstruction performance is evaluated using the physics metrics defined in Section IV B. Across all datasets and reconstruction configurations, CML out- performs OC, with the largest gains appearing at high multiplicity. These differences follow directly from the embedding geometry: the narrow margin distributions of CML define a stable clustering scale, whereas the broad and often negative margins of OC make cluster- ing increasingly ambiguous. a. Energy dependence. Figure 2 shows reconstruc- tion efficiency and purity as a function of the primary particle energy.For the dedicated EM model, CML achieves near-perfect efficiency (∼ 99%) and substan- tially higher purity (∼ 80–82%) than OC, which remains below 85% efficiency and 72% purity. For HAD show- ers, efficiencies are more similar across methods (∼ 70– 76%), but CML retains a clear purity advantage of∼ 10– 15%. The mixed-trained model reveals a stronger separa- tion. For EM showers, OC degrades severely, with ef- ficiencies dropping to ∼ 30–40%, whereas CML retains efficiencies above 80% and substantially higher purity. For HAD showers, efficiencies remain comparable, but CML again achieves higher purity. Across all cases, performance remains stable beyond the training range, indicating that the dominant differ- ences arise from the learned representation rather than from any strong dependence on primary energy. This is consistent with the embedding geometry, for which the separation margin is controlled mainly by local shower structure rather than absolute shower energy. b. Multiplicity dependence. Figure 3 shows perfor- mance as a function of the particle multiplicity. This is the regime in which the separation between methods is most pronounced. At low multiplicity, all methods perform similarly. As multiplicity increases, clear differences emerge. For EM showers at N = 30, CML maintains high efficiency (∼95–98%) and purity (∼73–78%), while OC degrades to ∼75% efficiency and ∼47–55% purity. The number ratio remains close to unity for CML but drops signifi- cantly for OC, indicating substantial merging. A similar trend is observed for HAD showers. At N = 30, CML improves purity by nearly 20 percentage points over OC while also providing a modest but sys- tematic efficiency gain. Again, CML maintains a more stable R N , indicating improved control of merging in dense environments. The mixed-trained model shows the strongest con- trast. For EM showers at N = 30, CML remains func- tional with efficiencies of ∼70%, whereas OC collapses to ∼20–30%.For HAD showers, efficiencies remain comparable, but CML retains a clear purity advantage. These trends can be understood directly from the embedding margins. For CML, the margin distribu- tions remain narrow and concentrated near the sepa- ration boundary across multiplicities, so a single clus- tering scale continues to separate showers even as over- lap increases. For OC, the behaviour depends strongly on shower type. In EM events, the margin becomes extremely broad, so no global threshold can separate showers consistently; this explains the large degrada- tion in R N and purity, particularly for agglomerative clustering. In HAD events, the OC margin is less broad but systematically negative, so clustering is somewhat more stable but still intrinsically ambiguous, leading to persistent mis-clustering and reduced purity. The mixed setting makes this contrast most explicit: CML produces similar margin distributions for EM and HAD showers and therefore supports a common threshold, whereas OC does not, causing the EM performance of the mixed model to collapse while the HAD perfor- mance remains closer to that of the HAD-only model. c. Energy resolution. Figure 4 shows the corre- sponding energy resolution. For EM showers, CML con- sistently achieves the best resolution and remains clos- est to the ideal pattern-recognition limit. At high en- ergy, O(600 GeV), CML reaches ∼1.6%, compared with ∼2.0% for OC with native inference and ∼2.4% for OC with agglomerative clustering. For HAD showers, the separation is smaller but re- mains systematic. The CML method provides the largest improvement at low energy, where pattern-recognition effects dominate (e.g. 15.4% versus 18–20% at 50 GeV), while at higher energies the curves approach a constant term and the gap narrows. These results are the direct consequence of the clus- tering behaviour.The stable separation margins of CML reduce both merging and fragmentation, leading to more accurate assignment of energy deposits to re- constructed objects. In contrast, the broad and negative margins of OC lead to systematic mis-assignment of en- ergy, particularly in dense environments, and therefore to degraded resolution. d. Dependence on embedding dimensionality. Ta- ble I shows the mean reconstruction performance of the mixed-trained model for 16- and 4-dimensional em- beddings, evaluated on an independent mixed sample. Reducing the embedding dimension leads to a modest degradation for all methods, but the relative ordering remains unchanged: CML continues to outperform OC in both purity and efficiency across all configurations. This shows that the observed advantage is not specific to the 16-dimensional setting. VI. DISCUSSION AND CONCLUSIONS We have presented a clustering framework for point- cloud segmentation in high-granularity calorimeters based on CML. Rather than learning object-centric clus- tering variables, the method learns a representation in which hits from the same shower are placed nearby and hits from different showers are separated, with cluster- 9 0.0 0.2 0.4 0.6 0.8 1.0 1.2 Efficiency EMHADMixed: EMMixed: HAD 50100200400600 0.0 0.2 0.4 0.6 0.8 1.0 1.2 Purity 501002004006005010020040060050100200400600 Primary particle energy E [GeV] CML + Density readoutCML + AgglomerativeOC + Native inferenceOC + Agglomerative FIG. 2: Reconstruction efficiency (top) and purity (bottom) as functions of primary particle energy for electromagnetic (EM) and hadronic (HAD) showers. Columns show models trained on EM, trained on HAD, and a mixed-trained model evaluated separately on EM and HAD showers. The vertical dashed line indicates the upper boundary of the training energy range. The dominant differences are largely independent of energy, indicating that performance is controlled primarily by the learned representation rather than by the absolute shower energy. TABLE I: Mean reconstruction purity and efficiency for the mixed-trained model evaluated on the combined EM and HAD test sample for 16- and 4-dimensional embeddings. The relative ordering between methods is unchanged when the embedding dimensionality is reduced, showing that the CML advantage is not driven by latent-space size alone. Model DimensionClusteringPurity Efficiency CML 16Agglomerative 0.7220.932 16Density0.7100.945 4Agglomerative 0.6900.887 4Density0.6370.905 OC 16Agglomerative 0.4690.849 16Density0.5200.838 4Agglomerative 0.5120.813 4Density0.5000.866 ing applied only as a readout of the learned geometry. This decoupling allows the representation to be opti- mized for pairwise compatibility while retaining flexi- bility in the choice of inference procedure. The central result of this work is that the learned embedding geometry directly determines clustering performance.The CML approach produces narrow separation-margin distributions that remain positive for EM showers and only slightly negative for HAD show- ers, indicating a stable and well-defined clustering scale even in dense environments. In contrast, OC yields substantially broader and often negative margin distri- butions, particularly for EM showers, implying strong overlap between intra- and inter-shower distances and therefore intrinsically ambiguous clustering decisions. These geometric differences explain the observed recon- struction behaviour: CML consistently achieves higher purity, higher efficiency, more stable R N , and improved energy resolution, with the largest gains appearing at high multiplicity where shower overlap is most severe. The mixed-training results provide the strongest evi- dence for robustness. The CML method maintains simi- lar separation scales for EM and HAD showers, allowing a single clustering threshold to operate effectively across both particle types. By contrast, OC learns different ge- ometric structure for EM and HAD showers. This leads to a pronounced degradation for EM showers in particu- lar, indicating that the object-centric formulation is less able to accommodate heterogeneous shower topologies within a single model. Taken together, these results show that, for highly granular calorimeter reconstruction, learning a stable similarity geometry is more effective than learning ex- 10 0.00 0.25 0.50 0.75 1.00 Efficiency EMHADMixed: EMMixed: HAD 0.00 0.25 0.50 0.75 1.00 Purity 51015202530 0.0 0.5 1.0 1.5 2.0 R N 510152025305101520253051015202530 Particle multiplicity N particles CML + Density readoutCML + AgglomerativeOC + Native inferenceOC + Agglomerative FIG. 3: Reconstruction efficiency (top), purity (middle), and number ratio (bottom) as functions of particle multiplicity N for electromagnetic (EM) and hadronic (HAD) showers. Columns show models trained on EM, trained on HAD, and a mixed-trained model evaluated separately on EM and HAD showers. The vertical dashed line indicates the upper boundary of the training multiplicity range. The performance gap between CML and OC increases strongly with multiplicity, showing that clustering stability in dense environments is determined by the underlying embedding geometry. plicit object-centric clustering variables. More broadly, they suggest that contrastive metric learning provides a robust alternative for dense point-cloud segmenta- tion problems in which object boundaries are ambigu- ous, overlap is common, and inference must remain sta- ble under changing event complexity. We propose to test this strategy with ultra-realistic simulations of the HGCAL detector in high-pileup conditions, as imple- mented in the CMS software stack. ACKNOWLEDGEMENTS We thank Sunanda Banerjee for the help in creating a realistic dataset corresponding to particle showers in a highly granular detector. The neural networks in this study have been trained on the Imperial College RCS HPC cluster and the Oscar cluster at Brown University. L. G. and L. N. are supported by the DOE, Office of Sci- ence, Office of High Energy Physics Early Career Re- search program under Award No. DE-SC0026288. B. M. acknowledges the support of Schmidt Sciences. 11 0.00 0.01 0.02 0.03 0.04 0.05 EMMixed: EM 100200300400500600 0.000 0.025 0.050 0.075 0.100 0.125 0.150 0.175 0.200 HAD 100200300400500600 Mixed: HAD ( E reco / E sim ) Primary particle energy E [GeV] CML + Density readoutCML + AgglomerativeOC + Native inferenceOC + AgglomerativeCML + Density readoutCML + AgglomerativeOC + Native inferenceOC + Agglomerative Ideal algorithm FIG. 4: Energy resolution as a function of primary particle energy for electromagnetic (EM) and hadronic (HAD) showers. Panels show models trained on EM, a mixed-trained model evaluated on EM, trained on HAD, and a mixed-trained model evaluated on HAD. The vertical dashed line marks the upper boundary of the training energy range. The black dashed curve denotes the ideal pattern-recognition limit, defined as the resolution obtained by a perfect clustering algorithm with no merging or splitting, and represents a lower bound on the achievable resolution given the detector response. Improvements in CML resolution follow directly from its improved clustering purity and reduced merging. 12 1 CMS Collaboration, The Phase-2 Upgrade of the CMS End- cap Calorimeter, Tech. Rep. (CERN, Geneva, 2017) https: //cds.cern.ch/record/2293646. 2 Xiangyang Ju et al., “Graph Neural Networks for Par- ticle Reconstruction in High Energy Physics Detec- tors,”(2020), https://cds.cern.ch/record/2715452, arXiv:2003.11603. 3 Lukas Ehrke et al., “Topological Reconstruction of Particle Physics Processes Using Graph Neural Networks,” Phys. Rev. D 107, 116019 (2023). 4 Javier Duarte and Jean-Roch Vlimant, “Graph Neural Net- works for Particle Tracking and Reconstruction,” in Arti- ficial Intelligence for High Energy Physics (World Scientific, 2022) p. 387–436. 5 Jan Kieseler, “Object Condensation: One-Stage Grid-Free Multi-Object Reconstruction in Physics Detectors, Graph, and Image Data,” Eur. Phys. J. C 80, 886 (2020). 6 Gregory Matousek and Anselm Vossen, “AI-Assisted Ob- ject Condensation Clustering for Calorimeter Shower Reconstruction at CLAS12,”(2025), arXiv:2503.11277 [physics.ins-det]. 7 Shah Rukh Qasim et al., “Multi-Particle Reconstruc- tion in the High Granularity Calorimeter Using Object Condensation and Graph Neural Networks,”(2021), arXiv:2106.01832 [physics.ins-det]. 8 S. Gardner, R. Tyson, D. Glazier, and K. Livingston, “Ob- ject Condensation for Track Building in a Backward Elec- tron Tagger at the EIC,” JINST 19, C05052 (2024). 9 R. Hadsell, S. Chopra, and Y. LeCun, “Dimensionality Reduction by Learning an Invariant Mapping,” in CVPR (2006) p. 1735–1742. 10 Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E. Sarma, Michael M. Bronstein,and Justin M. Solomon, “Dy- namic Graph CNN for Learning on Point Clouds,” (2019), arXiv:1801.07829 [cs.CV]. 11 Aaron van den Oord, Yazhe Li, and Oriol Vinyals, “Rep- resentation Learning with Contrastive Predictive Coding,” (2019), arXiv:1807.03748 [cs.LG]. 12 Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton, “A Simple Framework for Con- trastive Learning of Visual Representations,”(2020), arXiv:2002.05709 [cs.LG]. 13 Prannay Khosla et al., “Supervised Contrastive Learning,” (2021), arXiv:2004.11362 [cs.LG]. 14 Phuc H. Le-Khac, Graham Healy, and Alan F. Smeaton, “Contrastive Representation Learning: A Framework and Review,” IEEE Access 8, 193907–193934 (2020). 15 Yunfan Li et al., “Contrastive Clustering,”(2020), arXiv:2009.09687 [cs.LG]. 16 Kilian Lieret et al., “High Pileup Particle Tracking with Object Condensation,”(2023), arXiv:2312.03823 [physics.data-an]. 17 Daniel Müllner, “Modern Hierarchical,Agglomera- tive Clustering Algorithms,”(2011), arXiv:1109.2378 [stat.ML]. 18 Martin Ester, Hans-Peter Kriegel, Jörg Sander, and Xiaowei Xu, “A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise,” in KDD (1996) p. 226–231. 19 Leland McInnes, John Healy, and Steve Astels, “hdbscan: Hierarchical Density Based Clustering,” J. Open Source Softw. 2, 205 (2017). 20 S. Agostinelli et al., “Geant4—A Simulation Toolkit,” Nucl. Instrum. Meth. A 506, 250–303 (2003). 21 CMS Collaboration, The Phase-2 Upgrade of the CMS End- cap Calorimeter, Tech. Rep. (CERN, Geneva, 2017) https: //cds.cern.ch/record/2293646. 22 Nural Akchurin, Response of a CMS HGCAL Silicon- Pad Electromagnetic Calorimeter Prototype to 20–300 GeV Positrons, Tech. Rep. (CERN, Geneva, 2021) https://cds. cern.ch/record/2798347. 23 CMS Collaboration, “Performance of the CMS High Granu- larity Calorimeter Prototype to Charged Pion Beams of 20– 300 GeV/c,” (2023), arXiv:2211.04740 [physics.ins-det]. 24 Diederik P. Kingma and Jimmy Ba, “Adam: A Method for Stochastic Optimization,” (2017), arXiv:1412.6980 [cs.LG]. 25 Dingyi Zhang et al., “Deep Metric Learning with Spherical Embedding,” (2020), arXiv:2011.02785 [cs.CV]. 26 Kevin Musgrave et al., “A Metric Learning Reality Check,” (2020), arXiv:2003.08505 [cs.CV]. 27 CMS Collaboration, “The Iterative Clustering (TICL) (v5a) Reconstruction at the CMS Phase-2 High Granularity Calorimeter Endcap,”(2024), https://cds.cern.ch/ record/2920448. 28 CMS Collaboration, “Energy Calibration and Resolution of the CMS Electromagnetic Calorimeter in p Collisions at √ s = 7 TeV,” JINST 8, P09009 (2013).