Results
A total of 254 patients from two independent cohorts were included in our study based on the inclusion and exclusion criteria. Specifically, 152 patients from the CUCH cohort were randomly assigned to a training set and an internal test set, while 102 patients from the TCGA cohort served as an external test set. Detailed clinicopathological characteristics of the patients across the training, internal test, and external test sets are presented in Table 1 . In the training set, 62 (50.8%) of patients were ER and PR positive, 12 (9.8%) were HER2 positive, and 48 (39.4%) were triple-negative. In the internal test set, 16 (53.4%) of patients were ER and PR positive, five (16.6%) were HER2 positive, and nine (30.0%) were triple-negative. In the external testing set, 70 (68.6%) of patients were ER and PR positive, 11 (10.8%) were HER2 positive, and 18 (17.6%) were triple-negative. In the training set, 29 patients had BRCA PV, with 17 (58.6%) for BRCA1 and 12 (41.3%) for BRCA2 . The internal test set included seven patients with BRCA PV, comprising 4 (57.1%) with BRCA1 and three (42.9%) with BRCA2 . In the external test set, among 26 patients with BRCA PV, 13 (50.0%) had BRCA1 , 11 (42.3%) had BRCA2 , and two (7.7%) had both.

Notes:

ER, estrogen receptor; PR, progesterone receptor; HER2, human epidermal growth factor receptor 2; HR, hormone receptor.

A segmentation network was developed to accurately distinguish tumor regions from WSIs. This model demonstrated high efficacy, achieving an AUC of 0.960 (95% CI [0.959–0.961]). The accuracy, sensitivity, and specificity were 0.888 (95% CI [0.887–0.890]), 0.859 (95% CI [0.856–0.861]), and 0.908 (95% CI [0.906–0.909]), respectively. Compared with three pathologists of varying experience (junior, medium, and senior), the model’s performance was almost equivalent to that of a medium-level pathologist ( Figure 2A ). The confusion matrix shows specific performance metrics of the segmentation model. Among tumor region samples, the model correctly identified 86% as tumor, while misclassifying 14% as non-tumor. Among non-tumor region samples, 91% were correctly identified as non-tumor, with 9% misclassified as tumor ( Figure 2B ). Three original WSIs and their corresponding annotation maps are illustrated in Figure 2C , where the red areas in the maps denote the tumor regions identified by the model. The alignment of the model-generated annotation maps with the tumor regions in the original images validates the model’s accuracy.

The BiAMIL model was developed by first inputting normalized tiles into the ResNet 34 model to extract 1,000-dimensional features. These features were then aggregated using a Bi-directional self-attention mechanism approach. Subsequently, the aggregated feature matrix was fed into a multilayer perceptron (MLP) classifier to predict the probability of BRCA gene mutation status for each WSI ( Figure 3 ). BiAMIL achieved AUC values of 0.819 (95% CI [0.673–0.965]) in the internal test set ( Figure 4A ), and 0.817 (95% CI [0.712–0.923]) in the external test set ( Figure 4B ). The five-fold cross-validation results for the BiAMIL model on the training set are displayed in Table S1 . The model was compared with the ResNet 34 by Wang et al. (2021) . ResNet 34 achieved AUC values of 0.783 (95% CI [0.624–0.941]) the internal test set ( Figure 4C ), and 0.684 (95% CI [0.559–0.810]) in the external test sets ( Figure 4D ). The five-fold cross-validation results for the ResNet 34 model on the training set are shown in Table S2 . In the internal test and external test sets, BiAMIL outperformed the ResNet 34 model in accuracy, sensitivity, specificity, positive predictive value (PPV), negative predictive value (NPV), and F1 score ( Figs. 4E and 4F ). Due to hormone receptor-positive and triple-negative breast cancer accounting for 80% of breast cancer cases and the high occurrence of BRCA1 in triple-negative breast cancer, a subgroup analysis of BiAMIL’s performance in these subtypes was conducted, with results shown in Table 2 . These findings demonstrate that BiAMIL is a more accurate and reliable method for estimating the BRCA status compared to the traditional ResNet 34 model.

Note:

AUC, area under the curve; PPV, positive predictive value; NPV, negative predictive value.

To explore the relationship between pathological tissue features and BRCA gene status, a post-hoc explanation of the BiAMIL model was conducted using the Class Activation Mapping (CAM) algorithm. The model generated heatmaps for tiles with high attention scores, indicating that tumor areas, including tumor cells and tumor-infiltrating lymphocytes (TILs), are significant contributors to the model’s predictions, while the stroma contributes less ( Figs. 5A and 5B ). Tiles predicted as BRCA PV exhibited a denser number of TILs compared to those predicted as BRCA WT, as evidenced by the median percentage of TILs being higher in the BRCA PV group than in the BRCA WT group (25.8% vs . 14.1%) ( Figure 5C ). The effectiveness of the BiAMIL model in distinguishing BRCA gene mutation status was further assessed using the t-SNE algorithm, revealing a clear separation between the BRCA PV and BRCA WT groups ( Figure 5D ).

To further explore the relationship between tumor cell features and BRCA gene status, the Qupath software was used to automatically identify tumor cells in regions highly influenced by the BiAML model. Pathologists reviewed and refined the delineation of tumor cells in each WSI, extracting features of cell morphology. The cells were then clustered into six groups using the k -means, with each cluster represented by a different color ( Figure 6A ). A correlation analysis was constructed between the clusters and cell morphological features, illustrating the relationship between each cluster (Cluster 0 to Cluster 5) and the cell morphological features. This analysis indicated a strong correlation between Cluster 2 and the morphological features of tumor cells and nuclei ( Figure 6B ). Subsequent analysis of the differences in tumor cell and nuclear morphological features between the BRCA PV and WT groups within Cluster 2 revealed that, compare to the BRCA WT group, the BRCA PV group exhibited larger tumor cell areas (501.75 vs . 461.50, P = 1.41e−13), larger nuclear areas (180.00 vs . 168.75, P = 3.13e−09), and higher nuclear cell area ratio (0.36 vs . 0.34, P = 5.73e−11) ( Figs. 6C – 6E ).