UMamba<T>
Models & Types · AiDotNet.ComputerVision.Segmentation.Medical
U-Mamba: Hybrid CNN-Mamba architecture for medical segmentation.
Inheritance: NeuralNetworkBase<T> → SegmentationModelBase<T> → MedicalSegmentationBase<T> → UMamba<T>
For Beginners
Medical image segmentation with long-range dependencies. CT and MRI organ segmentation.
Common use cases:
- Medical image segmentation with long-range dependencies
- CT and MRI organ segmentation
- 3D medical volume segmentation
- Efficient medical AI with linear complexity
How It Works
Technical Details:
- Hybrid CNN + Mamba (State Space Model) blocks in U-Net
- Linear complexity for processing long-range dependencies
- Captures both local CNN features and global SSM context
- U-Net architecture with Mamba blocks replacing transformer layers
Reference: Ma et al., “U-Mamba: Enhancing Long-range Dependency for Biomedical Image Segmentation”, arXiv 2024.
Example
// Create a U-Mamba model for medical image segmentation with long-range dependencies
var architecture = new NeuralNetworkArchitecture<double>(
inputType: InputType.ThreeDimensional,
taskType: NeuralNetworkTaskType.MultiClassClassification,
inputHeight: 256, inputWidth: 256, inputDepth: 1, outputSize: 14);
var model = new UMamba<double>(architecture);
// Every tunable is now set through the options object; these are the defaults:
var custom = new UMamba<double>(architecture,
options: new UMambaOptions { NumClasses = 14, DropRate = 0 });
// Or load a pre-trained ONNX model for CT/MRI organ segmentation
var onnxModel = new UMamba<double>(architecture, "umamba.onnx");
Constructors
| Constructor | Summary |
|---|---|
UMamba(NeuralNetworkArchitecture<T> architecture, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction, UMambaOptions options) |
Initializes UMamba in native (trainable) mode. |
UMamba(NeuralNetworkArchitecture<T> architecture, string onnxModelPath, UMambaOptions options) |
Initializes UMamba in ONNX (inference-only) mode. |
Methods
| Method | Summary |
|---|---|
MedicalSegmentationResult<T> SegmentFewShot(Tensor<T> queryImage, Tensor<T> supportImages, Tensor<T> supportMasks) |
|
MedicalSegmentationResult<T> SegmentSlice(Tensor<T> slice) |
Segments a single 2D medical slice. |
MedicalSegmentationResult<T> SegmentVolume(Tensor<T> volume) |
Segments a 3D volume slice-by-slice and aggregates the per-structure statistics. |
ModelMetadata<T> GetModelMetadata() |
Collects metadata describing this model’s configuration. |