## 3 Results and Discussion  
### Performance of the Instance Segmentation  
The size distribution of the Xiyu conglomerate was analyzed by segmenting the CT images. After iterative adjustments, the best algorithms were selected based on the validation results from UNet, HRNet, SegFormer, and the modified SegFormer. As depicted in Figure 9, the improved SegFormer generates binary and grayscale segmented images.  
Three metrics, namely, intersection over union (IoU), dice coefficient, and F1 score, are employed to evaluate the predictive performance of different models. The intersection over union (IoU) measures the extent of overlap between the predicted positive samples and the actual positive samples.  
\[IoU=(TP)/(TP+FP+FN) \tag{13}\]  
In this context, TP represents the true positive count, FP represents the false positive count, and FN represents the false negative count. The IoU ranges from 0 to 1, with higher values indicating a greater overlap between the predicted results and the actual labels. An IoU of 1 indicates a perfect match between the predicted results and the actual labels.  
The dice coefficient measures the similarity between the predicted positive samples and the actual positive samples, similar to IoU. The dice coefficient is more robust in handling segmentation tasks with class imbalance.  
\[\text{Dice}=(2\times\text{TP})/(2\times\text{TP}+\text{FP}+\text{FN}) \tag{14}\]  
The F1 score combines the precision and recall of a model.  
\[\text{F1}=2\ \times\ (\text{Precision}\times\text{Recall})/(\text{ Precision}\ +\ \text{Recall}) \tag{15}\]  
Precision is the ratio of true positive predictions to all the positive predictions, while recall is the ratio of true positive predictions to all the actual positive samples.  
The evaluation results of the three metrics for the four methods are presented in Table 1. It is evident that the SegFormer model outperforms UNet and HRNet in terms of accuracy by a significant margin. Additionally, HRNet exhibits slightly better accuracy than UNet. UNet performs exceptionally well in low-resolution images or small-sample segmentation tasks. However, when it comes to high-resolution CT image instance segmentation tasks, the decoder of UNet may not effectively handle long-range dependencies within high-resolution images. For certain instance segmentation tasks, instances may exhibit extensive feature connections, and the local feature propagation of UNet may be insufficient to capture such global dependencies. Moreover, in terms of multi-scale processing, the images may contain subtle structures and regions at different scales. HRNet is capable of handling these subtle differences without sacrificing resolution. In comparison, UNet primarily relies on the encoder-decoder architecture for information propagation and lacks the advantage of HRNet's multi-branch approach for handling multi-scale information.  
Figure 9: Comparison of the segmentation results with different networks. (**a**) Original image, (**b**) gray-scale image, (**c**) improved SegFormer-generated image, (**d**) UNet-generated image, (**e**) HRNet-generated image, (**f**) SegFormer-generated image.  
The SegFormer model demonstrated significant improvements in all the evaluation metrics compared to HRNet, particularly in accurately identifying pores. The SegFormer model incorporates a hierarchical Transformer encoder, efficiently handling multi-scale information. This is crucial for high-resolution CT image instance segmentation tasks, where images may contain details and structures at different scales. By effectively capturing these subtle differences, SegFormer enhances the accuracy of instance segmentation.  
Through progressively integrating different features, the improved SegFormer model pays more attention to the distinctions between features at different scales, further enhancing segmentation accuracy, especially in recognizing matrices. The dice coefficient improved by 6.57, and the IoU improved by 8.79. The improved recognition results of SegFormer are displayed in Figure 10.