Research Article
A Fuzzy Inference System for Diagnosis of Hypothyroidism
D.S.M. College, Parbhani, Maharashtra, India
R. P. Ambilwade
Vivekanand College, Aurangabad, India
The thyroid hormones deliver energy to cells of the body. Thyroid hormone is carried through the blood to every tissue in the body. Thyroid hormone is essential to help each cell in each tissue and organ to work right. Thyroid hormone helps the body use energy, stay warm and keep the brain, heart, muscles and other organs working as they should. The most common problem that occurs with thyroid is hypothyroidism (ATA, 2010). Hypothyroidism occurs when the thyroid gland produces too little thyroid hormone. When the thyroid gland is under-active, improperly formed at birth, surgically removed all or in part, or becomes incapable of producing enough thyroid hormone, a person is said to be hypothyroid. The most severe form of hypothyroidism is myxedema, which is a medical emergency. It may affect all body functions. The rate of metabolism slows causing mental and physical sluggishness (BTA, 2010). The symptoms of hypothyroidism are general and changing from one person to another. It includes dry skin, fatigue, loss of energy and memory problem. The detection of disease is difficult at early stage. The patient suffers a lot by getting a wrong treatment. A kind of uncertainty is involved in diagnosis of disease.
Fuzzy logic and fuzzy set theory exhibits immense potential for effective solving of the uncertainty in the problem. The application of fuzzy logic in medicine started in the early 70s, soon after the, paper published by Zadeh (1965). One of the most important areas of application of fuzzy set theory as developed by Zadeh is Fuzzy Rule-Based System (FRBS) also called Fuzzy Inference System (FIS) (Alayon et al., 2007). Fuzzy inference is the process of formulating the mapping from a given input to an output using fuzzy logic (Kwiatkowska, 2006). The mapping then provides a basis from which decisions can be made, or patterns discerned.
Several researchers have used fuzzy logic in medical diagnosis such as diagnosis of the pulmonary embolism (Serpen et al., 2000), cortical malformations (Alayon et al., 2007), rheumatic and pancreatic diseases (Moein et al., 2006), hepatitides (Moein et al., 2006) and diabetes (Soula et al., 1983; Turnin et al., 1992; Zahlmann et al., 1997).
Historically, two phases of general applications can be distinguished. Initially the fuzzy member functions were added to rule-based expert systems, the main data were numerical and the fuzzy sets were used to model medical terms and verbal expressions. The second phase can be characterized by various factors such as, new approaches to generation of membership functions using extraction techniques from data mining; processing of biomedical signals and images and, merging several AI techniques for knowledge representation and medical decision support (Hennessey and Scherger, 2007).
DESIGN OF FUZZY INFERENCE SYSTEM
The Fuzzy Inference System is a rule-based system where fuzzy logic is used as a tool for representing different forms of knowledge about a problem, as well as for modeling the interactions and relationships that exist between its variables (Alayon et al., 2007). The proposed fuzzy inference system is to be used for assisting Doctor in the diagnosis of hypothyroidism. The functions of this system are: first, to collect all information that is usually analyzed in these cases by the expert, second, to study the relations between the different considered factors and the possible hypothyroidism types and third, to offer an automated diagnostic aid. Rule-based systems have been successfully used to model human problem-solving activity and adaptive behavior, where the classical way to represent human knowledge is the use of if-then rules. The proposed system uses the Mamdani fuzzy inference system for implementation. Figure 1 shows the flow diagram of the system. The whole system is developed under the supervision of medical expert Dr. D.V. Rajurkar, Vyankatesh Hospital, Aurangabad, India during the period March 2008 to March 2010.
The proposed system consists of 3 input, 1 output and 18 rules and actual fuzzy inference diagram for the system is shown in Fig. 2. The present system is used for diagnose of hypothyroidism. The diagnosis is based on three input variables (1) SymptomScore expressed as a percentage of severity of symptoms, (2) T4 and (3) TSH are nothing but the values obtained from blood report of the patients. The system output is the actual diagnosis of the patient which gives the severity of the hypothyroidism which is divided into four types. The Knowledge base describing the systems behavior is represented by the membership functions designing the linguistic variables. Hence, for the proposed systems behavior, four linguistic variables are defined. Out of these four, three variables are input variables namely-SymptomScore, T4, TSH and one output variable called hypothyroidism. Fuzzifier unit computes the membership values of each input variable in accordance with the fuzzy values defined in the database. Inference engine interprets the rules combined in the rule base. The inference engine is performed in three steps, (1) antecedent activation, (2) implication and (3) aggregation. Finally, defuziffier converts the fuzzy output into crisp value using any defuzzification method.
Fig. 1: | Flow diagram of fuzzy inference system |
Fig. 2: | Block diagram of FIS |
Data collection: A form was designed to collect the patients symptoms. Figure 3 shows the form. Based on severity of symptoms, a symptom score is computed which is in the range of 0-100. Data of 45 patients from Aurangabad city of Maharashtra state, India are collected.
Fig. 3: | Patients symptoms check form |
MEMBERSHIP FUNCTIONS FOR INPUTS AND OUTPUT
The fuzzy variable SymptomScore has been represented using three fuzzy sets to classify the inputs given by:
• | Low risk: The range is between 0 to 30 |
• | Med risk: Fifteen to 65 is the range for MedRisk |
• | High risk: The range for this fuzzy set from 45 to 100 |
The shape of membership function used for this lowrisk and highrisk are of trapezoidal type and for med risk is of triangular type shown in Fig. 4.
The second input is the value of T4. This value can be directly obtained from the blood report of patient. Normally every pathological reports has some reference range, we called it as a normal. T4 also have reference range between 0.6 to 2.0 ng dL-1. If the value of T4 is below this range then it is termed as low. On the basis of this terminology, there are two membership functions for T4 namely low and normal as shown in Fig. 5.
The third input for the system is TSH. For this type of input three membership functions are chosen which is based on the reference range of TSH. (0.5 to 4.6 mlU mL-1). The membership function curve is shown in Fig. 6.
Fig. 4: | Membership function for symptom score |
Fig. 5: | Membership function for T4 |
Fig. 6: | Membership function for TSH |
The output variable is hypothyroidism which gives the diagnosis of patient which is nothing but the type of hypothyroidism. There are three classes of hypothyroidism namely subclinical, primary and secondary. NoHypo indicates normal. The range for this membership function is from 0 to 100. The fuzzy sets NoHypo and Secondary are of trapezoidal in shape and other two are of Triangular shape as in Fig. 7. The 4 classes and their ranges are defined by:
NoHypo | : | 0 to 20 |
Subclinical | : | 10 to 40 |
Primary | : | 25 to 65 |
Secondary | : | 50 to 100 |
Figure 7 shows membership function for output.
Every rule in fuzzy rule base system consists of rule antecedents (inputs) and rule consequents (output or result). Table 1 shows the rule antecedents and consequent for this system.
Fig. 7: | Membership function for output |
Table 1: | Rule antecedents and rule consequents |
Rule antecedent uses three input parameters symptom score, T4 and TSH along with their linguistic variables. Rule consequent gives output of Hypothyroidism category.
The first parameter is symptom score which gives the risk for developing hypothyroidism. There are three types of risks defined which are low risk, medium risk and high risk depending on the patients symptoms and its severity, family history, risk factors etc. Other two inputs which are useful for constructing rules are actual values of T4 and TSH. As every blood test has some specific range of values which we can map into normal, low, below normal, high, very high etc. These ranges indicate the severity of disease and/or percentage of that particular hormone. The importance of these ranges plays an important role in diagnosing the disease. We have considered the three values of TSH, i.e., low, normal and high, two for T4, i.e., low and normal. The output of the system is final diagnosis categorized into four categories Nohypo, subclinical, primary and secondary.
TESTING OF THE SYSTEM
About 45 patients data are collected and tested for results. As hypothyroidism is more prone to female patients, out of 45 patients 37 are female and remaining are males. Table 2 shows the data about all patients, its output obtained from the proposed FIS, which is nothing but a crisp value and diagnosis made by doctor.
Table 2: | Diagnosis of patient done by FIS and doctor |
Fig. 8: | Surface viewer diagram for inputs symptom score, T4and output |
Table 3: | Percentage of final diagnosis |
Figure 8 shows surface viewer diagram for inputs symptom score, T4 and output Hypothyroidism. It allows us to see output surface for the two inputs.
The impact on the variation in the output due to the input values of T4 and TSH can be observed in Fig. 9. It is the surface viewer diagram for inputs T4, TSH and output.
The performance of the FIS is given in Table 3. Observe that diagnosis made by FIS is compared with the diagnosis made by medical expert. Out of 45 patients FIS diagnosed 17 in the category of subclinical, 7 in primary, 14 in secondary and 7 in Nohypo. When compared with the classification to that of human medical expert, 88% accuracy is given by the system.
Medical diagnosis of Hypothyroidism is very critical considering uncertainty involved in symptoms. Particularly in India it is normally late diagnosed. Several researchers have attempted to develop medical diagnosis system for other diseases and have achieved accuracy up to 93%. But, no attempt is made for hypothyroidism. We are able to achieve accuracy up to 88%.
Fig. 9: | Surface viewer for inputs T4, TSH and output |
A medical diagnosis accuracy up to 83% is reported in earlier works (Moein et al., 2006). Our system has analyzed data of 45 patients in India. Out of 45 patients the FIS diagnosed 17 patients as Subcilincal (15 by doctor), 7 under primary category (6 by doctor) 14 are of secondary type (13 by doctor) and 7 are categorized as Nohypo (6 by doctor), i.e., normal. The average percentage of diagnosis made by doctor is 88.15% against the diagnosis made by the system. The secret of such fuzzy systems is that they are easy to implement, easy to maintain, robust and cheap.