Abstract

The allocation of visual attention by pathologists during cancer diagnosis is a highly selective process that critically shapes the information extracted from whole-slide images (WSIs). Human attention helps medical imaging tasks such as classification and segmentation, and becomes a strong semantic cue for identifying diagnostically informative regions for report generation. In this paper, we introduce human attention into the training of pathologist report generation models. To this end, we collected a multimodal human-attention dataset of 121 prostate WSIs annotated with pathologists’ multi-scale viewport trajectories synchronized with the pathologists’ verbal descriptions and cursor movements for five clinically relevant components (e.g., Gleason patterns). Using this dataset, we fine-tune two report generation models with an attention-alignment loss that regularizes the model attention over image patches to match the distribution of pathologist attention. We evaluate our approach on prostate cancer report generation and visual question answering using two models with different internal attention mechanisms (i.e., how image tokens are integrated into the language decoder). Experiments show average gains of 10.9% on NLP-based metrics and 19.3% in accuracy across five clinically relevant report components. Further, model attention maps extracted at inference time, with minimal computational overhead, align more closely with pathologist attention, providing stronger visual support for the generated reports by highlighting the regions that most influence the output.

1 Introduction↩︎

Figure 1: Top-left: Collect pathologist attention during WSI examination. Top-right: Align model attention maps to human attention via a training-time loss. Bottom: At inference, the model generates reports with model-attention-based visual evidence.

Human visual attention is capacity-limited and shifts over time. During whole-slide image (WSI) examination, pathologists scan the slide sequentially, selectively focusing on task-relevant regions. These attention trajectories reflect the visual evidence a pathologist encodes during cancer diagnosis. Clinically, modeling pathologist attention can support trainee education by revealing how specialists examine slides and can also facilitate the assessment of pathologists’ expertise levels [1][4], and understand decision-making [5]. Computationally, expert attention has increasingly been used as auxiliary supervision in medical imaging. Across pathology and radiology, attention signals have guided fully supervised and weakly supervised classification [6][8], segmentation [9], and text-to-image generation [10]. Beyond medical imaging, evidence from cognitive science and attention-aware image description [11][13] suggests that where people look shapes how they interpret and describe visual content. Together, these findings motivate leveraging pathologists’ attention as an auxiliary cue for pathology report generation, which grounds generated text in plausible visual evidence, and improves both interpretability and report quality.
Despite rapid recent progress in pathology report generation and visual question answering [14][18], only a few works incorporate auxiliary supervision such as model-predicted semantic information, and none so far leverage human attention in pathology report generation. Kim et al. [19] introduces semantic cues via a multi-label classifier over key diagnostic elements, but the generated reports are limited to predefined categories and depend on predicted semantics rather than ground-truth signals. Agent-based approaches such as CPathAgent [20] and PathChat+ [21] supervise the training by predicting the Region Of Interest(ROI)-based visual support with step-by-step reasoning; however, these ROIs are not derived from the attention of actual pathologists, and inducing such visual support typically requires large-scale instruction tuning.
In this paper, we align the visual attention of report generation models with pathologist attention. In vision–language transformers, model attention weights indicate how much each image patch contributes to token generation, providing a natural mechanism for grounding diagnostic statements in visual evidence. To supervise this alignment, we first collect a prostate cancer pathologist-attention dataset that captures multi-scale WSI examination behavior for five clinically critical components: Gleason patterns, perineural invasion, intraductal carcinoma, extraprostatic extension, and surgical margin. While the pathologists read the slides, we record viewport trajectories across magnification levels and synchronized, real-time verbal descriptions of observed findings, which provide soft labels for all the five components across the corresponding viewports.
Using this rich supervision, we introduce a plug-and-play module for report generation in the form of an auxiliary attention-alignment loss that regularizes model attention toward the corresponding pathologist attention distribution over image tokens (1). Pathologist attention is required only during training, with no additional inputs at inference, and the loss adds negligible overhead. We evaluate this design on both a report generation model and a WSI visual question answering model, covering two common vision–language fusion designs: cross-attention and self-attention. Experiments show 5.5%–12% average improvements on NLP-based metrics, and 8%–34% gains in accuracy on the five clinically related components across the two models. The model attention in the inference-time is aligned more closely with pathologist attention, providing stronger visual evidence for the generated reports. Our contributions are:

  • To our knowledge, we are the first to incorporate pathologist-attention supervision into pathology report generation, showing consistent report-quality gains across architectures.

  • We collect a multimodal pathologist-attention dataset of prostate WSIs with multi-scale viewport trajectories synchronized with spoken descriptions of observed findings.

  • We improve interpretability by producing attention-based visual evidence that better matches how pathologists attend during cancer diagnosis.

