## 2 Materials and Methods
### Convolutional Neural Network Model-Based Classification  
In the second part of the material and methods section, we describe developing convolutional neural network (CNN) based classification models for different data sets and outcome variables. We pre-processed the images as can be seen in Figure S3. The data sorting for the classification itself is shown in Figure S4. 2.1 Image Classification on Tile Level Using a Deep Residual Network (Residual Neural Network (ResNet))  
Data Set Preparation on Tile Level without and Concerning the Tile-Case-Relation  
Two different methods were used for data set generation without and with regarding the tile-case-relation: First, for each classification, we sorted the tiles for the attribute of the classification. For the classification of Border to nodal status (Bo2 No), all the tiles from peripheral tumor areas were divided into two classes according to their binary nodal status denoted in the patient data file. Then we randomly split the tiles within each class into sets for training (75%), validation (15%) and testing (10%) without regard to the WSI they belong to. This led to tiles from one single WSI being present in the training set, as well as the validation and possibly testing set. In a second approach, to respect the case origin we grouped the tiles after their corresponding WSI. The groups were then directly distributed into training, validation and test set with similar rates. Thus, tiles from one WSI could end up only in the training set, or exclusively the validation set, or the test set. \begin{table}
\begin{tabular}{c c c c c c c} \hline
**Classification** & **\# Cases** & **\# Tiles** & **m:f** & **Age (mean \(\pm\) std)** & **N0:N1:N2** & **B0:B1:B2:B3:B4** \\ \hline Bo2 No & 178 & 39,600 & 106:72 & \(68.7\pm 10.9\) & 92:39:47 & 3:48:45:53:27 \\ Ce2 No & 169 & 15,734 & 99:70 & \(69.0\pm 10.9\) & 90:37:42 & 3:47:41:51:25 \\ \hline \end{tabular}
\end{table} 
Table 1: **Distribution of tiles for classification. ** Segmented HE-images were filtered for tiles depicting central tumor areas and tiles containing border tumor areas. In accordance with the patient data these tiles were distributed into the corresponding categories. We defined the following two tasks: mapping of the central tumor areas to the nodal status (hereafter referred to as Ce2 No) and mapping of the tumor border areas to the nodal status (hereafter Bo2 No). #—number of objects; m:f—number of male:female patients; N0:N1:N2—number of cases with corresponding nodal status; B0:B1:B2:B3:B4—number of cases with corresponding budding status. The model used was a pre-trained residual neural network Pytorch-implementation ResNet with 152 layers [21, 28]. It has been pre-trained on the ImageNet data set [29, 30]. Thus, the features it relies on are trained for real-world objects like plants or trees and not histological objects. It was trained using cross-entropy loss, learning rate scheduler and stochastic gradient descend optimizer as described previously in [PERSON] et al. [31]. The target output (or clinical output) has been the nodal status (N\(-\) or N\(+\)) of the case from which the image tiles come. The other available clinical outputs, namely budding status, nodal status and progress, have not been used here. Training was performed over 50 epochs. To increase robustness, several data augmentation methods were applied randomly, like horizontal or vertical flipping or rotation. One model has each been trained for the central tiles, the border tiles and a conjoined collection of border and central tiles, hereafter called tumor tiles. 2.2 Image Classification on Slide Level Using a Multi-Instance Learning (MIL) Model Data Set Preparation for the MIL-Approach  
The strategy of multiple-instance learning (MIL) involves a classification approach based on cases where each image tile is denoted as an instance. In this context, the complete case is termed a bag [32, 33, 34, 35]. In our scenario, each bag consists of a variable number of instances, which are the tiles.