A Fair and Safe Usage Drug Recommendation System in Medical Emergencies by a Stacked ANN

: The importance of online recommender systems for drugs, medical professionals, and hos-pitals is growing. Today, the majority of people use online consultations for drug recommendations for all types of health issues. Emergencies such as pandemics, ﬂoods, or cyclones can be helped by the medical recommender system. In the era of machine learning (ML), recommender systems produce more accurate, quick, and reliable clinical predictions with minimal costs. As a result, these systems maintain better performance, integrity, and privacy of patient data in the decision-making process and provide precise information at any time. Therefore, we present drug recommender systems with a stacked artiﬁcial neural network (ANN) model to improve the fairness and safety of treatment for infectious diseases. To reduce side effects, drugs are recommended based on a patient’s previous health proﬁle, lifestyle, and habits. The proposed system produced results with 97.5% accuracy. A system such as this could be useful in recommending safe medicines to patients, especially during health emergencies.


Introduction
Online consultations require the patient to describe their symptoms to the doctor. A spike in virtual medical services has been reported in the wake of the novel coronavirus disease (COVID-19) [1]. Diabetes, hypertension, and heart disease are all associated with an increased risk of virus infections. The availability of health care professionals 24/7, no need for travel, security, privacy, and drug recommendations are all advantages of virtual medical services. The recommender system allows for improvements in medical services in disparate areas [2]. Often, finding a physician in remote areas can be tricky, so recommender systems have been created to help.
Health-related recommender systems can make an early diagnosis, predict disease progression, and make appropriate recommendations according to the health status of patients [3,4]. Machine learning (ML) greatly improves the quality of medical recommender systems by providing suggestions that are based on patient needs and feedback [5,6]. By using sentiment analysis and feature engineering, the drug recommender system can dispense medicine according to a specific condition. Emotions, such as attitudes and opinions, are separated and extracted from language through sentiment analysis [7].
By using the recommender system, information overload can be solved, and egovernment and e-learning can be improved [8]. Depending on an individual's health status, these recommender systems prescribe medications, diagnose diseases, and refer them to the relevant health care. An ML-driven recommendation system generates appropriate recommendations using parameters such as blood pressure, gender, cholesterol levels, and blood sugar for diseases such as colds, fevers, and cardiac deaths [9]. The healthcare system built on the Internet of Things (IoT) coupled with an oncology interface has provided nutrition information to individuals [10].
Depending on the patient's medical history, a decision support system can assist a doctor in prescribing a drug. In contrast, the recommendation system suggests the same based on an analysis of previous usage patterns [11]. Four types of recommender systems exist, including content-driven filtering, collaborative filtering, knowledge-driven recommender systems, and hybrid recommender systems [12,13]. Since the drug recommendation framework includes medical terminology, such as infection names, side effects, and synthetic names, only a limited number of papers are available.
In this work, we proposed the development of a drug recommender system (DRS) for different diseases to maintain good patient health and longevity. We addressed the unfairness in drug usage by DRS for severe chronic diseases by improving the recommendation accuracy by the integration of ML knowledge. A further discussion was carried out on how the proposed DRS integrates the person's health profile and automation of meditation, and drug dosages. The system performance was calculated based on different metrics such as accuracy, sensitivity, and specificity. The performance was further compared with other existing ML models to validate its efficiency.

