Downloads · 30 days
29
3% of all-time downloads
hugging-science/breast-cancer-detector-2
breast-cancer-detector-2 is a image classification model from hugging-science. Use it when you need a label for an image. The card lists the license as apache-2.0.
Note: This checkpoint was donated to Huggingface-science to support open medical AI research
Downloads · 30 days
29
3% of all-time downloads
All-time downloads
837
Public
Parameters
85.8M
686 MB on disk
Likes
4
Public
Click a slice to open those files.
.safetensors343 MB · 100%
From the Hugging Face model README
Note: This checkpoint was donated to Huggingface-science to support open medical AI research
Artificial Intelligence has revolutionized software engineering through automation, intelligent code assistance, and streamlined workflows. In the same way, AI is transforming the medical field, particularly in radiology and oncology, by helping clinicians detect diseases earlier and making diagnostic processes faster and more efficient.
The model demonstrates strong generalization and excellent accuracy even on unseen data. However, as a responsible developer, I strongly recommend using this model only as an assistive tool — never as a standalone diagnostic solution. It should always be used in conjunction with the professional judgment of a qualified radiologist or clinician.
huggingface-science/breast-cancer-detector is a three-class image classification model designed to assist healthcare professionals in analyzing breast ultrasound images. It classifies images into:
The model acts as a supportive tool that can help reduce workload, provide a quick second opinion, and contribute to earlier detection of breast cancer — one of the most common cancers affecting women worldwide.
Important: This model is not a replacement for professional medical judgment. It should always be used alongside expert review.
| Epoch | Training Loss | Validation Loss | Accuracy |
|---|---|---|---|
| 1 | 0.8091 | 0.6462 | 0.8127 |
| 2 | 0.4966 | 0.4761 | 0.8311 |
| 3 | 0.4988 | 0.5465 | 0.7388 |
| 4 | 0.5662 | 0.3808 | 0.8707 |
| 5 | 0.3819 | 0.2817 | 0.9156 |
| 6 | 0.4244 | 0.2713 | 0.9288 |
| 7 | 0.3856 | 0.2570 | 0.9261 |
| 8 | 0.3428 | 0.2442 | 0.9446 |
| 9 | 0.3087 | 0.2163 | 0.9446 |
| 10 | 0.3349 | 0.2100 | 0.9393 |
| 11 | 0.3559 | 0.2261 | 0.9393 |
| 12 | 0.2707 | 0.2248 | 0.9446 |
The model shows strong convergence and high final validation accuracy (~94.46%), with good robustness thanks to the noise augmentation.
Strengths: The model shows excellent detection performance on the trained distribution. The 20% noise augmentation during training helped improve robustness against real-world variations in ultrasound image quality.
Internal Evaluation: Final validation accuracy of 94.46% after 12 epochs.
To further evaluate generalization on unseen data, we tested the model on the external dataset as-cle-bert/breastcanc-ultrasound-class, which contains 647 breast ultrasound images with only two classes (benign_breast_cancer and malignant_breast_cancer).
Note: Since this dataset does not include a "normal" class (while our model supports three classes), we mapped predictions as follows for evaluation:
"benign" → benign_breast_cancer"malignant" → malignant_breast_cancer"normal" → excluded from primary metrics (reported separately)Performance on Benign vs Malignant Classification:
| Metric | Score |
|---|---|
| Accuracy | 96.12% |
| Precision (Malignant) | 94.26% |
| Recall / Sensitivity (Malignant) | 93.81% |
| F1-Score (Malignant) | 94.03% |
Detailed Classification Report:
| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| benign | 0.9701 | 0.9724 | 0.9712 | 434 |
| malignant | 0.9426 | 0.9381 | 0.9403 | 210 |
| accuracy | - | - | 0.9612 | 644 |
| macro avg | 0.9563 | 0.9552 | 0.9558 | 644 |
| weighted avg | 0.9611 | 0.9612 | 0.9612 | 644 |
The model demonstrates strong generalization, achieving 96.12% accuracy on this external dataset despite the difference in label space and limited training data. The very low rate of "normal" predictions (0.46%) on images containing only lesions further highlights the model's reliability.
This model follows the spirit of large-scale medical AI efforts (such as Google Health and DeepMind’s breast cancer screening research), which emphasize AI as a powerful assistive tool that augments, rather than replaces, clinical expertise.
from transformers import pipeline
classifier = pipeline("image-classification", model="huggingface-science/breast-cancer-detector")
result = classifier("path/to/clean_breast_ultrasound_image.png") # you can use a link also
print(result)
The model outputs labels via the mapping:
{
"0": "benign",
"1": "malignant",
"2": "normal"
}
Input Requirements: Provide only clean breast ultrasound images (PNG/JPG) without any text or overlays.
If you use this model, please cite:
Parveshiiii (2026). breast-cancer-detector: A three-class breast ultrasound classifier trained on gymprathap/Breast-Cancer-Ultrasound-Images-Dataset.
Disclaimer: This model is provided for research and assistive purposes only. The developer bears no liability for any clinical decisions made using this tool. Always consult qualified healthcare professionals for medical diagnosis.