Skip to content
BIASED

Beyond CycleGAN: MUNIT, CUT and SPADE

Block 1 of 8~3 min

Content and style

StarGAN v2 gave one input many outputs (see StarGAN: one generator for many domains). A style code entered the generator through AdaIN, and a cycle carried the image back with its own style. Three requests are still open. Translate without a second pass through a cycle. Render a photo from a map of labels, "sky here, road there". Make a small image sharp at four times the size. This topic covers one answer to each, and starts with an older route to many outputs.

MUNIT (Huang et al., 2018) assumes that an image is made from two codes. The content code cc is shared by both domains: the spatial structure, such as a cat's pose and layout. The style code sis_i belongs to domain ii: the rendering, such as fur and colour. Here cc is content, not StarGAN's label.

Each domain ii gets a content encoder EicE^c_i, a style encoder EisE^s_i and a decoder GiG_i. To translate from domain 1 to domain 2, keep the content and swap the decoder:

x1→2=G2(E1c(x1), s2),s2∼N(0,I).x_{1 \to 2} = G_2\big(E^c_1(x_1),\, s_2\big), \qquad s_2 \sim \mathcal N(0, I).

A new s2s_2 gives a new output. Taking s2=E2s(x2)s_2 = E^s_2(x_2) from a real image of the second domain gives example-guided translation: the output copies the style of the example.

The shapes of the two codes do much of the separating. For a 256×256256 \times 256 image, the content is a 64×64×25664 \times 64 \times 256 feature map computed with instance normalization. That normalization removes each channel's mean and spread, statistics that carry much of the style. The style is a vector of just 8 numbers from global average pooling, so it has no layout at all. The decoder injects it through AdaIN, as in StyleGAN: a style-based generator, with the scales and shifts computed from ss by a small MLP.

Answers are saved on the server and tied to this browser until you sign in.