In this research, a new multilayered mamdani fuzzy inference system (Ml-MFIS) is proposed to diagnose hepatitis B. The proposed automated diagnosis of hepatitis B using multilayer mamdani fuzzy inference system (ADHB-ML-MFIS) expert system can classify the different stages of hepatitis B such as no hepatitis, acute HBV, or chronic HBV. The expert system has two input variables at layer I and seven input variables at layer II. At layer I, input variables are ALT and AST that detect the output condition of the liver to be normal or to have hepatitis or infection and/or other problems. The further input variables at layer II are HBsAg, anti-HBsAg, anti-HBcAg, anti-HBcAg-IgM, HBeAg, anti-HBeAg, and HBV-DNA that determine the output condition of hepatitis such as no hepatitis, acute hepatitis, or chronic hepatitis and other reasons that arise due to enzyme vaccination or due to previous hepatitis infection. This paper presents an analysis of the results accurately using the proposed ADHB-ML-MFIS expert system to model the complex hepatitis B processes with the medical expert opinion that is collected from the Pathology Department of Shalamar Hospital, Lahore, Pakistan. The overall accuracy of the proposed ADHB-ML-MFIS expert system is 92.2%.

1. Introduction

Disease analysis is a crucial element in the field of medicine and healthcare. An inappropriate analysis of a disease often results in improper treatment that leads to complications of the ailment and eventually to death [1]. What are the major signs and symptoms of the disease and its extent or degree of symptoms on the organs? When this is resolved, suitable treatment can be administered to lighten the pains. To perform this efficiently at the right time is complicated and needs much knowledge about the disease and history of the patient. It is essential to analyze the disease at the right time and report its conditions. As hepatitis is a liver infection disease, it may cause death if not diagnosed at the right time. These are various symptoms for an abnormal liver. The cause of hepatitis B includes the use of addictive drugs, continuous use of alcohol and medicines, smoking, sharing of daily use utensils with an infected person, blood transfusion, sexual contact with infected person, etc. It is common in areas where the system of sanitation is absent and blood transfusion without proper protection is being performed [2]. Many approaches for analysis have been explored. Some of those are crucial physical examination, liver tests, ultrasound, liver biopsy, blood tests, etc. Different blood tests are conducted for hepatitis B. After the test of ALT [13] and AST, the major test is hepatitis B surface antigen (HBsAg) [12, 18]. If the HBsAg test result is positive, then other tests such as anti-HBsAg, anti-HBcAg, anti-HBcAg-IgM, HBeAg, anti-HBeAg, and HBV-DNA [17] must be conducted to check the level of hepatitis. If chronic hepatitis is severe, it causes health issues. It can be classified into five phases: (i) HBeAg-positive chronic infection, (ii) HBeAg-positive chronic hepatitis, (iii) HBeAg-negative chronic infection, (iv) HBeAg-negative chronic hepatitis, and (v) HBsAg-negative phase [13]. Hepatitis-B virus (HBV) infection is still a problem for global public health with substantial morbidity and mortality [1316]. If HBsAg is negative, then there are very fewer chances of HBV. Sometimes HBsAg is negative and anti-HBsAg (HBsAb) values are more than the cutoff values due to some previous vaccination. This results in no-hepatitis B state. In anti-HBcAg, anti-HBsAg is positive with negative HBsAg which is due to the previous recovered HBV attack. For acute hepatitis B, the HBsAg and anti-HBcAg-IgM must be positive. If the test results of HBsAg and anti-HBcAg are positive and anti-HBsAg and anti-HBcAg-IgM are negative, it results in chronic hepatitis B. The proposed ADHB-ML-MFIS expert system is based on these test results. There are different data analysis techniques, and some of them are based on machine learning, statistics, data abstraction, decision support system, and expert system [3]. Expert system techniques have been used in last few years in medical analysis. They increase the diagnostic accuracy and decrease the costs [4].

In all over the world, last-stage liver infection is a major source of morbidity and death [17]. In 2015, according to the World Health Organization (WHO), 1.34 million deaths were occurred due to hepatitis and 257 million people were infected with HBV worldwide [18]. In 2016, the WHO reported that approximately 240 million people had chronic hepatitis B virus infection from all over the world [19].

