Multiple instance learning (MIL) is widely used in computational pathology because it enables weakly supervised analysis of whole-slide images (WSIs) without requiring patch-level annotations. In attention-based MIL, instances with high attention scores are often interpreted as diagnostically important regions and used as visual explanations. However, attention scores alone cannot determine whether selected high-attention instances are significantly different from normal instances, limiting the reliability of attention-based explanations. In this paper, we formulate the evaluation of high-attention instances as a statistical hypothesis testing problem. Specifically, we assess whether a selected high-attention instance significantly deviates from a representative normal reference instance selected based on feature similarity. A major challenge is that both the target instance and the reference instance are selected through data-dependent procedures, rendering standard hypothesis testing invalid. To address this issue, we introduce a selective inference (SI) framework that explicitly accounts for the selection events induced by attention-based instance selection and adaptive reference selection, thereby enabling the computation of valid selective p-values conditional on these events. Experiments demonstrate Type-I error control on synthetic and MNIST-based data and practical applicability to pathological WSIs, with higher statistical power than the conventional over-conditioning approach.
Figures & tables
Figure 1: Overview of the proposed framework. An ABMIL model predicts the bag label and generates an attention map for a test WSI. A high-attention instance is selected according to its attention score, and a representative reference instance is adaptively selected from the reference instances. The proposed SI framework then evaluates whether the selected high-attention instance significantly differs from the representative reference instance while accounting for the adaptive selection procedures.
Figure 2: Overview of the ABMIL model. An input bag Xn={xn,m}m∈[Mn] is first mapped to instance feature representations {hn,m}m∈[Mn] by the feature extractor fenc . The attention network fatt assigns an attention logit to each instance, and the bag feature is computed as the attention-weighted sum of the instance features. The classifier fclf predicts the bag label from the aggregated bag feature. Instances whose attention logits exceed the attention threshold are identified as high-attention instances and are subsequently subjected to selective inference.
Figure 3: Type-I error rate (left) and statistical power (right) on the synthetic dataset. The top row shows the results for varying the number of nearest neighbors k , while the bottom row shows the results for varying the Gaussian noise variance.
Figure 4: Type-I error rate under strong attention-based selection in the synthetic stress-test experiment. The dashed horizontal line indicates the nominal significance level of 0.05. The number of reference instances and the number of nearest neighbors were varied jointly as Mref=k∈{1,3,5,10} , while fixing the input dimension to d=32 and the Gaussian noise variance to σ2=0.6 . The attention threshold was set to the 99.99th percentile of the attention logits obtained from an independent set of normal instances.
Figure 5: Type-I error rate and statistical power in the MNIST-based experiments. From top to bottom, the plots show the Type-I error rate and statistical power using three Gaussian clusters, followed by the Type-I error rate and statistical power using five Gaussian clusters. The horizontal axis represents the positive class.
Proposed
OC
Bonferroni
Normal rejection rate (297)
0.037
0.037
0.000
Tumor rejection rate (1962)
0.570
0.468
0.117
Table 1: Quantitative evaluation on the CAMELYON16 dataset for k=3 . The numbers in parentheses indicate the numbers of tested instances used to compute the corresponding metrics.
Figure 6: Visualization of p -value maps for three representative CAMELYON16 tumor WSIs. (a) shows the ground-truth tumor masks, while (b), (c), and (d) show the results of Proposed, OC, and Bonferroni, respectively. Green and red rectangles indicate selected high-attention instances with p≥0.05 and p<0.05 , respectively. The remaining tumor cases are provided in Appendix D.3 .
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 7: Type-I error rate (left column) and statistical power (right column) under different parameter settings in the synthetic experiments. The dashed horizontal line indicates the nominal significance level of 0.05. The top row shows the results obtained by varying the input dimension while fixing the Gaussian noise variance to σ2=1.0 and the number of nearest neighbors to k=5 . The middle row shows the results obtained by varying the Gaussian noise variance while fixing the input dimension to 32 and setting k=1 . The bottom row shows the corresponding results with k=10 .
Figure 8: Type-I error rate and statistical power in the MNIST-based experiments using three Gaussian clusters. From top to bottom, the plots show the Type-I error rate and statistical power with k=3 , followed by the Type-I error rate and statistical power with k=1 . The horizontal axis represents the positive class.
Figure 9: Type-I error rate and statistical power in the MNIST-based experiments using five Gaussian clusters. From top to bottom, the plots show the Type-I error rate and statistical power with k=3 , followed by the Type-I error rate and statistical power with k=1 . The horizontal axis represents the positive class.
Figure 10: Visualization of p -value maps for additional CAMELYON16 tumor WSIs (Part I). (a) shows the ground-truth tumor masks, while (b), (c), and (d) show the results of Proposed, OC, and Bonferroni, respectively. Green and red rectangles indicate selected high-attention instances with p≥0.05 and p<0.05 , respectively.
Figure 11: Visualization of p -value maps for additional CAMELYON16 tumor WSIs (Part II). (a) shows the ground-truth tumor masks, while (b), (c), and (d) show the results of Proposed, OC, and Bonferroni, respectively. Green and red rectangles indicate selected high-attention instances with p≥0.05 and p<0.05 , respectively.
Université Paris-Saclay, CentraleSupélec, Gustave Roussy, INSERM, IHU PRISM, Cancer Data Science Unit, France · Université Paris-Saclay, CentraleSupélec, MICS Laboratory, France