acgan

本文探讨了AC-GAN在条件图像合成中的应用,详细介绍了其损失函数与网络结构,并通过实验证明了该方法能有效提升生成图像的质量与多样性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

论文笔记

acgan(Conditional Image Synthesis with Auxiliary Classifier GANs)

gan损失函数:
discriminator
acgan损失函数:
在这里插入图片描述
D is trained to maximize LS + LC while G is trained to
maximize LC - LS.AC-GAN学习与类标签无关的z表示形式
广义上讲,
发生器G的结构是一系列“反卷积”层,它们将噪声z和c类别转换为图像
判别器D是具有LeakyReLU非线性的深度卷积神经网络

证明提升了生成图像的鉴别能力和图像的多样性
To measure discriminability, we feed synthesized images
to a pre-trained Inception network (Szegedy et al., 2015)
and report the fraction of the samples for which the Inception network assigned the correct label2
MS-SSIM是已充分表征的感知相似性度量标准的多尺度变体,它试图将对人类感知不重要的图像方面去除掉
在这里插入图片描述

### ACGAN架构详解 #### 条件信息集成 ACGAN(Auxiliary Classifier GAN)扩展了条件生成对抗网络(cGAN),不仅能够基于噪声向量生成样本,还能根据类别标签生成指定类别的数据。在ACGAN中,除了常规的生成器和判别器外,还引入了一个辅助分类器用于预测输入样本的真实类别[^3]。 #### 生成器设计 生成器接收随机噪声\( z \)以及目标类别标签\( y \),并将两者拼接成一个新的向量作为实际输入。这种做法允许模型理解不同类别之间的差异并据此创建具有特定属性的数据实例。生成过程旨在欺骗判别器相信所产生物品来自真实的分布而非合成版本。 ```python import tensorflow as tf from tensorflow.keras.layers import Dense, Reshape, Concatenate def build_generator(latent_dim=100, num_classes=10): label_input = Input(shape=(1,), dtype='int32') noise_input = Input(shape=(latent_dim,)) # 将标签嵌入到适当维度的空间内并与噪音混合 label_embedding = Embedding(num_classes, latent_dim)(label_input) flat_label = Flatten()(label_embedding) merged_inputs = Multiply()([noise_input, flat_label]) x = Dense(7 * 7 * 256, activation="relu")(merged_inputs) ... ``` #### 判别器与辅助分类器组合 判别器部分负责评估传入样本的真实性;与此同时,附加的一个小型全连接层充当辅助分类器的角色,试图推断出每张图像是哪个具体类别成员。此设置促使生成器不仅要制造逼真的伪造品还要确保这些产物符合预期的语义特征。 ```python def build_discriminator(img_shape, num_classes=10): img_input = Input(shape=img_shape) model = Sequential([ Conv2D(64, kernel_size=3, strides=2, input_shape=img_shape), LeakyReLU(alpha=0.2), Dropout(0.25), ... ]) features = model(img_input) validity = Dense(1, activation='sigmoid')(features) aux_output = Dense(num_classes, activation='softmax')(features) return Model(inputs=[img_input], outputs=[validity, aux_output]) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值