Harnessing the power of longitudinal medical imaging for eye disease prognosis using Transformer-based sequence modeling

Gregory Holste, Mingquan Lin, Ruiwen Zhou, Fei Wang, Lei Liu, Qi Yan, Sarah Van Tassel, Kyle Kovacs, Emily Y. Chew, Zhiyong Lu, Zhangyang Wang, Yifan Peng · DOI

Introduction

In ophthalmology, many of the most debilitating conditions—such as age-related macular degeneration (AMD) and primary open-angle glaucoma (POAG)—are characterized by their slow, progressive nature. Clinicians do not typically diagnose or manage these diseases based on a single snapshot; instead, they rely on a patient’s longitudinal history, comparing current scans with previous ones to assess the rate of change.

Despite this clinical reality, most deep learning models for medical imaging remain "cross-sectional." These models function like a camera, asking whether a disease is present at a specific moment in time, while ignoring the rich temporal context of a patient’s prior visits. To bridge this gap, researchers have developed the Longitudinal Transformer for Survival Analysis (LTSA), a model that treats a sequence of medical images as a temporal narrative to predict future disease risk.

The LTSA Framework

The LTSA model shifts the paradigm from simple classification to sequence modeling. By treating a series of fundus photographs (images of the back of the eye) like a sequence of words in a sentence, the model can learn the "grammar" of disease progression.

Technical Innovations

To effectively model medical history, the researchers introduced several key technical components:

  • Temporal Positional Encoding: Standard Transformers typically use positional encodings to denote the order of elements (e.g., first, second, third). However, medical visits are often irregularly spaced. LTSA utilizes an encoder that accounts for the actual time elapsed between visits, allowing the model to distinguish between a six-month gap and a two-year gap.
  • Causal Self-Attention: The architecture employs a "decoder-style" mask. This ensures that when the model makes a prediction for a specific time point, it only considers past and current data, preventing "data leakage" from the future and mimicking the real-world constraints of clinical practice.
  • Discrete Survival Analysis: Rather than providing a binary "Yes/No" prediction for a fixed window (e.g., risk at 5 years), the model outputs a hazard function. This provides a dynamic, time-varying risk assessment, showing the probability of disease onset across multiple future intervals.
  • Step-Ahead Prediction: As an auxiliary task during training, the model attempts to predict the visual features of the next visit based on current history. This forces the AI to learn more robust representations of how eye tissue changes over time.

Experimental Setup and Datasets

The model was validated using two of the most significant longitudinal datasets in ophthalmology:

  1. Age-Related Eye Disease Study (AREDS): Comprising 49,452 images from 4,274 participants, this dataset was used to predict the progression of late-stage AMD.
  2. Ocular Hypertension Treatment Study (OHTS): Comprising 30,932 images from 1,597 participants, this dataset focused on predicting the onset of POAG.

These datasets are particularly valuable because they follow patients for over a decade, providing a definitive "ground truth" for long-term disease trajectories.

Key Insights: The Importance of Trajectory

The study’s findings underscore a critical point: history matters. While the most recent image is naturally the strongest predictor of immediate risk, the change from previous states provides essential context.

Through temporal attention analysis, the researchers observed that the model naturally learns to prioritize the most recent visit (approximately 96% of the time), but it maintains a "memory" of older visits that decays linearly. This allows the model to perform "Dynamic Risk Ranking." In head-to-head tests, LTSA could distinguish between two patients who appeared similar in their most recent scans but had different trajectories, correctly identifying who would progress to disease sooner.

Performance Results

The LTSA model was compared against a standard "Single-Image Baseline" (a ResNet18 architecture). The longitudinal approach showed a clear advantage:

  • AMD Prognosis: LTSA outperformed the baseline in 19 out of 20 head-to-head comparisons across various time horizons.
  • Glaucoma (POAG) Prognosis: LTSA was superior in 18 out of 20 comparisons.
  • Predictive Accuracy: The performance gap widened as more historical data became available. For instance, in predicting 2-year risk for AMD, LTSA achieved a concordance index (C-index) of 0.923, significantly higher than the baseline’s 0.886.

Limitations and Future Directions

While LTSA represents a significant advancement in ophthalmic AI, the authors identified several avenues for future research:

  • Continuous Time Modeling: The current model operates in discrete time steps (e.g., 1-year intervals). Moving toward continuous-time modeling could provide even finer granularity for clinical decision-making.
  • Multimodal Data Fusion: Currently, the model relies solely on images. Integrating tabular data—such as age, genetics, and smoking history—could further refine risk profiles.
  • Binocular Analysis: Eye diseases often affect both eyes, though frequently at different rates. A binocular model that analyzes both eyes simultaneously might capture subtle, inter-eye progression cues that a single-eye model misses.

Conclusion

By moving beyond static snapshots and embracing the temporal complexity of medical imaging, the LTSA model provides a more accurate and clinically relevant tool for disease prognosis. This research demonstrates that the same Transformer architectures revolutionizing natural language processing can be harnessed to understand the "language" of disease progression, potentially offering clinicians a powerful new way to identify high-risk patients before irreversible vision loss occurs.

Summary updated

BibTeX
@article{holste2024harnessing,
  author = {Gregory Holste and Mingquan Lin and Ruiwen Zhou and Fei Wang and Lei Liu and Qi Yan and Sarah Van Tassel and Kyle Kovacs and Emily Y. Chew and Zhiyong Lu and Zhangyang Wang and Yifan Peng},
  title = {{Harnessing the power of longitudinal medical imaging for eye disease prognosis using Transformer-based sequence modeling}},
  journal = {Npj Digit. Medicine},
  year = {2024},
  doi = {10.1038/s41746-024-01207-4},
}
Figure