Survival prediction for Glioblastoma (GBM) patients using an ensemble of classical ML models trained on radiomic, imaging-derived, and clinical features. The pipeline combines Random Forest, XGBoost, and Logistic Regression (via voting/stacking ensembles) with CNN-based imaging feature extraction, LDA-based feature selection, SMOTE for class balancing, and Optuna for hyperparameter tuning. Model quality is evaluated with classification accuracy/F1 and the survival-analysis concordance index (C-index).
Glioblastoma is an aggressive brain tumor with highly variable survival outcomes. Instead of predicting exact survival time, this project buckets patients into survival-percentile categories (quartiles of Survival_from_surgery_days) and treats prognosis as a multi-class classification problem, which is more robust to the limited sample sizes typical of GBM cohorts. Predicted class probabilities are then mapped to a survival-time estimate to compute a concordance index against the true survival times.
Built on public TCIA (The Cancer Imaging Archive) collections for Glioblastoma:
- MRI & Radiomic Data (UPENN-GBM / UCSF-PDGM) — multi-parametric MRI (T1, T1GD, T2, FLAIR, DSC, DTI), ~69GB / 630 participants / 10,645 NIfTI files, with tumor sub-region segmentations (ED/ET/NC). Radiomic features per modality/region are extracted with CaPTk (
radiomic/radiomic_features_CaPTk/*.csv). Download · DOI - UPENN-GBM clinical info (
UPENN-GBM_clinical_info_v2.1.csv) — demographics, molecular markers, and survival/follow-up data. - Histopathology images (34 patients, 71 images) — whole-slide NDPI scans (
Histopathology/) converted for downstream tiling/analysis. Download · DOI
Radiomic feature tables and clinical data are merged on PatientID into a single modeling table (stackAndModel/merged_data.csv, cnn_stacked.csv).
- Data preparation (
radiomic/,Brats/,clinical.ipynb,csv_segm.ipynb) — DICOM→NIfTI conversion, radiomic feature extraction per tumor sub-region/MRI sequence, merging of radiomics with clinical metadata, EDA and cleaning of missing/inconsistent values (EDA/). - CNN feature extraction (
stackAndModel/Cnn.ipynb,MRI/) — a 3D CNN is used as a feature extractor over segmented tumor volumes; the resulting embeddings are merged with radiomic/clinical features. - Target construction — survival time (
Survival_from_surgery_days_UPDATED) is bucketed into 4 percentile-based classes (quartiles) to form the classification target. - Feature selection — Linear Discriminant Analysis (LDA) ranks features by discriminative importance; the top-N features are selected for modeling (feature-count sweep in
stack.ipynb/Cnn.ipynb). - Class balancing — SMOTE (via
imbalanced-learn) oversamples minority survival classes to counter class imbalance before training. - Modeling — Random Forest, XGBoost, and Logistic Regression (SVM in some experiments) are combined via
VotingClassifier(soft-voting ensemble) andStackingClassifier. - Hyperparameter tuning — Optuna searches RF/XGBoost/Logistic-Regression hyperparameters, optimizing cross-validated accuracy (
stackAndModel/optunamain.ipynb,stack.ipynb). - Evaluation — accuracy, balanced accuracy, and classification reports for the classification task; predicted class probabilities are mapped to a survival-time estimate to compute the concordance index (
lifelines.utils.concordance_index) as the survival-specific metric. - Interpretability — SHAP (TreeExplainer / permutation explainer) explains ensemble/XGBoost predictions and visualizes global feature importance.
- Visualization — Matplotlib/Seaborn for class distributions, correlation matrices, and Optuna trial results (see
stackAndModel/*.png).
The best-performing ensemble model is serialized to stackAndModel/best_ensemble_model.pkl.
- Language: Python (Jupyter notebooks)
- ML/Modeling: scikit-learn (RandomForest, LogisticRegression, SVC, VotingClassifier, StackingClassifier, LDA), XGBoost, PyTorch (CNN feature extractor), Optuna (hyperparameter tuning), imbalanced-learn (SMOTE)
- Survival metrics: lifelines (
concordance_index) - Interpretability: SHAP
- Imaging/Radiomics: CaPTk (radiomic feature extraction), NiBabel (NIfTI I/O)
- Data/Viz: pandas, NumPy, Matplotlib, Seaborn
- Model persistence: joblib
Brats/ BraTS/UCSF-PDGM radiomics experiments and metadata
EDA/ Exploratory analysis of clinical and tumor statistics
Histopathology/ NDPI whole-slide image handling
MRI/ DICOM/NIfTI conversion utilities
radiomic/ CaPTk-extracted radiomic feature CSVs (per modality/region) + EDA
stackAndModel/ Core modeling pipeline: CNN features, LDA, SMOTE, Optuna,
ensemble/stacking classifiers, SHAP explainability
clinical.ipynb, radiomics.ipynb, csv_segm.ipynb Data prep / merging notebooks
*.csv Clinical info and radiomics feature manifests
This is a notebook-driven research project (no packaged CLI/API). To reproduce:
- Clone the repo and obtain the underlying TCIA data (UPENN-GBM clinical info, MRI/radiomics/histopathology collections linked above — not included in this repo due to size).
- Install dependencies:
pip install pandas numpy scikit-learn xgboost torch optuna imbalanced-learn lifelines shap matplotlib seaborn joblib nibabel jupyter
- Run the data-preparation notebooks (
clinical.ipynb,csv_segm.ipynb,radiomic/eda.ipynb) to merge clinical and radiomic data intostackAndModel/merged_data.csv/cnn_stacked.csv. - Run
stackAndModel/Cnn.ipynb(orstackAndModel/stack.ipynb) for the full pipeline: LDA feature ranking -> SMOTE balancing -> ensemble/stacking training -> Optuna tuning (optunamain.ipynb) -> SHAP explainability -> concordance index evaluation. - The trained ensemble is saved to
stackAndModel/best_ensemble_model.pkland can be reloaded withjoblib.load.
Metrics reported in stackAndModel/Cnn.ipynb for the 4-class survival-percentile task (CNN + radiomic + clinical features, LDA-selected, SMOTE-balanced):
| Metric | Ensemble (Voting) | Stacking |
|---|---|---|
| Balanced Accuracy | 0.99 | 0.97 |
| Concordance Index | 0.88 | 0.88 |
| Accuracy | — | 0.98 |
Other experiments in stack.ipynb / optunamain.ipynb (different feature subsets/target binning, without CNN features) report accuracies roughly in the 0.3–0.6 range and concordance indices around 0.85–0.86, showing how strongly results depend on the chosen feature set and modality combination — see the individual notebooks for exact configurations. These are research/experimental results on a limited cohort and have not been externally validated.
Brats/,MRI/, andHistopathology/contain exploratory data-processing notebooks that fed into the final pipeline but are not part of the production model itself.- Raw imaging data (NIfTI, NDPI) is not included in the repo due to size; notebooks assume local access to the TCIA collections above.
- Glioblastoma: An Update in Pathology, Molecular Mechanisms and Biomarkers
- Epidemiology of Glioblastoma Multiforme
- Survival Prediction using Machine Learning & Deep Learning
- MRI-Based Survival Analysis
MIT — see LICENSE.