This is the implementation of the "A Collaborative Self-supervised Domain Adaptation for Low-Quality Medical Image Enhancement".
-
Firstly, download the datasets from the following links:
- EyeQ Dataset - Diabetic Retinopathy Detection | Kaggle
- Corneal Nerve Dataset - Link
- ISIC-2017 Dataset - ISIC Challenge
- Endoscopy Dataset - Link
- Chest X-ray Dataset - Link
- Cardiac MRI Dataset - Link
-
Split the datasets into train/test.
-
Serialize the original images via 'patch_serialize.py'.
-
Initialize high-/low-quality domains
$\mathbb{H}$ and$\mathbb{L}$ by clustering algorithm in folder './LocalAggregation'. Next, update$\mathbb{H}$ and$\mathbb{L}$ through 'quality_assessment_scheme.py'. -
Construct source style domains
$\mathbb{S}$ and target style domains$\mathbb{T}$ from$\mathbb{H}$ through clustering algorithm in folder './LocalAggregation'.
Then prepare the datasets in the following format for easy training:
(data_l, data_s, and data_t represent patches from
├── dataset
│ ├── EyeQ
│ │ ├── Test_Folder
│ │ │ ├── data_l
│ │ │ ├── data_s
│ │ │ └── data_t
│ │ └── Train_Folder
│ │ │ ├── data_l
│ │ │ ├── data_s
│ │ │ └── data_t
│ ├── Corneal Nerve
│ │ ├── Test_Folder
│ │ │ ├── data_l
│ │ │ ├── data_s
│ │ │ └── data_t
│ │ └── Train_Folder
│ │ │ ├── data_l
│ │ │ ├── data_s
│ │ │ └── data_t
│ ├── ISIC
│ │ ......
│ ├── Endoscopy
│ │ ......
│ ├── Chest X-ray
│ │ ......
│ ├── Cardiac MRI
│ │ ......
Run
pip install -r requirements.txt
Change the settings in configs/unit_noise2clear-bn.yaml
and run the DASQE model
python train.py --output_path ${LOG_DIR}$
Run
python test.py --input_a ${Low_quality_path}$ --input_c ${target_style_path}$ --output_folder ${output_image_path}$ --checkpoint ${pretrain_model_path}$ --psnr