# Topology-Aware Retinal Artery-Vein Classification via Deep Vascular Connectivity Prediction
## 2 Methods
### Pixelwise Prediction on the Optic Disc and Vessel
#### 2.1.4 Network Architecture  
We adopt the network in [7], which is based on the VGG-16 network [15], as our base network. In this network, the final output is inferred from concatenated multi-scale features of the VGG-16. Before the concatenation, feature maps are resized to have identical spatial resolutions. A more complex network called U-Net [16] showed no differences in the performance. For all five aforementioned tasks, we use pixelwise softmax cross-entropy losses. The loss for optic disc segmentation, which is easily generalizable for other tasks, is defined as:  
\[L_{od}(X)=\ -\frac{1}{|X|}\sum_{i}O^{*}(x_{i})\text{log}\ O(x_{i}), \tag{1}\]  
where \(O^{*}(x_{i})\) and \(O(x_{i})\) are the one-hot encoded GT label and the class prediction for pixel \(x_{i}\), respectively. The weights for class-balancing are omitted for brevity. \(X\) is a set of pixels involved in the training, which is the set of all pixels in an image unless otherwise noted. We experimentally confine \(X\) to centerline pixels in thickness model training. This coincides with an impression that the thickness might be more well defined at on-centerline pixels than at off-centerline pixels. Figure 3 visualizes three network architectures used for topology-aware AV classification. The first network is for optic disc segmentation and is the base network itself in terms of the architecture (Figure 3a). The second is a multi-task network for binary vessel segmentation and AV classification, which is composed of one shared encoder and two separate decoders for each task (Figure 3b). These two correlated tasks are grouped for both efficiency and effectiveness. The loss function for training this network is defined as the weighted summation of two losses \(L_{segm}\) and \(L_{av}\), and is given by:  
\[L_{segm\_av}=\ \lambda_{segm}*L_{segm}+\lambda_{av}*L_{av}, \tag{2}\]  
where \(\lambda_{segm}\) and \(\lambda_{av}\) are the weights for each task. The third is another multi-task network for thickness/orientation classification (Figure 3c). While the vessel segmentation and AV classification themselves are desired outputs from the second network, thickness/orientation classifications in this network are trained as auxiliary tasks to learn desired features, which will be input for the vascular connectivity classification. The connectivity classification is implemented using fully connected (fc) layers on top of the concatenation of the penultimate layer features of the auxiliary tasks. For any two pixels that are respectively on different vessel segments joining at a junction, features extracted at their image coordinates are fed into the fc layers. One of the desired properties for the pairwise classification is to satisfy symmetry, which means that the output is the same regardless of the input order. To accomplish this, we use a Hadamard product (element-wise product) of two feature vectors to make a single vector for the final inference [17], as shown in Figure 3c. We again use a softmax cross-entropy loss for the connectivity classification, which is termed \(L_{conn}\). The connectivity GT label for training is decided from topology GTs exemplified in Figure 3c. The loss function for training the connectivity classification network is then defined as the weighted summation  
Figure 3: Three networks for topology-aware AV classification. For each network, an input image and the corresponding ground-truth (GT) image for training are presented. For all three component networks, we adopt the network of [7] as the backbone network. (**a**) Network for optic disc segmentation (OD segm.). (**b**) Multi-task network for binary vessel segmentation and AV classification (cls. ), which is composed of one shared encoder and two separate decoders for each task. (**c**) Network for vascular connectivity classification, including multi-task auxiliary outputs for thickness/orientation classifications.