## 2 Materials and Methods
### Residual Attention U-Net Network  
The U-Net structure [26] was adopted to consider high-resolution local textures and low-resolution contextual information using encoding and decoding paths. Additional operations were implemented, such as attention gates (AGs) [30] and residual blocks [34]. The integration of the AG into the model provides superior attention to important regions in our case (OARs and prostate) rather than unlabeled regions (background). Also, residual blocks were implemented for in-depth feature information collection in each convolution, increasing the model's performance and reducing the model's parameters. The input layer requires a fixed number of slices to perform the 2.5D training strategy. In our study, this fixed number is defined as 3, where the second slice serves as the primary one, encompassing the segmented OARs. The first and third slices, designated as neighboring slices, are also input into the model to gather contextual information. These neighboring slices provide additional features that help the model in considering the broader context in  
Figure 1: Data sample. (**a**) MR image in axial orientation, and (**b**) ground truth segmented OARs and prostate from expert physicians. Each color on (**b**) corresponds to a different organ. Figure 2: Minimum filtering: (**a**) the pixels with a normalized gray level \(>\)0.1, and (**b**) the results after the minimum filtering, removing background noise. which the regions of interest exist. Then, the input shape of the model is 256 \(\times\) 256 \(\times\) 3, representing the height, width, and number of slices, respectively. The encoding and decoding paths contain four layers in depth; each layer includes a residual block. Between each layer, both encoding and decoding layers are connected through concatenation connections. In the encoder, each residual block is a pair of convolutional blocks with a fixed sequence of 2D convolutions having a 3 \(\times\) 3 filter size, stride one, padding one, batch normalization, and ReLU operations followed by a 2D max-pooling operation with a kernel size of 2 \(\times\) 2 and stride 2. After the encoding path, the bottleneck of the model provides a 16 \(\times\) 16 \(\times\) 1024 feature map. Then, the attention mechanism is triggered by inputting the feature map from the previous layer and the feature map from the same layer of the encoding path. In the last phase, concatenation is performed between the output of the AG and the up-sampled feature map of the previous layer, followed by the same residual block as in the encoding path. The schematic of Residual Attention U-Net (ResAttU-Net) architecture is presented in Figures 3 and 4. Multiple basic loss functions were tested during the implementation related to the semantic segmentation task. Among them, Focal Loss (FL) [42] is a modified version of the cross-entropy loss, including an additional term to focus on hard misclassified examples,  
Figure 4: (**a**) The attention block, where \(W_{\text{g}}\) is the feature map derived from the encoding path, and \(W_{\text{x}}\) and X are the convolved and normalized output of the previous residual block. (**b**) The structure of the residual block. Figure 3: Residual Attention U-Net model. The residual blocks were replaced with the plain convolutional layers. The left side of the model represents the encoding path, and the right side represents the decoding path, respectively. dealing with the class imbalance issue [43]. Focal loss is defined in Equation (1), where \(p_{t}\) is the estimated probability for the class, and \(\gamma\) is a tunable parameter with \(\gamma\in[0,5]\). \[\text{FL}(p_{t})=-\alpha_{t}(1-p_{t})^{\gamma}\text{log}(p_{t}) \tag{1}\]  
The adaptive moment estimation (ADAM) algorithm was used due to its efficiency [44]. ADAM is an optimization algorithm that updates the network weights iteratively, remaining controlled and unbiased. The learning rate was 0.001, and the batch size was 4 for all the experiments.