Disease Progression Modeling
Module: Healthcare AI | Difficulty: Advanced
Linear Mixed-Effects Model
where and .
Joint Model
where is the longitudinal marker value at time .
Disease Progression Models
| Disease | Model | Time Horizon | AUC |
|---|---|---|---|
| Alzheimer's | Mixed Effects | 5 years | 0.78 |
| CKD | Joint Model | 3 years | 0.82 |
| Diabetes | HMM | 10 years | 0.75 |
| Heart Failure | DeepSurv | 2 years | 0.80 |
| COPD | Recurrent NN | 1 year | 0.77 |
import torch
import torch.nn as nn
import numpy as np
class RecurrentProgressionModel(nn.Module):
def __init__(self, input_dim=50, hidden_dim=64, num_layers=2):
super().__init__()
self.input_proj = nn.Linear(input_dim, hidden_dim)
self.rnn = nn.LSTM(hidden_dim, hidden_dim, num_layers,
batch_first=True, dropout=0.2)
self.attention = nn.MultiheadAttention(hidden_dim, num_heads=4,
batch_first=True)
self.progression_head = nn.Linear(hidden_dim, 1)
def forward(self, x, lengths=None):
x = torch.relu(self.input_proj(x))
if lengths is not None:
packed = nn.utils.rnn.pack_padded_sequence(
x, lengths.cpu(), batch_first=True, enforce_sorted=False)
rnn_out, _ = self.rnn(packed)
rnn_out, _ = nn.utils.rnn.pad_packed_sequence(rnn_out, batch_first=True)
else:
rnn_out, _ = self.rnn(x)
attn_out, _ = self.attention(rnn_out, rnn_out, rnn_out)
final = attn_out[:, -1, :]
return self.progression_head(final)
model = RecurrentProgressionModel(input_dim=50, hidden_dim=64)
x = torch.randn(10, 20, 50)
lengths = torch.randint(10, 20, (10,))
output = model(x, lengths)
print(f'Progression output shape: {output.shape}')
Research Insight: Joint models that simultaneously model longitudinal markers and time-to-event outcomes outperform separate analyses because they leverage the correlation between repeated measurements and survival. Deep joint models using neural ODEs can capture non-linear trajectories and irregular sampling patterns common in real-world clinical data.