Abstract
This paper proposes a deep learning framework for Covid-19 detection by using chest X-ray images. The proposed method first enhances the image by using fuzzy logic which improvises the pixel intensity and suppresses background noise. This improvement enhances the X-ray image quality which is generally not performed in conventional methods. The pre-processing image enhancement is achieved by modeling the fuzzy membership function in terms of intensity and noise threshold. After this enhancement we use a block based method which divides the image into smooth and detailed regions which forms a feature set for feature extraction. After feature extraction we insert a hashing layer after fully connected layer in the neural network. This hash layer is advantageous in terms of improving the overall accuracy by computing the feature distances effectively. We have used a regularization parameter which minimizes the feature distance between similar samples and maximizes the feature distance between dissimilar samples. Finally, classification is done for detection of Covid-19 infection. The simulation results present a comparison of proposed model with existing methods in terms of some well-known performance indices. Various performance metrics have been analysed such as Overall Accuracy, F-measure, specificity, sensitivity and kappa statistics with values 93.53%, 93.23%, 92.74%, 92.02% and 88.70% respectively for 20:80 training to testing sample ratios; 93.84%, 93.53%, 93.04%, 92.33%, and 91.01% respectively for 50:50 training to testing sample ratios; 95.68%, 95.37%, 94.87%, 94.14%, and 90.74% respectively for 80:20 training to testing sample ratios have been obtained using proposed method and it is observed that the results using proposed method are promising as compared to the conventional methods.
Keywords
Introduction
The usage of machine learning (ML) intends to impart intelligence by a machine in solving various real time problems. In healthcare sector, ML can act as a transforming edge for clinical decisions [1]. ML algorithms provide precise and accurate information by training any image data which helps to detect the particular disease in its early stage. The major requisite of ML algorithm is availability of real time data and high computational power [2, 3]. For a pandemic situation like Covid-19, ML can be used to predict the infection in patients in its early stage which can help the clinical industry to identify the effective treatment. Covid-19 disease has 2% fatality rate and most of the deaths are due to respiratory failure [4, 5]. If early detection of Covid-19 is performed then the further spread of this disease can be reduced by referring the patient to quarantine. World Health Organization (WHO) is receiving data from all over the world for this pandemic and this data is also made available to public by different image repositories which enables the researcher to design an automated diagnosis for this disease [6, 7]. Thus, the need it to develop an efficient ML algorithm for prediction of Covid-19 infection with higher accuracy. This paper proposes a model which has been analyzed by two classification algorithms i.e. SVM and ELM with the use of chest X-ray image. The outcomes of classifier are adopted in this paper for Covid+and Pneumonia identification. This paper uses an integration of deep learning (DL) with ML and has several advantages in terms of feature extraction and classification which can benefit the clinical decisions. DL refers to extract features by using deep convolutional neural networks (CNNs) [8]. The CNN layer processes all non-linear information. The deeper the layer is the more complex information is learned [8].
The fuzzy set theory is used to enhance the intensity and contrast of dark areas of image by setting the fuzzy rules in such a way that the pixels with incomplete information of redundant information are separated. In this paper, we have chosen the fuzzy logic based approach for image pre-processing so that the image quality can be enhanced by using fuzzy membership of intensity and noise threshold. Moreover, it makes it easier to divide the image into smooth and detail regions because these regions are separated by comparing the intensity threshold as computed in fuzzy logic based approach.
In this paper, we have used the chest X-ray images for automatic diagnosis of Covid-19 by training and testing the proposed model. We have used chest X-ray image dataset [6, 7] to train and test the proposed model in three ratios of training to testing samples i.e. 20:80, 50:50 and 80:20. We have observed that as the number of training images increase the prediction accuracy also increases. We have first developed a deep CNN using a hashing layer to learn the imaging characteristics of the chest X-ray image. Then we have analyzed the performance of proposed method by using extreme machine learning (ELM) classifier [9] and support vector machine (SVM) classifier [10] to classify Covid+, Pneumonia and Normal cases. ELM method has shown better performance over SVM method for the given training set. The hashing layer that has been introduced in the proposed model transforms the high dimensional feature information into low dimensional binary data. This binary data captures the detailed regions of Covid infection effectively. It has been observed that Covid+images have more detailed regions and Covid- images have more smooth regions. Thus a smaller patch size is effective for capturing these detailed regions more precisely. The performance of the proposed method has been compared with other state-of-art methods. It is assumed that the proposed method is superior to other methods. We have obtained promising results that show the effectiveness of proposed method for automatic detection of Covid-19.
Contribution
The contribution of this paper is as follows: Initially, the chest X-ray images of the patients are fuzzified in terms of intensity enhancement and noise suppression. The enhanced image is divided in sub-regions as smooth and detail regions by using a block based sliding window method. The features are extracted from these sub-regions and are used for training the deep neural network. A new hashing layer is added in the proposed network which transforms the high dimensional real features into low dimensional binary features.
The rest of the paper is as follows: Section 2 presents literature overview; the proposed method and the proposed algorithm have been detailed in Section 3. Section 4 discusses results and finally Section 5 concludes the paper.
Literature review
In [11] the authors proposed a COVIDX-Net arctitecture that included seven different architectures of deep CNN models. But, due to the lack of public COVID-19 datasets, the study is validated on 50 Chest X-ray images only. In [12–14] the authors have analysed the existing deep learning architectures for classifying Covid cases. In [14] the authors have proposed a COVID-Net Deep CNN architecture which was tested for 13870 chest X-ray images and obtained classification accuracy of 93.3%. In [15] authors have proposed deep CNN framework known as DeepCOVIDExplainer which was tested for 16995 chest X-ray images and obtained 93.1% classification accuracy. In [16] the authors proposed DarkCovidNet model for detecting the Covid virus in 1125chest X-ray images and obtained 98.08% classification accuracy. In [17] authors have 260 chest X-ray images to train the DL model. But, due to limited number of training set the accuracy was not validated. In [18] the authors adopted the concept of transfer learning with CNN and proposed a model for Covid detection but the number of classes were taken as 2 and 3 only. This model had an average 3- class classification accuracy of 92%. In [19] the authors have used a pre-trained ResNet-50 for detecting the Covid virus in chest X-ray images and obtained 96.23% classification accuracy. In [20] the authors used SVM classifier with Res-Net model for detecting the Covid virus in chest X-ray images and obtained 95.38% classification accuracy in 41 epochs only. In [21] the authors implemented a hybrid deep learning model by using SVM classifier and obtained accuracy of 90.5 %. In [22] the authors used the existing DL method to extract image features but have not used any technique for improvising the feature extraction.
Based the literature review it has been observed that various deep learning frameworks have been proposed for early detection of COVID-19 in the patients. But, so far the feature extraction which is further fed to the training model has not been improved as per literature survey. Moreover, the researchers have not used any technique for improvising the image during pre-processing. In this paper we have pre-processed the image using a fuzzy based method and overall accuracy of the proposed deep network has been improvised by inserting a hashing layer after fully connected layer.
Proposed model
In this paper we propose a machine learning framework for Covid-19 detection. The process starts with image pre-processing which enhances the chest X-ray images using fuzzy logic [23]. Then the image is divided into smooth and detail regions on the basis of pixel intensity. After fuzzification, the features are extracted using machine learning (ML) method. After feature extraction the training data is generated and classifier is trained to detect Covid+, Pneumonia and Normal cases. Figure 1 presents the block diagram of the proposed model.

