ICU AI
Sepsis Early Detection
SOFA Score Prediction
class SepsisPredictor(nn.Module):
def __init__(self, input_dim=40, seq_len=24):
super().__init__()
self.lstm = nn.LSTM(input_dim, 64, num_layers=2, batch_first=True, bidirectional=True)
self.attention = nn.Linear(128, 1)
self.classifier = nn.Sequential(
nn.Linear(128, 64), nn.ReLU(), nn.Dropout(0.3), nn.Linear(64, 1))
def forward(self, x):
h, _ = self.lstm(x)
attn = torch.softmax(self.attention(h), dim=1)
context = (attn * h).sum(dim=1)
return torch.sigmoid(self.classifier(context))