An Emergency Unit Support System to Diagnose Chronic Heart Failure Embedded with SWRL and Bayesian Network

In all the regions of the world, heart failure is common and on raise caused by several aetiologies. Although the development of the treatment is fast, there are still lots of cases that lose their lives in emergence sections because of slow response to treat these cases. In this paper we propose an expert system that can help the practitioners in the emergency rooms to fast diagnose the disease and advise them with the appropriate operations that should be taken to save the patient’s life. Based on the mostly binary information given to the system, Bayesian Network model was selected to support the process of reasoning under uncertain or missing information. The domain concepts and the relations between them were building by using ontology supported by the Semantic Web Rule Language to code the rules. The system was tested on 105 patients and several classification functions were tested and showed remarkable results in the accuracy and sensitivity of the system. Keywords—Ontology Engineering; Bayesian Network; Heart Failure; Expert System; Validation Test


INTRODUCTION
In dealing with real world applications, one inescapably has to deal with uncertain or missing information.In diagnosing Expert System (ES), it is impossible to model all the conditions and variables in specific values, and because of the large number of these variables, probabilistic models are not suitable, while Bayesian Network (BN) does [1,2].
A Bayesian Network is a graphical representation of probabilistic information expressed as directed acyclic graph with nodes that represent the variables with uncertain or missing values, and edges between then to represent the probabilistic value that represent the influence of these variables [3].For several reasons BN plays a significant role in modelling uncertainty in ES and Decision Support Systems.The graphical representation that shows the conditional independencies between the nodes are easy to be understand by the user of the system.Moreover, since BN defines a unique joint between two specific nodes, the consistency and correctness of inference are guaranteed due to the mathematical calculation dependencies [4].
There are lots of efforts in recent years into designing ESs that can assist experts in different fields to make their decision.The reasons behind this are reducing clinical errors the patient's waiting time, and unnecessary medical and laboratory tests.Heart failure diagnosing require special attention from the ES builders since the patients of this disease need to be diagnosed, treated and monitored continuously and with fast response.The main symptoms are breathlessness in specific cases, extreme tiredness and ankle swelling, which may extend up the leg and get worst at night.As noticed, the description of the symptoms requires specifying some probability values to represent the level of relations between variables.
Using ontology in the design of expert systems is a hot issue.In the field of AI, ontology is a collection of classes, attributes, and the relationships between them.It represents the vocabulary for transferring thought and performing reasoning in a domain [5].The main reason behind using ontology to represent the knowledge and the relationships in expert systems is its ability to reuse the domain knowledge by sharing the common understanding in a specific field.Its interoperability feature allows the ontology systems to be spread and developed more powerfully.This paper presents a framework for designing and implementing an expert system to be used in emergency units to help practitioners to diagnose heart failure disease in the presence of uncertain or missing information.The design depends on two different technologies, Bayesian network to model uncertain values for some required variables, and ontology to model the concepts of the ES and the relationships between them.

