MammoWise: Multi-Model Local RAG Pipeline for Mammography Report Generation
Organizations: University of California, Davis, CA, USA
Abstract
Screening mammography is high volume, time sensitive, and documentation heavy. Radiologists must translate subtle visual findings into consistent BI-RADS assessments, breast density categories, and structured narrative reports. While recent Vision Language Models (VLMs) enable image-to-text reporting, many rely on closed cloud systems or tightly coupled architectures that limit privacy, reproducibility, and adaptability. We present MammoWise, a local multi-model pipeline that transforms open source VLMs into mammogram report generators and multi-task classifiers. MammoWise supports any Ollama-hosted VLM and mammography dataset, and enables zero-shot, few-shot, and Chain-of-Thought prompting, with optional multimodal Retrieval Augmented Generation (RAG) using a vector database for case-specific context. We evaluate MedGemma, LLaVA-Med, and Qwen2.5-VL on VinDr-Mammo and DMID datasets, assessing report quality (BERTScore, ROUGE-L), BI-RADS classification, breast density, and key findings. Report generation is consistently strong and improves with few-shot prompting and RAG. Classification is feasible but sensitive to model and dataset choice. Parameter-efficient fine-tuning (QLoRA) of MedGemma improves reliability, achieving BI-RADS accuracy of 0.7545, density accuracy of 0.8840, and calcification accuracy of 0.9341 while preserving report quality. MammoWise provides a practical and extensible framework for deploying local VLMs for mammography reporting within a unified and reproducible workflow.
Figures & tables
| BI-RADS | Original | After | Action |
|---|---|---|---|
| 1 | 3331 | 500 | Downsample (random) |
| 2 | 1167 | 500 | Downsample (random) |
| 3 | 242 | 500 | Augment (flip + scale) |
| 4 | 205 | 500 | Augment (flip + scale) |
| 5 | 55 | 200 | Augment (flip + scale + translation; capped) |
| Total | 5000 | 2200 |
| Task | Evaluation Parameters | Without RAG | With RAG | |||
|---|---|---|---|---|---|---|
| Best Result | Prompt | Model | Result | Model | ||
| BI-RADS | Accuracy | 0.2909 | Fewshot | LLAVA-Med | 0.319 | MedGemma |
| Precision | 0.4121 | Fewshot | Qwen2.5VL | 0.4508 | Qwen2.5VL | |
| Recall | 0.2909 | Fewshot | LLAVA-Med | 0.319 | MedGemma | |
| F1-score | 0.2217 | Fewshot | LLAVA-Med | 0.2756 | Qwen2.5VL | |
| Specificity | 0.8165 | Fewshot | LLAVA-Med | 0.8265 | MedGemma | |
| Task | Evaluation Parameters | Without RAG | With RAG | |||
|---|---|---|---|---|---|---|
| Best Result | Prompt | Model | Best Result | Model | ||
| BI-RADS | Accuracy | 0.57 | CoT | Qwen2.5VL | 0.895 | MedGemma |
| Precision | 0.8139 | Fewshot | LLAVA-Med | 0.9757 | MedGemma | |
| Recall | 0.57 | CoT | Qwen2.5VL | 0.895 | MedGemma | |
| F1-score | 0.59 | CoT | Qwen2.5VL | 0.93002 | MedGemma | |
| Specificity | 0.8602 | Fewshot | LLAVA-Med | 0.9807 | MedGemma | |
| Task | Evaluation Parameter | Zeroshot | Fewshot | CoT | RAG-Fewshot | Finetune | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Generate All Tasks Together | Generate 1 Task at a Time | ||||||||||
| 3 Epochs | 6 Epochs | 10 Epochs | 15 Epochs | 6 Epochs | 10 Epochs | ||||||
| BI-RADS | Accuracy | 0.2218 | 0.1019 | 0.2493 | 0.319 | 0.3564 | 0.4698 | 0.6355 | 0.5139 | 0.4976 | 0.7545 |
| Precision | 0.2722 | 0.1515 | 0.1846 | 0.3663 | 0.3608 | 0.5734 | 0.6544 | 0.5444 | 0.484 | 0.7356 | |
| Recall | 0.2218 | 0.1019 | 0.2493 | 0.319 | 0.3564 | 0.4698 | 0.6355 | 0.5139 | 0.4591 | 0.7516 | |
| F1-score | 0.1237 | 0.0376 | 0.1412 | 0.2698 | 0.3489 | 0.4186 | 0.6261 | 0.4911 | 0.4152 | 0.7404 | |
| Task | Best Prompt | Best RAG | (RAG – Prompt) | Best QLoRA | (QLoRA – RAG) |
|---|---|---|---|---|---|
| BI-RADS | 0.1412 | 0.2698 | 0.1286 | 0.7404 | 0.4706 |
| Density | 0.6900 | 0.7529 | 0.0629 | 0.8894 | 0.1365 |
| Calcification | 0.6973 | 0.7694 | 0.0721 | 0.9384 | 0.1690 |
| Mass | 0.5016 | 0.5404 | 0.0388 | 0.8777 | 0.3373 |
| Asymmetry | 0.7875 | 0.7787 | 0.0088 | 0.8261 | 0.0474 |
| Suspicion | 0.3369 | 0.3271 | 0.0098 | 0.7951 | 0.4680 |
| Task | Our Work | MammoCLIP | LLaVA-Mammo | LLaVA-MultiMammo | PubMedCLIP |
|---|---|---|---|---|---|
| BI-RADS | 0.7545 | – | – | – | 0.5325 |
| Breast Density | 0.884 | 0.88 | 0.766 | 0.806 | – |
| Mass | 0.8740 | 0.8 | – | – | – |
| Calcification | 0.9341 | 0.98 | – | – | – |
| Task | Evaluation Parameter | Models | ||
|---|---|---|---|---|
| MedGemma | Qwen2.5VL | LLAVA-Med | ||
| BI-RADS | Accuracy | 0.2218 | 0.1957 | 0.2273 |
| Precision | 0.2722 | 0.0855 | 0.0517 | |
| Recall | 0.2218 | 0.1957 | 0.2273 | |
| F1-score | 0.1237 | 0.0913 | 0.0842 | |
| Specificity | 0.8006 | 0.8008 | 0.8 | |
| Task | Evaluation Parameter | Models | ||
|---|---|---|---|---|
| MedGemma | Qwen2.5VL | LLAVA-Med | ||
| BI-RADS | Accuracy | 0.1019 | 0.2582 | 0.2909 |
| Precision | 0.1515 | 0.4121 | 0.3493 | |
| Recall | 0.1019 | 0.2582 | 0.2909 | |
| F1-score | 0.0376 | 0.1876 | 0.2217 | |
| Specificity | 0.8004 | 0.808 | 0.8165 | |
| Task | Evaluation Parameter | Models | ||
|---|---|---|---|---|
| MedGemma | Qwen2.5VL | LLAVA-Med | ||
| BI-RADS | Accuracy | 0.2493 | 0.2291 | 0.2488 |
| Precision | 0.1846 | 0.0526 | 0.1898 | |
| Recall | 0.2493 | 0.2291 | 0.2488 | |
| F1-score | 0.1412 | 0.0855 | 0.2059 | |
| Specificity | 0.8059 | 0.8 | 0.8046 | |
| Task | Evaluation Parameters | MedGemma | LLAVA-Med | Qwen2.5VL |
|---|---|---|---|---|
| BI-RADS | Accuracy | 0.2878 | 0.2 | 0.2918 |
| Precision | 0.2861 | 0.0824 | 0.6562 | |
| Recall | 0.2878 | 0.2 | 0.2918 | |
| F1-score | 0.2602 | 0.1167 | 0.247 | |
| Specificity | 0.8371 | 0.8 | 0.8268 | |
| BERTScore | 0.8662 | 0.8322 | 0.8557 |
| Task | Evaluation Parameters | MedGemma | LLAVA-Med | Qwen2.5VL |
|---|---|---|---|---|
| BI-RADS | Accuracy | 0.3531 | 0.3998 | 0.201 |
| Precision | 0.3717 | 0.8139 | 0.2483 | |
| Recall | 0.3531 | 0.3998 | 0.201 | |
| F1-score | 0.3392 | 0.3419 | 0.0797 | |
| Specificity | 0.8542 | 0.8602 | 0.8005 | |
| BERTScore | 0.9983 | 0.9508 | 0.9999 |
| Task | Evaluation Parameters | MedGemma | LLAVA-Med | Qwen2.5VL |
|---|---|---|---|---|
| BI-RADS | Accuracy | 0.2277 | 0.183 | 0.57 |
| Precision | 0.3108 | 0.336 | 0.65 | |
| Recall | 0.2277 | 0.183 | 0.57 | |
| F1-score | 0.1462 | 0.1288 | 0.59 | |
| Specificity | 0.81 | 0.8358 | 0.77 | |
| BERTScore | 0.8657 | 0.9939 | 0.8448 |