[解读] Positional Normalization

规范化 (Normalization) 方法是加速深度神经网络训练的常用方法, 已经有许多归一化方法的变体, 但它们都只是跨空间的规范化, 并且会丢弃掉规范化计算过程中得到的统计信息. 本文提出一种与众不同的跨通道的规范化方法, 作者认为这是一种很自然的想法, 因为这将能够从图像或特征图的某一位置提取到一阶和二阶矩, 捕获到某种结构信息.

论文链接: https://arxiv.org/abs/1907.04312v2

Github 项目地址: https://github.com/Boyiliee/PONO

相关的工作

在这里插入图片描述

批规范化 (Batch normalization [29]) 方法用于计算机视觉任务的深度神经网络. 分组归一化 (Group normalization [74 ]) 主要用于目标检测和实力分割任务. 分层归一化 ( Layer Normalization [41]) 适用于序列模型, 常见于自然语言处理任务. 实例归一化 ( Instance normalization [68]) 因其具有从输入中删除样式信息的能力而广泛用于图像合成.

但是, 上述所有归一化方案都遵循一个共同的模式: 跨空间维度的归一化, 并丢弃提取的统计信息. 这设计背后的理念是一阶矩和二阶矩被认为是消耗性的 (expendable), 应该将之删除.

本文的方法

本文提出一种与众不同的跨通道的规范化方法 Positional Normalization (PONO), 正如上面图中所示, 提取到的均值和标准差能够捕获粗糙的结构信息. 在生成模型的情况下, 这些信息必须在解码器中重新学习. 相反, 我们建议直接将这两个矩信息 (均值和标准差) 注入到网络的后续层中, 作者称之为矩捷径 (Moment Shortcut, MS) 连接.

首先介绍 PONO 方法. 将上面图中规范化方法归纳为一般形式为:
X b , c , h , w ′ = γ ( X b , c , h , w − μ σ ) + β . X_{b, c, h, w}^{\prime}=\gamma\left(\frac{X_{b, c, h, w}-\mu}{\sigma}\right)+\beta. Xb,c,h,w=γ(σXb,c,h,wμ)+β.
根据不同的规范化方案, 计算出其对应的 μ \mu μ σ \sigma σ, 对 X X X 进行标准化, 然后再应用仿射变换(其参数为 γ , β \gamma, \beta γ,β) 得到后规范化 (post-normalized) 特征. 仿射变换的目的是保证每一次数据经过标准化后还保留原有学习来的特征, 同时又能完成规范化操作, 加速训练, 并且这两个参数也是需要学习的.

具体到本文的 PONO 方法, 其计算公式为
μ b , h , w = 1 C ∑ c = 1 C X b , c , h , w , σ b , h , w = 1 C ∑ c = 1 C ( X b , c , h , w − μ b , h , w ) 2 + ϵ \mu_{b, h, w}=\frac{1}{C} \sum_{c=1}^{C} X_{b, c, h, w}, \quad \sigma_{b, h, w}=\sqrt{\frac{1}{C} \sum_{c=1}^{C}\left(X_{b, c, h, w}-\mu_{b, h, w}\right)^{2}+\epsilon} μb,h,w=C1c=1CXb,c,h,w,σb,h,w=C1c=1C(Xb,c,h,wμb,h,w)2+ϵ

除此以外, 在深度生成模型中, 作者借鉴 U-Nets[57] 网络中从编码器到解码器的跳跃连接方法, 提出一个 PONO 的变体, 将在编码器前层中计算得到的 μ , σ \mu, \sigma μ,σ 用于对解码器中对应位置的特征进行仿射变换. 作者将这种方法称为 矩捷径(Moment Shortcut, MS). 具体如下图左半部分所示:

在这里插入图片描述

上图中的计算用函数表达为: M S ( x ) = γ F ( x ) + β \mathrm{MS}(\mathbf{x})=\gamma F(\mathbf{x})+\beta MS(x)=γF(x)+β. 其中 F F F 代指中间层的计算. β , γ \beta, \gamma β,γ 分别来自于 μ , σ \mu, \sigma μ,σ.

除了直接将 μ , σ \mu, \sigma μ,σ 向后传递, 还可以通过一个小的卷积网络来对 μ , σ \mu, \sigma μ,σ 进行变换, 这个小的网络通常只有一两层, 如上图右半部分所示. 作者将这种方法称为动态矩捷径 (DMS).

参考

  • [29] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
  • [74] Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the European Conference on Computer Vision (ECCV), pages 3–19, 2018.
  • [41] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
  • [68] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
  • [57] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234–241. Springer, 2015.

补充

规范化(Normalization)和标准化(Standardization)的区别和联系?

规范化的百度百科解释.

特征缩放是一种用于规范化独立变量或数据要素范围的方法。在数据处理中,它也称为数据规范化,通常在数据预处理步骤期间执行。它有以下四种方法:

Rescaling (min-max normalization)
x ′ = x − min ⁡ ( x ) max ⁡ ( x ) − min ⁡ ( x ) x^{\prime}=\frac{x-\min (x)}{\max (x)-\min (x)} x=max(x)min(x)xmin(x)

Mean normalization
x ′ = x − average ⁡ ( x ) max ⁡ ( x ) − min ⁡ ( x ) x^{\prime}=\frac{x-\operatorname{average}(x)}{\max (x)-\min (x)} x=max(x)min(x)xaverage(x)
Standardization (Z-score Normalization)

标准化是一种特征缩放(Feature scaling)的方法.
x ′ = x − x ˉ σ x^{\prime}=\frac{x-\bar{x}}{\sigma} x=σxxˉ
在机器学习中, 我们无法获得真实数据分布, 所以均值和方差都是估计值, 实际上这应该被称为学生化残差(https://en.wikipedia.org/wiki/Normalization_(statistics)), 有关 z-score 的内容(https://en.wikipedia.org/wiki/Standard_score)

Scaling to unit length
x ′ = x ∥ x ∥ x^{\prime}=\frac{x}{\|x\|} x=xx
我比较认同的解答:

The two most discussed scaling methods are Normalization and Standardization. Normalization typically means rescales the values into a range of [0,1]. Standardization typically means rescales data to have a mean of 0 and a standard deviation of 1 (unit variance).

https://towardsdatascience.com/normalization-vs-standardization-quantitative-analysis-a91e8a79cebf

有关规范化 (normalization) 的解释 https://en.wikipedia.org/wiki/Normalization, https://en.wikipedia.org/wiki/Normalization_(statistics)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值