Abstract
The process of manually searching for relevant instances in, and extracting information from, clinical databases underpin a multitude of clinical tasks. Such tasks include disease diagnosis, clinical trial recruitment, and continuing medical education. This manual search-and-extract process, however, has been hampered by the growth of large-scale clinical databases and the increased prevalence of unlabelled instances. To address this challenge, we propose a supervised contrastive learning framework, CROCS, where representations of cardiac signals associated with a set of patient-specific attributes (e.g., disease class, sex, age) are attracted to learnable embeddings entitled clinical prototypes. We exploit such prototypes for both the clustering and retrieval of unlabelled cardiac signals based on multiple patient attributes. We show that CROCS outperforms the state-of-the-art method, DTC, when clustering and also retrieves relevant cardiac signals from a large database. We also show that clinical prototypes adopt a semantically meaningful arrangement based on patient attributes and thus confer a high degree of interpretability.
Introduction
Modern clinical practice and research increasingly rely on massive databases of physiological signals, such as 12-lead Electrocardiograms (ECGs). These databases are vital for tasks ranging from rare arrhythmia diagnosis to clinical trial recruitment. However, the sheer volume of data and the lack of expert labels for a significant portion of these signals present a major bottleneck.
Existing computational approaches typically address either unsupervised clustering or information retrieval, but rarely both. Unsupervised methods like k-means often fail to capture clinically relevant nuances because they ignore available patient metadata (e.g., age, sex). Conversely, retrieval systems often struggle with the complex time-series nature of ECG data. CROCS (Clustering and Retrieval of Cardiac Signals) is designed to bridge this gap by providing a unified framework that leverages patient attributes to guide the learning of signal representations.
Methodology: Clinical Prototypes and Contrastive Learning
The fundamental innovation of CROCS is the introduction of clinical prototypes. These are learnable embeddings ($p_{A_j}$) in a latent space, where each prototype represents a unique combination of patient attributes, such as "Male, Under 25, Sinus Rhythm."
Supervised Contrastive Framework
CROCS employs a supervised contrastive learning objective. During training, an ECG signal $x_i$ is passed through a feature extractor $f_\theta$ to produce a representation $v_i$. This representation is then "attracted" to its corresponding clinical prototype while being "repelled" from others.
Key technical refinements include:
- Modulated Soft Assignment: Instead of a rigid one-to-one mapping, the framework uses a "soft" attraction mechanism. A signal is strongly attracted to its exact attribute match but also maintains a weaker attraction to other prototypes within the same disease class. This encourages the model to learn features that distinguish sex and age even within the same pathology.
- Semantic Regularization ($L_{reg}$): To ensure the latent space is interpretable, the authors enforce a geometric structure where the Euclidean distance between prototypes reflects the Hamming distance of their attribute sets. For instance, prototypes for adjacent age groups are forced to be closer than those for distant age groups.
Experimental Setup and Datasets
The framework was evaluated on two major ECG datasets:
- Chapman Dataset: 10,646 patients across 4 arrhythmia classes.
- PTB-XL Dataset: 18,885 patients across 5 diagnostic classes.
In both datasets, patient sex and age (discretized into quartiles) were used alongside disease class to define the attribute combinations for the prototypes.
Results and Discussion
CROCS demonstrates superior performance across both clustering and retrieval tasks compared to state-of-the-art baselines like Deep Transfer Clustering (DTC).
Clustering Performance
On the Chapman dataset, CROCS achieved a disease class clustering accuracy of 90.3%, a significant improvement over DTC's 53.4%. This highlights the effectiveness of using prototypes as anchors to create well-separated data "islands" in the latent space.
Retrieval Precision
The framework also proved highly reliable for retrieval. For the Chapman dataset, the precision at $K=1$ was 95.6% for matching at least one patient attribute. This capability allows researchers to use specific attribute combinations as queries to find similar cases in large, unlabelled databases.
Data Efficiency and Interpretability
A key strength of CROCS is its robustness. Even when trained on only 10% of labeled data, it outperformed competing methods trained on the full dataset. Furthermore, the semantic regularization ensures that the latent space is not a "black box"; the physical arrangement of prototypes reflects clinical similarities, enhancing the model's interpretability for clinicians.
Conclusion and Future Work
CROCS provides a powerful, unified solution for managing large-scale clinical signal databases. By anchoring representations to clinical prototypes, it enables high-accuracy clustering and precise, multi-attribute retrieval. Future work will focus on handling continuous attributes directly to avoid discretization and addressing the computational challenges posed by an increasing number of patient attributes.
Summary updated