Arxiv:2003.12327V1 [Cs.CV] 27 Mar 2020 Despite BW’S Theoretical Support in Improving Condition- Learning Algorithms During Data Preprocessing [25, 23, 12]

Arxiv:2003.12327V1 [Cs.CV] 27 Mar 2020 Despite BW’S Theoretical Support in Improving Condition- Learning Algorithms During Data Preprocessing [25, 23, 12]

An Investigation into the Stochasticity of Batch Whitening Lei Huangy Lei Zhao Yi Zhouy Fan Zhuy Li Liuy Ling Shaoy yInception Institute of Artificial Intelligence (IIAI), Abu Dhabi, UAE flei.huang, yi.zhou, fan.zhu, li.liu, [email protected] [email protected] 3 3 Abstract 2 2 1 1 Batch Normalization (BN) is extensively employed in var- 0 0 ious network architectures by performing standardization -1 -1 within mini-batches. A full understanding of the process Examples Examples -2 Normalized Points -2 Normalized Points has been a central target in the deep learning communi- Sampled Point Sampled Point -3 -3 ties. Unlike existing works, which usually only analyze -2 0 2 -2 0 2 the standardization operation, this paper investigates the (a) BN standardization (b) PCA whitening 3 3 more general Batch Whitening (BW). Our work originates from the observation that while various whitening transfor- 2 2 mations equivalently improve the conditioning, they show 1 1 significantly different behaviors in discriminative scenarios 0 0 -1 -1 and training Generative Adversarial Networks (GANs). We Examples Examples attribute this phenomenon to the stochasticity that BW in- -2 Normalized Points -2 Normalized Points Sampled Point Sampled Point troduces. We quantitatively investigate the stochasticity of -3 -3 -2 0 2 -2 0 2 different whitening transformations and show that it corre- (c) ZCA whitening (d) CD whitening lates well with the optimization behaviors during training. Figure 1. We sample 1000 examples (black points) from a Gaussian We also investigate how stochasticity relates to the estima- distribution in a 16-dimensional space, and show the examples in tion of population statistics during inference. Based on our the two-dimension sub-space (the 6th and 16th dimension). Given analysis, we provide a framework for designing and compar- an example x (red diamond), when combining with 100 different ing BW algorithms in different scenarios. Our proposed BW mini-batches XB (B = 64), we provide the normalized output x^ algorithm improves the residual networks by a significant (yellow pentagram), where (a), (b), (c) and (d) show the results of margin on ImageNet classification. Besides, we show that BN standardization, PCA, ZCA and CD whitening, respectively. the stochasticity of BW can improve the GAN’s performance with, however, the sacrifice of the training stability. (BW) further extends the scope of BN by removing the cor- relation of standardized activations [16]. It has been shown 1. Introduction to improve the performance in discriminative scenarios [16] and Generative Adversarial Networks (GAN) [39]. Normalization techniques have been extensively used for arXiv:2003.12327v1 [cs.CV] 27 Mar 2020 Despite BW’s theoretical support in improving condition- learning algorithms during data preprocessing [25, 23, 12]. It ing, there remains some intriguing observations relating to has been shown that centering, scaling and decorrelating the BW that are not well explored. Firstly, while various whiten- inputs speeds up the training [25]. Furthermore, whitening ing transformations can equivalently improve the condition- the input that combines all above operations, improves the ing [20], they show significant differences in performance: conditioning of the Hessian, making the gradient descent 1) Principal Component Analysis (PCA) whitening hardly updates similar to the Newton updates [25, 46, 16]. converges while Zero-phase Component Analysis (ZCA) Batch Normalization (BN) [19] extends the idea of nor- whitening works well in discriminative scenarios [16]; 2) malizing the input into the activations of intermediate layers Cholesky Decomposition (CD) whitening achieves signifi- of Deep Neural Networks (DNNs), and represents a mile- cantly better performance than ZCA in GAN training, while stone technique in the deep learning community [12, 43, 47]. it has slightly worse performance in discriminative cases BN standardizes the activations by executing centering and [39]. Secondly, while group based whitening—where fea- scaling within a mini-batch of data, facilitating the optimiza- tures are divided into groups and whitening is performed tion [19, 22, 36] and generalization [4, 5]. Batch Whitening within each one—is essential in discriminative scenarios 1 [16, 31], full feature whitening has been shown to achieve refined in [36], showing that BN leads to a smoother land- better performance in training GANs [39]. scape of the optimization problem under certain assumptions. This paper focuses on explaining the above observations Ghorbani et al.[10] investigated this explanation by comput- of BW. We find that the stochasticity introduced by normal- ing the spectrum of the Hessian for a large-scale dataset. It is ization over batch data (Figure1) can be key to uncovering believed that the improved conditioning enables large learn- the intriguing phenomena of BW. We quantitatively inves- ing rates, thus improving the generalization, as shown in [5]. tigate the magnitude of stochasticity in different whitening Another argument is that BN can adaptively adjust the learn- transformations, using the evaluation method called Stochas- ing rate [7, 15, 2] due to its scale invariance [19, 4]. This tic Normalization Disturbance (SND) [17]. By doing so, effect has been further discussed in combination with weight we demonstrate that PCA whitening has significantly larger decay [49]. Other works have included an investigation stochasticity, which is difficult to be controlled by either into the signal propagation and gradient back-propagation increasing batch size or using group based whitening. On [48]. Different from these approaches, our work focuses on the other side, ZCA whitening has the smallest stochastic- analyzing the stochasticity of whitening over batch data. ity, while CD whitening has a moderate value, and more The stochasticity introduced by normalization over batch importantly, their stochasticity can be well controlled. This data was first mentioned in the BN paper [19], and further suggests ZCA whitening should have better optimization explored in [3, 44] from the perspective of Bayesian opti- behaviors in training, while PCA whitening has problems in mization. This stochasticity results in differences between converging, due to the increased stochasticity which slows the training distribution (using mini-batch statistics) and down the progress of the optimization [42, 17]. the test distribution (using estimated population statistics) We also investigate the stochasticity during inference, [18], which is believed to be the main cause of the small- which is caused by the estimation of population statistics batch-problem of BN [47]. To address this issue, a number averaged over the mini-batch statistics during training. We of approaches have been proposed [47, 34, 29, 18, 45, 41]. show that in terms of estimating the population statistics of Furthermore, it has been observed that BN also encounters the whitening matrix, it is more stable to use the mini-batch difficulties in optimization during training [37, 17]. This covariance matrix indirectly (We calculate the whitening phenomenon is explored by the stochastic analysis shown matrix after training) than the mini-batch whitening matrix in [17]. Different from the above research which focuses on directly. We further provide an empirical investigation to standardization, we analyze, for the first time, the stochastic- understand the reasons behind this observation, and find that ity on batch whitening. We propose that analyzing whitening the stochastic sequences of the mini-batch whitening matrix rather than standardization, has several advantages in under- have a large diversity than the covariance matrix. standing the behaviors of normalization over batch data: 1) Based on the above analyses, we provide a general frame- There are an infinite number of whitening transformations work for designing and comparing BW algorithms in dif- and the main ones show significant differences as discussed ferent scenarios. We design new BW algorithm and apply in Section1; 2) The extent of the whitening (stochasticity) them to the residual networks [12] for ImageNet dataset [8], can be well controlled by the batch and group size, which significantly improving the performance over the original provides more information in designing experiments. one. We further conduct thorough experiments on training Our work is related to the previously proposed whitening GANs. We show that full feature whitening, when combined methods regarding the activation of DNNs. One approach with coloring, can improve the final score of evaluation. is to consider the whitening matrix as model parameters to However, it reduces the training stability and is more sen- be estimated using full data [9, 28]. This kind of whiten- sitive to the hyper-parameters configurations. We attribute ing has also been exploited in image style transformation this phenomenon to two main effects caused by the intro- tasks [26, 38]. Another line of research is batch whitening, duced stochasticity of BW: 1) Strong stochasticity can in- which is what this paper discusses. This approach treats crease the diversity of generated images and thus improve the normalization as a function over a mini-batch input. the GAN’s performance; 2) At the same time, high stochas- The main works include PCA whitening, ZCA whitening ticity harms optimization and thus is more sensitive to the [16] and its approximation ItN [17], and CD whitening [39]. hyper-parameters. We argue that controlling

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    15 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us