EXPERT SYSTEM FOR SKIN PROBLEM CONSULTATION IN THAI TRADITIONAL MEDICINE

Background : This paper aimed to demonstrate the research and development of a rule-based expert system for skin problem consulting in the areas of acne, melasma, freckle, wrinkle, and uneven skin tone, with recommended treatments from Thai traditional medicine knowledge. Materials and Methods : The tool selected for developing the expert system is a software program written in the PHP language. MySQL database is used to work together with PHP for building database of the expert system. The system is web-based and can be reached from anywhere with Internet access. Results : The developed expert system gave recommendations on the skin problem treatment with Thai herbal recipes and Thai herbal cosmetics based on 416 rules derived from primary and secondary sources. The system had been tested by 50 users consisting of dermatologists, Thai traditional medicine doctors, and general users. The developed system was considered good for learning and consultation. Conclusion : The present work showed how such a scattered body of traditional knowledge as Thai traditional medicine and herbal recipes could be collected, organised and made accessible to users and interested parties. The expert system developed herein should contribute in a meaningful way towards preserving the knowledge and helping promote the use of Thai traditional medicine as a practical alternative medicine for the treatment of illnesses.


Introduction
Nowadays, skin care is a topic of interest to both women and men worldwide.This is true especially for skin problems about acne, melasma, freckle, wrinkle, and uneven skin tone, since they are a common cause for skin blemishes and sufferings to patients.There are several cures for treatment of these skin problems.Patients can choose among a plethora of methods of modern medicine or alternative medicine.In Thailand, Thai traditional medicine has been in use for health problems of Thai people for a long time.Thai traditional medicine uses Thai herbal recipes and Thai herbal cosmetics for the skin problem treatment.In the present research, the expert system technology is used for promoting Thai herbal medicine for alternative medicine to people worldwide with the vision of healthy skin for all.
An expert system is an artificial intelligence tool that has been used for decades for modern medical diagnosis (Changchit and Spooner, 2004;Sigut et al., 2007).In the present research, the use of Thai herbal medicine for the skin problem treatment in textbooks of Thai traditional medicine and in websites is reviewed.Our extensive literature search has not found any reports of the use of expert systems for Thai herbal medicine prior to the present study.Also, although there are websites dedicated to Thai herbs for skin care, there are no websites that develop an expert system for Thai herbal medicine.
The developed expert system comprises the main knowledge-based tools which provide diagnosis of skin problems in the areas of acne, melasma, freckle, wrinkle, and uneven skin tone, and which give the recommended treatment for those skin problems or impairments through various kinds of Thai herbs and Thai herbal cosmetics including protecting and preserving skin health.Moreover, the diagnostic procedures in this research can be used for self-training by primary healthcare students and practitioners.This would be beneficial to the field of skin healthcare by alleviating the problem of the lack of resource persons specialising in Thai traditional skin therapy because an expert system never retires, becomes sick, or takes leave (Scown, 1985).

Materials and Methods
The present research paper focuses on the part of the rule-based expert system development process.Typically, the development of the expert system involves four major activities: 1.Knowledge acquisition, 2. Knowledge representation, 3. Knowledge inference, 4. Explanation and justification (Changchit, 2008).The main module of this rule-based expert system is a rule base, called knowledge base as the database of this system.The rule base contains specific knowledge and expert knowledge about the various skin problem areas presented in rules.Rules, in the form IF-THEN, are elementary units of knowledge.The initial process of constructing the knowledge base is knowledge acquisition.This rulebased system consists of 416 IF-THEN rules, facts, and an inference engine controlling the application of the rules based on the facts.This expert system is thus a conventional rule-based expert system using human expert knowledge to solve the skin problems that normally would require human intelligence.

The expert system development process
Most complete and successful expert system applications were developed using the rule-based approach.Rule management is a valuable technique for representing and processing reasoning knowledge (Holsapple and Whinston, 1987).With this approach, skin problems diagnosis reasoning knowledge is represented as rules that tell the inference engine what conclusions can be drawn under various symptoms and signs of skin problems.Each rule specifies if certain conclusions can be regarded as being valid.The result of processing a rule set could be preliminary diagnosis and recommended treatment with Thai herbal recipes or Thai herbal cosmetics.
The main components of the proposed rule-based expert system are as follows: the user interface, the inference engine, the knowledge base, the working memory, explanation facility and knowledge acquisition facility (Figure 1) (Negnevitsky, 2011).An end user would communicate with the system via a user interface and the explanation facility that would interact with the inference engine.The working memory represents the set of facts known about the skin problem (domain).The knowledge base stores all relevant information, data, rules, cases, and relationships used by the expert system.The general form of a rule is: IF <conditions> THEN <conclusion>.The inference engine tries to derive new information about a given skin problem using the rules in the knowledge base and the situation specific knowledge in the working memory.Explanation facility provides the reasoning behind a certain conclusion.Knowledge acquisition facility provides a means for capturing and storing knowledge elicited from medical experts into a knowledge base.The inputs (symptoms and signs of skin problems, etc.) of the patient and the user's comments/suggestions are stored in a database.Existing rules can be modified and new rules can be included through authorised access to the database.

The system design
Designing of the expert system consists of four systems: language system, problem processing system, knowledge system, and presentation system as shown in Figure 2. Thus, the major activities used for building the expert system are as follows: knowledge acquisition, knowledge representation, knowledge inference, and programming.

Knowledge acquisition
Knowledge acquisition plays an important role in building the knowledge system of the expert system development.It is evident that the quality of the resulting system is dependent on the quality of knowledge originally elicited (Bolger and Wright, 1994;Jager et al., 1998).With this idea, the researchers act as knowledge engineers, take knowledge acquisition process that are acquiring, organising, extracting, accumulating, transferring, and transforming the skin problem-solving to a computer program for constructing or expanding the knowledge base.The data and knowledge are collected from different sources.The first valuable primary source is acquired from specialised databases, books and a few electronic websites.The second valuable source is from interviews with Thai traditional doctors and dermatologists (domain experts) about dermatology and its disorders.This knowledge can be classified by important facts.After that, the questions and answers are organised in the form of questions that are appropriate for inference and queries building.

Knowledge representation
This research represents skin problem-solving expertise from dermatologists and Thai traditional doctors and/or documented knowledge sources into the knowledge base as database of the expert system by the use of rules.In making rules, backward chaining or so-called goal-driven reasoning is an efficient way to solving skin problems by setting each type of skin problems to be the goal or hypothesis, and setting many attributes (symptoms and signs of skin problems) for proving hypothesis.The skin problems knowledge is structured in rules which describe how each of the possibilities might be selected.The rules break the skin problem into sub-problems.For the inference engine of the expert system, backward chaining starts with a list of goals https://en.wikipedia.org/wiki/Objective_(goal)(orhypotheseshttps://en.wikipedia.org/wiki/Hypothesis) and works backwards from the consequent https://en.wikipedia.org/wiki/Consequentto the antecedent to see if there is datahttps://en.wikipedia.org/wiki/Dataavailable that will support any of these consequents (Russell and Norvig, 2009).To backward chain from a goal in working memory of the inference engine: 1.
Select rules with conclusions matching the goal; 2.
Replace the goal by the rule's premises.These become sub-goals; .
Work backwards till all sub-goals are known to be true -either they are facts in working memory or the user provides the information.

Typical skin problems diagnosis rule in rule-based reasoning
In the expert system development, there are 416 knowledge rules of skin problem diagnosis for building rule-based reasoning to knowledge base of the expert system.In this paper, for lack of space, an example of knowledge rule for building knowledge base of the expert system is shown in Table 1, and the recommended treatment is shown in Table 2.
Table 2 suggests the use of some or all of these Thai herbal recipes for non-inflammatory acne treatment for patients who have symptoms and signs of this skin problem.Trial usage of the expert system is available on the website "Thaiherbalexpert.com".

