Hierarchical contrastive learning from GP-recorded and eGFR labels for CKD staging
Ali Guran1, Avishek Siris2, Gary K L Tam2
1Department of Computer Science, Swansea University, Swansea, SA1 8EN, UK. 935538@swansea.ac.uk.
Abstract:
Chronic kidney disease staging from longitudinal clinical records is challenging because routinely recorded GP stage labels are scarce, whereas rule-based eGFR labels are more abundant but may not capture the broader clinical context reflected in primary-care coding. This study proposes a hierarchical contrastive learning framework for CKD staging under heterogeneous supervision, designed to maximise the use of available data by leveraging both scarce GP annotations and abundant rule-based labels, which provide complementary but partially inconsistent information. Rather than treating these supervision sources as fully consistent or conflicting, the proposed approach models graded levels of agreement and incorporates this structure into a contrastive objective. This encourages clinically concordant cases to form compact representations while progressively separating increasingly discordant cases, yielding a structured and clinically meaningful embedding space. The framework is extensively evaluated across multiple neural architectures for longitudinal CKD modelling, including recurrent, convolutional, temporal convolutional, Transformer-based, and hybrid models. Results show consistent improvements over classification-only and binary contrastive baselines, with the best performance achieved using a TCN+Transformer backbone. These findings show that structured contrastive supervision can effectively exploit complementary information from clinician-annotated and rule-based labels and provide a practical framework for longitudinal disease modelling, with potential applicability beyond CKD.

