[论文解读] BinaryDuo: Reducing Gradient Mismatch in Binary Activation Network by Coupling Binary Activations
BinaryDuo 通过将预训练的三值激活解耦为两个二值激活来训练二值激活网络,从而实现更好的梯度匹配,并在像 CIFAR-10 和 ImageNet 规模模型这样的基准测试中对比最先进的 BNNs 提高准确率。
Binary Neural Networks (BNNs) have been garnering interest thanks to their compute cost reduction and memory savings. However, BNNs suffer from performance degradation mainly due to the gradient mismatch caused by binarizing activations. Previous works tried to address the gradient mismatch problem by reducing the discrepancy between activation functions used at forward pass and its differentiable approximation used at backward pass, which is an indirect measure. In this work, we use the gradient of smoothed loss function to better estimate the gradient mismatch in quantized neural network. Analysis using the gradient mismatch estimator indicates that using higher precision for activation is more effective than modifying the differentiable approximation of activation function. Based on the observation, we propose a new training scheme for binary activation networks called BinaryDuo in which two binary activations are coupled into a ternary activation during training. Experimental results show that BinaryDuo outperforms state-of-the-art BNNs on various benchmarks with the same amount of parameters and computing cost.
研究动机与目标
- 在训练过程中激励并量化二值激活网络中的梯度不匹配。
- 提出一种更好的梯度不匹配估计方法,利用平滑损失的梯度。
- 引入 BinaryDuo:一种两阶段训练方案,将三值激活解耦为两个二值激活,随后进行微调。
- 证明 BinaryDuo 在 CIFAR-10、ImageNet(使用 AlexNet 和 ResNet-18)的相近参数和计算预算下达到最先进或有竞争力的准确率。
提出的方法
- 利用 Coordinate Discrete Gradient (CDG) 的平滑损失梯度来估计梯度不匹配。
- 表明更高精度的激活(ternary 或 2-bit)比复杂的 STEs 更有效地缓解梯度不匹配。
- 提出 BinaryDuo:先用 ternary 激活训练网络,然后通过带有特定 BN 偏置变化的解耦成两个二值激活,以模拟 ternary 函数。
- 解耦后对权重进行翻倍,并按比例重新配置层宽度以保持参数数量在可比范围内,随后对解耦后的二值网络进行微调。
实验结果
研究问题
- RQ1能否用平滑损失的梯度来更好地估计梯度不匹配,而不是激活与近似之间的累积差?
- RQ2在训练阶段利用三值激活、推理阶段解耦为二值激活的训练方案,在等成本下是否能提升 BNN 的性能?
- RQ3在像 CIFAR-10 和 ImageNet 等标准基准测试中,BinaryDuo 在准确性和效率方面与最先进的 BNN 方法相比如何?
主要发现
| 网络 | Top-1 | Top-5 | (Mbit) | FLOP |
|---|---|---|---|---|
| AlexNet (BNN) | 41.8 | 67.1 | 62.3 | 82.3M |
| XNOR-Net | 44.2 | 69.2 | 191 | 126M |
| BNN+ | 46.1 | 75.7 | 191 | 126M |
| BinaryDuo | 52.7 | 76.0 | 189 | 119M |
| BinaryDuo(+sc)† | - | - | - | 164M |
| ResNet-18 (BNN with shortcut) | - | - | - | - |
| BinaryDuo(+sc)† | 60.9 | 82.6 | 31.9 | 164M |
- 粗梯度与 Coordinate Discrete Gradient (CDG) 之间的余弦相似度在二值激活下下降,且不会被复杂的 STE 所改进。
- 更高精度的激活(ternary/2-bit)比仅改进反向代理更有效地降低梯度不匹配。
- 将两个二值激活耦合以模拟一个 ternary 激活(BinaryDuo),然后解耦并进行微调,在相同参数和计算预算下获得更高的准确率。
- 在 CIFAR-10 的 VGG-7 上,解耦后的 BinaryDuo 达到 90.44% 的测试准确度,超过在耦合三值模型训练后再微调得到的基线二值模型 89.07%(89.69%)。
- 在 ImageNet 的 AlexNet 和 ResNet-18 上,BinaryDuo 的 top-1 准确率分别为 52.7%(AlexNet)和 60.4%(ResNet-18),在类似的参数和计算预算下优于其他 BNN 方案;BinaryDuo(+sc) 在 ResNet-18 的快捷连接下达到 60.9% 的 top-1。
- BinaryDuo 在所测试的架构中始终优于最先进的 BNN 方法,同时保持可比较的模型大小和 FLOPs。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。