# Render U-Net: A Unique Perspective on Render to Explore Accurate Medical Image Segmentation
## 3 Methodology
### Attention Gate
These features will replace original upsampling features and concatenate to refine the boundary. ### Deep Supervision

To improve convergence speed and solve the problem of gradient disappearance, deep supervision was first proposed in [30]. In our work, deep supervision was introduced to supervise the semantic information collected by the nested architecture. Figure 6 shows how deep supervision is implemented in Render U-Net. Because Render U-Net redesigned dense skip connections, deep supervision can help the network supervise different levels of semantic information. Then, we used the hybrid loss function in [20] to calculate the loss of the four output results from different levels. By analyzing the characteristics of medical image segmentation, the hybrid loss function reintegrated three loss functions, including dice coefficient, cross entropy, and focal loss. The mathematical formulation of the above hybrid loss function is:

\[\text{Hybrid Loss}=\sum_{\text{i=1}}^{4}\left(1-\left[\frac{\text{b}\times \overline{\text{Y}}\times\text{log}\,\text{Y}_{\text{i}}}{|\text{Y}_{\text{i }}-0.5|^{r}}+\frac{2\times\text{Y}_{\text{i}}\times\overline{\text{Y}}+\text{ s}}{\text{Y}_{\text{i}}^{2}+\text{s}}\right]\right) \tag{1}\]

In the above mathematical formula, \(\overline{\text{Y}}\) is the actual segmentation result after manual labeling, and \(\text{Y}_{\text{i}}\) is the segmentation prediction result from the block \(X_{0,i}\) in the network. When calculating the loss, we regard \(\overline{\text{Y}}\) and \(\text{Y}_{\text{i}}\) as pixel matrices. All operations in the formulation are calculated on the entire

Figure 5: Example of the coarse-to-fine process. First, a coarse mask on a 5 \(\times\) 5 grid is predicted by the coarse decoder. Next, the N most uncertain points (dots in grids) are selected to recover detail on the finer grid. Finally, these point-features are extracted and then used to replace the original features extracted by the encoder. Figure 6: Implementation of deep supervision in Render U-Net. Ground truth supervises the output of the nested convolution structure. The four results \(X_{0,1}\),\(X_{0,2}\), \(X_{0,3}\),\(X_{0,4}\) are compare with ground truth and directly participate in the calculation of hybrid loss. matrices. \(|\ |\) is the absolute value function, s is the smooth factor, \(b\) is the balance factor in Focal loss, and hyper parameter \(r\) is used for difficult samples. Firstly, because of the particularity of the medical sample, positive (existing organ) samples usually occupy a small proportion in the dataset. To reduce the influence of the sample imbalance, \(b\) is added as a balance factor to the above hybrid loss function, where \(b\) overcomes this problem by giving different weights to different samples. This solution draws on the idea of focal loss in which the negative samples (\(\vec{Y}=1\)) multiply the \(b\) to get bigger loss value. Secondly, there are also easy and difficult samples in clinical diagnosis, where simple samples mean the patients with clear symptoms while the difficult samples mean the patients with confused symptoms. In fact, there are more simple samples in the dataset. In order to better help the network to achieve a good segmentation of samples with different diagnostic difficulties, the hyper parameter \(r\) is introduced. In the organ segmentation task, when predicted result \(Y_{i}\) approaches 0, the more likely the sample is to be classified as negative. Similarly, when predicted result \(Y_{i}\) approaches 1, the more likely the sample is to be classified as positive. On the contrary, when \(Y_{i}\) approaches 0.5, it is so hard to diagnose that it is the difficult sample and the loss increases. As a consequence, this hyper parameter \(r\) can help model optimize the segmentation of difficult samples.