Knowledge inference
The activities in this phase refer to the computer programming techniques for making reference to imitate the reasoning behaviours of human experts for building the problem processing system of the expert system.The "brain" of the expert system is the inference engine.This component provides directions about how to use the system's knowledge by developing the agenda that organises and controls the steps taken to solve the skin problems whenever consultation is performed.In this research we make an inference engine that operates by the method of backward chaining.Backward Chaining is a query driven approach.Beginning with a dedicated query called the goal, program rules and data items are recursively selected if they are relevant for "proving" that a query succeeds.The query is then replaced by the query part (possibly consisting of a conjunction or disjunction of smaller queries) of the selected rule, and the process is repeated until all queries can be evaluated against data items in the database ("facts").In this paper, for lack of space, backward chaining process is shown in Figure 3 and data flow example of skin problem diagnosis in inference engine of the expert system is shown in Figure 4.The inference engine of the expert system operates as a problem processing system by internal diagnosis together with the knowledge system.The flow of internal processes in the inference engine is shown in Figure 5.

Programming
The tool selected for developing the expert system is a software program written in the PHP language.The system can be web-based, and it takes seconds to input data and quickly convert the correct diagnosis.MySQL database is used to work together with PHP for building data base of the expert system.For lack of space, an example of algorithm programming and problem solving is shown in Figure 6.

User interface
The expert system contains the presentation system with a language processor for friendly communication between the user and the computer.This communication can be carried out in a series of questions and answers with pictures.To consult with the system, the users must choose skin problem topic that they want to consult with the expert system in the homepage of www.thaiherbalexpert.com.After entering the skin problem topic, the system starts to conduct interactive dialogue by asking some questions about symptoms and signs experienced by the patient with various parameters.The answers are processed by the system and the system provides pre-diagnosis results and recommended treatment with Thai herbal recipes and Thai herbal cosmetics.This means that the system gives only preliminary diagnostic results and, for the sake of safety, the users are advised to consult with a Thai traditional doctor before using recommended treatment of the system.The preliminary

Algorithm 1
Record herbal data

Herbal data
Output Herbal data for making list

Begin {Record adding herbal data}
Open herbal data base If (input data = none) then

End If
Close herbal data base diagnostic results of the expert system are not official medical diagnosis and are not meant to replace the medical doctor.It only provides consultation for alternative medicine, and users are advised to have better study of and consult with Thai traditional medicine experts before using recommended treatment of the expert system.

Results
The developed expert system provides preliminary diagnosis and recommendations on the skin problem treatment with Thai herbal recipes and Thai herbal cosmetics based on 416 rules derived from primary and secondary sources.The developed expert system has been tested with 50 users consisting of dermatologists, Thai traditional medicine doctors, and general users.Test results show that the assessors were highly satisfied with this expert system as shown in Table 3.

Table 3: Assessment results of the expert system
From these results, it may be concluded that the developed system is considered good for learning and consultation.All 50 assessors were given questionnaires to comment on the system performance.They had access to computers at their places of work and were interested in the expert system that can promote Thai herbal medicine as Thai traditional, complementary and alternative medicine for all peoples in the world.

Conclusion
Most people who want to have beautiful skin must know how to take care of their skin.The developed expert system in this research is a tool for promoting Thai herbal medicine for skin problem treatment as an alternative medicine.It should be noted that this paper gives an overall picture of the development of an expert system for the skin problem consulting and not intended for, nor can it be substituted for medical treatment online.All users are free to learn and choose the knowledge of alternative medicine from this system.However, users should consult a Thai traditional doctor before using any herbs.

Figure 2 :
Figure 2: Simplified overview of the expert system for the skin problem consultation

Figure 4 :
Figure 4: Data flow of acne problem diagnosis in the inference engine of the expert system

Figure 5 :
Figure 5: Flow diagram of internal processes of the inference engine

Figure 6 :
Figure 6: An example of algorithm programming and problem solving

Table 1 :
An example of the knowledge rule for acne diagnosis IF THEN 1) Characteristics of the nodule on your skin are "Solid nodule in skin pore with open surface" 2) The colour of the nodule is black.3)The size of the nodule is about 1-3 mm.4) You have got the symptom(s) of pain or swelling or red or burning sensation at the skin problem.

Table 2 :
Thai herbal medication and additional suggestions for acne treatment