\section{Introduction}

\indent Many normalization method has advanced deep learning performance. Many deep learning networks use Batch Normalization(BN) \cite{BatchNorm} in their architectures because BN in most cases is adaptive to batch size of a training models, which accelerate training and help the models to converge to better minimum point of loss function of deep neural networks. But Batch Normalization has well performance in specific hyperparameter condition e.g, large batch size. After that, Many batch independent normalization methods and micro batch networks proposed. As micro-batch learning is more adaptive inputs, it can be expected to having more generalization results. Although many methods proposed, they stiil have difficulty matching the performances of BN with large batch size or they is targeted to specific task, which they lack of generalization to other tasks.

In this paper, we propose Normalized Convolutional (NC), which have more generality to any tasks. NC also can smooth the loss landscape by stardardization of sliced-inputs reponsive to filters of convolution layers. NC also can normally distribute the outputs.It means an activation which concerned with normal distribution,e.g SELU\cite{SNN}, can be applied .Todays, many convolution is conducted by matrix multiplication of image to column matrix(im2col) of inputs and reshaped matrix of weight for effciency. Different from the previous normalization methods conducted after or before convolution, NC normalize inputs of rows of im2col and go to next steps. It means normalizaing is conducted during convolutional process. In short, NC process is not usual normalization and can not be realized in deep learning framework optimizing standard convolution process. Hence we named this method 'Normalized Convolution'. As a result, NC process has universal property which means NC can be applied to any AI tasks involving convolution neural layer .

To show its effectiveness, we study NC from both theoretical and experimental viewpoints. The higlights of our contributions are:

1. Theoretically, we show that NC reduces the Lipschitz constants of the loss and gradients. Hence NC smooths the loss landscape.

2. Experiments show that NC networks outperform the performance group normalization(GN) networks in basic image classification that base of other tasks.

3. Second we show that SELU can be fitted into NC process. First we simply verify that NC process give outputs good condition for SELU.

To show that our NC is more generalized to many vision tasks, we have conduct expriments including image classification on  ImageNet dataset, object detection and instance segmentation on COCO dataset\cite{COCO}, semantic image segmentation on PASCAL VOC\cite{PSACALVOC}, Cycle GAN training on some dataset\cite{CGAN}. But we believe that a convoluton process is a key of many tasks, we think experiments on image classification is a basic and sufficient. 

\section{Normalized Convolutional Networks}
\label{sec:headings}
It has been demonstrated that BN influences network training in a fundamental way: it makes the landscape of the optimization problem significantly smoother[3].It affect to new normalization so called Weight Standardization(WS).\cite{WS} BN considers the Lipschitz constants with respect to actionvations, but WS is concerned with weigths. The gradients with respect to weights is also concerned with inputs responsed to weighs. Therefore, we argue that we can also smmoth loss landscape by normalize each sliced-inputs which is dot-producted with weights. It is dual of weight standardization. Based on these motivations, we propose Normalized Convolution Networks.

\subsection{Normalized Convolution}
Consider a standard convolutional layer with its bias terms set to 0:

\begin{equation}
y = W*x
\end{equation}

where ${W\in R^{O \times I}}$ denotes the weights and ${x\in R^{I \times HW}}$ denotes inputs in the layers and * denotes the convolution operation. For ${W \in R^{O \times I}}$, ${O}$ is the number of the output channels, ${I}$ corresponds to the number of input channels within kernel region of each output channel. For ${x \in R^{I \times HW}}$, ${HW}$ is the ouput width times output heights. NC normalize the im2col matrix ${x}$ as following :

\begin{equation}
        \widehat{x}_{i,k} = \frac{x_{i,k} - \mu_{k}}{\sigma_{k} + \epsilon},
\end{equation}
where

$$\centering \mu_{k} = \frac{1}{I} \sum_{i=1}^I x_{i,k}$$ $$\sigma_{k}=
 \sqrt{\frac{1}{I} \sum_{i=1}^I(x_{i,k}-\mu_{k})^2}.$$


After Normalization of im2col matrix, the outputs can be calculated by matrix multiplication. Note that we can affine transform before convolution or after convolutions. In our experiemnts, We apply affine transform after convolution. 

\begin{figure}
    \centering
    \includegraphics[scale=1]{a3.png}
    \caption{Normalized convolution diagram. The pink area of im2col is stadardized and correspond area of weight can be also stadardized}
    \label{fig:fig1}
\end{figure}

\subsection{Gradients of Normalized Convolution}

