Downloads · 30 days
0
pnavard/SegFormer3D
SegFormer3D is a machine learning model from pnavard. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
SegFormer3D is a novel and efficient transformer-based architecture designed specifically for 3D medical image segmentation. It extends the successful 2D SegFormer architecture to handle volumetric medical data while…
Downloads · 30 days
0
Access
Public
Updated Jul 18, 2025
Repo size
22.4 MB
Likes
0
Public
Click a slice to open those files.
.pth18.2 MB · 100%
From the Hugging Face model README
SegFormer3D is a novel and efficient transformer-based architecture designed specifically for 3D medical image segmentation. It extends the successful 2D SegFormer architecture to handle volumetric medical data while maintaining computational efficiency and strong segmentation performance.
SegFormer3D introduces several key innovations for efficient 3D medical image segmentation:
The model achieves state-of-the-art performance on multiple 3D medical segmentation benchmarks while being computationally efficient.
<p align="center"> <img src="https://raw.githubusercontent.com/OSUPCVLab/SegFormer3D/main/resources/segformer_3D.png" alt="SegFormer3D Architecture" width="500"/> </p>The model was trained and evaluated on several medical imaging datasets:
from transformers import SegFormer3DConfig, SegFormer3DModel
import torch
# Initialize configuration
config = SegFormer3DConfig(
in_channels=4, # Number of input channels
num_classes=3, # Number of segmentation classes
# Model architecture parameters
embed_dims=[32, 64, 160, 256],
num_heads=[1, 2, 5, 8],
depths=[2, 2, 2, 2],
sr_ratios=[4, 2, 1, 1]
)
# Initialize model
model = SegFormer3DModel(config)
# Example forward pass
batch_size = 1
depth, height, width = 128, 128, 128 # Example input dimensions
x = torch.randn(batch_size, config.in_channels, depth, height, width)
outputs = model(x)
# Get segmentation logits
logits = outputs.logits # Shape: (batch_size, num_classes, D, H, W)
Input Preprocessing:
Training Strategy:
Memory Management:
@InProceedings{Perera_2024_CVPR,
title={Segformer3d: an efficient transformer for 3d medical image segmentation},
author={Perera, Shehan and Navard, Pouyan and Yilmaz, Alper},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={4981--4988},
year={2024}
}
This implementation is based on the original SegFormer architecture by Xie et al. and extends it to efficient 3D medical image segmentation. We thank the authors for their valuable contributions to the field.