# AI Approaches in Computer-Aided Diagnosis and Recognition of Neoplastic Changes in MRI Brain Images
## 3 Results  
### Classification Results  
While researching, various types of networks were trained, including different pre-trained architectures, with varying results. Some models were hard or even impossible to train on the dataset, while others achieved excellent results in a few first attempts. For every network type described in Section 2.4, the best prototype in terms of accuracy was chosen, and the results were gathered in Table 1. As the goal of the work was to compare the raw capabilities of the discussed architectures, no other parameters were taken into account while choosing top models. Although, along with the score achieved by the architecture, there is also a count of parameters the network had, as the algorithm's complexity is an essential factor while productizing the solution.  
The outcomes show that all tested architectures were able to provide classification accuracy close to 90%, which is comparable to the state-of-the-art solutions [11, 13]. The pre-trained ViT model proved to be the best out of the tested architectures, but with a score only slightly better than a simple ViT or a pre-trained Xception model, at the cost of tremendous complexity, as shown in Table 1. This high complexity of the architecture can be explained by its generality; a Transformer is less suited to processing images than a CNN, however it can benefit more from larger datasets due to better data generalization. There are also smaller versions of the ViT available; the one considered here has 32 encoder blocks, but there is also one with 16 blocks, although, during this research, it turned out to be less accurate than its bigger version. Additional insights into classification results, along with confusion matrices for the models, can be found in Appendix A and Figures A5 and A6.  
Noteworthy is the fact that the simple ViT demonstrated accuracy comparable with the Xception-based model, while not using many more parameters than a four-layer convolutional network. This property might make it a great computer vision algorithm for embedded devices, combining efficiency with relatively low demand for computing resources.  
Regarding ease of training, the simple convolution model was the most straightforward to train. Reasonable results could have been obtained using almost any training parameters or layers layout, provided the network was kept relatively simple with some generalization mechanism (dropout, pooling, label smoothing). The Xception network was not much worse, although it required careful learning rate selection and many more resources. Only some types of CNNs worked so well during the research; models based on different pre-trained architectures were tried too, and some of them resulted in inferior outcomes or did not even manage to train. A few examples of such networks might be a VGG family or a ResNet family, which delivered results far from the top models.  
Vision Transformers were more challenging to train than convolutional networks; to obtain a model with fair outcomes, numerous experiments needed to run. ViTs required more extensive generalization methods, slower learning, and bigger batches of images, increasing the training process's memory complexity. In addition, the size of the input patches significantly influences the network's performance, and it is hard to find the right heuristic to tell which size will yield the best results. Smaller patches allow the model to  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Network Type** & **Accuracy [\%]** & **Number of Parameters** \\ \hline Simple Conv Net & 88.55 & 2,101,412 \\ Pre-trained Xception & 90.38 & 21,912,620 \\ Simple Vision Transformer & 90.18 & 3,466,564 \\ Pre-trained Vision Transformer & 92.30 & 303,734,276 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Accuracies and parameters count for the best models.  
extract more detailed local features, while discouraging attention to global patterns and notably increasing computational complexity.