We will show that NC is able to make the loss landscape smooother. This calcualtion processes are almost same in \cite{WS}, whice is explained more detail. Specifically, we show that optimizing $L$ on $x$ has smaller Lipschitz constants on both the loss and the gradients than optimizing $L$ on ${\widehat{x}}$. Lipschitz constant of a function $f$ is the value of A if $f$ satisfies ${\left| {f} \left( x_{1} \right) - {f} \left( {x_{2}} \right) \right| }$ ${\le {A} \parallel{x_{1} - x_{2}}\parallel}$. For the loss and gradients, $f$ wiil be $L$ and ${\nabla_{x}{L}}.$ Small Lipschitz constants on the loss and gradients means that the changes of the loss and the gradients during training will be bounded more. In short, the optimizer can take longer step which make learning accelerate.

Let's calculate gradient while normalizing inputs. The normalized process is 2 step. first step is centering by mean of each rows and  Second one is divide by standard deviation of each rows of im2col matrix. 
For first step, A simple calculation shows that
\begin{equation}
{\parallel{\nabla_{\dot{x_{k}}}}{L}\parallel}^2 = \frac{1}{\sigma_{k}}\left({\parallel{\nabla_{\widehat{x}_{k}}}{L}\parallel}^2+\frac{1}{I^2}<\widehat{x}_{k},\nabla_{\widehat{x}_{k}}{L}>^2\left(<\widehat{x}_{k},\widehat{x}_{k}>-2I\right) \right)
\end{equation}

Here, <,> denote dot product and $\dot{x}_{k}$ is centered $k$th column vectors of im2col matrix of inputs. By stadardization process, ${{\parallel{\widehat{x}_{k}}\parallel}^2 = I}$. Since NC process is a convolution process which is followed by normalizing the row of im2col matrix corresponding $k$, the effect of ${ \frac{1}{{\sigma_{x}}_{k}} }$ will be canceled. Therefore, the real effect on the gradient norm is the reduction ${\frac{1}{I}<{\widehat{x}_{k}},\nabla_{\widehat{x}_{k}}{L}>^2}$.

Next, similar calcuation shows,

\begin{equation}
{\parallel{\nabla_{{x}_{k}}}{L}\parallel}^2 ={\parallel{\nabla_{\dot{{x}_{k}}}}{L}\parallel}^2 -  \frac{1}{I}<1,\nabla_{\dot{x}_{k}}{L}>^2
\end{equation}

Hence the effect of (4) on the Lipschitz is also reducing Lipschitz constant. 
Note that gradient of loss with respect to $k$th layer equals to matrix multiplication of gradients of $k$th loss gradient of inputs with gradient of  activation functions of $k$th layer with respect to input variables. Therefore considering gradient of loss with respect to input variables is important.
Summarizing (3),(4), we can say NC make loss landscape smoother. To verify this effect on real world, we conduct case study on ResNet-50\cite{resnet} trained on tiny ImageNet\cite{TINY} and ResNet-18 on CIFAR-10.




\subsection{NC might go well Self Normalizing Exponential linear Activations}

 Real convolution calculation in deep learning frameworks use matrix multiplication im2col matrix of inputs with weight kernels, If corresponding weight columns are well distributed, which mean properly initialized, seeing as dot product of two standardized elements, outputs are normally distributed according to corresponding weight distribution. Hence we can apply self normalizing activation functions, is called SELU.\cite{SNN}. Therefore we can adopt SELU as fitting actiovation function to NC theoritically when Large sample theories e.g, CLT(Central Limit Theorem), can be considered. Hence we compare NC with RELU\cite{RELU} type activations and NC with ELU\cite{ELU} type activations. But Unfortunately we can't find any imporvement.


\subsection{Normalized Convolution code}

\noindent
{\it Simple code of Normalized Convolution in Pytorch }
\begin{verbatim}
Normalized Convolution(inputs,in_channel,out_channel,kernel_size):
    a,b = kernel_size
    h,w = output_height,output_width
    
    im2col_inputs = unfold(x,kernel_size,channel)
    
    flatten_weights = flatten(weight,out_channel,kernel_size)
    
    mean = im2col_inputs.mean(axis=-1)
    
    std = (im2col_inputs.var(axis=-1)+epsilon).sqrt()
    
    im2col_inputs = (im2col_inputs - mean) / std
    
    output = im2col_inputs @ flatten_weights.
    
    return output.reshape(-1,h,w,out_channel)
\end{verbatim}
\noindent
\section{Experimental Results}



\subsection{Image Classification on Tiny ImageNet and CIFAR-10}





Imagenet dataset is a large-scale image dataset. There are about 1.28 millon training samples and 50K validation images. It has 1000 categories.  In this paper, for time limit, we use the tiny imagenet dataset. The dataset has 100K samples, 10K validation iamges and 200 categories. We conduct simply compare ResNet50 with Group Normalization(GN) \cite{GroupNorm} and ResNet50 with NC in micro-batch setting. Since NC has batch-independent normalizing process, we compare with Group Normalization which outperforms other batch-independent normalization methods e,g Layer Normalization\cite{LN}, Instance Normalization\cite{IN}. Table~\ref{tab:table1}. shows that out simple experiments result. From table, we can see ResNet50+NC actives top-1/5 accuracy more 2\% higher than ResNet50+GN in both and better validation loss. From Figure \ref{fig:fig2}, we can see NC has consistency learning curve during 1 epoch.



