Heart rate events classification via explainable fuzzy logic systems

ABSTRACT

. Heart rate classification (bpm-beat per minutes) Tachycardia, which is characterized as an atrial or ventricular rate of more than 100 beats per minute and may be physiological or pathological, is a frequent phenomenon [12]. At these levels, the heart is unable to efficiently pump oxygen-rich blood to the body. The two types of tachycardia are atrial tachycardia (upper heart chambers) and ventricular tachycardia (lower heart chambers) (ventricular tachycardia). Tachycardia may be caused by heart-related conditions such as high blood pressure (hypertension), emotional fatigue, or over intake of alcoholic or caffeinated beverages, among others.

Classification systems
The classification system involves categorizing and arranging lists of objects in a rational and useful manner. Additionally, any collection of objects may have several useful classification systems. Linnaean taxonomy (classifying living things) and Dewey decimal classification are two examples of well-known classification schemes (classifying non-fiction books). In this paper, a few classification algorithms are discussed in the following section.
An artificial neural network (ANN) is a kind of computer that uses artificial intelligence. It is focused on studies in living organisms' brains and nervous systems [13]. It is proper to fix the problem. ANN provide the potential to learn and model nonlinear and complex relationships. Menwhile, a well-known tool for a variety of data mining operations is the support vector machine (SVM). Outliner understanding, regression, and classification are also part of this. SVM [14] is a set of supervised learning approaches for classification and regression that are identical. SVM employs mathematical learning theory to discover a regularized hypothesis that closely fits the available evidence while avoiding overfitting. The decision tree is a tree structure that looks like a flowchart [15]. A test on an attribute is represented by each internal node in the decision tree. Each mark represents a test result, and each leaf node represents a class code. A decision tree can easily be converted into classification criteria.x.

Fuzzy logic systems
Since the class with the highest similarity [16], fuzzy logic is clear to grasp. The fuzzy logic algorithm can also be represented with little details. Aside from that, fuzzy logic will operate with any kind of input, whether it is imprecise, warped, or noisy. As shown in Figure 2, fuzzification, fuzzy inference, and defuzzification are central components of a fuzzy logic system. The following are the major phases in the FLS (fuzzy logic system) as shown in Figure 2: i) the fuzzification component converts each crisp input variable into a membership grade based on the membership functions defined; ii) the fuzzy reasoning method is then carried out by the inference engine, which employs the necessary fuzzy operators to produce the fuzzy collection that will be accumulated in the output variable; and iii) the defuzzification component uses a specific defuzzification process to produce the fuzzy collection that will be accumulated in the output variable. One of the most compelling reasons to use FLSs for machine modelling is that they use easy-to-understand linguistic variables and rules [8]. Furthermore, thanks to their linguistic modelling and estimated thinking skills, FLSs are good at capturing the scope of a wide variety of problems [17].

Fuzzy logic systems on medical application
Fuzzy logic plays an important part in some fields of medicine. Breast cancer [18], heart disease [19], [20], lung cancer [21], [22], liver [23], [24], and diabetes [25], [26] are only a few of the medical realms where fuzzy logic systems (FLSs) have been effectively implemented. In addition, the FLSs is useful for objective research in medical diagnosis \cite{greeda2018study}. In the medical field, fuzzy expert systems are used to learn knowledge, cope with inconsistencies, schedule care, provide advice, track and manage the structure, forecast parameters, and think artificially. The methodology used is presented along with the fundamentals of fuzzy logic and its application fields in the medical domain.

MEDICAL EXPERT ACQUISITION ON HEART RATE CLASSIFICATION
In FLS, fuzzy rules have been used as a primary way to express knowledge since they are more suitable and flexible than traditional IF-THEN rules. However, building a rule base, especially from human experts, is one of the most challenging tasks for FLSs [27]. This is due to the lack of a consistent system for designing fuzzy rules, especially where human experts are used. This section discusses the method for producing fuzzy logic rules from human experts, especially medical experts.
In this study, a mixed-mode approach, consisting of an interview and a survey, was used to gather actual information. This research includes an interview session with three medical experts. The survey on heart rate is then performed with medical experts.

Interview
The first medical expert is Dr. A, a medical officer. The second medical expert is Mrs B, a pharmacist. The third medical expert is Dr. C, a medical officer. All three medical experts are from Hospital Sultanah Maliha, Langkawi, Kedah. During a conversation with Dr. A, it was found that there was no difference in heart rate between men and women. To put it another way, all men and women have the same heart rate. During an interview with Mrs B, some symptoms of tachycardia and bradycardia were found. Intermittent heartbeats, blurred vision, palpitations, and chest pain are also symptoms of tachycardia. Fatigue, dizziness, and shortness of breath are all symptoms of bradycardia. In other words, there is a difference in signs between tachycardia and bradycardia. Finally, it was found during the consultation with Dr. C that the paediatrics group had a higher heart rate than the infants. In other words, the heart rhythms of children were lower than those of the public.

Survey
During this process, medical experts performed a heart rate survey. Five medical practitioners took part in the study. It's worth noting that three of the five medical professionals who took part in the interview was the same person. There are 36 questions in this survey. The results of this survey will be used to build the MATLAB rule base for this scheme. For example, in this survey, question 3 is depicted in Figure 3. . What would happen if the heart rate were slow, the age is young, and the fitness level is above average?

Capturing the rules from the experts
The aim of this section is to look at how to assess the rule base by looking at the survey results (from the previous section). Each survey query has the goal of obtaining the rule base for this study. We used the plurality of expert responses for each question to determine the result for each guideline. Figure 4 shows an example of question 1 from this survey. We may always receive a straightforward answer in order to obtain the result of the rules as shown in Figure 3. However, as shown in Figure 5, it is possible that expert responses will provide similar results for both options. In this case, we'll have to talk with another one of the five senior medical experts to get a clear answer to the issue.

DEVELOPMENT OF FUZZY LOGIC SYSTEMS-HEART RATE CLASSIFICATION
As previously said, this study used a fuzzy logic approach. In fuzzy logic, there are three steps for classifying heart-rate events, as shown in Figure 6. That is the phases of fuzzification, fuzzy inference, and defuzzification sub-chapters.

Define the fuzzification
Fuzzification is the first step of fuzzy logic. For all input variables, this step is used to set the fuzzy set. It implies the task of translating a crisp number to a series of fuzzy values. By assigning numerical values to the linguistic component, this is achieved. The input variable for this study would be all of the questions that were triggered in response to heart rate. In this step, the system's input and output variables as shown in Table 1 are specified and translated into linguistic variables. Table 2 demonstrate the input variables with their linguistic variables.
In this study, there are the aforementioned three inputs and one output in this system. The inputs are heart rate, age, and fitness level as shown in Table 2. The output is the heart rate type as shown in Table 1. The type of fuzzy inference system used in this study is the Mamdani inference system. Figure 7 shows the heart rate classification system on the MATLAB programme.  The heart rate values are the first key input in this study. Three membership functions were modelled for this variable input. That is, there are three types of membership functions: Slow, normal, and fast. This input variable's form of membership functions is also 'gaussmf'. The heart rate variable has a range Int J Artif Intell ISSN: 2252-8938 Heart rate events classification via explainable fuzzy logic systems (Anis Jannah Dahalan) 1041 of 40 to 220. The membership functions for the input variable heart rate are shown in Figure 8. Note that the same technique applies to all inputs, which will not be discussed in this paper due to page restrictions.
The output variable of the study is heart rate events. Similarly, there are three membership functions for this output variable: Bradycardia, regular, and tachycardia. The class of membership functions in this output variable is \emph{'trimf'}. The standards of exercise range from 0 to 4. Figure 9 shows the membership features for the results variable heart rate type.

Fuzzy inference system
Fuzzy inference is the second step of fuzzy logic. The method of mapping the input variables (as previously described) to the output variables is known as fuzzy inference. The heart identification with linguistics component is the study's performance, and it can be classified as bradycardia, normal, or tachycardia. The 'min' operator was used in this study. The conditional part of the law is merged using the min operator. That is, the membership value of the conclusion part is proportional to the lowest membership value of the condition parts. The study's fuzzy rule base is shown in Figure 10. There are 36 rule bases in this analysis. This rule base was created as a result of a survey of medical experts. This rule base includes the 'and' relationship.

Defuzzification
Defuzzification is the third level of fuzzy logic. Three methods can be used in the defuzzification phase: center of area (COA), center of sums (COS), and mean of maxima (MOM). However, only the center of area (COA) technique was used in the analysis. This is because the COA technique will measure the best equilibrium between several output linguistic words. During the defuzzification process, the output is shown using an \emph{evalfis()} in MATLAB as can be seen in Figure 11. There are three types of heart rate events: tachycardia, normal, and bradycardia. In this defuzzification step, the users' or patients' findings for this analysis are shown in Figure 11. Figure 11. Evaluating of fuzzy inference-heart rate classification events

