Document Type : Original Research


1 PhD, Department of Statistics, Mathematics, and Computer Science, Allameh Tabataba’i University, Iran

2 PhD, Department of Biomedical Engineering, Standard Research Institute, Karaj, Iran



Background: Artificial intelligence plays an important role in medicine. Specially, expert systems can be designed for diagnosis of disease.
Objective: Artificial intelligence can be used for diagnosis of disease. This study proposes an expert system for diagnosis of Multiple Sclerosis based on clinical symptoms and demographic characteristics. Specially, it recommends patients to refer to a specialist for further investigation.
Material and Methods: In this empirical study, some symptoms of Multiple Sclerosis are mapped to fuzzy sets. Moreover, several rules are defined for prediction of Multiple Sclerosis. The fuzzy sets and rules form the knowledge base of the expert system. Patients enter their symptoms and demographic information via a user interface and Mamdani method is used in inference engine to produce the appropriate recommendation.
Results: The precision, recall, and F-measure are used as criteria to analyze the efficiency of the expert system. The results show that the designed expert system can recommend patients for further investigation as effective as specialists. Specially, while the proposed expert system recommended referring to a doctor for some healthy users, most of the MS patients are diagnosed.
Conclusion: The proposed expert system in this study can analyze the symptoms of patients to predict the Multiple Sclerosis disease. Therefore, it can investigate initial status of patients in a rapid and cost-effective manner. Moreover, this system can be applied in situations and places, which human experts are unavailable.



In most developing countries, inadequate medical experts and high cost of healthcare are the main problems of patients, suffering from various diseases. In some counties, accessing to the cheaper healthcare services is time-consuming; however, some disease should be treated as soon as possible due to the disease’s nature. Infectious diseases spread and death risks are some of the results of late treatment. Therefore, reducing the cost and initial treatment of the patient should be considered in healthcare system.

Multiple sclerosis (MS) is an unpredictable, often disabling disease related to the nervous system. Central nervous system (CNS) is damaged by MS disease and the cause is still unknown. In this disease, immune system attacks a material called Myelin (wraps around nerve fibers to protect them) and brain is not able to send signal through body appropriately.

MS disease can affect all parts of the body. Different parts of CNS can be damaged resulting to various symptoms. For example, peripheral nerves in kidney may cause abnormal condition in kidney. This disease should be diagnosed as soon as possible due to its potential danger. Symptoms and signs of this disease can be used to decide whether the patient should refer to a doctor or not. Moreover, specialist can benefit from these symptoms to diagnose the patients.

Uncertainty is the inherent nature in the diagnosis of the disease [ 1 ]. In the diagnosis of disease, there several uncertain variables, which make the diagnosis process complex. This uncertainty relates to the inexact observations and feelings of patients. For example, when a user is asked about his/her weakness, sometimes he/she is not certain about his/her answer. Thus, answers such as “somewhat” can be seen in many situations.

Over the years, artificial intelligence methods and techniques have been applied in medical domain to improve the efficiency of the diagnosis, controlling, analysis, and monitoring. Fuzzy logic is one of the branches, which can handle the uncertainty and linguistic ambiguity. Besides, expert system is a computer system which has the decision making ability of a human expert [ 2 ]. It employs human knowledge to solve problems, which need human expertise. In expert systems, users interact with the applications to solve problems or receive recommendations.

Expert systems have been applied in various domains such as medical applications. MYCIN was one of early rule-based expert systems designed for diagnosing blood infections. Some of the expert systems are designed for diagnosis or decision support [ 3 , 4 ]. They have been applied for diagnosing heart attack [ 5 ], Meningitis [ 6 ], iron deficiency anemia [ 7 ], depression [ 8 ], periodontal disease [ 9 ], multiple sclerosis disease [ 10 ], Uveitis [ 11 ], coronary artery disease screening [ 12 ].

Regarding to the importance of treatment and diagnosis of MS disease, this paper presents an expert system, which is able to evaluate the symptoms and signs of the patients suffering from MS. Patients enter their symptoms and signs and the designed system can recommend them to refer to a doctor. Many patients underestimate their symptoms, which may result to disabling conditions. Therefore, this system can provide recommendations reducing the potential danger. Therefore, early and cheap investigation is beneficial for many patients. Moreover, the output of the proposed expert system as a consultation system gives guidance for doctors to understand the current state of the MS patients. Based on the output the expert system, unnecessary tests can be avoided or doctors can prescribe other related tests such as MRI test. In this paper, we designed a fuzzy expert system (FESMS) to handle uncertainty and analyze patients’ symptoms related to MS disease.

