key: cord-0801497-f1tt0ks1 authors: Melese Ayalew, Aleka; Olalekan Salau, Ayodeji; Tadele Abeje, Bekalu; Enyew, Belay title: Detection and Classification of COVID-19 Disease from X-ray Images Using Convolutional Neural Networks and Histogram of Oriented Gradients date: 2022-01-26 journal: Biomed Signal Process Control DOI: 10.1016/j.bspc.2022.103530 sha: 75ac69471b5607efd9c3f8d7958109cc216bcdcc doc_id: 801497 cord_uid: f1tt0ks1 COVID-19 is now regarded as the most lethal disease caused by the novel coronavirus diseases for humans. The COVID-19 pandemic has spread to every country on the planet and has wreaked havoc on them by increasing the number of human deaths, caused intense hunger, and lowered economic productivity. Also due to a lack of sufficient radiologist, restricted amount of COVID-19 test kits available in hospitals, and a shortage of equipment due to the daily increase in cases, the number of persons infected with COVID-19 has increased. Even for experienced radiologists, examining chest X-rays is a difficult task. Many people have died as a result of inaccurate COVID-19 diagnosis and treatment, as well as ineffective detection measures. This paper therefore presents a unique detection and classification approach (DCCNet) for quick diagnosis of COVID-19 using chest X-ray images of patients. To achieve quick diagnosis, a convolutional neural network (CNN) and histogram of oriented gradients (HOG) method is proposed in this paper to help medical experts diagnose COVID-19 disease. The diagnostic performance of the hybrid CNN model and HOG-based method was then evaluated using chest X-ray images collected from University of Gondar and online databases. This was achieved using Keras (with TensorFlow as a backend) and Python. After the DCCNet model was evaluated, a 99.9% training accuracy and 98.3% test accuracy was achieved, while a 100% training accuracy and 98.5% test accuracy was achieved using HOG. After evaluation, the hybrid model achieved 99.97% and 99.67% training and testing accuracy for detection and classification of COVID-19 which was better by 1.37% than when feature extraction was performed using CNN and 1.17% when HOG was used. The DCCNet produced a result that outperformed state-of-the-art models by 6.7%. The current coronavirus outbreak was detected by a Chinese physician in Wuhan, the capital city of Hubei province in mainland China, in late December 2019 [1]. This new virus is very contagious and has rapidly spread over the world. Because the outbreak has spread to 216 nations, the World Health Organization (WHO) declared it a public health emergency of international concern on January 30, 2020. On February 11, 2020, this new coronavirus associated acute respiratory deadly disease was officially named as Corona Virus disease-19 (COVID-19) by the WHO. Radiologists perform COVID-19 diagnosis manually. However, manual diagnosis of COVID-19 requires experienced radiologists and is a time-consuming process, tedious, error-prone, and exhaustive since the radiologists are expected to diagnosis a large number of COVID-19 patients. Developing countries of the world face a shortage of equipment, test kits, and radiologists for diagnosing . In addition to the diagnostic process being time-consuming, the scarcity of skilled radiologists to provide accurate diagnoses, especially in light of the rapidly increasing COVID-19 cases, is still a major concern. To determine if a person is infected with COVID-19, a sample is taken from the nose (nasopharyngeal swab) or throat (throat swab) by a healthcare professional. The samples are then transferred to a laboratory for testing. The manual outcome of the test, however, could be a false-negative depending on the timing and quality of the test sample. This method of testing, accurately detected COVID-19 infections 71% of the time [2] . Another essential diagnostic approach for COVID-19 detection is by using chest X-ray. Although, if the X-ray scans are not clear, COVID-19 is frequently misdiagnosed as another disease. As a result of the inaccurate diagnosis, patients are most times given wrong prescriptions, which ends up complicating their health status. This urgent health concern has lead to a pressing need to create more accurate and automated diagnostic methods that use chest X-ray images to identify COVID-19. Machine learning methods, most especially deep learning has been identified as a more accurate method as compared to other methods [3] [4] [5] . Authors in [3, 4] diagnosed COVID-19 disease using deep learning methods from X-ray and CT scan images. Despite the fact that the proposed models in these research works was tested with a small number of X-ray images, especially the positive case images of COVID-19 patients, there was a class imbalance problem in earlier investigations. Furthermore, they used CNN exclusively as a deep learning model. Similarly, authors in [6] , focused on the classification of the COVID-19 epidemic by using only CNN and got less accurate result. Using only CNN is most times not sufficient for detecting COVID-19 accurately [7, 8] . Therefore, numerous methods of improving the results obtained from previous CNN methods and their limitations are being explored. This paper presents an effective classifier to classify cases of COVID-19 into two classes; either negative (normal) or positive (infected) by using chest X-ray images. In this regard, we proposed a deep learning approach for automated COVID-19 disease classification aimed at maintaining a high accuracy, and reducing false-negative cases. In general, threshold image segmentation was used to segment chest X-ray images of COVID-19 infected persons. Also we used anisotropic diffusion filtering (ADF) to remove noise and also compared its performance with other filters. A hybrid combination of CNN and HOG was used for feature extraction, YOLOv3 was used for object detection (whether the input image was chest X-ray or not), and SVM was used for classification. This remaining parts of this paper are organized as follows. Section 2 presents a review of related works. Section 3 describes the methodology used in the development of the proposed COVID-19 disease classifier, while section 4 presents the results and discussion. Finally the paper is concluded in section 5. In [9] , the authors proposed deep a learning method for a chest X-ray image dataset. They used domain extension transfer learning (DETL) with a pre-trained deep CNN. The proposed system was specially implemented for detecting COVID-19 cases from chest X-ray images. The authors used Gradient Class Activation Map (Grad-CAM) for COVID-19 detection and to identify the areas where the model focused more during classification. An overall accuracy of 90.13% ± 0.14 was obtained. Although, the authors used a small amount of data, the proposed method was still able to detect COVID-19. Authors in [10] , developed a system for the early prevention and detection of COVID-19 disease using image analysis. The authors used a deep learning model on a chest X-ray image dataset to determine the effects of COVID-19 on people who have pneumonia or lung illness. In the study, the authors proposed five pre-trained CNN based models (ResNet50, ResNet101, ResNet152, InceptionV3, and Inception-ResNetV2) for the detection of coronavirus pneumonia infected patients. The pre-trained ResNet50 model achieved the highest classification performance (96.1% accuracy for Dataset-1, 99.5% accuracy for Dataset-2, and 99.7% accuracy for Dataset-3) out of the four models utilized. COVID-19 prediction from chest X-ray images using deep transfer learning was presented in [11] . The researchers employed a collection of X-ray images from a variety of sources to detect COVID-19 disease using transfer learning methods such as ResNet18, ResNet50, SqueezeNet, and DenseNet-121. They collected 250 X-ray images of COVID-19 infected patients who had tested positive for the virus. They tested the models and found that they had a sensitivity rate of 98% and a specificity rate of roughly 90%. For feature extraction, they used CNN and pre-trained models, and got less accurate results. This however shows that using CNN alone is not sufficient for accurately detecting and recognizing COVID-19. The main reason for the poor results is that they used fewer images to train both the CNN and the pre-trained model, whereas generally, more images are required to accurately recognize COVID-19. By detecting patterns from past patient data and chest X-ray scans to diagnose COVID-19, the bulk of published research have predicted that the most likely outcome that a patient has contacted COVID-19 is based on their symptoms, travel history, and the delay in reporting the case. However, the previous works have some limitations such as: class imbalance in the manipulation of data, applying images to CNN without applying image preprocessing like equalization of the intensity, removing noise from the X-ray images, verification of the input image, and segmenting the region of interest. To overcome these drawbacks, this study applied a number of image preprocessing techniques, YOLOv3 for input object detection (used to check whether the given input image is a COVID-19 patient's image or another object image), and for segmenting the region of interest. Furthermore, HOG and CNN features were combined and classification was performed with SVM to improve the COVID-19 detection accuracy. The major steps of the proposed method system architecture is shown in Fig. 1 . The steps include image preprocessing, object detection, image segmentation, feature extraction, and COVID-19 disease classification. In the image processing part we used image size rescale and resize, normalized the images to a standard size, and and employed filtering techniques for noise removal. Furthermore, YOLOv3 was used to detect if the input image is a chest X-ray image or not. Secondly, image segmentation was performed to identify the region of interest and distinguish the foreground image from the background image. Thirdly, feature learning was accomplished by extracting essential information from the input image using CNN and HOG. The CNN and HOG techniques were used to extract feature vectors from the chest X-ray images. The features obtained from these two techniques were combined and fed into the model as input in order to train the classification model. The combination of CNN and HOG feature extraction yields a large number of features for diagnosing if COVID-19 is present or not. In comparison to the original CNN, the combine features provide improved classification accuracy and require less number of learning iterations. From the preprocessing to the training, validation, and testing phases in CNN, sigmoid is used as a function learning technique. Finally, we used SVM to classify the image into one of two predetermined classes (Normal or COVID-19). A dataset was formed comprising of 300 original images collected from the University of Gondar hospital in Ethiopia and 2200 images collected from the online repository used in [12] . An image augmentation technique was applied to increase our dataset as the data was not adequate enough for the feature extraction stage. Image augmentation is typically applied to a dataset to expand the size of the training dataset by creating modified versions of the images in the dataset. The original images were transformed by shifts, flips, zooms, cropping the images, and rotating the images [13] . For this experiment, we have used a total of 6000 augmented images (3000 images of Normal and 3000 images of COVID-19 infected patients). The dataset was divided into training, validation, and test set. The first step performed in the detection and classification of COVID-19 is preprocessing of the chest Xray images to improve their quality. This includes elimination of noise or unnecessary information from the chest X-ray images without obliterating essential information. In this phase, we resized the images of the dataset into 224 x 224 pixels to reduce the processing time and computational cost. Also, the images were converted into NumPy array which Keras can work with easily. OpenCV was used for image resizing and conversion into the NumPy array. Histogram equalization was performed on the acquired images with a sample shown in Fig. 2 . This method is one of the pixel brightness transformation techniques. It is one of the sophisticated methods for modifying the dynamic range and contrast of an image by altering the image such that its intensity histogram gives the desired shape. Histogram equalization is a computer image processing technique for increasing image contrast. It accomplishes this task by effectively spreading out the most frequent intensity values, i.e. stretching out the intensity range of the image [14] . Anisotropic diffusion filter (ADF) has been successfully employed in the field of image processing to remove noise while preserving the main edges of existing objects [15] . It is a technique aimed at reducing image noise without removing substantial parts of the image content such as edges, lines or other crucial elements. ADF is a popular medical image de-noising technique which has the ability to preserve micro texture information [16] . This method was employed to decrease diffusivity, while convolving the regions near the edges to minimize the blurring effect. This is described using Eq. (1). where, ( , ) is the divergence operator. It is a diffusion threshold function which denotes the gradient operator, while ∇ ( , ) is the image intensity. During the testing phase, images affected by Poisson noise were used to evaluate different filter performances. We tested several filtering methods such as arithmetic mean filter, contra harmonic mean filter, Gaussian filter, median filter, blockmatching and 3D filtering (BM3D), bilateral filter, and anisotropic diffusion filter (ADF) to determine the most appropriate. Based on the Shannon entropy measure and signal to noise ratio (SNR), both the contra harmonic mean filter and ADF gave promising results, but the ADF outperformed other filters. Contra harmonic mean and ADF were found to be the best suited de-noising methods for X-ray image noises among numerous filtering methods that were evaluated. Due to this reason, both the Contra harmonic mean filter and the ADF satisfy the Shannon entropy measure [17] . (1) Object detection entails identifying and classifying existing objects in a single image, as well as labeling them with rectangular bounding boxes to indicate their appearance. Before segmenting the chest X-ray images, we applied YOLOv3 for cross checking to determine if the input image is a chest X-ray image of a human lung or not. YOLO uses CNN to perform feature extraction, classification, and localization of an object. YOLOv3 improves the detection performance by training the entire dataset of images. This unified model has various advantages over the traditional object detection approaches. First and foremost, YOLOv3 is slightly faster and also does not require a complicated pipeline because we defined detection as a regression problem. During the training and testing stages, YOLOv3 identifies the complete image, so it implicitly encodes contextual information of the classes as well as their appearance. This is shown in Fig. 3 . Segmentation is the process of dividing an image into separate sections, each part representing homogeneous regions with similar features such as intensity, color, and texture. Thresholding is one of the common segmentation techniques. It operates on the basis of grey-level images. Thresholding was used to convert the grayscale images into black and white images out of a gray scale by setting exactly those pixels above a given threshold value to white. In this paper, thresholding-based segmentation was chosen because it is computationally fast and easy to implement [18] . However, since chest X-ray images are gray in color when converted into binary images, parts of the chest X-ray image were matched with the background. This is in contrast to effective segmentation which results in complete separation of the images (background and foreground) without information loss. In this paper, among the several thresholding techniques, we mainly applied Global thresholding. Local thresholding methods apply distinct threshold values to different regions of the image, whereas global thresholding methods apply a single threshold to the entire image. Global thresholding methods are extremely rapid and produce excellent results. Global thresholding using an appropriate threshold, T: by replacing each pixel in the image with a black pixel if the image intensity, src(x, y) is less than some fixed constant, T (that is, src(x, y)