As we show, fine-tuning a pathology report generation model with human attention improves performance with relatively small pathologist annotation effort (\(\sim7\) hours in total for the reported experiments). This suggests that our plug-and-play module can easily become a part of model training for pathology report generation.

2 Pathologist Attention Dataset↩︎

Figure 2: Data collection process. Pathologists examine each WSI by iteratively zooming for detail and zooming out to navigate (bottom right). We record synchronized verbal descriptions, convert viewports center to scanpath (top center), filter points by target components, and generate a Gaussian-smoothed saliency map overlaid on the slide (top right).

Dataset collection. We record pathologists’ attention using QuIP caMicroscope [22]. Six pathologists reviewed 121 TCGA-PRAD prostate WSIs [23] and annotated seven elements: Gleason score, intraductal carcinoma (IDC), perineural invasion (PNI), extraprostatic extension (EPE), surgical margin, lymphovascular invasion, and seminal vesicle invasion. As shown in 2, slides are viewed in a 1912\(\times\)​930 viewport with iterative zooming and panning, yielding multi-magnification viewports. We sample viewports at 20,Hz and convert each to its center point to form a magnification-aware scanpath; synchronized verbal descriptions provide soft component labels. We remove duplicates and keep only positively labeled points per component. Due to sparsity, we exclude lymphovascular and seminal vesicle invasion and focus on five components. On average, scanpaths contain 59 points with 221,s per slide (\(\sim7\) hours total).
Human attention map construction. We construct Gaussian-blurred saliency maps [1], [2], [24]. For each magnification (\(2\times\), \(4\times\), \(10\times\), \(20\times\)), we project scanpath points onto the corresponding grid, apply Gaussian smoothing, then resize and merge maps into a single multi-scale saliency map per slide.

3 Method↩︎

3.1 Preliminaries↩︎

Report generation models adopt transformers structure [25]. Given queries \(Q\), keys \(K\), and values \(V\), scaled dot-product attention computes \[A=\mathrm{softmax}\!\left(\frac{QK^\top}{\sqrt{d}}\right), \qquad \mathrm{Attn}(Q,K,V)=AV,\] where \(A\) is the model attention weights, and \(\mathrm{Attn}(Q,K,V)\) is the output feature of a transformer attention layer.
Multimodal report generation models typically use two image-text fusion designs. Self-attention fusion concatenates image and text tokens \(Z=[\mathbf{X};\mathbf{Y}_{<t}]\), where \(\mathbf{X}\in\mathbb{R}^{I\times d}\) are image tokens and \(\mathbf{Y}_{<t}\in\mathbb{R}^{t\times d}\) are previously generated text tokens, and projects \(Q,K,V\) from \(Z\). Cross-attention fusion projects \(Q\) from the current text query, while \(K,V\) come only from \(\mathbf{X}\). These fusion determine how slide features influence next-token prediction: WSI-LLaVA [14] uses self-attention fusion, whereas HistGen [15], Bi-Gen [17], and HistoGPT [18] adopt cross-attention.

3.2 Pathologist Attention Alignment↩︎

