## 3 Materials and Methods
### The Method
#### 3.2.1 The Network and Hyperparameters Choice  
To choose the best network for 3D segmentation of liver and tumors we compared segmentation performances on the validation set of our designed cascade approach using four different FCNN networks. Our input to the network is a five-dimensional tensor, with the first two dimensions corresponding to the batch size and channel size. As we used only one MRI image, the number of input channels in this study is equal to one. All four networks have 3 output channels representing each from the predicted class. By applying voxelwise voting, the final 3D segmentation mask is obtained. The use of FCNN provides volume to volume segmentation [27]. The algorithm of the study is presented in Figure 4. All networks used in our methods were based on the convolution filter feature extraction. 3D U-net [43] and 3D V-net [18] are two FCNN networks based on 2D U-net [17], utilizing encoding and decoding paths with a skip connection between them. Both networks utilize 3D convolutions to produce the final segmentation. It requires the input feature matrix with a shape \((l,w,h,c)\) where \(l,w,h\) stand for length, width, height and \(c\), channels, and a 3D convolutional kernel \(w\) of size \(w\times w\times w\times c_{l}\times c_{w}\), where \(c_{l}\,,c_{w}\) are the number of channels before and after the convolution. A 3D convolution output will be computed using Equation (1)  
\[G_{x,y,z,n}=\sum_{i=0}^{l-1}\sum_{j=0}^{w-1}\,\sum_{h=0}^{h-1}\,\sum_{m=1}^{c} \,w_{ij,k,m,n}I_{x+i,y+j,z+k,m} \tag{1}\]  
By applying the stride of two, the size of the input volume is decreased by half, and using strided transpose convolutions, the size is increased back to its origin in the decoding part of the network. The main difference between the U-net and V-net architectures is the additional residual layers in the downsampling stages [18]. The number of filters of both networks begins with 16, going up to 256 at the bottleneck stage. Following the implementation proposed by the MONAI libraries, 3 DV-net uses the kernel size of \(5\times 5\times 5\), Elu activation function, 3D batch normalization [44] and 50% of random dropout of 3D feature maps. A kernel size of \(3\times 3\times 3\) is used for3D U-net, along with Prelu activation function, instance batch normalization [45] and no dropout. Figure 3: Distribution (percentage) of MRI data acquired on the different MRI systems included in the study: (**a**) Train and Validation subset (**b**) Test subset. SegResNet is another FCNN network with a similar encoding part based on decreasing the size of the volumes using a stride of two and kernel size of 3 \(\times\) 3 \(\times\) 3. According to the MONAI implementation, the number of filters begins with eight and with each downsampled layer, it is multiplied by two. It is utilizing the Relu activation function in each of the blocks of the networks, group normalization [46] and without dropout. The decoder part is similar to 3D U-net implementations, with the variational autoencoder branch added by the authors [19]. HighResNet is another FCNN network that utilizes 3D convolutions to extract features from volumetric images with 3 \(\times\) 3 \(\times\) 3 convolution kernels. However, this network consists only of 20 convolution layers. By utilizing dilated convolutions (Equation (2)), the network avoids the encoding and decoding strategy to get the higher features from the volumes. After the first eight filters with standard 3D convolutions, the authors introduced dilated convolutions with a dilation factor \(r\) for further feature extraction (Equation (2)). This dilation factor increases the receptive field by preserving the spatial resolution. \[O_{x,y,z,n}=\sum_{l=0}^{l-1}\sum_{j=0}^{w-1}\sum_{h=0}^{h-1}\sum_{m=0}^{c-1}w_ {ij,j,k,m,n}I_{(x+ir),(y+ir),(z+kr),m} \tag{2}\]  
To obtain the final segmentation, the final convolution layer with a 1 \(\times\) 1 \(\times\) 1 convolution and 160 kernels is applied. The network has a Relu activation function, batch normalization and no dropout [20].