Instructions to use misalisu-ai/lemr-multimodal-clinical-core with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use misalisu-ai/lemr-multimodal-clinical-core with Transformers:
# Load model directly from transformers import LEMRForClinicalPrediction model = LEMRForClinicalPrediction.from_pretrained("misalisu-ai/lemr-multimodal-clinical-core", dtype="auto") - Notebooks
- Google Colab
- Kaggle
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).
𧬠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_2$) 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 ($\alpha$) based on the shared latent representation:
The dynamically weighted representation is generated within the convex hull[cite: 581]:
If clinical notes are missing or highly corrupted by typographical noise, the gating parameter autonomously drives $(\mathbf{1} - \alpha) \to 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:
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:
π 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
- 68
