[Skip to content]

TWI
Search our Site
.

Developing a diagnostic expert system

TWI Bulletin, March/April 1992

 

Martin Bourton
Martin Bourton

Martin Bourton joined TWI having graduated in 1987 from the University of East Anglia with a degree in Electronic Systems Engineering. He is now a Senior Research Engineer in the Microcomputer Section of the Arc Welding Department.

He has worked with diagnostic expert systems for a number of years, more recently developing programs concerned with shielding gas selection and welding machine design.

Martin Bourton details the design of a computer system structure which could be used to develop a number of diagnostic systems. WELDCRACK EXPERT, a system for diagnosing fabrication cracks, is used to illustrate the system structure.


A need for a generic computer system structure and suitable knowledge acquisition techniques arose out of a requirement to produce an expert system for crack diagnosis. The problem of fabrication cracking has been encountered in the steel construction industry for many years. The knowledge required to diagnose and remedy fabrication cracks is dispersed among a limited number of experts, but a large number of fabricators need this expert knowledge when problems arise during construction of steel structures.

System structure

The recommended structure for development of a diagnostic type expert system is set out below, and WELDCRACK EXPERT is used as an example.

Generic structure

Figure 1 shows the essential features of the structure. All the knowledge bases contain rules and questions. Those in the elementary knowledge base are general, initial questions which give a rapid indication of which problem is most likely to have occurred. Those in each of the secondary knowledge bases are more detailed questions and rules relating to possible solutions.

Fig. 1. Generic system structure
Fig. 1. Generic system structure

A likelihood value is associated with each secondary knowledge base. This value is updated after each piece of information is entered by the user.

The expert system is used (or consulted) as follows:

  1. Responses are provided by the user to questions contained in the elementary knowledge base. After each piece of information is entered, all the likelihood values are updated.
  2. On completion of the elementary knowledge base investigation the secondary knowledge base having the greatest likelihood value is investigated. This investigation continues until one of two conditions is met. Either the solution is found, or one of the other secondary knowledge bases now has the greatest likelihood value.
  3. If the first condition is met the consultation is terminated. If the second is met the investigation switches to the knowledge base having the greatest likelihood value, where it continues. The term 'likelihood value' was chosen in preference to 'probability', as likelihood values do not adhere to the strict mathematical definition of probability.

Since the program structure is based upon likelihoods, deciding that the goal has been achieved is no simple matter. The program can only say that it is 'likely' that the goal has been attained. A threshold level is used to distinguish between a likelihood that is sufficient to imply that the goal has been reached, and one that is insufficient. Setting of this level is vital to correct operation of the system. If the level is set too low an incorrect conclusion may be drawn, but if it is set too high a conclusion may never be reached. Close consultation with the expert upon whose knowledge the system is based is essential if the threshold level is to be set correctly.

The advantage of partitioning the gathered knowledge into separate modules is that, after acquiring some initial background information, the user is only asked questions relating to the most likely cause. This means that a solution is attained in the shortest possible time.

WELDCRACK EXPERT system structure

WELDCRACK EXPERT is a crack diagnosis expert system designed for use with ferritic steels. The user (usually a welding engineer) enters the characteristics of the fabrication crack ( e.g. its appearance, size and location). WELDCRACK EXPERT responds by indicating which cracking mode is most likely to have induced the crack. Five cracking modes are considered: solidification cracking; hydrogen cracking; reheat cracking; liquation cracking; and lamellar tearing.

The initial investigation for the WELDCRACK EXPERT system is concerned with the basic characteristics of the crack being considered. The knowledge acquired from the following fundamental questions is used to update the likelihood values for each of the five secondary knowledge bases.

  • When was the crack discovered?;
  • What is the location of the crack?;
  • What is the orientation of the crack?.

Each of the five secondary knowledge bases corresponds to a single cracking mode.

A typical conclusion from this elementary investigation is that if the crack lies in the weld metal alone it cannot be a lamellar tear. Hence, the lamellar tear likelihood value would be set to zero. The extent to which a likelihood value is increased or decreased in response to a particular answer is often judgmental, and is determined by the expert.

If, for instance, on completion of the elementary investigation, it is found that the solidification cracking likelihood has the greatest value, only questions relating to solidification cracking will be asked during the next stage of the consultation.

