Manuscript Offprint
arXiv:2611.07865OcTreeMamba: Topology-Aware Mamba for 3D Medical Segmentation via Octree Sparsification
Kaixiang Mai, Jiaqi Yu, Yuzhu Ji, Yiqun Zhang, Zhijie Wang, Haijun Zhang, Yiu-ming Cheung
Guangdong University of Technology, Guangzhou, China, RIKEN Center for Advanced Intelligence Project, Tokyo, Japan, Harbin Institute of Technology, Shenzhen, China, Hong Kong Baptist University, Hong Kong, China
Abstract—Accurate segmentation of 3D anatomical structures is crucial to medical image analysis. Recently, Mamba-based approaches have achieved promising segmentation performance in capturing long-range dependencies with linear-time computational complexity. However, heuristic selective scanning strategies inherently disrupt the intrinsic spatial hierarchy and increase computational redundancy, ignoring the inherent sparsity of 3D anatomical structures. To this end, we propose OcTreeMamba, a hierarchical framework that incorporates Octree structures into SSM, achieving 3D topology-aware long-range context feature propagation and integration. Specifically, a Structure Learner performs anatomy-adaptive structured sparsification through hierarchical gating and Gumbel-Softmax sampling, enabling differentiable selection of anatomical regions. The selected regions are subsequently organized by a Dynamic Octree Builder into a multi-level topology that preserves their hierarchical connectivity. Based on the constructed Octree, a bidirectional Tree-SSM propagates and integrates contextual features along connectivity-aware leaf-parent-root and root-parent-leaf trajectories. Extensive experiments on four benchmark datasets show that our proposed OcTreeMamba achieves competitive performance w.r.t. topological continuity and computational efficiency, particularly for recovering the complex structure on vascular datasets. The code is available here.
Index Terms—Octree structure, State space model, Mamba, Dynamic scan path, Medical image segmentation
I. INTRODUCTION
Automatic segmentation of anatomical structures, such as blood vessels, airways, tumors, and organs, is a foundation task in computer-aided medical image analysis and facilitates disease diagnosis, treatment planning and surgical navigation [1]–[3]. Deep Convolutional Neural Networks (DCNNs), particularly the U-Net [4] and its variants [5]–[10], have achieved remarkable progress in medical image segmentation. However, the locality of convolutional operations inherently limits their ability to capture long-range dependencies within confined receptive fields. Therefore, CNN-based models with residual connections [11], deformable convolutions [12], large kernels [13] and attention mechanisms [14] have been proposed for capturing long-range contextual features. However,

