BiPer:使用周期函数的二值神经网络
BiPer: Binary Neural Networks using a Periodic Function
AI总结:
本文提出BiPer方法,在前向传播中用方波二值化、反向传播中用同周期正弦函数作为可微替代,通过周期函数频率控制量化误差,在CIFAR-10和ImageNet上分别提升最高1%和0.69%。
摘要:
量化神经网络对权重和激活值采用降低精度的表示。这一量化过程显著降低了网络的内存需求和计算复杂度。二值神经网络(BNNs)是量化的极端情况,仅用一位来表示数值。由于通常使用符号函数将实数值映射为二值,因此引入平滑近似来在误差反向传播过程中模拟梯度。因此,前向模型与反向模型之间的不匹配会破坏梯度方向,导致训练不一致问题和性能下降。与当前的二值神经网络方法不同,我们提出在二值化过程中采用二值周期(BiPer)函数。具体来说,我们在前向传播中使用方波来获得二值,并在反向传播中使用与方波具有相同周期的三角函数正弦函数作为可微替代。我们证明该方法可以通过利用周期函数的频率来控制量化误差,并提高网络性能。大量实验在基准数据集和网络架构上验证了BiPer的有效性,在CIFAR-10和ImageNet分类任务上相比最先进方法分别提升了最高1%和0.69%。我们的代码已在 https://github.com/edmav4/BiPer 公开。
英文摘要:
Quantized neural networks employ reduced precision representations for both weights and activations. This quantization process significantly reduces the memory requirements and computational complexity of the network. Binary Neural Networks (BNNs) are the extreme quantization case, representing values with just one bit. Since the sign function is typically used to map real values to binary values, smooth approximations are introduced to mimic the gradients during error backpropagation. Thus, the mismatch between the forward and backward models corrupts the direction of the gradient, causing training inconsistency problems and performance degradation. In contrast to current BNN approaches, we propose to employ a binary periodic (BiPer) function during binarization. Specifically, we use a square wave for the forward pass to obtain the binary values and employ the trigonometric sine function with the same period of the square wave as a differentiable surrogate during the backward pass. We demonstrate that this approach can control the quantization error by using the frequency of the periodic function and improves network performance. Extensive experiments validate the effectiveness of BiPer in benchmark datasets and network architectures, with improvements of up to 1% and 0.69% with respect to state-of-the-art methods in the classification task over CIFAR-10 and ImageNet, respectively. Our code is publicly available at https://github.com/edmav4/BiPer.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。