We present QNNRepair, the first method in the literature for repairing quantized neural networks (QNNs). QNNRepair aims to improve the accuracy of a neural network model after quantization. It accepts the full-precision and weight-quantized neural networks and a repair dataset of passing and failing tests. At first, QNNRepair applies a software fault localization method to identify the neurons that cause performance degradation during neural network quantization. Then, it formulates the repair problem into a linear programming problem of solving neuron weights parameters, which corrects the QNN's performance on failing tests while not compromising its performance on passing tests. We evaluate QNNRepair with widely used neural network architectures such as MobileNetV2, ResNet, and VGGNet on popular datasets, including high-resolution images. We also compare QNNRepair with the state-of-the-art data-free quantization method SQuant. According to the experiment results, we conclude that QNNRepair is effective in improving the quantized model's performance in most cases. Its repaired models have 24% higher accuracy than SQuant's in the independent validation set, especially for the ImageNet dataset.
翻译:摘要:我们提出了QNNRepair,这是文献中首个用于修复量化神经网络(QNN)的方法。QNNRepair旨在提升神经网络模型量化后的精度。该方法接收全精度与权重量化神经网络以及一个包含通过测试和失败测试的修复数据集。首先,QNNRepair应用软件故障定位方法来识别神经网络量化过程中导致性能下降的神经元。随后,它将修复问题转化为求解神经元权重参数的线性规划问题,从而在纠正QNN在失败测试上性能的同时,不损害其在通过测试上的性能。我们使用广泛应用的神经网络架构(如MobileNetV2、ResNet和VGGNet)在包括高分辨率图像在内的流行数据集上评估了QNNRepair。同时,我们将QNNRepair与当前最先进的无数据量化方法SQuant进行比较。实验结果表明,QNNRepair在多数情况下能有效提升量化模型的性能。其修复后的模型在独立验证集上的准确率比SQuant高出24%,尤其在ImageNet数据集上表现更为显著。