Related Work
From the existing literature, different health recommender systems (HRS) are available. Collaborative filtering utilizes past user behavior to examine similar profiles and determine preferences to make clear recommendations. A hospital recommendation system was proposed by Fedelucio et al. [14] based on the treatments, consulted physicians, hospitals, and patient health indicators of a patient. An alternative hybrid recommender system based on available information on family doctors and available patients was suggested [15].
Various HRS help to support medical treatment and prognosis [16]. Recommendations made on content-based filtering are dependent on specific features only. Different features selected using rough set feature reduction can predict diabetes [17]. Content-driven models are used to evaluate radial doses and weights for elements in cancer treatments [18]. It is reported that content-based models achieve a better performance than traditional models in predicting the risk of heart attack [19].
A model called iCARE uses collaborative filtering and hybrid learning to predict disease risk based on a patient's previous illnesses [20]. The risks of delivery for pregnant women can be predicted using a collaborative filtering algorithm that includes Mahalanobis distance and fuzzy membership [21]. Ontologies and methods of problem-solving are fundamental components of knowledge-based systems [22]. Based on the knowledge of users and products, knowledge-based filtering selects products that are suitable for users [23]. Meanwhile, hybrid systems combine different filtering approaches [24].
Demographic filtering offers recommendations based on demographic data such as age, gender, nationality, and residency [25]. In medical emergencies such as the COVID-19 pandemic, older people have a higher risk of complications and contracting serious illnesses if they are untreated. Through information filtering, the HRS can handle such emergencies by collecting patient messages and recommending treatment [26]. With the help of the patient's demographic information, these messages for smoking cessation users used hybrid filtering to assess similarity.
A semantic web is a fast-evolving technology that utilizes a content-based recommendation system with machine-readable annotations [27]. The social-based filtering algorithm considers information about an individual's neighborhood, along with similar tastes [28]. To prescribe the most appropriate treatment to patients, semantic clustering assesses the similarities between records, taking into account the patient's demographics, location, and medical complications [29].
The DRS offers medicine based on patient reviews using sentiment analysis and feature engineering. The risk level classification identifies a patient's immune system and recommends medicines if the patient has a low immune system [30]. Doulaverakis et al. [31] proposed GalenOWL, a semantic-driven online framework with the help of a specialist to manage drug recommendations based on the past profile of the patient. By considering worldwide standards such as ICD-10 and UNII, this framework converts clinical data and drug interactions to ontological terms. Cloud-assisted drug recommendation (CADRE) also considers the patient's side effects and shifts to the cloud to advance the quality of the patient's experience [32]. No particular DRS system was developed for the COVID-19 emergency. Therefore, we aimed to develop a DRS modeling framework by incorporating a stacked artificial neural network (ANN) for the fair and safe usage of drugs in pandemics.

Dataset
We prepared the drug selection dataset for the COVID-19 treatment from different sources including drug banks, news reports, and the existing literature [33][34][35][36][37]. Primarily, potential drugs recommended for COVID-19 by the World Health Organization (WHO) including Remdesivir, Umifenovir, acetaminophen, and Favipiravir were considered. Later, the data from studies [34][35][36][37] helped us to create interactions between the drugs and the collected clinical data. Other demographic patient information including gender, age, height, weight, exercise habits, country, food habits, COVID-19 infected data, and the co-morbidities were collected and are presented in Table 1. The incomplete or missing data columns were excluded from a given dataset. Patient symptoms based on individual questionnaires and lab reports were collected and drug categorization was completed for the drug using the stacked ANN. The recommendation of antibacterial drugs was completed by mapping the patient's health history.

Data Pre-Processing
The symmetric uncertainty feature selection measure was applied to find the association between different features in the feature space. Under the candidate feature (f i ) we evaluated the information shared between the selected feature (f s ) and f i . The relevance of the class of the independent features was measured by: here, I is the mutual information and E is the entropy of the features.
The entropy of f i is calculated by Entropy(f i ) = −(p(0)× log(p(0)) + p(1)× log(p(1))) I(f i , f s ) = ∑ i∈I ∑ s∈S P(i, s) log P(i,s) P(i)P(s) ; Here i ∈ I, s ∈ S are the possible values of I and S, respectively; P(i) and P(s) signify the distribution of I and S, and P(i,s) signifies the joint distribution.

