# Frequency-Domain and Spatial-Domain MLMVN-Based Convolutional Neural Networks
## 4 MLMVN as a Frequency-Domain CNN and the Frequency-Domain Pooling
### Frequency Domain Pooling  
It is obvious that the Fourier transform of any signal (or image, in particular) produces a frequency-domain representation of the same size as the signal. This means that if our input image is of size \(m\times n\), its Fourier transform contains \(m\times n\) Fourier coefficients representing the image in the frequency domain. If these Fourier coefficients are used as inputs to MLMVN, each neuron in the first layer should have \((m\times n)+1\) weights, accordingly. On the one hand, this leads to increased computational costs. On the other hand, not all frequencies are needed to recognize images; only those frequencies that represent important details are essential.  
Considering this, it is attractive and important to find a suitable method for downsampling a frequency-domain input to reduce computational complexity and possibly even improve classification capability by eliminating non-essential frequencies. To achieve this, we propose a \"frequency pooling\" operation as follows.  
The frequency representation of a signal or an image contains Fourier coefficients corresponding to the frequencies from which the signal or image is composed. It is also a well-known fact that the higher the frequency, the smaller the details it reproduces, and vice versa. Therefore, based on the size of the objects that should be recognized, we can determine the frequencies important for recognizing these objects and drop the redundant frequencies that are not essential for their recognition.  
To perform frequency-domain pooling of an image, we should first apply the Fourier transform (Figure 5a) and perform a circular shift, ensuring that the DC frequency is in the center and the high frequencies are at the edges (Figure 5b). Now the lower frequencies are located at the center, and the higher frequencies are at the corners. To select useful frequencies, we should rely on the Nyquist-Shannon Theorem [76]. It follows from this theorem that the Fourier transform of an image whose size is \(n\times n\) contains coefficients corresponding to \(n/2\) 2D frequencies. Then, to distinguish any object (or shape) whose size is approximately \(s\times s\), we should rely on the frequencies from the \(1^{st}\) to the \(\lfloor n/2s\rfloor^{th}\) where \(\lfloor\dots\rfloor\) is the floor function. In such a case, the \(\lfloor n/2s\rfloor^{th}\) frequency is a cut-off frequency. For example, let us have an image whose size is \(32\times 32\). If we need to distinguish an object (or shape) whose size is \(4\times 4\), we need to use Fourier coefficients corresponding to the frequencies from the \(1^{st}\) one to the \(\lfloor 32/(2\times 4)\rfloor=4^{th}\) one. To distinguish an object (or shape) whose size is \(3\times 3\), we need to use Fourier coefficients corresponding to the frequencies from the \(1^{st}\) one to the \(\lfloor 32/(2\times 3)\rfloor=6^{th}\) one, etc.  
To extract Fourier coefficients corresponding to the selected 2D frequencies, we can use the following rule: a Fourier coefficient with the \((x,\ y)\) horizontal and vertical indexes should be extracted from the Fourier transform if \(\sqrt{x^{2}+y^{2}}\leq t\), where \(t\) is a cut-off frequency. To simplify this process, it is also possible to apply the \"diamond\" or \"zigzag\" rule (Figure 5c) to extract selected frequencies around the DC frequency. A few Fourier coefficients may be missing from the extracted ones, but as our experiments show, this does not affect the results while reducing the input size and computational cost. It is important to mention that we do not extract the DC component, as it does not contain information useful for image recognition.