Weakly Supervised Learning Based Prediction of BRAF Mutation from Thyroid Fine Needle Aspiration Cytology
Background BRAF mutation is a clinically significant genetic alteration in thyroid carcinoma, with major implications for diagnosis, prognosis, and treatment selection. While conventional cytology provides morphologic assessment, it cannot determine mutation status. We develop an AI model to predict BRAF mutation directly from digital cytology images.
Materials A total of 263 thyroid fine needle aspiration (FNA) cytology whole slide images (WSIs) were collected from two institutions and digitized with extended z-stacking to preserve three-dimensional nuclear and cytoplasmic features characteristic of cytology specimens. The cohort comprised 245 BRAF-positive and 18 BRAF-negative cases. Slides were prepared using two liquid-based cytology methods: 177 (67.3%) with ThinPrep and 86(32.7%) with EasyPrep. BRAF-negative cases were predominantly from ThinPrep preparations (15 of 18), with only 3 BRAF-negative cases from EasyPrep. The dataset was partitioned into 5-fold cross-validation (CV) splits, with each fold consisting of 199 training, 32 validation, and 32 test slides, stratified for binary classification of BRAF mutational status.
Methods ROI segmentation followed by a non-overlapping 256x256 patch extraction from each WSI were performed at 20x magnification for the pre-processing steps. Patch-level features were extracted using 4 vision foundation models (VFMs) to identify the most suitable encoder for cytology-based BRAF classification as shown in Table 2 and notably, CytoFM, a cytology-specific pretrained model was included. We employed Clustering-constrained Attention Multiple Instance Learning (CLAM) [1] for weakly supervised slide-level classification. We erformed Bayesian hyperparameter optimization to search for the optimal parameter, with the search space including CLAM architecture variable (single- or multi-branch), learning rate, learning rate scheduler, dropout rate, weight decay, bag-level loss weight, patch dropout, feature-level Gaussian noise, and SMOTE-based minority class oversampling. Given the severe class imbalance in our dataset, addressing this disparity was critical to prevent the model from overwhelmingly favoring the majority class. We utilized a feature interpolation strategy for SMOTE, which adds the feature of similar tissue patches from different negative cases to create hybrid patches. The optimization objective was the mean test AUROC across 5-fold CV. Performance metrics including AUROC, accuracy, sensitivity, specificity, precision, and F1-score were computed per fold, and 95% confidence intervals were derived from the fold-level distributions.
Results Table 2 shows the optimal parameter based on the 5-fold CV of mean test AUROC and as for the feature extractor, CytoFM showed significantly better performance than the other VFMs, outperforming UNI2-h by 0.069 in respect to the best AUROC without the overlap in the 95% CI value. The best model based on the highest mean AUROC from the 5-fold CV achieved an AUROC of 0.784 for BRAF mutation rediction as shown in Fig. 3 and Table 3 shows decent overall performance, including an accuracy of 0.750 and a sensitivity of 0.771, suggesting that assessing BRAF mutation status to a clinically meaningful extent is feasible using thyroid FNA slides.
Conclusion AI-based cytology analysis shows significant potential for predicting BRAF mutation status non-invasively, serving as a rapid riage tool that could reduce unnecessary molecular testing in indeterminate thyroid FNA cases. While limited by dataset size and a severe class imbalance, the robust performance of cytology-specific models in this study proves the viability of this approach. Future multi-institutional and prospective studies are required to validate these findings and confirm generalizability before clinical implementation.