A novel Multi-Dataset Multi-Task (MDMT) learning framework that predicts COVID-19 prognostic outcomes from chest X-rays by jointly training on two publicly available datasets with distinct but correlated labelling schemes β AIforCOVID (severity prognosis) and BRIXIA (severity score assessment) β without requiring universal cross-dataset annotations.
Filippo Ruffini Β· Lorenzo Tronchin Β· Zhuoru Wu Β· Wenting Chen Β· Paolo Soda Β· Linlin Shen Β· Valerio Guarrasi
Unit of Computer Systems & Bioinformatics, UniversitΓ Campus Bio-Medico di Roma Β· College of Computer Science and Software Engineering, Shenzhen University Β· Department of Electrical Engineering, City University of Hong Kong
π Paper Β· π§© Framework Β· βοΈ Setup Β· π Usage Guide Β· π Results Β· π Citation
This repository accompanies the paper "Multi-Dataset Multi-Task Learning for COVID-19 Prognosis", accepted at MICCAI 2024 (main conference, poster presentation) and published in the MICCAI 2024 Proceedings (doi: 10.1007/978-3-031-72390-2_24).
We introduce a Multi-Dataset Multi-Task (MDMT) learning framework that leverages two publicly available COVID-19 CXR datasets β each annotated with a different but complementary prognostic signal β within a single unified training pipeline. Our central hypothesis is that jointly learning to assess radiological severity (BRIXIA, task Οβ) enhances the model's ability to classify prognostic outcome groups (AIforCOVID, task Οβ), improving both performance and robustness.
Key contributions:
- A MDMT model for two publicly available COVID-19 CXR datasets, each assigned to a distinct task, trained end-to-end with a shared CNN backbone and task-specific fully connected heads.
- A multi-task loss function incorporating an indicator function that enables gradient-level disentanglement across heterogeneous data sources.
- Extensive evaluation across 18 CNN architectures and 2 validation strategies (5-fold CV and Leave-One-Center-Out), with rigorous statistical analysis, demonstrating significant improvements over STL and fine-tuning baselines.
Figure 1 β MDMT model architecture. A single batch X is formed by randomly sampling from both datasets D^Οβ (AIforCOVID) and D^Οβ (BRIXIA). A shared CNN backbone f^s extracts a common feature representation H, which is routed to two task-specific fully connected heads f^Οβ and f^Οβ. The indicator function I(Xα΅’, Οβ±Ό) masks out loss contributions from samples not belonging to each task, enabling end-to-end joint optimisation without cross-dataset label requirements.
| Configuration | Symbol | Description |
|---|---|---|
| Single-Task Learning (AIforCOVID) | STL^Οβ | CNN backbone trained on Οβ alone |
| Single-Task Learning (BRIXIA) | STL^Οβ | CNN backbone trained on Οβ alone |
| Fine-Tuning | FT | STL^Οβ model fine-tuned on Οβ |
| Multi-Dataset Multi-Task | MDMT | Proposed: joint training on both tasks |
| Dataset | Task | Symbol | Samples | Centers | Labels | Validation |
|---|---|---|---|---|---|---|
| AIforCOVID (Soda et al., 2021) | Severity prognosis (Mild vs. Severe) | Οβ | 1 586 | 6 | Binary | LOCO |
| BRIXIA (Signoroni et al., 2021) | Severity score assessment | Οβ | 4 707 | Multiple | 4-class | β |
AIforCOVID (D^Οβ): 1 586 CXR from COVID-19-positive adults across 6 Italian centres. Patients are classified as mild (home isolation / hospitalisation without ventilatory support) or severe (NIV, ICU, or death). Collected in three successive releases.
BRIXIA (D^Οβ): 4 707 CXR from sub-intensive and intensive care. The Brixia score grades lung opacity in 6 regions (0β3 each). Regional scores are summed and binned into four categories (0β3).
Preprocessing pipeline (both datasets): lung segmentation via U-Net β bounding-box extraction β resize to 256Γ256 β ImageNet normalisation.
18 CNN backbones across 6 architectural families, all pre-trained on ImageNet:
| Family | Models |
|---|---|
| DenseNet | DenseNet-121, DenseNet-161, DenseNet-169, DenseNet-201 |
| EfficientNet | EfficientNet-b0, EfficientNet-b1-p, EfficientNet-es, EfficientNet-es-p, EfficientNet-lite |
| GoogLeNet | GoogLeNet |
| MobileNet | MobileNet |
| ResNet | ResNet-18, ResNet-34, ResNet-50, ResNet-101, Wide-ResNet50-2 |
| ShuffleNet | ShuffleNet-v2-x0, ShuffleNet-v2-x1 |
.
βββ configs/
β βββ common/
β β βββ common_multi.yaml # Shared hyperparameters for MDMT
β β βββ common_morbidity.yaml # Shared hyperparameters for STL^Οβ
β β βββ common_severity.yaml # Shared hyperparameters for STL^Οβ
β βββ bash_experiments/ # JSON files that enumerate backbone sweeps
β βββ 5/ # Experiment-specific configs for 5-fold CV
β β βββ morbidity/
β β βββ severity/
β β βββ multi/
β βββ loCo/ # Experiment-specific configs for LOCO
β β βββ morbidity/
β β βββ severity/
β β βββ multi/
β βββ *_debug.yaml # Quick-iteration debug configs
β
βββ scripts/ # Single-GPU terminal launchers (run from repo root)
β βββ preprocess_aiforcovid.sh # AIforCOVID: DICOM β TIFF β masks + bboxes
β βββ preprocess_brixia.sh # BRIXIA: DICOM β TIFF β masks + bboxes
β βββ train_stl_aiforcovid.sh # Train STL^Οβ
β βββ train_stl_brixia.sh # Train STL^Οβ
β βββ train_mdmt.sh # Train MDMT (proposed method)
β βββ run_experiments.py # Batch launcher β runs many backbones locally
β βββ aggregate_results.sh # Aggregate fold results + statistical analysis
β
βββ src/
β βββ models/
β β βββ train_MultiObjectiveModel.py # MDMT training entry point
β β βββ train_morbidity_SingleTask.py # STL^Οβ training entry point
β β βββ train_severity_SingleTask.py # STL^Οβ training entry point
β β βββ predict_morbidity.py # Inference script
β βββ preprocessing/
β β βββ AFC/
β β β βββ ClinicalDataCreation_AFC.py # Step 1: DICOM β TIFF for AIforCOVID
β β β βββ segmentation_AFC.py # Step 2: U-Net lung masks + bboxes
β β βββ BRIXIA/
β β βββ convertDicom_brixia.py # Step 1: DICOM β TIFF for BRIXIA
β β βββ segmentation_BX.py # Step 2: U-Net lung masks + bboxes
β βββ datasets/
β β βββ organization/ # Dataset iterators and augmentation pipeline
β βββ postprocessing/
β β βββ Create_Final_Report.py # Aggregate per-fold results into tables
β β βββ plot_results.py # Visualisation of aggregated results
β β βββ results_interface.py # Interactive Dash results explorer
β β βββ statistical_analysis/
β β βββ compute_statistical_scores.py # One-tail t-test comparisons
β βββ utils/ # Data loading, model builders, training loops
β
βββ figures/
β βββ method.pdf / method.png # Model architecture figure
β βββ miccai_2024_logo.png
βββ requirements/
β βββ requirements.txt
βββ Paper-4049.tex # Camera-ready LaTeX source
βββ supplementary.tex # Full per-backbone results table
git clone https://github.com/fruffini/Multi-Dataset-Multi-Task-Learning-for-COVID-19-Prognosis.git
cd Multi-Dataset-Multi-Task-Learning-for-COVID-19-Prognosispython3.9 -m venv covid-env
source covid-env/bin/activate # Windows: covid-env\Scripts\activate
pip install --upgrade pip
pip install -r requirements/requirements.txtGPU note. The paper used 4 Γ NVIDIA TESLA A100 GPUs with batch size 128. For a single GPU with less memory, reduce
batch_sizein the relevant config file underconfigs/.
Create the following directory layout at the project root:
data/
βββ AIforCOVID/
β βββ imgs/ β release 1 DICOMs
β βββ imgs_r2/ β release 2 DICOMs
β βββ imgs_r3/ β release 3 DICOMs
β βββ AIforCOVID.xlsx
β βββ AIforCOVID_r2.xlsx
β βββ AIforCOVID_r3.xlsx
βββ BRIXIA/
βββ dicom_clean/ β cleaned DICOM files
βββ metadata_global_v2.csv
AIforCOVID β register and download from the AIforCOVID portal or the Zenodo record.
BRIXIA β download from the BRIXIA dataset page (public release).
The preprocessing pipeline uses a pre-trained U-Net (BSNet) to segment the lungs. Place the weights as follows:
models/
βββ segmentation_brixia/
βββ trained_model.hdf5 β used for AIforCOVID
βββ segmentation_brixia-model.h5 β used for BRIXIA
Weights are available from the BSNet repository.
The fold definitions (CV splits and LOCO assignments) are stored under data/processed/. These are committed to the repository and require no additional steps.
Run both preprocessing pipelines once before any training.
# AIforCOVID: converts DICOMs β TIFFs β lung masks β bounding-box manifest
bash scripts/preprocess_aiforcovid.sh
# BRIXIA: converts DICOMs β TIFFs β lung masks β bounding-box manifest
bash scripts/preprocess_brixia.shEach script accepts optional path overrides β run with --help for details.
After preprocessing, the directory layout will be:
data/
βββ AIforCOVID/
β βββ processed/
β βββ images/ β converted TIFFs
β βββ masks/ β binary lung masks
β βββ box_data_AXF123.xlsx β bounding-box manifest consumed by the DataLoader
βββ BRIXIA/
βββ images/ β converted TIFFs
βββ processed/
βββ masks/ β binary lung masks
βββ box_data_BX.xlsx β bounding-box manifest
All scripts are run from the repository root.
STL^Οβ β Single-Task on AIforCOVID (severity prognosis)
# Default: resnet18, 5-fold CV, release 3
bash scripts/train_stl_aiforcovid.sh
# Custom backbone and LOCO validation
bash scripts/train_stl_aiforcovid.sh \
densenet121 \
configs/loCo/morbidity/afc_config_singletask_loCo.yaml \
3 my_run
# Resume from checkpoint
bash scripts/train_stl_aiforcovid.sh resnet18 \
configs/5/morbidity/afc_config_singletask_cv5.yaml 3 1 -cSTL^Οβ β Single-Task on BRIXIA (severity score)
# Default: resnet18, 5-fold CV, global Brixia score
bash scripts/train_stl_brixia.sh
# EfficientNet-b0, per-lung score, LOCO
bash scripts/train_stl_brixia.sh \
efficientnet_b0 \
configs/loCo/severity/bx_config_singletask_loCo.yaml \
brixia_Lung BASELINE_LungMDMT β Multi-Dataset Multi-Task (proposed method)
# Default: resnet18, 5-fold CV, global score, release 3
bash scripts/train_mdmt.sh
# DenseNet-201, LOCO, release 3
bash scripts/train_mdmt.sh \
densenet201 \
configs/loCo/multi/parallel_config_multitask_loCo18.yaml \
brixia_Global 3 my_run
# Resume from checkpoint
bash scripts/train_mdmt.sh resnet18 \
configs/5/multi/parallel_config_multitask_cv5.yaml brixia_Global 3 1 -cPositional arguments for all train scripts:
| Position | STL^Οβ | STL^Οβ | MDMT |
|---|---|---|---|
| 1 | MODEL | MODEL | MODEL |
| 2 | CFG | CFG | CFG |
| 3 | RELEASE (1/2/3) | STRUCTURE | STRUCTURE |
| 4 | ID_EXP | ID_EXP | RELEASE (1/2/3) |
| 5 | -c to resume |
-c to resume |
ID_EXP |
| 6 | β | β | -c to resume |
Available STRUCTURE values: brixia_Global Β· brixia_Lung Β· regression
scripts/run_experiments.py iterates over all backbone Γ structure combinations defined in a JSON config and runs them sequentially (or in parallel with --max_jobs). Stdout/stderr of each job is written to logs/<job_tag>.log.
# MDMT, 5-fold CV, all 18 backbones β one at a time (single GPU)
python scripts/run_experiments.py -k multi -e 5 -id 1
# STL^Οβ, LOCO
python scripts/run_experiments.py -k morbidity -e L -id 1
# STL^Οβ, 5-fold CV
python scripts/run_experiments.py -k severity -e 5 -id BASELINE
# Run 4 backbones in parallel (multi-GPU or time-multiplexing)
python scripts/run_experiments.py -k multi -e 5 -id 1 --max_jobs 4
# Resume all runs from checkpoint
python scripts/run_experiments.py -k multi -e 5 -id 1 -c| Flag | Description | Default |
|---|---|---|
-k |
Modality: morbidity / severity / multi |
morbidity |
-e |
Experiment key (see table below) | 5 |
-id |
Experiment identifier (checkpoint prefix) | 1 |
-c |
Resume each job from its latest checkpoint | β |
--max_jobs |
Max parallel processes | 1 |
Experiment key reference:
-k |
-e |
Config loaded |
|---|---|---|
multi |
5 |
experiment_setups_multitask_parallel_5.json |
multi |
L6 |
experiment_setups_multitask_parallel_loCo_6.json |
morbidity |
5 |
experiment_setups_morbidity_5.json |
morbidity |
10 |
experiment_setups_morbidity_10.json |
morbidity |
L |
experiment_setups_morbidity_loCo.json |
severity |
5 |
experiment_setups_severity_5.json |
severity |
L |
experiment_setups_severity_loCo.json |
bash scripts/aggregate_results.sh # release 3, results stored in data_root
bash scripts/aggregate_results.sh 2 # release 2Summary tables are written to reports/. Statistical comparisons (one-tail t-test, MDMT vs STL^Οβ and MDMT vs FT) are printed to stdout.
python src/postprocessing/results_interface.py
# Open http://localhost:8050| Experiment | CV ACC | CV F1 | CV GM | LOCO ACC | LOCO F1 | LOCO GM |
|---|---|---|---|---|---|---|
| STL^Οβ | 66.0 | 63.9 | 65.9 | 61.2 | 57.3 | 60.1 |
| FT | 67.3 | 63.1 | 66.9 | 64.8 | 58.9 | 63.8 |
| MDMT | 68.6 | 66.6 | 68.5 | 65.7 | 64.3 | 66.0 |
| Statistic | Comparison | CV ACC | CV F1 | CV GM | LOCO ACC | LOCO F1 | LOCO GM |
|---|---|---|---|---|---|---|---|
| Mean (ΞΌβ) | MDMT vs STL^Οβ | *** | *** | *** | *** | *** | *** |
| Mean (ΞΌβ) | MDMT vs FT | ** | *** | ** | β | β | β |
| Std (Οβ) | MDMT vs STL^Οβ | * | * | * | * | β | * |
| Std (Οβ) | MDMT vs FT | β | β | β | * | β | * |
* p<0.05, ** p<0.01, *** p<0.001.
@inproceedings{ruffini2024mdmt,
title = {Multi-Dataset Multi-Task Learning for COVID-19 Prognosis},
author = {Ruffini, Filippo and Tronchin, Lorenzo and Wu, Zhuoru and Chen, Wenting
and Soda, Paolo and Shen, Linlin and Guarrasi, Valerio},
booktitle = {Medical Image Computing and Computer Assisted Intervention -- MICCAI 2024},
pages = {248--258},
year = {2024},
publisher = {Springer Nature Switzerland},
doi = {10.1007/978-3-031-72390-2_24},
url = {https://link.springer.com/chapter/10.1007/978-3-031-72390-2_24}
}Please also cite the datasets:
@article{soda2021aiforcovid,
title = {AIforCOVID: Predicting the clinical outcomes in patients with COVID-19
applying AI to chest X-rays},
author = {Soda, Paolo and others},
journal = {Medical Image Analysis},
year = {2021},
doi = {10.1016/j.media.2021.102216}
}
@article{signoroni2021severity,
title = {BS-Net: Learning COVID-19 pneumonia severity on a large Chest X-Ray dataset},
author = {Signoroni, Alberto and others},
journal = {Medical Image Analysis},
year = {2021},
doi = {10.1016/j.media.2021.101945}
}Filippo Ruffini is a PhD student enrolled in the National PhD in Artificial Intelligence, XXXVIII cycle, course on Health and life sciences, organised by UniversitΓ Campus Bio-Medico di Roma.
This work was partially supported by:
- Italian Ministry of Foreign Affairs and International Cooperation, grant PGR01156
- PNRR MUR project PE0000013-FAIR
- PNRR β DM 118/2023
Computing resources were provided by NAISS and SNIC at Alvis @ C3SE, partially funded by the Swedish Research Council through grants no. 2022-06725 and no. 2018-05973.
Released under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).
- β Academic research, teaching, non-profit clinical research, personal study, modification and redistribution with attribution.
- β Commercial products or paid clinical decision-support systems require a separate licence.
Contact: Valerio Guarrasi β valerio.guarrasi@unicampus.it
