CROCS: Clustering and Retrieval of Cardiac Signals Based on Patient Disease Class, Sex, and Age

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.

text: 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.

heading: 1 Introduction
text: Clinical databases can comprise instances that are either unlabelled or labelled with patient attribute information, such as disease class, sex, and age. The process of manually searching for relevant instances in, and extracting information from, such databases underpin a multitude of tasks [1]. For example, clinicians extract a disease diagnosis from patient data, researchers involved in clinical trials search for and recruit patients satisfying specific inclusion criteria [2], and educators retrieve relevant information as part of the continuing medical education scheme [3]. This manual search-and-extract process, however, is hampered by the rapid growth of large-scale clinical databases and the increased prevalence of unlabelled instances; those for which patient attribute information is unavailable.
Given such a setting, in this paper, we are interested in addressing two questions: given a large, unlabelled clinical database, (1) how do we extract attribute information from such unlabelled instances? and (2) how do we reliably search for and retrieve relevant instances? To address the former, the task of clustering holds value. In this setting, a centroid groups together instances that share some similarities. Recent research has focused on exploiting existing clustering algorithms, such as k-means, to group similar patients from electronic heath record (EHR) data [4, 5]. Such methods, however, are exclusively unsupervised; they do not exploit patient attribute information. To address the second question, the task of information retrieval holds promise. In this setting, a query associated with a set of desired attributes is exploited to retrieve a relevant instance. Recent research has focused predominantly on retrieving medical images [6], clinical text [7], and EHR data [8], with minimal emphasis on medical time-series data [9]. These methods do not extend to cardiac
35th Conference on Neural Information Processing Systems (NeurIPS 2021).
time-series data nor do they account for search based on multiple patient attributes. Most notably, previous work performs either clustering or retrieval, and not both.
In this work, we address both questions while exploiting large-scale electrocardiogram (ECG) databases comprising patient attribute information. Our contributions are the following: (1) we propose a supervised contrastive learning framework, CROCS, in which we attract representations of cardiac signals associated with a unique set of patient attributes to embeddings, entitled clinical prototypes. Such attribute-specific prototypes, which create “islands” of similar representations [10], allow for both the clustering and retrieval of cardiac signals based on multiple patient attributes. (2) We show that CROCS outperforms the state-of-the-art method, DTC, in the clustering setting and retrieves relevant cardiac signals from a large database. At the same time, clinical prototypes adopt a semantically meaningful arrangement and thus confer a high degree of interpretability.

heading: 2 Related work
text: Clinical representation learning and clustering Learning meaningful representations of clinical data is an ongoing research endeavour. Recent research has focused on learning representations from EHR data [11, 12, 13, 14, 15] and via auto-encoders, which are then clustered using existing methods, such as k-means [4, 5]. As for time-series data, auto-encoders are learned with [16] or without [17] an auxiliary clustering objective, salient features (shapelets) are identified in an unsupervised manner [18, 19], and patient-specific representations are learned via contrastive learning [20]. Li et al. [21] learn prototypes, or representative embeddings, via the ProtoNCE loss and cluster instances using k-means. Their work builds upon recent research in the contrastive learning literature [22, 23, 24]. Similar to our work is that of Gee et al. [11] where prototypes are learned for the clustering of time-series signals. Their prototypes, however, cannot cluster instances based on multiple patient attributes and do not extend to the retrieval setting.
Clinical information retrieval (IR) Retrieving clinical data from a large database has been a longstanding goal of researchers within healthcare [25]. Such research has involved the retrieval of clinical documents [26, 7, 27, 28] where, for example, Avolio et al. [29] map text queries to an ontology known as SNOMED, before retrieving relevant clinical documents. Recent research has focused on the retrieval of biomedical images [6, 30], and EHR data [31, 32] to discover patient cohorts in a clinical database [8]. Goodwin et al. [9] implement an unsupervised patient cohort retrieval system by exploiting clinical text and time-series data. These approaches, however, do not explore cardiac signals, cannot account for multiple patient attributes, and are unable to also cluster instances. To the best of our knowledge, we are the first to design a learning framework that allows for both the clustering and retrieval of cardiac signals based on multiple patient attributes.

