SAMamba3D: Adapting segment anything for generalizable three-dimensional segmentation of multiphase pore-scale images
Abstract
Reliable segmentation of multiphase pore‑scale X‑ray images of rocks is necessary to quantify fluid saturation, connectivity, and interfacial geometry. However, current three‑dimensional segmentation methods are typically dataset‑specific, requiring retraining or extensive fine‑tuning whenever rock type, fluid pattern, scanner, or acquisition conditions change. Foundational models such as the Segment Anything Model provide strong two‑dimensional boundary priors, but they are not directly applicable to three‑dimensional data. This study presents SAMamba3D, a parameter‑efficient framework that adapts a largely frozen segment anything model encoder to generalizable three‑dimensional pore‑scale segmentation by coupling it with Mamba‑based volumetric context modeling and progressive cross‑scale feature interaction. For sandstone and carbonate datasets, with different fluids, wettability, and scanning conditions, SAMamba3D matches or outperforms current three‑dimensional baselines while reducing the need for case‑specific retraining. The resulting segmented images preserve physically meaningful descriptors, including fluid saturation, connectivity, and interface morphology, enabling more reliable and rapid analysis of large three‑dimensional multiphase images.
Document Type: Original article
Cited as: Zhang, R., Song, X., Zhu, L., Bijeljic, B., Li, G., Blunt, M. J. SAMamba3D: Adapting segment anything for generalizable three‑dimensional segmentation of multiphase pore‑scale images. Advances in Geo‑Energy Research, 2026, 21(2): 109‑124. https://doi.org/10.46690/ager.2026.08.03
DOI:
https://doi.org/10.46690/ager.2026.08.03Keywords:
X-ray micro-computed tomography, multiphase pore-scale imaging, three-dimensional image segmentation, foundational model adaptation, cross-domain generalizationReferences
Alhammadi, A. M., AlRattour, A., Singh, K., et al. In situ characterization of mixed‑wettability in a reservoir rock at subsurface conditions. Scientific Reports, 2017, 7: 10753.
Alhosani, A., Bijeljic, B., Blunt, M. J. Pore‑scale imaging and analysis of wettability order, trapping and displacement in three‑phase flow in porous media with various wettabilities. Transport in Porous Media, 2021, 140: 59‑84.
Alqahtani, N. J., Niu, Y., Wang, Y., et al. Super‑resolved segmentation of X‑ray images of carbonate rocks using deep learning. Transport in Porous Media, 2022, 143(2): 497‑525.
AlZahrani, H. M., Bijeljic, B., Chai, R., et al. Pore‑scale analysis and visualization of tertiary cationic surfactant flooding in a complex carbonate. ACS Omega, 2025, 10(43): 51383‑51395.
Bashir, A., Ali, M., Patil, S., et al. Comprehensive review of CO₂ geological storage: Exploring principles, mechanisms, and prospects. Earth‑Science Reviews, 2024, 249: 104672.
Blunt, M. J., Bijeljic, B., Dong, H., et al. Pore‑scale imaging and modelling. Advances in Water Resources, 2013, 51: 197‑216.
Buades, A., Coll, B., Morel, J. M. A non‑local algorithm for image denoising. Paper Presented at IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), NW Washington, DC, United States, 20‑26 June, 2005.
Bultreys, T. Estallades carbonate # 2. National Science Foundation: Digital Rocks Portal, 2016.
Chen, C., Miao, J., Wu, D., et al. MA‑SAM: Modality‑agnostic SAM adaptation for 3D medical image segmentation. Medical Image Analysis, 2024, 98: 103310.
Dalton, L. E., Klise, K. A., Fuchs, S., et al. Methods to measure contact angles in scCO2‑brine‑sandstone systems. Advances in Water Resources, 2018, 122: 278‑290.
Du, S., Shi, Y. Concise extraction and characterization of the pore‑throat network in unconventional hydrocarbon reservoirs: A new perspective. Petroleum Science, 2024, 21(3): 1474‑1487.
Gao, Y., Foroughi, S., Ma, Z., et al. Gradient information enhanced image segmentation and automatic in situ contact angle measurement applied to images of multiphase flow in porous media. Water Resources Research, 2024, 60(9): e2023WR036869.
Gao, Y., Raeini, A. Q., Selem, A. M., et al. Pore‑scale imaging with measurement of relative permeability and capillary pressure on the same reservoir sandstone sample under water‑wet and mixed‑wet conditions. Advances in Water Resources, 2020, 146: 103786.
Gu, A., Dao, T. Mamba: Linear‑time sequence modeling with selective state spaces. arXiv Preprint arXiv: 2312.00752, 2023.
Hatamizadeh, A., Nath, V., Tang, Y., et al. Swin UNETR: Swin transformers for semantic segmentation of brain tumors in MRI images. Paper Presented at Brainlesion: Glioma, Multiple Sclerosis, Stroke and Traumatic Brain Injuries, Virtual Event, 27 September, 2021.
Hu, E. J., Shen, Y., Wallis, P., et al. LoRA: Low‑rank adaptation of large language models. arXiv Preprint arXiv:2106.09685, 2021.
Iassonov, P., Gebrenegus, T., Tuller, M. Segmentation of X‑ray computed tomography images of porous materials: A crucial step for characterization and quantitative analysis of pore structures. Water Resources Research, 2009, 45: W09415.
Isensee, F., Jaeger, P. F., Kohl, S. A. A., et al. nnU‑Net: A self‑configuring method for deep learning‑based biomedical image segmentation. Nature Methods, 2021, 18: 203‑211.
Jangda, Z., Menke, H., Busch, A., et al. Subsurface hydrogen storage controlled by small‑scale rock heterogeneities. International Journal of Hydrogen Energy, 2024, 60: 1192‑1202.
Jia, Y., Zhu, J., Jia, N., et al. Direct prediction of capillary pressure curves from cross‑size digital rock images based on a spatial pyramid pooling convolutional network. Physics of Fluids, 2025, 37(12): 126610.
Kirillov, A., Mintun, E., Ravi, N., et al. Segment anything. Paper Presented at IEEE/CVF International Conference on Computer Vision (ICCV), Paris, France, 2‑6 October, 2023.
Lin, Q., Bijeljic, B., Berg, S., et al. Minimal surfaces in porous media: Pore‑scale imaging of multiphase flow in an altered‑wettability Bentheimer sandstone. Physical Review E, 2019, 99(6): 063105.
Lin, Q., Bijeljic, B., Pini, R., et al. Imaging and measurement of pore‑scale interfacial curvature to determine capillary pressure simultaneously with relative permeability. Water Resources Research, 2018, 54(9): 7046‑7060.
Lin, T., Goyal, P., Girshick, R., et al. Focal loss for dense object detection. Paper Presented at IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22‑29 October, 2017.
Liu, C., Shan, L., Zhao, J., et al. Deep learning in digital rock technology: A comprehensive review. Advanced Intelligent Engineering, 2026, 1(1): 4‑20.
Ma, J., He, Y., Li, F., et al. Segment anything in medical images. Nature Communications, 2024, 15(1): 654.
Ma, J., Li, F., Wang, B. U‑Mamba: Enhancing long‑range dependency for biomedical image segmentation. arXiv Preprint arXiv: 2401.04722, 2024.
Myronenko, A. 3D MRI brain tumor segmentation using autoencoder regularization. Paper Presented at Brainlesion: Glioma, Multiple Sclerosis, Stroke and Traumatic Brain Injuries, Granada, Spain, 16 September, 2018.
Niu, Y., Mostaghimi, P., Shabaninejad, M., et al. Digital rock segmentation for petrophysical analysis with reduced user bias using convolutional neural networks. Water Resources Research, 2020, 56(2): e2019WR026597.
Perez, E., Strub, F., de Vries, H., et al. FiLM: Visual reasoning with a general conditioning layer. Paper Presented at AAAI Conference on Artificial Intelligence (AAAI), New Orleans, Louisiana, 2‑7 February, 2018.
Salehi, S. S. M., Erdogmus, D., Gholipour, A. Tversky loss function for image segmentation using 3D fully convolutional deep networks. arXiv Preprint arXiv:1706.05721, 2017.
Scanziani, A., Singh, K., Blunt, M. J., et al. Automatic method for estimation of in situ effective contact angle from X‑ray micro tomography images of two‑phase flow in porous media. Journal of Colloid and Interface Science, 2017, 496: 51‑59.
Scanziani, A., Singh, K., Bultreys, T., et al. In situ characterization of immiscible three‑phase flow at the pore scale for a water‑wet carbonate rock. Advances in Water Resources, 2018, 121: 446‑455.
Schluter, S., Sheppard, A., Brown, K., et al. Image processing of multiphase images obtained via X‑ray microtomography: A review. Water Resources Research, 2014, 50(4): 3615‑3639.
Shan, L., Liu, Y., Du, K., et al. Drilling rock image segmentation and analysis using segment anything model. Advances in Geo‑Energy Research, 2024, 12(2): 89‑101.
Shojaei, M. J., Blunt, M., Bijeljic, B. X‑ray tomography dataset of steady‑state two‑phase flow in bentheimer sandstone. Digital Rocks Portal, 2023.
Siavashi, J., Mahdavira, M., Shojaei, M. J., et al. Segmentation of two‑phase flow X‑ray tomography images to determine contact angle using deep autoencoders. Energy, 2024, 288: 129698.
Singh, K., Menke, H., Andrew, M., et al. Time‑resolved synchrotron X‑ray micro‑tomography datasets of drainage and imbibition in carbonate rocks. Scientific Data, 2018, 5: 180265.
Tang, K., Armstrong, R. T., Mostaghimi, P., et al. Scaling deep learning for material imaging with a pseudo 3D model for domain transfer. Nature Communications, 2025, 16: 11293.
Tawfik, M., Karpyn, Z. T., Huang, S. Comparative study of traditional and deep‑learning denoising approaches for image‑based petrophysical characterization of porous media. Frontiers in Water, 2022, 3: 800369.
Wu, J., Ji, W., Liu, Y., et al. Medical SAM adapter: Adapting segment anything model for medical image segmentation. Medical Image Analysis, 2025, 102: 103547.
Xie, C., Zhu, J., Wang, J., et al. Direct prediction of relative permeability curve from 3D digital rock images based on deep learning approaches. International Journal of Rock Mechanics and Mining Sciences, 2023, 170: 105544.
Ye, S., Song, X., Ma, Z., et al. A noise‑resistant and annotation‑free supervoxel‑based algorithm for rapid segmentation of multiphase X‑ray images. Advances in Geo‑Energy Research, 2025, 16(1): 50‑59.
Yuan, Y., Zhang, L. C., Feng, Z. Natural Hydrogen: Geological Formation, Accumulation, and Resource Potential for a Low Carbon Future. Cham, Switzerland, Springer, 2026.
Zhu, L., Bijeljic, B., Blunt, M. J. Generation of pore‑space images using improved pyramid wasserstein generative adversarial networks. Advances in Water Resources, 2024, 190: 104748.
Zhu, L., Bijeljic, B., Blunt, M. J. Diffusion model‑based generation of three‑dimensional multiphase pore‑scale images. Transport in Porous Media, 2025, 152: 22.
Downloads
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Rui Zhang, Xianzhi Song, Linqi Zhu, Branko Bijeljic, Gensheng Li, Martin Blunt

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.