Bayesian Network A.
A Bayesian network is a probabilistic model P showed at a directed acyclic graph (DAG).In another word, BN of n variables consists of a DAG of n nodes and a number of arcs.Each node in a DAG represents a random variable X i ; and a directed arc between two nodes X i , X j represents the direct influence or causal from X i to X j .There is a probability distribution P associated with each node i, such that: ( | ( , where ( is the parent set of .All the probability factors of a given DAG are listed in a Conditional Probability Table (CPT) and the joint probability distribution or probability inference of a BN is the product of its CPT: www.ijacsa.thesai.org

( ∏ ( | ( ) (
Using joint probability distribution, BNs support probabilistic inference in the joint space.To relax a BN, Bayesian classifiers required.In the designing of our model we adopted three types of classifiers.The first one, which is the simplest and most used one, is the naïve Bayesian classifier which assumes that the independence features are conditionally independent.The second classifier is the Tree Augmented Network (TAN) which is performed by adding directional edge between variables that are not belong to the same class node [6].The last classifier used is the Forest Augmented Network (FAN) to perform better ranking by joining several trees together [7].

Expert Systems B.
Since the beginning of the using computers, scientist and physicians started to think of ways to utilize computers in assisting them to do their work.The first article appeared in the field of diagnosing process was in 1959 [8] that suggested a technique that helps physicians in diagnosing diseases and focused on pointing the light on the benefits of using computers in medical fields.Moreover, several early systems appeared.The most well-known system was developed in Leeds University in 1972 [9] to diagnose abdomen pain using Bayesian probability theory.Later in 1976, another wellknown medical diagnosing system appeared, MYCIN [10].MYCIN embedded the field of Artificial Intelligent (AI), which uses abstract symbols rather than numerical calculations, to build the production rules and to strength the reasoning process to identify bacteria causing severe infections.In 1991, A Dynamic Hospital Information System (HELP) appeared [11] that has the ability to generate alerts when abnormal signs in the patient record are noted.
There are five main components in any rule-based expert system.The knowledge base which has the rules and any other form of information collected from the human experts in the field.Knowledge can be either abstract or concrete.While abstract knowledge can be represented by rule and probability distribution, concrete knowledge refers to the information related to a specific abstract knowledge (facts).The heart of every expert system is the Inference Engine which draws conclusions by applying abstract knowledge to concrete knowledge.These conclusions can be based on either deterministic knowledge (knowledge about certain facts), probabilistic knowledge (knowledge about uncertain facts), or nondeterministic knowledge (fuzzy knowledge) [12].Another component in the building blocks of an expert system is the Explanation Mechanism which provides the user with the necessary explanation about the way a specific conclusion drawn and the reasons behind using specific facts.When the expert system deals with users, it should be accompanied with a User Interface component which should be user friendly and easy to use.

Ontology and its Engineering C.
"An ontology is a formal explicit representation of concepts in a domain, properties of each concept describes characteristics and attributes of the concept known as slots and constrains on these slots" [13].In the field of computer science and information technology, Ontology is the process of representing knowledge in a specific domain [14].Ontology is used to represent the sharable knowledge in terms of concepts which represented by classes, relations which represent the relations between the concepts, instances which are the objects represented by the concepts, and axioms which represent the rules that tie the concepts to the instances [15].
Fonseca [16] defines ontology as "an ontology refers to an engineering artefact, constituted by a specific vocabulary used to describe a certain reality".He identified the difference between ontology and information systems in modelling and reasoning about information, as ontology deals with the information in conceptual level, while information systems do this task in implementation time.
In their work, Rousey et.al.[17] gave different perspectives of the word "Ontology" in the field of Compute Science."For example, ontology can be: a thesaurus in the field of information retrieval, a model represented in OWL in the field of linked-data, or a XML schema in the context of databases".
On the other hand, knowledge Engineering is the steps that should be followed to build ontology.There are several methods use in this aspect [18], In this paper Toronto Virtual Enterprise (TOVE) method was used [19].The reason behind choosing this methodology and its steps are illustrated in the forthcoming sections.

Web Ontology Language (OWL) D.
Among several ontology languages, OWL is the most used one.It is a World Wide Web Consortium (W3C) recommendation in 2004 to be "used by applications that need to process the content of information instead of just presenting information to humans" [20].It has several features over XML and RDF by providing additional vocabulary along maintain their properties.It is then used to define instances (individuals) and maintain their properties, and then it is used to reason about these classes and individuals [17].OWL has three sub-languages: 1) OWL-Lite: This sub-language intended for users who need simple modelling and constraints.Although it provides quick path to thesauri and other taxonomy, its cardinality is limited to either 0 or 1.
2) OWL-DL: To fill the shortage of OWL-Lite, this sublanguage comes with features that enrich the use of OWL.Class Boolean combinations and class property restrictions are some of the added features.Other properties in describing a class in term of other disjoint classes are another new feature.With all these features, OWL-DL becomes the most used language since it provides the user with full expressiveness [20].
3) OWL-Full: this sub-language offers to its users maximum expressiveness and syntactic freedom of RDF [17].As instance, OWL-Full treats a class as a set of individuals and as an individual at the same time.Its data type property generalizes to include inverse functional property.www.ijacsa.thesai.org

Semantic Web Rule Language (SWRL) E.
Based on the combination between OWL-DL and OWL-Lite sublanguages, SWRL was developed to be the rule language of the semantic web.It allows the users to write the first-order logic rules required to reason about the specified OWL individuals.The semantic rules of SWRL are the same as the description logic of Owl to make the reasoning process easier and stronger.
Each SWRL rule has an antecedent and a consequent, each of which could be a disjunction of several atoms.There are several atom types that are supported y SWRL, such as class atoms, individual property atoms, data value property atoms, and data range atoms.The most powerful atoms are built-in atoms, where SWRL provides several types of existing builtin and allow the user to design and use his own built-ins [21].

III. RELATED WORK
Several BN expert systems were proposed to provide the experts with the required decision especially in medical field.Some of these systems were based on building their knowledge base using ontology.In diagnosing heart diseases, [22] proposed a Decision Support System to be used by the cardiovascular experts and the data obtained from the Rapid Access Chest Pain Clinic in England.The medical conditions were modelled as binary clauses, either yes or no.No other values were used in this system to model the uncertain variables.
Jayanta and Marco [3] presets a framework for an expert ES that assists the expert to assess the several minerals levels in the patient's body.The data of the study was dedicated to elderly people over 65 years old and no ontology engineering used.
To the best of our knowledge, all the proposed Expert Systems which focus on heart diseases were designed to be used by the expert in the field.There is only one proposal for a system that can be used in emergence units.In their work, Joan et al. [23] proposed a Bayesian-based ES to be used in the emergency units to assist practitioners to diagnose unstable angina.In this paper we propose an ES that is supplemented by BN and Ontology engineering to diagnose heart failure in the emergency units.

IV. METHODOLOGY FOR ONTOLOGY ENGINEERING
System Architecture A.
The architecture of the proposed system consists of several modules.Figure 1 illustrates these modules and the interactions between them.As any other expert system, the core of our system is the knowledge base module which consists of the fact base and the rule base.The facts are extracted, using the user interface, from the user as the patient's symptoms in addition to the laboratory and clinical test results.The rules base consists of SWRL decision rules and the ontology structured classes along with the relationships between these classes.The decision rules were inferred from technical guidelines published by the National Institute of Health and Care Excellence in the UK [24,25].While the ontology classes were formed using Protégé Ontology editor.
The inference engine is the core of any expert system which depends on the facts and the rules to reason the required decision.In our work we use Pellet [26], which considered to be one of the best OWL-DL reasoned with several features such as data-type reasoning and debugging, rules integration, and reasoning conjunctive queries.In this stage more decision rules could be inferred and added to the list of available rule base.The final decision results will be introduced to the user through the user interface alongside with the explanation about this decision inferred from the explanation module.The methodology used to build our ontology-based ES is TOVE, designed by Gruninger and Fox [19].The main goal of TOVE is to develop a set of integrated ontologies and it has several characteristics that make it widely used as ontology engineering.It provide the ability to create a sharable representation of the ontology, to define the meaning of each semantic in first-order logic, to reason about the semantics automatically, and to depict the context in graphical context.According to several literatures [19], TOVE has six stages to be followed and these stages are modified in this paper to depict the reasoning under uncertain or insufficient information.Bayes-TOVE stages are illustrated in Figure 2. b) Since heart failure should be diagnosed fast and since its symptoms are similar to other diseases, the things that make the practitioners get confused in the diagnosing process.c) Patients with heart failure and are in emergency room should be treated taking into consideration the existing disease and the new symptoms that require them to be entered in emergency unit.
d) When a patient get entered to an emergency room, she or her carer may not get all the information that are required in the diagnosing process such as laboratory and clinical test results.This led to use BN to represent some uncertain or missing variables. 2

) Uncertain Informal Competency Questions
In this stage the motivation scenario is changed into informal competency queries that the ontology should answer.The resultant queries provide a clear idea about the new designed ontology and represent the first evaluation step to determine the importance of the ontology and if it can be replaced by existing ones [27].Some of the informal questions of our system are:  What treatments should be taken? What drug should be given to the patient?These queries emphasise the concepts and the relationship between these concepts that are going to be embedded in the ontology.Several of these questions cannot be answered in emergency unit accurately but the reasoning still necessary to be completed.

3) Bayes-Terminology
In this stage the proposed informal questions from the previous stage should be described through either First-Order-Logic or through Knowledge Interchange Format (KIF) axioms.In this project we used Standards Upper Ontology KIF (SUO-KIF).The reason behind authoring this language was to understand the meanings of expressions without the need for a manipulating interpreter [28].As instance, the following rule: "Refer patients with suspected heart failure and high BNP level or high NTproBNP level, to have transthoracic Doppler 2D echocardiography and specialist assessment within 2 weeks".[24] Could be written in SUO-KIF as the following macro-like structure: instance and exist are relations.The SUO-KIF structure can be represented as a tree in which its nodes are the instances and the edges are the functions, relations, or operations on these instances.This stage is necessary for ontology reusability since the KIF representation is generic across many domains.This example emphasises the demand need for reasoning under uncertain information.The actual values of "high BNP" should be 100 and 400 pg/ml and it is not necessarily refer to HF, it could refer to other diseases such as diabetes if the patient age is over 70. Figure 3 shows the BN acyclic graph for the given rule.

4) Uncertain Formal Competency Questions
The main aim of this stage is to make sure that the ontology system is consistent based on the axioms of the ontology [19].This stage should specify the following: the set of terminologies based on the axioms in the proposed ontology (T Ontology ), the set of instances (T Ground ), the Bayesian network (T BN ), and it determines the following: ( such that checks the consistency between the terminologies and instances on one side and first-order sentences in the language on the other side ( ).
Using Formal Competency Questions, the ontology can be distinguished and the relationships with other ontologies can be specified.Several approached, however, have been proposed to use the Competency questions as an ontology evaluator and mechanisms were proposed to check if a given ontology meets its competency questions.[29] 5) Bayes Axioms Axioms in the ontology are the definition of the concepts and relations and constraints between them [19].Moreover, axioms should represent the semantic of the objects and their relations.Although it is considered to be the most difficult process in building ontologies, axioms are considered to be the most important and significant part as well.In this paper, axioms are going to be represented as a tree-like structure rather than first-order logic statements, as suggested in [30].Figure 5 shows the structure of the axioms used in the proposed ES.

V. SYSTEM IMPLEMENTATION
The architecture of the system, which is depicted in Figure 1, has several stages.The first stage is to implement the ontology classes, object properties, data properties and their characteristics alongside with the relations between them (see Figure 4).OWL-DL is used as an ontology language since it has several features listed in section 2. Protégé is used to create the ontology system.Embedded with some reasoners, Protégé is an open source, W3C recommendation, with several features that enables its users to run and check consistency of the system.The second stage was to build the inference rules for the Expert System using SWRL rules.All the rule were built depending on the guideline published by the National Institute for Health and Care Excellence [24].Figure 6 illustrates sample of the inference rules used and an inferred axiom from implementing the rules.Figure 7 shows the result of implementing the inference rules on one of the patients.The red circle in the figure represent the recommendation to the practitioner that the patient should take the Doppler-2D-Echocardiography to make sure if she has HF or not.TESTING AND VALIDATION The dataset used to test the ES was belonged to 105 patients collected from Emergency units in three private hospitals in Jordan and the system has been used by several practitioners.The performance of the system was calculated using the area under the curve (AUC) of Receiver Operating Characteristics (ROC) graph and compute the factors associated to it [33].AUC reflects the percentage of correct classification and its value ranged between 1, indicating optimum classification of all cases, and 0, indicating completely random classifications.Keep in mind that no realistic system should have AUC value less than 0.5 representing 50% random classification [33].Depending on the tested data, AUC value of implementing the ES was 0.7164, which considered to be equalized with other similar systems.Moreover several classification functions were used to test the ES (see Table 1) depending on the values of TP, FP, TN, and FN: 1) Sensitivity: refers to the ability of the system to correctly identify the patients having HF based on the given symptoms and laboratory test results.For our ES, this value is high comparing with other related systems, which makes the system reliable.
2) Specificity: refers to the ability of the system to correctly identify the patient do not having HF.The result of testing this function (Table 1) shows that only 33% of the patients were incorrectly identified having HF and this is due to the using of BN that lowered the error rate.
3) Accuracy: this classification function measures the statistical bias of the system, i.e., how close the results are to the true values.More than 75% of the tested patients had correct results, either having HF or do not and with correct identification.
4) Positive and negative predictive values (PPV) and (NPV): the PPV is the probability that a patient correctly diagnosed to have HF and NPV is the probability of a healthy person correctly diagnosed not to have HF.The resulting ratios of these functions on the data set showed that around 75% of the tested patients were correctly diagnosed.

