# Segmentation of Brain Tumors from MRI Images Using Convolutional Autoencoder
## 3 Results and Discussion  
The CNA architecture's performance evaluation for segmentation was performed by calculating the _Dice_ coefficient and _Acc_, _Se_, _Sp_, and _Pr_ for each of the test set images. The coefficients were calculated for each image separately, therefore in Table 3, the mean and median values of those estimated coefficients for all tests are presented. The metrics are calculated and presented in Table 3 for the aforementioned eight tests, combinations of two evaluation methods (5-fold cross-validation and one test), two data division methods (record-wise and subject-wise), and two training datasets (original and augmented).  
According to the mean and median value for the _Dice_ coefficient, the best results for cross-validation and one test method of the evaluation were obtained by training the network on the augmented dataset with record-wise data division. The observed difference between the mean and the median value is that there are images in which the network could hardly segment the tumor at all, which can be seen on the _Dice_ coefficients' histograms in the Appendix A. High values of _Acc_ and _Se_ coefficients are a consequence of the already mentioned class imbalance. For these reasons, when it comes to image segmentation, it is best to observe the values and histograms of _Dice_, _Sp_, and _Pr_ coefficients.  
Some of the results of segmentation after training the network on the original data set with record-wise data division are shown in Figure 3. Examples of tumor segmentation with _Dice_ coefficients higher and lower from its median value (83.31%) for each tumor type are presented, along with an MRI image and mask. The segmented images also show the  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Mask Pixel Value** & **Predicted Pixel Value** \\ \hline _TP_ & 1 & 1 \\ _FP_ & 0 & 1 \\ _TN_ & 0 & 0 \\ _FN_ & 1 & 0 \\ \hline \hline \end{tabular} \(\overline{TP}\)—true positive, _FP_—false positive, _TN_—true negative, _FN_—false negative.  
\end{table}
Table 2: Definition of parameters _TP_, _FP_, _TN_, _FN_ between mask pixel values and predicted pixel values.  
_Dice_ coefficient achieved for that segmentation. Even in the cases where the _Dice_ coefficient is lower, the predicted mask clearly indicates the existence and position of the tumor, which shows the significant diagnostic value of our method.  
The proposed CNA architecture has less than 0.5 million parameters, and training with the augmented dataset achieves better results than training with the original dataset. The record-wise method gives slightly better results compared to the subject-wise. Tumors differ in appearance depending on their type. Additionally, the number of images for each of the tumor types is not the same, nor is the number of patients with each tumor type. Therefore, the subject-wise method does not affect the distribution by type of tumor in the training and testing set, which is the reason for obtaining slightly worse results for the subject-wise method than the record-wise. The segmentation execution time is reasonably good, with an average value of 13 _ms_ per image. Despite the advantages the developed network has, there is a drawback worth mentioning. It is regarding the small database currently available and used in this paper. A well known disadvantage of the encoder-decoder architecture is a problem with the slow learning of the middle layer due to gradient decrease with error propagation. The only way to fight this limitation is to make a bigger database.