Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
HieuPhan33 committed Mar 31, 2024
2 parents 2ac4bc5 + a9ededf commit 5a7d821
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 17 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ If you find our work useful, please cite our paper.

```
@article{phan2024decomposing,
title={Decomposing Disease Descriptions for Enhanced Pathology Detection: A Multi-Aspect Vision-Language Matching Framework},
author={Minh Hieu Phan and Yutong Xie and Yuankai Qi and Lingqiao Liu and Liyang Liu and Bowen Zhang and Zhibin Liao and Qi Wu and Minh-Son To and Johan W. Verjans},
title={Decomposing Disease Descriptions for Enhanced Pathology Detection: A Multi-Aspect Vision-Language Pre-training Framework},
author={Vu Minh Hieu Phan and Yutong Xie and Yuankai Qi and Lingqiao Liu and Liyang Liu and Bowen Zhang and Zhibin Liao and Qi Wu and Minh-Son To and Johan W. Verjans},
year={2024},
journal={arXiv preprint arXiv:2403.07636},
}
Expand Down Expand Up @@ -225,9 +225,9 @@ Our pre-train code is given in ```Pretrain```.

* Run `accelerate launch --multi_gpu --num_processes=4 --num_machines=1 --num_cpu_threads_per_process=8 train_MAVL.py --root /data/2019.MIMIC-CXR-JPG/2.0.0 --config configs/MAVL_resnet.yaml --bs 124 --num_workers 8`

Note: The reported results in our paper are obtained by pre-training on 4 x A100 for 60 epochs. We provided the checkpoint [here](Pretrain/data_file/DATA_Prepare.md).
Note: The reported results in our paper are obtained by pre-training on 4 x A100 for 60 epochs. We provided the checkpoints [here](Pretrain/data_file/DATA_Prepare.md). We found that ckpts at later stage (`checkpoint_full_46.pth`) yields higher zero-shot classification accuracy. Ckpt at earlier stage (`checkpoint_full_40.pth`) yields more stable accuracy on visual grounding.

We also conducted a lighter pre-training schedule with 2 x A100 for 40 epochs using mixed precision training, achieving similar zero-shot classification results. Checkpoints for this setup are also available [here](Pretrain/data_file/DATA_Prepare.md).
We also conducted a lighter pre-training schedule with 2 x A100 for 40 epochs using mixed precision training, achieving similar zero-shot classification results. Checkpoint for this setup is also available [here](Pretrain/data_file/DATA_Prepare.md).

```
accelerate launch --multi_gpu --num_processes=2 --num_machines=1 --num_cpu_threads_per_process=8 --mixed_precision=fp16 train_MAVL.py --root /data/2019.MIMIC-CXR-JPG/2.0.0 --config configs/MAVL_short.yaml --bs 124 --num_workers 8
Expand Down
9 changes: 6 additions & 3 deletions Zero-shot_classification/configs/chexpert_mavl.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
test_file: '/data/data/chexpertv1/CheXpert-v1.0/filter_test_labels.csv'
test_file: '/data/VLM/data/chexpertv1/CheXpert-v1.0/filter_test_labels.csv'
disease_book: 'observation explanation.json'
concept_book: '../Pretrain/concept_gen/gpt4_mimic.json'

dataset: 'chexpert'
root: '/data/data/chexpertv1'
root: '/data/VLM/data/chexpertv1'
model: 'mavl'
model_path: '../checkpoints/checkpoint_full_40.pth'
model_path: '../checkpoints/checkpoint_full_46.pth'
# model_path: '../../medslip/checkpoints/cl_global_1e-1_true/checkpoint_40.pth'


mode: feature

image_res: 224
Expand Down
9 changes: 5 additions & 4 deletions Zero-shot_classification/configs/padchest_seen_mavl.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
test_file: '/data/data/PadChest/test.csv'
test_file: '/data/VLM/data/PadChest/test.csv'
disease_book: 'observation explanation_padchest_rare.json'
# concept_book: '../Pretrain/concept_gen/gpt4_mimic_padchest_rare.json'
concept_book: '../Pretrain/concept_gen/gpt4_mimic_padchest_rare.json'

dataset: 'padchest'
root: '/data/data/PadChest/'
root: '/data/VLM/data/PadChest/'
model: 'mavl'
model_path: '../checkpoints/checkpoint_short_37.pth'
# model_path: '../checkpoints/checkpoint_short_37.pth'
model_path: '../../medslip/checkpoints/cl_global_1e-1_true/checkpoint_40.pth'


image_res: 224
test_batch_size: 128
test_batch_size: 512

d_model: 256
base_model: 'resnet50'
Expand Down
7 changes: 3 additions & 4 deletions Zero-shot_classification/configs/rsna_mavl.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
test_file: '/data/data/rsna/test.csv'
test_file: '/data/VLM/data/rsna/test.csv'
disease_book: 'observation explanation.json'
concept_book: '../Pretrain/concept_gen/gpt4_mimic.json'

dataset: 'rsna'
root: '/data/data/rsna'
root: '/data/VLM/data/rsna'
model: mavl
# model_path: '../checkpoints/checkpoint_full_40.pth'
model_path: '../../medslip/checkpoints/cl_global_1e-1_true/checkpoint_40.pth'
model_path: '../checkpoints/checkpoint_full_46.pth'


image_res: 224
Expand Down
7 changes: 7 additions & 0 deletions Zero-shot_classification/result_mavl_chexpert_feature.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Class Name,Accuracy,Max F1,AUC ROC,Precision,Recall
cardiomegaly,0.818,0.7513812154696132,0.9042486574697812,0.6445497630331753,0.9006622516556292
edema,0.886,0.6666666666666666,0.9210110584518167,0.6222222222222222,0.717948717948718
consolidation,0.932,0.4,0.8639724723625449,0.4230769230769231,0.3793103448275862
atelectasis,0.796,0.7247956403269755,0.8752330903542973,0.6214953271028038,0.869281045751634
effusion,0.902,0.7798165137614679,0.9506847319347319,0.7456140350877193,0.8173076923076923
Average,0.8668000000000001,0.6645320072449447,0.9030300021146346,0.6113916541045687,0.736902010498252
3 changes: 3 additions & 0 deletions Zero-shot_classification/result_mavl_rsna_feature.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Class Name,Accuracy,Max F1,AUC ROC,Precision,Recall
pneumonia,0.8081319093123478,0.6237587348289814,0.863606256560271,0.5649566955363091,0.6962233169129721
Average,0.8081319093123478,0.6237587348289814,0.863606256560271,0.5649566955363091,0.6962233169129721
7 changes: 5 additions & 2 deletions Zero-shot_grounding/configs/covid_mavl.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
test_file: '/data/data/covid_rural/test.csv'
test_file: '/data/VLM/data/covid_rural/test.csv'
disease_book: 'observation explanation.json'
concept_book: '../Pretrain/concept_gen/gpt4_mimic_covidr.json'
# concept_book: '../../medslip/Pretrain/concept_gen/gpt4_mimic_covid.json'

dataset: 'covid-r'
root: '/data/data/covid_rural'
root: '/data/VLM/data/covid_rural'
target: 'covid19'
model_path: '../checkpoints/checkpoint_full_40.pth'
# model_path: '../../medslip/checkpoints/cl_global_1e-1_true/checkpoint_40.pth'


image_res: 224
test_batch_size: 512
Expand Down

0 comments on commit 5a7d821

Please sign in to comment.