Skip to content

hakkikeman/Breast-Cancer-Detection-PyTorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Breast Cancer (IDC) Detection using Deep Learning

Python 3.8+ PyTorch License: MIT Open In Colab

Project Overview

This project focuses on the binary classification of Invasive Ductal Carcinoma (IDC), the most common type of breast cancer, using histopathological images. The study compares the performance of a Custom Convolutional Neural Network (CNN) built from scratch with a pre-trained VGG-16 transfer learning model.

Dataset

The dataset used is the "Breast Histopathology Images" from Kaggle. A balanced subset of 10,000 RGB image patches ($50\times50$ pixels) was utilized. The data was split into 70% Training, 15% Validation, and 15% Testing. (Note: The dataset is not included in this repository due to size constraints. You can download the Breast Histopathology Images Dataset directly from Kaggle).

Methodology & Models

The entire workflow is implemented in PyTorch within a single Jupyter Notebook.

  • Custom CNN: Designed from scratch with 3 Convolutional blocks, Max Pooling, ReLU activation, 50% Dropout, and Fully Connected layers.
  • VGG-16 (Transfer Learning): Utilized pre-trained ImageNet weights. The final classifier layer was fine-tuned for this specific medical imaging task.
  • Generative AI Integration: Generative AI (Gemini) was utilized to research and implement advanced optimization strategies, specifically applying "Differential Learning Rates" to further enhance the VGG-16 model's performance during fine-tuning.

Results

Both models were trained on an NVIDIA T4 GPU (Google Colab).

  • Custom CNN: Achieved 85.13% Validation Accuracy.
  • VGG-16: Achieved 83.60% Validation Accuracy. The Custom CNN adapted more quickly to the specific tissue details within the limited epoch count (5 epochs).

How to Run

  1. Clone this repository:

    git clone https://github.com/hakkikeman/Breast-Cancer-Detection-PyTorch.git
    cd Breast-Cancer-Detection-PyTorch
  2. Download the dataset from Kaggle and update the data path in the notebook.

  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Open and run all cells in breast_cancer_classification_cnn_vs_vgg16.ipynb.

About

Binary classification of Invasive Ductal Carcinoma (IDC) using a Custom CNN and VGG-16 transfer learning.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors