[论文解读] Zero-Shot Knowledge Distillation from a Decision-Based Black-Box Model
本文提出零样本决策型黑盒知识蒸馏(ZSDB3KD),一种通过仅返回硬标签预测的黑盒教师模型蒸馏知识来训练紧凑学生网络的方法。通过迭代优化噪声输入以最大化其与决策边界的距离,该方法生成鲁棒的伪样本,其软标签使在无法访问训练数据或教师参数的情况下也能实现有效蒸馏,进而在CIFAR-10上实现59.46%的准确率(AlexNet-Half)。
Knowledge distillation (KD) is a successful approach for deep neural network acceleration, with which a compact network (student) is trained by mimicking the softmax output of a pre-trained high-capacity network (teacher). In tradition, KD usually relies on access to the training samples and the parameters of the white-box teacher to acquire the transferred knowledge. However, these prerequisites are not always realistic due to storage costs or privacy issues in real-world applications. Here we propose the concept of decision-based black-box (DB3) knowledge distillation, with which the student is trained by distilling the knowledge from a black-box teacher (parameters are not accessible) that only returns classes rather than softmax outputs. We start with the scenario when the training set is accessible. We represent a sample's robustness against other classes by computing its distances to the teacher's decision boundaries and use it to construct the soft label for each training sample. After that, the student can be trained via standard KD. We then extend this approach to a more challenging scenario in which even accessing the training data is not feasible. We propose to generate pseudo samples distinguished by the teacher's decision boundaries to the largest extent and construct soft labels for them, which are used as the transfer set. We evaluate our approaches on various benchmark networks and datasets and experiment results demonstrate their effectiveness. Codes are available at: https://github.com/zwang84/zsdb3kd.
研究动机与目标
- 解决教师模型为仅返回类别概率的决策型黑盒时的知识蒸馏挑战。
- 在因隐私或存储限制而无法访问训练数据和模型参数的实际场景中实现知识迁移。
- 开发一种零样本方法,从黑盒教师模型生成高质量伪样本,以构建用于蒸馏的软标签。
- 在基准数据集上展示该方法在数据可访问与不可访问设置下的有效性。
提出的方法
- 通过测量每个训练样本相对于教师决策边界的鲁棒性(即其与边界的距离),构建软标签,利用多次查询估计梯度方向。
- 在无法访问数据的情境下,通过优化随机噪声以最大化其与决策边界的距离,生成伪样本,模拟真实训练数据分布。
- 通过多次查询黑盒教师模型获取的梯度估计,将样本从决策边界推开,实现优化过程。
- 软标签基于样本对不同类别的相对鲁棒性生成,从而支持学生网络的标准知识蒸馏训练。
- 该方法利用真实训练样本天然更具鲁棒性(远离决策边界)的特性,优于对抗性或随机样本。
- 通过将白盒参数访问替换为基于查询的边界估计,将零样本知识蒸馏扩展至黑盒设置。
实验结果
研究问题
- RQ1当教师模型仅返回硬标签,且无法访问模型参数或训练数据时,能否有效执行知识蒸馏?
- RQ2在无法获取类别概率的情况下,如何从基于决策的黑盒教师模型构建软标签?
- RQ3通过最大化与决策边界的距离生成的伪样本,能否有效代表真实数据分布以用于蒸馏?
- RQ4当训练数据和教师参数不可用时,学生模型的性能与标准知识蒸馏相比如何?
主要发现
- 在CIFAR-10上使用AlexNet-Half,ZSDB3KD在不访问任何训练数据或教师softmax输出的情况下实现了59.46%的测试准确率,显著优于随机噪声输入(13.53%和14.79%)
- 在可访问训练数据的情况下,DB3KD在FLOWERS102上表现出具有竞争力的性能,证明了在约束较少设置下的有效性。
- 经过1000次迭代后,生成的伪样本在视觉上连贯且可识别,平均图像与真实数据分布高度相似。
- 仅使用每类1,000个伪样本,学生模型在MNIST上实现了94%的测试准确率,接近于在完整访问条件下标准知识蒸馏的性能。
- 随着迭代次数和样本数量的增加,性能持续提升,且在每类8,000个样本时趋于饱和,表明方法具备良好的可扩展性。
- 消融实验确认,生成样本的质量和学生模型的性能强烈依赖于优化步数和所用伪样本数量。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。