BreastXAgent: a lightweight agentic interpretability framework for breast density classificationBreastXAgent: A lightweight agentic explainability framework for breast density classification
The authors propose BreastXAgent, using LangGraph routing plus rule-based guardrails to constrain LLM generation of breast density classification reports; on 160 images the authors report a safety pass rate of 100%, versus only 12.5% for LLM-only.
The paper does not posit an adversarial attacker. The protection target is the risk of the report generation process itself: the LLM producing unsupported Grad-CAM overclaims and clinical diagnostic claims when generating breast density explanation reports; the victim system is a research-oriented, non-diagnostic reporting pipeline, and the underlying classifier is not modified.
- Deep models for breast density classification typically output only a label and confidence, and directly using an LLM to generate explanation reports easily produces Grad-CAM overclaiming and clinical diagnostic claims, which is unacceptable in safety-sensitive settings.
- BreastXAgent chains a pretrained MONAI classifier, Grad-CAM, LangGraph confidence routing, Llama-3.1-8B report generation, and rule-based guardrails into a single agent pipeline; when the guardrails detect violating wording, the LLM draft is discarded and replaced with a deterministic fallback report.
- Five report strategies were compared on 160 mammography images: LLM-only safety pass rate 12.5%, Grad-CAM overclaim rate 75.0%; the full BreastXAgent reached 100.0% on both safety pass rate and utility score, with a guardrail replacement rate of 6.3%.
- In the Discussion, the authors note: the dataset has only 160 images, only a single classifier is used, and rule-based guardrails may miss semantic-level overclaiming; future directions include a larger dataset, incorporating classifier uncertainty into routing, and designing repair-style guardrails.
- Evaluated models
- Meta-Llama-3.1-8B-Instruct
- Benchmarks
- BreastReportBench
- Metrics
- Safety pass rateGrad-CAM overclaim rateClinical overclaim rateUtility scoreCompletion rateInput faithfulnessConfidence consistencyFallback rate
BreastXAgent is a lightweight agentic interpretability framework for breast density classification, combining a pretrained classifier, Grad-CAM, LangGraph routing, LLM report generation, and rule-based guardrails to generate controlled, faithful, non-diagnostic reports. On 160 mammograms, uncontrolled LLM reports showed 75% Grad-CAM overclaiming and 62.5% clinical overclaiming, whereas the full framework achieved a 100% safety pass rate, zero overclaiming, and the highest utility score. The agent guardrails enable safe generation of structured explanations without modifying the underlying classifier.
Paper analysis
What problem does this paper attempt to solve?
How can an LLM be made to generate safe, faithful, non-diagnostic explanation reports for breast density classification without modifying the underlying classifier.
Core question: breast density classification models output only a label and confidence; how can an LLM be made to generate safe, faithful, non-diagnostic explanation reports.
- Setting and importance: Breast density (BI-RADS A–D, four categories) affects mammography sensitivity and is associated with breast cancer risk; the authors argue that giving only a label and confidence is insufficient to provide an understandable, confidence-aware explanation of model behavior.
- Shortcomings of existing methods: The authors state that Grad-CAM can provide visual evidence but does not provide structured reasoning and should not be treated as anatomical evidence, tissue localization, or diagnostic evidence; an independent classifier also cannot convert results into a controlled clinical-style report.
- Core observation: The authors report that uncontrolled LLM reports produce many unsupported claims—on 160 images, LLM-only Grad-CAM overclaiming rate was 75.0% and clinical overclaiming rate 62.5% (Table 2); strict prompts can only reduce, not eliminate, violations.
- Proposed approach: BreastXAgent, a lightweight agentic explanation framework combining a pretrained MONAI classifier, Grad-CAM, LangGraph routing, LLM report generation, and rule-based guardrails; and BreastReportBench, an evaluation setting comparing five reporting strategies.
- Threat model: The paper does not posit an adversarial attacker; the protection target is the risk of the generation pipeline itself going out of control.
- Risk source: The LLM overinterprets Grad-CAM in reports (treating it as evidence) or makes clinical claims such as diagnosis, localization, or follow-up recommendations.
- Defender capabilities: Access to classifier outputs, confidence, and Grad-CAM files, and ability to intercept and replace text after generation.
- Victim system: A research-oriented, non-diagnostic reporting pipeline; the underlying classifier is not modified.
- Success criterion: The report passes faithfulness, confidence consistency, and non-diagnostic checks (Safety pass rate in Table 1).
What related research exists?
Related work falls into three groups: breast density classification, Grad-CAM visual explanation, and agent workflows (LangGraph, MedRAX).
Breast density classification
- MONAI pretrained breast density classification model — directly outputs four BI-RADS density categories without task-specific retraining; this paper uses it as the visual reasoning component; the paper notes that a standalone classifier gives only a label and confidence and cannot explain visual evidence or generate controlled reports.
- Deep learning review works (Abhisheka et al. 2023; Chakravarthy and Rajaguru 2022) — treat breast density/lesion prediction as an image-level classification task; the paper cites them only as background.
Visual explanation
- Grad-CAM (Selvaraju et al. 2017) — generates coarse localization heatmaps by weighting convolutional feature maps with class-specific gradients; this paper applies it to the last convolutional block of an Inception-v3 backbone. The paper notes that Grad-CAM itself does not produce structured reasoning, confidence explanations, or validated text reports, and thus serves only as an evidence source.
- Yeh et al. (2025) — a lightweight breast mass classification model; the paper cites it only in the visual explanation context.
Agent systems and medical imaging reasoning
- LangGraph (LangChain documentation) — represents workflows with shared state, nodes, and edges, with each node computing routing logic; this paper uses it to connect prediction, confidence analysis, Grad-CAM evidence, LLM generation, and report validation.
- MedRAX (Fallahpour et al. 2025) — formalizes medical imaging reasoning as a tool orchestration problem rather than a pure classification problem; the authors state that BreastXAgent is inspired by this direction and is a compact proof of concept for mammography reporting.
- Arunkumar et al. (2026) — a review of LLM agent architecture, taxonomy, and evaluation, cited in support of the LangGraph design.
Baselines and evaluation setup: the paper compares five report strategies (Template-only, LLM-only, Strict-prompt LLM, LangGraph + LLM, BreastXAgent), evaluated on the authors' proposed BreastReportBench (160 images) (Table 2).
The authors position this paper as follows: unlike standalone classifiers or heatmap generators, and unlike medical LLM reporting approaches that rely on direct text generation, BreastXAgent combines prediction, visual explanation, language generation, and guardrail validation into a controlled explanation reporting process.
How does the paper address this problem?
Five-step agent pipeline: classification and Grad-CAM → confidence routing → LLM generation → rule-based guardrail validation, with violations replaced by a deterministic fallback report.
Overall approach: without retraining the classifier, use a BreastXAgent agentic pipeline to convert model outputs and Grad-CAM artifacts into structured, faithful, confidence-aware, non-diagnostic reports. The system consists of five steps (Figure 1): visual prediction, visual explanation, workflow routing, language generation, and guardrail validation, all running on the same shared state object orchestrated by LangGraph.
Classification and visual explanation
- Classifier: A pretrained MONAI breast density classification model (Hugging Face repository), taking a mammogram image as input and outputting a probability vector p = [pA, pB, pC, pD] over four BI-RADS density categories; the predicted class is ŷ = argmaxk ∈ {A,B,C,D} pk, and confidence c = max(p).
- Grad-CAM: Applied to the last convolutional layer of the Inception-v3 backbone, computing importance weights from gradients of feature-map activations with respect to the class score; the heatmap is ReLU'd, scaled to the original image size, and overlaid on the mammogram as the visual explanation artifact.
Confidence grading and routing
- Grading: The raw confidence c is mapped by fixed thresholds to a discrete level ℓ (high / moderate / low, Eq. 4; the threshold formulas are not fully preserved in the converted text, and the specific values are not given in the readable text of the paper).
- Routing logic (Algorithm 1): high goes to FullReport (full density description); moderate goes to QualifiedReport (adding qualifiers such as "moderate confidence"); low goes to DisclaimerReport (adding a disclaimer and avoiding detailed visual interpretation). The routing decision is written to shared state S and passed to the LLM generation node.
LLM report generation
- Model and input: Meta-Llama-3.1-8B-Instruct, with input being a structured prompt containing the predicted class and density description, confidence score and level, Grad-CAM evidence status ("relative activation, not tissue composition"), and the routing decision.
- Generation constraints: The prompt explicitly instructs the LLM not to describe visual interpretation of the mammogram or Grad-CAM, not to make diagnostic or anatomical localization claims, and to adjust wording by confidence level ("likely" for moderate, "may" for low).
- Report structure: Fixed three sections—Findings, Visual Evidence, Impression.
Guardrail validation and fallback
- Detection method: A rule module based on keyword and pattern matching, covering four categories of prohibited patterns: diagnostic terms, tissue localization claims, Grad-CAM overclaiming, and suggestive statements such as follow-up/biopsy.
- Replacement rather than warning: If any prohibited pattern is hit, the LLM output is discarded and a deterministic fallback report is generated (fixed template: gives the class, confidence level and score, states that Grad-CAM was generated but is not interpreted, and notes that this is research output rather than a clinical diagnosis). The final report is chosen by rule between the LLM draft and the fallback template (Eq. 5, Algorithm 2).
Evaluation method
- BreastReportBench: 160 private mammogram images (class distribution 12.5% A, 43.75% B, 37.5% C, 6.25% D), with one report generated per image under each of five strategies.
- Metrics (Table 1): completion rate, input faithfulness, confidence consistency, Grad-CAM overclaiming rate, clinical overclaiming rate, safety pass rate, fallback rate, utility score (0–100% composite score). The paper does not state whether each metric is judged by humans or by automatic rules.
What experiments did the paper conduct?
Five report strategies were compared and ablated on 160 images: LLM-only safety pass rate 12.5%, full pipeline 100.0%, fallback rate 6.3%.
Experimental setup
- Data: mammography images from a private sample set of 160 images, with class distribution 12.5% A, 43.75% B, 37.5% C, and 6.25% D.
- Compared strategies: five — Template-only, LLM-only, Strict-prompt LLM, LangGraph + LLM, and BreastXAgent — each run once per image.
- Models: a pretrained MONAI breast density classifier for classification; Meta-Llama-3.1-8B-Instruct for report generation, with temperature = 0.0 to ensure deterministic output.
- Metrics: completion rate, input faithfulness, confidence consistency, Grad-CAM overclaim rate, clinical overclaim rate, safety pass rate, fallback rate, and utility score (definitions in Table 1).
- Review method: the paper does not state whether each metric was judged by human annotation or automatic rules, nor does it report the number of repetitions.
Main results
Comparison of the five strategies on BreastReportBench (N=160), according to Table 2:
Swipe horizontally to read the table
Method Completion rate Faithfulness Confidence consistency Grad-CAM overclaim Clinical overclaim Safety pass rate Utility score Template-only 100.0% 100.0% 100.0% 0.0% 0.0% 100.0% 68.8% LLM-only 68.8% 81.3% 56.3% 75.0% 62.5% 12.5% 31.3% Strict-prompt LLM 100.0% 100.0% 87.5% 12.5% 6.3% 81.3% 81.3% LangGraph + LLM 100.0% 100.0% 93.8% 6.3% 6.3% 87.5% 87.5% BreastXAgent 100.0% 100.0% 100.0% 0.0% 0.0% 100.0% 100.0% - The authors consider the LLM-only baseline to perform poorly; the strict prompt reduced overclaiming but was insufficient to guarantee safety-critical reports.
- The authors state that LangGraph routing improved confidence consistency, and that the guardrails plus deterministic fallback brought the full pipeline to 100% safety and utility.
- Note that Template-only also reaches a 100% safety pass rate but has the lowest utility score; the authors explain this as its limited adaptive explanation capability.
Ablation study
Removing components one at a time (N=160), according to Table 3:
Swipe horizontally to read the table
Variant Removed component Safety pass rate Grad-CAM overclaim Utility score Full BreastXAgent None 100.0% 0.0% 100.0% No guardrails Guardrail fallback 87.5% 6.3% 87.5% No LangGraph routing Routing 93.8% 6.3% 75.0% No strict prompt Strict prompt 0.0% 100.0% 25.0% Template-only LLM generation 100.0% 0.0% 68.8% - The authors report that removing the strict prompt drops the safety pass rate to 0.0%, the largest effect among the ablations.
- Removing routing still maintains a 93.8% safety pass rate, but the utility score drops to 75.0%; on this basis the authors conclude that routing mainly contributes to utility rather than safety.
Guardrail intervention analysis
- Trigger distribution (Table 4, N=160): Grad-CAM overclaim 4.4%, tissue localization claims 3.1%, advisory statements 1.9%, diagnostic terms 0.0%; any violation combined 6.3%, i.e., 93.7% of LLM drafts passed unmodified.
- The authors state that most reports were not replaced, and that the fallback intervened in only a small fraction of cases.
Qualitative examples
- Single-case comparison (Table 5, one class B case, confidence 0.78): the LLM-only output contained violations of the localization, clinical interpretation, and follow-up recommendation types; the Strict-prompt version had no violations but was more brief; the BreastXAgent version gave the class, confidence, a statement that Grad-CAM is not interpreted as tissue localization, and a non-diagnostic statement.
- Figure 2 shows the input mammography image, Grad-CAM heatmap, and generated report for one case; the authors state that the output suppresses unsupported diagnostic claims while predicting BI-RADS density.
Other ablations and analyses
- The paper has no other parameter analyses beyond the tables above; the Discussion reiterates: without the strict prompt the safety pass rate is 0%, and only the template strategy is safe but has the lowest utility (68.8%).
What are some points that can be further explored?
The authors acknowledge that the dataset is small, that a single classifier is used, and that rule-based guardrails may miss semantic overclaiming, and they propose three future directions.
Limitations and future directions noted by the authors
- Small dataset size: The Discussion notes that the dataset of 160 images is small.
- Single classifier: The Discussion notes that the experiments used only one classifier.
- Coverage of rule-based guardrails: The Discussion notes that rule-based guardrails may miss semantic-level overclaiming.
- Larger datasets: Both the Discussion and the Conclusion list "evaluation on larger datasets" as future work.
- Classifier uncertainty: The Discussion proposes that future work could incorporate classifier uncertainty into routing; the Conclusion phrases this as adding classifier error handling.
- Repair-based guardrails: The Discussion and the Conclusion propose designing repair-based guardrails to reduce reliance on fallback replacement.
Scope of the experiments
- Five report strategies were tested: Template-only, LLM-only, Strict-prompt LLM, LangGraph + LLM, and BreastXAgent (Table 2).
- The data are 160 private mammography images, with class distribution 12.5% A, 43.75% B, 37.5% C, and 6.25% D; class D accounts for 6.25%.
- Report generation used only one LLM (Meta-Llama-3.1-8B-Instruct, temperature = 0.0), and classification used only one pretrained MONAI model.
- The paper does not report how each metric was judged (manual or automatic), annotator agreement, or the number of repeated experiments.
- The guardrails are keyword and pattern-matching rules; the paper did not test adversarial evasion inputs targeting the guardrails.
Summarize the main content of the paper
BreastXAgent constrains breast density report generation with routing plus rule-based guardrails; the authors report that the safety pass rate rose from 12.5% to 100% on 160 images.
A proof-of-concept paper on medical AI agent safety: building BreastXAgent, a controlled, faithful, non-diagnostic explanation report generation framework for breast density classification.
- Problem: the classifier outputs only a label and confidence; the authors report that writing reports directly with an LLM produces many unsupported claims — on 160 images, LLM-only had a Grad-CAM overclaim rate of 75.0%, a clinical overclaim rate of 62.5%, and a safety pass rate of only 12.5% (Table 2).
- Method: a five-step pipeline — pretrained MONAI classifier prediction, Grad-CAM heatmap generation, LangGraph routing by confidence level (high/moderate/low corresponding to full/qualified/disclaimer reports), Meta-Llama-3.1-8B-Instruct generating a three-part report under a strict prompt, and rule-based guardrails performing keyword and pattern matching, where any violation hit discards the draft and replaces it with a deterministic fallback template.
- Main results: on BreastReportBench (160 private images), the full pipeline had a safety pass rate of 100.0%, a utility score of 100.0%, and 0.0% for both types of overclaim; the strict prompt (81.3%) and LangGraph routing (87.5%) only partially improved the safety pass rate (Table 2).
- Ablation: removing the strict prompt dropped the safety pass rate to 0.0%; removing the guardrails dropped it to 87.5%; removing routing kept safety at 93.8% but dropped the utility score to 75.0% (Table 3).
- Guardrail interventions: 6.3% of LLM drafts were replaced by fallback, with triggers dominated by Grad-CAM overclaim (4.4%) and tissue localization claims (3.1%), and diagnostic term triggers at 0.0% (Table 4).
- Authors' conclusion: the authors state that the main contribution is controlled, faithful, non-diagnostic explanation generation rather than improving classifier accuracy; they acknowledge the small dataset, the single classifier, and that rule-based guardrails may miss semantic overclaiming, and plan future work to evaluate on larger datasets, add classifier error handling, and develop repair-based guardrails.