\begin{figure}[t]
    \centering
    \includegraphics[scale=1]{lcurve1.png}
    \caption{Blue curve indicates ResNet50+NC training loss curve during 1 epcoh and Orange curve indicates ResNet50+GN. We can see NC is trained consistently}
    \label{fig:fig2}
\end{figure}


\begin{table}[t]
 \caption{Results of Experiments on image classification}
  \centering
  \begin{tabular}{lllll}
    \toprule 
    \cmidrule(r){1-5}
    Dataset   &Model     & Top1     & Top5 & validation loss \\
    \midrule
    Tiny ImageNet       &ResNet50+GN & 51.01  & 24.51     & 2.48\\
                        &ResNet50+NC & \textbf{49.82}  & \textbf{23.34}    & \textbf{2.09}\\
    \bottomrule
    CIFAR-10            &ResNet18+GN & 10.14  & 0.00      &0.41\\
                        &ResNet18+NC & \textbf{8.52}   & \textbf{0.00}      &\textbf{0.31}
    
    
  \end{tabular}
  \label{tab:table1}
\end{table}

We run all experiments using the Pytorch implemnetations of the layers. NC is realized by custom layer using Pytorch.
Here, we list the hyperparameters used for this result. For all models, the learinng rate is set to 0.01 initially, and is multiplied by 0.1 after every 30 epochs. We use SGD to train the models without momentum and weight-decay. For all models, training batch is set to 2. We use RELU activation for all models. We do not use data augumentations. We train all models 50 epochs.


Next, Although CIFAR-10 dataset is smaller than Imagenet dataset, it is one of the most widely used datasets for machine learning research. CIFAR-10 dataset contains 60,000 32x32 color images in 10 different classes. We conduct same experiment on CIFAR-10. The model used is that ResNet18. We use SGD without momentum and weight-decay. training batch is set to 2. We use RELU activation for all models.We do use a few data augumenations. We use horizontalflip and Random shift up to 10\% of image size. We train all models 50 epochs.




\begin{figure}
  \centering
  \subfloat[train accuracy]{\includegraphics[height=10\baselineskip]{train_acc.png}}\quad
  \subfloat[train loss]{\includegraphics[height=10\baselineskip]{train_loss.png}}\quad
  \subfloat[validation accuracy]{\includegraphics[height=10\baselineskip]{val_acc.png}}\quad
  \subfloat[validation loss]{\includegraphics[height=10\baselineskip]{val_loss.png}}
  \caption{Results of ResNet18+GN training and ResNet18+NC training on CIFAR-10}
\end{figure}













\section{Conclusion and Future work}

In this paper, we propose a new paradaigm convolution Normalized Convolution(NC) which is motivated by a recent results that shows that smoothing effects of WS\cite{WS} during training. Our method can be seen as dual version of weight standardization. It is also consistent with orginal differential convolution operator property. If one of them is smooth, The differential property of orginal convolution of two functions, although one of them is not smooths,share with differential property of smooth function. We show that by same calculation in \cite{WS} NC also reduce the Lipschitz condition. The results show that NC outperforms GN. Hence according to \cite{WS} research, WS+NC can be a state of art method in micro-batch image classifcation. 

\subsection{Future works} In batch independent normalization methods, Positional Normalization(PN)\cite{PN} is similar with out method because if a kernel size is 1x1, the process is same . But kernel size is not always 1x1, our method is more adaptive to direct concerned slice-inputs as NC standardizes im2col matrix. Empricially we verify that NC is outperform on normal tasks such as classification,segmentation,object detection etc than PN. But PN is more adaptive to GAN type tasks. We will apply the NC method to GAN type tasks. For other tasks, we need to conduct experiments.
Next, we need to find a proper activation for NC. Despite of self normalizing property, we see that SELU isn't proper. If we find more adaptive initialization, SELU might outperform.
Finally, When we conduct experiment using several optimizer method, we can't obtain good results on other gradient adpative optimizer method such as Adam\cite{Adam},RMSProp. Therefore NC need a new adpative optimizing methods. 








\section{Acknowledgments}
This research was financially supported by the Ministry of Trade,Industry, and Energy(MOTIE), Korea, under "Regional Specialized Industry Development Program(R\&D,P0002072)" supervised by the Korea Institute for Advacement of Technology(KIAT).




\bibliographystyle{unsrt}
