## 3 Method
### Boundary Loss Function  
In medical images, the area of interest usually has a specific shape and the boundary is often blurred. It is difficult for networks with the cross-entropy loss function or similarity coefficient loss function to learn boundary and contour features. Therefore, we propose a new loss function for effective learning of boundary and contour features. The boundary loss function can better optimize the network to explore the boundary features, which makes the boundary of the segmentation result smoother. However, to speed up the convergence rate of the network, we first use the combined loss function of cross-entropy and similarity coefficient to optimize the network parameters in each stage of network training. After the network loss decreases to a certain degree, that is, the combined loss can no longer be reduced by changing the learning rate, the boundary loss function is used to optimize the network further. The combined loss function of cross-entropy and similarity coefficient can be described as follows:  
\[L_{c}=\omega_{1}\times L_{b}(T,P)+\omega_{2}\times L_{d}(T,P), \tag{7}\]  
where \(\omega_{1}\) and \(\omega_{2}\) are the corresponding weights of the loss function of the cross-entropy and similarity coefficient, respectively. Afterwards, the boundary loss function is used to optimize network parameters to better learn the boundary information in the image. The boundary loss function \(L_{c}\) can be described as follows:  
\[L_{c}=d+\alpha\times a+\beta\times e, \tag{8}\]  
Figure 4: The proposed 2.5D FCN structure is shown in the figure above. The CT slices of \(H\times W\times 5\) are fed into the network and the model outputs the probability map of \(H\times W\times 1\). where \(d\), \(a\) and \(e\) indicate the distance, area and boundary, respectively, and there is little difference in detail with \(l\) and \(r\) in Formula (4). \(\alpha\) and \(\beta\) are the weights of the area and the boundary, respectively. \(d\), \(a\) and \(e\) can be written in pixelwise manner as follows:  
\[d=\sum_{i=1,j=1}^{N}\sqrt{(\Delta u_{x_{i,j}})^{2}+(\Delta u_{y_{i,j}})^{2}}, \tag{9}\]  
and  
\[a=\left|\sum_{i=1,j=1}^{N}u_{i,j}(1-v_{i,j})\right|+\left|\sum_{i=1,j=1}^{N}v_ {i,j}(1-u_{i,j})\right|, \tag{10}\]  
where \(v_{i,j}\) and \(u_{i,j}\) represent the values of the marked and predicted values, respectively. \(x_{i,j}\) and \(y_{i,j}\) are two coordinate values of pixel \((i,j)\). \(N\) is the pixel space. \(\Delta u\) represents the result from subtracting the value of the corresponding pixel index. We assume that the image with the true value is designated as \(A\). \(B\) is the resulting image of four iterative expansions of \(A\). \(C\) is the resulting image of four iterative corrosions of \(A\). The extraboundary is \(Om=A\otimes B\), and the intraboundary is \(Im=A\otimes C\), where \(\otimes\) represents an xor operation. Then, \(Im\) and \(Om\) are used to obtain the predicted values of extraboundary \(O\) and intraboundary \(I\). Thus, the boundary \(e\) can be described as follows:  
\[e=\left|\sum_{i=1,j=1}^{N}O_{i,j}+\sum_{i=1,j=1}^{N}(1-I_{i,j})\right|. \tag{11}\]  
The boundary loss function considers the distance, area and boundary as contour features simultaneously. For distance, Formula (9), the adjacent pixel points in the same target tissue and organ area in medical images have a certain similarity; therefore, taking distance as part of the loss function, namely, minimizing the difference between adjacent pixel points, can achieve the purpose of optimizing network parameters. For area, when using Formula (10), similar to the Dice loss function, it is essential to maximize the pixel value in the target area and minimize the pixel value in the background to ensure effective segmentation. For the boundary, Formula (11), the boundary between organs in the medical image is, therefore, the boundary can be weighted. The boundary can be taken as a part of the loss function to optimize the segmentation of the target boundary and to make it smoother.