On the other hand, edge weight used for neighborhood aggregation in GNNs is defined as a reciprocal of a pairwise spatial distance between source and target nodes divided by the diagonal length of the input image \(I\)  for normalization, formulated as follows: \(w_{i} = 1 / (d^{spa}_{(v_{src}, v_{dst})} \times \texttt {diag\_len}(I))\)  for \(e_{i} = (v_{src}, v_{dst})\) , where \(\texttt {diag\_len}\)  denotes a function returning the length of a diagonal of the given image. Note that such an edge weighting scheme allows the GNN model to give larger weights on nearby objects during the aggregation of features from neighboring source nodes to the target node. For GNN, we use two Graph Convolutional Network (GCN) [1]} layers, and the overall graph feature extraction procedure is as follows:
\(\begin{split}& \hat{f}^{down}_i = \texttt {1x1Conv}(\hat{f}^{conv}_i), \; \hat{c}_i = \texttt {embed}(\texttt {argmax}(\hat{p}_i)) \\& \hat{f}^{node}_i = \texttt {concat}(\hat{f}^{down}_i, \hat{c}_i), \; w_{i} = 1 / (d^{spa}_{(v_{src}, v_{dst})} \times \texttt {diag\_len(I))}, \\& \hat{f}^{gnn}_i = \texttt {GCN}(\mathcal {E}, \hat{f}^{node}, w),\end{split}\) 
