Manuscript Offprint

arXiv:2608.22619

GET: Generative Embedding Translation for Medical Image Segmentation

Md Maklachur Rahman, Md Hasan Al Banna, Saraf Anjum, Mahmudul Hasan, Tracy Hammond

Md Maklachur Rahman 1^{1}, Md Hasan Al Banna 1^{1}, Saraf Anjum 2^{2}, Mahmudul Hasan 3^{3}, and Tracy Hammond 1^{1}

1^{1} Texas A&M University, College Station, TX, USA

2^{2} Independent Researcher

3^{3} Alfa Laval

{maklachur, mdhasanalbanna, hammond}@tamu.edu, sarafanjumeva@gmail.com, mahmudul.hasan@alfalaval.com

Abstract. Generative segmentation provides an alternative to direct pixel-wise prediction by operating on learned latent representations, but effective image-to-mask translation must preserve target structure while remaining computationally efficient. We propose Generative Embedding Translation (GET), a structured embedding-translation framework that progressively transforms image embeddings into mask embeddings within the frozen latent space of a Stable Diffusion VAE. GET uses a U-Net-style Embedding Translation Network with 1.07M trainable parameters, combining Mobile Bottleneck Convolutions, Subsampled Self-Attention, and Multi-scale Feature Enrichment for local modeling, global context, and multi-scale refinement. Across five medical segmentation datasets, GET outperforms generative, CNN, and Transformer baselines. Compared with the strongest generative baseline, GMS, GET improves average Dice and IoU by 0.93% and 1.26%, reduces HD95 by 0.81 pixels, and uses 31.41% fewer trainable parameters. Under bidirectional BUS-BUSI domain shift, GET further improves Dice and IoU by 3.51% and 3.39%, while reducing HD95 by 27.37 pixels. Our code is available at: https://github.com/maklachur/GET.

Keywords: Medical image segmentation · generative segmentation · latent embedding translation · lightweight networks

1 Introduction

Medical image segmentation is crucial for accurate diagnosis, treatment planning, and clinical decision-making. Traditional segmentation approaches predominantly use Convolutional Neural Networks (CNNs), such as U-Net [28], UNet++ [43], AULUNet [24], DeepLabV3+ [7], and nnUNet [16], which effectively capture hierarchical local features. However, CNN-based methods remain constrained in modeling long-range dependencies, which are important for segmenting complex anatomical structures and ambiguous boundaries [23].

Transformer-based models [8] address this limitation through global self-attention. Architectures such as TransUNet [6], SwinUNet [4], and UNETR [10]

M. M. Rahman et al.

improve contextual modeling by capturing long-range interactions, but their attention mechanisms can introduce substantial computational cost. Their performance can also depend on large annotated datasets, which are often difficult to obtain in medical imaging [25, 30].

Generative segmentation provides a complementary direction by operating on learned latent representations rather than relying solely on direct pixel-wise prediction. Variational Autoencoders (VAEs) [18] and Vector-Quantized VAEs (VQ-VAEs) [9] provide compact latent representations, while recent segmentation methods include diffusion-based approaches such as MedSegDiff-V2 [39] and SDSeg [19], as well as direct latent-translation approaches such as GSS [5] and GMS [12]. Although prior work demonstrates the feasibility of translating image representations into mask representations, accurate segmentation requires the translation to preserve the spatial structure of the target. The transformation must recover the target's location, extent, shape, and boundaries from image appearance while remaining robust to variations in texture, contrast, and acquisition conditions. This motivates a structured translation process that can jointly model local detail, global context, and multi-scale spatial information while keeping the trainable component compact. A detailed discussion of related work is provided in Supplementary Material Section 5.

Based on this perspective, we propose Generative Embedding Translation (GET), which formulates medical image segmentation as structured embedding translation within a frozen Stable Diffusion VAE (SD-VAE) space. The SD-VAE provides a fixed representation space for both images and masks, while a lightweight Embedding Translation Network (ETN) learns the task-specific transformation from image embeddings to mask embeddings. Rather than treating this transformation as a single mapping operation, ETN progressively translates the representation across multiple resolution stages, allowing spatial structure to be modeled and refined before the predicted mask embedding is decoded. Keeping the SD-VAE frozen further isolates the trainable segmentation component and limits the number of parameters that must be optimized.

The ETN is a five-stage U-Net-style translator that combines three complementary components. Mobile Bottleneck Convolution (MBC) provides efficient local feature extraction, Subsampled Self-Attention (SSA) captures global context at the bottleneck, and Multi-Scale Feature Enrichment (MFE) aggregates information across multiple receptive fields during decoding. Multi-stage latent reconstruction and additional L2 latent alignment constrain intermediate and final representations toward the target mask embedding, while Dice and Focal-Tversky losses directly supervise the decoded segmentation. Together, these components enable GET to preserve local structure, global organization, and multi-scale detail within a compact latent translation framework.

