For network inputs, \(32 \times 32\)  image patches centered at the contour of handwriting were extracted. Same as Christlein et al [1]} we follow the architectural design of He et al. [2]} on CIFAR10 dataset [3]}. \(6n + 2\)  layers are employed with \(n\)  set to 3 leading to the ResNet-20 architecture. The first layer is \(3 \times 3\)  convolutions. Then an stack of \(6n\)  layers with \(3 \times 3\)  convolutions follows with every \(2n\)  layers forming an stage. At the beginning of each stage (except the first one), the feature map size is halved (downsampled) by a convolutional layer with the stride of 2, while the number of filters is doubled. Within each stage, the layers have the same number of filters. More precisely, feature maps and filters for stages are of sizes \(\lbrace 32, 16, 8 \rbrace \)  and \(\lbrace 16, 32, 64 \rbrace \) , respectively. Shortcut connections are connected to the pairs of \(3 \times 3\)  layers leading to a total \(3n\)  shortcuts. The network ends with the global average pooling layer with a size of 8 and an \(N\) -way fully connected layer. However, We discard the last fully-connected layer and pass the \(1 \times 1 \times 64\)  output feature vector global average pooling layer to the NetVLAD to further learn the VLAD embeddings of these feature vectors. (See Figure REF ).