At present, artificial intelligence is being used to diagnose different kinds of medical problems. Intelligent systems are being developed to resolve the medicals issues [5]. Fuzzy inference system is the very powerful expert system to analyze the problems and provide their solutions. FIS is very useful where chances of uncertainty may occur. It is used in every filed of life such as automatic robotics, industries, computer sciences, medical systems, weather forecasting, agriculture, and so on. Neshat et al. presented a fuzzy system for the analysis and diagnosis of liver disorders [4]. Obot and Udoh diagnosed hepatitis using the fuzzy inference system on the basis of symptoms such as vomiting, body weakness, nausea, bile in urine, loss of appetite, jaundice, etc. [6]. Lancaster introduced a medical device on the basis of fuzzy logic control (FLC). FLC is used for managing the controller that employs air stress of human skin, and to manage it, alarm was used [7]. Rana and Sedamkar designed an expert system for medical diagnosis using the fuzzy logic inference system [8]. Adeli et al. discussed and diagnosed hepatitis in their research. They introduced “New Hybrid Hepatitis Diagnosis System Based on Genetic Algorithm and Adaptive Network Fuzzy Inference System” [9]. Dagar et al. introduced a FIS to diagnose various diseases based on initial symptoms [10]. Umoh and Ntekop proposed an expert system using the FIS to diagnose and monitor cholera [11].

2. Methods

Our proposed automated diagnosis hepatitis B (ADHB) multilayered mamdani fuzzy inference system- (MFIS-) based expert system (ADHB-ML-MFIS ES) is explained in this section. Figure 1 shows the flow of the proposed ADHB-ML-MFIS expert system methodology.

The ADHB-ML-MFIS expert system consists of two layers as shown in Figure 2. In layer I, hepatitis is diagnosed (No/Yes) using two input variables, alanine aminotransferase (ALT) and aspartate aminotransferase (AST), as shown in Figure 2.

The value of ALT and AST are also used to build up a lookup table given in Table 1 to evaluate the status of hepatitis. If layer I diagnoses hepatitis, then layer II is active. Layer II diagnoses the stage of HB based on the seven input variables as shown in Figure 2. Layer II input variables are shown in Table 2.

The layer I of the proposed ADHB-ML-MFIS expert system can be mathematically written asand the layer II of the proposed ADHB-ML-MFIS expert system can be expressed as

2.1. Input Variables

Fuzzy input variables are statistical values that are used to diagnose hepatitis B. In this search, a total of nine different types of input variables are used on both layers. Two variables are used at layer I, and rest of the variables are used at layer II. The details of these input variables with their ranges are shown in Tables 1 and 2.

2.2. Output Variables

In this search, multilayered architecture is proposed to diagnose hepatitis B. If the layer I output is yes, then layer II is activated. Output variables for both layers are shown in Table 3.

2.3. Membership Functions

The membership function of this system gives curve values between 0 and 1 and also provides a mathematical function that offers statistical values of input and output variables. Graphical and mathematical representations of the proposed ADHB-ML-MFIS expert system member functions of I/O variables of both layers are shown in Table 4. These MFs are developed after discussion with medical experts from Pathology Department, Shalamar Hospital, Lahore, Pakistan.

2.4. Lookup Table

The lookup table for the proposed ADHB-ML-MFIS-based expert system contains 50 input-output rules. A few of them are shown in Table 5. This lookup table is developed with the help of medical experts from Pathology Department of Shalamar Hospital, Lahore, Pakistan.

2.5. I/O Rules

They play a critical role in any fuzzy inference system (FIS). The performance of any expert system depends upon these rules. In this research, I/O rules are developed using a lookup table as shown in Table 6. Proposed I/O rule based on the ADHB-ML-MFIS expert system is shown in Figures 3 and 4.

2.6. Inference Engine

Inference engine is one of the core components of any expert system. In this research, Mamdani inference engine is used in both layers.

2.7. Defuzzifier

Defuzzifier is one of the critical components of an expert system. There are different types of defuzzifiers. In this research, a centroid-type defuzzifier is used. Figure 5 shows the defuzzifier graphical representation of layer I in the ADHB-ML-MFIS expert system. In Figures 6(a)6(d), the graphical representations of the defuzzifier at the layer II ADHB-ML-MFIS expert system is presented.

