A clinical ML pipeline combining radiomics, image embeddings, and natural-language representations for ICU pneumonia severity classification. This project, its design and implementation was spearheaded and produced in collaboration with Data Scientist and Head and Neck Surgeon, Dr. Nicholas Shannon; original and developing project research accredited tohttps://github.com/nbshannon.π©Ί
Project initiative was developed and presented at the IMAGINE AI 2024 Conference by National University Singapore Medical Datathon toward Healthcare Artificial Intelligence.
Information on the event and its affiliates can be found here:
- π https://medicine.nus.edu.sg/dbmi/events/imagine-ai-2024/
- π https://sg-ai.org/
- π https://www.channelnewsasia.com/watch/new-centre-ai-in-public-health-be-launched-early-next-year-4789486
Pneumonia is one of the most common ICU admissions, and severity assessment typically depends on radiologist interpretation of chest-x-rays (CXR) or CT scans. In real clinical workflows, this process may be:
- Delayed due to radiologist availability
- Subjective with inter-reader variability
- Inconsistent across hospitals and severity guidelines
Goal: Build a multimodal ML pipeline that predicts pneumonia severity using three complementary data sources from the MIMIC-CXR and MIMIC-IV datasets:
- Medical Images (CXR/CT) β deep visual embeddings
- Radiomics Features β quantitative regional texture descriptors
- Radiology Reports β structured RadGraph NER entities + semantic topic embeddings
This system aims to provide early, automated, and interpretable predictions to support clinicians at the point of admission.
This project integrates multiple technical and clinical domains:
###Clinical Imaging
- CXR & CT interpretation
- Lesion location & density
- Radiomics quantification (GLCM, GLRLM, GLSZM)
- Mask-based ROI extraction
- Extraction of radiology βFindingsβ & βImpressionsβ
- RadGraph-XL entity + relation mapping
- Transformers for clinical semantic embeddings
- BERTopic clustering for global anatomical patterns
- Classical models (XGBoost, SVM) using multimodal features
- Imbalanced ICU labels (severity, ventilation, mortality)
- Feature-level fusion and model-level fusion
- MIMIC-CXR & MIMIC-IV cohort structure
- ICU metadata: LOS, mortality, ventilation duration, clinical severity
- Need for interpretable, auditable predictions
- Radiomics extraction (Pyradiomics)
- CNN visual encoders (ResNet β external code)
- Embedding extraction + latent fusion
- Dimensionality reduction (PCA, UMAP)
- RadGraph-XL NER + relationship mapping
- Clinical transformers (Bio/ClinicalBERT)
- BERTopic (UMAP + HDBSCAN + c-TF-IDF)
- KeyBERT-Inspired representation modeling
- Topic-probability extraction
-
Fusion of:
- Radiomics
- Image embeddings
- NER entities
- Topic probabilities
-
XGBoost multimodal classifier
-
SVM + embedding baselines
-
Interpretability via XGBoost feature importance
- ICU cohort definition
- Class-imbalance handling (weights, SMOTE)
- Statistical cluster validation (Silhouette, DB Index)
- K-Fold CV
-
ETL pipelines for radiology text β embeddings
-
ETL for radiomics β harmonized tensors
-
Repository structure split into:
- NLP_processing pipeline
- Prediction Model modules
- Standalone scripts for training
- As an ICU physician, I want early severity predictions to guide escalation of care.
- As a radiologist, I want interpretable outputs that highlight anatomical & textual drivers of classification.
- As an ML researcher, I want a modular multimodal pipeline for experimentation.
- As a data engineer, I want clean processing scripts for images, radiomics, and text.
- Python
- SQL
| Modality | Libraries |
|---|---|
| Imaging | PyTorch, torchvision, OpenCV, pydicom |
| Radiomics | Pyradiomics |
| NLP | spaCy, RadGraph-XL, HuggingFace Transformers, BERTopic, UMAP, HDBSCAN |
| ML Models | XGBoost, sklearn, PyTorch |
| Visualization | Matplotlib, Seaborn |
| Data | Pandas, NumPy |
- MIMIC-CXR: CXR images + radiology reports
- MIMIC-IV: ICU labels (severity, ventilation, LOS, mortality)
-
Extract Findings + Impressions
-
Clean text (lowercase, punctuation removal, clinical stopwords)
-
RadGraph-XL extraction:
- Anatomy
- Observations
- Uncertainty modifiers
- Relations
-
Convert structured entities β embedding vectors
-
Optional: concatenate with ClinicalBERT embeddings
- Generate 768-dim sentence embeddings
- UMAP (n_neighbors=30) for reduction
- HDBSCAN for density clustering
- c-TF-IDF for cluster representations
- KeyBERT-Inspired β candidate keywords
- MMR (0.7) β diversity-optimized topic terms
- Output: cluster IDs + topic probability vector per report
- Apply bounding box / lung mask
- Extract 50+ radiomics features
- Normalize across patients (z-score)
- Output: radiomics feature vector
- Proprietary NUS research team ResNet encoder
- Extract latent 2048-dim vector
- Stored & loaded as pretrained image features
Note: The actual image model code is not included in the repo due to licensing.
Combine:
- Radiomics vector
- RadGraph entity vector
- BERTopic topic-probability vector
- Precomputed image embeddings
Fusion methods tested:
- Concatenation β XGBoost
- Concatenation β SVM baseline
- (Planned) Dual-head CNN + Transformer fusion network
Outputs:
- Binary or 3-class severity prediction
- Feature importances (XGBoost)
- Topic & entity-level interpretability
- Full RadGraph entity extraction across ICU cohort
- BERTopic clustering generated: 23 clinical topics
- Radiomics pipeline (mask β features) fully integrated
- XGBoost multimodal baseline completed
- Interpretable cluster-level and feature-level insights generated
-
Add structured EHR variables (SpOβ, labs, vitals)
-
Develop unified ResNet + Transformer fusion model
-
Evaluate against clinical benchmarks:
- BioViL
- CheXzero
- Vision-Language clinical models
-
Deploy clinician-facing web dashboard
-
Reliability analysis across:
- disease subtypes
- age groups
- ventilation status
MIMIC-CXR/
β
βββ NLP_processing/ # RadGraph, embeddings, topic modeling
β βββ radgraph_extraction.py
β βββ bert_embedding_generation.py
β βββ topic_modeling_bertopic.py
β βββ ...
β
βββ Prediction Model/ # Classical models, evaluation, fusion
β βββ model_xgboost.ipynb
β βββ SVM_Y.ipynb
β βββ multimodal_processing.py
β
βββ scripts/ # ETL helpers and utilities
β βββ clean_text.py
β βββ extract_features.py
β βββ ...
β
βββ Embedding_feature_train_xgb.py # XGBoost multimodal training script
βββ python310_requirements.txt # Environment for RadGraph pipeline
βββ requirements.txt # General environment
βββ README.md
Important: The full ResNet image-encoding pipeline used in the datathon is proprietary to the NUS research team and is not included.