
ZERO-SHOT LEARNING OF A CONDITIONAL GENERATIVE ADVERSARIAL NETWORK
FOR DATA-FREE NETWORK QUANTIZATION
Yoojin Choi, Mostafa El-Khamy, Jungwon Lee
SoC R&D, Samsung Semiconductor Inc., San Diego, CA 92121, USA
ABSTRACT
We propose a novel method for training a conditional gener-
ative adversarial network (CGAN) without the use of train-
ing data, called zero-shot learning of a CGAN (ZS-CGAN).
Zero-shot learning of a conditional generator only needs a
pre-trained discriminative (classification) model and does not
need any training data. In particular, the conditional gener-
ator is trained to produce labeled synthetic samples whose
characteristics mimic the original training data by using the
statistics stored in the batch normalization layers of the pre-
trained model. We show the usefulness of ZS-CGAN in data-
free quantization of deep neural networks. We achieved the
state-of-the-art data-free network quantization of the ResNet
and MobileNet classification models trained on the ImageNet
dataset. Data-free quantization using ZS-CGAN showed a
minimal loss in accuracy compared to that obtained by con-
ventional data-dependent quantization.
Index Terms—Zero-shot learning, conditional genera-
tive adversarial networks, data-free training, quantization
1. INTRODUCTION
Generative adversarial networks (GANs) [1] are of great in-
terest in deep learning for image or speech synthesis prob-
lems. Two neural networks, called generator and discrim-
inator, play a zero-sum game to learn the mapping from a
random noise distribution to the target data distribution. The
generator is trained to fool the discriminator by making its
fake samples as similar as possible to the real training data,
while the discriminator is trained to distinguish the fake sam-
ples produced by the generator from the real training data.
Conditional GANs (CGANs) [2] are the conditional version
of GANs, where both the generator and the discriminator are
conditioned on some extra information, such as classes or at-
tributes. CGANs have potential in various conditional gener-
ation tasks such as labeled image generation, image-to-image
translation, and so on [3]. In this paper, we propose a novel
method of training a conditional GAN without any training
data, called zero-shot learning of a CGAN (ZS-CGAN).
Network quantization is an important procedure for effi-
cient inference when deploying pre-trained deep neural net-
works on resource-limited platforms [4]. By using quantized
Student
(quantized)
Teacher/Discriminator
(pre-trained)
Conditional
generator
Random
noise
Label
Constraint to match BN statistics
Cross-entropy ↓
Data-free
knowledge
distillation
Fig. 1: Zero-shot learning of a CGAN (ZS-CGAN) and data-
free knowledge distillation. First, we train a conditional gen-
erator without any training data. A pre-trained classification
model (called teacher) plays the role of a (fixed) discrimina-
tor that evaluates generated samples. In particular, the cross-
entropy between the generator input and the teacher output is
minimized. The generator is also constrained to produce syn-
thetic samples similar to the original training data by match-
ing the statistics at the batch normalization (BN) layers of the
teacher. Second, we transfer knowledge from the pre-trained
teacher to a (quantized) student via data-free knowledge dis-
tillation using the synthetic samples from the generator.
weights and activations, we not only reduce the computational
cost, but also lower the memory footprint required for infer-
ence. The improved efficiency after quantization is usually
traded off against an accuracy loss. To minimize the accu-
racy loss from quantization, the quantization parameters are
optimized with some calibration data in post-training quan-
tization (PTQ). To recover the accuracy loss, the quantized
model can also be re-trained with some training data, which
is called quantization-aware training (QAT).
Most of the existing network quantization methods are
data-dependent, implying that a large number of training data,
which were already used in training the floating-point model,
are assumed to be available and used in the quantization pro-
cedure (cf. [5–10]). However, it becomes more and more dif-
ficult and expensive to share the training data due to their large
size, restriction by proprietary rights, and to preserve data pri-
vacy. The regulations and compliance requirements around
privacy and security complicate both data sharing by the orig-
inal model trainer and data collection by the model quantizer,
for example, in the case of medical and bio-metric data.
The conditional generator trained with our proposed ZS-
CGAN can generate samples whose statistics match those of
the training dataset. Hence, we propose utilizing it for data-
arXiv:2210.14392v1 [cs.CV] 26 Oct 2022