Skip to content

Add support for Residual/Attention blocks in U-Net #4

@perctrix

Description

@perctrix

Is your feature request related to a problem? Please describe.
Right now our UNet implementation only supports the standard DoubleConv blocks and plain upsampling. This makes it harder to experiment with common U-Net variants (Residual U-Net, Attention U-Net) that are widely used in medical image segmentation.

Describe the solution you'd like
I’d like to add support for the new components we implemented in components.py:

  • UNetResidualConv (residual double conv block)
  • AttentionGate + UNetAttentionUpsample (skip connection gating)

The UNet class could accept arguments such as block= and upsample= so users can flexibly switch between the default modules and these new ones.

Describe alternatives you've considered

  • Keeping a completely separate ResUNet or AttentionUNet implementation, but that would duplicate most of the code.
  • Hard-coding these options into UNet, but that would reduce flexibility.

Additional context
These modules are standard in literature, and integrating them would make mipcandy-bundles much more “out-of-the-box” for segmentation baselines. We already have working implementations, we just need to hook them into the UNet API and add minimal tests.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttodoNew task or assignment

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions