Skip to content

We propose a Dual-Tower Transformer (DT-Transformer) for stroke mortality prediction on the multicenter eICU Collaborative Research Database. The decoupled architecture encodes categorical features with learnable embeddings and numerical clinical variables using a Transformer encoder with multi-head self-attention, then fuses both representations for mortality prediction. The model achieves an AUPRC of 0.6171—a 14.4% relative improvement over the strongest neural baseline. An Adaptive Runtime Safeguard prevents out-of-range categorical indices from reaching the embedding lookup.

Several implementation details in the published paper differ from the archived codebase—specifically which features the categorical tower embeds, the feature counts, the scope of the runtime safeguard, and Figure 4, which was included in error and shows illustrative values rather than attention weights from the trained model. All reported performance metrics come from the original pipeline and remain unchanged. See the model repository corrections and preprocessing audit for full details.

Model AUROC AUPRC
DT-Transformer (ours) 0.8848 ± 0.0034 0.6171 ± 0.0058
XGBoost 0.8908 0.6467
Random Forest 0.8806 0.6236
Neural Network 0.8582 ± 0.0018 0.5394 ± 0.0054
Standard Transformer 0.8457 ± 0.0129 0.5279 ± 0.0195
Standard MLP 0.8534 ± 0.0058 0.5170 ± 0.0081

Neural model metrics are reported as mean ± SD across five random seeds on a fixed 70/10/20 split stratified by outcome and partitioned by ICU stay. XGBoost and Random Forest represent single deterministic runs.

  • Dual-Tower Design — Separate encoding pathways for categorical and numerical features.
  • Self-Attention (Numerical Tower) — A two-layer Transformer encoder models interactions among the 91 numerical inputs, while the categorical tower employs learnable embeddings.
  • Late Fusion — Tower outputs are concatenated prior to the classification head.
  • Adaptive Runtime Safeguard — Performs range validation and index clamping on categorical inputs to prevent out-of-range values from reaching the embedding lookup.

Stack: Python · PyTorch · Scikit-learn · XGBoost · Pandas · NumPy

eICU Collaborative Research Database — A multicenter critical care database comprising 200,859 ICU stays across 208 hospitals. The stroke cohort is extracted using ICD-9 codes 430, 431, 433, 434, 436, and 437, restricted to the first 72 hours of each ICU stay. The 94 input features comprise patient demographics, hospital identifier, admission height and weight, and aggregated vital signs and laboratory measurements. Data are available through PhysioNet credentialed access.

Open-Source Implementation — Released across two repositories. Model training (Dual-Tower-Transformer-eICU-Stroke) includes the PyTorch architecture, a unified training engine covering seven model families, a multi-seed evaluation runner, Optuna hyperparameter optimization, and SHAP/LIME explainability tools. The data pipeline (Data-Preprocessing-for-eICU) handles raw eICU extraction, ICD-9 stroke cohort selection, first-72-hour feature aggregation, and stratified train/validation/test partitioning (by ICU stay in the published version, and by patient on the corrected fix branch).