Pathologist attention encoding in token space. Pathology report generation models first encode each WSI into a sequence of image tokens \(\mathbf{F}\in\mathbb{R}^{I\times d}\). Given a full-resolution human saliency map, we assign each token a saliency value by querying the map at the token’s recorded patch coordinates, yielding \(\mathbf{a}^{\text{human}}\in\mathbb{R}^{I}\). To encourage model attention consistent with pathologists’ attention, we fine-tune WSI-LLaVA and HistGen with the standard autoregressive next-token objective augmented by an attention-alignment loss.
Human attention alignment in WSI-LLaVA [14]. We use the last-layer self-attention weights \(\mathbf{A}\in\mathbb{R}^{(I+P+T)\times(I+P+T)}\), where \(I\) is the number of image tokens, \(P\) is the prompt length, and \(T\) is the number of answer tokens. We extract the answer-to-image attention block \[\mathbf{A}_{\text{ans}\rightarrow \text{img}} =\mathbf{A}\big[\mathcal{T}_{\text{ans}},\,\mathcal{I}\big]\in\mathbb{R}^{T\times I},\] where \(\mathcal{I}\) indexes image-token positions and \(\mathcal{T}_{\text{ans}}\) indexes answer-token query positions. We then aggregate token-wise attention into an image-level model attention vector by averaging over answer tokens: \[\mathbf{a}^{\text{model}} =\frac{1}{T}\sum_{t\in\mathcal{T}_{\text{ans}}}\mathbf{A}_{\text{ans}\rightarrow \text{img}}[t,:]\in\mathbb{R}^{I}.\] Given the corresponding human attention vector \(\mathbf{a}^{\text{human}}\in\mathbb{R}^{I}\), we define the alignment loss as the KL divergence between the attention distributions following the design of GazeVLM [26], \[\mathcal{L}_{\mathrm{KL}} = D_{\mathrm{KL}}\!\left( \mathrm{softmax}(\mathbf{a}^{\text{human}}) \;\Big\|\; \mathrm{softmax}(\mathbf{a}^{\text{model}}) \right).\]

Training objective. Given the ground-truth tokens \(\{t_1,\dots,t_T\}\), the base objective is the next-token negative log-likelihood \(\mathcal{L}_{\mathrm{CE}} = -\sum_{t=1}^{T} \log p_{\theta}(t_t \mid t_{<t}, \mathbf{X})\). The overall loss is \(\mathcal{L} = \mathcal{L}_{\mathrm{CE}} + \lambda\,\mathcal{L}_{\mathrm{KL}}\), where \(\lambda\) controls the strength of alignment, and is set to 1.0 in the experiment.
Human attention alignment in HistGen. Given the different attention mechanism of HistGen (cross-attention) from WSI-LLaVA (self-attention), we directly extract the model attention \(\mathbf{A}^{\text{model}}\in\mathbb{R}^{T\times I}\) and then follow the same way to compute alignment loss.

3.3 Inference-Time Visual Support Generation↩︎

During inference, we generate reports and extract model attention to image tokens in each step, then average across steps to obtain a slide-level vector \(\mathbf{a}^{\text{model}}\), then back-project it to a pixel-level heatmap by assigning each patch its token value, followed by normalization and Gaussian smoothing ( 3.2).

4 Experiments↩︎

4.1 Setups↩︎

Baselines. We use HistGen [15] and WSI-LLaVA [14] as base models, which differ in multimodal fusion attention mechanisms and are designed for different tasks (report generation vs.visual question answering). Zero-shot denotes directly evaluating each pretrained model on its test set. w/o alignment denotes LoRA fine-tuning [27] using only the next-token prediction loss, without any pathologist-attention alignment.
Report Dataset. We use the official datasets and splits of HistGen and WSI-LLaVA. For HistGen, attention alignment is trained only on the 81 slides with our attention annotations, while evaluation follows the official val/test sets (86/76). Visual-support evaluation (requiring GT comparison) is performed on 20 test slides. For WSI-LLaVA, we use 107 training examples and 11 test examples for report-quality evaluation, and 15 test samples for visual-support evaluation.
Metrics. We evaluate both report quality and visual support. For report generation, we report standard NLP metrics: BLEU (B1–B4) [28], METEOR (M) [29], and ROUGE-L (R) [30]. Since our attention annotations target five pathological components, we use ChatGPT-5.2 to extract them and compute exact-match scores between generated and ground-truth reports: Gleason requires matching both primary and secondary patterns, while the remaining components are binary scored. We report ACC-G, ACC-PNI, ACC-EPE, and ACC-S for Gleason score, perineural invasion, extraprostatic extension, and surgical margin, respectively; we omit intraductal carcinoma because it does not appear in the ground-truth reports. For visual support, we measure attention heatmap similarity with Normalized Scanpath Saliency (NSS) and KL divergence (KL) [31], and quantify agreement with ground-truth Gleason regions using segmentation labels from [32], reporting ROC-AUC (the probability that a pixel inside the binary segmentation mask receives a higher heatmap score than a pixel outside).
Implementation details. We use LoRA finetuning for both HistGen and WSI-LLaVA with the same split and training setting as the original papers. The experiment runs on a single RTX 6000 GPU. We set \(\lambda=1.0\) for both models.

