III. ATTRIBUTE GAN (ATTGAN)
前提:所有attribute都是binary型的

A. Testing Formulation
定义输入图像为xa,包含n个attribute a=[a1,⋯,an]
encoder网络Genc将xa编码为latent representation z
z=Genc(xa)(3)
target attribute记为b=[b1,⋯,bn]
decoder网络Gdec将z和b作为输入,生成图像xb^
xb^=Gdec(z,b)(4)
综合公式(3)和(4),有
xb^=Gdec(Genc(xa),b)(5)
B. Training Formulation
整个训练过程是无监督的,因为ground truth xb是未知的
Reconstruction Loss
我们希望只编辑attribute改变的部分,同时保留其它attribute不变,因此引入reconstruction learning(文章给出了2个理由,感觉略显牵强)
令b=a,得到生成图像xa^
xa^=Gdec(z,a)(6)
那么xa^与xa应该比较近似,于是关于生成器G的Reconstruction Loss定义如下
Genc,Gdecmin Lrec=Exa∼pdata∥∥xa−xa^∥∥1(11)
使用ℓ1 loss相较于ℓ2 loss不容易模糊
Attribute Classification Constraint
生成图像xb^应该确保包含属性b,因此引入一个attribute classifier C
于是关于生成器G的Attribute Classification Constraint定义如下
Genc,GdecminLclsg=Exa∼pdata,b∼pattr[ℓg(xa,b)](7)
ℓg(xa,b)=i=1∑n−bilogCi(xb^)−(1−bi)log(1−Ci(xb^))(8)
attribute classifier C的训练目标如下
Cmin Lclsc=Exa∼pdata[ℓr(xa,a)](9)
ℓr(xa,a)=i=1∑n−ailogCi(xa)−(1−ai)log(1−Ci(xa))(10)
Adversarial Loss
使用WGAN-GP版本的adversarial Loss,判别器D和生成器G的目标函数分别如下
∥D∥L⩽1minLadvd=−Exa∼pdataD(xa)+Exa∼pdata,b∼pattrD(xb^)(12)
Genc,GdecminLadvg=−Exa∼pdata,b∼pattrD(xb^)(13)
Overall Objective
生成器G的目标函数如下
Genc,GdecminLenc,dec=λ1Lrec+λ2Lclsg+Ladvg(14)
判别器D和attribute classifier C的目标函数如下
D,Cmin Ldis,cls=λ3Lclsc+Ladvd(15)
C. Why are attribute-excluding details preserved?
AttGAN执行了multi-task learning,一个是face reconstruction task,另一个是attribute editing task
作者认为这两个task是高度相似的,它们之间的transferability gap非常小,因此the detail preservation ability learned from the face reconstruction task can be easily transfered to the attribute editing task
D. Extension for Attribute Style Manipulation
参考文献[28]和[26],引入一组style controllers θ=[θ1,⋯,θi,⋯,θn],然后maximize the mutual information between the controllers and the output images to make them highly correlated

具体来说,如Figure 3所示,额外引入一个style predictor Q,encoder网络Gdec额外接收θ作为输入,生成具备target attribute b和style controllerθ的图像xθ^b^
xθ^b^=Gdec(Genc(xa),θ,b)(16)
style controller θ与生成图像x∗之间的mutual information定义如下
I(θ;x∗)=Qmax Eθ∼p(θ),x∗∼p(x∗∣θ)[logQ(θ∣x∗)]+const(17)
故生成器G新增一项损失函数如下
Genc,GdecmaxI(θ;x∗)(18)