CLIC: Contextual Language-Informed Cardiac Pathology Classification

Giovani D. Lucafó, Rafael da Costa Silva, João Lucas Luz Lima Sarcinelli · 2026

Read CLIC: Contextual Language-Informed Cardiac Pathology Classification by Giovani D. Lucafó, Rafael da Costa Silva, João Lucas Luz Lima Sarcinelli (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-19132.txt.

Introduction

Giovani D. Lucafó and four colleagues propose CLIC, a heart-diagnosis method that pairs ECG signals with patient context written as text. The ECG is the standard non-invasive test for heart disease, yet most programs use the signal alone, ignoring patient traits and recording context that doctors use each day. Turning context into plain text gives the model an anchor that helps sort complex patterns. Template-based clinical text lifts sorting scores each time, while richer text made by large language models stays close behind.

Catalog record

CREATORGiovani D. Lucafó, Rafael da Costa Silva, João Lucas Luz Lima Sarcinelli
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE15920
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.19132

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

CLIC: Contextual Language-Informed Cardiac Pathology Classification Giovani D. Lucafó, Rafael da Costa Silva, João Lucas Luz Lima Sarcinelli Abstract The electrocardiogram (ECG) is the gold standard for non-invasive diagnosis of cardiac pathologies and is a fundamental pillar of cardiovascular medicine. Recent progress in deep learning has led to the development of robust automated classifiers that achieve high performance by processing raw physiological signals. However, in clinical practice, diagnosis is rarely based solely on the signal. Cardiologists commonly support their interpretation with the patient’s characteristics and the specific data-acquisition context. Despite this, most current algorithms remain restricted to signal-only analysis, failing to integrate technical metadata and demographic variables. This paper proposes C ontextual L anguage- I nformed C ardiac pathology classification (CLIC), a multimodal framework that significantly enhances diagnostic precision by encoding these variables through natural language. We demonstrate that translating patient-level contextual data into descriptive text provides an informative anchor that helps the model disambiguate complex physiological patterns. We further investigate the use of Large Language Models to synthesize richer clinical descriptions and observe that, while these generated texts remain competitive, controlled template-based contextual clinical text leads to consistent improvements in downstream classification performance. 1 Introduction Modern machine learning-based applications increasingly rely on large, heterogeneous datasets that collect information from multiple sources and modalities. In this context, multimodal learning has emerged as an approach to building richer, more complex representations ( 7 ) . However, compared to domains such as vision and language, the integration of different modalities with health time series remains less explored ( 14 ) . Few studies address the fusion of signals, clinical notes, and structured records in a unified framework ( 8 ; 6 ) . In healthcare, where time series are widely used to monitor patients, the limitations of unimodal approaches are evident. Medical decision-making relies on multiple sources of information, including physiological signals, demographic data, and textual reports, which provide complementary views of patient health. Relying on a single modality can lead to incomplete or suboptimal diagnosis, whereas richer representations can improve classification performance. Despite the success of deep learning for physiological time series, most existing architectures focus only on signal data and do not leverage the multimodal nature of medical data ( 9 ; 16 ) . In this work, we address this gap in the context of cardiology by proposing C ontextual L anguage- I nformed C ardiac pathology classification (CLIC), a multimodal supervised learning framework that integrates electrocardiogram (ECG) time series signals with textual information for cardiac pathology classification. As depicted in Figure 1 , rather than treating text as an auxiliary input, CLIC investigates how contextual language representations can enrich ECG-based feature learning, leading to more informative representations for downstream classification tasks. Specifically, we explore two multimodal configurations of CLIC, which will be detailed further in the next section. These configurations allow us to analyze the impact of increasingly expressive textual context on multimodal representation learning. Figure 1: Illustration of the C ontextual L anguage- I nformed C ardiac pathology classification (CLIC) framework. The framework consists of two input data workflows: a Resnet18 that receives a 12-lead ECG as input, and a ClinicalBERT that receives a contextual clinical text generated via a template-based strategy called Data-to-text (1) and a Prompt-guided strategy that uses Llama (2). Unlike many multimodal approaches in physiological signal analysis that rely on additional clinical sources such as electronic health records (EHRs) ( 4 ; 5 ; 17 ; 10 ) , the proposed CLIC framework operates in a self-contained setting, using only information directly available at acquisition time. Our results show that incorporating contextual variables improves classification performance and representation quality compared to ECG-only baselines. However, the integration strategy is important. Direct concatenation of numerical attributes provides a strong and stable baseline, yet transforming metadata into natural language yields the best overall results, especially in a deterministic Data-to-Text setting with the ClinicalBERT language encoder. In contrast, LLM-generated reports do not consistently improve the semantic quality of the embeddings beyond structured approaches. Although CLIC is designed to generalize across signal types and datasets, this study focuses on ECG-based diagnosis as a case study to evaluate different strategies for combining physiological signals with structured and text-based contextual information. 2 Methodology We formulate the addressed problem as a supervised multiclass classification task for ECG-based pathology classification. We conduct our experiments using the PTB-XL dataset ( 15 ) , a large-scale publicly available ECG benchmark. This dataset meets our computational constraints and provides a rich set of structured metadata, including diagnostic statements and clinical annotations, which support the multimodal experimental setting considered in this work. The classification is performed over five categories: Normal ECG (NORM), Myocardial Infarction (MI), ST/T Change (STTC), Conduction Disturbance (CD), and Hypertrophy (HYP). We followed the standard split into training, validation, and test sets and observed a notable class imbalance, particularly for Conduction Disturbances and Hypertrophy classes, posing additional challenges for supervised learning. The signals in PTB-XL consist of 500 Hz 12-lead ECGs, accompanied by the patient’s data, such as sex, age, and weight, and automatically annotated rhythm and morphology information. We followed the dataset’s recommended stratification using the strat_fold column. Folds 1 through 8 were allocated for training, fold 9 for validation, and fold 10 for testing. The target value corresponds to a single diagnostic class. As the base model for the ECG, we employ an unimodal ECG classifier based on a ResNet18 ( 2 ) architecture adapted for time series modality. The ECG encoder maps each input signal to a 512-dimensional embedding, which is subsequently fed into a multilayer perceptron (MLP) classifier. The MLP consists of two hidden layers with 256, 64, and 5 units, in this order. We employ the same architecture as the backbone in the multimodal scenario. To incorporate contextual patient information, we evaluate two strategies to construct textual representations from ECG metadata, as shown in Figure 1 . These text representations are combined with the ECG signal embeddings. Both strategies use the same metadata variables: age, sex, height, weight, collection device, signal morphology, and rhythm. The height and weight attributes were used to calculate body mass index (BMI), a commonly used metric for weight-related health risks. This selected set of variables corresponds to information that can be collected at acquisition time by health professionals in a clinical environment. The multimodal strategies are: (1) Data to text: This method converts structured metadata into short natural language descriptions using template-based substitution. It provides deterministic and consistent textual context while preserving clinical reasoning. (2) Prompt guided: This method generates more complex clinical descriptions using a large language model. In our experiments, we use the 8 billion parameter Llama 3.1 ( 13 ) model to produce a concise clinical ECG report conditioned on available metadata. We designed a prompt to guide Llama in generating the ECG reports. The model was instructed to act as a cardiology specialist and produce a single paragraph that simulates a clinical report when given the data described above. To ensure factual consistency, we constrained the model to use only the provided information and to avoid generating false information (e.g., heart rate values not present in the input). The generated text from both methods were encoded using a pretrained

Read the complete text