Block diagram of the proposed model.
We propose a method, which enhances the contrast between the infrared region and surrounding areas of the X-ray image. Consider,
The fuzzification algorithm
The proposed algorithm for fuzzy based enhancement of chest X-ray is based on the pixel intensity and background noise. Algorithm 1 presents the steps for Fuzzy enhancement of chest X-ray image. The step-wise algorithm is detailed as follows:
Where,
Where
Here,
When the membership value is associated with intensities of detail and smooth regions then m is enhanced and when the membership value originates from the noise then we suppress it. Thus, the overall fuzzy membership operator is given as
In this paper we propose a block based method to divide the image into smooth and detail regions. Algorithm 2 presents the steps for block based division of smooth and detail region. In order to divide smooth and detail regions, all rows and columns of the image are scanned for first and last non-zero pixel. The rectangle area (
labeled in detailed region and if
Feature extraction
Consider the dataset
Configuration of deep network used
Configuration of deep network used
The extracted deep features are separated on the basis of similarity with the original feature space. Figure 2 shows the layer wise structure of the feature learning part of the deep network used. This is achieved by evaluating the feature distance for all the extracted features. We use Eucledian distance (ED) [28] to measure the similarity between deep features and is calculated as

Layer wise structure of the feature learning part of the deep network used.
We insert a hashing layer after fully connected layer to compute feature distance effectively because when the FD is very high then the computation of ED is not feasible [28]. This new layer transforms the high dimensional real features into low dimensional binary features. The binary features generated form the hashing layer is written as
The negative likelihood of Equation (8) resembles an optimization problem [29] where the minimization of
log(
The above mode can be integrated into the proposed framework of deep learning such that,
Where,
The effect of regularization parameter on overall accuracy has been analysed in results section. Thus, the feature learning and hash code learning are connected together in the proposed framework. The major advantage of the proposed framework is minimization of the feature distance between similar samples which improves the overall accuracy. The proposed framework has also been minimized for weight and bias.
Once the network is trained through the proposed model we can obtain the deep learned features effectively. These features are then into an ELM classifier [9] and SVM classifier [10] for the subsequent classification as Covid+, Pneumonia and Normal cases. The simulation results validates that by using an ELM classifier the detection is faster and is insensitive to manual parameter setup. Algorithm 4 presents the steps for deep hash learning and classification.
Results and discussion
We have analysed the efficiency of the proposed method on the chest X-ray image data set [6, 7]. The dataset includes 123 frontal view chest X-rays images from [6] and 224 Covid+images, 700 pneumonia images and 504 normal images [7]. We have taken the 12 classes of the data. A quantitative analysis is performed to evaluate the performance of proposed method w.r.t. length of hashing layer, patch size and regularization parameter. The performance of the proposed method has also been compared with other deep learning methods [14, 21 and 22]. In our experiments we have chosen the 500 samples per class randomly for training and testing. The results have been analyzed for three cases of training and testing ratio i.e. 20:80, 50:50 and 80:20. We evaluate performance metrics i.e. overall accuracy, class accuracy, specificity, sensitivity, F-measure and kappa statistics.
Tables 2–4 present the quantitative comparison with state-of-art methods [14, 21 and 22] for performance metrics (overall accuracy, class accuracy, specificity, sensitivity, F-measure and kappa statistics) w.r.t. training to testing ratio as 20:80, 50:50 and 80:20 respectively. From Tables 2–4 we observe that proposed method shows advantages in 7 classes out of 12. The proposed method has shown significant improvement as compared to Wang et al. [14], as the authors obtained classification accuracy of 93.3% only. Apostolopoulos et al. [18] considered 2 and 3 classes only with classification accuracy of 92% but proposed method has used 12 classes and average classification accuracy is 95.38% for 80:20 training to testing ratio. Alqudah et al. [21] used SVM classifier and obtained accuracy of 90.5%. The performance of proposed method has been analyzed by using SVM and ELM classifiers both and obtained better results with ELM classifier with average accuracy of 94.68% for different training to testing ratios. Li et al. [22] have not used any technique for improvising the feature extraction, on the other hand the proposed method uses a fuzzy based image preprocessing and block based division method to improve the quality of extracted features.
Comparison of proposed method with other method for training to testing ratio as 20:80
Comparison of proposed method with other method for training to testing ratio as 20:80
Comparison of proposed method with other method for training to testing ratio as 50:50
Comparison of proposed method with other method for training to testing ratio as 80:20
Overall Accuracy (OA) is a performance measure which is computed by dividing the accurately classified classes by total number of classes. The accuracy analysis between the proposed and other models shows that the proposed model achieves higher accuracy due to inclusion of hashing layer and minimization of weight and bias of the network characterization function. F-measure metric is a weighted harmonic mean of the recall and precision. Sensitivity is computed for Covid+cases. Specificity is computed for Covid- cases. Kappa-statistics measures expected value of outcome by subtracting it from the classification success which is kind of reliability measure. It is observed that as we increase the training data these performance metrics improve.
Table 5 presents the ELM and SVM classifier comparison results by using proposed method. It is observed that ELM classifier shows better results as compared to SVM classifier due to its insensitivity to parameters setup. Figure 3 shows that as the length of hashing layer increases the OA increases but this increase is until the length 64. Beyond this length the OA becomes stable. It has been observed that normal images have more smooth regions and infected images have more detailed regions. Therefore the smaller patch size is needed for detecting detailed regions effectively. In Fig. 4, it is observed that OA is more when patch size is smaller which means better detection and OA drops as we increase patch size. for The regularization parameter (𝓇) also affects accuracy. From Fig. 5 it has been observed that the optimal value of accuracy is achieved for 𝓇 = 10.
Classifier performance comparison for proposed method

Comparison of overall accuracy of proposed method with length of hashing layer.

Comparison of overall accuracy of proposed method with patch size.

Comparison of overall accuracy of proposed method with regularization parameter.
In this paper, a deep learning model is proposed for Covid-19 classification from chest X-ray images. There has been an improvement in OA using propsoed method due to the newly added hashing layer as it minimizes the Euclidian feature distance between similar samples and minimizes the Euclidian feature distance between dissimilar samples. This training dataset is then used in SVM and ELM classifier for Covid-19 classification as Covid+, Pneumonia and Normal cases. The comparison results in terms of various performance metrics are drawn between the proposed method and existing state-of-art methods by considering different ratios of training and testing data. The experimental results show that the proposed method has an overall improvement in terms of accuracy, F-measure, sensitivity, specificity, and Kappa statistics.
This paper proposes a deep learning framework for Covid-19 detection which has better accuracy than conventional models. The limitation of the proposed approach is that if the patients in critical state might not be able to undergo X-ray scanning. This approach can be used for diagnosis due to cost-effectiveness of X-rays images. In future, the diagnosis can be made more effective by training more massive datasets using continuous data collection. Further, it is planned to make use of different classifiers for different features extracted from the chest images. We aim to enhance the model efficiency and usability by deploying it in hardware.