Symptom Extraction and Severity Rating
We divided the survey data into parts of speech to extract the symptoms, and the extracted words were mapped to the disease dictionary with the symptoms and drugs. The dictionary of medical terms was adopted from the Systematized Nomenclature of Medicine and Clinical Terms (SNOWMED-CT) [38,39]. The mapping of the corresponding symptom entities was completed using the infection severity. The infection severity was estimated under the guidance of the pharmacist.
To standardize the feature F p = (f p1 , f p2 , . . . , f pn ), we used the min-max scaling to normalize the features using ; where f pq is the q th rating specific to the q th infection symptom in F p , max F , min F are the maximum and the minimum ratings

Drug Target
To create the drug labels, we used the categorized drug information and described them based on the patient attributes. To measure the frequency (FREQ) of the occurrence of the drug d p based on the symptom feature s p for all the cases: FREQ d p ,s p = q dp,sp q dp ; here FREQ d p ,s p is the frequency of the drug (d p ) to the symptom feature (s p ); q d p ,s p is the number of cases containing the d p and s p ; and q d p is the number of cases containing the drug d p .
The drug d p can be represented as d p = {FREQ d 1 ,s 1 , FREQ d 2 ,s 2 , . . . , FREQ d p ,s p }. The kmeans clusters were applied in drug categorization [40][41][42]. We assembled the information about diseases and drug interactions for a better representation by: G drd 1 |R t | ∑ P R t q P ; here R t represents the association of drug (t) to drug set (b). The drug prediction was performed based on the drug correlation presented by σ TG d ∑ d T dq x d ⊗ x q ; here σ is the activation function, ⊗ represents the element-wise product, T dq represents the correlation between drug d and drug q.
The drug target aggregation operation associates a drug with a specific disease by ; here x k g d represents drug d after the g aggregation operation. To aggregate the drug target information by aggregating the k layers by (TG d ∑ d T ds (x d ⊗ h t )); here t represents the target of the disease symptom in drug symptom, h t represents the initialized symptom t.
The Artificial Neural Network (ANN) model was incorporated to perform the drug selection based on the patient's symptoms. When a new patient (p new ) appears, the model collects patient symptomatic data for a similarity check of the existing patient records. Then, the training phase is performed and the symptom drug classifier is classified according to the patients' symptoms. Medications are displayed based on side effects and co-morbidities, and a drug is chosen based on the drug attributes. This is analyzed by: here A i,new are the features for the new cases and A i,old represent the old cases.

Recommendation Algorithm
To suggest drugs for the specific disease, the DRS recommends antibacterial drugs based on the individual's past health status and present risk level. The matching of the drug with the active individual features is completed using the following equation: here f x is the feature set of the individual and x, f x is the mean over the set of features of I.
If the diseased individual has allergies, high blood pressure, and poor health, adverse side effects of the drug may lead to death or morbidity [43]. The probability of the drug side effect is calculated by: ; here S x and S y are the side effects of the drug D x , prediction score , and ϑ k is the average risk of all the diseased individuals with a risk factor of k. The fair drug recommendation system takes into account health conditions, preferences, race, and gender. Based on the weighted binary singular value decomposition, a stacked ANN is proposed. Figure 1 illustrates the framework for the proposed drug recommendation system. A normal health condition or a worsened state is indicated by the input parameter values. For the recommendation algorithm, the current state of a parameter is crucial. Each parameter value can belong to a different class according to the proposed technique. Every user has a unique health profile, which is compared to a user who had a similar health condition in the past. Based on the user's immune system and preferences, the stacked ANN model identifies the appropriate set of medications. Our recommendations were based on a comparison of the individuals' health profiles and individual preferences with those of similar individuals. In Algorithm 1, all the individuals with the same features are grouped into a recommendation cluster. Categorize the users according to the filtered features, and cluster all the individuals that have the same features.

2.
Selection of the similar cluster individuals to the active individual 3.
Calculate the drug features (i.e., dosages, tolerance, smell, gas generation) of the active individual by considering the health status and the user preferences. ; where f p are the most important drug features, n p and P p are the measurements of the next and the past health status, t u are the allergies, m(t u ) is the instances count, ϑ(t u ) is the selected infectious features of the individual t u , d(u * , p) is the feature direction change, the range of the values is −1,0,1, i(t u ) is the magnitude of the specified feature and S(d(t u )) is the duration.

