# Fast Prediction of Flow Field around Airfoils Based on Deep Convolutional Neural Network
## 2 Methods
### Design of Neural Network Model
#### 2.1.3 Convolutional Layer  
The convolutional layer of CNN executes most of the computational promotion. Figure 3 is a typical convolution scheme where the local receptive field with a kernel of 3 \(\times\) 4 maps to 3 filters. During the convolution process, the filter slides across the whole input with a certain stride, meanwhile, the element-wise product is executed, with homologous output responses at each spatial position. The size of the output after the convolutional operation is calculated as:  
\[N_{w}^{[l+1]}=\frac{N_{w}^{[l]}-n_{w}^{[l+1]}+2p_{w}^{[l+1]}}{s^{[l+1]}}+1 \tag{5}\]  
\[N_{h}^{[l+1]}=\frac{N_{h}^{[l]}-n_{h}^{[l+1]}+2p_{h}^{[l+1]}}{s^{[l+1]}}+1 \tag{6}\]  
where the superscript \(l\) and \(l+1\) represent the index of the convolutional layers (could be called by \(l\)th and \((l+1)\)th convolutional layer later), the subscript \(w\) and \(h\) refer to the width and height of the kernel, while \(p\) is the padding size. Taking the change of \(N_{w}\) from \"Conv2\" to \"Conv3\" for example, there is \(24=(50-4+0)/2+1\) (no padding). We can also see from Figure 3 that the size of the convolution kernel (\(n_{w}\times n_{h}\times n_{c}\)) is \(3\times 4\times 1\), the number of filters \(n_{F}\) is 3, after the convolution operation, the input image of \(11\times 22\) is compressed into the output of shape 9 \(\times\) 19 \(\times\) 3 according to Equations (5) and (6). In addition, the index of the slide window (box in red solid line) is row 6 and column 9, after the convolution process (point-to-point multiplication with the convolution kernel  
\begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Layer Name**} & **Executing Operation** & **Shape** \\ \cline{2-3}  & \(n_{w}\times n_{h}\times n_{e}\times n_{f}/s\) & \(N_{w}\times N_{h}\times d\) \\ \hline Input & — & \(208\times 340\times 2\) \\ Conv1 & \(4\times 8\times 2\times 16/2\) & \(103\times 167\times 16\) \\ Conv2 & \(5\times 7\times 16\times 32/2\) & \  
followed by summation), it is projected to the corresponding position of 3 filters. Moreover, the local operation of a given convolutional layer is carried out as follows:  
\[y=\sum_{i}\sum_{j}w_{i}x_{j}+b \tag{7}\]  
where \(y\) is the local output, \(w_{i}\) is the weight coefficient of kernel \(i\), \(x_{j}\) is the local receptive field seen by the neurons, and \(b\) is the bias matrix. Subsequently, the ELU activation function (see Equation (4)) will be applied to obtain the output of the current layer. Actually, the weight parameter refers to the actual values associated with each element and indicates the importance of that element in predicting the final value, which can be understood as the coefficients of each term of a nonlinear function. As described in Equation (7), the bias parameter is a threshold value to shift the activation function to the left or right, which can be called the intercept distance along the \(y\) direction in the linear equation. Finally, the \(f\) in Equation (1) can be summarized as follows provided that \(l\) indicates the last layer:  
\[f=W^{l}\times g\Big{(}y^{l-1}\Big{)}+b^{l} \tag{8}\]  
where \(y^{l-1}\) is the output \((l-1)\)th layer, \(g\Big{(}y^{l-1}\Big{)}\) denotes the final output after using activation function, and \(W^{l}\) and \(b^{l}\) represent the weight and bias matrix of the \(l\)th layer, respectively. To reduce the number of parameters and speed up the convolution process, local connectivity and weight sharing schemes are employed in each convolutional layer. The local connectivity is utilized to connect the local receptive field of the input to each neuron to learn the local features. While weight sharing scheme is to keep using identical convolving parameters for all convolutional kernels within a filter, to detect the same features from different regions, but apply different weight parameters for each kernel to detect different features.