Fig. 1. Motivation of OcTreeMamba. (a) Dense scanning over 3D grids disrupts local anatomical adjacency and increases computation redundancy on non-informative background regions. (b) Anatomy-aware sparse octree topology constructed in OctreeMamba aims to propagate features along foreground structures through hierarchical interactions, improving topology preservation and structure-aware segmentation while maintaining a memory-performance balance.
it remains challenging for CNN models to segment anatomical structures, such as vessels and tumors, with intricate branching patterns, irregular shapes or elongated morphology. In contrast, Vision Transformer (ViT)-based methods [15]–[20] were proposed to model global contextual relations by using a dense query-based self-attention block. However, the quadratic computational and memory complexity in terms of the number of tokens becomes the bottleneck when applying it to 3D voxel grids. In addition, ViT-based models practically rely on sliding-window strategies and aggressive downsampling, which, to some extent, impedes the recovery of fine-grained structures with spatial details.
Recently, State Space Models (SSMs) [21], particularly the Mamba architecture [22], have been proposed for vision and natural language processing tasks. Due to efficiency for long-term feature propagation and linear scalability with the sequence length, SSM-based models have drawn significant attention [23], [24]. For medical image segmentation, Mamba-based frameworks, such as U-Mamba [25], Vim [26] and VMamba [27], have been developed. To perform sequence modeling for the 3D volumetric data, these approaches practically flatten the dense spatial grids into 1D sequences.
Corresponding author: Yuzhu Ji
This work was supported in part by the National Natural Science Foundation of China (NSFC) under Grants 62302104 and 62476063, the Guangdong Basic and Applied Basic Research Foundation under Grants 2026A1515011337 and 2025A1515011293, and the Science and Technology Planning Project of Guangdong under Grant No. 2021B0101220006.
Generally, handcrafted scanning patterns are introduced to obtain rich contextual relations with dense spatial traversal. However, the handcrafted scanning with fixed patterns practically corrupts the intrinsic spatial relations and makes it fail to capture the geometry and spatial distribution of anatomical structures effectively [25]. Moreover, adjacent voxels in the 3D non-causal volume data are widely separated when scanning the 1D sequence, causing inaccurate segmentation results with topological inconsistencies. In addition, the scanning algorithm generally propagates hidden states among voxels, without identifying whether the voxels contain valid contextual features. It thus increases a large amount of redundant computation and latency on multiple traversals for propagating features across structurally irrelevant regions, such as backgrounds and imaging noise. Furthermore, the sequential context feature propagation on dense grids leads to misalignment with the topology and sparse distribution of anatomical structures (see Fig. 1(a)).
We argue that, to achieve topology-preserving and computationally efficient sequence modeling, the scanning trajectories should: 1) align with the topologies of anatomical structures intrinsically, and 2) be adaptively sparse by filtering out non-informative nodes. Therefore, instead of introducing multiple handcrafted dense traversal trajectories, we reformulate feature propagation in SSM over a sparse tree-based topology to conform the propagation paths to the intrinsic anatomical structures (see Fig. 1(b)). To this end, we propose OcTreeMamba, a novel topology-adaptive state space model for 3D medical image segmentation. Our key technical insight is to reformulate feature propagation on a sparse yet efficient Octree topology on dense grids. Specifically, the proposed model consists of three key modules: 1) A Structure Learner is designed to perform differentiable anatomy-adaptive sparsification through hierarchical gating and Gumbel-Softmax sampling, enabling informative anatomical regions to be selected in an end-to-end manner; 2) A Dynamic Octree Builder is proposed to organize the selected regions into a multi-level Octree topology while preserving their hierarchical connectivity; 3) A bidirectional Tree-SSM is developed to facilitate efficient feature aggregation and broadcasting along connectivity-aware bidirectional tree traversal. Experimental results on four benchmark datasets demonstrate that OcTreeMamba achieves competitive segmentation accuracy and state-of-the-art topology preservation on vascular datasets, while maintaining a favorable memory-performance balance on dense organ and lesion segmentation tasks. In summary, our main contributions are threefold:
-
We propose a novel Octree-based Mamba framework for 3D medical image segmentation. To the best of our knowledge, we are the first to integrate the hierarchical Octree structure to perform feature propagation along tree topology in SSM-based models for medical image segmentation.
-
We develop a hierarchical Octree construction mechanism for preserving the differentiability of the framework, while dynamically sparsifying the Octree to enable semantic-driven structure learning.
-
We present a topology-aware bidirectional feature propagation by adapting the Tree-SSM. It reformulates conventional scan paths as hierarchical propagation along Octree connectivity, enabling long-range dependency modeling while preserving local topology.
A. CNN-based Models
CNN-based models, e.g., U-Net and nnU-Net [4], [7], have prevailed in the field of medical image segmentation due to their ability to extract representative local features, becoming foundational architectures for various medical image analysis tasks [5], [9], [28], [29]. Generally, these architectures introduce skip connections [4] and multi-scale feature fusion [9], [10], to integrate local and global contextual features and recover spatial details from downsampled features. To process volumetric data, 3D U-Net [6] and V-Net [30] adapted 3D convolution operations to exploit inter-slice correlations in volumetric data. Subsequent works further augmented this paradigm by incorporating residual learning [31] and attention mechanisms [5], [32], enabling the network to focus on discriminative regions while suppressing background noise. However, this efficiency stems from their reliance on local convolutions, which predict voxel-wise labels based on limited receptive fields, and thus struggle to capture long-range dependencies and global semantic context.
B. Transformer-based Models
To overcome the locality limitations of CNNs, Dosovitskiy et al. [15] introduced Vision Transformers (ViT) by using self-attention to model global dependencies, inspiring CNN-ViT hybrid architectures for medical image segmentation. Specifically, Chen et al. [17] pioneered TransUNet [17] by integrating a Transformer bottleneck into a CNN encoder-decoder architecture for global context modeling. Subsequently, Hatamizadeh et al. [33] presented UNETR, a pure Transformer framework that processes 3D volumetric patches with a ViT encoder to capture long-range dependencies. Furthermore, Hatamizadeh et al. [19] developed Swin-UNETR, incorporating shifted-window attention to reduce the cost of dense self-attention. However, applying Transformers to 3D images remains constrained by quadratic computational complexity [15], [33], [34]. Different from these approaches, OcTreeMamba avoids dense pairwise interactions over volumetric tokens by organizing informative anatomical regions into a hierarchical octree and propagating long-range structural information through the SSM, while retaining a dense convolutional pathway to preserve local details.
C. Mamba-based Models
To capture long-range dependencies while preserving linear computational efficiency, the State Space Model (SSM) and its variants [21], [35], [36] have been introduced for both vision and natural language processing tasks. Specifically, S4 [21] was proposed by improving the original SSM using structural constraints on the state matrix and initializing it with High-Order Polynomial Projection Operator (HIPPO) [37].