Material and Methods

Fuzzy logic

In this empirical study, Fuzzy logic can handle uncertainties in various domains. One of the areas which fuzzy logic can be applied is medical diagnosis. In fuzzy set theory, linguistic terms, symbolic and numerical values are mapped to each other [ 13 ]. Fuzzy variables and fuzzy sets are two main parts of the fuzzy logic representing linguistic terms and their ranges, respectively. Finally, defuzzification process returns a crisp value as an output.

Fuzzy set A is represented as follows:

A = { ( x, µA(x) ) | Є X }

Where µA(x) is called the membership function for the fuzzy set A. X is referred to as the universe of discourse. The membership function associates each element x Є X with a value in the interval [0, 1].

Fuzzy set qualifiers and operators play an important role in fuzzy logic. Fuzzy set qualifiers called Hedges are applied to modify the shape of fuzzy sets. Some of these hedges are defined as follows:

Very = [ μA ( x ) ] 2

Extremely = [ μA ( x ) ] 3

Dilatation = [ μA ( x ) ] 3

Fuzzy logic operators used in this paper are used to combine various variables in rules. They include:


µ A∪B ( x ) = max ( µ A ( x ) , µ B ( x ) ) = µ A ( x ) ∪ µ B ( x ) (1)


µ A∩B ( x ) = min ( µ A ( x ) , µ B ( x ) ) = µ A ( x ) ∩ µ B ( x ) (2)


µ A ( x ) = 1 - µ A ( x ) (3)

Defuzzification step calculates the output based on input fuzzy sets and rules. It can be done in several ways:

- Center of sums method

- Center of gravity

- Center of area

- Weighted average method

- Maxima methods

Center of gravity is one the widely used methods in this step and is calculated using formula (4):

∑ i=1 n x i * µ ( x i ) ∑ i=1 n µ ( x i ) (4)

Where xi indicates the sample element, µ ( x i ) is the membership function, and n represents the number of elements in the sample.

Expert system

Expert systems consist of three main parts: long-term memory, short-term memory, an inference engine and possibly a user interface. The long-term memory contains the knowledge base which can be acquired from domain experts and related corpus. The short-term memory contains the facts presented by the end users and conclusions obtained by inference engine. Inference engine is the core of expert system, which processes the knowledge, facts and logical rules. The output of the inference engine can be used for decision-making, guidance, diagnosis, monitoring.

Architecture of FESMS

The main technical goal of this work is to analyze the symptoms and demographic characteristics of potential MS patients. The architecture of the designed system is shown in Figure 1. This system is implemented in MATLAB environment.

Figure 1. Architecture of the fuzzy expert system (FESMS)

Knowledge base contains the MS related knowledge, which the experts have, and the symptoms and their effects on disease diagnose. We benefit from Clinically Isolated Syndrome (CIS) as a basis of knowledge base which is a term that describes the first clinical status of a disease showing characteristics of inflammatory demyelination that could be MS, but has yet to fulfill criteria of dissemination in time [ 14 ]. Moreover, CIS is often used in the first step to in MS diagnosis. The most common presentation for clinically definite MS include three categories [ 15 ].

1. Optic neuritis

A common symptom of MS is optic neuritis which is usually appears in one eye. This symptom has been present in 17% and 8% of African-Americans and Caucasians, respectively [ 16 ]. Therefore, optic neuritis is one of the main symptoms for MS prediction. It includes various signs such as eye movement with pain, and loss of color vision.

2. Brainstem

Brain stem has the task of controlling messages between brain and other parts. It includes signs such as Ataxia, Vertigo.

3. Spinal cord

Spinal cord connects the brain and peripheral nervous system. Signs such as asymmetric limb weakness, and incomplete transverse myelitis belong to this category.

In this paper, we have used first clinical presentations that mostly have been seen in MS patients. In this manner, optic neuritis and myelitis were the most frequent seen signs in MS patients [ 17 ]. Moreover, demographic characteristics, including gender, and age have been considered in disease diagnosis. These variables constitute part of the knowledge base.

As an example, fuzzy set related to age and unilateral reduced visual acuity are shown in Figures 2 and 3, respectively.

Figure 2. Age fuzzy set

