AI for Emergency Medicine and Triage
Module: Healthcare AI | Difficulty: Advanced
Triage Acuity Score
NEWS2 (National Early Warning Score)
Glasgow Coma Scale
Emergency AI Applications
| Application | Input | Output | Performance | |------------|-------|--------|-------------| | Triage Priority | Vitals + symptoms | Acuity level | AUC 0.89 | | Sepsis Detection | Labs + vitals | Risk score | AUC 0.92 | | Trauma Detection | CT + vitals | Injury severity | AUC 0.90 | | Cardiac Arrest Risk | ECG + vitals | Probability | AUC 0.88 | | Stroke Detection | CT + symptoms | LVO detection | AUC 0.91 |
import torch
import torch.nn as nn
class TriageModel(nn.Module):
def __init__(self, num_vitals=10, num_symptoms=50):
super().__init__()
self.vital_encoder = nn.Sequential(
nn.Linear(num_vitals, 32), nn.ReLU(), nn.Linear(32, 32))
self.symptom_encoder = nn.Sequential(
nn.Linear(num_symptoms, 64), nn.ReLU(), nn.Linear(64, 32))
self.fusion = nn.Sequential(
nn.Linear(64, 64), nn.ReLU(),
nn.Dropout(0.3), nn.Linear(64, 5))
def forward(self, vitals, symptoms):
v = self.vital_encoder(vitals)
s = self.symptom_encoder(symptoms)
combined = torch.cat([v, s], dim=1)
return self.fusion(combined)
class SepsisPredictor(nn.Module):
def __init__(self, input_dim=50, hidden_dim=64):
super().__init__()
self.lstm = nn.LSTM(input_dim, hidden_dim, batch_first=True, bidirectional=True)
self.attention = nn.Sequential(
nn.Linear(hidden_dim * 2, 32), nn.Tanh(), nn.Linear(32, 1))
self.classifier = nn.Linear(hidden_dim * 2, 1)
def forward(self, x):
lstm_out, _ = self.lstm(x)
attn_scores = self.attention(lstm_out)
attn_weights = torch.softmax(attn_scores, dim=1)
context = (attn_weights * lstm_out).sum(dim=1)
return torch.sigmoid(self.classifier(context))
def compute_news2(vital_scores):
weights = [0, 1, 2, 3, 0, 1, 2]
return sum(w * s for w, s in zip(weights, vital_scores))
model = TriageModel()
vitals = torch.randn(1, 10)
symptoms = torch.zeros(1, 50)
symptoms[0, :5] = 1
triage_output = model(vitals, symptoms)
print(f'Triage priority logits: {triage_output.shape}')
sepsis_model = SepsisPredictor()
time_series = torch.randn(1, 24, 50)
risk = sepsis_model(time_series)
print(f'Sepsis risk score: {risk.item():.4f}')
news2_score = compute_news2([0, 1, 0, 2, 0, 1, 0])
print(f'NEWS2 score: {news2_score}')
Research Insight: Emergency department AI must operate under extreme time constraints: decisions must be made in seconds. Real-time models that process vital signs streams and provide continuous risk scores can alert clinicians to deteriorating patients before traditional scoring systems. The challenge is maintaining high sensitivity while keeping false alarm rates manageable.