Fig. 2. Overview of the proposed OcTreeMamba. The overall model (a) is built upon a UNet encoder-decoder framework. The Octree Encoder (b) is the core component, which consists of three modules: a topology-aware Structure Learner (c) for identifying active anatomical regions, a Dynamic Octree Builder (d) for constructing hierarchical sparse topology, and a bidirectional Tree-SSM Propagation module (e) for topology-aware long-range feature modeling.
Gu et al. [22] developed Mamba, also known as S6, by introducing the selective scan mechanism and achieving inference complexity and parallel training capability. Furthermore, considering the non-causal nature of images, Vim [26] and VMamba [27] incorporate strategies to traverse image patches via multiple heuristic scanning paths. Recently, hybrid architectures integrating Mamba with U-Net or Transformers, such as U-Mamba [25] and SegMamba-V2 [38], have been proposed for 3D medical image segmentation by adapting the handcrafted scanning patterns to the 3D space along tri-plane perspectives. However, these methods still rely on predefined dense scanning paths without learning anatomy-adaptive hierarchical representations, separating adjacent 3D voxels and causing topological inconsistencies [27], [39], [40]. In contrast, OcTreeMamba selects informative anatomical regions, organizes them into a hierarchical Octree, and propagates features along topology-aware traversal paths with less redundant computation over background regions.
III. METHOD
A. Overview
As shown in Fig. 2, OcTreeMamba is built upon an encoder-decoder architecture. The core of the framework is the Octree Encoder, which consists of a topology-aware structure learner, a dynamic octree builder and a bidirectional Tree-SSM propagating module (Fig. 2(c)-(e)). Specifically, the topology-aware Structure Learner predicts active anatomical masks from the dense feature map, and the Dynamic Octree Builder constructs a hierarchical octree topology leveraging the predicted semantic activation masks. The Bi-directional Tree-SSM Propagation module performs topology-aware feature propagation over the constructed octree to model long-range semantic dependencies among sparse anatomical re-
gions. The obtained features are upsampled and re-injected into the dense backbone through residual fusion, followed by downsampling operations to produce the output feature map at multiple scales. This design preserves fine-grained spatial details while integrating local and global structural context through topology-aware Tree-SSM propagation.
B. Structure Learner
For 3D medical image data, anatomical regions for segmentation generally occupy only a limited portion of the volumetric space. In contrast, background regions and homogeneous interiors contribute little to long-range structural modeling. Directly applying state-space propagation to the dense grid not only introduces redundant computation but also weakens the structural responses of sparse foreground regions in sequential modeling. Therefore, before constructing the octree topology, we designed a structure learner to locate anatomy-relevant regions for subsequent topology-aware propagation.
Given an input feature , the structure learner produces activation scores at two complementary granularities, i.e., coarse- and fine-grained predictions. Specifically, the coarse predictor produces binary activation scores :
where denotes the prediction scores for the inactive and active states at each spatial location. MaxPool() represents a max-pooling operation to reduce the feature resolution. This coarse prediction aims to provide a stable semantic prior for suppressing large irrelevant regions. In parallel, a fine predictor operates on the original resolution and produces fine-grained activation map to capture boundary details:
To enable end-to-end optimization of discrete structure selection, a Gumbel-Softmax relaxation is introduced to provide differentiable approximations to the binary activation decisions. For each prediction granularity , the relaxed activation probability is computed as:
where and denote the activation score and relaxed probability for decision at granularity . The indices and represent the inactive and active decisions. denotes Gumbel noise, and is the temperature coefficient. By applying the Gumbel-Softmax relaxation, two binary activation masks can be derived by selecting the most probable activation state:
where is the indicator function. and denote the coarse- and fine-grained binary masks, respectively. The hard binary masks are used in the forward pass, while gradients are propagated through the corresponding soft probabilities, enabling end-to-end optimization of the discrete structure.
In practice, these two binary activation masks describe structural activation w.r.t. different granularities. Intuitively, the coarse mask provides region-level semantic reliability, whereas the fine mask preserves local boundary and thin-structure responses. To enforce hierarchical consistency between the two scales, we introduce a top-down gating mechanism:
where denotes element-wise logical intersection, which retains a voxel only when it is activated by both the fine-scale predictor and its corresponding coarse-scale parent, thereby suppressing isolated activations from local predictions. Such a multi-granularity compensation design is important for sparse and elongated anatomical structures, where both global support localization for the Octree structure and local boundary preservation are required for achieving accurate segmentation.
C. Dynamic Octree Builder
The activation mask produced by the Structure Learner identifies active voxels through , but these voxels remain isolated spatial locations without defining the hierarchical connections and interactions. Thus, our Dynamic Octree Builder further converts the sparse voxels into a hierarchical Octree topology. Specifically, for any active leaf node at spatial coordinate (where ), the Octree hierarchy is established by recursively mapping it to its ancestors via coordinate quantization:
where and denote the parent and grandparent nodes of , respectively. More generally, the ancestor can be obtained by recursively quantizing the coordinates of its predecessor nodes. In this way, spatially adjacent active voxels are naturally grouped into shared parent nodes, and distant regions can interact through higher-level ancestors. In our implementation, the unstructured sparse mask is thereby transformed into a connected multi-level tree topology for the Tree-SSM message passing.
D. Bidirectional OcTree-SSM Feature Propagation
The core insight of our proposed method is to perform feature propagation via hierarchical sparse tree traversal along the learned octree. Inspired by [40], a bidirectional hierarchical Octree-topology feature propagation mechanism is developed to model long-range dependencies through bottom-up aggregation and top-down broadcasting. Intuitively, the bottom-up propagation aims to condense local responses into coarse structural states, allowing spatially separated active regions to interact through their shared ancestors. Top-down broadcasting is tailored to redistribute the contextual information to refine parent and leaf representations, while the input-conditioned channel-wise modulations selectively control information flow at each propagation stage. Consequently, long-range structural dependencies can be modelled over sparse active nodes maintaining the learned hierarchical topology.
Let , and denote the active leaf, parent, and grandparent node sets, respectively. For a leaf node , denotes its local feature, denotes its parent, and denotes the grandparent of a parent node . We define the input-conditioned modulation used in different propagation stages. In the bottom-up direction, leaf features are first aggregated to their parent nodes:
where is the SiLU activation function, denotes a multi-layer perception for producing parameters. This vector is used for channel-wise selective modulations rather than dense transition matrices. The superscript indicates selective modulation applied in bottom-up aggregation. Similarly, the parent states are further aggregated to grandparent nodes:
At the grandparent level, we apply an input-conditioned modulation to obtain the contextual state:
where denotes the modulated state stored at grandparent node . This bottom-up propagation condenses sparse local responses into coarser structural states.
In the top-down direction, let retrieve the contextual state of grandparent nodes. The contextual state is then broadcast back to parent nodes:
where gates the grandparent context injected into the parent state, yielding the enhanced representation . Each
TABLE I QUANTITATIVE VALIDATION ON IMAGECAS, TOPCOW2024, BRATS2021, AND ABDOMENCT BENCHMARK DATASETS.
| Dataset | Method | Backbone | Segmentation | IoU↑ | Efficiency / Memory | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Dice↑ | cIDice↑ | HD95↓ | TM↓ | IM↓ | Param.↓ | TP↑ | ||||
| ImageCAS | nnU-Net | CNN | 81.54 | 86.60 | 16.03 | 69.16 | 5563.40 | 2706.91 | 30.79 | 42.55 |
| MedNeXt | CNN | 80.17 | 85.20 | 22.04 | 67.26 | 20959.74 | 4063.70 | 5.55 | 15.55 | |
| SegFormer3D | ViT | 79.39 | 85.72 | 16.80 | 66.08 | 2145.73 | 895.16 | 4.49 | 131.88 | |
| UNETR++ | ViT | 80.42 | 85.80 | 13.67 | 67.55 | 3995.28 | 1441.55 | 42.64 | 38.42 | |
| U-Mamba_Bot | Mamba | 82.11 | 87.17 | 13.19 | 70.00 | 11175.03 | 3173.21 | 42.12 | 18.91 | |
| SegMamba | Mamba | 81.22 | 85.63 | 17.42 | 68.70 | 16963.61 | 4454.63 | 67.36 | 9.55 | |
| SegMamba-V2 | Mamba | 81.13 | 85.82 | 17.04 | 68.56 | 15080.17 | 5457.21 | 138.77 | 11.70 | |
| OcTreeMamba_Bot | CNN+SSM | 82.31 | 87.67 | 12.88 | 70.23 | 5942.21 | 2771.79 | 34.78 | 36.57 | |
| OcTreeMamba_Enc | CNN+SSM | 81.91 | 87.18 | 14.32 | 69.67 | 15465.01 | 3030.85 | 40.57 | 25.14 | |
| TopCoW2024 | nnU-Net | CNN | 65.57 | 78.61 | 25.13 | 56.97 | 5491.87 | 2630.60 | 30.80 | 44.12 |
| MedNeXt | CNN | 66.82 | 79.01 | 26.54 | 58.47 | 20254.12 | 3917.88 | 5.56 | 15.76 | |
| SegFormer3D | ViT | 48.80 | 70.97 | 46.67 | 40.75 | 2925.81 | 862.44 | 4.50 | 130.13 | |
| UNETR++ | ViT | 64.96 | 76.97 | 28.60 | 56.00 | 4956.18 | 1440.80 | 42.64 | 37.60 | |
| U-Mamba_Bot | Mamba | 60.34 | 77.81 | 29.68 | 52.89 | 10879.82 | 3084.89 | 42.13 | 19.15 | |
| SegMamba | Mamba | 66.99 | 79.51 | 23.95 | 58.36 | 16419.50 | 4313.02 | 67.36 | 9.82 | |
| SegMamba-V2 | Mamba | 66.99 | 79.53 | 21.80 | 58.31 | 14640.62 | 5315.59 | 138.77 | 12.80 | |
| OcTreeMamba_Bot | CNN+SSM | 66.28 | 79.50 | 21.22 | 57.62 | 6258.60 | 2698.48 | 34.79 | 37.58 | |
| OcTreeMamba_Enc | CNN+SSM | 67.17 | 80.82 | 19.68 | 58.46 | 15311.03 | 2939.08 | 40.58 | 25.86 | |
| BraTS2021 | nnU-Net | CNN | 84.52 | – | 9.76 | 77.28 | 4887.71 | 2425.92 | 31.20 | 52.77 |
| MedNeXt | CNN | 84.42 | – | 10.38 | 77.30 | 17968.72 | 3527.31 | 5.55 | 18.16 | |
| SegFormer3D | ViT | 80.20 | – | 12.78 | 70.99 | 1816.21 | 823.51 | 4.53 | 140.08 | |
| UNETR++ | ViT | 83.75 | – | 10.99 | 76.39 | 4103.96 | 1470.90 | 42.65 | 38.81 | |
| U-Mamba_Bot | Mamba | 84.27 | – | 10.78 | 77.07 | 9706.80 | 2842.64 | 42.12 | 22.90 | |
| SegMamba | Mamba | 84.20 | – | 11.81 | 76.95 | 14708.65 | 3984.07 | 67.42 | 11.50 | |
| SegMamba-V2 | Mamba | 84.10 | – | 11.42 | 76.88 | 13183.95 | 4985.98 | 138.78 | 14.17 | |
| OcTreeMamba_Bot | CNN+SSM | 84.44 | – | 10.82 | 77.17 | 5262.46 | 2501.82 | 35.19 | 42.46 | |
| OcTreeMamba_Enc | CNN+SSM | 84.49 | – | 11.36 | 77.24 | 11586.51 | 2725.12 | 40.98 | 26.40 | |
| AbdomenCT | nnU-Net | CNN | 84.68 | – | 30.26 | 77.20 | 4803.27 | 2163.55 | 30.71 | 51.63 |
| MedNeXt | CNN | 85.71 | – | 28.73 | 78.41 | 14726.03 | 2848.82 | 5.56 | 22.00 | |
| SegFormer3D | ViT | 80.08 | – | 36.47 | 70.92 | 1962.25 | 649.71 | 4.50 | 133.79 | |
| UNETR++ | ViT | 86.05 | – | 21.00 | 78.96 | 4538.10 | 1435.92 | 42.64 | 36.98 | |
| U-Mamba_Bot | Mamba | 86.61 | – | 18.20 | 79.87 | 9234.50 | 2538.70 | 41.95 | 23.94 | |
| SegMamba | Mamba | 83.83 | – | 31.35 | 76.20 | 14445.62 | 3901.28 | 67.36 | 11.06 | |
| SegMamba-V2 | Mamba | 86.07 | – | 26.13 | 79.03 | 12980.15 | 4903.85 | 138.77 | 14.08 | |
| OcTreeMamba_Bot | CNN+SSM | 85.47 | – | 27.45 | 78.23 | 5539.05 | 2198.35 | 34.71 | 42.61 | |
| OcTreeMamba_Enc | CNN+SSM | 86.07 | – | 22.11 | 78.98 | 14011.68 | 5438.26 | 40.49 | 25.00 | |
active leaf then retrieves its enhanced parent context as , where denotes its parent. The sparse output feature is computed as:
where and are generated from , and denotes the layer-normalized linear projection. The enhanced sparse feature set is denoted as .
To integrate the sparse tree representations back into the dense backbone, we exploit a zero-initialized residual fusion strategy [41]. The enhanced sparse features are scattered back to the dense grid and fused with the original input:
where denotes learnable parameters, which are initialized to 0. Such initialization ensures the module initially acts as an identity mapping. During the training process, receives non-zero gradients when the sparse branch provides information that minimizes the loss, effectively acting as a “soft gate” to filter out early-stage noise. The fused tensor , now enriched with global topological semantics, is processed by the Dense Downsampling. Finally, the fused tensor
enriched with topological-aware context features is used to predict voxel-wise semantic segmentation results.
E. Loss Function
To optimize our model, we designed a hybrid loss function that simultaneously penalizes pixel-wise segmentation errors and discrete topological structural deviations:
where and are loss weights for the structural sparsity and auxiliary deep supervision loss terms, respectively. Specifically, represents the cross-entropy loss applied to the final network output. provides auxiliary deep supervision directly to the sparse module before the outcome is fused back into the dense backbone. This auxiliary term is crucial for the Octree-SSM module, as it forces the sparse branch to rapidly capture the intrinsic topological complexities independently, without solely relying on the gradients back-propagated from the dense decoder.
IV. EXPERIMENTS
A. Datasets and Evaluation Metrics
We performed experiments on four diverse 3D biomedical segmentation benchmarks, including ImageCAS [42] for

