# Deep Neural Networks for HER2 Grading of Whole Slide Images with Subclasses Levels
## 4 Results  
Once the 5-class datasets are built, each architecture network is trained and validated. Tables 6 and 7 show a summary of the results for all the methods and datasets. In all the experiments, the same set of hyperparameters was used so that performance can be compared in the same conditions. These parameters for training have been chosen considering two principles in mind. First, this is a finetuning over previously ImageNet trained models. Second, that reproducibility over different networks is desirable. Because \begin{table}
\begin{tabular}{l l l l l l l l l l} \hline \hline
**Dataset** & **Class** & \multicolumn{3}{c}{**AN**} & \multicolumn{3}{c}{**GN**} & \multicolumn{3}{c}{**VGG**} \\ \hline  & & **Sens** & **Spec** & **Acc** & **Sens** & **Spec** & **Acc** & **Sens** & **Spec** & **Acc** \\ \hline \multirow{6}{*}{DS0} & 0 & 0.94 & 0.96 & 0.96 & 0.95 & 0.95 & 0.93 & 0.96 & 0.96 \\  & 1 & 0.80 & 0.95 & 0.92 & 0.78 & 0.94 & 0.91 & 0.84 & 0.92 & 0.90 \\  & 2+ & 0.76 & 0.95 & 0.91 & 0.73 & 0.95 & 0.90 & 0.71 & 0.92 & 0.88 \\  & 3+ & 0.85 & 0.98 & 0.95 & 0.82 & 0.98 & 0.95 & 0.73 & 0.99 & 0.94 \\ \cline{2-11}  & 0 & 0.84 & 0.94 & 0.92 & 0.78 & 0.94 & 0.91 & 0.82 & 0.98 & 0.95 \\  & 1 & 0.68 & 0.93 & 0.88 & 0.65 & 0.92 & 0.86 & 0.82 & 0.95 & 0.93 \\  & 2+ & 0.70 & 0.94 & 0.89 & 0.70 & 0.92 & 0.88 & 0.82 & 0.94 & 0.93 \\  & 3+ & 0.85 & 0.97 & 0.94 & 0.84 & 0.97 & 0.94 & 0.88 & 0.99 & 0.97 \\ \cline{2-11}  & 0 & 0.80 & 0.95 & 0.92 & 0.80 & 0.95 & 0.92 & 0.82 & 0.96 & 0.94 \\ \cline{2-11}  & 1 & 0.73 & 0.95 & 0.90 & 0.75 & 0.95 & 0.91 & 0.81 & 0.96 & 0.93 \\ \cline{2-11}  & 2+ & 0.84 & 0.95 & 0.93 & 0.83 & 0.95 & 0.92 & 0.88 & 0.97 & 0.95 \\ \cline{2-11}  & 3+ & 0.89 & 0.98 & 0.96 & 0.88 & 0.98 & 0.96 & 0.94 & 0.98 & 0.97 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Results of sensitivity (Sens), specificity (Spec) and accuracy (Acc) for the five-class datasets. Each column depicts an architecture: AlexNet (AN), GoogleNet (GN) and VGG-16 (VGG). \begin{table}
\begin{tabular}{l l l l l l l l} \hline \hline
**Dataset** & **Class** & \multicolumn{3}{c}{**RN**} & \multicolumn{3}{c}{**DN**} \\ \hline  & & **Sens** & **Spec** & **Acc** & **Sens** & **Spec** & **Acc** \\ \hline \multirow{6}{*}{DS0} & 0 & 0.95 & 0.96 & 0.96 & 0.95 & 0.94 & 0.94 \\  & 1 & 0.83 & 0.95 & 0.92 & 0.77 & 0.96 & 0.92 \\  & 2+ & 0.75 & 0.97 & 0.92 & 0.82 & 0.95 & 0.92 \\  & 3+ & 0.89 & 0.98 & 0.96 & 0.80 & 0.99 & 0.95 \\ \cline{2-11}  & 0 & 0.88 & 0.94 & 0.93 & 0.89 &of that, L2 regularization and gradient clipping are defined. The specific values have been chosen from the common range that they take from the state of the art so that they can work in a large range of models with no issue. These references provide more details about how they are defined and how they should be used [39; 40; 41]. Nevertheless, no noticeable differences should be observed given that the parameters are set within the proper range. Regarding the amount of data of these datasets, 3 epochs are enough to adapt the network to the problem. This is observed in the training plots of the loss function, since after the third epoch the network training was stable and no improvement was observed. To further prevent overfitting and to refine the model weights during these epochs, a learning rate decay is also applied, which is common in the state of the art to reduce the magnitude of weight changes throughout the learning process. As a result, these are the specific parameters: training was carried out during 3 epochs, using ImageNet initialization weights, with 0.01 as the initial learning rate and a decay of 0.1 at each epoch for training stabilization. Gradient clipping (L2 normalization method) with a 0.05 threshold was used to prevent gradient exploding. Momentum at 0.9 and L2 regularization at 0.004 are also applied to avoid overfitting. The most optimal performance is observed with the ResNet and DenseNet models, and with the DS2 dataset where data augmentation and balanced classes are implemented.