Figure 3. Unilateral reduced visual acuity fuzzy set.

Rules are the other part of the knowledge base of expert system, deciding about the effect of variables on MS disease.

The knowledge base of MS diagnosis comprises the following fuzzy rules:

If X1 is A11 and ... and Xm is A1m then Y is B1

If X1 is An1 and ... and Xm is Anm then Y is Bn

Which xi represents the observed symptoms, Aij and Bi are fuzzy sets belong to symptoms and MS disease, respectively.

In each rule, a symptom can be present (or not). Presence of demographic information, a symptom or a sign can affect the conclusion of a rule. For example, females are more likely to get MS disease compared with males.

Some of the rules are shown in Figure 4. For instance, the knowledge base includes the following rules:

If age is adult and gender is female and unilateral reduced visual is high then MS is very high.

If age is adult and gender is male and unilateral reduced visual is high then MS is high.

Figure 4. Rules definition.

The next component of the designed expert system is inference engine. This component has the task of processing the patients’ symptoms, fuzzy sets, and rules. Mamdani inference method is used in this system to produce the recommendations. In this system, the used method in defuzzification step is center of gravity presented in formula (4). As an example that is shown in Figure 5, the output MS=67.3 is created recommending to the patient to have a consultation with doctor (greater values than 25 are recommended for more investigation).

Figure 5. An example of inference based on user’s input

Users provide their information, including symptoms using a user interface component and the recommendations are also displayed in it.


We have conducted an experiment to evaluate the performance of the FESMS system. In this experiment, users are asked to enter their symptoms, signs and demographic information. Regarding to the provided information, several rules are fired. FESMS is used to produce the prediction.

We asked from 30 patients (who were referring to the MS specialist for the first time) to provide the needed information (symptoms). The output of the expert system may recommend them to track their potential MS disease or not. We stored the recommendations in a database and then compared the recommendations with final diagnosis results. The final results are acquired by normal treatments and tests such as MRI. The results of final diagnosis and recommendations are shown in Table 1.

Final Diagnosis FESMS Recommendation
All patients 30 30
Positive 12 19
Negative 18 11
FESMS: Fuzzy expert system
Table 1.Final diagnosis vs expert system recommendations.

Results show that the designed expert system has recommended to 91.66% MS patients to refer to a doctor resulting to high recall. This means that the expert system effectively diagnosed MS patients. By contrast, among 19 positive recommendations, only 11 had the disease resulting to near 58% precision.

Moreover, we asked the doctors to present their initial opinion based on the symptoms and observations (before MRI test). Finally, we compared the output of the expert system with the initial opinions. The comparison is shown in Table 2. Results show that the efficiency of the expert system is close to the real expert (doctor). This closeness is one of the goals of expert systems to be applied instead of experts. This means that patients can use FESMS effectively to get initial recommendations.

Initial doctor opinion (%) FESMS (%)
Precision 62.50 57.89
Recall 83.33 91.66
F-measure 71.42 70.96
FESMS: Fuzzy expert system
Table 2.Fuzzy expert system (FESMS) vs human expert


The designed expert system gets the symptoms as inputs and provides appropriate response. The results show that, this system is able to identify 91.66% of MS patients.

The expert system has recommended to several non-patients to refer to doctor. An important point in disease diagnosis is that recall measure is more critical than precision measure. False recommendations reduce the system efficiency. However, eliminating some true recommendations is not tolerated. Ignoring such recommendations may cause serious problems in future for MS patients. Therefore, the proposed system tries to recommend referring to a doctor if some minimum symptoms are observed.

This research shows that first clinical presentations; besides, the demographic characteristics have an important role for early diagnosis of MS patients. Moreover, fuzzy logic has managed symptoms and uncertainty effectively.


In this paper, we introduced FESMS as an expert system, enabling patients to evaluate their MS symptoms. It is possible to increase precision in this system resulting to lower recall. However, recall is more important than precision in diagnosis systems and we have considered this fact in FESMS. Moreover, this system presents effective recommendations, which can be beneficial in terms of cost and expert availability.

In future, we will design a more sophisticated expert system by considering more symptoms. Moreover, we will present more than one recommendation in the expert system based on the type of symptoms and fuse them to provide the final output.


This work was supported by the Allameh Tabataba’i University. Moreover, I appreciate from Shahrzad Matinfar for medical information provision and other anonymous persons who helped to conduct experiments.

Authors’ Contribution