heading: 3 Background
text: Supervised clustering We learn a function, fθ : x ∈ RD −→ v ∈ RE , parameterized by θ, that maps a D-dimensional input, x, to an E-dimensional representation, v. We also have a labelled dataset, Dl = {xi, Ai}Nli=1, where each instance, xi, is associated with a set of discrete patient attributes, Ai = {αic, αis, αia} where αc = disease class, αs = sex and αa = age. Supervised clustering can involve learning M Nl centroids with each representing a unique set of attributes, {αjc, αjs, αja} ∈ {Aj}Mj=1, and grouping similar instances together. Given unlabelled instances, {xu}Nu=1, the centroid closest to each representation, vu = fθ(xu), is used to infer the latter’s attributes. In this work, we learn cluster centroids which are more formally introduced in Sec. 4.1.
Information retrieval IR involves searching through a large, unlabelled dataset, {xu}Nu=1, and retrieving a relevant instance, xu. However, relevance, defined based on whether an instance satisfies some criteria, is difficult to ascertain when instances are unlabelled. Typically, a query in the form of an embedding which represents a desired set of attributes, Aj , retrieves its closest (and most relevant) representation, vu = fθ(xu), and infers the latter’s attributes. In this work, we learn a set of query embeddings. As will become apparent in Sec. 5, these embeddings can also be treated as centroids, like those outlined in supervised clustering, and will thus serve a dual purpose.

heading: 4 Methods

heading: 4.1 Attribute-specific clinical prototypes
text: We aim to learn embeddings, referred to as clinical prototypes, that can be exploited for both the clustering and retrieval of cardiac signals based on multiple patient attributes. In the clustering setting, the goal is to annotate unlabelled instances with a set of patient attributes. To that end, we exploit clinical prototypes as centroids of clusters to which such unlabelled instances are assigned (see Fig. 1 left). In the retrieval setting, the goal is to retrieve unlabelled instances based on a set of patient attributes. To that end, we exploit each clinical prototype as a query to search through an unlabelled database and retrieve instances to which it is most similar (see Fig. 1 right).
In designing clinical prototypes, we take inspiration from the field of natural language processing (NLP) where a learnable word embedding represents a unique word. In our case, each prototype represents a unique combination of discrete patient attributes. Formally, given the attributes, αc, αs, and αa, we would have M = |αc| × |αs| × |αa| such unique combinations denoted by A = {αjc, αjs, αja}Mj=1. We associate each combination, Aj ∈ A, with a learnable prototype, pAj ∈ RE , for a set of M prototypes, P = {pAj}Mj=1. Note that this framework extends to any number of attributes. In the next section, we outline how to learn these clinical prototypes.

