计算机科学 ›› 2020, Vol. 47 ›› Issue (5): 144-148.doi: 10.11896/jsjkx.190700176

• 计算机图形学&多媒体 • 上一篇    下一篇

量化权值激活的生成对抗网络

郑哲1,2,3, 胡庆浩2, 刘青山1,3, 冷聪2   

  1. 1 南京信息工程大学自动化学院 南京210044
    2 中国科学院自动化研究所南京人工智能芯片创新研究院 南京211100
    3 江苏省大数据分析技术重点实验室 南京21004
  • 收稿日期:2019-07-25 出版日期:2020-05-15 发布日期:2020-05-19
  • 通讯作者: 刘青山(qsliu@nuist.edu.cn)
  • 作者简介:z.zheng@nuist.edu.cn

Quantizing Weights and Activations in Generative Adversarial Networks

ZHENG Zhe1,2,3, HU Qing-hao2, LIU Qing-shan1,3, LENG Cong2   

  1. 1 School of Automation,Nanjing University of Information Science &Technology,Nanjing 210044,China
    2 Artificial Intelligence Chip Research,Institute of Automation,Chinese Academy of Science,Nanjing 211100,China
    3 Jiangsu Key Lab of Big Data Analysis Technology,Nanjing 210044,China
  • Received:2019-07-25 Online:2020-05-15 Published:2020-05-19
  • About author:ZHENG Zhe,postgraduate.His main research interests include deep network compression and so on.
    LIU Qin-shan,professor.His main research interests include image and vision analysis,including face image analysis,graph and hypergraph-based image and video understanding,medical image analysis,and event-based video analysis.

摘要: 近年来,生成对抗网络(Generative Adversarial Networks,GAN)在图像超分辨率、图像生成等许多计算机视觉任务中展现出优异的性能。借助于GPU强大的计算力,人们可以设计计算复杂度更高的GAN网络。然而,对于资源受限的移动端设备,高功耗、计算需求大的GAN将很难被直接部署到实际应用中。得益于神经网络压缩技术取得的巨大进展,将GAN部署到移动端设备成为可能。为此,文中提出一种同时对网络权值和激活进行量化的方案来压缩GAN网络。通过量化敏感性分析发现,与量化分类网络不同,GAN中的量化权重比量化激活更敏感,因此在量化时给予权重更多的量化比特。文中比较了两种评价GAN生成图像的指标即Inception Score(IS)和Fréchet Inception Distance(FID),发现FID更适合评估量化后GAN的性能。基于敏感性分析在Mnist和Celeb-A数据集上进行量化实验,用FID指标来评估量化GAN的性能。实验结果表明:在生成图像质量不下降的情况下,所提方法依然可以取得4倍以上的压缩率,从而有效地解决了GAN的压缩问题。

关键词: 量化, 神经网络压缩, 生成对抗网络, 移动端设备, 资源受限

Abstract: In recent years,generative adversarial network have shown excellent performance in many computer vision tasks such as ima-ge super resolution,image generation and so on.GANs can be designed to be much more greedy in computation complexity because of huge quantity uses of GPU application.For mobile devices that are resource-limited,however,on which it is intractable for GAN on be deployed due to high consumption both in energy and computation.Thanks for great success in neural network compression,it is possible to deploy GAN on mobile devices.This paper proposed a method to simultaneously quantize weights and activations in GANs.Sensitivity analysis shows that weights are more sensitive than activation in quantization process.This paper used Fréchet Inception Distance (FID)score to evaluate generated images of quantized GANs for Inception score is less applicable than FID.Motivated by sensitivity analysis,extensive experiments were conducted on Mnist and Celeb-A datasets.Results show that the proposed method can compress GANs by up to 4x and still achieve even higher performance than the original GANs.Thus,it effectively resolves the problem of compressing GANs.

Key words: Generative adversarial networks, Mobile devices, Neural network compression, Quantization, Source-limited

中图分类号: 

  • TP391
[1]GOODFELLOW IAN J.Generative adversarial nets[C]//Proceedings of the Neural Information Processing Systems.2014:2672-2680.
[2]KRIZHEVSKY A.ImageNet classification with deep convolutional neural networks[C]//Proceedings of the Neural Information Processing Systems.2012:1106-1114.
[3]BROCK A,DONAHUE J,SIMONYAN K.Large Scale GAN Training for High Fidelity Natural Image Synthesis[J].arXiv:1809.11096.
[4]WANG P,WANG D,JI Y,et al.QGAN:Quantized Generative Adversarial Networks[J].arXiv:1901.08263.
[5]ANGELINE A,CHIANG P,GAIN A,et al.Compressing gans using knowledge distillation[J].arXiv:1902.00159.
[6]HEUSEL M,RAMSAUER H,UNTERHINER T,et al.GANs Trained by a TWO Time-Scale Update Rule Converge to a Local Nash Equilibrium[J].arXiv:1706.08500.
[7]SALIMANS T,GOODFELLOW I,ZAREMBA W,et al.Im-proved Techniques for Training GANs[C]//Proceedings of the Neural Information Processing Systems.2016:2234-2242.
[8]MIRZA M,OSINDERO S.Conditional generative adversarialnets[J].arXiv:1411.1784.
[9]KARRAS T,AILA T,LAINE S,et al.Progressivegrowing of gans for improved quality,stability,andvariation[J].arXiv:1710.10196.
[10]RADFORD A,METZ L,CHINTALA S.Unsupervised representation learning with deep convolutional generative adversarial networks[J].arXiv:1511.06434.
[11]ARJOVSKY M,CHINTALA S,BOTTOU L.Wasserstein gan[J].arXiv:1701.07875.
[12]GULRAJANI I,AHMED F,ARJOVSKY M,et al.CImproved training of wasserstein gans[C]//Proceedings of the Neural Information Processing Systems.2017:5767-5777.
[13]HUBARA I,COURBARIAUX M,SOUDRY D,et al.Binarized neural networks[C]//Proceedings of Neural Information Processing Systems.2016:4107-4115.
[14]COURBARIAUX M,BENGIO Y,DAVID J.Binaryconnect:Training deep neural networks with binary weights duringpro-pagations[C]//Proceedings of the Neural Information Proces-sing.2015:3123-3131.
[15]RASTEGARI M.XNOR-Net:ImageNet Classification Using Binary Convolutional Neural Networks[C]//Proceedings of the European Conference on Computer Vision.2016:525-542.
[16]HU Q H,WANG P S,CHENG J.From Hashing to CNNs:Training Binary Weight Networks via Hashing[C]//Procee-dings of theAAAI Conferenceon Artificial Intelligence.2018:3247-3254.
[17]LIN X,ZHAO C,PAN W.Towards accurate binary convolutional neural network.[C]//Proceedings of the Neural Information Processing Systems.Montreal,2017:345-353.
[18]ZHOU A J,YAO A B,GUO Y W,et al.Incremental Network Quantization:Towards Lossless CNNs with Low-Precision Weights[J].arXiv:1702.03044.
[19]LI Z,NI B,ZHANG W,et al.Performance guaranteed net-workacceleration via high-order residual quantization[C]//Proceedings of the International Conference on Computer Vision.2017:2584-2592.
[20]FROMM J,PATEL S,PHILIPOSE M.Heterogeneous Bitwidth Binarization in Convolutional Neural Networks[C]//Procee-dings of the Neural Information Processing Systems.2018:4006-4015.
[21]WANG K,LIU Z J,LIN Y J,et al.HAQ:Hardware-Aware Automated Quantization[J].arXiv:1811.08886.
[22]ZHOU S C,WU Y X,NI Z K,et al.DoReFa-Net:Training Low Bitwidth Convolutional Neural Networks with Low Bitwidth Gradients[J].arXiv:1606.06160.
[23]ZHANG D Q,YANG J L,YE D Q Z,et al.LQ-Nets:Learned Quantization for Highly Accurate and Compact Deep Neural Networks[C]//Proceedings of European Conference on Computer Vision.2018.
[24]ZHUANG B H,SHEN C H,TAN M K,et al.Structured Binary Neural Networks for Accurate Image Classification and Semantic Segmentation[J].arXiv:1811.10413.
[25]CAI Z,HE X,SUN J,et al.Deep learning with low precision by halfwavegaussian quantization[C]//Proceedings of IEEE Conference on Computer Vision and Pattern Recognition.New York:IEEE Press,2017:5918-5926.
[26]BENGIO Y,LÉONARD N,COURVILLE A.Estimating orpropagating gradientsthrough stochastic neurons for conditional computation[J].arXiv:1308.3432.
[27]SHANE B,RISHI S.A Note on the Inception Score[J].arXiv:1801.01973.
[1] 张佳, 董守斌.
基于评论方面级用户偏好迁移的跨领域推荐算法
Cross-domain Recommendation Based on Review Aspect-level User Preference Transfer
计算机科学, 2022, 49(9): 41-47. https://doi.org/10.11896/jsjkx.220200131
[2] 王冠宇, 钟婷, 冯宇, 周帆.
基于矢量量化编码的协同过滤推荐方法
Collaborative Filtering Recommendation Method Based on Vector Quantization Coding
计算机科学, 2022, 49(9): 48-54. https://doi.org/10.11896/jsjkx.210700109
[3] 孙奇, 吉根林, 张杰.
基于非局部注意力生成对抗网络的视频异常事件检测方法
Non-local Attention Based Generative Adversarial Network for Video Abnormal Event Detection
计算机科学, 2022, 49(8): 172-177. https://doi.org/10.11896/jsjkx.210600061
[4] 戴朝霞, 李锦欣, 张向东, 徐旭, 梅林, 张亮.
基于DNGAN的磁共振图像超分辨率重建算法
Super-resolution Reconstruction of MRI Based on DNGAN
计算机科学, 2022, 49(7): 113-119. https://doi.org/10.11896/jsjkx.210600105
[5] 郝强, 李杰, 张曼, 王路.
基于改进YOLOv3的空间非合作目标部件识别算法
Spatial Non-cooperative Target Components Recognition Algorithm Based on Improved YOLOv3
计算机科学, 2022, 49(6A): 358-362. https://doi.org/10.11896/jsjkx.210700048
[6] 尹文兵, 高戈, 曾邦, 王霄, 陈怡.
基于时频域生成对抗网络的语音增强算法
Speech Enhancement Based on Time-Frequency Domain GAN
计算机科学, 2022, 49(6): 187-192. https://doi.org/10.11896/jsjkx.210500114
[7] 徐辉, 康金梦, 张加万.
基于特征感知的数字壁画复原方法
Digital Mural Inpainting Method Based on Feature Perception
计算机科学, 2022, 49(6): 217-223. https://doi.org/10.11896/jsjkx.210500105
[8] 高志宇, 王天荆, 汪悦, 沈航, 白光伟.
基于生成对抗网络的5G网络流量预测方法
Traffic Prediction Method for 5G Network Based on Generative Adversarial Network
计算机科学, 2022, 49(4): 321-328. https://doi.org/10.11896/jsjkx.210300240
[9] 黎思泉, 万永菁, 蒋翠玲.
基于生成对抗网络去影像的多基频估计算法
Multiple Fundamental Frequency Estimation Algorithm Based on Generative Adversarial Networks for Image Removal
计算机科学, 2022, 49(3): 179-184. https://doi.org/10.11896/jsjkx.201200081
[10] 李建, 郭延明, 于天元, 武与伦, 王翔汉, 老松杨.
基于生成对抗网络的多目标类别对抗样本生成算法
Multi-target Category Adversarial Example Generating Algorithm Based on GAN
计算机科学, 2022, 49(2): 83-91. https://doi.org/10.11896/jsjkx.210800130
[11] 谈馨悦, 何小海, 王正勇, 罗晓东, 卿粼波.
基于Transformer交叉注意力的文本生成图像技术
Text-to-Image Generation Technology Based on Transformer Cross Attention
计算机科学, 2022, 49(2): 107-115. https://doi.org/10.11896/jsjkx.210600085
[12] 陈贵强, 何军.
自然场景下遥感图像超分辨率重建算法研究
Study on Super-resolution Reconstruction Algorithm of Remote Sensing Images in Natural Scene
计算机科学, 2022, 49(2): 116-122. https://doi.org/10.11896/jsjkx.210700095
[13] 石达, 芦天亮, 杜彦辉, 张建岭, 暴雨轩.
基于改进CycleGAN的人脸性别伪造图像生成模型
Generation Model of Gender-forged Face Image Based on Improved CycleGAN
计算机科学, 2022, 49(2): 31-39. https://doi.org/10.11896/jsjkx.210600012
[14] 唐雨潇, 王斌君.
基于深度生成模型的人脸编辑研究进展
Research Progress of Face Editing Based on Deep Generative Model
计算机科学, 2022, 49(2): 51-61. https://doi.org/10.11896/jsjkx.210400108
[15] 张玮琪, 汤轶丰, 李林燕, 胡伏原.
基于场景图的段落生成序列图像方法
Image Stream From Paragraph Method Based on Scene Graph
计算机科学, 2022, 49(1): 233-240. https://doi.org/10.11896/jsjkx.201100207
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!