Congratulations to our C2FVL has been accepted by IEEE International Conference on Acoustics, Speech and Signal Processing 2023 (ICASSP 2023)!
This repo is the official implementation of "COARSE-TO-FINE COVID-19 SEGMENTATION VIA VISION-LANGUAGE ALIGNMENT" Arxiv.
You can also refer to our another work LViT, which is basically built by the same Codebase.
Install from the requirements.txt
using:
pip install -r requirements.txt
Questions about NumPy version conflict. The NumPy version we use is 1.17.5. We can install bert-embedding first, and install NumPy then.
The original data can be downloaded in following links:
-
QaTa-COVID Dataset - Link (Original)
-
MosMedData+ Dataset - Link (Original)
Note: The text annotation of QaTa-COVID train datasets download link.
The text annotation of QaTa-COVID val datasets download link.
The text annotation of QaTa-COVID test dataset download link.
(Note: The text annotation of MosMedData+ dataset will be released in the future. And you can email to me for the datasets)
Then prepare the datasets in the following format for easy use of the code:
├── datasets
├── QaTa-COVID
│ ├── Test_Folder
| | ├── Test_text.xlsx
│ │ ├── img
│ │ └── labelcol
│ ├── Train_Folder
| | ├── Train_text.xlsx
│ │ ├── img
│ │ └── labelcol
│ └── Val_Folder
| ├── Val_text.xlsx
│ ├── img
│ └── labelcol
└── MosMedData+
├── Test_Folder
| ├── Test_text.xlsx
│ ├── img
│ └── labelcol
├── Train_Folder
| ├── Train_text.xlsx
│ ├── img
│ └── labelcol
└── Val_Folder
├── Val_text.xlsx
├── img
└── labelcol
You can train to get your own model.
python train_model.py
Here, we provide pre-trained weights on QaTa-COVID and MosMedData+, if you do not want to train the models by yourself, you can download them in the following links:
(Note: the pre-trained model will be released in the future.)
- QaTa-COVID:
- MosMedData+:
First, change the session name in Config.py
as the training phase. Then run:
python test_model.py
You can get the Dice and IoU scores and the visualization results.
Dataset | Dice (%) | IoU (%) |
---|---|---|
QaTa-COVID | 83.40 | 74.62 |
MosMedData+ | 74.56 | 61.15 |
In our code, we carefully set the random seed and set cudnn as 'deterministic' mode to eliminate the randomness. However, there still exsist some factors which may cause different training results, e.g., the cuda version, GPU types, the number of GPUs and etc. The GPU used in our experiments are on four NVIDIA GeForce GTX 1080 Ti GPUs and the cuda version is 11.2. And the upsampling operation has big problems with randomness for multi-GPU cases. See https://pytorch.org/docs/stable/notes/randomness.html for more details.
@inproceedings{shan2023coarse,
title={Coarse-to-Fine Covid-19 Segmentation via Vision-Language Alignment},
author={Shan, Dandan and Li, Zihan and Chen, Wentao and Li, Qingde and Tian, Jie and Hong, Qingqi},
booktitle={ICASSP 2023-2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
pages={1--5},
year={2023},
organization={IEEE}
}