Automatic Cardiac Risk Management Classification using large-context Electronic Patients Health Records
Organizations: Research Unit of Intelligent Health Technologies, Universit`a Campus Bio-Medico di Roma, Rome, Italy. · Central Diagnostic Laboratory, University Medical Center Utrecht, Utrecht, The Netherlands.
Abstract
To overcome the limitations of manual administrative coding in geriatric Cardiovascular Risk Management, this study introduces an automated classification framework leveraging unstructured Electronic Health Records (EHRs). Using a dataset of 3,482 patients, we benchmarked three distinct modeling paradigms on longitudinal Dutch clinical narratives: classical machine learning baselines, specialized deep learning architectures optimized for large-context sequences, and general-purpose generative Large Language Models (LLMs) in a zero-shot setting. Additionally, we evaluated a late fusion strategy to integrate unstructured text with structured medication embeddings and anthropometric data. Our analysis reveals that the custom Transformer architecture outperforms both traditional methods and generative \acs{llm}s, achieving the highest F1-scores and Matthews Correlation Coefficients. These findings underscore the critical role of specialized hierarchical attention mechanisms in capturing long-range dependencies within medical texts, presenting a robust, automated alternative to manual workflows for clinical risk stratification.
Figures & tables
| Characteristic | Value |
|---|---|
| Male samples | 1871 (53.73%) |
| Female samples | 1611 (46.27%) |
| Age (mean ± SD) | M: 74.52 ± 9.05, F: 74.40 ± 9.51 |
| Class 0 | 2808 (80.61%) |
| Class 1 | 674 (19.39%) |
| Total number of samples | 3482 |
| Feature | HTrans (Avg) | HTrans (CLS) | ResNet | LinearSVC |
| Architecture Base | Hierarchical Transformer | ResConsultNet (CNN) | SVM (Linear) | |
| Input Representation | Learned Embeddings | Learned Embeddings | TF-IDF | |
| Aggregation | Global Avg Pool | CLS Token | Max Pooling (Inter-layer) | Hyperplane Dist. |
| Structural Params | ||||
| Total Layers | – | |||
| Block Composition | PreNorm Attn/FF Add | Conv1D BN ReLU | – | |
| Parameter | Value |
|---|---|
| Epochs | |
| Batch Size | |
| Learning Rate | |
| Weight Decay | |
| Optimizer Flag | Adam (AMSGrad) |
| Data Split Strategy |
| Models | F1-Score (%) | Precision (%) | Recall (%) | MCC-Score ⊕ |
|---|---|---|---|---|
| Dummy Classifier | 31.17 (0.53) | 19.36 (0.33) | 79.94 (1.47) | -0.0013 (0.016) |
| Linear SVC △ | 86.13 (0.59) | 82.80 (0.57) | 92.78 (0.48) | 0.749 (0.011) |
| H-transformer 1D † | 89.73 (3.39) | 89.73 (3.39) | 91.48 (1.25) | 0.718 (0.049) |
| H-transformer 1D ‡ | 91.48 (1.25) | 91.48 (1.25) | 89.73 (3.39) | 0.646 (0.144) |
| ResNet1D | 78.54 (2.16) | 78.54 (2.16) | 78.54 (2.16) | 0.371 (0.102) |
| Zero-Shot LLM GPT-4o-mini | 34.81 | 21.31 | 94.8 | 0.12 |
| Models | F1 (%) | Precision (%) | Recall (%) | MCC ⊕ |
|---|---|---|---|---|
| Dummy Classifier | 50.76 (0.0) | 50.75 (0.0) | 50.78 (0.0) | 0.015 (0.0) |
| Linear SVM △ | 86.30 (0.56) | 82.97 (0.54) | 92.87 (0.43) | 0.752 (0.010) |
| H-transformer1D † | 92.48 (0.67) | 92.48 (0.67) | 92.48 (0.67) | 0.758 (0.024) |
| H-transformer1D ‡ | 91.02 (1.11) | 91.02 (1.11) | 91.02 (1.11) | 0.730 (0.028) |
| ResNet1D | 85.48 (0.69) | 85.48 (0.69) | 85.48 (0.69) | 0.565 (0.023) |