## 2 Materials and Methods
### Neural Network and Training  
The BRAU-Net++ neural network architecture was chosen for the segmentation task required for automatic VBQ determination. This u-shaped architecture is a hybrid CNN-transformer network that uses bi-level routing attention (BRA) as the core building block for its encoder-decoder structure. It also uses skip connection channel-spatial attention (SCCSA) which adopts convolution operations, aiming to minimize local spatial information loss and amplify the global dimension interaction of multi-scale features [20]. The code for the BRAU-Net++ neural network can be downloaded at: [[https://github.com/Caipengzhou/BRAU-Netplusplus/tree/master](https://github.com/Caipengzhou/BRAU-Netplusplus/tree/master)]([https://github.com/Caipengzhou/BRAU-Netplusplus/tree/master](https://github.com/Caipengzhou/BRAU-Netplusplus/tree/master)) (accessed on 10 June 2024). The loss function used for training the dataset was the same that used by the authors of the original article for Synapse dataset training. It is a hybrid loss function that combines both dice loss and cross-entropy loss. Dice loss (\(L_{\textit{dice}}\)), cross-entropy loss (\(L_{\textit{ce}}\)) and hybrid loss (L) are defined as follows:  
\[L_{\textit{dice}}=1-\sum_{k}^{K}\frac{2\omega_{k}\sum_{i}^{N}p(k,i)g(k,i)}{ \sum_{i}^{N}p^{2}(k,i)+\sum_{i}^{N}g^{2}(k,i)}\ \, \tag{1}\]  
\[L_{ce}=-\frac{1}{N}\sum_{i=1}^{N}G(k,i)\cdot log\ (P(k,i))+(1-G(k,i))\cdot log\ (1-p(k,i))\, \tag{2}\]  
\[L=\lambda L_{\textit{dice}}+(1-\lambda)L_{ce}\, \tag{3}\]  
where N is the number of pixels; \(G(k,\,i)\in(0,\,1)\) and \(P(k,\,i)\in(0,\,1)\) indicate the ground truth label and the produced probability for class k, respectively; K is the number of classes; \(\sum_{k}\omega_{k}=1\) is the weight sum of all classes; and \(\lambda\) is a weighted factor that balances the impact of \(L_{\textit{dice}}\) and \(L_{ce}\). In this study, \(\omega_{k}\) and \(\lambda\) are empirically set at 1 K and 0.6, respectively [20]. Figure 3 shows the BRAU-Net++ architecture and SCCSA module. To evaluate the performance of the neural network, the average dice similarity coefficient (DSC) is used, along with the precision, accuracy, recall and Jaccard index, also known as intersection-over-union (IoU). These evaluation metrics are calculated as follows:  
\[DSC=\frac{2\times TP}{2\times TP+FP+FN}\ \, \tag{4}\]  
\[Accuracy=\frac{TP+TN}{TP+TN+FP+FN}\ \, \tag{5}\]  
\[Precision=\frac{TP}{TP+FP}\ \, \tag{6}\]  
\[Recall=\frac{TP}{TP+FN}\ \, \tag{7}\]\[IoU=\frac{TP}{TP+FP+FN}\ \, \tag{8}\]  
where _TP_, _FP_, _TN_ and _FN_ are true positive, false positive, true negative and false negative. As can be seen from Equations (4) and (8), the IoU can be expressed as \(IoU=DSC/(2\text{-}DSC)\). Nevertheless, the \(IoU\) value was calculated for the sake of completeness. Neural network predictions can formally be separated into these categories using a confusion matrix algorithm implemented in the Python programming language. These evaluation metrics can be used to compare the performance of BRAU-Net++ and other modern neural network architectures. nnU-Net, a self-configuring deep learning-based framework for medical image segmentation, has gained acceptance in the medical image analysis community as a state-of-the-art approach for 3D image segmentation tasks [21; 24]. Since nnU-Net was trained on the dataset used for this work, its performance can be directly compared to the performance of the BRAU-Net++ network. The BRAU-Net++ neural network was trained over 400 epochs with the public dataset described above. The training was performed using an HP Z8 G4 workstation with an NVIDIA Quadro P6000 graphics card. The trained neural network model was then used to segment the dataset of 166 series acquired from the resident hospital. Figure 3: The architecture of the BRAU-Net++, which is constructed based on the BiFormer block.