4.
Generate recommendations by calculating the individual's health status with ∑ u∈U ∑ p∈P A t,u,p 5.
Store the list of the recommended drugs upon the acceptance of the user. If the individuals reject the list of drugs and dosages, provide them with the alternative list of drugs and dosages which has been followed by similar individuals who have been assessed using the drug recommendation algorithm. 6.
Generate the list of recommended lists of drugs and dosages based on the individual's health status, lifestyle, and individual preferences.

Recommendation Algorithm
To suggest drugs for the specific disease, the DRS recommends antibacterial drugs based on the individual's past health status and present risk level. The matching of the drug with the active individual features is completed using the following equation: If the diseased individual has allergies, high blood pressure, and poor health, adverse side effects of the drug may lead to death or morbidity [43]. The probability of the drug side effect is calculated by: The fair drug recommendation system takes into account health conditions, preferences, race, and gender. Based on the weighted binary singular value decomposition, a stacked ANN is proposed. Figure 1 illustrates the framework for the proposed drug recommendation system. A normal health condition or a worsened state is indicated by the input parameter values. For the recommendation algorithm, the current state of a parameter is crucial. Each parameter value can belong to a different class according to the proposed technique. Every user has a unique health profile, which is compared to a user who had a similar health condition in the past. Based on the user's immune system and preferences, the stacked ANN model identifies the appropriate set of medications. Our recommendations were based on a comparison of the individuals' health profiles and individual preferences with those of similar individuals. In Algorithm 1, all the individuals with the same features are grouped into a recommendation cluster.

Software and Hardware Specifications
The experiments were conducted on a PC with an Intel i9, 7890XE processor with 18 physical and 36 logical cores, 128 GB of memory, and Windows 10 Enterprise as the operating system. Anaconda IDE was used to write the Python code.

Fairness Drug Recommendation for SARS-CoV-2 Infectious Diseases Using ML and Regression
Calculating high prediction values involves three steps including obtaining, filtering, and choosing the highest prediction values. The correlation between the recommendation errors and the threshold should be calculated. We used a statistical test to identify the possible predictors to improve the fairness of drug recommendations by considering the characteristics of the patient and the severity of the disease. A threshold of one standard deviation was applied to each diagnostic feature based on symmetric uncertainty. Tetrachoric analysis was used to estimate the correlation between the binary covariant features. The Conway Maxwell Poisson regression was employed to identify the drug characteristics and the clinical evidence. The Hausman test was also applied to assess the change in the effectiveness prediction score for the individual and the drug, as shown in Figure 2.

Fairness Drug Recommendation for SARS-CoV2 I Regression
Calculating high prediction values involves th and choosing the highest prediction values. The co errors and the threshold should be calculated. W possible predictors to improve the fairness of dru characteristics of the patient and the severity of th deviation was applied to each diagnostic feature rachoric analysis was used to estimate the correla tures. The Conway Maxwell Poisson regression w acteristics and the clinical evidence. The Hausm change in the effectiveness prediction score for th Figure 2.

Fairness of Drug Side-Effects Predictions Using Deep Learning and Regression
Drug features were extracted to predict drug side effects associated with drug names and clinical characteristics. A bilingual evaluation understudy metric was used to identify the associated drug side effects. The following drugs are tabulated along with their side effects in Table 2.
The selection of an adequate threshold is crucial to fine-tune the medical recommendation process. It is recommended that the parameter range is defined as (0,1), where 0 indicates complete fairness and 1 indicates no fairness. An assessment of the average error for the recommendations is necessary for a better scale of accuracy. We chose 0.4 as the threshold value for the optimal selection, and 0.5 as the default parameter value. Table 3 summarizes the proposed drug recommender system with different hidden layers.  The stacked ANN was implemented for a drug recommendation system with varying hidden layers, and the error rate was compared as the number of hidden layers was increased. A minimum error rate was observed when three hidden layers were used. To evaluate the proposed models, the Relu activation function and Adam optimizer with 150 epochs and 32 batch sizes were used. Table 4 presents a comparison of the performance estimates for the different models. The performance metrics were applied to evaluate the drug recommendation performance. We observed that the proposed model performed better than other traditional ML algorithms in terms of accuracy, precision, sensitivity, and specificity.