F. Matinfar proposed the idea. The introduction of the paper was written by F. Matinfar. The related literature was gathered by F. Matinfar and A. Tavakoli Golpaygani. The method implementation was carried out by F. Matinfar. Results and Analysis was provided by F. Matinfar and A. Tavakoli Golpaygani. The paper was proofread by A. Tavakoli Golpaygani. All the authors read, modified, and approved the final version of the manuscript.

Ethical Approval

The data was not extracted in real patients.


This study was supported by Allameh Tabataba’i University.

Conflict of Interest



  1. Torres A, Nieto JJ. Fuzzy logic in medicine and bioinformatics. Journal of Biomedicine & Biotechnology. 2006; 2006(2):91908. Publisher Full Text | DOI | PubMed
  2. Jackson P. Introduction to expert systems. Publishing Co Inc: United States; 1998.
  3. Sharma K, Virmani J. A decision support system for classification of normal and medical renal disease using ultrasound images: A decision support system for medical renal diseases. International Journal of Ambient Computing and Intelligence. 2017; 8(2):52-69. DOI
  4. Morris D, Bharadwaj P. An Electronic Clinical Decision Support Tool to Assist Hospital Physicians with Prognosis: Development and Mixed Methods Evaluation (SA508A). Journal of Pain and Symptom Management. 2018; 55(2):641-2. DOI
  5. Hassan N, Arbaiy N, Shah NA. Fuzzy expert system for heart attack diagnosis. Materials Science and Engineering. 2017; 226(1):012111. DOI
  6. Langarizadeh M, Khajehpour E, Khajehpour H, Farokhnia M, Eftekhari M. A fuzzy expert system for distinguishing between bacterial and aseptic meningitis. Iranian Journal of Medical Physics. 2015; 12(1):1-6. DOI
  7. Yilmaz A, Dagli M, Allahverdi N. A fuzzy expert system design for iron deficiency anemia. 2013. DOI
  8. Zarandi MF, Soltanzadeh S, Mohammadi A, Castillo O. Designing a general type-2 fuzzy expert system for diagnosis of depression. Applied Soft Computing. 2019; 80:329-41. DOI
  9. Allahverdi N, Akcan T. A Fuzzy Expert System design for diagnosis of periodontal dental disease. 5th International Conference on Application of Information and Communication Technologies (AICT). IEEE: Baku, Azerbaijan; 2015. DOI
  10. Esposito M, De Falco I, De Pietro G. An evolutionary-fuzzy DSS for assessing health status in multiple sclerosis disease. International Journal of Medical Informatics. 2011; 80(12):e245-54. DOI | PubMed
  11. Mutawa AM, Alzuwawi MA. Multilayered rule-based expert system for diagnosing uveitis. Artificial Intelligence in Medicine. 2019; 99:101691. DOI | PubMed
  12. Pal D, Mandana KM, Pal S, Sarkar D, Chakraborty C. Fuzzy expert system approach for coronary artery disease screening using clinical parameters. Knowledge-Based Systems. 2012; 36:162-74. DOI
  13. Wagner C, Hagras H. Toward general type-2 fuzzy logic systems based on zSlices. IEEE Transactions on Fuzzy Systems. 2010; 18(4):637-60. DOI
  14. Lublin FD, Reingold SC, Cohen JA, et al. Defining the clinical course of multiple sclerosis: the 2013 revisions. Neurology. 2014; 83(3):278-86. Publisher Full Text | DOI | PubMed
  15. Brownlee WJ, Miller DH. Clinically isolated syndromes and the relationship to multiple sclerosis. Journal of Clinical Neuroscience. 2014; 21(12):2065-71. DOI
  16. Cree BA, Khan O, Bourdette D, Goodin DS, Cohen JA, Marrie RA, Glidden D, Weinstock-Guttman B, Reich D, Patterson N, Haines JL. Clinical characteristics of African Americans vs Caucasian Americans with multiple sclerosis. Neurology. 2004; 63(11):2039-45. DOI | PubMed
  17. Nazish S, Shahid R, Zafar A, Alshamrani F, Sulaiman AA, Alabdali M, Aljaafari D, Al Wabari E, Alkhamis FA. Clinical presentations and phenotypic spectrum of multiple sclerosis at a University Hospital in Saudi Arabia. J Clin Neurol. 2018; 14(3):359-65. Publisher Full Text | DOI | PubMed