A wonderful object detection toolbox MMDetection are used for lesion detection. A trained model and predicted results can be downloaded here. Note that the model has a relatively poor generalization ability and cannot precisely predict lesions of fundus images from EyePACS because of the limited training samples of IDRiD.
Please refer to the instruction of MMDetection for installation.
-
Download IDRiD dataset [link].
-
Use
scripts/mask2bbox.py
to convert the lesion mask of images to bounding boxes. The output is a csv file. -
Use
scripts/csv2coco.py
to convert the csv file to coco annotation format. The requirements for the format of new datasets can be found in here. -
Replace the configuration files in MMDetection with the files in
configs
. Please remember to update the path to dataset. -
Follow the instruction of MMDetection to training the model.
-
Download EyePACS dataset [link]. Then delete line 77 in
../tools/crop.py
and run it to remove the black border of images of EyePACS. Line 77 in../tools/crop.py
is for resizing and we do not resize images for lesion detection. -
Use
scripts/detect.py
to generate lesion predictions of EyePACS. -
Use
scripts/build_dataset.py
to select lesions with high confidence threshold. The output is a pickle file for training the lesion-based contrastive learning models.