Detecting Breast Cancer from Histopathology Images Using CNN-Based Framework
No Thumbnail Available
Files
Date
2025
Journal Title
Journal ISSN
Volume Title
Publisher
Library Information Services, COMSATS University Islamabad, Lahore Campus
Abstract
Breast cancer remains one of the most frequently diagnosed cancers among women globally,
with histopathology analysis serving as the gold standard for diagnosis. But manual
examination of histopathology slides takes a long time, is prone to making mistakes, and often
has differences between observers, especially in complicated cases. To overcome these
constraints, this study introduces a lightweight and deployable deep learning framework
designed to automate breast cancer detection utilizing histopathology images from the BRACS
dataset. The proposed framework utilizes the DenseNet169 model pre-trained on ImageNet;
we fine-tuned the last 30 layers after testing different depths. We resized the input images to
1024×1024 to preserve important morphological details, and we employed simple
augmentations, such as rotation and flipping, during training. Additionally, a semi-automated
segmentation and annotation strategy was developed using k-means clustering based on RGB
color and shape features, generating binary masks that were further validated by a
histopathologist. Both classification and segmentation models were implemented in Keras on
a CPU-based environment with 32 GB RAM. We evaluated our models using scikit-learn.
The classification achieved 79% accuracy on the 3-class test set and 90% accuracy on the
binary test set (normal vs. invasive carcinoma), demonstrating competitive results compared
to state-of-the-art models. The evaluation metrics used for both models were precision, recall,
and F1-score; classification performance was further assessed using accuracy, and
segmentation performance was evaluated using the Dice coefficient. Our classification model
(DenseNet169 with partial fine-tuning) has approximately 4 million trainable parameters,
while the segmentation model (U-Net with ResNet34 encoder) consists of around 25 million
parameters—both models being compact enough for deployment on standard desktop CPUs.
The segmentation masks were generated using a novel semi-automated pipeline that balances
visual coherence (shape and structure) with RGB clustering, allowing more precise annotation
than conventional thresholding or fully automated tools. These findings highlight that a
selectively fine-tuned CNN can deliver reliable diagnostic assistance, even in resource-
constrained environments.
Description
Keywords
Department of Computer Science, SP23, Computer Science, Histopathology Images, CNN, histopathology, Dr. Zulfiqar Habib