Fig. 3. Quantitative comparison with state-of-the-art methods on four datasets.
coronary artery segmentation, TopCoW24 [43] for circle of Willis segmentation, AbdomenCT [44] for multi-organ abdominal segmentation, and BraTS21 [45] for brain tumor segmentation. Segmentation performance is assessed using Dice Similarity Coefficient (DSC), Intersection over Union (IoU), and 95% Hausdorff Distance (HD95). For the topology-sensitive vascular datasets, centerline Dice (clDice) [46] is additionally reported. Computational efficiency is measured by the parameter count, throughput (TP, patches/s), training and inference memory usage (TM/IM, MiB).
B. Implementation Details
We built our model upon the nnUNet framework and implemented two versions of our model, i.e., OcTreeMamba_Bot and OcTreeMamba_Enc by setting the octree encoder in the bottleneck only and full encoder stages, respectively. The models are optimized using SGD with an initial learning rate of 2e-3, a weight decay of 3e-5, and a differential polynomial learning-rate decay strategy with a power of 0.9. The learning rate of the CNN backbone is set to half that of the sparse branch. The loss weights are set to and . We trained OcTreeMamba_Bot and OcTreeMamba_Enc for 500 and 1,000 epochs, respectively. All experiments are conducted on a workstation with four NVIDIA RTX 4090 GPUs.
C. Main Results
We compare our method with state-of-the-art models across three paradigms: (1) CNNs (including nnU-Net [7], Med-NeXt [47]); (2) Vision Transformers (UNETR++ [48], Seg-Former3D [49]); and (3) Dense SSMs (U-Mamba [25]). As shown in Table I, OcTreeMamba demonstrates better performance on topology-sensitive vascular segmentation while maintaining competitive results on tumor and multi-organ benchmarks. On the ImageCAS dataset, OcTreeMamba_Bot outperforms all compared methods, improving over nnU-Net by 0.77 Dice, 1.07 clDice, and 1.07 IoU, while reducing HD95 from 16.03 to 12.88. It indicates that bottleneck-level octree modeling is particularly effective for thin coronary
artery structures without substantially increasing memory cost. On the TopCoW2024 dataset, OcTreeMamba_Enc achieves the best performance, improving Dice by 1.6 and reducing HD95 by 5.45 compared with nnU-Net. On BraTS2021 and AbdomenCT, OcTreeMamba shows competitive accuracy compared with CNN, Transformer, and Mamba baselines. In particular, OcTreeMamba_Bot offers a better memory-performance balance, achieving substantially lower memory cost and higher throughput than dense Mamba-based methods while preserving comparable segmentation accuracy.
The qualitative comparisons in Fig. 3 further visualize these observations. On ImageCAS and TopCoW2024, OcTreeMamba produces more continuous vascular branches with fewer isolated false positives and class inconsistencies. On AbdomenCT, it better preserves both large-organ boundaries and small anatomical structures, while on BraTS2021 it maintains a coherent tumor shape comparable to the strongest baselines. These results demonstrate that the proposed hierarchical sparse modeling is effective across both curvilinear vascular structures and compact volumetric targets.
D. Ablation Study
We conducted ablation studies on the ImageCAS dataset to further analyze the effectiveness of OcTreeMamba, including the sparse traversing operator and different configurations of the Octree Encoder. Table II compares different operators within the octree-based traversing framework under both bottleneck-only and encoder-wide configurations, while Fig. 4 further evaluates the interaction between placement and learning rate scaling across different datasets. These studies aim to identify an effective accuracy-efficiency trade-off and examine how octree-based sparse modeling behaves under different architectural and optimization configurations.
a) Ablation on the proposed OcTreeMamba block: We ablate different feature aggregation strategies of OcTreeMamba. As shown in Table II, by replacing the feature aggregation with a point-wise MLP or convolution, the bottleneck version of baseline models improves upon the nnU-Net
TABLE II
ABLATION STUDY OF DIFFERENT SETTINGS OF OCTREEMAMBA BLOCK ON THE IMAGECAS DATASET.
| Component | Configuration | Segmentation Accuracy | Efficiency / Complexity | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Dice | clDice | HD95 | IoU | TM | IM | Param. | TP | ||
| nnU-Net | - | 81.54 | 86.60 | 16.03 | 69.16 | 5563.40 | 2706.91 | 30.79 | 42.55 |
| Octree + MLP | Bottleneck | 81.99 | 87.36 | 12.29 | 69.78 | 5942.70 | 2775.52 | 34.95 | 36.66 |
| Octree + Conv | Bottleneck | 81.93 | 87.28 | 12.52 | 69.71 | 5932.17 | 2763.18 | 34.03 | 37.07 |
| Octree + Self-Attn | Bottleneck | 82.20 | 87.66 | 11.70 | 70.08 | 5937.81 | 2768.66 | 34.44 | 36.40 |
| Octree + Tree-SSM | Bottleneck | 82.31 | 87.67 | 12.88 | 70.23 | 5942.21 | 2771.79 | 34.78 | 36.57 |
| Octree + MLP | Encoder | 81.63 | 87.18 | 11.87 | 69.24 | 11028.60 | 3034.45 | 41.05 | 26.51 |
| Octree + Conv | Encoder | 73.24 | 79.09 | 18.54 | 58.32 | 9227.00 | 3005.21 | 38.41 | 26.33 |
| Octree + Self-Attn | Encoder | 82.13 | 87.40 | 12.73 | 69.98 | 12075.42 | 3027.99 | 39.58 | 24.37 |
| Octree + Tree-SSM | Encoder | 81.77 | 87.14 | 13.59 | 69.48 | 14957.68 | 3042.41 | 40.57 | 24.80 |

