## 1 Introduction  
Soil supports over 95% of agricultural production, and soil erosion remains a major threat to the global environment and agriculture [1]. Therefore, appropriate technology is required to gain a better understanding of the properties and processes of eroded soil, particularly non-destructive and non-intrusive techniques such as computed tomography (CT), which can reduce interference with the soil structure [2; 3]. By combining CT scanning and advanced image processing technologies, a series of 2D grayscale slice images can be continuously generated and reconstructed into a complete 3D sample [4; 5; 6]. CT enables the study of the microstructures of complex soil pore networks [7; 8; 9] and has been widely used in soil science to investigate the properties and characteristics of soils at different scales, ranging from the pore scale to the field scale [10; 11]. The 3D segmentation of soil pores is foundational in pore research, facilitating the identification of pore structures in three dimensions and serving as a preliminary step for subsequent analyses [12]. Soil pore structures in CT imagery display dimensional variability, encompassing changes in horizontal shape and vertical connectivity, indicating neighborhood similarity across different CT images within the pore structure domain [13]. However, existing segmentation methods fail to fully utilize the spatial information of CT images, leading to poor connectivity of segmented pores and difficulty in improving segmentation accuracy. In recent years, deep learning methodologies have achieved remarkable advancements in accuracy and generalizability when tackling the task of CT image segmentation [14; 15]. Notably, they excel at biological imaging [16; 17]. However, the morphology and physical properties of pores in soil CT images are more complex and heterogeneous compared to those in biological images [18; 19]. The complexity of soil CT images poses a challenge to the identification of pores [20]. Fortunately, the InDuDoNet+ model effectively reduces artifacts produced by CT equipment [21], while [PERSON] et al. (2023) have used deep unfolding networks to enhance image resolution [22]. These methods based on deep unfolding networks provide higher-quality data for CT image segmentation, helping to improve the accuracy of segmentation results. [PERSON] et al. (2021) and [PERSON] et al. (2022) achieved good accuracy when segmenting 2D CT images of sandstone [23; 24]. [PERSON] et al. (2019) investigated soil pore segmentation using 2D CT images [25]. [PERSON] et al. (2023) used an improved U-Net to segment dye-tracing images [26]. Although significant progress has been made in tackling the challenge of segmenting soil pores, uncertainties remain regarding the harmonization of spatial information in segmentation. Spatial information contained within soil CT scan images, which is critical for three-dimensional soil reconstruction and multi-scale modeling, is currently underutilized. Existing 3D image segmentation methods can be divided into three primary categories: (I) 2D models such as U-Net are used to segment individual 2D image slices [27; 28]. The resulting 2D segments are then concatenated to generate 3D segments [25; 29; 30]. However, based on a lack of consideration for spatial connectivity during image segmentation, gaps between neighboring slices may appear abruptly. (II) To obtain better results, it is feasible to replace 2D convolution with 3D convolution [31; 32; 33]. However, this imposes a heavier burden on computational resources for network training, leading to high computational costs. Additionally, 3D images are expensive and complex to acquire, and the quantity of available samples is insufficient for deep learning purposes. (III) A recurrent neural network (RNN) can be used to concatenate 2D image slices [34; 35]. For example, to exploit 3D context, [PERSON] et al. (2015) and [PERSON] et al. (2016) utilized a long short-term memory (LSTM) network [36; 37].