Knowledge-based systems (Expert Systems)
Knowledge-based systems
A 'knowledge-based system' is a synonym of an 'expert system'. It is "an application of artificial intelligence to a particular area of activity where traditional human expert knowledge and experience are made available through a computer package" (British Computer Society, 'A Glossary of Computing Terms'). In other words, it is a piece of software that has a go at replacing experts' knowledge and experience. In this section, we will describe the components of the software that make up an expert system. We will then look at some typical applications.
The components of knowledge-based software
Knowledge-based software systems have four identifiable parts to them. These are:
- The knowledge base.
- The rule base.
- The inference engine.
- The user interface.
1) The knowledge base
The knowledge base is the name given to the part of the software that holds the facts. It contains the knowledge for a particular area of expertise, such as a medical diagnostic expert system or an engine fault diagnostic system.
2) The rule base
This is an identifiable part of the knowledge base. It holds the rules that are applied to the facts. For example, one rule might be:
-
- IF the toe is swollen
- AND the nail is black
- THEN it could be an in-growing toenail
3) The inference engine
This is a piece of software that takes requests for information from the user interface and then searches through the knowledge base by applying the rules in the rule base. The inference engine retrieves appropriate knowledge from the knowledge base and passes it to the user interface software. It separates the user interface from the 'clever' part of the software. That means that different applications can be written by different people, each one having their own user interface - and they will all be able to use the same expert system.
4) The user interface
The user enters requests for information. They may do this by entering in answers to closed questions (questions which have only a few possible answers). The answers will result in the knowledge base being reduced further and further until only limited facts are left. These can then be returned to the user along with a probability factor. These four components can be represented with the following diagram:

Talking about an expert system
We know that if we want to describe what an expert system is, we need to mention the knowledge base, the rule base, the inference engine and the user interface. We could also highlight the characteristics of an expert system in the following way:
-
- Expert systems are quite specialised. Each expert system usually attempts to be an expert in a very focused area of expertise.
- When answers are returned, they are often given probabilities. For example, in a medical diagnostic expert system, a high temperature, headaches and a cough might return
-
- Common cold - 61.78% chance.
- Influenza - 38.21% chance.
- Bubonic plague - 0.01% chance.
-
- A user is often asked a series of questions and must select an answer from perhaps two or three choices for each question. When the answers have been selected via the user interface, they are passed to the inference engine. This then triggers a search of the knowledge base using the rules in rule base. The resulting facts with a probability score are then passed back to the inference engine and on to the user interface.
- Sometimes an explanation or advice may be part of the answers returned.
Types of knowledge-based systems
There are three types of knowledge-based systems that you should know about. These are:
- Diagnostic systems.
- Advice-giving systems.
- Decision making systems.
For each type, you should be able to describe a classic example.
1. Diagnostic systems
These are systems that ask a question, the answer given by the user resulting in the knowledge base being reduced in size. The classic example is a medical diagnostic system.
-
- The first question might be 'Do you have constant headaches'? If the answer is 'Yes', then one portion of the knowledge base can be explored further. If the answer is 'No', then a different portion can be explored. Whatever the answer, the number of facts that will be looked at has been reduced.
- Suppose the answer to the above question was 'Yes'. The next question might be 'Do you have a sore throat'? Again, the answer can be either 'Yes' or 'No'. If it is 'Yes' then that reduces the part of the knowledge base for people with headaches even further to a part for people with headaches and sore throats. If it is 'No', then that will reduce the part of the knowledge base for people with headaches but without sore throats.
- Suppose the answer was 'No'. The next question might be 'Do you have a high temperature'? This process will continue until the number of facts left is very small. These can then be reported to the user, perhaps with a probability factor and some additional comments.
- We can represent the process with the following diagram. Notice how the knowledge base gets smaller and smaller with each question answered.

Another example of this kind of system is a car engine diagnostic system. When a car has a problem with its engine, the problem can be diagnosed with the help of an expert system. For example, the first question might be 'Is there an oil leak'? If there is, that would reduce the knowledge base to an area that deals with problems involving oil leaks. If there isn't, that would reduce the knowledge base to an area that deals with problems not involving oil leaks. Another question could be asked that further reduces the knowledge base and so on, until the number of possible causes of the problem are small enough to report back to the user.
2. Advice-giving systems
You have already seen a classic example of this type of knowledge-based system, when you looked at stock-control systems. In this kind of system, a process is monitored by the software. When the software detects particular situations, it gives advice! In a stock control system in a shop, the stock is constantly monitored: the amount of a product in stock is decremented each time a customer buys a product and has it scanned and it is increased each time a delivery from the main warehouse is received. The stock control system 'knows' that when a product falls below a certain number, it should advise that a re-order take place. Stock control systems can also be called 'decision-making' knowledge-based systems if they are able to re-order automatically, without any human intervention.
Another example is the safety systems fitted on planes that help them avoid collisions. As the plane flies, it scans ahead, checking that the path is clear of other planes. If it does detect a plane coming towards it, it should advise the pilot to change course. Like stock control systems, these systems can also be called 'decision-making knowledge-based systems if they are able to automatically change course to a safe route, without human intervention.
3. Decision-making systems
In the section above, we saw that advice-giving systems can also be called 'decision-making systems' if they have enough information and the hardware and software to allow them to actually take decisions themselves, without human intervention. Many process systems are both, because they enable a user to select whether the system will be fully automated, or will simply report and advise. An automated share-selling expert system can be both. Instructions can be given to the software that tell it to automatically sell a share when it reaches a certain price or it can be told to give a message to the stockbroker, advising that the shares be sold. The stockbroker can then review the situation, discuss it with the owner of the shares and then take action.
Some advantages and disadvantages of expert systems
Software can never completely replace a human. For one thing, a human has hunches and intuition. Some might argue that removing these elements is a good thing! Humans can, however, evaluate completely new situations whereas an expert system is bound by rigid rules and their current knowledge base. Indeed, an expert system's knowledge base and rule base must be kept up-to-date. This may seem straightforward but if the expert system is in a third world country, for example, it means that some training will be needed so that somebody locally can do this.
To have an expert system means that the hardware and software must be bought. Not only may this be a problem in some situations, but careful thought needs to be given to maintaining the hardware and software - you don't want the system to stop being used the moment there is a problem, simply because nobody has been trained to maintain the system.
Expert systems may well be a wonderful substitute for situations where it is impossible to recruit highly trained people. They should also be much cheaper than the equivalent human. It may simply not be possible to pay for enough doctors to work in third world countries, or it may not be possible to recruit enough stockbrokers to work in a firm. There are some dangers, though. It may be that people come to rely too much on the power of the expert system! These systems are never perfect. They may contain software bugs. They may cause situations that have not previously been considered. Expert systems that automatically bought and sold shares around the world nearly caused a stock market meltdown in the 1990s because they fed off each other and caused each system to sell sell sell!