# Voting-Based Contour-Aware Framework for Medical Image Segmentation
## 2 Method
### Contour-Aware CNN  
We present the architecture of our contour-aware CNN in this stage as inspired by [29; 31]. We employed the encoder and decoder CNNs as the backbone networks, as shown in Figure 1a, and we inserted contour enhancement modules to interconnect the encoder and decoder of intermediate layers in each resolution. We applied the bilinear up-sampling to the output of the contour enhancement module at each resolution and then concatenated all the feature maps. Furthermore, the contour-aware CNN is guided by a \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multicolumn{2}{c}{**Encoder/Decoder**} \\ \cline{2-3}  & **Resolution Stage** & **Number of Feature Maps** \\ \hline \multirow{8}{*}{CHAOS} & 3 \(\times\) 3 conv blocks 1 & 32 \\  & 3 \(\times\) 3 conv blocks 2 & 64 \\  & 3 \(\times\) 3 conv blocks 3 & 128 \\  & 3 \(\times\) 3 conv blocks 4 & 256 \\  & 3 \(\times\) 3 conv blocks 5 & 480 \\  & 3 \(\times\) 3 conv blocks 6 & 480 \\  & 3 \(\times\) 3 conv blocks 7 & 960 \\  & \multicolumn{2}{c}{Strided Convolution} \\  & \multicolumn{2}{c}{Transposed Convolution} \\ \hline \multirow{8}{*}{Hippocampus} & 3 \(\times\) 3 conv blocks 1 & 32 \\  & 3 \(\times\) 3 conv blocks 2 & 64 \\ \cline{1-1}  & 3 \(\times\) 3 conv blocks 3 & 128 \\ \cline{1-1}  & 3 \(\times\) 3 conv blocks 4 & 256 \\ \cline{1-1}  & \multicolumn{2}{c}{Strided Convolution} \\ \cline{1-1}  & \multicolumn{2}{c}{Transposed Convolution} \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The configurations of nnU-Net encoder and decoder layer in our experiments on CHAOS and hippocampus datasets. \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multicolumn{2}{c}{**Encoder/Decoder**} \\ \cline{2-3}  & **Resolution Stage** & **Number of Feature Maps** \\ \hline \multirow{8}{*}{CHAOS} & 3 \(\times\) 3 conv blocks 1 & 64 \\  & 3 \(\times\) 3 conv blocks 2 & 128 \\  & 3 \(\times\) 3 conv blocks 3 & 256 \\ \cline{1-1}  & 3 \(\times\) 3 conv blocks 4 & 512 \\ \cline{1-1}  & 3 \(\times\) 3 conv blocks 5 & 512 \\ \cline{1-1}  & \multicolumn{2}{c}{Max pooling} \\ \hline \multirow{8}{*}{Hippocampus} & 3 \(\times\) 3 conv blocks 1 & 64 \\ \cline{1-1}  & 3 \(\times\) 3 conv blocks 2 & 128 \\ \cline{1-1}  & 3 \(\times\) 3 conv blocks 3 & 256 \\ \cline{1-1}  & 3 \(\times\) 3 conv blocks 4 & 512 \\ \cline{1-1}  & \multicolumn{2}{c}{Max pooling} \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The configurations of Segnet encoder and decoder layers in our experiments on CHAOS and hippocampus datasets. semantic segmentation loss, a contour loss, and a compatibility loss, all of which ensure high quality of segmentation mask margins. As shown in Figure 1b, the contour enhancement module can accentuate edge presentations and comprises a residual block and an attention layer. It requires two inputs in each resolution stage, one from the decoder and fed into the residual block, and one from the encoder and delivered into the attention layer. To minimize the computational cost of CNN, we employ separable convolution, followed by a normalization layer and a non-linear unit layer in the residual block. The attention layer has two inputs, and \(I_{res,r}\) and \(I_{e,r}\) indicate the inputs from the residual block and encoder, respectively, at resolution r. We concatenate \(I_{res,r}\) and \(I_{e,r}\), then perform a convolution operation using a normalized \(1\times 1\) convolution layer \(Conv_{1\times 1}\), followed by a sigmoid function \(\sigma\). The intermediate result pixel-wise product with \(I_{res,r}\) is used the output of the contour enhancement module at resolution r, which can be defined as follows:  
\[Out_{r}=\sigma(Conv_{1\times 1}(I_{res,r}||I_{e,r}))\cdot I_{res,r} \tag{1}\]  
where operator \(\cdot\) is a pixel-wise multiplication operator, and \(\parallel\) signifies the concatenation of feature maps. The \(Out_{r}\) is then upsampled using bilinear interpolation for further fusing.