DEMONSTRATION OF FUZZY LOGIC SYSTEM-GRAPHIC USER INTERFACE
We will illustrate the proposed design of a fuzzy system in this section. We use the MATLAB graphic user interface (GUI) to view all of the fuzzy components for classifying heart rate events in this example. As a result, the MATLAB GUI has five interfaces: a main menu, a diagnostic page, a research page, a result page, and a background page. Figure 12 depicts the MATLAB GUI's front screen. This page gives you a short rundown of the system. To put it another way, this page can be thought of as a system summary page. Figure 13 shows the MATLAB GUI's diagnostic tab. There are five requirements on this diagnosis list. The following information is required: user id, date, heart rate, age, and fitness level. The candidate must complete all five requirements. The participant must press the ''SUBMIT'' button after completing all the conditions.

GUI-results
The outcome page in the MATLAB GUI as shown in Figure 14. Participants' values from the previous page (diagnosis page) are immediately transferred to this page. Click the "result" button after the participant has verified that the value is the same as the previous page (diagnosis page). The answer will be shown on the page after the participant presses the button. The participants' results are dependent on the diagnosis page. On this tab, the outcome will be shown as bradycardia, regular, or tachycardia. A "fuzzy process" button is also available. A fuzzy logic scheme can be routed to this button. There's even a tab that says "explanation and suggestion". This button can be used to go to the page of explanations and suggestions.

GUI-explanation and suggestion
The definition and suggestion tab in the MATLAB GUI as shown in Figure 15(a). There are three different types of heart rate cases. The three types of heart rate incidents are bradycardia, mild, and tachycardia. Each type of heart rate occurrence has a button that takes you to the next tab.
The definition and suggestion for the bradycardia case, for example, as shown in Figure 15(b). This GUI shows basic information about bradycardia (slow heart rate). This GUI also tells the participant whether or not they should see a doctor. The GUI's aim is also to educate the participants about the situation. For instance, describe the symptoms that lead to this heart rate event.

PRELIMINARY EVALUATION ON EXPLAINABLE OF THE PROPOSED APPROACH
In this section, we conduct the preliminary assessment of the proposed fuzzy logic system. The best way to know whether the proposed system is understandable or explainable is by asking the people or the user that used the system [28]. We would like to specifically inquire about the users' understanding and usefulness of the proposed systems. Just ten medical practitioners participate (that knows about heart rate assessment) in the preliminary evaluation.

Assessing people perception on understanding of the fuzzy heart rate events system
This section tends to assess the people perception of the proposed system. Figure 16 shows a bar chart for the first question on the information provided is easy to understand. According to the survey, most participants comprising five out of ten participants equivalent to 50% agreed that the information provided in the system is easy to understand. This is because the developer uses simple words in the system so that the participants can easily understand, such as the use of linguistic variable of the fuzzy system is easy to grasp. Providentially, none of the participants preferred strongly disagree and disagrees that the information provided in the system is easy to understand. This means that none of the participants did understand the information in the system. Figure 17 depicts a bar chart illustrating whether it is simple to self-diagnose heart rate using the system rather than visiting a hospital or clinic. According to the poll, the majority of participants agreed that it is simple to do heart rate self-diagnosis across the system rather than going to a hospital or clinic, with seven out of ten participants (70%) agreeing. This is due to the fact that by using the system, participants should not have to wait for their turn to be diagnosed. In addition, two out of ten participants, or 20%, firmly accepted that self-diagnosing heart rate across the system is easier than going to a doctor or clinic. This is due to the fact that participants do not have to wait long to learn the outcome of their diagnosis.

Assessing usefulness of the proposed system
Eventually, one out of every ten people, or 1%, said it is simple to do heart rate self-diagnosis through the system rather than going to a doctor or clinic. This is due to the fact that the participant may believe that the system, as well as the hospital or clinic, are simple to diagnose. Fortunately, none of the participants wanted to firmly disagree or disagree that the system's knowledge is easy to understand. This suggests that none of the researchers accepted that using the device to self-diagnose heart rate is impossible.

CONCLUSION
In conclusion, we have described how to build explainable fuzzy systems for medical applications, specifically heart rate events classification. The method entails three steps: (i) classifying the medical expert's criteria for heart rate signs; (ii) designing an explainable fuzzy logic system for heart rate assessment; and (iii) examining the proposed system with human experts. Despite the fact that this is the initial step in the development, the proposed approach seems to be promising in terms of developing fuzzy systems for heart rate event classification, based on existing information from demonstration and preliminary evaluation. We would like to do further research into more complex medical applications, with a focus on developing a method for designing explainable fuzzy systems. We will also conduct testing with more medical professionals and public customers, resulting in a more understandable fuzzy system for medical applications.