Quantization is a widely adopted technique for deep neural networks to reduce the memory and computational resources required. However, when quantized, most models would need a suitable calibration process to keep their performance intact, which requires data from the target domain, such as a fraction of the dataset used in model training and model validation (i.e. calibration dataset). In this study, we investigate the use of synthetic data as a substitute for the calibration with real data for the quantization method. We propose a data generation method based on Generative Adversarial Networks that are trained prior to the model quantization step. We compare the performance of models quantized using data generated by StyleGAN2-ADA and our pre-trained DiStyleGAN, with quantization using real data and an alternative data generation method based on fractal images. Overall, the results of our experiments demonstrate the potential of leveraging synthetic data for calibration during the quantization process. In our experiments, the percentage of accuracy degradation of the selected models was less than 0.6%, with our best performance achieved on MobileNetV2 (0.05%). The code is available at: https://github.com/ThanosM97/gsoc2022-openvino
翻译:量化是深度神经网络中广泛采用的技术,旨在降低所需的内存和计算资源。然而,量化后的大多数模型需要合适的校准过程来保持其性能不变,这需要来自目标域的数据,例如用于模型训练和模型验证的一部分数据集(即校准数据集)。本研究探讨了使用合成数据替代真实数据进行量化方法校准的可行性。我们提出了一种基于生成对抗网络的数据生成方法,该方法在模型量化步骤之前进行训练。我们比较了使用StyleGAN2-ADA和我们预训练的DiStyleGAN生成的数据进行量化的模型性能,并将其与使用真实数据以及基于分形图像的替代数据生成方法进行量化的情况进行了对比。总体而言,我们的实验结果证明了在量化过程中利用合成数据进行校准的潜力。实验中,所选模型的精度下降百分比低于0.6%,其中在MobileNetV2上取得了最佳性能(0.05%)。代码地址:https://github.com/ThanosM97/gsoc2022-openvino