Background
Accurate and reliable multiclass brain tumor classification from magnetic resonance imaging (MRI) remains challenging because of substantial variation in tumor morphology, overlapping imaging characteristics, and uncertainty in model predictions. This study aimed to develop and evaluate an uncertainty-aware hybrid CNN–Transformer framework that integrates complementary local and global image representations while incorporating leakage-aware evaluation, calibration analysis, and cross-dataset testing.
Methods
A hybrid architecture combining EfficientNetV2-B0 and Vision Transformer (ViT) representations was developed using cross-modal attention and adaptive feature-level fusion. Predictive uncertainty was assessed using Monte Carlo (MC) Dropout, and probability calibration was evaluated using Expected Calibration Error (ECE) and negative log-likelihood. The primary Kaggle/Masoud brain tumor MRI dataset was screened for exact duplicates and near-duplicate images using cryptographic hashing and perceptual-similarity-based grouping. Because explicit patient identifiers were unavailable, these similarity-derived groups were used to separate related-looking images across data partitions; this procedure does not establish confirmed patient-level independence. Performance was assessed using discrimination, classification, calibration, and uncertainty metrics, with additional evaluation on public brain MRI datasets where applicable.
Findings
On the primary test set, the proposed Hybrid Ensemble achieved 98.10% accuracy (95% CI, 97.37–98.76), with an F1-score of 0.9810 and macro-AUC of 0.9988. It outperformed ViT (97.46% accuracy) and EfficientNetV2-B0 (96.76% accuracy), as well as conventional output-level ensembles (97.08–97.86%). Across ten group-wise folds, the Hybrid Ensemble achieved a mean F1-score of 98.19% (SD, 0.16%) and significantly outperformed EfficientNetV2-B0 (Wilcoxon signed-rank test, p = 6.03 ×10⁻¹¹) and ViT (p = 1.22 ×10⁻⁶). On BraTS 2021, accuracy was 97.34% and F1-score was 0.9673. MC Dropout reduced ECE from 0.031 to 0.017. Correct predictions showed higher confidence and lower predictive entropy than misclassified predictions (maximum softmax confidence, 0.983 vs 0.785; entropy, 0.058 vs 0.536; Kolmogorov–Smirnov statistic, 0.803; p < 0.001).
Interpretation
The proposed hybrid framework combines adaptive CNN–Transformer feature fusion with uncertainty-aware inference and demonstrated high discriminative performance, improved calibration, and consistent performance across public datasets. However, these findings represent methodological validation on public 2D MRI datasets rather than evidence of clinical effectiveness. In particular, the absence of confirmed patient identifiers in the primary dataset limits certainty regarding patient-independent generalization. Prospective, multi-institutional validation using standardized clinical MRI data and expert-annotated localization is required before clinical deployment.