## 3 Methods
### Gradient-Enhanced Encoder Scheme  
Unlike previous studies [8; 35; 36; 37; 38; 39; 40; 41], we propose a novel gradient-enhanced encoder scheme to additionally learn geometric features by adding two gradient-based encoders in parallel to the encoder in the UNETR++ framework, as shown in Figure 2. The proposed gradient-based encoders take the second-order partial derivatives \(\frac{\partial^{2}f(x,y,z)}{\partial x\partial z}\) and  
Figure 1: Architecture of G-UNETR++ consisting of a hierarchical encoder–decoder structure with skip connections between the encoder and decoder, followed by convolutional blocks to generate segmentation results.  
\(\frac{\partial^{2}f(x,y,z)}{\partial y\partial z}\) as their inputs, respectively, to learn 3D geometric features such as the boundaries between different organs and tissues especially along the z-axis, where \(f(x,y,z)\) denotes a CT scan image and x, y, and z represent the coordinates of a voxel in the image. The two second-order partial derivatives are the first two elements of the last column of the Hessian matrix of a CT scan. The Hessian matrix of a CT scan is calculated as follows:  
\[H=\begin{bmatrix}\frac{\partial^{2}f(x,y,z)}{\partial x^{2}}&\frac{\partial^{ 2}f(x,y,z)}{\partial y\partial z}&\frac{\partial^{2}f(x,y,z)}{\partial y \partial z}\\ \frac{\partial^{2}f(x,y,z)}{\partial z\partial x}&\frac{\partial^{2}f(x,y,z)}{ \partial z\partial y}&\frac{\partial^{2}f(x,y,z)}{\partial z^{2}}\end{bmatrix} \tag{1}\]  
The two second-order partial derivatives are computed as follows. First, we compute the first-order partial derivatives for each 2D CT slice along the x- and y-axes. Then, we calculate the second-order partial derivatives for each 2D CT slice along the z-axis, as shown in Equations (2) and (3), respectively:  
\[H_{x}(S)=\begin{bmatrix}\frac{\partial^{2}S}{\partial x_{11}\partial z_{11}}& \cdots&\frac{\partial^{2}S}{\partial x_{1M}\partial z_{1M}}\\ \vdots&\ddots&\vdots\\ \frac{\partial^{2}S}{\partial x_{11}\partial z_{11}}&\cdots&\frac{\partial^ {2}S}{\partial x_{NM}\partial z_{NM}}\end{bmatrix} \tag{2}\]  
\[H_{y}(S)=\begin{bmatrix}\frac{\partial^{2}S}{\partial y_{11}\partial z_{11}}& \cdots&\frac{\partial^{2}S}{\partial y_{1M}\partial z_{1W}}\\ \vdots&\ddots&\vdots\\ \frac{\partial^{2}S}{\partial y_{1M}\partial z_{NM}}&\cdots&\frac{\partial^ {2}S}{\partial y_{NM}\partial z_{NM}}\end{bmatrix} \tag{3}\]  
where \(S\) represents a CT slice and \(N\) and \(M\) are the height and width of the slice, respectively. Then, by stacking the second-order partial derivatives of all the CT slices, we obtain \(\frac{\partial^{2}f(x,y,z)}{\partial z\partial z}\) and \(\frac{\partial^{2}f(x,y,z)}{\partial y\partial z}\), respectively. Like the encoder in UNETR++, our gradient-based encoders also have a four-stage encoding procedure in order to learn the 3D geometric features.  
Figure 2: The proposed gradient-enhanced encoder scheme, consisting of two proposed gradient-based encoders (**left** and **middle**) and the encoder in the UNETR++ framework (**right**).  
As shown in Figure 3, the proposed gradient-enhanced encoders take the two second-order partial derivatives that enhance the local curvature and edge information of the anatomical structures in medical images as the input and then learn these features in a hierarchical manner. Across different stages of the encoding process, the gradient-enhanced encoders are able to preserve important structural details. This hierarchical approach ensures that the geometric information crucial for segmentation remains discernible, preserving the fine details necessary for distinguishing the liver from its adjacent structures.