whole image classifier converted from the patch classifier (Fig. \[fig:patch2image\]). Similarly, a 2-stage training strategy was used to first train the newly added top layers (i.e. function $g$) and then train all layers (i.e. function $h$) with a reduced learning rate, which was as follows:

1.  Set learning rate to 1e-4, weight decay to 0.001 and train the newly added top layers for 30 epochs.

2.  Set learning rate to 1e-5, weight decay to 0.01 and train all layers for 20 epochs for a total of 50 epochs.

If the above 50 epochs did not lead to convergence, the training was resumed with up to 200 additional epochs. Due to GPU memory limit, a batch size of 2 was used.

The average gray scale value of the whole image training set was subtracted from both patch and whole image sets in training. No other preprocessing was applied. Data augmentation was used on-the-fly by doing the following random transformations: horizontal and vertical flips, rotation in \[-25, 25\] degrees, shear in \[-0.2, 0.2\] radians, zoom in \[0.8, 1.2\] ratio and channel shift in \[-20, 20\] pixel values.

### Development of patch classifiers

The accuracy of Resnet50 and VGG16 on the test set 