In Figure 5, diagnoses of hepatitis using probability are based on two input parameters ALT and AST. If the values of ALT and AST are elevated and ALT level is higher than the AST level, then there is 80% chance for hepatitis to occur. In this case, more than 80 % chances of hepatitis are present. Our system diagnoses hepatitis. It is also observed that if the AST level is higher than the ALT level, then there is fair chance for hepatitis to occur. If both values of ALT and AST are in the normal range, then it means no hepatitis.

Figure 6(a) shows hepatitis B (regarding probability) based on HBsAg and anti-HBsAg. Different colours in the surface region present the stages of hepatitis. It is also observed that if anti-HBsAg (x-axis) is negative (equivalent mathematically lies between 2 and 10 IU/L) and HBsAg (y-axis) is less than 0.8, then the probability of hepatitis B (z-axis) is 0; that is, it may be any other type of hepatitis. It is also observed that if costs of anti-HBsAg is more the 10 IU/L its mean positive, amounts of HBsAg is less the 0.8, and the value of hepatitis is 80% which is due to vaccination or some previous infection.

Similarly, remaining Figures 6(b)6(d) present hepatitis B results by prevailing different input parameter values. The surface region represents probability values by two input variables from the given seven input variables. The hepatitis B results are the combination of at least three input variables.

3. Results

For simulation results, MATLAB R2017a tool is used. MATLAB is also used for modelling, simulation, algorithm development, prototyping, and many other fields. MATLAB is an efficient tool for programming, data analysis, visualization, and computing. For simulation results, nine inputs and one output DHB variables are used. When results of layer I show hepatitis, there can be different types of hepatitis such as hepatitis A, B, C, D, and E. In this research, the proposed ADHB-ML-MFIS-based expert system not only diagnosed hepatitis B but also showed the different levels of hepatitis B such as acute, chronic, etc. But if layer I diagnoses hepatitis and layer II diagnoses no hepatitis B, its means that it may contain other types of hepatitis. Figures 7(a)7(c) show the performance of the proposed ADHB-ML-MFIS expert system at layer I.

Figure 7(a) shows that if the values ALT and AST are in the normal range, then there is no hepatitis or other infections. Figure 7(b) shows that if the values of AST are greater than ALT, then the elevation may be due to alcohol or any other problem. Figure 7(c) shows the high cost of ALT as it is more elevated than AST showing hepatitis.

Table 6 shows the accuracy of the proposed ADHB-ML-MFIS expert system in comparison with Medical Human expert of Shalamar Hospital, Lahore, Pakistan. The efficiency of the proposed method is randomly checked on 52 records. The standard unit of anti-HBsAg and HBV-DNA is IU/L; during simulation in most cases, we considered their values are 20 IU/L. The proposed DHB-ML-MFIS expert system provides the accurate results for all costs, and only at borderline it may achieve some minor errors.

Figure 8 shows the precision of the proposed ADHB-ML-MFIS expert system in the form of probability of all output cases. The last column produces an overall efficiency of the proposed ADHB-ML-MFIS expert system which is 92.2%.

4. Conclusion and Future Work

The primary focus of our research was to design an expert system to diagnose hepatitis B by ELISA blood test reports taken from Pathology Department of Shalamar Hospital, Lahore, Pakistan. The proposed expert system is elementary and easy to use for both medical and nonmedical professionals. A common man can also diagnose the status of hepatitis by providing required inputs. The primary objective of this research is to diagnose the different levels of hepatitis B. The overall precision of the proposed DHB-ML-MFIS expert system is 92.2%. In future, the efficiency of the proposed system can be improved using other techniques including computational intelligence such as neural network and neurofuzzy systems. This research work can be extended to others types of hepatitis such as A, C, D, and E.

Data Availability

The clinical/patient data used to support the findings of this study are restricted by the Shalamar Hospital, Lahore, Pakistan, in order to maintain patient privacy. The simulation files/data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this article.


The authors would like to express their deepest gratitude to Mrs. Niala Naz from UOL for the helpful suggestions during data collection and result interpretation.