通过分类实现二值化:soft function 真的必要吗?
Binarizing by Classification: Is soft function really necessary?
AI总结:
本文将网络二值化建模为二分类,用 MLP 同时承担前向二值分类与反向梯度估计,无需手工 soft function,并在 ImageNet 与 COCO 上显著提升二值网络性能。
摘要:
二值神经网络利用 Sign 函数将权重和激活二值化,这需要梯度估计器来克服其不可微性,并且在反向传播过程中不可避免地会引入梯度误差。尽管许多手工设计的 soft function 已被提出作为梯度估计器,以更好地近似梯度,但其机制并不清晰,而且二值模型与其全精度对应模型之间仍存在巨大的性能差距。为解决这些问题并降低梯度误差,我们提出将网络二值化作为一个二分类问题处理,并使用多层感知机(MLP)作为前向传播中的分类器以及反向传播中的梯度估计器。得益于 MLP 在理论上能够拟合任意连续函数的能力,它可以被自适应地学习,以二值化网络并反向传播梯度,而无需任何关于 soft function 的先验知识。从这一视角出发,我们进一步通过实验证明,即使是简单的线性函数也能优于以往复杂的 soft function。大量实验表明,所提出的方法在图像分类和人体姿态估计任务中均取得了令人惊讶的性能。具体而言,我们在 ImageNet 数据集上使 ResNet-34 达到 65.7% 的 top-1 准确率,绝对提升 2.6%。此外,我们将二值化作为姿态估计模型的一种轻量化方法,并提出了精心设计的二值姿态估计网络 SBPN 和 BHRNet。在具有挑战性的 Microsoft COCO 关键点数据集上评估时,所提出的方法使二值网络首次实现高达 60.6 的 mAP。在真实平台上进行的实验表明,BNN 在性能与计算复杂度之间取得了更好的平衡,尤其是在计算资源极低的情况下。
英文摘要:
Binary neural networks leverage $\mathrm{Sign}$ function to binarize weights and activations, which require gradient estimators to overcome its non-differentiability and will inevitably bring gradient errors during backpropagation. Although many hand-designed soft functions have been proposed as gradient estimators to better approximate gradients, their mechanism is not clear and there are still huge performance gaps between binary models and their full-precision counterparts. To address these issues and reduce gradient error, we propose to tackle network binarization as a binary classification problem and use a multi-layer perceptron (MLP) as the classifier in the forward pass and gradient estimator in the backward pass. Benefiting from the MLP's theoretical capability to fit any continuous function, it can be adaptively learned to binarize networks and backpropagate gradients without any prior knowledge of soft functions. From this perspective, we further empirically justify that even a simple linear function can outperform previous complex soft functions. Extensive experiments demonstrate that the proposed method yields surprising performance both in image classification and human pose estimation tasks. Specifically, we achieve $65.7\%$ top-1 accuracy of ResNet-34 on ImageNet dataset, with an absolute improvement of $2.6\%$. Moreover, we take binarization as a lightweighting approach for pose estimation models and propose well-designed binary pose estimation networks SBPN and BHRNet. When evaluating on the challenging Microsoft COCO keypoint dataset, the proposed method enables binary networks to achieve a mAP of up to $60.6$ for the first time. Experiments conducted on real platforms demonstrate that BNN achieves a better balance between performance and computational complexity, especially when computational resources are extremely low.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。