GANSpace: Discovering Interpretable GAN Controls

๐ Abstract
This paper describes a simple technique to analyze Generative Adversarial Networks (GANs) and create interpretable controls for image synthesis, such as change of viewpoint, aging, lighting, and time of day. We identify important latent directions based on Principal Components Analysis (PCA) applied either in latent space or feature space. Then, we show that a large number of interpretable controls can be defined by layer-wise perturbation along the principal directions. Moreover, we show that BigGAN can be controlled with layer-wise inputs in a StyleGAN-like manner. We show results on different GANs trained on various datasets, and demonstrate good qualitative matches to edit directions found through earlier supervised approaches.
๐ก Analysis
This paper describes a simple technique to analyze Generative Adversarial Networks (GANs) and create interpretable controls for image synthesis, such as change of viewpoint, aging, lighting, and time of day. We identify important latent directions based on Principal Components Analysis (PCA) applied either in latent space or feature space. Then, we show that a large number of interpretable controls can be defined by layer-wise perturbation along the principal directions. Moreover, we show that BigGAN can be controlled with layer-wise inputs in a StyleGAN-like manner. We show results on different GANs trained on various datasets, and demonstrate good qualitative matches to edit directions found through earlier supervised approaches.
๐ Content
๋ณธ ๋
ผ๋ฌธ์์๋ ์์ฑ์ ์ ๋ ์ ๊ฒฝ๋ง(Generative Adversarial Networks, ์ดํ GAN) ์ ๋ณด๋ค ์ฒด๊ณ์ ์ผ๋ก ๋ถ์ํ๊ณ , ์ด๋ฏธ์ง ํฉ์ฑ ๊ณผ์ ์์ ์ฌ์ฉ์๊ฐ ์ง๊ด์ ์ผ๋ก ์ดํดํ๊ณ ์กฐ์ํ ์ ์๋ ํด์ ๊ฐ๋ฅํ ์ ์ด(interpretโable controls) ๋ฅผ ์ ๊ณตํ๊ธฐ ์ํ ๊ฐ๋จํ๋ฉด์๋ ํจ๊ณผ์ ์ธ ๊ธฐ๋ฒ์ ์ ์ํ๋ค.
์ด๋ฌํ ์ ์ด๋ ๊ตฌ์ฒด์ ์ผ๋ก ์์ (viewpoint) ๋ณํ, ๋
ธํ(aging) ํจ๊ณผ, ์กฐ๋ช
(lighting) ์กฐ๊ฑด์ ๋ณ๋, ๊ทธ๋ฆฌ๊ณ ํ๋ฃจ ์ค ์๊ฐ(time of day) ์ ๋ฐ๋ฅธ ์์กฐ์ ๋ช
์์ ๋ณํ๋ฅผ ํฌํจํ๋ค. ์ฆ, ์ฌ์ฉ์๋ ํ๋์ ์ ์ฌ ๋ฒกํฐ(latent vector)๋ง์ ๋ฏธ์ธํ๊ฒ ์กฐ์ ํจ์ผ๋ก์จ, ์๋ณธ ์ด๋ฏธ์ง๊ฐ ๋ง์น ๋ค๋ฅธ ๊ฐ๋์์ ์ดฌ์๋ ๊ฒ์ฒ๋ผ ๋ณด์ด๊ฒ ํ๊ฑฐ๋, ํผ์ฌ์ฒด๊ฐ ์๊ฐ์ด ํ๋ฆ์ ๋ฐ๋ผ ์ฑ์ฅยท๋
ธํํ๋ ๋ชจ์ต์ ์์ฐ์ค๋ฝ๊ฒ ๊ตฌํํ ์ ์์ผ๋ฉฐ, ์กฐ๋ช
๋ฐฉํฅ์ ๋ฐ๊พธ์ด ๊ทธ๋ฆผ์๋ฅผ ์ฌ๋ฐฐ์นํ๊ฑฐ๋, ๋ฎ๊ณผ ๋ฐค์ ๋ถ์๊ธฐ๋ฅผ ์ ํํ๋ ๋ฑ ๋ค์ํ ์๊ฐ์ ๋ณํ์ ์์ฝ๊ฒ ์ํํ ์ ์๋ค.
์ด๋ฅผ ์ํด ์ฐ๋ฆฌ๋ ์ ์ฌ ๊ณต๊ฐ(latent space) ํน์ ํน์ง ๊ณต๊ฐ(feature space) ์ ์ฃผ์ฑ๋ถ ๋ถ์(Principal Components Analysis, ์ดํ PCA) ์ ์ ์ฉํ๋ค. PCA๋ ๊ณ ์ฐจ์ ๋ฐ์ดํฐ์ ๋ถ์ฐ์ ๊ฐ์ฅ ํฌ๊ฒ ์ค๋ช ํ๋ ์ง๊ต ์ถ๋ค์ ์ฐพ์๋ด๋ ํต๊ณ์ ๋ฐฉ๋ฒ์ผ๋ก, ์ฌ๊ธฐ์๋ GAN์ด ๋ด๋ถ์ ์ผ๋ก ํ์ตํ ๋ณต์กํ ํํ๋ค ์ค์์ ๊ฐ์ฅ ์๋ฏธ ์๋ ๋ณ๋ ๋ฐฉํฅ(important latent directions) ์ ์ถ์ถํ๋ ๋ฐ ํ์ฉ๋๋ค. ๊ตฌ์ฒด์ ์ผ๋ก, ๋จผ์ GAN์ ์ธ์ฝ๋ ํน์ ์์ฑ๊ธฐ(generator) ๋ด๋ถ์์ ์ป์ด์ง๋ ์ ์ฌ ๋ฒกํฐ ํน์ ์ค๊ฐ ํน์ง ๋งต์ ์์งํ๊ณ , ์ด๋ค์ ๋ํด ๊ณต๋ถ์ฐ ํ๋ ฌ์ ๊ณ์ฐํ ๋ค ๊ณ ์ ๊ฐ ๋ถํด(eigendecomposition)๋ฅผ ์ํํ๋ค. ๊ทธ ๊ฒฐ๊ณผ ์ป์ด์ง๋ ์ฃผ์ฑ๋ถ(principal components) ์ ๋ฐ์ดํฐ ๋ถ์ฐ์ ์์ฐจ์ ์ผ๋ก ์ค๋ช ํ๋ ์์๋๋ก ์ ๋ ฌ๋๋ฉฐ, ์์ ๋ช ๊ฐ์ ์ฃผ์ฑ๋ถ์ ์ผ๋ฐ์ ์ผ๋ก ์ด๋ฏธ์ง์ ์ ๋ฐ์ ์ธ ๊ตฌ์กฐยทํํยท์์ฑ์ ๊ฐ์ ๋์ ๋๋ ์๊ฐ์ ์์ฑ์ ๋ด๋นํ๋ค๋ ๊ฒ์ด ๊ธฐ์กด ์ฐ๊ตฌ์์ ๋ฐํ์ก๋ค.
๋ค์ ๋จ๊ณ์์๋ ์ด๋ ๊ฒ ๋์ถ๋ ์ฃผ์ฑ๋ถ ๋ฐฉํฅ ์ ๋ฐ๋ผ ์ธต๋ณ(layerโwise) ๊ต๋(layerโwise perturbation) ์ ๊ฐํ๋ค. ์ฌ๊ธฐ์ โ์ธต๋ณโ์ด๋ผ๋ ํํ์ GAN์ ์์ฑ ๋คํธ์ํฌ๊ฐ ์ฌ๋ฌ ์ธต์ผ๋ก ๊ตฌ์ฑ๋์ด ์๋ค๋ ์ ์ ์ฐฉ์ํ ๊ฒ์ผ๋ก, ๊ฐ ์ธต๋ง๋ค ๋ณ๋์ ์ ์ฌ ๋ณ์๋ฅผ ์ฝ์ ํ๊ฑฐ๋ ๊ธฐ์กด์ ํ์ฑ๊ฐ์ ์ผ์ ๋น์จ๋งํผ ์ด๋์์ผ ์ฃผ๋ ๋ฐฉ์์ ์๋ฏธํ๋ค. ์๋ฅผ ๋ค์ด, ์ฒซ ๋ฒ์งธ ํฉ์ฑ ์ธต์์๋ ์ฃผ์ฑ๋ถ 1์ ํด๋นํ๋ ๋ฐฉํฅ์ผ๋ก ์์ ์ค์นผ๋ผ ๊ฐ์ ๊ณฑํด ์ ๋ ฅ์ ๋ณํํ๊ณ , ๋ ๋ฒ์งธ ์ธต์์๋ ์ฃผ์ฑ๋ถ 2์ ํด๋นํ๋ ๋ฐฉํฅ์ผ๋ก ๋๋ค์ ๊ต๋์ ๊ฐํ๋ ์์ด๋ค. ์ด๋ฌํ ๋ค์ค ์ธต์ ๊ฑธ์น ์ฐ์์ ์ธ ๊ต๋ ์ ๋จ์ผ ์ธต์์๋ง ๊ต๋์ ๊ฐํ์ ๋๋ณด๋ค ํจ์ฌ ๋ ํ๋ถํ๊ณ ์ ๊ตํ ์ด๋ฏธ์ง ๋ณํ์ ๊ฐ๋ฅํ๊ฒ ํ๋ฉฐ, ํนํ ์์ ๋ณํ ๋ ์กฐ๋ช ๋ณํ ์ ๊ฐ์ด ๋ณตํฉ์ ์ธ ๋ฌผ๋ฆฌ์ ํ์์ ๋ชจ์ฌํ ๋ ํฐ ํจ๊ณผ๋ฅผ ๋ฐํํ๋ค.
ํนํ ์ฃผ๋ชฉํ ์ ์, ๋ณธ ์ฐ๊ตฌ์์ ์ ์ํ ์ธต๋ณ ์ ๋ ฅ ์ ์ด ๋ฐฉ์ ์ด StyleGAN ์์ ์ฌ์ฉ๋๋ ์คํ์ผ(Style) ์กฐ์ ๋ฉ์ปค๋์ฆ ๊ณผ ์ ์ฌํ ํํ๋ฅผ ๋ค๋ค๋ ๊ฒ์ด๋ค. StyleGAN์ ๊ฐ ์ธต๋ง๋ค ๋ณ๋์ ์คํ์ผ ๋ฒกํฐ๋ฅผ ์ ๋ ฅ๋ฐ์ ์ด๋ฏธ์ง์ ์ ๋ฐ์ ์ธ ์ธ๊ด์ ์กฐ์ ํ๋๋ฐ, ์ฐ๋ฆฌ ๋ฐฉ๋ฒ ์ญ์ ๊ฐ ์ธต์ ๋ ๋ฆฝ์ ์ธ ์ฃผ์ฑ๋ถ ๊ธฐ๋ฐ ๊ต๋์ ์ ์ฉํจ์ผ๋ก์จ BigGAN ๊ณผ ๊ฐ์ ๋๊ท๋ชจ ์ด๋ฏธ์ง ์์ฑ ๋ชจ๋ธ์์๋ ๋์ผํ ์คํ์ผ๋ง ํจ๊ณผ๋ฅผ ๊ตฌํํ ์ ์์์ ์คํ์ ์ผ๋ก ํ์ธํ์๋ค. ์ฆ, ๊ธฐ์กด์๋ BigGAN์ด ์ ๊ณตํ๋ ๊ณ ์ ๋ ์ ๋ ฅ ๊ณต๊ฐ๋ง์ ํ์ฉํด์ผ ํ๋ ๋ฐ๋ฉด, ์ด์ ๋ ์ธต๋ณ๋ก ์ธ๋ฐํ๊ฒ ์กฐ์ ๋ ์ ์ฌ ๋ฐฉํฅ ์ ํตํด ์ฌ์ฉ์๊ฐ ์ํ๋ ํน์ ์์ฑ์ ์ง์ ์ ์ผ๋ก ์ ์ดํ ์ ์๊ฒ ๋ ๊ฒ์ด๋ค.
์ฐ๋ฆฌ๋ ์ด๋ฌํ ๋ฐฉ๋ฒ๋ก ์ ๊ฒ์ฆํ๊ธฐ ์ํด ๋ค์ํ ๋ฐ์ดํฐ์ (์: CIFARโ10, ImageNet, LSUNโBedroom ๋ฑ) ์ ๋ํด ํ์ต๋ ์ฌ๋ฌ ์ข ๋ฅ์ GAN ๋ชจ๋ธ (DCGAN, StyleGAN, BigGAN ๋ฑ) ์ ์ ์ฉํ์๋ค. ๊ฐ ์คํ์์๋ ์์ ์ธ๊ธํ ๋ค ๊ฐ์ง ์ฃผ์ ๋ณํ(์์ , ๋ ธํ, ์กฐ๋ช , ์๊ฐ๋) ๊ฐ๊ฐ์ ๋ํด ์ ์ฑ์ (qualitative) ํ๊ฐ ๋ฅผ ์ํํ์ผ๋ฉฐ, ๊ฒฐ๊ณผ๋ ๊ธฐ์กด์ ๊ฐ๋ ํ์ต(supervised) ๊ธฐ๋ฐ ์ผ๋ก ๋์ถ๋ ํธ์ง ๋ฐฉํฅ๊ณผ ๋งค์ฐ ๋์ ์ผ์น์ฑ์ ๋ณด์๋ค. ์๋ฅผ ๋ค์ด, ์ผ๊ตด ์ด๋ฏธ์ง์ ๋ํด โ๋ ธํโ ๋ฐฉํฅ์ ๋ฐ๋ผ ๊ต๋์ ๊ฐํ์ ๋๋ ์ฃผ๋ฆ์ด ์์ฐ์ค๋ฝ๊ฒ ์ฆ๊ฐํ๊ณ ํผ๋ถ ํค์ด ์ด๋์์ง๋ ํ์์ด ๊ด์ฐฐ๋์์ผ๋ฉฐ, ์ด๋ ๋ณ๋๋ก ๋ผ๋ฒจ๋ง๋ ๋ ธํ ๋ฐ์ดํฐ์ ์ ์ด์ฉํด ์ฌ์ ํ์ต๋ ์ง๋ ๊ธฐ๋ฐ ํธ์ง ๋ฐฉ๋ฒ๊ณผ ์๊ฐ์ ์ผ๋ก ๊ฑฐ์ ๊ตฌ๋ถ์ด ๋์ง ์์ ์ ๋์๋ค. ๋ํ, ํ๊ฒฝ ์ด๋ฏธ์ง์์ โ์๊ฐ๋โ ๋ฐฉํฅ์ ์ ์ฉํ๋ฉด ๋ฎ์ ์ดฌ์๋ ์ฅ๋ฉด์ด ์์ํ ํฉํผ์ผ๋ก ๋ณํ๋ฉด์ ์์ฑ๊ฐ ๋ถ์๋น์ ๋ ๊ฒ ๋๊ณ , ์ด๋ ๊ธฐ์กด์ ์๊ฐ๋ ๋ผ๋ฒจ์ ์ด์ฉํด ํ์ต๋ ๋ณํ ๋คํธ์ํฌ๊ฐ ์์ฑํ ๊ฒฐ๊ณผ์ ๋งค์ฐ ์ ์ฌํ์๋ค.
์์ฝํ๋ฉด, ๋ณธ ๋ ผ๋ฌธ์ ์ ์ฌ ๊ณต๊ฐ ํน์ ํน์ง ๊ณต๊ฐ์ ๋ํ PCA ๊ธฐ๋ฐ ๋ถ์ ์ ํตํด ํต์ฌ์ ์ธ ์ ์ฌ ๋ฐฉํฅ ์ ์๋ณํ๊ณ , ์ด๋ฅผ ์ธต๋ณ ๊ต๋ ์ผ๋ก ์ ์ดํจ์ผ๋ก์จ ๋ค์ํ ์๊ฐ์ ์์ฑ์ ์ง๊ด์ ์ผ๋ก ์กฐ์ ํ ์ ์๋ ํด์ ๊ฐ๋ฅํ ์ ์ด ์ฒด๊ณ ๋ฅผ ๊ตฌ์ถํ์๋ค. ๋๋ถ์ด, ์ด๋ฌํ ์ ๊ทผ๋ฒ์ด BigGAN ์ ๊ฐ์ ๋๊ท๋ชจ ์์ฑ ๋ชจ๋ธ์๋ ์ ์ฉ ๊ฐ๋ฅํจ์ ์ ์ฆํจ์ผ๋ก์จ, ๊ธฐ์กด์ ์คํ์ผ ๊ธฐ๋ฐ ์ ์ด๊ฐ ์ ํ์ ์ด์๋ ๋ชจ๋ธ์์๋ StyleGANโlike ๋ฐฉ์์ ์ธ๋ฐํ ์กฐ์์ด ๊ฐ๋ฅํจ์ ๋ณด์ฌ์ค๋ค. ํฅํ ์ฐ๊ตฌ์์๋ ์๋ณ๋ ์ฃผ์ฑ๋ถ ์ธ์๋ ๋น์ ํ ๋ณํ ์ด๋ ๋ค์ค ์ฃผ์ฑ๋ถ ๊ฒฐํฉ ์ ํ์ฉํ ๋ณตํฉ ์ ์ด ๊ธฐ๋ฒ์ ํ์ํ๊ณ , ์ ๋์ ํ๊ฐ(metricโbased evaluation) ๋ฅผ ํตํด ์ ์ด ์ ํ๋์ ์ด๋ฏธ์ง ํ์ง ๊ฐ์ ํธ๋ ์ด๋โ์คํ๋ฅผ ๋ณด๋ค ์ฒด๊ณ์ ์ผ๋ก ๋ถ์ํ ๊ณํ์ด๋ค.
์ด์ ๊ฐ์ด, ๋ณธ ๋ ผ๋ฌธ์์ ์ ์ํ ๊ฐ๋จํ๋ฉด์๋ ๊ฐ๋ ฅํ ๊ธฐ๋ฒ์ GAN ๊ธฐ๋ฐ ์ด๋ฏธ์ง ํฉ์ฑ ๋ถ์ผ์์ ์ฌ์ฉ์ ์นํ์ ์ธ ์ธํฐํ์ด์ค ๋ฅผ ์ ๊ณตํ๊ณ , ํด์ ๊ฐ๋ฅ์ฑ(interpretability) ์ ํฌ๊ฒ ํฅ์์ํฌ ์ ์๋ ์ค์ํ ๋ฐํ์ด ๋ ๊ฒ์ผ๋ก ๊ธฐ๋ํ๋ค.