Pytorch code for Unsupervised Local Discrimination for Medical Images. (arXiv)
It is an extension of our previous work acceptted by (IPMI 2021).
The goal of this work is to learn local discriminative representation for medical images and explore its medical applications. Medical images commonly have the following two properties, 1) intra-modality structures similarity (i.e medical images of human contain similar anatomical structures), and 2) inter-modality shape similarity (i.e anatomical structures among different modalities may have similar shape knowledge).
Based on these two facts, we systematacially propose a local discriminative representation framework, which can measure pixel-wise, region-wise and patch-wise similarity for medical images. There are mainly three highlights:- Based on the prior knowledge that medical images of human share similar anatomical structures, we propose an unsupervised deep learning framework to learn discriminative features and cluster similar regions. In this framework, two branches, including an embedding branch to embed each pixel and a clustering branch to cluster similar regions. In the embedding space, pixels of similar structures should be closely distributed. And the learnt representation can be a good initialization for corresponding down-streams.
- Implement environment: 4xGTX1080, Ubuntu 18.04LTS, pytorch 1.8.0, Cuda 10.2
- Clone this repo: git clone https://github.com/HuaiChen-1994/LDLearning.git.
- Dataset preprocessing: total 14 open dataset should be downloaded and preprocessed. Please follow ./dataset/ReadMe.txt to finish this step.
We only take the code of retinal images as an example, then, the implementation in X-ray is similar to this processing.
The code of this part is in ./retinal code/step1_ld_pretraining (or ./X-ray code/step1_ld_pretraining).
- Set the experimental parameters in ./retinal code/step1_ld_pretraining/args_setting.py according to the detail explanations in this file (GPU id, batch-size, et.al.).
- Patch discrimination learning to learn initial discriminative representations. cd to ./retinal code/step1_ld_pretraining/, then, python step1_train_pd_mixup.py.
- Local discrimination learning python step2_train_ld.py.
The codes for downstream tasks are in ./retinal code/step2_downstream_tasks, run STEP1_transfer.py and STEP2_random_initialization.py.
- Set the experimental parameters in ./retinal code/step3_shape_guided_segmentation/args_setting.py
- cd to the path of ./retinal code/step3_shape_guided_segmentation. python step1_train_pd_mixup.py;python step2_train_with_shape_prior.py;python step3_test_segmentation.py.
Please kindly cite this paper in your publications if it helps your research:
@inproceedings{chen2021unsupervised,
title={Unsupervised learning of local discriminative representation for medical images},
author={Chen, Huai and Li, Jieyu and Wang, Renzhen and Huang, Yijie and Meng, Fanrui and Meng, Deyu and Peng, Qing and Wang, Lisheng},
booktitle={International Conference on Information Processing in Medical Imaging},
pages={373--385},
year={2021},
organization={Springer}
}
@article{chen2021unsupervised,
title={Unsupervised Local Discrimination for Medical Images},
author={Chen, Huai and Wang, Renzhen and Li, Jieyu and Peng, Qing and Meng, Deyu and Wang, Lisheng},
journal={arXiv preprint arXiv:2108.09440},
year={2021}
}
Contact: chenhuai@sjtu.edu.cn



