IDH1 and astrocytoma (excluding glioblastoma): In order to analyze performance for individual classes we plot in Fig. 3 the confusion matrix of the best performing model (ResNet50-ViT model), concluding that training with the categorical cross-entropy loss function weighted by the class weights has solved the imbalanced data issue, with almost perfect classification for all classes (including the minority classes, such as necrosis), except the IDH-mutant, 1p/19q codeleted (oligodendroglioma) class which is in 16% of cases misclassified as IDH-mutant (astrocytoma).