**1. Introduction**

The first case of viral disease COVID-19 [1] was registered in December 2019 in China's city Wuhan, which was subsequently proclaimed in March 2020 as a pandemic by WHO (World Health Organization). Coronavirus is also recognized as SARS-CoV- [2]. It is from the same group as MERS-CoV and SARS-CoV, which were discovered in 2003 & 2015, respectively [3]. As stated by the European Centre for Disease Prevention and Control [4], on 29 July 2021 about 34,435,890 cases were reported as positive for COVID-19, out of which 743,712 deaths were reported. It affects almost every aspect of life including health, education, the economy, etc. A wide part of employees lost their livelihoods due to this

**Citation:** Alqahtani, A.; Zahoor, M.M.; Nasrullah, R.; Fareed, A.; Cheema, A.A.; Shahrose, A.; Irfan, M.; Alqhatani, A.; Alsulami, A.A.; Zaffar, M.; et al. Computer Aided COVID-19 Diagnosis in Pandemic Era Using CNN in Chest X-ray Images. *Life* **2022**, *12*, 1709. https://doi.org/ 10.3390/life12111709

Academic Editors: Daniele Giansanti and Hyunjin Park

Received: 15 September 2022 Accepted: 12 October 2022 Published: 26 October 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

outbreak. There are no proper medicines or vaccines discovered yet. However, it can be controlled to some extent through early detection. One of the most common and widely used techniques is RT-PCR [5], which is a real-time detection method. RT-PCR samples are collected through a swab that is inserted into the nose and mouth of the patient to collect the samples. These samples are then sent to labs for testing, but it is a complex, time-consuming manual practice. Automatic detection is an alternative method recommended for the early detection of coronavirus.

Early studies show that chest radiograph images of patients who are infected with coronavirus illustrate some irregularities. The easy availability and accessibility of these radiograph images in areas with limited resources make them better options than PCR [6,7]. However, to examine these radiograph images to detect the infected areas of the lungs, experienced and skilled radiologists are required, but the computer-aided diagnosis system CADx also solves this problem for radiologists. It detects the presence of the virus that causes COVID-19 quickly and with high precision. CADx, using chest X-rays, should have been designed to fight against this virus [8]. Machine learning (ML) and deep learning (DL) play a vital role in the medical field for the detection and treatment of many of the deadliest diseases like brain tumors, chest cancer, etc. During the last couple of decades, deep learning showed vast progress in terms of efficient and accurate predictions. Due to this great ability of generalization, it is able to solve many complex problems of computer vision like image classification, organ detection, disease identification, etc. [9,10].

Deep learning is an advanced field and is a further subclass of machine learning. Its CNN algorithm gives far better results than any other traditional algorithm. One of the best features of CNN is that it automatically extracts features from the images without using handy craft filters. Sometimes, parameter learning through a limited dataset can cause overfitting problems. This problem can be tackled by using pre-trained architectures of CNN like GoogleNet, DenseNet, and VGG-16, which are trained on the ImageNet datasets. By using the transfer learning technique, we can apply the pre-trained architectures to our limited dataset. For this purpose, we have to remove the last few layers of the pre-trained model and then test it on our specific dataset. Proper hyper-parameters and efficient fine-tuning make it a more effective approach [11,12].

In this study, we proposed a COV-Net architecture-based computer-aided diagnosis system for COVID-19 analysis. In the presented work, we used the benchmark dataset which contains images of chest X-rays of viral pneumonia-infected patients, COVID-19 patients, and normal images to train our proposed COV-Net model. In D-HL, boundary homogeneity-related deep features are extracted from the fully connected layer FC-1 of the proposed COV-Net architecture. For structural risk minimization and to enhance the generalization ability of the proposed framework, we used SVM as a classifier for the final prediction. The proposed COV-Net contains four convolutional blocks, and optimized arrangements of layers facilitate better and more efficient learning with fewer parameters as compared to state-of-the-art deep CNNs. The following are the contributions of this study:

