Skip to content

(ongoing) Implemented Mask R-CNN model to automatically segment the boundary of potential cancerous regions (specifically Melanoma) from dermoscopic images.

Notifications You must be signed in to change notification settings

meng1994412/Cancer_Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Cancer Detection

Objectives

This is ongoing project

Implemented Mask R-CNN model to automatically segment the boundary of potential cancerous regions (specifically Melanoma) from dermoscopic images.

Packages Used

Approaches

The skin lesion boundary segmentation dataset is from International Skin Imaging Collaboration (ISIC) 2018 Lesions dataset, which consists of 2594 images in JPEG format and 2594 corresponding ground-truth masks in PNG format.

The lesions.py contains several subclasses of the Mask R-CNN classes. We define a subclass of the Config class inside mrcnn to override and/or define any configurations we might need, which is called LesionBoundaryConfig (check here). The LesionBoundaryConfig class stores all relevant configurations when training Mask R-CNN model on the skin lesion dataset.

Just as we have a training configuration, we also have an prediction/inference configuration as well, which is called LesionBoundaryInferenceConfig (check here). The LesionBoundaryInferenceConfig class is not subclass of the Mask R-CNN Config class but is rather a subclass of LesionBoundaryConfig class used for training.

The LesionBoundaryDataset class (check here) is responsible for managing the lesion dataset, including loading both images and their corresponding masks from disk.

Train & evaluate the Mask R-CNN model

The lesions.py has three modes, including training (check here), predicting (check), and investigating (check here). The investigating mode is used to check the training set to make sure the data is properly stored. It is a wise choice to start with a pre-trained model and then fine-tune it. Thus, Mask R-CNN model with ResNet backbone pre-trained on the COCO is used, which is named mask_rcnn_coco.h5 (download site). We first freeze all the layers before head, and train the head for 25 epochs. After the head have start to learn patterns, we could pause the training and unfreeze all the layers before, and continue the training but with smaller learning rate.

The following command can start to train the Mask R-CNN model.

python lesions.py --mode train

However, it is recommended to investigate and debug dataset, images and masks, before starting training, in order to ensure the training process can work properly.

The following command can provide some insight into dataset before training the Mask R-CNN model.

python lesions.py --investigate

Next step

Since I just finished first-time training to get a sense of training Mask R-CNN model, there are many modifications to be done in the future, including increase the accuracy while reducing the possible overfitting situation.

About

(ongoing) Implemented Mask R-CNN model to automatically segment the boundary of potential cancerous regions (specifically Melanoma) from dermoscopic images.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages