Artificial intelligence for diagnosis of mild–moderate COVID-19 using haematological markers

Abstract Objective The persistent spread of SARS-CoV-2 makes diagnosis challenging because COVID-19 symptoms are hard to differentiate from those of other respiratory illnesses. The reverse transcription-polymerase chain reaction test is the current golden standard for diagnosing various respiratory diseases, including COVID-19. However, this standard diagnostic method is prone to erroneous and false negative results (10% -15%). Therefore, finding an alternative technique to validate the RT-PCR test is paramount. Artificial intelligence (AI) and machine learning (ML) applications are extensively used in medical research. Hence, this study focused on developing a decision support system using AI to diagnose mild-moderate COVID-19 from other similar diseases using demographic and clinical markers. Severe COVID-19 cases were not considered in this study since fatality rates have dropped considerably after introducing COVID-19 vaccines. Methods A custom stacked ensemble model consisting of various heterogeneous algorithms has been utilized for prediction. Four deep learning algorithms have also been tested and compared, such as one-dimensional convolutional neural networks, long short-term memory networks, deep neural networks and Residual Multi-Layer Perceptron. Five explainers, namely, Shapley Additive Values, Eli5, QLattice, Anchor and Local Interpretable Model-agnostic Explanations, have been utilized to interpret the predictions made by the classifiers. Results After using Pearson’s correlation and particle swarm optimization feature selection, the final stack obtained a maximum accuracy of 89%. The most important markers which were useful in COVID-19 diagnosis are Eosinophil, Albumin, T. Bilirubin, ALP, ALT, AST, HbA1c and TWBC. Conclusion The promising results suggest using this decision support system to diagnose COVID-19 from other similar respiratory illnesses.


Introduction
the saRs-coV-2 pandemic has affected all facets of life, including healthcare, education, the environment and the economy [1]. it has also raised concerns about how medical facilities and healthcare systems can respond to a new virus. as of 18 april 2023, 762,791,152 cases were reported, including six million deaths [2]. eventually, vaccines such as BioNtech, sinopharm, Moderna and covaxin were developed to combat cOViD-19 [3]. these vaccines were distributed to people all around the world. the vaccines effectively prevent a severe cOViD-19 prognosis in most people [4]. the lifecycle of cOViD-19 is described in Figure 1. Due to the wide range of clinical manifestations that can occur in patients, the ongoing worldwide spread of cOViD-19 has made diagnosis difficult for clinicians. seasonal influenza has made diagnosis more challenging because influenza and cOViD-19 cause similar symptoms [5]. Given that both viruses co-exist, it is crucial to differentiate them to manage patients at an elevated risk of infection, some of which may be virus-specific. cOViD-19 is detected using a standard test called the reverse transcriptase polymerase chain reaction (Rt-PcR). however, it consumes a lot of time to generate results. False negative and misclassified results have also been observed. it also requires special equipment and reagents that might only be available in some hospitals, especially in underdeveloped countries [6]. hence, an alternative method to diagnose cOViD-19 is required. several methods, including computed tomography (ct) images, ultrasound, X-rays, voice-based analysis, clinical markers and magnetic resonance imaging (MRi), have been used for cOViD-19 diagnosis [7].
Machine learning (Ml) and deep learning (Dl) applications are being heavily used in healthcare settings for diagnosis, screening, prognosis and risk assessment [8]. the models can enhance a physician's decision-making process using computational and visualization methodologies. the advancements listed above are mainly due to the emergence of relevant medical datasets and algorithms [9]. the interpretability and comprehensibility of modern artificial intelligence (ai) applications should also be examined before deploying them in actual scenarios. a model's rationale behind a prediction must be clear for doctors to trust the diagnosis. this demonstrates why most Ml models are just used as prototypes in the medical field. some medical professionals hesitate to use ai applications that are hard to trust and understand [10]. explainable ai(Xai) tries to interpret the predictions using model estimators, global/local explanations and rule-based estimations. Further, the explainers use visualization techniques, making it easier for physicians to understand the predictions [11].
White blood cells, basophils, monocytes, neutrophils, lymphocytes, eosinophils, aspartate aminotransferase (ast), alanine transferase (alt), albumin and other clinical markers have proven to be important for cOViD-19 diagnosis [12]. this presents a rare opportunity for researchers to simultaneously explore features which influence patient diagnosis and develop cutting-edge testing methodologies for cOViD -19 diagnosis. a few studies that use Ml in the battle against cOViD-19 are discussed below.
Gavriilaki et al. [13] used a rigorous algorithm to justify severe cOViD-19 in patients. clinical data of 97 patients were considered for this research. asteris et al. [14] used neural networks to predict mortality in severe cOViD-19 patients. One hundred and thirty-three patients were considered for this research. according to the study, the most markers are thBD and c3a levels. in another research, fuzzy ensemble models and transfer learning were used to detect cOViD-19 using chest X-rays [15]. two thousand three hundred and thirteen images that consisted of cOViD-19, other pneumonia and normal patients were considered. a maximum accuracy of 99.5% was obtained. in another research, Ml models were used to predict cOViD-19 cases [16]. three countries were considered that included United Kingdom, italy and australia. asteris et al. [17] used mathematical modelling to understand the risks of cOViD-19. the number of cOViD-19 deaths in six different countries was analysed. Five laboratory markers were used to predict cOViD-19 severity in another research [18]. two hundred and forty-eight patients and 25 clinical markers were considered. a maximum accuracy of 96% was achieved by the aNN model. cOViD-19 mortality was predicted using Ml in yet another research [19]. a Mexican dataset was considered and a maximum accuracy of 96% was obtained. cOViD-19 was diagnosed using routine blood tests in another research [20]. Four classifiers were used for prediction and the random forest obtained an accuracy of 92%. this study uses Ml and Dl algorithms to develop an early decision support model that can diagnose cOViD-19 from other similar respiratory illnesses. the other contributions of this research are given below: the study continues as follows: Materials and methods are covered in section 2. in-depth explanations of feature selection, data description, pre-processing and Ml approaches are provided in this section. Results and discussions are presented in section 3. this section describes the outcomes of the Ml and Dl models, their interpretation and future discussions. the final section contains the conclusion and recommendations for further study.

Description of the dataset
the cOViD-19 and non-cOViD-19 ili patient datasets were obtained from Dr tMa Pai hospital and Kasturba Medical college. the above hospitals are situated in the Udupi District, india. ethical clearance was obtained to carry out this study (ethical clearance iD: iec: 613/2021). informed verbal consent was also taken from the patients before conducting this study. the details of patients who underwent the Rt-PcR test between april 2022 and December 2022 were considered. Blood test results were obtained from 870 patients (270 non-cOViD-19 ili, 300 mild cOViD-19 and 299 moderate cOViD-19 patients). severe cOViD-19 patients were not considered in this study since the number of severe cases has drastically reduced after introducing cOViD-19 vaccines. Further, these patients' markers vary drastically, making the classification biased towards severe cOViD-19 patients. every patient was asymptomatic or had mild-moderate influenza symptoms such as myalgia, cough and fever. a clear description of the parameters is made in table 1.

Dataset preprocessing and feature selection
Data preprocessing involves various steps such as removing null values, variable encoding, data standardization, removing outliers and data balancing. in this study, 23 continuous and two categorical attributes (Gender and label) are present. Generally, missing values are replaced using mean, median and other imputation methods. We used the median to replace the continuous attributes since outliers do not affect them. the categorical variable 'Gender' had no missing values. in this research, 'JaMOVi' was utilized to perform descriptive statistical analysis [21]. Researchers use it as an open-source statistical tool  to perform extensive statistical analysis. table 2  describes the several statistical measures such as  mean, median, standard deviation, interquartile range  and percentiles. For better data visualization, bar graphs, scatter plots and violin plots were generated, as shown in Figures 2 and 3. From Figure 2, it can be seen that there was not much difference in age between cOViD-19 and non-cOViD-19 patients. From the figure, it can also be seen that eosinophil levels were slightly elevated in non-cOViD-19 patients. Neutrophil levels were slightly elevated, and lymphocyte levels were slightly lower in cOViD-19 patients. Further, many attributes had outliers. We did not handle outliers in this study since it would make the models more biased during testing.
From Figure 3(a), it can be seen that neutrophils and lymphocytes are inversely proportional. a linear relationship exists between the two. From Figure 3(b), it can be seen that protein and albumin are directly proportional to each other. a linear relationship also exists between the above two attributes. the gender composition of the dataset is described in Figure 3(c). the non-cOViD-19 cohort consisted of 114 male and 156 female patients. three hundred and forty-seven male patients and 252 female patients were present in the cOViD-19 cohort. One-hot encoding was performed on the 'Gender' attribute [22]. Before developing a model, categorical attributes must be converted  into integers since many classifiers cannot handle string values. after data pre-processing, the dataset was split into training and testing (80:20). Data scaling is essential in Ml. When there is a substantial difference between data points, the effectiveness of the models is negatively impacted. Furthermore, the algorithms favour attributes with greater values, regardless of the metrics utilized. this study used standardization to scale the data [23]. in standardization, the standard deviation of the attribute is assigned as one and the data points are grouped around the features' mean. Medical data are frequently unbalanced, which distorts the proportion of the data. From table 2, it can be seen that cOViD-19 cases are almost double that of non-cOViD-19 ili cases. the classifiers favour the category with more occurrences. hence, data balancing is essential. this study used the Borderline-sMOte method to balance the training data [24]. however, the testing data were not subjected to balancing to protect the integrity of the data.
Feature selection is utilized for choosing the essential attributes. Due to the widespread adaption of modern technologies and intelligent systems, massive amounts of data have been produced. concerns such as noise and duplication are considerably reduced once feature selection is completed [25]. Fifteen feature selection methods have been compared in this study. table 3 describes the feature selection methods, the number of attributes chosen by each technique and the names of the features chosen. the table shows that the harris hawks optimization, whale optimization and sine cosine algorithm chose the least number of features. Most algorithms choose between 5 and 10 features. Figure 4 gives a pictorial description of the features chosen by various algorithms. From the figure, it can be observed that the most important parameter chosen is alP. Many methods also chose liver enzymes such as alt and ast. a few algorithms also considered hba1c, haemoglobin, monocytes and potassium. the techniques did not consider three attributes: age, neutrophil and lymphocyte.

Machine learning pipeline and performance metrics
several Ml algorithms were used for model training. the ideal hyperparameters for each model were found using the grid search method [41]. a fivefold cross-validation approach was additionally applied during training. it separates the data into several subgroups for training and testing [42]. the models become more reliable, when the data are divided into folds. Further, all the models were stacked on various levels.
stacking is a method of collective learning that integrates the results of several classifiers using a meta-learner. the meta-learners maximize each model's abilities while minimizing the weakness of the associated baseline classifiers. this custom stacking technique results in a better and more reliable classifier [43]. the first stacked model was formed using logistic regression, decision tree, K-nearest neighbors (KNN) and random forest. the boosting classifiers such as adaptive boosting (adaBoost), extreme gradient boosting (Xgboost), categorical boosting (catboost) and light gradient boosting machine (lighgbm) were aggregated to form the second stack. the final stack was ensembled using the first and second stacks. the final stacked model can be used for prediction since it combines several heterogeneous classifiers. all stacking models used logistic regression as their meta-classifier. the customized stacking architecture is pictorially represented in Figure 5.
Further, Dl algorithms were tested. Deep learning is a part of Ml, which processes datasets according to a predetermined mathematical framework to discover patterns and relationships [44]. While Ml needs feature selection, Dl automatically performs feature mining and modelling steps during training. it can also generate new features, handle unstructured data, perform self-learning tasks and support parallel processing.
complex irregular patterns can be modelled by DNNs [45]. its main job is to manage user inputs, run increasingly complex calculations on the data, and generate outcomes that can aid in decision-making.
cNN was primarily used for imaging data. tabular (one-dimensional) data can also make use of cNN [46]. a benefit of 1D-cNN is that it allows users to derive insights from the data without needing specialized knowledge. long short-term memory networks is another Dl algorithm which uses a sequence of neural networks and allows information to be stored for a long period [47]. it solves the vanishing gradient problem that recurrent neural networks (RNN) commonly face. Machine translation and natural language processing applications make use of lstM. however, it can be used for time-series data. lstM contains three gates: Forget gate, input gate and Output gate. lstM comprises a memory cell (lstM cell), which acts like a feed-forward neural network. Further, each neuron has Gender, haemoglobin, monocyte, basophil, AlT, AlP, HbA1c 3 differential evolution (de) [28] it is a technique in evolutionary computation that improves a given problem by repeatedly attempting to enhance a potential solution 5 Monocyte, eosinophil, AlT, AlP, HbA1c 4 firefly algorithm (fA) [29] The algorithm mimics the flashing behaviour of fireflies to choose the best set of features 6 Haemoglobin, creatinine, potassium, AsT, AlT, AlP 5 flower pollination algorithm (fPA) [30] The algorithm is based on the concept of pollination in flowers 6 Haematocrit, eosinophil, basophil, T. bilirubin, AsT, AlP 6 Genetic algorithm (GA) [   a current state and a hidden layer. the Forget gate decides to keep the information or delete it. the input gate processes new/updating of information. the output gate passes the information to the next layer.
ResMlP is another efficient model used in Dl. it was developed by touvron et al. [48]. ResMlP is based on the principle of multi-layer perceptron's (MlP). a collection of frameworks and tools called Xai are designed to comprehend and analyse the models/classifiers [11]. shaP, liMe, eli5 and Qlattice were the explainers utilized in this study. the entire flow diagram of the Ml pipeline is depicted in Figure 6. table 4 describes the performance metrics used to validate the classifiers. several classification and loss metrics have been considered to evaluate the classifiers.

Model evaluation
Multiple models were used to diagnose mild-moderate cOViD-19 patients. the grid search method of hyperparameter tuning was applied to each model. the data were further split using the fivefold cross-validation technique. to avoid overfitting, each model was trained 10 times, with the average results being computed. the precision obtained by the classifiers for all feature selection algorithms is described in table 5. the recall obtained is discussed in table 6. Pearson's correlation, mutual information and cuckoo search algorithm obtained excellent precision values among all the feature selection techniques. the final stacked model obtained an excellent precision of 84%, 81% and 86%, respectively. Feature selection algorithms such as differential evolution, genetic algorithm, particle swarm optimization and whale optimization obtained good precision values too.
Grey wolf optimizer and since cosine algorithm obtained poor precision values with 66% and 65% for the final stacked algorithm. excellent recall values were obtained by Pearson's correlation, mutual information, cuckoo it is a metric, which combines both precision and recall. 5 AUc -in receiver operating characteristic curve (Roc), true positive rate is plotted against false positive rate at various thresholds. The area under this curve is called AUc (area under curve). 6 Average precision (AP) -in precision-recall curve, precision is plotted against recall at various thresholds. The area under this curve is called average precision. 7 Jaccard score (Js) The degree of similarity between two groups of data is gauged by the Jaccard score.
Further, the results obtained by the Ml models were compared with Dl algorithms. the model architectures of DNN, 1D-cNN, lstM and ResMlP are described in table 8. the results obtained by the neural network are described in table 9. among all the Dl models, the 1D-cNN obtained the best results with an accuracy of 88%. the accuracy and loss curves for the classifiers are described in Figures 9 and 10. here, the training accuracy is plotted against testing accuracy and training loss is plotted against validation loss. the 1D-cNN and ResMlP models were slightly overfitting compared to DNN and lstM.
the Dl models performed well in classifying mildmoderate cOViD-19. however, the stacked Ml models were superior. When the data size is comparatively small, tree-based models can sometimes perform better than Dl models for tabular data [49].

Explainable artificial intelligence to interpret model predictions
the classification system's diagnosis will significantly influence how healthcare decisions are made. technological advancements have led to digitizing and automating multiple processes and functions. as a result, accurate, intelligible and easy-to-understand techniques are given more priority. a comprehensible Xai model improves a healthcare professional's capacity to validate the proposed predictions in the intricate world of medicine. Before making a final treatment choice, assessing the diagnostic model's performance is essential. Furthermore, feature evaluations considering various factors are essential for resilient systems. in this research, five explainers have been utilized. they are shaP, liMe, eli5, Qlattice and anchor. Most of the algorithms were tested on the best four feature selection methods. When writing this manuscript, many explainers did not support Dl models. Further, the Ml pipelines obtained better results compared to Dl models. hence, Dl models were not subjected to Xai techniques in this research.
the basis of shaP is probability and game theory [50]. the shaP beeswarm plots for the final stack model for the best four feature selection techniques (Pc, csa, Mi and PsO) are described in Figure 11. a hyperplane separates the two classes (non-cOViD-19 ili cases are towards the left, and cOViD-19 positive cases are towards the right of the hyperplane). additionally, the colours red and blue denote higher and lower values, respectively. additionally, the markers are ordered in decreasing order of significance. (the best marker remains at the top). the figures show that markers such as eosinophil, albumin, tWBc, alP, hba1c, basophil and sodium are important. From the diagrams, it can also be seen that eosinophil count decreases in cOViD-19 patients. Other markers including tWBc, alP, alt, basophil and t. bilirubin also decrease for saRs-coV-2 patients. hba1c was slightly elevated in cOViD-19 patients. Other increased Table 7. Performance of the Ml classifiers after using the top four feature selection methods. markers for cOViD-19 patients are sodium, albumin, haemoglobin, haematocrit and monocytes. a force plot can be utilized to predict an individual's diagnosis. Figure 12 indicates force plots for individual patients for the best four feature selection methods. Figure 12(a,b) indicates a positive saRs-coV-2 prediction. Figure 12(c,d) indicates a negative prediction. Markers such as albumin, t. bilirubin, hba1c, alP and alt push the prediction towards cOViD-19 positive. clinical parameters such as hba1c, alP, haemoglobin and ast point towards a cOViD-19-negative diagnosis. Further, the size of the bar is directly proportional to feature importance.
liMe is an Xai technique known for its local interpretations [51]. initial data are updated to gain insight into the algorithm's results after generating projections with the features chosen for explanations. it uses the linear regression technique to demystify the predictions. the algorithms generate many combinations, which are then used for training. Finally, justifications and analysis are offered for each prediction. the liMe explanations for the best four feature selection methods are depicted in Figure 13. Figure 13(a,b) depicts a cOViD-19-positive patient. every feature has a weight, and they are ranked in decreasing order of significance. as can be observed, a diagnosis for cOViD-19 requires indicators like tWBc, alP, t. bilirubin and eosinophil. Figure 13(b,d) shows that the cOViD-19 test was negative. hba1c, sodium and ast were crucial in predicting a cOViD-19 negative diagnosis.
a Python toolkit called eli5 employs a standardized aPi to visualize and troubleshoot various classifiers [52]. it supports both regression and classification models. in this study, eli5 was used on the decision tree models for the best four selection methods. Figure  14 depicts the explanations made by the eli5 model. according to eli5, the most critical parameters are t. bilirubin, D. bilirubin, hba1c and alP. the eli5 also considers the 'bias' parameters for its predictions.
an ai company, 'abzu' , developed Qlattice. Qlattice is a Python software module used for symbolic regression [53]. this explainer supports both categorical and numerical data formats. it enables users to quickly create, plot   and examine essential features. Figure 15 illustrates how Qgraphs can be used to visualize the model's interpretation. Qgraphs contain edges, nodes and activation functions. they also connect the input and output layers. in Python, Qgraphs are interpreted using the 'FeYN' library. the significance of indicators like hba1c, tWBc, eosinophil, alP and t. bilirubin can be observed. Further, the models have heavily used activation functions such as Gaussian and multiplication.
anchor' is another Xai method to interpret Ml models [54]. anchors use a set of 'rules' and 'conditions' to explain the important features. each anchor (condition) is measured by two metrics: precision and coverage. Precision defines the accuracy of the explanations. the number of instances which use the same condition for prediction is defined by coverage. anchor explanations are described in table 10. the best markers that predict cOViD-19 are: alP, eosinophil, alt, alP    and haemoglobin. the best markers that diagnose ili non-cOViD-19 patients are eosinophil, alP, haematocrit, albumin and t. bilirubin.

Further discussions
this study identified clinical markers that can diagnose cOViD-19 from similar respiratory diseases using Ml algorithms. a combination of markers such as eosinophil, tWBc, t. bilirubin, hba1c, alP and alt were crucial in diagnosing cOViD-19. in order to validate the diagnosis, the decision support system can be used concurrently with an Rt-PcR test.
Patients with cOViD-19 had relatively decreased eosinophil levels. eosinopenia in cOViD-19 patients has already been documented in numerous researches [55,56]. hba1c was comparatively higher in cOViD-19 patients in this study. hba1c has already been used as a prognostic marker in several cOViD-19 studies [57,58]. liver enzymes such as alP, alt, ast and t. bilirubin were comparatively lower in cOViD-19 patients. Many studies have reported decreased liver enzymes among coronavirus patients [59,60]. according to our study, tWBc levels decreased in cOViD-19 patients. in numerous researches, leukopenia was seen in cOViD-19 patients [61,62]. albumin levels were higher for   cOViD-19 patients in our study. according to other studies, higher albumin count was observed in mildmoderate cOViD-19 patients [63,64]. Monocyte count tends to increase after contracting cOViD-19 [65,66]. Our research agrees with the existing literature. Basophil count was lower in cOViD-19 patients compared to ili non-cOViD-19 patients in our study. there are similar studies that report basopenia in cOViD-19 patients [67,68].
Numerous research teams have developed ai systems intending to automate cOViD-19 diagnosis in response to the unprecedented health crisis brought on by the global pandemic. however, very few studies have used clinical markers as a modality. Marateb et al. [69] used Ml to distinguish between cOViD-19 and non-cOViD-19 pneumonia. the study considered three datasets and an ensemble classifier was utilized. all three datasets obtained good accuracies. White blood cells and c reactive protein were crucial for accurate diagnosis. self-organizing maps, neural networks, and cluster algorithms were used to diagnose cOViD-19 in another research [70]. the most critical markers were basophils, eosinophils, red cell distribution width and leukocytes. an Xai approach was used to diagnose cOViD-19 in another research [71]. Four ensemble models were explained using liMe. the gradient-boosting decision tree obtained the best performance with an aUc of 0.86. the crucial markers were lactate dehydrogenase, white blood cells and eosinophil count. Guo et al. [72] used a multivariate algorithm to distinguish cOViD-19 from similar respiratory diseases. a maximum accuracy of 92% was obtained, and the most essential markers were lymphocytes and white blood cells. chadaga et al. [73] used Ml and Dl algorithms to diagnose cOViD-19 from non-cOViD-19 patients. a maximum accuracy of 96% was obtained by the final stack. the most crucial markers observed in this study were alt, basophil and tWBc. however, severe cOViD-19 patients were also included in the study. another Xai technique was used by Rostami and Oussalah [74] to diagnose cOViD-19. a graph-boosted Xai technique was used to interpret the results. the essential markers were platelets, eosinophils, c-reactive protein, ast and WBc.
in this study, we have used Xai techniques such as eli5, Qlattice and anchor, which have been rarely used in medical research. cOViD-19 severity has also reduced drastically after the introduction of cOViD-19 vaccines. however, very few studies have included only mild and moderate cOViD-19 patients. therefore, we emphasize the suggested approach, which uses Xai to diagnose cOViD-19 from other similar respiratory illnesses.

Limitations and future work
there are a few limitations to this study. Patients were considered from only one geographical location. it is necessary to consider patients from different demographics to establish reliable results. Medical validation was not performed. Real-time usage of models in hospitals can be performed. Graphical processing units (GPU) were not used in this study. Deep learning models run faster when GPUs are used. the data were imbalanced too. When the data are imbalanced, the models favour the majority class. to avoid ambiguity, the Borderline-sMOte oversampling technique was used on the training dataset.
in the future, cloud-based systems can save the data and models. Unsupervised and reinforcement learning methods can also be utilized. Other diagnostic methods such as, cough sounds, ct scans and chest X-rays can also be combined suitably. Data from various countries and geographical territories can be combined to establish the results' reliability. hold-out set can also be considered along with training and testing/validation data. Oversampling techniques could also be compared with under sampling techniques.

Conclusions
in this research, several supervised learning algorithms were utilized to diagnose mild-moderate cOViD-19 from other similar respiratory illnesses. the data were collected from two indian hospitals. Before model training, 15 feature selection techniques were used to choose the most important parameters. a custom stacked model was then trained, which included several heterogeneous classifiers. Further, DNN, lstM, 1D-cNN and ResMlP were also trained and tested. after using Pearson's correlation and particle swarm optimization feature selection, the final stack obtained a maximum accuracy of 89%. Five Xai techniques, including liMe, shaP, eli5, Qlattice and anchor, were used to understand the predictions. the most important markers that were useful in cOViD-19 diagnosis are eosinophil, albumin, t. bilirubin, alP, alt, ast, hba1c and tWBc. the models can be deployed in real-time as a decision support system to validate the results obtained by the Rt-PcR tests.