The LEMR Framework: Robust, Efficient, and Calibrated Multimodal EHR Learning on Constrained Commodity Hardware

The Lightweight Efficient Multimodal Robustness (LEMR) framework provides an optimized, resource-conscious deep learning methodology engineered to perform robust clinical risk stratifications strictly within a consumer-grade computational budget (such as a single Google Colab free tier T4 GPU).

LEMR explicitly resolves three fundamental failure modes of traditional multi-modal electronic health record (EHR) models: modality missingness, extreme textual/clinical note noise, and high-stakes prediction miscalibration.


🗺️ Architectural Topology

The framework ingests highly heterogeneous, asynchronous streams from the MIMIC-IV production database: structured vital signs (24-hour time-series grids mapped from ICU chartevents) and unstructured free-text progress documentation (note.discharge).

MultiModal Architecture Diagram


🧬 Core Methodological Design

1. Lightweight Modality Encoders

To isolate gradient tracking vectors and lower VRAM allocations, raw image and textual data streams are mapped down using parameter-efficient representations:

  • Structured Vitals: Encoded using a single-layer Gated Recurrent Unit (GRU) tracking key continuous vectors (Heart Rate, Systolic Blood Pressure, SpO₂) bucketed into hourly aggregates.
  • Unstructured Text: Handled by a completely frozen transformer backbone (distilbert-base-uncased) acting as a linear feature probe, preventing expensive end-to-end backpropagation over large-scale parameters.

2. Adaptive Gated Multimodal Fusion

Rather than blindly concatenating streams—which leaves models brittle if one data stream is corrupted or missing—LEMR implements an active Gated Multimodal Unit (GMU). The system computes sample-specific sigmoidal routing gates (α) based on the shared latent representation:

α=σ(Wgate[hvitalshtext]+bgate)\alpha = \sigma\left(W_{\text{gate}} \left[ h_{\text{vitals}} \parallel h_{\text{text}} \right] + b_{\text{gate}}\right)

The dynamically weighted representation is generated within the convex hull:

hfused=αhvitals+(1α)htexth_{\text{fused}} = \alpha \odot h_{\text{vitals}} + (\mathbf{1} - \alpha) \odot h_{\text{text}}

If clinical notes are missing or highly corrupted by typographical noise, the gating parameter autonomously drives (1 − α) → 0, muting the corrupted channel and preventing latent space corruption.

3. Post-Hoc Confidence Calibration

Modern overparameterized networks produce overly confident, distorted logit assignments that do not match empirical disease frequencies. We resolve this post-training by minimizing the Expected Calibration Error (ECE) over validation sets:

ECE=m=1MBmnacc(Bm)conf(Bm)\text{ECE} = \sum_{m=1}^M \frac{|B_m|}{n} \left| \text{acc}(B_m) - \text{conf}(B_m) \right|

Using the lineally exact L-BFGS convergence routine, we solve for a universal temperature scaling factor T > 0 to soften model outputs without perturbing the original classification argmax sequence bounds:

p^i=ezi/Tjezj/T\hat{p}_i = \frac{e^{z_i / T}}{\sum_{j} e^{z_j / T}}


📊 VRAM Memory Optimization Profiles

By decoupling parameter matrices and routing backward loops through custom parameter hooks, LEMR scales smoothly down to cheap, constrained environments:

Optimization Execution Mode Peak VRAM Footprint (MB) Throughput Performance ECE Convergence
Standard Baseline (FP32) 14,250 MB 12.4 samples/sec Baseline
Baseline AMP (FP16) 6,840 MB 38.2 samples/sec Identical
AMP + Gradient Accumulation 2,120 MB 32.1 samples/sec Identical
AMP + Accumulation + Grad Hooks 1,650 MB 34.8 samples/sec Identical

🛠️ Reproducibility and Usage Verification

To confirm structural validity without loading sensitive hospital files, execute the local testing harness:

python verify_pipeline.py
Downloads last month
2
Safetensors
Model size
203k params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support