Discussion
For example, a DRS for migraine patients can help doctors write the appropriate and accurate drugs for the patients based on their severity and importance [44]. The proposed DRS consists of individuals who are 80% similar to the present diseased individual. An additional system for diabetic patients using collaborative filtering can recognize patients that closely match the active patient by considering features such as insulin, glucose, body mass index, and blood pressure [45]. By using information about a patient's profile, combined with ontologies and rule-based decision making, these systems can recommend anti-diabetes medicines with dose restrictions [46].
A patient with COVID-19 and susceptible virus-related fatigue was treated with chloroquine, as reported in [47]. Lopinavir significantly decreased the incidence of ARDS in patients with SARS-CoV-2 infection [48]. Nafamostat has been reported as a treatment for pancreatitis and abnormal coagulation that occur frequently in COVID-19 patients [49]. In the early phases of the COVID-19 treatment and for the treatment of influenza, camostat is used [50]. Gastric ulcers are treated with farotine, which has few side effects and an adequate efficacy and reduces iNOS activity [51]. With its immune system boosting effects, Nitazoxanide improves the respiratory distress associated with SARS-CoV-2 [52]. Combined with other COVID-19 treatments, ivermectin lowers mortality rates and hospital stays for moderate COVID-19 patients [53].
Researchers used resilient distributed dataset programming to implement the density peak-based clustering algorithm in their study [54]. A system for identifying sickness and treatment association rules was proposed to identify disease diagnosis recommendations. Unfortunately, the outbreak of coronavirus has limited the availability of legitimate clinical resources, such as doctors, nurses, and equipment. Due to the distress of the medical profession, a lot of people are dying. Shen et al. [55] outlined a system for performing infectious disease diagnoses and clinical decisions. In the proposed system, antibiotic usage is recommended using the naive Bayes classifier, and the ontological relations and rules are accurately stored in Neo4j.
Fairness is the major bias arising from recommender systems. Certain characteristics, such as race, gender, age, qualification, or property, are not represented equally in the dataset. In the case of unbalanced data, it is possible to highlight overrepresented groups in the rankings while reducing visibility for underrepresented groups. According to previous studies, the feedback loop causes the high usage medicines to become more popular and the low usage medicines to become less popular. Using the Type 2 fuzzy ontology and the wearable sensors for diabetes treatments, another study has reported that drugs and diet plans are available to patients [56]. Based on the findings of the authors, the proposed system is effective in extracting diabetic patients' risk factors and recommending drug therapy.
In this paper, the accuracy of the proposed system framework gradually increased to 98.5%, which indicates that the ANN is the accepted model for drug recommender systems. After pre-processing, the patient feature spaces and the drug-drug interaction are obtained from the drug-target association. Health care data provide drug information for infectious diseases to the medical recommender system. This system compares the patient's choices based on their similarity and has a superior level of accuracy to other state-of-the-art technologies. Since the proposed methodology builds both the interactions between a disease and the drug and the interactions between a drug and a drug, as well as between a drug and target, the hybrid restricted Boltzmann machine outperformed the logistic regression by approximately 3.9%.

Conclusions
This work involved deep learning techniques to make unbiased and fair drug recommendations. The loss function is used with the input data to improve fairness and accuracy. When a patient with comorbidities comes for a recommendation, we obtain the patient's lab test results. A diagnosis is made by the DRS based on the features of the patient, and we rely on this diagnosis to determine the drug category in the system. The architecture uses statistical analysis to improve accuracy by adjusting the threshold value, which also balances fairness.

Conflicts of Interest:
No author has any potential conflict of interest during the submission and publication of the manuscript.