Diabetic Retinopathy Detection using PatchCNN Networks.
Since the available data is highly limited and contains segmentation masks, we convert those to bounding boxes for detection and localization.
-
Download diabetic retinopathy dataset from either of these databases:
-
Pre-processed image using Gray Scale Cropping and Weighted Gaussian Blur. To reproduce the results, run
dataprep/preprocess_cropnblur.py
file. -
Divide the masks and images into patches of size 64x64, run
dataprep/patches.py
to get the results. -
Convert the segmentation masks to bounding boxes. To obtain the results run
dataprep/masks2boxes.py
file. -
Convert these bounding boxes to different formats as required by the model using specific conversion scripts. e.g., for YOLO use
dataprep/prepdata_yolo.py
file. -
To prepare the data (along with annotations) for EfficientDet, run the file
dataprep/prepdata_coco.py
since the data is fed into EfficientDet in coco's format. This will prepare the necessary.json
files required to train the network. -
In case some model requires VOC annotations, use coco2voc converter.
To train the efficientdet, follow the training code provided here: EfficientDet Repo. The prepared dataset config is given in the efficientdet folder as a .yaml
file.
The dataset config yaml can be accessed from this path: efficientdet/images.yaml
To know the entire training command with params, run help on the train.py as follows.
python train.py -h
The trained network weights of model d0 can be downloaded for iDRiD dataset from HERE
To run the inference, run the following command:
python efficientdet/efficientdet_test.py <path_to_img> <path_to_trained_weights>
Results | Mask |
---|---|