## 2 Materials and Methods
### Implementation  
After the completion of the dataset preprocessing, the dataset is divided into three sets: a training set consisting of 6221 images (from 74 patients), a validation set with 160 images (from 2 patients), and a testing set with 464 images (from 5 patients). The selection of five patients for the test set was made through a rigorous randomization process. The limited number of patients in the validation and in the test set was due to the limited dataset in terms of patients and we decided to reinforce the training set. The subsequent step involved the selection of the model and the training strategy (2D vs. 2.5D). After a series of experiments, the chosen loss function was the focal loss. While other loss functions have proven effective for multiclass segmentation, the focal loss has gained attention for its ability to handle class imbalance issues. The focal loss assigns higher weights to misclassified samples, thereby emphasizing the training on challenging examples. This property makes it particularly useful in scenarios where certain classes are underrepresented. The focal loss can be defined as follows:  
Figure 6: Training strategies. Difference between 2D and 2.5D strategies.  
\[\text{Focal Loss}=-\sum_{i}^{N}(1-p_{i})^{\gamma}g_{i}\log(p_{i})\]  
where \(p_{i}\) represents the predicted mask of class \(i\), \(g_{i}\) represents the ground truth mask of class \(i\), and \(\gamma\) is a tunable focusing parameter that modulates the weight assigned to each sample.  
The training process was performed on a T4 GPU, featuring 40 streaming multiprocessors (SMs) with a 6 MB L2 cache shared by all SMs, and 16 GB high-bandwidth memory (GDDR6) connected to the processor, enabling accelerated computations and reducing training times. The model parameters, including the batch size (16), the loss function (focal loss), the number of epochs (40), and the learning rate (0.0002), were carefully chosen based on their performance during a series of experiments. The Adam optimization algorithm, as proposed by [PERSON] and [PERSON] [29], dynamically adjusts the learning rate for each model parameter based on gradients, combining the advantages of AdaGrad and RMSProp. The chosen learning rate for the Adam algorithm was set at 0.0002. Additionally, the training process incorporates a cosine annealing learning rate scheduler, which gradually adjusts the learning rate over epochs. The synergy between Adam and the cosine annealing scheduler contributes to effective convergence and exploration of the model's parameter space, ensuring optimal performance in multiorgan segmentation tasks.  
To improve efficiency and to reduce memory usage, mixed precision training was employed, performing certain operations with lower precision while maintaining higher precision for others. The cosine annealing LR scheduler adjusts the learning rate gradually, aiding the model in exploring different loss landscapes. The exponential moving average (EMA) was used to stabilize and improve the model's performance by smoothing out parameter fluctuations. Moreover, by comparing the 2D and 2.5D strategies in our model, the impact of contextual information from neighboring slices could be evaluated.