The solidification crack type investigation will continue until either a solidification crack is confirmed, ( i.e. its likelihood value has exceeded the threshold), or one of the other crack types becomes more likely. If the former is true, a list of references describing solidification crack remedial action is displayed and the consultation terminated. If the latter is the case, the investigation switches to the relevant secondary knowledge base. Figure 2 shows a flow diagram of the WELDCRACK EXPERT system structure.

Fig. 2. WELDCRACK EXPERT system structure
Fig. 2. WELDCRACK EXPERT system structure

A user-friendly system

During development of WELDCRACK EXPERT great care and attention were given to the way in which information was transferred. Throughout a WELDCRACK EXPERT consultation a bar graph representation of the present and previous crack type likelihoods is displayed. This facility enables the user to see the crack type ranking, the most likely crack type and those cracking modes whose likelihoods have been set to zero. Figure 3 shows the WELDCRACK EXPERT user interface. By displaying both the present and previous likelihood values the user can immediately see the effect a question has on each of the crack type likelihoods. Thus, the system may act as a training aid, showing which features are associated with each cracking mode.

Fig. 3. WELDCRACK EXPERT user interface
Fig. 3. WELDCRACK EXPERT user interface

As information can be transferred more efficiently by using pictures as well as text, many graphical images have been built into WELDCRACK EXPERT.

Two types of picture have been incorporated: hand-drawn schematics, whenever it was necessary to highlight a particular crack feature; and digitally scanned metallurgical photographs, whenever more detail was required. Figure 4 shows a hand drawn schematic, Fig.5 a digital scan of a weld microstructure.

Fig. 4. Hand drawn schematic from WELDCRACK EXPERT
Fig. 4. Hand drawn schematic from WELDCRACK EXPERT
Fig. 5. Digitally scanned photograph from WELDCRACK EXPERT
Fig. 5. Digitally scanned photograph from WELDCRACK EXPERT

Knowledge elicitation, or putting the expert into the system

TWI defines a true expert system to be a computer program that contains knowledge elicited directly from one or more experts knowledgeable in the domain being computerised. An expert system can contain further information obtained from books, magazines and conference papers, but it is the information obtained directly from the experts, their know-how acquired working in the domain, that differentiates an expert system from a conventional program. Certain techniques are used specifically to elicit knowledge from an expert.

The key features a system developer needs to consider are as follows:

  • The main concepts, e.g. crack location, crack appearance, welding process, heat treatment, joint type in the WELDCRACK EXPERT;
  • The extent to which any one concept in the elementary knowledge base or secondary knowledge base will affect the likelihood of any of the cracking types;
  • The threshold level which is used to distinguish between a likelihood that is sufficient to imply attainment of the goal and one that is not.

The main knowledge elicitation techniques used during the development of the system were interviewing, prototyping and card sorting.

Interviewing

During an interview, it is more helpful to the expert if the knowledge engineer who is building the system is specific and uses specific instances, problems and situations. It is dangerous to make assumptions, or to ask closed questions, as this may inhibit the expert from revealing some crucial knowledge.

Prototyping

Prototyping was used extensively in developing WELDCRACK EXPERT to define the threshold level which was used to determine whether a likelihood value was sufficient to imply the presence of a particular crack type. This was carried out by an iterative cycle of showing the system to the expert using some case studies, refining the threshold level in the light of comments received from the expert, and then showing the system to the expert incorporating the revised changes. This was continued until the experts felt that the system was giving realistic results.

Card sorting

In developing WELDCRACK EXPERT card sorting was used for the following:

  • To determine the main concepts;
  • To order the concepts;
  • To group the concepts.

To determine a logical ordering of the concepts the knowledge engineer prepared cards with a concept written on each card. The engineer then asked each expert to position the cards in order of their importance in the context of different sets of circumstances. Five experts were tested and it was found that, whilst there were differences of opinion between the experts, a general pattern emerged.

This technique is very simple and allows the expert to manipulate the 'concepts' very easily.

Conclusions

The advantage of slotting the gathered knowledge into groups is that after the initial interrogation the user is only asked questions relating to the most likely cause. This way a solution is reached in the shortest possible time.

A common structure has been developed which can be applied to different diagnostic type expert systems. The structure has been designed so that subsequent systems can be developed with considerably less time and effort.

Knowledge acquisition techniques, which have been found to be the most effective for this type of system, are equally beneficial when developing other similar systems.


WELDCRACK EXPERT was one of the top ten programs in The Manufacturing Intelligence Awards of 1991. This annual award is presented jointly by the British Computer Society and the Department of Trade and Industry for the best application of knowledge based systems to manufacturing technology, manufacturing management and materials technology.