VII. CONCLUSION AND FUTURE WORK
This paper presents an expert system to help physicians in hospital's Emergency units to diagnose Heart Failure disease.The system is based on BN with discrete nodes to enable the users to reason under uncertain or incomplete information.The SWRL rules are used to build the inference rules and Jess is used as an inference engine.The validation tests are done using 105 cases and the results of the classification functions show that the system has high level of validity.The model achieves more than 75% of PPV, NPV, and accuracy; while it www.ijacsa.thesai.orgachieves 83% in sensitivity function.To make the system usable even more easily, a web application is going to be constructed as a future work and to link the system with the data base systems that are pre-prepared by the hospitals to increase the accuracy of the system and to get benefit of previous information stored for each patient.

Fig. 2 .
Fig. 2. Bayes-TOVE 1) Motivation In the motivation stage, the requirement of the system should be set either as questions, story problem, or examples.The motivation scenarios of our proposed Ontology are: a) The lack of ES that can be used in the emergency units to diagnose heart failure or deal with patients already diagnosed to have the disease.b)Since heart failure should be diagnosed fast and since its symptoms are similar to other diseases, the things that make the practitioners get confused in the diagnosing process.c) Patients with heart failure and are in emergency room should be treated taking into consideration the existing disease and the new symptoms that require them to be entered in emergency unit.d)When a patient get entered to an emergency room, she or her carer may not get all the information that are required in the diagnosing process such as laboratory and clinical test results.This led to use BN to represent some uncertain or missing variables.2) Uncertain Informal Competency QuestionsIn this stage the motivation scenario is changed into informal competency queries that the ontology should answer.The resultant queries provide a clear idea about the new designed ontology and represent the first evaluation step to determine the importance of the ontology and if it can be replaced by existing ones[27].Some of the informal questions of our system are: a) Does the patient already diagnosed to have a heart failure?b) If the answer to question1 is yes, then:  What are the results of the patient's laboratory test results? What drugs are taking by the patient? What are the new symptoms? Does the new symptoms relate to heart failure? If the patient requires new drug, what are the conflict effects with the current drugs. What treatment should be taken?c) If the answer to question1 is no, then:  What are the patient's symptoms? What are the similarities between the existing symptom and the heart failure symptoms?

Fig. 4 .
Fig. 4. Sample of OWL classes, data properties, and object properties for the ES

Fig. 6 .
Fig. 6.Sample of SWRL rules used in the ES The rule engine used was Java Expert System Shell (jess), a small, light, and one of the fastest rule engines available [31].It is a powerful program developed by one of the team members at Sandia Laboratories in Canada.Netica API [32]

TABLE I .
ACHIEVEMENT FACTORS OF TESTING THE ES