Master's project · IMA, Sorbonne Université & Télécom Paris

Automated Segmentation of Cell Images with CycleGAN

Cycle-Consistent Generative Adversarial Networks applied on Retinal Pigment Epithelium

Aissam Djahnine

Sorbonne Université · Télécom Paris · Institut Pasteur

0.79–0.87
Dice on test examples
1,032
microscopy images, 256 × 256
Unpaired
no matched image–mask pairs needed
3
metrics: Dice, Hausdorff, perceptual
Input cell images, ground-truth masks and CycleGAN segmentations with Dice, Hausdorff and perceptual similarity scores
Input, ground truth and CycleGAN segmentation for two test images, with their scores.

Abstract

Segmenting cells in microscopy images normally requires many hand-prepared image–mask pairs. This project explores generative adversarial networks to reduce that need, with two objectives: generating synthetic cell images for data augmentation, and segmenting cells with a cycle-consistent GAN that can be trained without paired images and masks.

A DCGAN generates new retinal pigment epithelium (RPE) images, and a CycleGAN learns to translate between cell images and segmentation masks using adversarial, cycle-consistency and identity losses. Experiments use two public datasets: 1,032 RPE images from NIST and U2OS cells from the Broad Bioimage Benchmark Collection.

On held-out RPE images, the unpaired CycleGAN reaches Dice similarity coefficients between 0.79 and 0.87, with Hausdorff distances around 9.4–9.7.

Keywords: GAN · CycleGAN · DCGAN · unpaired image-to-image translation · cell segmentation · microscopy

Method

A GAN pairs a generator, which produces new samples, with a discriminator, which tells real samples from generated ones. CycleGAN learns a mapping between two image domains (cell images and segmentation masks) without paired examples.

  1. Adversarial losses push each generator to produce images its discriminator cannot tell from real ones.
  2. Cycle-consistency loss requires that translating an image to a mask and back recovers the original image.
  3. Identity loss keeps an image unchanged when it already belongs to the target domain.
CycleGANDCGANUnpaired trainingPython

2.1Generating cell images (DCGAN)

Following the DCGAN guidelines, the generator uses strided transposed convolutions, batch normalization, ReLU activations and a Tanh output; the discriminator uses strided convolutions and LeakyReLU (slope 0.2). Implemented in PyTorch and trained for 300 epochs with Adam (learning rate 0.0002, β₁ = 0.5), mini-batches of 128 and weights initialized from N(0, 0.02).

2.2Segmentation with CycleGAN

Each generator has an encoder of convolutions, a transformer of residual blocks and a decoder of transposed convolutions; the discriminators are PatchGANs. Two generators G: X → Y and F: Y → X are trained with adversarial losses plus a cycle-consistency loss, ‖F(G(x)) − x‖₁ + ‖G(F(y)) − y‖₁, weighted by λ.

Data

Table 1: Datasets.

DatasetImagesNotes
Human RPE cells (NIST)1,032 absorbance microscopy images, 256 × 256Used for generation and segmentation
Human U2OS cells (BBBC)55k+ images, 768 image–mask pairsIn- and out-of-focus high-content screening images

Training

CycleGAN translations after 10 and 90 epochs
Figure 1: Image-to-mask and mask-to-image translations after 10 and 90 epochs.

Results

Table 2: Segmentation quality on three test images

Test imageDice similarity coefficientHausdorff distancePerceptual similarity
Image 10.850669.50820.398
Image 20.869879.40550.324
Image 30.78979.70220.453
Third test image with its CycleGAN segmentation and scores
Figure 2: Third test image: ground truth and CycleGAN segmentation.

Key findings

  • Unpaired data works: real-world problems where paired data is not available can be treated with CycleGANs.
  • Training is hard: training a GAN is not easy, and the equilibrium point is rarely reached.
  • Better losses: other loss functions, such as an identity loss, can be used to build better models.

Report & slides

Project report (PDF, 4 MB) · Presentation slides (PDF, 2 MB) · Code on GitHub.

More research