c|c|cccccc|cccc Backbone & Method & B1 & B2 & B3 & B4 & R & M & ACC-G & ACC-PNI & ACC-EDE & ACC-S
& Zero-shot & 0.329 & 0.162 & 0.087 & 0.048 & 0.172 & 0.150 & 25.0 & 25.7 & 30.0 & 25.7
& w/o Alignment & 0.326 & 0.174 & 0.102 & 0.065 & 0.185 & 0.151 & 30.0 & 35.0 & 34.3 & 28.5
& Ours & 0.361 & 0.194 & 0.116 & 0.077 & 0.203 & 0.166 & 35.7 & 40.0 & 44.3 & 30.0
& Zero-shot & 0.469 & 0.283 & 0.187 & 0.129 & 0.328 & 0.211 & 45.5 & 81.8 & 45.5 & -
& w/o Alignment & 0.444 & 0.254 & 0.146 & 0.093 & 0.300 & 0.220 & 54.5 & 81.8 & 45.5 & -
& Ours & 0.479 & 0.292 & 0.197 & 0.136 & 0.338 & 0.228 & 63.6 & 90.9 & 63.6 & -

Figure 3: Qualitative results of report generation. Top: HistGen; Bottom: WSI-LLaVA. Components mentioned in the generated reports are highlighted in red, indicating more complete and higher-quality reports.
Figure 4: Qualitative results of visual support. Visual support is extracted from the last decoder layer at inference (top: HistGen, blurred due to the small number of image tokens for better visualization; bottom: WSI-LLaVA). Compared to training without alignment (fifth column), our method (fourth column) suppresses non-Gleason regions and better matches ground-truth pathologist attention (second column) and Gleason segmentation [32] (third column).
Table 1: Quantitative results of visual support. Our method produces model attention that aligns better with human and segmentation labels.
Method HistGen WSI-LLaVA
NSS\(\uparrow\) KL\(\downarrow\) ROC-AUC \(\uparrow\) NSS\(\uparrow\) KL\(\downarrow\) ROC-AUC \(\uparrow\)
w/o alignment 0.43 5.45 0.500 0.76 3.10 0.598
with alignment (Ours) 0.59 4.76 0.537 0.87 2.98 0.615

3.5pt

\begin{table}[t] 3.5pt
Method HistGen WSI-LLaVA
B4 R ACC-G B4 R ACC-G
all layers 0.079 0.199 34.2 0.124 0.325 45.5
last layer (Ours) 0.077 0.203 35.7 0.136 0.338 63.6
\vskip

-0.2in
\end{table}

4.2 Results↩︎

Quantitative results. In ¿tbl:tab:main-result?, aligning pathologist attention achieves the best performance on both HistGen and WSI-LLaVA. In particular, our method yields higher accuracy on all five clinical components than the baselines, suggesting that human attention guides the model toward more informative regions. We also observe that fine-tuning WSI-LLaVA without attention alignment leads to a performance drop, likely due to overfitting in this low-data setting, as WSI-LLaVA is built on a large language model (Vicuna-7b-v1.5 [33]). By providing human attention as a visual constraint, this alignment discourages the model from memorizing report text.
Qualitative results of generated reports. In 3, our model captures the clinically critical components targeted in our dataset collection more consistently than the baselines, suggesting it learns to leverage pathologist attention cues effectively.
Visual support. We report qualitative and quantitative results on visual support in 4 and 1, evaluating (1) alignment with pathologist attention and (2) coverage of Gleason patterns. These results suggest our alignment loss encourages the model to focus on more informative, human-preferred regions, improving report quality. The resulting visual support also enhances interpretability by indicating which regions support the model’s diagnostic statements.
Ablation. We ablate which transformer layer to use for extracting model attention in human-attention alignment. Results in ¿tbl:tab:layer-ablation? show that supervising only the last layer is sufficient to steer the model toward pathologist-attended regions, likely because last-layer attention most directly influences next-token prediction. In contrast, aligning multiple layers in WSI-LLaVA degrades performance below the zero-shot baseline, likely because it is much deeper than HistGen due to its large language model backbone, where different layers encode distinct information and enforcing a uniform attention target across all layers is overly restrictive.

