# Deep Neural Networks for HER2 Grading of Whole Slide Images with Subclasses Levels
## 4 Results
Table 14 shows the confusion matrix of the classification when combining the intermediate classes (1.5 and 2.5+) with their respective true classes (2+ and 3+). The classification model's metrics, including sensitivity, specificity, precision, accuracy, F1-score, and MCC, are shown in Table 15. By employing this methodology, the accuracy of the 2+ class is enhanced to 96%, while the 3+ class achieves a remarkable 98% accuracy. Figure 6 shows the bar charts to compare all the metrics for the two classification models, that is, directly classifying in 5 classes, and classifying in 7 classes and then aggregating the results into 5 classes. The comparison is displayed for each individual class. To illustrate the distinctions, the abscissa axis of the bar charts is set at 0.80. \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**GT\(\backslash\)Pred** & **0** & **1** & **2** & **3** & **Back** \\ \hline
0 & 901 & 65 & 0 & 0 & 34 \\
1 & 86 & 855 & 51 & 0 & 8 \\
2+ & 0 & 54 & 911 & 35 & 0 \\
3+ & 0 & 0 & 30 & 970 & 0 \\ Back. & 39 & 2 & 0 & 0 & 959 \\ \hline \hline \end{tabular}
\end{table} 
Table 14: Confusion matrix for ResNet-101 in DS4 aggregating to 5 classes. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**GT\(\backslash\)Pred** & **0** & **1** & **1.5** & **2** & **2.5** & **3** & **Back** \\ \hline
0 & 901 & 65 & 0 & 0 & 0 & 34 \\
1 & 86 & 855 & 28 & 23 & 0 & 0 & 8 \\
1.5 & 0 & 74 & 889 & 16 & 21 & 0 & 0 \\
2+ & 0 & 34 & 20 & 896 & 19 & 31 & 0 \\
2.5+ & 0 & 0 & 18 & 13 & 952 & 17 & 0 \\
3+ & 0 & 0 & 0 & 29 & 10 & 961 & 0 \\ Back. & 39 & 2 & 0 & 0 & 0 & 959 \\ \hline \hline \end{tabular}
\end{table} 
Table 12: Confusion matrix for ResNet-101 applied to DS3 dataset with 7 classes. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**GT\(\backslash\)Pred** & **0** & **1** & **1.5** & **2** & **2.5** & **3** & **Back** \\ \hline
0 & 901 & 65 & 0 & 0 & 0 & 34 \\
1 & 86 & 855 & 28 & 23 & 0 & 0 & 8 \\
1.5 & 0 &  
Figure 7 illustrates the entire process and it shows an example of a slide patch classified using a model trained with the methods stated in this work. There, the relevant tissue regions are highlighted in different colours depending on their score and influence in the grading decision. In this specific case, a 9.76% of the tissue is reported as 3+, so the system evaluates the slide as a 3+ positive, providing a warning to check for equivocal tissue regions for further analysis by the pathologist. Comparing the outcomes achieved using the proposed method to those cited in the current literature [13; 14; 15; 16; 17; 18; 19; 20], a comparison can be drawn with the outcomes of five of the mentioned methods, all of which used the AIDPATH database [14; 15; 16; 17; 19]. Among these, [PERSON] _et al._[14] reported the highest accuracy rate of 94%. When comparing with the approach proposed by [PERSON] _et al._[18], which utilises MIL at the pyramidal level, the obtained results are consistent with the previously reported findings, achieving an accuracy of approximately 91%. These results may be attributed to the network's lack of access to supplementary texture or tumour microenvironment data, instead relying on the same information presented at a varying scale. Finally, when we apply the ResNet34 network  
Figure 6: Comparison of models. Blue bars show the results when classifying directly into 5 classes and red bars show the results when classifying into 7 classes and aggregating to 5 classes. Figure 7: HER2 scoring procedure. The workflow involves a 7-class classification and a 5-class aggregation process. used in [PERSON] _et al._[20] to our dataset, the results are comparable to those previously reported, with an average accuracy of 94%. Thus, the proposed method outperforms other existing methods, as proven by the obtained results with an average accuracy of 97%.