# Frequency-Domain and Spatial-Domain MLMVN-Based Convolutional Neural Networks
## 3 CNNMVN Learning Algorithm and Error Backpropagation
### CNNMVN Error Backpropagation
#### 3.2.3 CNNMVN: The General Case  
Let us now consider CNNMVN containing \(G\) convolutional layers, \(M-1\) hidden layers, and one output layer. Let each convolutional layer consist of \(H_{g}\) kernels \(g=\overline{1,G}\). Let the input image \(x\) (or a feature map in the case of convolutional layers from the \(2^{nd}\) one to the \(G^{th}\) one) be of size \(a_{g}\times b_{g}\times d_{g}\). Then the kernel size in the \(g^{th}\) convolutional layer is equal to \(r_{g}\times r_{g}\times d_{g}\) (\(r_{p}<\min\big{(}a_{g},b_{g}\big{)}\)). The \(m^{th}\) hidden layer in the fully connected part contains \(N_{m}\) neurons (\(m=\overline{1,M-1}\)), and the output layer contains \(N_{M}\) neurons. The errors of all neurons in the fully connected part should be calculated according to (8)-(10) and (20). Then the errors of the neurons in the first hidden layer should be  
Figure 4: Backward convolution process. The blue square contains the errors of the feature map obtained in the second convolutional layer padded with zeros. The white square is the kernel rotated by \(180^{\circ}\). The green square represents errors of the feature map in the first convolutional layer. backpropagated to the last-convolutional-layer kernels similarly to how it was done in (21) for a \"simple CNNMVN\". \[\delta_{ij}^{thG}=\frac{1}{Q_{G}}\sum_{n=1}^{N_{1}}\delta_{n,1}\left(w_{ijh}^{n, 1}\right)^{-1}, \begin{array}{l}i=1,\ldots,a_{G}-r_{G}+1,\\ j=1,\ldots,b_{G}-r_{G}+1,\\ Q_{G}=r_{G}\cdot r_{G}\cdot c_{G},\end{array}  \tag{24}\]  
where \(\delta_{ij}^{thG}\) is the error of the feature map pixel with coordinates \(i,\,j\), produced by the \(h^{th}\) kernel of the last \(\left(G^{th}\right)\) convolutional layer, \(\delta_{n,1}\) are the errors of the first hidden layer neurons and \(w_{ijh}^{n,1}\) are these neurons' weights that are responsible for processing the \(ijh^{th}\) input, and \(Q_{G}\) is the normalization factor which should be equal to the size of the kernel in the last convolutional layer. To backpropagate the errors from the last convolutional layer to the preceding convolutional layer or in general case from the \(g^{th}\) convolutional layer to the \(g-1^{st}\) one, we use the same rule as before: the errors of the convolved pixels in the \(g-1^{st}\) layer depend on the kernel weights that process these pixels and the errors of the neurons (or kernels) in the following layer (which can be the first hidden layer or the next convolutional layer). Let us describe this mathematically. Let \(T_{g}\) be the number of times the \(ij^{th}\) pixel was involved into a convolution in the \(g^{th}\) convolutional layer. Then the errors of the kernels in the \(g-1^{st}\) convolutional layer are  
\[\delta_{ij}^{l,g-1}=\frac{1}{Q_{g-1}}\sum_{h=1}^{H_{g}}\sum_{t=1}^{T_{g}} \delta^{h,g,t}\left(w_{t}^{h,g}\right)^{-1}, \begin{array}{l}i=1,\ldots,a_{g} -r_{g}+1,\\ j=1,\ldots,b_{g}-r_{g}+1,\\ Q_{g}=r_{g}\cdot r_{g}\cdot c_{g},\end{array}  \tag{25}\]  
where \(\delta^{l,g-1}\) are the errors of the feature map obtained by the \(l^{th}\) kernel in the \(g-1^{st}\) convolutional layer (\(l=\overline{1,H_{g-1}}\)); \(\delta^{h,g,t}\) and \(w_{t}^{h,g}\) are the errors of the output and the weights of the \(h^{th}\) kernel in the \(g^{th}\) convolutional layer that process the \(ij^{th}\) pixel in the \(t^{th}\) convolution, respectively; and \(Q_{g-1}\) is a normalization factor which is equal to the size of the kernel in the \(g-1^{th}\) layer (note that \(Q_{2}=1\) as there is no further error backpropagation from the first convolutional layer). The same expression for the errors of a respective feature map should also be obtained using the backward convolution. This leads to the following. First, we should zero pad the errors of each feature map in a layer, from which the errors are backpropagated. Then a respective kernel should be rotated by \(180^{\circ}\), and then a respective convolution should be performed.