In summary, our main contributions are as follows:

– We develop GET, a structured embedding-translation framework that progressively maps image embeddings to mask embeddings across multiple resolutions within a frozen SD-VAE space using a compact trainable translator.

Figure

Fig. 1: Overview of the proposed framework. (a) Main pipeline: a frozen SD-VAE encodes both image (I) and mask (M) into latent features μimg\mu_{img} and μmask\mu_{mask}. The lightweight ETN translates image latent μimg\mu_{img} to segmentation latent μ^seg\hat{\mu}_{seg}. The s1s_1, s2s_2, s3s_3, and out are the segmentation latents from different stages of ETN. The μ^seg(s1)\hat{\mu}_{seg}^{(s_1)} and μ^seg(out)\hat{\mu}_{seg}^{(out)} denote the segmentation latent for s1s_1 and out, respectively, which are then decoded to generate the final masks. (b) ETN integrates MBC, MFE, and SSA modules for latent translation. (c) MBC acts as the encoder within ETN. (d) MFE aggregates multi-scale features via parallel dilated branches in the decoder. (e) SSA operates at the bottleneck, capturing long-range context through subsampled attention.

– We design a multi-stage ETN with MBC, SSA, and MFE for efficient local modeling, global context aggregation, and multi-scale refinement, together with latent- and mask-space supervision.

– Experiments on BUS, BUSI, GlaS, HAM10000, and Kvasir–Instrument demonstrate consistent improvements over recent generative, CNN, and Transformer baselines. Compared with GMS, GET improves average Dice and IoU by 0.93% and 1.26%, reduces HD95 by 0.81 pixels, and uses 31.41% fewer trainable parameters. Under bidirectional BUS–BUSI domain shift, GET further improves Dice and IoU by 3.51% and 3.39%, while reducing HD95 by 27.37 pixels.

References (43)

  • A novel focal tversky loss function with improved attention u-net for lesion segmentation
  • Dataset of breast ultrasound images
  • Loss functions in the era of semantic segmentation: A survey and outlook (opens arXiv in a new tab)
  • Swin-unet: Unet-like pure transformer for medical image segmentation
  • Generative semantic segmentation
  • TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation
  • Encoder-decoder with atrous separable convolution for semantic image segmentation
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Taming transformers for high-resolution image synthesis
  • Unetr: Transformers for 3d medical image segmentation
  • Missformer: An effective transformer for 2d medical image segmentation
  • Generative medical segmentation
  • Matchseg: Towards better segmentation via reference image matching
  • Acc-unet: A completely convolutional unet model for the 2020s
  • Multiresunet: Rethinking the u-net architecture for multimodal biomedical image segmentation
  • nnu-net: a self-configuring method for deep learning-based biomedical image segmentation
  • Kvasir-instrument: Diagnostic and therapeutic tool segmentation dataset in gastrointestinal endoscopy
  • Auto-encoding variational bayes
  • Stable diffusion segmentation for biomedical images with single-step reverse process
  • SGDR: Stochastic Gradient Descent with Warm Restarts
  • Decoupled Weight Decay Regularization
  • V-net: Fully convolutional neural networks for volumetric medical image segmentation
  • Attention U-Net: Learning Where to Look for the Pancreas
  • Aulunet: An adaptive ultra-lightweight u-net framework for efficient skin lesion segmentation in resource-constrained environments
  • Mambaliteunet: Cross-gated adaptive feature fusion for robust skin lesion segmentation
  • Mamba in vision: A comprehensive survey of techniques and applications (opens arXiv in a new tab)
  • High-resolution image synthesis with latent diffusion models
  • U-net: Convolutional networks for biomedical image segmentation
  • Ege-unet: an efficient group enhanced unet for skin lesion segmentation
  • Transformers in medical imaging: A survey (opens arXiv in a new tab)
  • Gland segmentation in colon histology images: The glas challenge contest
  • Ham10000 lesion segmentations
  • The ham10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions
  • Nvae: A deep hierarchical variational autoencoder
  • Medical transformer: Gated axial-attention for medical image segmentation
  • Neural discrete representation learning
  • Utransnet: rethinking the skip connections in u-net from a channel-wise perspective with transformer
  • Smeswin unet: Merging cnn and transformer for medical image segmentation
  • Medsegdiff-v2: Diffusion-based medical image segmentation with transformer
  • Lb-unet: A lightweight boundary-assisted unet for skin lesion segmentation
  • Automated breast ultrasound lesions detection using convolutional neural networks
  • Loss functions for image restoration with neural networks
  • Unet++: A nested u-net architecture for medical image segmentation