heading: 4.2 Learning attribute-specific clinical prototypes
text: Clinical prototypes will serve a dual purpose of attribute-specific clustering and retrieval. As such, prototypes will need to be in proximity to a subset of representations of instances associated with a specific set of patient attributes. To achieve this proximity, we leverage the contrastive learning framework which involves a sequence of attractions and repulsions, as explained next.
Hard assignment We encourage the representation, vi = fθ(xi), of an instance, xi, associated with a set of attributes,Ai ∈ A, to be similar to the single clinical prototype, pAj , that shares the exact same set of attributes (i.e., Ai = Aj), and dissimilar to the remaining clinical prototypes, {pAk}k 6=j . To achieve this, we optimize LNCE−hard for a mini-batch of B instances (Eq. 1). Intuitively, it heavily penalizes the learner if less probability mass is placed on the similarity of vi and pAj than on the similarity of other representation-and-prototype pairs. We choose to quantify the cosine similarity of pairs, s(vi,pAj ), alongside a temperature parameter, τs, as is done by Kiyasseh et al. [20].
LNCE−hard = − 1
B B∑ i=1 log ( es(vi,pAj )∑M k e s(vi,pAk ) ) s(vi,pAj ) = vi.pAj ‖vi‖‖pAj‖ . 1 τs (1)
We refer to this many-to-one mapping from representations to clinical prototype as a hard assignment. Such an assignment, however, implies that a prototype is unlikely to extract potentially useful
information from a representation whose attributes are not exactly the same as those of the prototype. We quantify this limitation in Sec. 6.4 and propose an alternative assignment next.
Soft assignment To overcome the limitation of a hard assignment, we encourage the representation, vi, to be similar to a subset of clinical prototypes, L ⊂ P (see Fig. 2). We must take caution, however, to avoid erroneously attracting representations to clinical prototypes from a different class. Doing so would reduce class-specific margins and thus hinder the downstream clustering and retrieval tasks.
Uniform attraction. We chose the subset to include prototypes, L = {pAl} |L| l=1, that share the same disease class, αic, with the representation, vi, implying that Al ∈ {αic, αls, αla} |L| l=1 ⊂ A. Note that the clinical prototypes in the subset, L, continue to represent attributes that vary along the dimensions of patient sex and age (αs, αa). Therefore, attracting vi to prototypes in L uniformly will likely cause the latter to become minimally distinguishable across sex and age. This is an undesired outcome in light of our goal of learning attribute-specific prototypes. We avoid this behaviour by modulating the degree of attraction between vi and all prototypes in the set, P , as outlined next.
Modulated attraction. The attractive force between vi and pAj is reflected by the corresponding LNCE−hard term (Eq. 1). By placing less probability mass on s(vi,pAj ) (i.e., less similarity) than on s(vi,pAk) ∀k, k 6= j, the learner incurs a higher loss and thus attracts the pair. We extend this logic to all prototypes to obtainM LNCE−hard terms per representation. To modulate these attractions, we introduce a weight, wij ∈ {wij}Mj=1, as a coefficient of the j-th loss term (Eq. 2). Each weight, wij , quantifies the degree of matching between attributes of the representation, Ai = {αic, αis, αia}, and those of the clinical prototype, Aj = {αjc, αjs, αja}, as reflected by q(Ai, Aj) ∈ R. We define 1 as the indicator function and τω as a temperature parameter that determines how soft the representation-andprototype attraction is. For example, as τω −→∞, this approach reverts to the uniform attraction setup. The intuition is that a stronger attraction (↑ wij) should exist for a representation-and-prototype pair that shares more attributes. We also avoid the erroneous attraction of pairs from different classes (i.e., αic 6= αjc) by setting ωij = 0. When visualizing the UMAP projection [33] of prototypes learned with a uniform attraction (τω =∞) (Fig. 3 left) and those learned with a modulated attraction (τω 6=∞) (Fig. 3 centre), we show that the latter become more linearly separable across sex.
LNCE−soft = − 1
B B∑ i=1  M∑ j=1 ωij log ( es(vi,pAj )∑M k e s(vi,pAk ) ) (2) ωij = { eq(Ai,Aj)∑|L| l e q(Ai,Aj) if αic = α j c
0 otherwise
q(Ai, Aj) = 1
τω .[1(αic = α j c) + 1(α i s = α j s) + 1(α i a = α j a)]
Arrangement of clinical prototypes Clinical prototypes would confer a high degree of interpretability if they also captured the semantic relationships between attributes. Concretely, prototypes representing similar attribute sets (e.g., adjacent age groups) should be similar to one another. This is analogous to the high similarity of word embeddings representing semantically similar words [34]. To capture these semantic relationships, we encourage class-specific prototypes to maintain some desired distance between one another. As such, each pair of M clinical prototypes, pAj , pAk ∀j, k ∈ [1,M ] is associated with an empirical and ground-truth (desired) distance. For the former, we normalize the prototypes (L2 norm) and calculate their Euclidean distance, d̂jk =
∥∥pAj − pAk∥∥2 ∀j, k ∈ [1,M ]. For the latter, we define the ground-truth distance as djk = β × dH ∈ R, where dH(Aj , Ak) ∈ Z+ is the Hamming distance between a pair of discrete attribute sets. Intuitively, the Hamming distance counts the number of attribute mismatches and β ∈ R penalizes each mismatch. Therefore, we can generate an empirical set, {d̂jk}Mj,k=1 and a ground-truth set, {djk}Mj,k=1, of distance values. By minimizing the mean-squared error between these two sets, we learn clinical prototypes that adopt a semantically meaningful arrangement (see Fig. 3 right). Since we are only interested in adopting this arrangement for prototypes of the same class (i.e., αjc = α k c ), we incorporate the regularization term, Lreg , into the final objective function, Ltot.
Lreg = M∑
j,k=1
(d̂jk − djk)2 ⇔ αjc = αkc Ltot = LNCE−soft + Lreg (3)

heading: 5 Experimental design
text: Datasets We use 1) Chapman [35] which consists of 12-lead ECG recordings from 10,646 patients alongside cardiac arrhythmia (disease) labels which we group into 4 major classes. 2) PTB-XL [36] consists of 12-lead ECG recordings from 18,885 patients alongside disease labels which we group into 5 major classes [37]. Each dataset contains patient sex and age information and is split, at the patient level, into training, validation, and test sets using a 60 : 20 : 20 configuration. Each time-series recording is split into non-overlapping segments of 2500 samples (≈ 5s in duration), as this is common for in-hospital recordings. Further details are provided in Appendix B.
Description of clustering setting During inference, we treat the clinical prototypes, {pAj}Mj=1, as a set of cluster centroids. We calculate the Euclidean distance between the i-th representation and each of the M prototypes, identify the closest prototype, pAk , and assign the representation to Ak which we now denote by Âi = {α̂ic, α̂is, α̂ia}. Repeating this process forN unseen instances results in
a set of assigned attribute values, ~̂α = {α̂i}Ni=1, for a particular attribute, α̂ ∈ A (e.g., disease class). Such unseen instances would typically be unlabelled. For evaluation, however, we assume access to the ground-truth attribute values, ~α = {αi}Ni=1, with which we calculate the accuracy, Acc(α̂), and the adjusted mutual information, AMI(α̂) ∈ [0, 1], between ~̂α and ~α.
Acc(α̂) = 1
N N∑ i=1 1(α̂i = αi) AMI(α̂) =
[ MI(~α, ~̂α)− E(MI(~α, ~̂α)) ] E(H(~α),H(~̂α))− E(MI(~α, ~̂α))
(4)
where MI(~α, ~̂α) denotes the mutual information between the ground-truth and assigned set of attribute values, and H(~α) denotes the entropy of the attribute values.
Description of retrieval setting During inference, we treat the clinical prototypes, {pAj}Mj=1, as a query set. We calculate the Euclidean distance between the j-th clinical prototype and representations of N unseen instances, retrieve the K closest instances, and then assign them to Aj = {αjc, αjs, αja}. Note that such instances would typically be unlabelled, thus precluding a simple SQL search. For evaluation, however, we assume access to the ground-truth attributes, {αic, αis, αia}Ki=1, with which we calculate a variant of the precision at K metric (Eq. 5). It checks whether at least one of the retrieved instances is relevant, where relevance is based on a partial or exact match of query and instance attributes (# attribute matches). This value is then averaged across all M prototypes.
P@K = 1
M M∑ j=1 1  K∑ i=1 1 ([ αic = α j c ] ∩ [ αis = α j s ] ∩ [ αia = α j a ])︸ ︷︷ ︸ relevance≡ # attribute matches = 3 ≥ 1  (5) Ideally, a retrieved instance would match all of the query’s attributes (disease class, sex, and age). In our context, however, the motivation for breaking down the evaluation of the retrieval setting based on the number of attribute matches is twofold. First, it allows us to evaluate our framework at a more granular level and thus detect subtle changes in performance. Second, the importance of such an evaluation at the attribute level arguably depends on the clinical context. For example, a cardiologist diagnosing a disease might be most interested in the pathology (i.e., disease class) attribute. On the other hand, a pharmaceutical company looking to recruit patients within a particular age group for a clinical trial might be most interested in the age attribute. Moreover, biomedical researchers looking to stratify treatment outcomes based on sex would be most interested in the sex attribute.
Baseline methods We compare clinical prototypes learned via the CROCS framework (CP CROCS) to the following methods. For retrieval, Deep Transfer Cluster (DTC) [38] learns cluster prototypes by minimizing the KL divergence between a target distribution and one based on the distance between prototypes and representations. TP CROCS involves traditional prototypes where each prototype, v̄Aj = 1∑ I(Ai=Aj ) ∑N i=1 vi · I(Ai = Aj), is simply an average of representations, vi, associated with the same set of attributes, Aj . Such representations are also learned via CROCS.
For the clustering task, we compare to several state-of-the-art clustering methods, in addition to those mentioned above. k-means identifies cluster centroids based on the input instances, x (KM raw), or representations, v, learned via the CROCS (KM CROCS) or explainable prototypes (KM EP) [11] framework. DeepCluster (DC) [39] iteratively applies k-means to representations, pseudolabels them according to their assigned cluster, and then exploits such labels for supervised training. Deep Temporal Clustering Representation (DTCR) [16] optimizes an objective function with a reconstruction, k-means, and classifier loss that determines whether instances are real. Information Invariant Clustering (IIC) [40] maximizes the mutual information between class probabilities of an instance and its perturbed counterpart. SeLA [41] implements Sinkhorn-Knopp to pseudo-label instances in a supervised manner. For further details, see Appendix D.
Hyperparameters During optimization, we chose the temperature parameter, τs = 0.1 [20], and τw = 1. We specified β = 0.2, in the regularization term, after experimenting with several values (see Appendix F). Too small a value of β would decrease the distance between class-specific clinical prototypes. Too large a value of β would cause clinical prototypes from different classes to overlap with one another and thus reduce class separability. For Chapman and PTB-XL, sex ∈ {M,F}, age is converted to quartiles, and |class| = 4 and 5, respectively. Therefore, M = |class| × |sex| × |age| =
32 and 40, for the two datasets, respectively. The network, fθ, comprises 1D convolutional operators and we chose the embedding dimension E = 128 and 256 for Chapman and PTB-XL, respectively. We show that E has a minimal effect on performance (see Appendix E). Further network and implementation details can be found in Appendix C.

heading: 6 Experimental results

heading: 6.1 Visualizing clinical prototypes
text: We begin by qualitatively validating the claim that clinical prototypes are attribute-specific. In other words, can prototypes be delineated along the dimensions of disease class, sex, and age? To address this, we illustrate, in Fig. 4, two dimensional UMAP projections of the class-specific clinical prototypes (large, coloured shapes), traditional prototypes (large, black shapes), and representations of instances in the validation set of Chapman and PTB-XL.
We show that clinical prototypes are indeed disease class-specific, as evident by the high degree of class separability of such prototypes. We also find that clinical prototypes are distinct from traditional prototypes, a distinction whose importance will become evident in later sections. Second, the consistency of the class labels of the prototypes with those of the representations is a harbinger of how prototypes may perform in the clustering and retrieval settings, as we show in the next section. These findings complement the delineation of the prototypes along the dimensions of sex and age, and their adoption of a semantically meaningful arrangement, as was shown in Section 4.

heading: 6.2 Deploying clinical prototypes in clustering setting
text: In the clustering setting, we assign cardiac signals in a held-out dataset to a set of patient attributes associated with the cluster of the closest clinical prototype. We evaluate these assignments based on the three patient-specific attributes (disease class, sex, and age) and present the results in Table 1.
In Table 1, we find that CROCS outperforms both generic and domain-specific state-of-theart clustering methods. For example, on Chapman, CP CROCS, KM EP, and DTC achieve Acc(class) = 90.3, 65.6, and 53.4% respectively. Along the dimension of sex, and on PTB-XL, CP CROCS and DTC achieve Acc(sex) = 73.5 and 58.6%, respectively. Second, we find that CROCS leads to rich representation learning that facilitates clustering. This is evident when comparing the performance of k-means applied to representations that are learned via different methods. For example, on Chapman, KM raw, KM EP, and KM CROCS achieve Acc(class) = 28.4, 65.6, and 73.4%, respectively. We also find that clinical prototypes, when exploited as centroids, are preferable to traditional prototypes, and centroids learned via k-means. For example, on PTB-XL, KM CROCS, TP CROCS, and CP CROCS achieve Acc(class) = 47.6, 53.6, and 76.0%, respectively. These findings, which hold across datasets and evaluation metrics, point to the overall utility of the CROCS framework and clinical prototypes for attribute-specific clustering.

heading: 6.3 Deploying clinical prototypes in the retrieval setting
text: Up until now, we have shown that CROCS leads to accurate clustering. In this section, we show that CROCS can also be independently exploited for retrieval. Specifically, a query retrieves the closest K = [1, 5, 10] previously unseen cardiac signals, and assigns them to its associated set of patient attributes. In Table 2, we evaluate these assignments based on both partial and exact matches of the attributes (# attribute matches) represented by the query and retrieved cardiac signals.
In Table 2, we find that CROCS outperforms the baseline retrieval method, DTC. For example, on Chapman, atK = 1, and when # attribute matches≥ 1, CP CROCS and DTC achieve a precision of 95.6 and 71.9%, respectively. This indicates that, on average, 95.6% of the cardiac signals retrieved by the clinical prototypes are relevant. Relevance, in this case, implies that the retrieved cardiac signals share at least one attribute with the query. Such a finding points to the utility of clinical prototypes as queries in the retrieval setting. We also find that CROCS leads to rich representation learning that facilitates retrieval. This is evident by the strong performance of TP CROCS which depends directly on representations learned via our CROCS framework. For example, on PTB-XL, at K = 1, and when # attribute matches ≥ 1, DTC, TP CROCS, and CP CROCS achieve a precision of 70.0, 99.0, and 92.5%, respectively. In this particular case, the lower performance of CP CROCS relative to TP CROCS is hypothesized to stem from clinical prototypes acting instead as archetypes (extreme representative data points) [42] which may occasionally hinder retrieval along multiple attributes. Evidence of such extreme embeddings can be found in Fig. 4. We also show that CROCS continues to perform well even when provided with only 10% of the labelled training data (see Appendix G).
To qualitatively evaluate the retrieval performance, we first randomly choose a query representing a set of attributes and calculate its Euclidean distance to the representations in a validation set. We present
distributions of such distance values in Fig. 5 (top row), for a DTC query and a CP CROCS query, coloured based on the ground-truth class of the representations (other queries shown in Appendix H). In Fig. 5 (bottom row), we illustrate the six cardiac signals (K = 6) that are closest to each query, with a green border indicating signals whose class attribute matches that of the query. We find that the CP CROCS query is closer to representations of the same class (SR) than to those of a different class. For example, in Fig. 5b (top row), the average distance between the CP CROCS query representing {SR,male,under 49} and representations with and without the class attribute SR is ≈ 0.6 and > 1.5, respectively. Such separability, which is not exhibited by the DTC query, points to the improved reliability of the CP CROCS query in distinguishing between the relevance of cardiac signals. Further evidence in support of this reliability is shown in Fig. 5 (bottom row) where we find that a DTC and a CP CROCS query retrieve relevant cardiac signals 0% and 50% of the time, respectively. This finding also extends to the PTB-XL dataset (Appendix H).

heading: 6.4 Investigating the marginal impact of design choices
text: We have shown that CROCS reliably allows for both clustering and retrieval. In this section, we conduct several ablation studies to better understand the root cause of this reliability (see Table 3). We find that, on average, the soft assignment of representations to prototypes is preferable to the hard
assignment. For example, on PTB-XL, LNCE−soft and LNCE−hard achieve Acc(class) ≈ 76.0 and 66.5%, respectively. We also find that our full framework (LNCE−soft + Lreg) performs better than, or on par with, other variants. For example, on Chapman, LNCE−hard and LNCE−soft τω =∞, and τω 6= ∞ achieve AMI(class) = 67.5, 68.2, and 72.1%, respectively, whereas LNCE−soft + Lreg achieves AMI(class) = 72.8%. This is a positive outcome given that the regularization term’s main purpose was simply to improve the interpretability of prototypes by allowing them to capture the semantic relationships between attributes. These findings extend to the retrieval setting (Appendix I).

heading: 7 Discussion
text: In this paper, we proposed a supervised contrastive learning framework, entitled CROCS, for the clustering and retrieval of cardiac signals based on multiple patient attributes. In the process, we attracted representations associated with a set of attributes to learnable embeddings, termed clinical prototypes, that share such attributes and repelled them from prototypes with different attributes. We showed that CROCS outperforms the state-of-the-art method, DTC, when clustering, and retrieves relevant cardiac signals while lending itself to a higher degree of interpretability.
We acknowledge several limitations that can be addressed in future work. We made the design choice of discretizing patient attributes (e.g., sex and age). However, these attributes, and indeed other clinical parameters, can be continuous. Therefore, extending clinical prototypes to capture this continuity could offer researchers finer control over the clustering and retrieval process. In doing so, we envision two main challenges. First, continuous attribute values imply that the number of prototypes to be learned will grow. This may pose a computational bottleneck. To alleviate this bottleneck, researchers may benefit from advancements in the field of NLP and textual representation learning. Second, to learn useful prototypes in this continuous setting, one may require sufficient labelled data associated with each attribute combination. In practice, this may be difficult to achieve, particularly for under-represented attribute groups. Furthermore, in this work, we were limited to three discrete patient attributes. Such a decision, although primarily motivated by the availability of patient meta-data alongside ECG signals, does not exploit the diverse and abundant meta-data typically available within healthcare.

heading: Acknowledgements
text: We thank the anonymous reviewers and Antong Chen for their insightful feedback. We also thank Nagat Al-Saghira and Mohammed Abdel Wahab for lending us their voice. David Clifton was supported by the EPSRC under Grants EP/P009824/1and EP/N020774/1, and by the National Institute for Health Research (NIHR) Oxford Biomedical Research Centre (BRC). The views expressed are those of the authors and not necessarily those of the NHS, the NIHR or the Department of Health. Tingting Zhu was supported by the Engineering for Development Research Fellowship provided by the Royal Academy of Engineering.

Review summaries:
Paper presents for retrieving cardiac signal data corresponding to a patient described  by a set (3) of attributes (Sex, age, disease type). This is built on a model constructed by clustering such cardiac signals representations and learning their corresponding patient attributes. 	Although well written, the paper suffers, in our opinion, from targeting a very simplified problem (number of attributes, attribute sampling) that lends it to building a bespoke solution that overfits the used data and thus overperforms other methods.  The novelty was not clearly apparent to us from other clustering/retrieval methods.

Cardiac signals when unlabeled are difficult to query for given a set of attributes of interest such as disease class, age and sex.  The paper proposes a cluster-based retrieval system for this purpose. The algorithm proposed is of two-fold - (1) Learn a function to map a cardiac signal to an embedding closer in representation to a clinical prototype (embedding representative of a unique attribute set)   - this is done using a contrastive-learning framework assuming an initial-set of labeled data where cardiac-signals are annotated with class, age and sex and (2) Given a query attribute set - use its clinical prototype embedding to rank the  cardiac signals. Here the function from step 1 is used to get an embedding representation for cardiac signals and then their Euclidean distance from clinical prototypes is considered for ranking in the retrieval. The paper evaluates clustering and retrieval tasks on two datasets Chapman and PTB-XL.

This paper proposes a clustering and information retrieval algorithm for unannotated large databases of physiological signals (in this case ECG signals). The method is based on a contrastive learning approach, which has recently been suggested for semi-supervised learning on ECG data. The proposed approaches are evaluated on two large ECG datasets and compared with state-of-the-art approaches.