GAN学习笔记(一)

做算法的过程中面对数据不足的问题,学习初衷是希望拿GAN来做数据增广。一直没有好好学习过GAN,开贴整理下资料。

先放张图:

该图的文章请见:https://zhuanlan.zhihu.com/p/70033932

附上一篇综述:https://zhuanlan.zhihu.com/p/58812258

与数据生成有关的:

https://zhuanlan.zhihu.com/p/58812258中提到行人重识别领域,有许多基于CycleGAN的迁移学习以进行数据增广的应用。同时在隐空间分解中提到CGAN和ACGAN,InfoGAN和ss-InfoGAN

GAN科普: https://zhuanlan.zhihu.com/p/35135501

关于WGAN的一些文章:https://zhuanlan.zhihu.com/p/58260684 , https://zhuanlan.zhihu.com/p/66489938 , 

Data Augmentation技术调研:https://zhuanlan.zhihu.com/p/40936977

在行人重识别的应用:https://zhuanlan.zhihu.com/p/66408913

训练技巧: https://zhuanlan.zhihu.com/p/52404647

-----------------------------------------------------------------------------------------------------------

CycleGAN源码:https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/models/networks.py#L227

CycleGAN分析: https://www.cnblogs.com/a-little-v/p/9762599.html

                           https://zhuanlan.zhihu.com/p/37198143 不过这篇缺少了identity loss

------------------------------------------------------------------------------------------------------------

关于上采样的一些状况:https://blog.csdn.net/hzhj2007/article/details/82697879 

                                      https://distill.pub/2016/deconv-checkerboard/

                                     https://zhuanlan.zhihu.com/p/31240720

结论就是,一般情况下,通过resize_image + Conv2D 可有效消除checkerboard artifacts现象。效果往往比直接Conv2DTranspose效果好。

查看keras的UpSampling2D源码:https://github.com/keras-team/keras/blob/master/keras/layers/convolutional.py#L1973

class UpSampling2D(_UpSampling):
 
    @interfaces.legacy_upsampling2d_support
    def __init__(self, size=(2, 2), data_format=None, interpolation='nearest',
                 **kwargs):
        normalized_size = conv_utils.normalize_tuple(size, 2, 'size')
        super(UpSampling2D, self).__init__(normalized_size, data_format, **kwargs)
        if interpolation not in ['nearest', 'bilinear']:
            raise ValueError('interpolation should be one '
                             'of "nearest" or "bilinear".')
        self.interpolation = interpolation

    def call(self, inputs):
        return K.resize_images(inputs, self.size[0], self.size[1],
                               self.data_format, self.interpolation)

    def get_config(self):
        config = super(UpSampling2D, self).get_config()
        config['interpolation'] = self.interpolation
        return config

可知调用的是K.resize_images方法,默认差值方法是'nearest'插值,也就是最邻近插值,还可以改成bilinear双线性插值。

另外某CycleGAN代码有如下注释:

(resize_image + Conv2D) (相比于Conv2DTranspose) can reduce checkerboard artifacts but the blurring might affect the cycle-consistency。具体效果未验证。

发布了161 篇原创文章 · 获赞 71 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/yxpandjay/article/details/100513095