So you want to be a Knowledge Engineer

If one assumed Artificial Intelligence was the area of science which dealt with making computers think and perform tasks which resemble reasoning, analysis and cognition as exhibited by humans, then Knowledge Engineering is a branch of Artificial Intelligence which models the knowledge necessary for this cognitive processes. There are many names for systems which perform a domain specific task; expert systems, knowledge based systems, rule based systems, etc. Often what is common to all these systems is the fact that some domain specific knowledge has been captured and integrated into the system to perform one or more tasks in the domain. Most domain experts (for example senior physicians) have mental algorithms or maps of processing information and arriving to a list of possible diagnoses. If one were to try and capture these algorithms, the most obvious way to do them is in the form of rules. Let us take an example of patient presenting with cough with expectoration. Let us restrict the possible causes of cough with expectoration in our case to be just three; lung cancer, tuberculosis, chronic obstructive pulmonary disease(COPD). Figure 1 shows a possible visual algorithm for approaching a diagnosis for cough with expectoration.


One can clearly see how each of the paths down this decision tree can be broken down into sets of ‘if – then’ rules. If the same example were to be coded in pseudocode, it might look like ;

if (history of smoking)
{ if (weight loss)
then (possible diagnosis of lung cancer)
else if (no weight loss)
then (possible diagnosis of chronic obstructive pulmonary disease)
else if(travel to third world countries)
then (possible diagnosis of tuberculosis)

However, any clinician will tell you that these rules are no good with corroborating Xray findings and also that Tuberculosis might present with weight loss too. Leaving the medicine part of ‘cough with expectoration’ alone, one could see how an expert system for diagnosing ‘cough with expectoration’ might be designed. Since Expert Systems most commonly are based on rules or some sort of heuristics, they tend to be called Rule Based Systems. However Knowledge Based Systems tend to separate the ‘domain knowledge’ itself from the heuristics. So in this example, if we seperated modelled the knowledge differently in the form ;

Tuberculosis has symptom cough
Tuberculosis is associated with travel to third world countries

Chroncic Obstructive Pulmonary diseases has symptom cough
Chroncic Obstructive Pulmonary is associated with smoking

Lung Cancer has symptom cough
Lung Cancer has symptom weight loss
Lung Cancer is associated with smoking

What we now have is a model of knowledge in the domain ‘cough with expectoration’. We can use this knowlege to infer diagnosis of cough with a few lines of code which might be structured differently to the pseudocode above. However, one can quickly see this representation is different to rules and is more likely to be reusable. The fact that Tuberculosis has a symptom of cough and is associated with travel to third world countries is more or less static and can be reused for another application. For example, given this model of knowledge, one could write a program which can tell us “Diseases associated with smoking” and the answer is obviously COPD and Lung Cancer ! In this model, the knowledge of the domain is clearly separated from the application that uses the knowlege. Knowledge Based Systems typically maintain a clean divide between domain knowledge and application flow (inference algorithm). This is in contrast to Rule Based Systems where domain knowledge infact resides in the rules themselves.

If you have been with me till here, then you might have some hazy idea of what Knowledge Engineering is ! Knowledge Engineering is the science of identifying, processing and representing of knowledge in a given domain in a formal structured fashion. Often this involves defining the vocabulary in the domain and also modelling the vocabularies and semantics and is the first and most fundamental stage of building a knowledge based systems. Unless the domain expert is also the knowlegdge engineer, there is an additional step of eliciting/gathering knowledge from the domain expert before the knowledge engineer can make any formal attempt at building a knowledge base. So often it is useful if the Knowledge Engineer has some background knowledge of the domain that he/she attempts to model. The next step of modelling the knowledge is to choose a modelling/ programming paradigm to represent this knowledge. This will be another article (coming soon).

Summary : Knowledge Engineering deals with the process of getting knowledge into a computer in a structured way so it can be accessed efficiently and can be used to solve domain related problems.

Leave a Reply