A newer version of this model is available: keanteng/swin-v2-breast-cancer-classification-0603

Breast Cancer Classification with Swin Transformer V2

This repository contains a fine-tuned Swin Transformer V2 model for breast cancer classification based on mammography images.

Due to the indistinguishable nature of the dataset various runs had been conducted to perform the original 3 classes classification according to the original DDSM dataset but the accuracy obtained is dismal (approx 67%) contrary to literature review of (>90%).

I have also explored dual input Swin Transformer using the Tumour Mask, however, similar dismal accuracy is obtained. We can look at the dataset and notice that the images all looks about the same except Normal. Thus, the detection strategy becomes detecting the presence of cancer by merging to Benign and Cancer images as a class against the Normal images.

With such approach, accuracy significant increases and achieve reliable performance.

Model Description

The model is based on the Swin Transformer V2 Base architecture, fine-tuned on the Mini-DDBS-JPEG dataset for breast cancer classification. It uses a custom classification head consisting of a multi-layer perceptron with dropout for regularization.

Key Features

  • Based on Swin Transformer V2 architecture
  • Input image size: 256x256 pixels
  • Binary classification task (No Cancer vs Has Cancer)
  • Mixed precision training for improved performance

Performance

The model was trained with class balancing techniques to handle data imbalance. Performance metrics on the test set:

Metric Value
Test Accuracy 0.9156
Test Loss 0.3274

For detailed performance metrics including precision, recall, and F1-score per class, please check the training notebook.

Usage

Please check the inference compute.

Downloads last month
17
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for keanteng/swin-v2-breast-cancer-classification-0602

Finetuned
(16)
this model

Dataset used to train keanteng/swin-v2-breast-cancer-classification-0602

Collection including keanteng/swin-v2-breast-cancer-classification-0602