Breast cancer classification with deep learning

I am experimenting with deep learning + medical imaging a lot these days. Today, I have an interesting experiment to showcase.

Context: Invasive Ductal Carcinoma (IDC) is the most common subtype of all breast cancers. To assign an aggressiveness grade to a whole mount sample, pathologists typically focus on the regions which contain the IDC. As a result, one of the common pre-processing steps for automatic aggressiveness grading is to delineate the exact regions of IDC inside of a whole mount slide.

Kaggle has got a dataset called Breast Histopathology Images which can be used to design an experimental system for detecting breast cancer.

Adrian Rosebrock of PyImageSearch designed an architecture called CancerNet for this purpose which uses depthwise separable convolutions at its core. His model was able to achieve an accuracy of 85% and specificity and sensitivity of 85%. Since the dataset is an imbalanced dataset we cannot just go by the measure of accuracy here.

I decided to go with my favorite weapon of choice for vision tasks - ResNets. I used a pre-trained ResNet50 as my main model and then fine-tuned it. I used cross-entropy with custom weights for the two classes in the dataset to tackle the class imbalance.

I am glad to present you with my results which are generously better than that of CancerNet. Find the code here: https://github.com/sayakpaul/Breast-Cancer-Detection-using-Deep-Learning