An Ontology-Driven IoT based Healthcare Formalism

The recent developments in the Internet of Things (IoT) paradigms have significantly influenced human life, which made their lives much more comfortable, secure and relaxed. With the remarkable upsurge of the smart systems and applications, people are becoming addicted to using these devices and having many dependencies on them. With the advent of modern smart healthcare systems, and significant advancements in IoT enabled technologies have facilitated patients and physicians to be connected in real-time for providing healthcare services whenever and wherever needed. These systems often consist of tiny sensors and usually run on smart devices using mobile applications. However, these systems become even more challenging when there is a need to take intelligent decision making dynamically in a highly decentralized environment. In this paper, we propose a BeliefDesire-Intention (BDI) based multi-agent formalism for ontology-driven healthcare systems that perform BDI based reasoning to take intelligent decision making dynamically in order to achieve the desired goals. We illustrate the use of the proposed approach using a simple case study with the prototypal implementation of heart monitoring applications. Keywords—Internet of Things; BDI reasoning agents; ontology; smart healthcare


I. INTRODUCTION
Recent years have witnessed rapid advances in the smart systems" development with the incorporation of IoT paradigms in the ubiquitous computing environment. IoT is a network of interconnected devices/sensors that enable the systems to share their collected data and process information in order to achieve a common goal. IoT follows certain protocols for communication with the availability of the internet in accessing real-time device data and remote management of the system. In recent years, a significant amount of literature has revealed numerous kinds of smart systems and applications in various domains, more specifically, in healthcare systems, supply chain management systems, telemedicine, security systems, and in safety-critical systems, etc. IoT based healthcare systems and applications have a huge impact on the urban areas where there is an increasing dependency on these devices because elderly people mostly stay alone in their homes. According to research in [1], it is indicated that around 89% of elderly people likely to stay home alone and it is expected to rise by 22% (2 billion population approximately) by 2050. Chronic diseases are the diseases people suffer from, for a very long time. These diseases become more fatal to the person with age. Elderly people who usually stay alone are more affected by such chronic diseases as compared to those who stay with their caregivers. The rapid proliferation of IoT based healthcare solutions mostly consists of smarter, lightweight sensor/embedded sensors attached to comfortable wearable devices to monitor the patient"s health and diagnose them accordingly. Using this mechanism, raw data is acquired by the sensors and then these systems compute the data to infer the derived results based on the provided facts from the sensors. However, the ability of data acquisition and analysis of the results could become troublesome in generating the desired results due to inadequate working on framework developments and poor applicability of the system. These systems often exhibit self-adaptive behavior in nature, mostly interact with users autonomously, run in a highly decentralized environment and can naturally be implemented as multi-agent systems. An agent is a piece of software that acquires information from the sensor/environment, perform reasoning, exchange information to/from other agents and infer the desired goals. An agent can be pro-active, reactive and has the capability to take decisions autonomously [2][3] [4]. Multi-agent systems use different reasoning techniques to develop smart healthcare systems. Among others, BDI (Belief-Desire-Intention) based reasoning is considered to be most optimistic approach due to its simplistic nature and the usage of folk psychological notions which corresponds to the human behavior as human think, plan and make an intention to meet his/her desired goals [5]. In literature, numerous IoT based healthcare systems are available. There are quite few IoT based frameworks available which acquire and process ontology-driven information. However, such healthcare frameworks incorporating BDI based reasoning are still lacking and having a thirsty area of research. In this paper, we present a semantic knowledgebased healthcare formalism using BDI reasoning agents to develop an intelligent decision support system. Our proposed solution to this dilemma is the proposed framework which gathers information of the patient using different sensors and agents and if any abnormality is detected, sends the relevant data to the medical server. We construct an ontology for modelling the domain which represents the overall structure of the system and the data being collected, while BDI-based reasoning is performed in order to achieve the desired results. We develop a heart monitoring application for the prototypal implementation of the proposed system.
The rest of the paper is structured as follows. In Section II, we present the related work. Section III presents BDI reasoning based smart healthcare formalism. Section IV discusses contextual modeling using ontology. Section V www.ijacsa.thesai.org provides the architecture of the proposed framework. Section VI presents the case study for the prototypal implementation of the system and finally concludes in Section VII.

