TL;DR
LYNX-ECG is a novel hierarchical graph neural network that classifies electrocardiograms (ECGs) by representing heartbeats as sparse "visibility graphs" of key turning points. It outperforms massive foundation models while using only 14% of the storage, and more importantly, it allows clinicians to "audit" its decisions by testing how specific waveform regions and timing patterns drive its predictions.
What Problem Does This Paper Address?
Deep learning has achieved impressive accuracy in medical diagnostics, but it often operates as a "black box." In the context of ECGs, standard models process raw signal samples, making it difficult to pinpoint exactly which part of a heartbeat—like the PR interval or the QRS complex—triggered a diagnosis.
Physicians interpret ECGs based on specific landmarks and the timing between them. If a model predicts a conduction disorder but can't show it's looking at the clinically relevant region, doctors are rightfully hesitant to trust it. Furthermore, traditional "attribution" methods (like heatmaps) often highlight isolated, noisy points rather than meaningful clinical structures. The authors aim to bridge this gap by creating a model that is both highly accurate and natively auditable.
Methods
The authors introduce LYNX-ECG (Lead-level visibilitY Networks for eXplainable ECG), which moves away from dense signal processing toward a structured, graph-based approach:
- Turning-Point Sparsification: Instead of treating every signal sample as a node, the model selects "turning points" (local extrema) and R-peaks. This reduces the data by over 86% while preserving the essential morphology of the waveform.
- Visibility Graphs: Nodes are connected using a "natural visibility" criterion—essentially, an edge exists between two points if they have a geometric "line-of-sight" over the rest of the waveform.
- Hierarchical GNN Architecture:
- Beat Level: An edge-aware Graph Isomorphism Network (GINE) encodes individual heartbeat graphs.
- Lead Level: A Graph Attention Network (GATv2) aggregates these beat embeddings within each of the 12 leads.
- Exam Level: Attention pooling combines lead embeddings into a final representation for classification.
Datasets
The model was trained and evaluated on large-scale, real-world data:
- CODE100: A massive training set of ~2.2 million 12-lead ECGs from the Telehealth Network of Minas Gerais, Brazil.
- CODE-Test: A high-quality, annotated in-domain test set of 827 exams.
- PTB-XL: A widely used public dataset (~21,800 exams) used for external validation to test how well the model generalizes to different populations and devices.
Key Insights and Ideas
- Sparsity is a Feature, Not a Bug: By focusing only on turning points, the model ignores high-frequency noise and focuses on the "shape" of the signal. This leads to better performance than using every single data point.
- Clinically Grounded Auditing: Because every node in the graph has a timestamp, the researchers can perform "interventional" audits. They can literally delete the QRS complex from a graph or shuffle the order of beats to see if the model's prediction changes.
- Learning the "Rules" of Cardiology: The audits revealed that the model naturally learns clinical logic. For example, it identifies Atrial Fibrillation (AF) based on the variation between beats; if you replace every beat with an identical "template" beat, the AF prediction vanishes.
- Lead Redundancy vs. Specificity: For rhythm disorders (like bradycardia), the evidence is redundant across leads. For conduction disorders (like bundle-branch blocks), the evidence is concentrated in specific leads (e.g., Lead I and V6 for RBBB), matching clinical practice.
Key Results
- State-of-the-Art Accuracy: On the CODE-Test set, LYNX-ECG achieved a macro F1 score of 0.889, outperforming five strong baselines, including the ECGFounder foundation model (0.863).
- High Faithfulness: In over 90% of correct predictions for conduction disorders, the clinically expected waveform region (e.g., the PR interval for 1st-degree AV block) was the primary driver of the prediction.
- Efficiency: The sparse representation requires only 14% of the storage compared to dense graph methods, making it much more practical for large-scale deployment.
Limitations and Future Work
- External Generalization: While the model performed well on the external PTB-XL dataset (F1 0.730), there was a noticeable drop compared to in-domain results. This was partly attributed to differences in how different institutions define labels (e.g., the heart rate threshold for "bradycardia").
- Reliance on Delineation: The auditing process currently relies on automated tools to identify the boundaries of P, QRS, and T waves. Errors in this pre-processing step can affect the audit's accuracy.
- Territorial Diagnoses: The current model does not have explicit "cross-lead" edges in its graph structure. This means it might struggle with "territorial" diagnoses (like specific types of heart attacks) that depend on comparing patterns across specific groups of leads. Future work could involve adding these relational edges to the hierarchy.
Summary updated