unet_3d(pretrained: bool = False, overrides: object = {})3-D U-Net for volumetric segmentation (Cicek et al., MICCAI 2016).
Builds the volumetric U-Net variant: all Conv2d / BatchNorm2d /
MaxPool2d ops are replaced with their 3-D counterparts; "bilinear"
upsampling becomes "trilinear". Default base_channels = 32 and
depth = 3 to keep memory tractable on volumetric inputs.
Model Size
Parameters
pretrainedbool= FalseReserved for future pretrained-weight loading. Currently ignored.
**overridesobject= {}Keyword overrides forwarded into
UNetConfig (num_classes,
in_channels, base_channels, depth, bilinear, ...).Returns
UNetForSemanticSegmentationSegmentation model with the 3-D U-Net configuration applied (or
with overrides merged on top of it).
Notes
See Cicek et al., "3D U-Net: Learning Dense Volumetric Segmentation from Sparse Annotation", MICCAI 2016 (arXiv:1606.06650). Volumetric convolutions add a depth axis, so memory cost scales linearly with the input depth — keep depth and base_channels modest.
Examples
>>> import lucid
>>> from lucid.models.vision.unet import unet_3d
>>> model = unet_3d()
>>> x = lucid.randn(1, 1, 64, 64, 64) # (B, C, D, H, W)
>>> out = model(x)
>>> out.logits.shape
(1, 2, 64, 64, 64)