Fig. 4. Ablation on different configurations of OcTreeMamba modules and learning rate strategy.

Fig. 5. Memory-performance analysis on training and inference memory cost(TM, IM) and 3D segmentation performance (Dice) on ImageCAS.
baseline, indicating that the octree-based sparse representation is more effective for modelling hierarchical anatomical structures. The performance drop of (+Conv) with 73.24 Dice may suggest convolutional operations lack an adequate receptive field for modelling long-range dependencies. In contrast, Self-Attention and our Tree-SSM, achieved superior performance. Specifically, Octree+Tree-SSM achieves superior performance on regional overlap of segmentation mask (Dice: 82.31), topological completeness (clDice: 87.67), and IoU (70.23). Although Self-Attention obtains the lowest HD95, Tree-SSM provides a more balanced performance across overlap, topology structure preservation, and efficiency-related metrics.
b) Ablation on different module configurations and learning rate strategy: Fig. 4 illustrates the impact of different model configurations (i.e., Bottleneck vs. Encoder) and the
different learning rate ratio ( vs. ). For module configuration, distributing the sparse OcTreeMamba modules across the encoder (Encoder) yields a Dice improvement on the multi-organ AbdomenCT dataset (86.07 vs. 85.72), but it decreases performance on ImageCAS. The superiority of OcTreeMamba_Enc on the AbdomenCT dataset indicates that multi-scale context is beneficial for capturing complex spatial relationships of large organs. Conversely, for the sparse vascular dataset, i.e., ImageCAS, applying sparse long-range modelling in the bottleneck layer is more effective than introducing it into high-resolution shallow layers. We believe that for curvilinear targets (i.e., ImageCAS, TopCoW2024), avoiding early-stage global interactions prevents interference from low-level background noise while maintaining higher computational efficiency. For the Learning Rate Strategy, increasing the ratio to provides metric gains on BraTS2021 under the Bottleneck setting. However, it shows performance drops on the AbdomenCT. Therefore, is adopted as the default setting in our experiment. Overall, OcTreeMamba_Bot and OcTreeMamba_Enc are retained as two complementary configurations for different anatomical structures and hardware constraints.
E. Efficiency Analysis
As shown in Table I, OcTreeMamba_Bot achieves a favorable memory-performance balance, maintaining competitive or superior accuracy with fewer resources than dense Mamba-based models. Across the four datasets, SegMamba requires higher training memory and higher inference memory, while delivering lower throughput. SegMamba-V2 further uses about more parameters with lower throughput. Compared with U-Mamba_Bot, OcTreeMamba_Bot reduces training memory by and provides higher throughput. Fig. 5 illustrates this balance. These gains come from applying sequence modeling to Octree-based sparse representations rather than dense 3D feature maps. Although SegFormer3D achieves the lowest memory cost and highest throughput, it suffers from substantial accuracy degradation on challenging datasets, especially TopCoW2024. In contrast, OcTreeMamba_Bot preserves strong accuracy with only a small memory increase over nnU-Net, while OcTreeMamba_Enc requires higher memory cost but provides stronger multi-scale modeling.
V. CONCLUSION
In this paper, we propose OcTreeMamba, a novel framework for 3D medical image segmentation by introducing a hierarchical Octree structure for feature propagation along tree topology in the SSM. Specifically, a structure learner is proposed to enable differentiable, anatomy-adaptive sparsification using Gumbel-Softmax sampling and hierarchical gating. A Dynamic Octree Builder is designed to organize the selected anatomical regions into a hierarchical Octree representation. A bi-directional Tree-SSM is developed to facilitate Leaf-Parent-Root propagation along the OcTree-Topology-aware trajectory aligned with Octree connectivity. Extensive evaluation across four datasets demonstrates that OcTreeMamba achieves competitive segmentation accuracy and state-of-the-art performance in preserving complex vessel topology on vascular datasets and exhibits a highly competitive memory-performance balance for large-scale organ segmentation on dense anatomical targets while maintaining a low GPU memory consumption.
REFERENCES
[1] G. Litjens, T. Kooi et al., “A survey on deep learning in med. image anal.” Med. Image Anal., vol. 42, pp. 60–88, 2017.
[2] A. Esteva, A. Robicquet et al., “A guide to deep learning in healthcare,” Nature medicine, vol. 25, no. 1, pp. 24–29, 2019.
[3] M. Antonelli, A. Reinke et al., “The medical segmentation decathlon,” Nature communications, vol. 13, no. 1, p. 4128, 2022.
[4] O. Ronneberger, P. Fischer et al., “U-net: Convolutional networks for biomedical image segmentation,” in MICCAI, 2015, pp. 234–241.
[5] O. Oktay, J. Schlemper et al., “Attention u-net: Learning where to look for the pancreas,” CoRR, vol. abs/1804.03999, 2018.
[6] Ö. Çiçek, A. Abdulkadir et al., “3d u-net: learning dense volumetric segmentation from sparse annotation,” in MICCAI, 2016, pp. 424–432.
[7] F. Isensee, Jaeger et al., “nnu-net: a self-configuring method for deep learning-based biomedical image segmentation,” Nature methods, vol. 18, no. 2, pp. 203–211, 2021.
[8] H. H. Lee, S. Bao et al., “3d ux-net: A large kernel volumetric convnet modernizing hierarchical transformer for medical image segmentation,” in ICLR, 2023, pp. 1–15.
[9] Z. Zhou, M. M. R. Siddiquee et al., “Unet++: A nested u-net architecture for medical image segmentation,” in MICCAI, 2018, pp. 3–11.
[10] H. Huang, L. Lin et al., “Unet 3+: A full-scale connected unet for medical image segmentation,” in ICASSP, 2020, pp. 1055–1059.
[11] K. He, X. Zhang et al., “Deep residual learning for image recognition,” in CVPR, 2016, pp. 770–778.
[12] J. Dai, H. Qi et al., “Deformable convolutional networks,” in ICCV, 2017, pp. 764–773.
[13] C. Peng, X. Zhang et al., “Large kernel matters—improve semantic segmentation by global convolutional network,” in CVPR, 2017, pp. 4353–4361.
[14] X. Wang, R. Girshick et al., “Non-local neural networks,” in CVPR, 2018, pp. 7794–7803.
[15] A. Dosovitskiy, L. Beyer et al., “An image is worth 16x16 words: Transformers for image recognition at scale,” in ICLR, 2021.
[16] Z. Liu, Y. Lin et al., “Swin transformer: Hierarchical vision transformer using shifted windows,” in ICCV, 2021, pp. 10012–10022.
[17] J. Chen, Y. Lu et al., “Transunet: Transformers make strong encoders for medical image segmentation,” CoRR, vol. abs/2102.04306, 2021.
[18] H. Cao, Y. Wang et al., “Swin-unet: Unet-like pure transformer for medical image segmentation,” in ECCV, 2023, pp. 205–218.
[19] A. Hatamizadeh, V. Nath et al., “Swin UNETR: swin transformers for semantic segmentation of brain tumors in MRI images,” in MICCAI, vol. 12962, 2021, pp. 272–284.
[20] A. Lin, B. Chen, J. Xu et al., “Ds-transunet: Dual swin transformer u-net for medical image segmentation,” IEEE Trans. Instrum. Meas., vol. 71, pp. 1–15, 2022.
[21] A. Gu, Modeling Sequences with Structured State Spaces. Stanford University, 2023.
[22] A. Gu and T. Dao, “Mamba: Linear-time sequence modeling with selective state spaces,” CoRR, vol. abs/2312.00752, 2023.
[23] K. Li, X. Li et al., “Videoamba: State space model for efficient video understanding,” in ECCV. Springer, 2024, pp. 237–255.
[24] E. Nguyen, K. Goel et al., “S4nd: Modeling images and videos as multidimensional signals with state spaces,” in NeurIPS, vol. 35, 2022, pp. 2846–2861.
[25] J. Ma, F. Li et al., “U-mamba: Enhancing long-range dependency for biomedical image segmentation,” CoRR, vol. abs/2401.04722, 2024.
[26] L. Zhu, B. Liao et al., “Vision mamba: Efficient visual representation learning with bidirectional state space model,” 2024.
[27] Y. Liu, Y. Tian et al., “Vmamba: Visual state space model,” in NeurIPS, vol. 37, 2024, pp. 103031–103063.
[28] K. Kamnitsas, C. Ledig et al., “Efficient multi-scale 3d cnn with fully connected crf for accurate brain lesion segmentation,” Med. Image Anal., vol. 36, pp. 61–78, 2017.
[29] O. Bernard, A. Lalande et al., “Deep learning techniques for automatic mri cardiac multi-structures segmentation and diagnosis: Is the problem solved?” IEEE TMI, vol. 37, no. 11, pp. 2514–2525, 2018.
[30] F. Milletari, N. Navab et al., “V-net: Fully convolutional neural networks for volumetric medical image segmentation,” in 3DV, 2016, pp. 565–571.
[31] X. Xiao, S. Lian et al., “Weighted res-unet for high-quality retina vessel segmentation,” in ITME, 2018, pp. 327–331.
[32] D. Liu, Y. Zhang et al., “Multi-directional attention: a lightweight attention module for slender structures,” Intelligence & Robotics, vol. 5, no. 4, pp. 827–843, 2025.
[33] A. Hatamizadeh, Y. Tang et al., “Unetr: Transformers for 3d medical image segmentation,” in WACV, 2022, pp. 574–584.
[34] A. Vaswani, N. Shazeer et al., “Attention is all you need,” in NeurIPS, 2017, pp. 5998–6008.
[35] A. Gu, K. Goel et al., “Efficiently Modeling Long Sequences with Structured State Spaces,” in ICLR, 2022.
[36] A. Gu, I. Johnson et al., “Combining recurrent, convolutional, and continuous-time models with linear state space layers,” in NeurIPS, vol. 34, 2021, pp. 572–585.
[37] A. Gu, T. Dao et al., “Hippo: Recurrent memory with optimal polynomial projections,” in NeurIPS, vol. 33, 2020, pp. 1474–1487.
[38] Z. Xing, T. Ye et al., “Segmamba-v2: Long-range sequential modeling mamba for general 3d medical image segmentation,” IEEE TMI, vol. 45, no. 1, pp. 4–15, 2025.
[39] T. Huang, X. Pei et al., “Localmamba: Visual state space model with windowed selective scan,” in ECCV. Springer, 2024, pp. 12–22.
[40] Y. Xiao, L. Song et al., “MambaTree: Tree topology is all you need in state space model,” in NeurIPS, vol. 37, 2024, pp. 75 329–75 354.
[41] L. Zhang, A. Rao et al., “Adding conditional control to text-to-image diffusion models,” in ICCV, 2023, pp. 3836–3847.
[42] A. Zeng, C. Wu et al., “Imagecas: A large-scale dataset and benchmark for coronary artery segmentation based on computed tomography angiography images,” CoRR, 2022.
[43] K. Yang, F. Musio et al., “The TopCoW challenge—topology-aware circle of willis segmentation for CT and MR angiography,” NEJM AI, vol. 3, no. 8, 2026.
[44] J. Ma, Y. Zhang et al., “Abdoment-1k: Is abdominal organ segmentation a solved problem?” IEEE TPAMI, vol. 44, no. 10, pp. 6695–6714, 2022.
[45] U. Baid, S. Ghodasara et al., “The rsna-asnr-miccai brats 2021 benchmark on brain tumor segmentation and radiogenomic classification,” CoRR, vol. abs/2107.02314, 2021.
[46] S. Shit, J. C. Paetzold et al., “cldice-a novel topology-preserving loss function for tubular structure segmentation,” in CVPR, 2021, pp. 16 560–16 569.
[47] S. Roy, G. Koehler et al., “Mednext: transformer-driven scaling of convnets for medical image segmentation,” in MICCAI. Springer, 2023, pp. 405–415.
[48] A. Shaker, M. Maaz et al., “Unetr++: delving into efficient and accurate 3d medical image segmentation,” IEEE Transactions on Medical Imaging, vol. 43, no. 9, pp. 3377–3390, 2024.
[49] S. Perera, P. Navard, and A. Yilmaz, “Segformer3d: an efficient transformer for 3d medical image segmentation,” in CVPRW. IEEE, 2024, pp. 4981–4988.