# Deep Learning Classification of Colorectal Lesions Based on Whole Slide Images
## 3 Results  
In the first experiment, we trained a single neural network to classify patches of a WSI into six classes. The neural network was trained according to the one-cycle policy. The quality of the prediction was evaluated with the PR-AUC value for each class during training. According to Figure 4, the classification quality of some classes increased or fluctuated (NG and AKG2 classes), while the classification quality of other classes decreased (for example, TA and VA classes). As a result of many experiments, it was not possible to find out the optimal number of training iterations maximizing values of PR-AUC simultaneously for all classes. At some point, the PR-AUC values decreased, indicating almost random predictions. This might be the consequence of extremely high values of neural network weights and indicate the exploding gradient problem. The problem arises due to the exponential growth of gradients in the training process, and in turn, the growth of the weights of the neural network to infinity. The weights of the network grew unequally for different classes. That is why we constructed six independent neural networks to solve the one-vs-rest binary classification problem. The classification quality in this case was evaluated with the accuracy, ROC-AUC, and PR-AUC metrics. Neural networks based on ResNet and EfficientNet architectures were compared, and the sizes of the WSI patches (224 \(\times\) 224 and 500 \(\times\) 500) were also varied. Selected results for EfficientNet-B4 are shown in Figure 5.  
Figures 6 and 7 show the ROC and PR curves for the best trained models. The best results were obtained for the NG class. This can be explained by a variety of available images of this class and the lower specificity of healthy tissues. The rest models demonstrated a lower quality of classification, since pathological tissues may have similar features. Table 4 shows the best prediction results for each class, according to the ROC-AUC and PR-AUC metrics. The EfficientNet-b4 model showed the best results for most tasks. The problem of multi-label classification implies that it is the choice of a probability threshold to determine whether an object belongs to a certain class. Several other metrics can be applied in addition to ROC-AUC and PR-AUC, such as sensitivity, specificity, precision, F1 score, and negative predictive value (NPV). All of them directly depend on the value of the probability threshold. Table 5 shows the values of these metrics for a threshold = 0.5 for both patch-level and WSI-level. Figure 5: Changes in metrics during the training process: (**a**) the ROC-AUC metric for the adenocarcinoma G1 class; (**b**) the PR-AUC metric for the adenocarcinoma G1 class; (**c**) the ROC-AUC metric for the adenocarcinoma G2 class; and (**d**) the PR-AUC metric for the adenocarcinoma G2 class. The CNN classification can be transferred to the real images. Figure 9 shows the output of the software, where the colors of the patches correspond to class colors in Figures 4, 6 and 7. The software painted the patches where predicted class probability was greater than 0.5. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Metrics** & & & & & & & \\ \hline \hline \multirow{4}{*}{ROC-AUC} & **MG** & **AKG1** & **AKG2** & **AKG3** & **TA** & **VA** \\ \cline{2-7}  & Metrics value & 0.96 & 0.85 & 0.94 & 0.91 & 0.80 & 0.84 \\ \cline{2-7}  & CNN & EfficientNet-b4 & EfficientNet-b4 & EfficientNet-b4 & EfficientNet-b4 & EfficientNet-b4 & EfficientNet-b4 & ResNet-b4 \\ \hline \multirow{2}{*}{PR-AUC} & Metrics value & 0.86 & 0.53 & 0.77 & 0.70 & 0.51 & 0.53 \\ \cline{2-7}  & CNN & EfficientNet-b4 & EfficientNet-b4 & EfficientNet-b4 & ResNet-34 & EfficientNet-b4 & EfficientNet-b4 \\ \hline \end{tabular}
\end{table} 
Table 4: The best results obtained for each class, according to ROC- and PR-curve analysis. Figure 6: The quality of EfficientNet-B4 prediction for all classes: (**a**) the ROC-AUC metric and (**b**) the PR-AUC metric.