\begin{table}[t] 3.5pt
Method HistGen WSI-LLaVA
B4 R ACC-G B4 R ACC-G
all layers 0.079 0.199 34.2 0.124 0.325 45.5
last layer (Ours) 0.077 0.203 35.7 0.136 0.338 63.6
\vskip

-0.2in
\end{table}

5 Conclusion and Discussion↩︎

We propose a plug-and-play pathologist attention–alignment framework that uses multi-scale expert attention as auxiliary supervision for explainable pathology report generation. Across HistGen and WSI-LLaVA, it improves report quality and clinically relevant component accuracy while producing attention maps that better match pathologists’ attention with minimal overhead. Our results highlight the value of auxiliary signals for report generation and suggest scalability to additional cancer types due to the modest data-collection burden. Future work will expand attention collection to more cancer types and develop models that generalize to new cancer types by leveraging shared examination behaviors of pathologists among different cancer types.

6 Acknowledgement↩︎

This research is supported by US National Science Foundation (NSF) grants IIS-2123920, IIS-2212046 and 2442053, National Institutes of Health (NIH), National Cancer Institute (NCI) grants 1R21CA25849301A1, 1R01CA297843-01, 3R21CA25849302S1, 1R03DE033489-01A1 and the Health Data Hub as part of the second edition of the France-Québec call for projects Intelligence Artificielle en santé. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.

Disclosure of Interests. The authors have no competing interests to declare that are relevant to the content of this article.

References↩︎

