## 4 Architecture of CNN Model  
CNN models are the most used deep learning (DL) methods, specifically in computer vision-related applications. Since CNN possesses both an accurate discrimination ability and good feature generation, this study uses deep CNN-based classification models on Chest X-ray and CT scan images to identify COVID-19. The block diagram of CNN architecture for an input image (Chest X-ray or CT scan image) is presented in Figure 3 below. Figure 1: Sample X-ray images of chests of 12 patients: (**a**) normal chests, (**b**) chests with pneumonia, and (**c**) chests infected by COVID-19. Figure 2: Sample CT scan images of 2 COVID-19 patients (**a**) COVID-19 infected (**b**) normal CT scan. A CNN model automatically learns spatial feature hierarchies (horizontal, vertical, lines, etc.) via backpropagation algorithm which uses multiple building blocks, such as convolutional layers, pooling layers, as well as fully connected layers. The different layers in the CNN model are:  
1. Convolutional Layer;
2. Pooling Layer;
3. Fully Connected Layer (FC layer). The CNN architectural model usually consists of alternate layers of convolution and pooling accompanied by one or more FC layers at the end. 1. **Convolutional Layer:** The first layer in the CNN architecture is the convolutional layer. It consists of a set of convolutional kernels (i.e., filters) where each neuron performs as the kernel. Here, the mathematical operation of convolution is accomplished between the input image and a filter of a specific size \(\mathrm{M}\times\mathrm{M}\). Convolution operation of a feature matrix can be expressed as follows:  
\[\mathrm{f}_{\mathrm{d}}^{\mathrm{c}}(\mathrm{s},\mathrm{t})=\sum_{\mathrm{k}} \sum_{\mathrm{a},\mathrm{b}}\mathrm{i}_{\mathrm{k}}\ (\mathrm{a},\mathrm{b}).\ \mathrm{e}_{\mathrm{d}}^{\mathrm{c}}(\mathrm{m}, \mathrm{n}) \tag{1}\]  
where \(\mathrm{i}_{\mathrm{k}}\ (\mathrm{a},\mathrm{b})\) denotes an element \((\mathrm{a},\mathrm{b})\) of the input image tensor \(\mathrm{I}_{\mathrm{k}}\), which is element wise multiplied by \(\mathrm{e}_{\mathrm{d}}^{\mathrm{c}}(\mathrm{m},\mathrm{n})\) index of the \(\mathrm{c}\mathrm{t}\mathrm{h}\) convolutional kernel of the \(\mathrm{d}\mathrm{t}\mathrm{h}\) layer; here \(\mathrm{f}_{\mathrm{d}}^{\mathrm{c}}(\mathrm{s},\mathrm{t})\) denotes the (s, t) element of the feature matrix concerning \(\mathrm{c}\mathrm{t}\mathrm{h}\) kernel of \(\mathrm{d}\mathrm{t}\mathrm{h}\) layer. Finally, the output feature-map \(\mathrm{F}_{\mathrm{d}}^{\mathrm{c}}\) of the \(\mathrm{c}\mathrm{t}\mathrm{h}\) convolutional operation on the \(\mathrm{d}\mathrm{t}\mathrm{h}\) neuron can be represented as:  
\[\mathrm{F}_{\mathrm{d}}^{\mathrm{c}}\ =[\mathrm{f}_{\mathrm{d}}^{\mathrm{c}}\ (1,1),\dots,\ \mathrm{f}_{\mathrm{d}}^{\mathrm{c}}\ ( \mathrm{s},\mathrm{t}),\dots,\ \mathrm{f}_{\mathrm{d}}^{\mathrm{c}}\ (\mathrm{S},\mathrm{T})] \tag{2}\]  
In Equation (2), S denotes the total number of rows of the feature matrix and T denotes the total number of columns of the feature matrix. The resulting output is called the feature map and it provides information about the image such as the corners and edges. The feature map is then fed to further layers to learn several other characteristics of the input image. The selection of a particular activation function is critical in the decision-making process. There are many unique activation functions, such as ReLU, SWISH, MISH, \(\tanh\), sigmoid, maxout, etc., which can be utilized to attain non-linear grouping of features. Equation (3) defines the activation function of a convolved feature-map as follows:  
\[\mathrm{T}_{\mathrm{d}}^{\mathrm{c}}=\mathrm{g}_{\mathrm{a}}(\mathrm{F}_{ \mathrm{d}}^{\mathrm{c}}) \tag{3}\]  
Figure 3: The block diagram of CNN architecture. In the above equation, \(F_{d}^{c}\) is the resulting output of a convolution network that is allotted to an activation function \(g_{a}(.)\).