II. RELATED WORK
Literature has revealed a significant amount of work on IoT based systems and applications in different domains of computer science, more specifically, using mobile application development, Raspberry Pi and Arduino frameworks. A majority of such applications acquire information from different sensors, cameras and other devices/agents, and provide assisted support dynamically according to the given situation. In the case of safety-critical systems, these systems detect hazardous situations and take decisions intelligently. For example; authors in [6] claimed that health-monitoring devices offered a great solution for those patients who could not visit their doctors regularly. The sensors in these healthcare monitoring devices are intelligent enough and have the capabilities to detect any abnormalities and cope up with the situation accordingly. In the healthcare episode-based scenario, there are usually eight stages of interaction among patients and doctors. The framework proposed in [6] reduces these stages by allowing patients to be monitored from the comfort of their home, where agents can help the situation and interact with patients and doctors in case of an emergency. Moreover, agents can advise the patient about his/her situation and can allow the patient to directly contact the doctor by sending the query of patient"s health and answering questions such as, whether the visit is important under the current health situation or not, if certain medications need to be continued or not, etc. In [7], the authors discussed that in WSN applications, the agent-based approach is important in terms of dynamic and goal-based decisions. WSN has characteristics like physical distribution, resource boundedness, information uncertainty, large scale, decentralized control and adaptiveness. Such properties can be shared and handled by multi-agents to achieve better results in scalability, decentralized control, resource-aware and situation-aware scenarios. In [8], the authors had a similar concept of using intelligent agents with healthcare technology in order to provide a better life for patients and reduce the expenses of hospital visitation when it"s not compulsory. The usage of agents helped the patients to monitor their vital signs by themselves with the help of intelligent agents [9][10] [11]. In [12], the authors discussed the usage of agents with WSN in healthcare. They concluded that using intelligent agents in healthcare applications greatly enhances the data processing stage. The authors also concluded that intelligent agents are very suitable in such applications due to their ability to adapt according to dynamic environments and reach a conclusion based on dynamic data.
In [13], the authors introduced an ontology-based approach, called the Medical Decision Support System (MDSS) which collects most relevant information of the user by providing a personalized questionnaire according to the patient profile and then provides the patients with customized advice. In [14], the authors produced a system based on a formal ontology that integrates patient information and alerts data retrieved from electronic health records in order to classify the importance of alerts. This can be very helpful when a huge number of alerts are generated and sent to the physicians, which makes it very difficult for the physicians to manage all these alerts simultaneously. In [15] the authors produced an Information Gathering System (IGS) that collects the most relevant information related to the patient which improves the classical approach by customizing the interview with each patient by providing a questionnaire that is driven by a domain ontology. The proposed system is complex in nature due to the continuous collection and processing of data by the sensors, the sharing of the data with the agents for reasoning, reaching a decision about the health of the patient and sharing this information with the patient"s doctor and caregiver. This level of complexity makes data handling a very tedious task prone to error. Thus, the ontology was developed to make performing this task easier. Using ontology makes the process of managing the acquired data very easy, as it allows proper structuring of the entire system, including all the agents involved and their collected data. In the proposed system, the agents involved are BDI-agents. These agents use the reasoning mechanism to perform reasoning in reaching an accurate decision about the condition of the patient and whether to inform the doctor and caregiver or not.

III. BDI REASONING BASED SMART HEALTHCARE
FORMALISM (BDI-SMARTHEALTH) In this section, we propose BDI reasoning based smart healthcare formalism which assists doctors and caregivers about health monitoring of the patients without any delay while the patient"s health is abnormal. The system consists of different agents which perform BDI reasoning in order to infer the desired goals. In the system, the proposed framework consists of three core layers:  Application layer  BDI based reasoning agents

 Ontology layer
The top layer is the application layer, which consists of an android application and its different interfaces, as shown in Fig. 1. The middle layer is the reasoning layer which consists of BDI-agents who use BDI-based reasoning to reach conclusions about situations. The lower ontology layer receives input from the data collected by the sensors, responsible for structuring and handling the acquired data. Fig. 1 provides an architecture of the proposed framework.

A. Ontology Layer
In this layer, ontology is developed to model the domain for data structuring. It is assumed that agents are getting contextual data from the sensors, which is stored in the ontology and then this contextual data is sent to BDI agents for performing reasoning on it. The desired results can be monitored on the application layer. 481 | P a g e www.ijacsa.thesai.org

B. BDI-Agent's Reasoning Layer
In this layer, multi-agent systems are involved with data acquisition, processing the data using BDI approach in order to reach the desired goals. These components are:

1) Sensors:
Sensors can be WBAN (wireless body area network), wearable sensors or any other physical sensors (camera, heat sensors, etc.) to collect the data from the environment and pass it further for processing. WBAN connects devices that monitor the situation of the person, such as heart rate, body temperature, body posture, etc., processes the information, stores and shares it [16]. Sensors used in the proposed work are:  Heart rate sensors: use to detect the pulse.
 Temperature sensor: use to detect body fever.
 GPS sensor: use to detect the location of the patient.
 Position sensor: to detect the patient"s position.
2) Connectivity: Sensors can transfer the data for processing and reasoning, whether the vital signs are normal or not? Sensors send the data using Wifi or Bluetooth connectivity to the mobile application or laptops which are called the connectors, who perform reasoning on the data and send it to the remote server where the physicians/ doctors can monitor the patient"s situation [17].
3) BDI-based reasoning: Sensors send the data using Wi-Fi or Bluetooth to the mobile application or other devices so that reasoning can be performed on the gathered data. When the data is sent to the connector, it performs reasoning mechanism in terms of its beliefs:  What was the measured heart rate?
 What should be the maximum/minimum heart rate level?
 What was the physical activity of the patient at the moment?
 What was the posture position of the patient?
These questions play vital role in reaching a conclusion about the condition of the patient, as there are numerous other factors like stress levels, age and gender that can have a direct effect on the heart rate of a person. If there is some abnormality in the acquired data, then the connector selects a plan according to its intention for coping up with the situation and alerts the nearest hospital (remote server) about the medical emergency.

4) Remote server:
Remote server or the medical care center is responsible for examining the patient"s condition from the received data and send the required help if needed. This permits the patients to stay outside of the hospitals while allowing the doctors to examine their daily routine and vital signs continuously. All the data gathered by the sensors is sent to the remote server, where the doctors can treat the patients whenever needed. 5) Storage: Cloud and other databases are used for storage purpose. On the connector side, the data is stored on mobile application databases, while on the remote side, the data is stored either on the cloud or in the system"s database.
6) Security: Security and privacy are major concerns when it comes to data transfer. In healthcare, it is the most important factor because sometimes the patient is not comfortable sharing his health status with anyone other than their doctors. The proposed application considers this concern www.ijacsa.thesai.org and uses the login/ sign up option for the patient, which gives only the patient the complete access to his own records, while on the medical care side, the login/sign-up option, allows doctors the complete access of only their own patients. Multiple cryptography algorithms like AES and DES can be used to secure the data being shared.

C. Application Layer
This layer gives access to the android application prototype developed for framework validity. Android studio is used for the development of the android application to ensure the availability of a major medical facility, monitoring of the heart rate, in especially the rural areas, which comprises 60.78% of the total area of Pakistan according to a survey 1 in year 2016 [18]. We propose a BDI reasoning based approach, by employing body temperature, heart rate monitoring, blood pressure, body position, and location sensors. These sensors send the collected data to agents for performing reasoning on it. The sharing of the alert message, in case of an emergency, is done by these agents by using smartphones. We chose smartphones and android operating system as the hardware and software respectively for our solution, owing to the fact that 68% of the users in Pakistan have android systems on their smartphones, according survey conducted in [19] [20], and also because, with the advent of the technological era, the availability and cost of smartphones with android system is decreasing with the launch of every new version of the Android operating system, resulting in the previous versions of the android operating systems to become more and more affordable for those belonging to low economic sector. This application allows its users to share their monitored heart rate with the medical experts via Whatsapp Messenger which is a cross-platform messaging and voice-over IP service owned by Facebook. The reason for choosing Whatsapp messenger is because until October 2018, it was ranked as one of the most popular mobile messaging application worldwide according to [21] and because of its end-to-end encryption feature, it is also secure and reliable, two very important non-functional requirements in any system, particularly when the system is responsible for saving and sharing critical data. A comprehensive elucidation of the steps involved in the working of the proposed android application is given below:  An unregistered user will first register in the application by providing his/her basic information, and will then be given an account which will include user"s e-mail and a password of the user"s choosing, which can be employed by the user for login purposes, every time he/she wishes to use the services provided by the android application.
 A registered user will enter the username and password, chosen by the user during registration, and then click the "login" button to login to the application.
 The sensors then start collecting and processing the data from their environment.
 If an anomaly occurs, this data is sent to the agent to perform further reasoning on the data. 1 www.tradingeconomics.com  The agents after receiving the data and performing reasoning on it, reach a conclusion about the current condition of the patient.
 This decision is then shared with the patient"s doctors and caregivers, with the help of the android application.
The doctors after receiving the data can draw a conclusion of the condition of the patient and prescribe him/her relevant measures for the improvement if necessary. The experts in this step reach a conclusion by keeping in mind the age of the patient, as with growing age, the heart rate may be affected more frequently during stress, which has become a growing issue in today"s society [22] explained further in Fig. 2. The decision reached by the experts also depends on the gender of the patient as the heart rate of women was determined to be higher than men, regardless of age [23] as explained in Fig. 3, therefore the conclusion reached by the expert may vary with the patient. Different interfaces have been developed for the Android application prototype of the proposed system to provide a better understanding of the application"s working. Due to space constraints, a few screenshots of the interfaces for such an application have been presented from Fig. 4-7. Fig. 4 represents the login page, where the registered user will enter his/her e-mail and password to gain access to the application. Fig. 5 depicts the heart-beat value, Fig. 7 shows the value after heart-beat values taken and all the monitored and saved data is saved in the database which can be seen in Fig. 8.
All the monitored and saved data is saved in the database which can be seen in Fig. 7.  (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 2, 2020 483 | P a g e www.ijacsa.thesai.org    IV. CONTEXT MODELLING USING ONTOLOGY Ontology is a formal specification of a conceptualization of the domain which consists of different concepts/classes with their predefined relationships. There are two different versions of ontology named OWL 1 (Web Ontology Language) and OWL 2 (Web Ontology Language). Each version of the ontology has its own sub-languages. Ontology has been used on the proposed framework to fetch the data from several sensors and store them in a structured and organized manner. Ontologies are a formal way of describing the taxonomies and relationship between the concepts, entities and data. The scene description of contextual heart rate monitoring is modeled using specified description logic languages to map into logical simulation shown in Fig. 8.

V. ARCHITECTURE DESIGN AND ALGO CALCULATION
This section shows the overall working of the reasoning mechanism of the proposed framework. In this step, the distances between two adjacent peaks are considered as the distance between the heartbeats. Knowing the average distance between two heartbeats, one can easily calculate the user"s pulse in beats per minute. The normal range at rest is between 60-100 beats per minute (bpm). The basic way to calculate the rate is by taking the duration between two peaks and dividing this duration into 60. Each peak corresponds to a www.ijacsa.thesai.org single heartbeat as shown in Fig. 9. The number of heartbeats and length of the measurement are all that is needed to calculate the heart rate. The resulting equation would be: Rate = 60/(peak interval).
For example, if the peak interval is 0.2 seconds then the heart rate is 60/0.2 = 300 bpm [24]. Fig. 10 shows the overall working of the reasoning mechanism of the proposed framework. Fig. 9. Heart Rate "Peaks".

A. General Scenario
To illustrate the use of the proposed formalism, we initially develop an ontology of smart healthcare systems. For this, we construct a simple example of a patient Charlie, a 60 years old male suffering from myocardial infarction. Charlie had a job in the city but has now retired. After retirement, his pension is not able to cover his living expenses in the city. Due to this reason, he has recently moved to a suburban rural part of the city. In this part of the city, the nearest medical facility (hospital) is 5 miles (8.05 km) away. Charlie has been suffering from myocardial infarction for more than 10 years. Myocardial infarction causes damage to the muscles of the heart due to interrupted blood flow because of a blood clot that develops in coronary arteries and can also occur if an artery suddenly narrows or spasms [25]. Because of this, he needs continuous monitoring of his vital signs, particularly his heart rate. Heart rate is directly related to body temperature. An increase in 10 bpm (beats per minute) occurs when the body temperature increases by even a single degree [26]. Heart rate also affects the blood pressure. When the blood pressure goes down, heart rate increases in an attempt to bring the blood pressure back to the normal level [27]. To provide Charlie with round-the-clock-care sensors are used. Some of these sensors, such as location sensors and body position sensor can be embedded in his house. Other sensors like heart rate monitor sensor, blood pressure sensor and body temperature sensor can be worn by Charlie. All these sensors transfer data to corresponding agents in a continuous manner and share information with other agents whenever needed and generate alerts, if required. Four agents are working in this system, namely, Heart-rate Agent (agent 1), Fever agent (agent 2) Position agent (agent 3) and GPS agent (agent 4). Agent 1 receives data from the heart rate sensor, Agent 2 receives data from the body temperature sensor, Agent 3 receives data from the body position sensor while agent 4 receives data from the location sensor. Each of these agents consists of Belief-Desire-Intention (BDI) reasoning, having a set of beliefs, intentions and goals. The proposed multi-agent system will be used in this scenario that is going to acquire the data from sensors.
 Heart-rate Agent (Agent 1): acquire heart rate, calculate the pulse data, and decide danger level.
 Fever agent (Agent 2): acquire body temperature from temperature sensors. Calculate temperature and decide danger level.  Tables I-IV give details about the inputs, beliefs, intentions, and goals of all four agents. www.ijacsa.thesai.org

B. Illustrative Example
Consider a scenario in which Charlie is sitting in his house reading a book, and he is being monitored by the healthcare system. Suddenly the heart rate monitoring sensor detects that Charlie"s heart rate has dropped considerably, all the way to 45 bpm, instead of remaining between the normal range of 60-100 bpm. The heart rate sensor alerts the heart rate agent (agent 1), about this anomaly. While this is happening, the fever sensor detects that Charlie"s body temperature has decreased to 34.5 °C, which is lower than the normal range of 36.5-37.0 °C. The fever sensor alerts the fever agent (agent 2), about this. Agent 1 and agent 2 communicate these pieces of information with each other and conclude that Charlie may be suffering from bradycardia, a major reason for myocardial infarction. However, to be more accurate agent 1 requests the position agent (agent 3) to provide him with Charlie"s current body position. Once agent 1 has received information that Charlie"s vital signs have gone beyond the specified ranges even though he is not doing any form of exertion, it becomes certain that Charlie is having a heart attack. After this, agent 1 requests a GPS agent (agent 4) to send Charlie"s accurate location. Once agent 4 sends this information after receiving it www.ijacsa.thesai.org from the GPS sensor, agent 1 sends all these details to the hospital as well as to Charlie"s caregiver by using the android application installed on Charlie"s phone. Charlie"s phone after receiving the alert of heart attack sends a message to Charlie"s emergency contact about Charlie"s current situation as well as the hospital/doctor. The hospital/doctor after receiving information about Charlie"s current situation reaches a conclusion about the treatment he should be given and notifies the ambulance service about Charlie"s location to rescue the patient as soon as possible.
VII. CONCLUSION AND FUTURE WORK In this paper, we present an ontology driven IoT based healthcare framework that uses BDI reasoning agents to develop an intelligent decision support system. The proposed solution can be suitable to provide health-care services to the patients living in far-off locales, where such facilities are not readily available. The proposed android application prototype allows automatically sharing the patient"s critical health-care data with their corresponding doctors and caregivers. This application also allows patients to have a way of knowing the acuteness of their condition at any given time by observing their previous medical records. In future work, we develop a logical framework for the development and deployment of a BDI reasoning based multi-agent system for the heterogeneous system. In addition, we shall add the feature in the application for an automatic comparison of the patient"s previous and current records.