[1]
S. Chakraborty et al., “Measuring and predicting where and when pathologists focus their visual attention while grading whole slide images of cancer,” Medical Image Analysis, p. 103752, 2025.
[2]
S. Chakraborty et al., “Predicting the visual attention of pathologists evaluating whole slide images of cancer,” in International workshop on medical optical imaging and virtual microscopy image analysis, 2022, pp. 11–21.
[3]
T. T. Brunye, P. A. Carney, K. H. Allison, L. G. Shapiro, D. L. Weaver, and J. G. Elmore, “Eye movements as an index of pathologist visual expertise: A pilot study,” PloS one, vol. 9, no. 8, p. e103447, 2014.
[4]
S. Chakraborty et al., “Decoding the visual attention of pathologists to reveal their level of expertise,” in MICCAI, 2024, pp. 120–130.
[5]
V. Thai et al., “Eye-tracking, mouse tracking, stimulus tracking, and decision-making datasets in digital pathology,” arXiv preprint arXiv:2510.24653, 2025.
[6]
T. Nan et al., “Deep learning quantifies pathologists’ visual patterns for whole slide image diagnosis,” Nature Communications, vol. 16, no. 1, p. 5493, 2025.
[7]
M. Bhattacharya, G. Singh, S. Jain, and P. Prasanna, “GazeLT: Visual attention-guided long-tailed disease classification in chest radiographs,” arXiv preprint arXiv:2508.09478, 2025.
[8]
M. Bhattacharya and P. Prasanna, “Gazediff: A radiologist visual attention guided diffusion model for zero-shot disease classification,” in Medical imaging with deep learning, 2024.
[9]
R. Ge et al., “Adaptation follow human attention: Gaze-assisted medical segment anything model,” IEEE Transactions on Circuits and Systems for Video Technology, 2025.
[10]
M. Bhattacharya, G. Singh, S. Jain, and P. Prasanna, “Radgazegen: Radiomics and gaze-guided medical image generation using diffusion models,” arXiv preprint arXiv:2410.00307, 2024.
[11]
Z. M. Griffin and K. Bock, “What the eyes say about speaking,” Psychological science, vol. 11, no. 4, pp. 274–279, 2000.
[12]
M. I. Coco and F. Keller, “Scan patterns predict sentence production in the cross-modal processing of visual scenes,” Cognitive science, vol. 36, no. 7, pp. 1204–1223, 2012.
[13]
R. Xue et al., “Personalized image descriptions from attention sequences,” arXiv preprint arXiv:2512.06662, 2025.
[14]
Y. Liang et al., “Wsi-llava: A multimodal large language model for whole slide image,” in CVPR, 2025, pp. 22718–22727.
[15]
Z. Guo, J. Ma, Y. Xu, Y. Wang, L. Wang, and H. Chen, “Histgen: Histopathology report generation via local-global feature encoding and cross-modal context interaction,” in MICCAI, 2024, pp. 189–199.
[16]
P. Chen, H. Li, C. Zhu, S. Zheng, Z. Shui, and L. Yang, “Wsicaption: Multiple instance generation of pathology reports for gigapixel whole-slide images,” in MICCAI, 2024, pp. 546–556.
[17]
L. Zhang, B. Yun, Q. Li, and Y. Wang, “Historical report guided bi-modal concurrent learning for pathology report generation,” in MICCAI, 2025, pp. 343–352.
[18]
M. Tran et al., “Generating dermatopathology reports from gigapixel whole slide images with HistoGPT,” Nature communications, vol. 16, no. 1, p. 4886, 2025.
[19]
K. A. Kim, S. Hong, S. Yoo, Y. Kang, and H. S. Shim, “Enhancing structured pathology report generation with foundation model and modular design,” IEEE Access, 2025.
[20]
Y. Sun et al., “CPathAgent: An agent-based foundation model for interpretable high-resolution pathology image analysis mimicking pathologists’ diagnostic logic,” arXiv preprint arXiv:2505.20510, 2025.
[21]
C. Chen et al., “Evidence-based diagnostic reasoning with multi-agent copilot for human pathology,” arXiv preprint arXiv:2506.20964, 2025.
[22]
J. Saltz et al., “A containerized software system for generation, management, and exploration of features from whole slide tissue images,” Cancer research, vol. 77, no. 21, pp. e79–e82, 2017.
[23]
M. L. Zuley et al., “Radiology data from the cancer genome atlas prostate adenocarcinoma [tcga-prad] collection,” Cancer Imaging Arch, vol. 9, no. 10.7937, p. K9, 2016.
[24]
M. Jiang, S. Huang, J. Duan, and Q. Zhao, “Salicon: Saliency in context,” in CVPR, 2015, pp. 1072–1080.
[25]
A. Vaswani et al., “Attention is all you need,” NeurIPS, vol. 30, 2017.
[26]
A. Pani and Y. Yang, “Gaze-VLM: Bridging gaze and VLMs through attention regularization for egocentric understanding,” arXiv preprint arXiv:2510.21356, 2025.
[27]
E. J. Hu et al., “Lora: Low-rank adaptation of large language models.” Iclr, vol. 1, no. 2, p. 3, 2022.
[28]
K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu, “Bleu: A method for automatic evaluation of machine translation,” in Proceedings of the 40th annual meeting of the association for computational linguistics, 2002, pp. 311–318.
[29]
S. Banerjee and A. Lavie, “METEOR: An automatic metric for MT evaluation with improved correlation with human judgments,” in Proceedings of the acl workshop on intrinsic and extrinsic evaluation measures for machine translation and/or summarization, 2005, pp. 65–72.
[30]
C.-Y. Lin, “Rouge: A package for automatic evaluation of summaries,” in Text summarization branches out, 2004, pp. 74–81.
[31]
R. J. Peters, A. Iyer, L. Itti, and C. Koch, “Components of bottom-up gaze allocation in natural images,” Vision research, vol. 45, no. 18, pp. 2397–2416, 2005.
[32]
Codatta, Accessed: 2026-02-24“Refined-TCGA-PRAD prostate cancer pathology dataset.” Hugging Face Datasets, [Online]. Available: https://huggingface.co/datasets/Codatta/Refined-TCGA-PRAD-Prostate-Cancer-Pathology-Dataset.
[33]
L. Zheng et al., “Judging llm-as-a-judge with mt-bench and chatbot arena,” NeurIPS, vol. 36, pp. 46595–46623, 2023.