NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Transformer Based Generative Adversarial Network for Liver Segmentation

Ugur Demir, Zheyuan Zhang, Bin Wang, Matthew Antalek, Elif Keles, Debesh Jha, Amir Borhani, Daniela P. Ladner, Ulas Bagci

Abstract

Accurate liver segmentation in Computed Tomography (CT) scans is essential for clinical diagnosis and surgical planning. While Convolutional Neural Networks (CNNs) have long served as the standard for medical image segmentation, they often struggle to capture long-range spatial dependencies due to their localized receptive fields. This paper presents a hybrid deep learning framework that integrates the global modeling capabilities of Transformers with the adversarial training of Generative Adversarial Networks (GANs). By utilizing a Transformer-based generator, the model effectively captures global context, while the discriminator ensures anatomical realism. Experimental results on the Liver Tumor Segmentation Challenge (LiTS) dataset demonstrate that the proposed Transformer-GAN achieves state-of-the-art performance, particularly in recall and Dice coefficient metrics.

Introduction

Automated liver segmentation is a critical precursor for diagnosing hepatic malignancies, planning complex surgeries, and monitoring treatment efficacy. However, the liver presents significant segmentation challenges due to its high variability in shape, size, and orientation across different patients. Furthermore, its proximity to other organs with similar intensity profiles in CT scans often leads to boundary ambiguities.

Traditional deep learning approaches, primarily based on CNN architectures like U-Net, excel at extracting local features and textures. However, they are inherently limited in capturing "long-range dependencies"—the spatial relationships between distant parts of a large organ. While Transformers have emerged as a solution to this limitation through self-attention mechanisms, they can occasionally produce segmentation masks that lack fine-grained anatomical consistency. To address this, we propose a GAN-based framework where a discriminator "critiques" the Transformer's output, forcing the generator to produce masks that are not only pixel-accurate but also anatomically credible.

Methodology

Architectural Variants

The research evaluates two primary architectural configurations designed to leverage the strengths of both Transformers and adversarial learning:

  1. Transformer-GAN (Vanilla): This model employs a conditional GAN framework. The Generator is structured as an encoder-decoder Transformer that processes a CT slice to predict a segmentation mask. The Discriminator then evaluates the predicted mask against ground-truth human annotations to distinguish between "real" and "synthetic" segmentations.
  2. Transformer-CycleGAN: This extension incorporates cycle-consistency constraints. It utilizes two generators (Image-to-Mask and Mask-to-Image) and two corresponding discriminators. This approach ensures a robust bidirectional mapping, requiring that an image translated to a mask and back to an image remains consistent with the original input.

Technical Components

  • The Generator: The core of the generator is a convolutional transformer. The encoder reduces spatial dimensions while extracting high-level features; the transformer module then applies self-attention to model global dependencies. Finally, the decoder restores spatial resolution to produce the final segmentation mask.
  • The Discriminator: The authors utilized a pixel-level discriminator (similar to the PatchGAN architecture). Rather than providing a single scalar value for the entire image, the discriminator evaluates small local patches. This forces the generator to maintain high-frequency detail and local accuracy.

Experimental Setup

The proposed models were evaluated using the Liver Tumor Segmentation Challenge (LiTS) dataset, a widely recognized benchmark in the field. The dataset consists of 131 CT scans, which were partitioned into 95 samples for training and 36 samples for testing. Performance was measured using standard segmentation metrics, including the Dice Coefficient, Precision, and Recall.

Results and Discussion

The Transformer-GAN architecture demonstrated superior performance compared to vanilla Transformer baselines. The quantitative results are summarized in the table below:

Method Dice Coefficient Precision Recall
Vanilla Transformer 0.9432 0.9464 0.9425
Transformer-GAN (Ours) 0.9433 0.9376 0.9515
Transformer-CycleGAN 0.9359 0.9539 0.9205

Key Findings

  • Global Context and Topology: The Transformer’s self-attention mechanism proved more effective than standard CNNs at relating pixels across the entire span of the liver. The addition of the GAN discriminator acted as a quality filter, helping the network learn the underlying "topology" of the liver and effectively eliminating false positives in non-target regions.
  • Performance Gains: The Transformer-GAN achieved the highest Dice coefficient (0.9433) and a notable boost in Recall (0.9515), marking a 0.9% improvement over the baseline.
  • Clinical Validation: Qualitative evaluations by participating physicians confirmed the reliability of the outputs, with no identified failures in the segmentation results produced by the Transformer-GAN.

Conclusion and Future Work

This study demonstrates that Transformers and GANs are highly complementary for medical image segmentation. While the Transformer provides the structural logic and global context, the GAN provides the necessary refinement and anatomical credibility.

Future research will focus on three key areas:

  1. Scaling: Testing the architecture on larger, multi-center datasets to ensure generalizability.
  2. 3D Integration: Extending the 2D slice-based approach to a fully 3D Transformer architecture to capture volumetric context across the Z-axis.
  3. Semi-Supervised Learning: Adapting the framework to learn from unannotated medical data, reducing the reliance on expert-labeled datasets.

Summary updated

BibTeX
@inproceedings{demir2022transformer,
  author = {Ugur Demir and Zheyuan Zhang and Bin Wang and Matthew Antalek and Elif Keles and Debesh Jha and Amir Borhani and Daniela P. Ladner and Ulas Bagci},
  title = {{Transformer Based Generative Adversarial Network for Liver Segmentation}},
  booktitle = {ICIAP Workshops},
  year = {2022},
  doi = {10.1007/978-3-031-13324-4\_29},
}
Figure