Mammo-FM: Breast-specific foundational model for Integrated Mammographic Diagnosis, Prognosis, and Reporting
Breast-specific foundation model
Diagnosis · Prognosis · Reporting
Quick start · Checkpoints · Datasets · Documentation · Citation
Citation required: Cite both Mammo-FM and Mammo-CLIP (MICCAI 2024) when using Mammo-FM. Both BibTeX entries are provided in Citation.
Overview
Mammo-FM is a breast-specific foundation model for integrated mammographic diagnosis, prognosis, and reporting. This repository provides the image–text encoder and task-specific checkpoints; the mammofm Python package connects them through a common interface.
| Capability | Python interface | Output |
|---|---|---|
| Preprocessing | mf.preprocess(img) |
Preprocessed mammogram from a DICOM file |
| Image representations | mf.features(img, dataset) |
Features before and after pooling |
| Diagnosis | mf.diagnosis(img, dataset) |
Zero-shot, linear-probe, and full-finetuning scores |
| Prognosis | mf.prognosis(views) |
Uncalibrated 1–5-year risk probabilities |
| Grounded reporting | mf.report_gen(views) |
Grounded report and classifier findings |
Research use only. These models are not approved for clinical use or medical decision-making. Use is governed by the Custom Academic License.
Quick start
Python package
Install with DICOM support and the optional report-generation dependencies. Python 3.10 or newer is required.
pip install "mammofm[report,dicom]"
Diagnosis and feature extraction take one image. Prognosis and report generation require four explicitly labeled views from the same examination: LMLO, LCC, RMLO, and RCC.
Report generation additionally requires approved access to meta-llama/Llama-3.1-8B-Instruct and an authenticated Hugging Face session, or a local base-model directory. See the report setup guide.
import mammofm as mf
views = {"lmlo": "LMLO.dcm", "lcc": "LCC.dcm", "rmlo": "RMLO.dcm", "rcc": "RCC.dcm"}
# Preprocess a DICOM image.
image = mf.preprocess(views["lmlo"])
# Extract image embeddings before and after pooling.
embeddings = mf.features(views["lmlo"], dataset="rsna")
# Compute single-image scores with zero-shot, linear-probe, and full-finetuning models.
diagnosis = mf.diagnosis(views["lmlo"], dataset="rsna")
# Estimate five risk horizons from the four-view examination.
risk = mf.prognosis(views)
# Generate a grounded report and its classifier findings.
report = mf.report_gen(views)
Supported diagnosis datasets: rsna, vindr, cmmd, nlbreast, and lumina. See the task-by-task model availability.
- Inputs: inference accepts DICOM or preprocessed PNG paths. DICOM conversion is handled automatically; PNGs should already have the intended breast preprocessing. The image size is 1520 high × 912 wide. Standalone
mf.preprocess()accepts DICOM and returns a Pillow image. - Device: CUDA is selected when available; otherwise CPU is used. Set
device="cuda"ordevice="cpu"explicitly when needed. A GPU is strongly recommended for report generation. - Downloads: public Mammo-FM checkpoints are downloaded on demand, cached locally, and checked against pinned revisions and SHA-256 digests. See caching and offline use.
- Local inference: images and reports are processed locally. Report generation does not require an OpenAI API key.
CLI
Run both four-view risk prediction and Mammo-GRG report generation:
mammofm exam \
--lmlo LMLO.dcm --lcc LCC.dcm \
--rmlo RMLO.dcm --rcc RCC.dcm \
--output-dir ./outputs/exam-001 \
--device cuda
Outputs include report.json, risk_mayo.json, and risk_bu.json. Use --only report or --only risk for a single workflow. See the CLI guide for output fields and other options.
Custom zero-shot prompts
Use your own positive and negative descriptions with the jointly trained image and text encoders:
import mammofm as mf
model = mf.MammoFM()
positive = model.text_embeddings(["There is a mass in the breast."])
negative = model.text_embeddings(["There is no mass in the breast."])
image = model.image_embeddings("mammogram.dcm", dataset="rsna")
scores = model.zero_shot(image, positive, negative)
This returns the positive cosine similarity, negative cosine similarity, and their difference. No sigmoid or softmax is applied by this custom-prompt interface. These similarity scores are not probabilities. See the custom-prompt guide.
Model checkpoints
The Python package selects the required checkpoints automatically. For manual use, choose the asset that matches your task.
Image–text encoders
| Checkpoint | Role |
|---|---|
Mammo-FM_BatmanlabTrained_CLIP.tar |
Default encoder for features, zero-shot image/text embeddings, and prognosis |
Mammo-FM_BatmanlabTrained_CLIP_last.tar |
Visual encoder used to train the released Mammo-GRG report generator |
Mammo-FM_ASU_Trained_CLIP.tar |
Additional image–text checkpoint; not the default for the Python endpoints above |
Task-specific models
| Task | Checkpoints | Guide |
|---|---|---|
| Linear probing | Dataset/task classifiers | Diagnosis |
| Full finetuning | Dataset/task classifiers | Diagnosis |
| Prognosis | Default S1 KD + S2 risk head · All risk checkpoints | Risk code and training |
| Report generation | Stage 1 projector · Stage 2 adapter and projector | Mammo-GRG |
| Report grounding | Mass, suspicious calcification, and asymmetry classifiers | Grounded reporting |
| Text-encoder initialization | ModernBERT fine-tuned on in-house radiology reports | Pretraining |
Linear-probe and full-finetuning checkpoints contain their own image encoder and classifier. The default prognosis head uses Mammo-FM_BatmanlabTrained_CLIP.tar. Mammo-GRG uses the *_last.tar visual encoder and the final Stage 2 weights, followed by grounding; Stage 1 is a training stage, not a separate inference call.
Data download
Download the preprocessed PNG images (1520 high × 912 wide) for OOD evaluation from the links below. Matching CSV files are provided in OOD_CSV.
| Dataset | Preprocessed images | Evaluation CSV | Split column |
|---|---|---|---|
| 🇺🇸 RSNA | Hugging Face dataset | train_folds.csv |
fold |
| 🇻🇳 VinDr | Kaggle dataset | Finding/detection CSV · Abnormality CSV | split |
| 🇨🇳 CMMD | Kaggle dataset | merged_final_cmmd.csv |
fold |
| 🇨🇦 NL-Breast | Kaggle dataset | nlbs_image_labels_v2.csv |
fold |
| 🇹🇷 LUMINA | Kaggle dataset | lumina_metadata.csv |
fold |
Dataset access and use remain subject to each source's terms. See the CSV guide for split conventions. To preprocess your own DICOM images, see the preprocessing guide.
Documentation
| Resource | What you will find |
|---|---|
| Python API and CLI | Installation, inputs, outputs, custom prompts, devices, and offline use |
| Training and downstream evaluation | Pretraining and dataset-specific experiment entrypoints |
| Mammo-GRG | Instruction data, visual embeddings, report training, grounding, and inference |
| Risk modeling | Distillation, finetuning, inference, and interpretation workflows |
| Paper | Methodology, study design, and evaluation protocols |
Intended use and limitations
Mammo-FM is provided for non-commercial academic research. Scores and generated reports require independent validation for the population and acquisition setting being studied. Risk outputs are uncalibrated; generated text can contain errors or unsupported findings. Neither constitutes a medical diagnosis or a substitute for professional assessment. Clinical deployment and medical decision-making use are prohibited by the license.
Citation
When using Mammo-FM, cite both papers: both Mammo-FM and Mammo-CLIP (MICCAI 2024).
Mammo-FM
@article{ghosh2025mammo,
title={Mammo-FM: Breast-specific foundational model for Integrated Mammographic Diagnosis, Prognosis, and Reporting},
author={Ghosh, Shantanu and Joshi, Vedant Parthesh and Syed, Rayan and Budhraja, Param and Kassem, Aya and Morrison, Katelyn C. and Tang, Alex and Wong, Ho Cheung Aiden and Varshney, Abhishek and Basak, Payel and Dai, Weicheng and Gichoya, Judy Wawira and Trivedi, Hari M. and Banerjee, Imon and Visweswaran, Shyam and Poynton, Clare B. and Batmanghelich, Kayhan},
journal={arXiv preprint arXiv:2512.00198},
year={2025}
}
Mammo-CLIP · MICCAI 2024
@inproceedings{ghosh2024mammoclip,
title={Mammo-CLIP: A Vision Language Foundation Model to Enhance Data Efficiency and Robustness in Mammography},
author={Ghosh, Shantanu and Poynton, Clare B. and Visweswaran, Shyam and Batmanghelich, Kayhan},
booktitle={Medical Image Computing and Computer Assisted Intervention -- MICCAI 2024},
pages={632--642},
publisher={Springer Nature Switzerland},
year={2024},
doi={10.1007/978-3-031-72390-2_59}
}
License and copyright
This model is released under a Custom Academic License for Model Weights. The full LICENSE governs use of these assets; it is not a permissive commercial-use license.
Summary of terms
The Model may be used solely for non-commercial academic research purposes.
Permitted users include:
- Academic institutions
- Non-profit research organizations
Allowed activities include:
- Research use
- Evaluation and benchmarking
- Fine-tuning or linear probing for academic research only
The following are strictly prohibited:
- Any commercial use
- Any use by for-profit entities without prior written approval
- Any use in products, services, or revenue-generating activities
- Any industry research, including internal evaluation or development, without explicit prior written permission
- Any clinical deployment
- Any diagnostic or treatment use
- Any use in medical decision-making systems
- Redistribution of the model weights, in whole or in part
- Hosting, serving, or making the model available through an API, SaaS platform, web service, or other remote access mechanism
- Distillation, compression, extraction, imitation, or transfer of knowledge from the model to create, train, initialize, or improve another model
Derivative models are allowed only if they:
- Are used solely for non-commercial academic research
- Are not shared publicly or redistributed
- Inherit this same license in full
- Are not used to circumvent restrictions in this license
Any use of the Model must include:
- Proper citation of the associated publication(s)
- Acknowledgment of the original authors and institution(s)
Example acknowledgment:
"This work uses Mammo-FM developed by the authors of Mammo-FM, Boston University."
Copyright © Batman Lab, 2024
Contact
| Topic | Contact |
|---|---|
| Permissions, commercial use, and industry research | Kayhan Batmanghelich · batman@bu.edu |
| Code and research questions | Shantanu Ghosh · shawn24@bu.edu |
- Downloads last month
- 377