AINet: Anchor Instances Learning for Regional Heterogeneity in Whole Slide Image Tingting Zheng, Hongxun Yao, Kui Jiang, Sicheng Zhao, Yi Xiao, Harbin Institute of Technology, Tsinghua University, Zhengzhou University Abstract Recent advances in multi-instance learning (MIL) have witnessed impressive performance in whole slide image (WSI) analysis. However, the inherent sparsity of tumors and their morphological diversity lead to obvious heterogeneity across regions, posing significant challenges in aggregating high-quality and discriminative representations. To address this, we introduce a novel concept of anchor instance (AI), a compact subset of instances that are representative within their regions (local) and discriminative at the bag (global) level. These AIs act as semantic references to guide interactions across regions, correcting non-discriminative patterns while preserving regional diversity. Specifically, we propose a dual-level anchor mining (DAM) module to select AIs from massive instances, where the most informative AI in each region is extracted by assessing its similarity to both local and global embeddings. Furthermore, to ensure completeness and diversity, we devise an anchor-guided region correction (ARC) module that explores the complementary information from all regions to correct each regional representation. Building upon DAM and ARC, we develop a concise yet effective framework, AINet, which employs a simple predictor and surpasses state-of-the-art methods with substantially fewer FLOPs and parameters. Moreover, both DAM and ARC are modular and can be seamlessly integrated into existing MIL frameworks, consistently improving their performance. 1 Introduction Figure 1 : Comparison results of FLOPs (G), parameters (M), and average accuracy with representative MIL methods on TCGA-ESCA, TCGA-BRCA, and BRACS datasets. AINet delivers superior performance with improved efficiency. Histopathology slides provide cellular morphology and tissue microenvironment, which are indispensable for accurate cancer diagnosis 35 ; 27 . With the rapid advancement of digital pathology, physical tissue slides can now be digitized into high-resolution whole slide images (WSIs), opening new avenues for applying deep learning to tumor diagnosis 13 ; 28 ; 34 . Nevertheless, the inherent gigapixel scale of WSIs, coupled with the sparse and scattered distribution of tumor regions, makes pixel-level manual annotation highly expensive and time-consuming 16 ; 11 . To alleviate these limitations, multi-instance learning (MIL) has emerged as a promising paradigm, treating a WSI as a “bag” of instances (patches) and leveraging bag-level labels to guide feature learning 6 ; 32 . Figure 2 : (a) Regional heterogeneity within a WSI originates from tumor sparsity and morphological diversity. (b) Previous MIL methods often neglect this heterogeneity, resulting in suboptimal feature aggregation. (c) The proposed AINet alleviates this limitation via DAM and ARC modules, yielding more discriminative representations and improved predictive accuracy. Despite recent progress, MIL-based approaches for WSI analysis continue to be fundamentally limited by intra-WSI heterogeneity, a key challenge illustrated in Figure 2 (a). This manifests in two primary forms: (i) the sparse distribution of tumor regions, which obscures discriminative instances within a vast number of non-informative ones, and (ii) the significant morphological diversity among instances, which hinders the aggregation of a comprehensive and coherent global context. Currently, existing methods designed to address these challenges can be broadly categorized into three paradigms: instance-, bag-, and pseudo-bag-level approaches 25 ; 46 . Instance-level methods predict labels for individual instances before aggregating them for a bag-level prediction 4 . However, in WSIs where tumor regions are sparse and non-lesion instances dominate, these methods often focus on uninformative instances and overlook global context, resulting in suboptimal representations 18 ; 41 . Bag-level methods aim to capture global context through advanced architectures, including attention mechanisms 15 , graph neural networks 18 ; 5 , and Transformers 31 ; 38 , which aggregate multiple instances into a unified bag-level representation. Despite these sophisticated designs, these approaches are computationally expensive and often fail to produce high-quality representations on highly heterogeneous instance sets, as aggregation can be diluted by uninformative or conflicting features. Decomposing WSIs into multiple regions (or pseudo-bags) has emerged as an effective strategy for handling instance heterogeneity in MIL 46 . However, due to sparse tumors and uneven feature distributions, many regions lack informative lesions or diversity cues, leading to representations that are neither sufficiently discriminative nor comprehensive 43 ; 23 . To address this issue, cross-region fusion has been widely adopted to enhance feature representations by aggregating complementary information. Yet, the heterogeneity across regions may also introduce redundant or noisy features, thereby undermining its effectiveness 52 . Consequently, a critical challenge remains: to devise a concise yet effective solution that mitigates regional heterogeneity by enhancing the discriminativeness of all regions while conserving their diversity and representativeness. Drawing inspiration from prototype learning, complex distributions can be effectively characterized by a compact set of reference points (called anchors) 9 . Beyond representation, anchors act as semantic bridges 9 , facilitating the correction of heterogeneous data and the discovery of discriminative features 29 ; 36 ; 26 . Motivated by these insightful properties, we introduce a novel concept, i.e., anchor instance (AI), to elegantly address heterogeneity across regions. Specifically, AIs constitute a compact set of representative instances selected from all regions, which serve as semantic reference points to guide regional interactions, thereby correcting the uninformative regions induced by tumor sparsity and morphological diversity. The AI paradigm directly addresses the aforementioned requirement by: 1) providing stronger, globally salient features that enhance discriminative power for region correction, and 2) summarizing representative information from each region to guide the interaction of diverse patterns, thereby preserving diversity while mitigating heterogeneity. Figure 3 : Overview of the proposed AINet for WSI classification. Each bag is first divided into multiple spatial regions. The dual-level anchor mining (DAM) module identifies a compact set of anchor instances (AIs), which are then incorporated by the anchor-guided region correction (ARC) module into regional representations to guide the aggregation of heterogeneous features. To identify AIs, we first design a dual-level anchor mining (DAM) module. Guided by the requirement that AIs should be globally discriminative and locally representative, DAM quantifies the salience of each instance by computing the similarity to both a global bag embedding and its local regional embedding. The dual similarity scores are combined to rank all instances, and the top-ranked ones are selected as the final AIs. To effectively utilize the AIs, we further devise an anchor-guided region correction (ARC) module. Rather than a simple assignment or fusion, ARC employs AIs as semantic pivots to facilitate interaction between heterogeneous regions. This design ensures that the corrected features maintain strong discriminative power and comprehensive representativeness, addressing the heterogeneity issue. Integrating the DAM and ARC modules forms our complete AINet framework. Using only a simple predictor, AINet outperforms state-of-the-art (SOTA) MIL-based models (Figure 1 ), underscoring the efficacy and efficiency of the anchor instance learning paradigm. Our main contributions are summarized as follows: • We introduce a novel concept of AI and develop AINet, a concise yet effective framework that extracts representative and discriminative instances for better WSI classification. • We design a DAM module to select AIs by comprehensively leveraging local (region) and global (bag) relationships, and an ARC module to mitigate heterogeneous interference during regional correction. • Extensive experiments on public datasets show that AINet outperforms state-of-the-art MambaMIL and PAMoE methods, achieving average accuracy gains of 2.50% and 4.65% on TCGA-BRCA, TCGA-ESCA, and BRACS, respectively, with lower FLOPs and parameters. 2 Related Work 2.1 Multi-instance Learning MIL is a weakly supervised paradigm that models each sample as a bag of instances, where only the bag-level label is provided 15 . The assumption is that a bag is positive if at least one instance is positive, and negative otherwise 4 . MIL has been widely applied across various domains, including computer vision 30 and medical data analysis 10 ; 19 ; 40 . To facilitate computer-aided diagnosis, MIL has gained significant attention in computational pathology for WSI analysis, driving advances in cancer subtype classification 52 , survival prediction 33 ; 8 , and lesion localization 22 . However, due to the extreme sparsity of tumor instances in gigapixel WSIs, learning discriminative bag-level representations remains highly challenging 15 . To overcome these limitations, some researchers have explored graph networks 1 ; 54 , attention mechanisms 49 ; 51 , Transformers 52 , and Mamba 50 ; 47 ; 53 to predict or aggregate instance-level information for accurate bag-level prediction. While effective, their performance is often compromised when dealing with complex and heterogeneous tissue structures. To address these issues, we propose AINet, which captures a compact set of informative instances to guide the fusion of heterogeneous features, enabling high-quality and discriminative bag-level representations. 2.2 Instance Selection in WSI classification Instance selection plays a crucial role in MIL-based WSI analysis, aiming to identify the most salient instances for accurate bag-level prediction 15 . Early studies mainly relied on global attention mechanisms, which assign attention weights to each instance 4 ; 25 . However, a single attention operator can be inaccurate 42 . To alleviate this issue, recent studies have introduced multi-branch attention mechanisms to capture instances with distinct morphological patterns, while others employ multi-head attention to model complex instance relationships for more reliable instance selection 31 ; 48 . Despite these advances, relying solely on bag-level supervision and attention scores limits the diversity of selected instances 37 . Several works have further explored similarity-based clustering, pseudo-labeling methods, and knowledge distillation to guide instance selection 17 ; 42 ; 21 . However, these methods often fail to select instances that are globally discriminative or locally representative, as they ignore the heterogeneity across WSI regions. To this end, our proposed DAM effectively captures instances that are representative within diverse regions while being discriminative toward bag-level semantics, facilitating instance aggregation. 3 Method This section first formulates the MIL problem, then outlines the AINet framework, followed by detailed descriptions of the DAM and ARC modules. 3.1 MIL Formulation Given a WSI X , the non-background tissue regions are divided into N instances \{(x_{i},y_{i})\mid 1\leq i\leq N\} , forming a bag. Here, Y denotes the label of X , while the instance-level labels y_{i} are unknown. The MIL formulation is expressed as: \displaystyle Y_{i} \displaystyle=\begin{cases}0,&\text{iff }\sum y_{i}=0,\quad y_{i}\in\{0,1\},\\ 1,&\text{otherwise},\end{cases} (1) In this case, a bag is labeled negative ( 0 ) if all instances are negative, and positive ( 1 ) otherwise. Typically, the MIL framework for WSI analysis embeds each instance x_{i} into a 1D feature vector f_{\text{ins}}^{i} 25 ; 46 ; 52 . After that, a scoring function then evaluates each feature to select the most informative instances or perform score-weighted aggregation for bag-level prediction. However, due to the heterogeneous tissue patterns in WSIs, such naive selection or aggregation often struggles to capture representative and discriminative representations. To alleviate this issue, we introduce a novel concept the AI. We identify a small subset of instances that serve as reference points to guide interactions across heterogeneous regions, thereby enabling the learning of high-quality and discriminative representations within a concise and effective framework. 3.2 Overview of AINet Figure 3 presents an overview of the proposed AINet framework, which aims to capture a compact set of anchor instances and guides heterogeneous region correction to achieve high-quality and discriminative representations. First, we denote a bag as a set of N instance features \{f_{\text{ins}}^{i}\}_{i=1}^{N} . We then divide the bag into L=\frac{N}{Z} regions according to the spatial distribution (coordinates) of instances in the WSI, where Z is the number of instances per region. Next, the DAM module is employed to estimate instance importance by jointly comparing each instance with the region-level embeddings and the global-level embedding of the entire bag, making the selection of AIs \{f_{\text{AI}}^{t}\}_{t=1}^{T} both locally representative and globally discriminative, where T denotes the number of AIs and t indexes the t -th AI. To address regional heterogeneity and correct the non-discriminative regions, ARC employs AIs \{f_{\text{AI}}^{t}\}_{t=1}^{T} to guide cross-region interactions, enabling discriminative cues from AIs to refine the uninformative regions while preserving the diversity and representativeness of regional instances. It is worth noting that a mask-based attention mechanism is incorporated into ARC to filter out redundant computations induced by massive instance interactions, thus resulting in compact bag representations. Finally, the remaining instances are fed into an attention-based predictor to produce the final bag prediction \hat{Y} . 3.3 Dual-level Anchor Mining To effectively identify sparsely distributed AIs while maintaining computational efficiency, each instance feature is first projected into a latent feature space through a lightweight multilayer perceptron (MLP), which consists of two linear layers and a ReLU activation. This projection produces L regions of instance features R_{l}=\{f_{l}^{z}\}_{z=1}^{Z} , where f_{l}^{z} denotes the z -th instance feature in the l -th region. We then compute two hierarchical embeddings to provide dual-level semantic guidance: a bag-level embedding f_{\text{bag}} obtained by mean pooling ( MP ) over all instances within the WSI (i.e., the entire bag), and a region-level embedding f_{\text{reg}}^{l} obtained by mean pooling over instances within each region R_{l} . This process can be formulated by: f_{\text{bag}}=\text{MP}(\{R_{l}\}_{l=1}^{L}),\{f_{\text{reg}}^{l}\}_{l=1}^{L}=\{\text{MP}(R_{l})\}_{l=1}^{L}. (2) As illustrated in Figure 3 , the DAM module computes the cosine similarity weights w_{l}^{z} between each f_{l}^{z} and both the region-level embedding f_{\text{reg}}^{l} and the bag-level embedding f_{\text{bag}} , which means: w_{l}^{z}=\alpha\cdot\cos(f_{l}^{z},f_{\text{reg}}^{l})+(1-\alpha)\cdot\cos(f_{l}^{z},f_{\text{bag}}), (3) where \cos(\cdot) denotes the cosine similarity function, and \alpha is set to 0.7 to balance local and global similarities. The similarity weights are then ranked, and the top k\% instances with the highest scores are selected as anchor instances \{f_{\text{AI}}^{t}\}_{t=1}^{T} : \{f_{\text{AI}}^{t}\}_{t=1}^{T}=\operatorname{Top}_{k}(\{f_{l}^{z},w_{l}^{z}\}_{z=1}^{Z}\,\big|\,l=1,\dots,L), (4) where \operatorname{Top}_{k}(\cdot) selects the top T=k\%\times N instance features and N=L\times Z . 3.4 Anchor-guided Region Correction With the DAM module, we obtained AIs that are both locally representative and globally discriminative. The proposed ARC module then aims to leverage these AIs as guidance to mitigate regional heterogeneity during cross-region interaction and correction. This approach allows us to use the AIs as explicit references, resulting in discriminative representations for more accurate predictions. Specifically, ARC incorporates the AIs into each region to form f_{\text{AIR}}^{l} , which is then linearly projected using W_{q}^{l},W_{k}^{l},W_{v}^{l} into the query Q_{l} , key K_{l} , and value V_{l} . Different from vanilla self-attention mechanisms, each Q_{l} attends to Key and Value not only from the current l -th region but also from the adjacent (l+1) -th region, introducing more diverse and discriminative regional representations for interaction. The anchor-guided region correction process can be summarized as follows: \displaystyle f_{\text{AIR}}^{l}=[\{f_{\text{AI}}^{t}\}_{t=1}^{T};\{f_{l}^{z}\}_{z=1}^{Z}], (5) \displaystyle Q_{l}=W_{q}^{l}f_{\text{AIR}}^{l},\,K_{l}=W_{k}^{l}f_{\text{AIR}}^{l},\,V_{l}=W_{v}^{l}f_{\text{AIR}}^{l}, (6) \displaystyle R_{\text{cross}}^{l}=\text{Softmax}(\frac{Q_{l}[K_{l};K_{l+1}]^{T}}{\sqrt{d_{K}}})[V_{l};V_{l+1}], (7) where [\,\cdot\,,\,\cdot\,] denotes the concatenation operation. While R_{\text{cross}}^{l}=\{f_{\text{cross}}^{l,j}\}_{j=1}^{T+Z} encodes discriminative cues across regions and AIs, correcting a large number of instances inevitably introduces redundant information. To further enhance the quality of the corrected features, we apply an attention-based masking mechanism, which masks M=r\times(T+Z) instance features with the lowest attention scores within each region, denoted as \text{Mask}_{r}(\cdot,\cdot) . Here, r is the mask ratio. This procedure is described as follows: \displaystyle\{A^{l,j}\}_{j=1}^{T+Z}=\text{Attention}\left(\{f_{\text{cross}}^{l,j}\}_{j=1}^{T+Z}\right), (8) \displaystyle\{\bar{f}_{\text{cross}}^{l,j}\}_{j=1}^{T+Z-M}=\text{Mask}_{r}\left(\{f_{\text{cross}}^{l,j},A^{l,j}\}_{j=1}^{T+Z}\right). (9) Finally, the compact set \bar{R}_{l}=\{\bar{f}_{\text{cross}}^{l,j}\}_{j=1}^{T+Z-M} is passed to a MIL predictor to achieve the prediction. In this work, we adopt a standard attention-based predictor, generating both region- and bag-level prediction results, i.e., \hat{y}^{l} and \hat{Y} . 3.5 Model Optimization To preserve essential information during feature projection before the DAM module, we apply a mean-squared error (MSE) consistency loss between the original instance features \{f_{\text{ins}}^{l,z}\}_{z=1}^{Z} and their projected counterparts \{f_{l}^{z}\}_{z=1}^{Z} . In addition, cross-entropy losses are computed at both the region and bag levels to ensure stable optimization. The overall loss function is formulated as: \displaystyle\mathcal{L}_{\text{MSE}}=\frac{1}{L\cdot Z}\sum_{l=1}^{L}\sum_{z=1}^{Z}\left\|f_{\text{ins}}^{l,z}-f_{l}^{z}\right\|_{2}^{2}, (10) \displaystyle\mathcal{L}_{\text{region}}\!=\!-\frac{1}{L}\sum_{l=1}^{L}\left[Y\log\hat{y}^{l}+(1-Y)\log(1-\hat{y}^{l})\right], (11) \displaystyle\mathcal{L}_{\text{bag}}=-\left[Y\log\hat{Y}+(1-Y)\log(1-\hat{Y})\right]. (12) Finally, the overall loss function is defined by the following combination: \displaystyle\mathcal{L}_{\text{AINet}}=\mathcal{L}_{\text{bag}}+\mathcal{L}_{\text{region}}+\mathcal{L}_{\text{MSE}}. (13) Table 1 : Quantitative results of AINet compared with representative MIL baselines on TCGA-BRCA and TCGA-ESCA datasets. Methods TCGA-BRCA TCGA-ESCA Accuracy AUC F1 Accuracy AUC F1 ResNet18 ABMIL 15 0.862 \pm 0.025 0.882 \pm 0.033 0.915 \pm 0.015 0.815 \pm 0.129 0.882 \pm 0.126 0.852 \pm 0.101 DSMIL 2 0.823 \pm 0.021 0.820 \pm 0.033 0.892 \pm 0.014 0.712 \pm 0.085 0.823 \pm 0.078 0.773 \pm 0.074 CLAM 25 0.865 \pm 0.020 0.890 \pm 0.029 0.917 \pm 0.014 0.821 \pm 0.091 0.916 \pm 0.052 0.844 \pm 0.085 TransMIL 31 0.847 \pm 0.021 0.846 \pm 0.036 0.905 \pm 0.013 0.815 \pm 0.081 0.878 \pm 0.086 0.847 \pm 0.065 DTFD-MaxM 46 0.816 \pm 0.023 0.810 \pm 0.033 0.885 \pm 0.013 0.821 \pm 0.067 0.914 \pm 0.075 0.851 \pm 0.057 DTFD-AFS 46 0.823 \pm 0.028 0.824 \pm 0.034 0.892 \pm 0.017 0.865 \pm 0.074 0.912 \pm 0.063 0.881 \pm 0.069 MHIM-ABMIL 37 0.858 \pm 0.004 0.883 \pm 0.020 0.912 \pm 0.001 0.828 \pm 0.119 0.911 \pm 0.098 0.866 \pm 0.085 MHIM-Trans 37 0.848 \pm 0.022 0.872 \pm 0.013 0.905 \pm 0.012 0.853 \pm 0.061 0.911 \pm 0.044 0.879 \pm 0.049 ILRA 41 0.857 \pm 0.035 0.886 \pm 0.026 0.908 \pm 0.027 0.803 \pm 0.136 0.896 \pm 0.097 0.838 \pm 0.116 SSMMIL 7 0.863 \pm 0.006 0.896 \pm 0.032 0.916 \pm 0.005 0.783 \pm 0.111 0.892 \pm 0.081 0.823 \pm 0.096 ACMIL 48 0.869 \pm 0.017 0.900 \pm 0.019 0.920 \pm 0.009 0.866 \pm 0.051 0.932 \pm 0.044 0.893 \pm 0.037 WIKG 18 0.863 \pm 0.018 0.887 \pm 0.030 0.914 \pm 0.013 0.770 \pm 0.131 0.874 \pm 0.106 0.793 \pm 0.121 MambaMIL 44 0.868 \pm 0.017 0.878 \pm 0.032 0.917 \pm 0.009 0.860 \pm 0.063 0.944 \pm 0.050 0.886 \pm 0.044 PAMoE 40 0.853 \pm 0.017 0.854 \pm 0.034 0.908 \pm 0.011 0.800 \pm 0.098 0.897 \pm 0.090 0.836 \pm 0.086 AINet (Ours) 0.878 \pm 0.016 0.901 \pm 0.028 0.924 \pm 0.011 0.873 \pm 0.098 0.946 \pm 0.046 0.894 \pm 0.080 PLIP ABMIL 15 0.870 \pm 0.019 0.900 \pm 0.010 0.918 \pm 0.012 0.923 \pm 0.042 0.976 \pm 0.029 0.934 \pm 0.036 DSMIL 2 0.856 \pm 0.019 0.895 \pm 0.013 0.911 \pm 0.012 0.904 \pm 0.067 0.961 \pm 0.037 0.919 \pm 0.057 CLAM 25 0.874 \pm 0.021 0.895 \pm 0.013 0.922 \pm 0.012 0.917 \pm 0.060 0.973 \pm 0.018 0.929 \pm 0.050 TransMIL 31 0.859 \pm 0.026 0.888 \pm 0.019 0.912 \pm 0.017 0.904 \pm 0.062 0.978 \pm 0.018 0.920 \pm 0.051 DTFD-MaxM 46 0.862 \pm 0.019 0.861 \pm 0.014 0.916 \pm 0.010 0.911 \pm 0.051 0.981 \pm 0.020 0.927 \pm 0.039 DTFD-AFS 46 0.840 \pm 0.012 0.870 \pm 0.011 0.901 \pm 0.010 0.929 \pm 0.042 0.978 \pm 0.024 0.940 \pm 0.035 MHIM-ABMIL 37 0.872 \pm 0.015 0.902 \pm 0.023 0.920 \pm 0.010 0.904 \pm 0.049 0.979 \pm 0.022 0.920 \pm 0.038 MHIM-Trans 37 0.859 \pm 0.026 0.888 \pm 0.019 0.912 \pm 0.017 0.880 \pm 0.150 0.947 \pm 0.085 0.890 \pm 0.142 ILRA 41 0.864 \pm 0.022 0.896 \pm 0.017 0.916 \pm 0.014 0.892 \pm 0.105 0.965 \pm 0.057 0.900 \pm 0.103 SSMMIL 7 0.869 \pm 0.012 0.900 \pm 0.010 0.919 \pm 0.010 0.917 \pm 0.072 0.975 \pm 0.024 0.930 \pm 0.059 ACMIL 48 0.869 \pm 0.023 0.890 \pm 0.038 0.920 \pm 0.015 0.929 \pm 0.042 0.978 \pm 0.024 0.940 \pm 0.035 WIKG 18 0.866 \pm 0.018 0.894 \pm 0.018 0.918 \pm 0.011 0.892 \pm 0.093 0.949 \pm 0.063 0.900 \pm 0.093 MambaMIL 44 0.862 \pm 0.021 0.887 \pm 0.022 0.916 \pm 0.013 0.891 \pm 0.053 0.977 \pm 0.018 0.910 \pm 0.041 PAMoE 40 0.869 \pm 0.015 0.899 \pm 0.006 0.919 \pm 0.009 0.892 \pm 0.087 0.955 \pm 0.071 0.911 \pm 0.066 AINet (Ours) 0.880 \pm 0.021 0.909 \pm 0.018 0.926 \pm 0.014 0.937 \pm 0.080 0.982 \pm 0.039 0.945 \pm 0.071 4 Experiments To comprehensively evaluate our AINet, we integrate it into representative MIL predictors and conduct extensive experiments on cancer prediction tasks. We also perform ablation studies to assess the contributions of key components, including the DAM and ARC modules. Furthermore, we examine the effects of the AINet hyperparameter settings. Table 2 : Quantitative results of AINet compared with representative MIL baselines on the BRACS dataset. Methods ResNet18 PLIP Accuracy AUC F1 Accuracy AUC F1 ABMIL 15 0.691 \pm 0.041 0.816 \pm 0.020 0.604 \pm 0.055 0.754 \pm 0.042 0.875 \pm 0.036 0.705 \pm 0.044 DSMIL 2 0.657 \pm 0.026 0.795 \pm 0.021 0.555 \pm 0.016 0.717 \pm 0.044 0.847 \pm 0.039 0.629 \pm 0.041 CLAM 25 0.689 \pm 0.036 0.830 \pm 0.028 0.601 \pm 0.024 0.742 \pm 0.054 0.871 \pm 0.023 0.692 \pm 0.043 TransMIL 31 0.706 \pm 0.044 0.799 \pm 0.035 0.596 \pm 0.036 0.709 \pm 0.032 0.851 \pm 0.022 0.640 \pm 0.059 DTFD-MaxM 46 0.698 \pm 0.030 0.815 \pm 0.062 0.610 \pm 0.044 0.724 \pm 0.054 0.838 \pm 0.063 0.617 \pm 0.075 DTFD-AFS 46 0.676 \pm 0.056 0.823 \pm 0.039 0.614 \pm 0.054 0.759 \pm 0.025 0.872 \pm 0.034 0.669 \pm 0.037 MHIM-ABMIL 37 0.715 \pm 0.035 0.851 \pm 0.033 0.624 \pm 0.039 0.765 \pm 0.034 0.881 \pm 0.038 0.709 \pm 0.055 MHIM-Trans 37 0.689 \pm 0.026 0.833 \pm 0.028 0.613 \pm 0.016 0.717 \pm 0.046 0.859 \pm 0.028 0.669 \pm 0.045 ILRA 41 0.702 \pm 0.037 0.851 \pm 0.043 0.642 \pm 0.052 0.717 \pm 0.025 0.852 \pm 0.029 0.622 \pm 0.039 SSMMIL 7 0.721 \pm 0.037 0.834 \pm 0.028 0.620 \pm 0.048 0.723 \pm 0.027 0.867 \pm 0.031 0.679 \pm 0.011 ACMIL 48 0.698 \pm 0.041 0.849 \pm 0.044 0.633 \pm 0.044 0.767 \pm 0.040 0.872 \pm 0.035 0.710 \pm 0.029 WIKG 18 0.706 \pm 0.053 0.837 \pm 0.030 0.637 \pm 0.055 0.724 \pm 0.032 0.858 \pm 0.018 0.662 \pm 0.049 MambaMIL 44 0.706 \pm 0.066 0.834 \pm 0.039 0.636 \pm 0.071 0.736 \pm 0.049 0.875 \pm 0.038 0.670 \pm 0.069 PAMoE 40 0.661 \pm 0.057 0.800 \pm 0.046 0.593 \pm 0.035 0.730 \pm 0.032 0.850 \pm 0.023 0.677 \pm 0.029 AINet (Ours) 0.745 \pm 0.060 0.864 \pm 0.051 0.687 \pm 0.076 0.771 \pm 0.040 0.890 \pm 0.032 0.723 \pm 0.057 4.1 Datasets and Implementation Details We evaluate the performance of AINet on three public benchmarks and employ two widely used feature extractors: ResNet-18 12 pretrained on ImageNet, and PLIP 14 , a foundation model pretrained on large-scale multimodal pathology data. In brief, the used datasets are summarized as follows: (1) TCGA Breast Cancer Dataset (BRCA). This dataset comprises 952 WSIs from the BRCA project, including 749 invasive ductal carcinoma (IDC) and 203 invasive lobular carcinoma (ILC) cases. Following prior works 23 , the dataset is divided into 65% for training, 10% for validation, and 25% for testing. (2) TCGA Esophageal Cancer Dataset (ESCA). ESCA contains 156 diagnostic WSIs, including 90 squamous cell carcinoma and 66 adenocarcinoma cases 39 . Data are divided into training, validation, and test sets with a 3:1:1 ratio, following 55 . (3) Breast Carcinoma Subtyping Dataset (BRACS). BRACS consists of 265 benign, 89 atypical, and 193 malignant breast tumors 3 . Following the official data split 3 ; 48 , 395 WSIs are used for training, 65 for validation, and 87 for testing. All WSIs are preprocessed following the CLAM 25 pipeline to extract non-background tissue 256 \times 256 patches at 10× magnification. The model is optimized using bag-level cross-entropy loss and the AdamW optimizer 24 , with a weight decay of 1e-5 and an initial learning rate of 1e-4 . We train the AINet model for 100 epochs with a batch size of 1 ( i.e., one bag per batch) on a single NVIDIA RTX 4090 GPU. 4.2 Baseline and Evaluation Metrics Baseline. We compare our AINet with 14 representative MIL methods, including attention-based approaches (ABMIL 15 , CLAM 25 , DSMIL 2 , MHIM-ABMIL 37 , ACMIL 48 , DTFD-MaxM 46 , DTFD-AFS 46 ), Transformer-based methods (TransMIL 31 , MHIM-TransMIL 37 , ILRA 41 , PAMoE 40 ), graph-based approaches WIKG 18 , and Mamba-based methods (SSMMIL 7 , MambaMIL 44 ). All baselines are implemented using their official repositories. Evaluation Metrics. Following prior works 2 ; 20 ; 52 , we evaluate prediction performance using standard metrics, including the area under the receiver operating characteristic curve (AUC), accuracy, and F1 score, with a fixed threshold of 0.5. To eliminate evaluation bias, we follow the 5-fold cross-validation setting adopted in previous works 37 ; 44 ; 45 . In each fold, training and validation sets are divided according to predefined dataset ratios for hyperparameter tuning. The final results are reported as the mean and standard deviation across all five test folds. Table 3 : Validation on the TCGA-ESCA dataset. The red denotes performance improvement, while green indicates reduced complexity. Methods ResNet18 PLIP FLOPs (G) #Param. (M) Accuracy AUC F1 Accuracy AUC F1 TransMIL 31 0.815 \pm 0.081 0.878 \pm 0.086 0.847 \pm 0.065 0.904 \pm 0.062 0.988 \pm 0.018 0.920 \pm 0.051 84.22 0.68 +AINet 0.822 \pm 0.121 (0.7) 0.889 \pm 0.116 (1.1) 0.8438 \pm 0.108 (0.4) 0.916 \pm 0.054 (1.2) 0.993 \pm 0.006 (0.5) 0.923 \pm 0.052 (0.3) 22.30 (61.92) 0.19 (0.49) ILRA 41 0.803 \pm 0.136 0.896 \pm 0.097 0.838 \pm 0.116 0.892 \pm 0.105 0.965 \pm 0.057 0.900 \pm 0.103 123.05 1.85 +AINet 0.866 \pm 0.098 (6.3) 0.915 \pm 0.091 (1.9) 0.882 \pm 0.090 (4.4) 0.905 \pm 0.099 (1.3) 0.967 \pm 0.054 (0.2) 0.918 \pm 0.083 (1.8) 21.86 (101.19) 0.19 (1.66) WIKG 18 0.770 \pm 0.131 0.874 \pm 0.106 0.793 \pm 0.121 0.892 \pm 0.093 0.949 \pm 0.063 0.900 \pm 0.093 49.80 0.43 +AINet 0.827 \pm 0.066 (5.7) 0.906 \pm 0.070 (3.2) 0.850 \pm 0.057 (5.7) 0.943 \pm 0.068 (5.1) 0.974 \pm 0.036 (2.5) 0.949 \pm 0.061 (4.9) 21.88 (27.92) 0.18 (0.25) SSMMIL 7 0.783 \pm 0.111 0.892 \pm 0.081 0.823 \pm 0.096 0.917 \pm 0.072 0.985 \pm 0.024 0.930 \pm 0.059 92.14 0.79 +AINet 0.828 \pm 0.122 (4.5) 0.903 \pm 0.093 (1.1) 0.865 \pm 0.091 (4.2) 0.930 \pm 0.067 (1.3) 0.985 \pm 0.033 (0.0) 0.938 \pm 0.060 (0.8) 21.74 (70.40) 0.17 (0.62) 4.3 Comparison with State-of-the-Art Methods The comparison results on two benchmark WSI datasets are summarized in Table 1 . We can find that our AINet consistently outperforms all baselines across all evaluation metrics. Specifically, averaged across the TCGA-BRCA and TCGA-ESCA datasets, AINet surpasses bag-level methods such as TransMIL 31 , MambaMIL 44 , and PAMoE 40 by 3.6%, 2.2%, and 3.9% in accuracy, and by 3.7% and 1.3%, and 3.3%in AUC, respectively. Compared with attention-based instance selection methods, including CLAM 25 and ACMIL 48 , AINet achieves average gains of 2.3% and 0.88% in accuracy, and 1.6% and 0.95% in AUC, respectively. In addition, AINet outperforms the pseudo-bag-based DTFD 46 , achieving average improvements of 3.4%, 4.1%, and 2.3% in accuracy, AUC, and F1, respectively. These superior performances largely stem from the proposed anchor instance learning, which provides high-quality and discriminative inputs for the MIL predictor. In contrast, instance selection and fusion methods are inevitably affected by regional heterogeneity, thereby limiting their representational quality. To further validate AINet on multi-class classification tasks, we evaluate it on the BRACS dataset. As listed in Table 2 , AINet achieves consistent performance gains, surpassing ILRA 41 , SSMMIL 7 , and WIKG 18 by 4.9%, 3.6%, and 4.3% in average accuracy, respectively. Furthermore, although MHIM 37 leverages knowledge distillation to identify informative instances and achieves a relatively higher AUC, its accuracy and F1 drop by 3.6% and 5.1%, respectively, due to the sparse discriminative information in BRACS. In contrast, AINet effectively alleviates this issue through dual-level anchor mining and anchor-guided region correction, enabling concise yet accurate representation of such complex instance distributions, and achieving improvements of 1.8%, 1.1%, and 3.9% in accuracy, AUC, and F1, respectively. Notably, our AINet achieves significant reductions in FLOPs and the number of parameters, as shown in Figure 1 . 4.4 AINet Generalizablity To further demonstrate the generalization and robustness of the proposed AINet, we integrate it into four representative MIL predictors on the TCGA-ESCA dataset. As reported in Table 3 , AINet could improve the performance of all MIL models while saving computational resources. When combined with AINet, the graph-based WIKG 18 and the SSM-based SSMMIL 7 achieve average accuracy gains of 5.4% and 2.9%, and F1 improvements of 5.3% and 2.5%, respectively, while reducing FLOPs by 57% and 76.4%. Moreover, through cross-region interaction while eliminating redundancy, AINet reduces FLOPs by 73.5% and 82.08%, and parameters by 72.05% and 89.75%, when compared to the multi-head attention–based TransMIL 31 and ILRA 41 , respectively. Table 4 : Ablation study of the key components on the TCGA-ESCA and BRACS datasets with ResNet18 features. The gray highlights our results. We set L=4 regions, select the top k=20\% instances as AIs, and apply a masking ratio of r=90\% within each region. Model DAM ACF ARC TCGA-ESCA BRACS Accuracy AUC F1 Accuracy AUC F1 Baseline ✗ ✗ ✗ 0.777 \pm 0.134 0.866 \pm 0.095 0.808 \pm 0.114 0.691 \pm 0.056 0.809 \pm 0.054 0.602 \pm 0.073 w DAM ✓ ✗ ✗ 0.809 \pm 0.117 0.886 \pm 0.128 0.841 \pm 0.095 0.713 \pm 0.047 0.835 \pm 0.040 0.594 \pm 0.061 w DAM+MHA ✓ ✗ ✗ 0.839 \pm 0.088 0.935 \pm 0.064 0.867 \pm 0.069 0.719 \pm 0.061 0.845 \pm 0.041 0.624 \pm 0.063 w DAM+ACF ✓ ✓ ✗ 0.840 \pm 0.108 0.938 \pm 0.073 0.868 \pm 0.083 0.732 \pm 0.039 0.844 \pm 0.036 0.631 \pm 0.045 w DAM+ARC (AINet) ✓ ✓ ✓ 0.873 \pm 0.098 0.946 \pm 0.046 0.894 \pm 0.080 0.737 \pm 0.025 0.854 \pm 0.046 0.638 \pm 0.040 Table 5 : Ablation study of the proposed DAM on the TCGA-ESCA and BRACS datasets using ResNet18 features. We set L=4 regions, select the top k=20\% instances as AIs, and apply a masking ratio of r=90\% within each region. Model Bag-level Region-level TCGA-ESCA BRACS Accuracy AUC F1 Accuracy AUC F1 Baseline ✗ ✗ 0.777 \pm 0.134 0.866 \pm 0.095 0.808 \pm 0.114 0.691 \pm 0.056 0.809 \pm 0.054 0.602 \pm 0.073 w Attention ✗ ✗ 0.816 \pm 0.156 0.890 \pm 0.109 0.839 \pm 0.131 0.713 \pm 0.043 0.837 \pm 0.041 0.638 \pm 0.054 w Max-pooling ✗ ✗ 0.808 \pm 0.093 0.918 \pm 0.093 0.842 \pm 0.067 0.681 \pm 0.040 0.820 \pm 0.058 0.593 \pm 0.057 w Bag-similar ✓ ✗ 0.828 \pm 0.133 0.923 \pm 0.075 0.862 \pm 0.099 0.687 \pm 0.048 0.816 \pm 0.040 0.575 \pm 0.051 w Region-similar ✗ ✓ 0.834 \pm 0.140 0.920 \pm 0.069 0.869 \pm 0.107 0.728 \pm 0.044 0.835 \pm 0.047 0.619 \pm 0.059 w DAM ✓ ✓ 0.873 \pm 0.098 0.946 \pm 0.046 0.894 \pm 0.080 0.737 \pm 0.025 0.854 \pm 0.046 0.638 \pm 0.040 4.5 Ablation Studies Validation on Basic Components. We conduct ablation experiments to evaluate the contribution of the key components in AINet, including DAM and ARC, to the overall performance. As a baseline, both DAM and ARC modules are removed, and regional instances are directly fed into an attention-based predictor for bag-level classification. To assess the effectiveness of DAM, we compare it against several alternative instance selection strategies, as summarized in Table 5 . Moreover, to examine the role of ARC in alleviating regional heterogeneity and enhancing cross-region interaction, we design four variants: w DAM, w DAM+MHA, w DAM+ACF, and w DAM+ARC (AINet), where w DAM+others denotes integrating the selected AIs into regions using different fusion mechanisms. Among them, w DAM+ACF does not use the neighbor region for interaction during correction. The quantitative results in Table 4 demonstrate that our complete AINet substantially outperforms its incomplete variants. Specifically, the w DAM effectively identifies representative and discriminative instances through a local-global selection mechanism, yielding average gains of 2.7% in accuracy and 2.3% in AUC over the Baseline, respectively. Moreover, the AI-guided fusion ( w DAM+ACF) further enhances regional representation quality, achieving 2.5%, 3.05%, and 3.2% improvements in accuracy, AUC, and F1, respectively, compared to w DAM. Although using informative AIs increases accuracy by 1.3% on the BRACS dataset, the vanilla multi-head attention fusion ( w DAM+MHA) still underperforms our w DAM+ACF due to the lack of explicit AIs guidance. Notably, the proposed w DAM+ARC effectively mitigates regional heterogeneity and enhances cross-region interactions, resulting in significant improvements of 7.1%, 6.25%, and 6.1% in accuracy, AUC, and F1 over the Baseline. DAM Variants. To further assess the effectiveness of the proposed DAM, Table 5 reports quantitative comparisons with several alternative instance selection strategies, including attention-based weighting ( w Attention), max-pooling ( w Max-Pooling), bag-level similarity weighting ( w Bag-similar, using \cos(f_{l}^{z},f_{\text{bag}}) in Eq. 3 ), and region-level similarity weighting ( w Region-similar, using \cos(f_{l}^{z},f_{\text{reg}}^{l}) in Eq. 3 ). Our DAM consistently outperforms all competing variants. Notably, selecting informative instances only at the bag-level leads to decreased accuracy: w Bag-similar (-2.6%), w Max-pooling (-3.65%), and w Attention (-1.65%) compared with w Region-similar (0.781). In contrast, w DAM achieves gains of 2.4%, 2.25%, and 2.2% in Accuracy, AUC, and F1, respectively, indicating that our DAM effectively identifies representative and discriminative instances, leading to better bag predictions. Hyperparameter Analysis. To analyze the influence of the number of AIs ( T=k\%\times N ) and the mask ratio ( r ), we conduct extensive experiments on AINet. As illustrated in Figure 4 , appropriately setting k\% and r\% significantly enhances classification performance. This improvement primarily arises from retaining informative AIs, which alleviates tumor sparsity and regional heterogeneity, thereby yielding gains of 2.9%, 7.8%, and 5.6% gain in accuracy, AUC, and F1 over the k=0\% setting. Moreover, incorporating the masking scheme in ARC further enhances performance, with 2.3% and 3.6% improvements in accuracy and F1, respectively, compared with the r=10\% setting. Figure 4 : Hyperparameter effects on the TCGA-ESCA dataset. 5 Conclusion In this work, we proposed AINet, a novel MIL framework for WSI analysis. AINet introduces the concept of AIs, a compact set of informative instances that are locally representative and globally discriminative, to mitigate the regional heterogeneity. The DAM module identifies AIs by jointly considering instance similarities with both local region and global bag embeddings, while the ARC module leverages AIs to explicitly guide interactions across heterogeneous regions, correcting the non-discriminative patterns. Extensive experiments on widely used benchmark datasets demonstrate that AINet consistently outperforms SOTA MIL methods with fewer FLOPs and parameters, and can be seamlessly integrated into other predictors.