Histopathology 1992, 21,269-274

Design of an expert system and its application to dermatopathology A.RUBIN Department of Histopathology and Cytology, Watford General Hospital, Watford, Herts, UK Date of submission 4 November 1991 Accepted for publication 18 February 1992

RUBIN A .

(1992) Histopathology 21, 269-274

Design of an expert system and its application to dermatopathology Expert systems are computer programs which use inference and knowledge to solve problems which usually require the expertise of a human specialist. This paper examines the application of expert systems to histopathology and explains their construction by describing the design of an expert system ‘dermdx’,intended to aid in the interpretation and diagnosis of biopsies of inflammatory diseases of the skin. The system consists of an expert shell, which performs the inference, and a rule-base, which contains the knowledge with which the system operates. The system can be easily updated or adapted to other tasks. Keywords: skin, dermatopathology, inflammatory diseases, expert systems, dermdx

Introduction The use of computers has become a familiar aspect of normal practice in most pathology laboratories. Their role is usually confined to data management and statistical analysis although computers have the potential to play a more active role in the diagnostic process. Rather than being used just for calculation, storage and transmission of data, computers can be used for tasks depending on reasoning and inference. ArtiEcial intelligence is the branch of computer science that deals with the application of computers to the task of reasoning. There are various sub-disciplines of artillcia1 intelligence including image processing, robotics, expert systems and speech recognition. Two of the most important strategies used in artificial intelligence with possible application to pathology are neural computing and expert systems. Neural computing is the attempt to produce intelligent programs by using the computer to imitate the structure of the human brain. Neural networks have been studied for many years but it is only recently, with the development of parallel processing computer architectures, that they have Address for correspondence: h.A.Rubin. Department of Histopathology and Cytology, Watford General Hospital. Vicarage Road, Watford, Herts. UK.

begun to show their true potential. The other strategy is more specific and deals with knowledge about a particular problem area. This is known as knowledge-based or expert systems. Both neural networks and expert systems are being explored with regard to applications in diagnostic pathology. Neural networks have great potential in the field of image identification and projects such as PapNet which use neural networks in automated cervical cytology screening have had some success. Most work with intelligent programs in pathology has been done using expert systems. WHAT IS A N EXPERT SYSTEM?

Expert systems have been described as ‘an intelligent computer program that uses knowledge and inference procedures to solve problems that are difficult enough to require significant human experience for their solution’’. They are intended to provide the sort of expertise usually associated with a human specialist2. Expert systems have been designed to aid in the solution of various problems in medicine and pathology. One of the best known is the system MYCIN which was designed to advise in the diagnosis and treatment of infections3n4. An important idea is that of a ‘domain’. The domain denotes the specific problem area for which the expert system has knowledge. The expert system consists of a 269

270 A.Rubin

knowledge base containing the rules for a specific domain of expertise and an inference engine for deductive reasoning from this knowledge. The inference engine must be able to interface with the user. The knowledge that the system has must be specific but the rules of inference used by the system are not necessarily so. This means that the system may consist of a computer program which performs the inference, with the specificknowledge in a separate file. This file, or rulebase may be edited using either a text editor or the computer program itself. The program is often referred to as the ‘expert shell’, and is not specific to the particular domain. Expert shells are available commercially and such shells have been used as part of diagnostic systems. Use of an expert shell for the construction of a system for the interpretation of fine needle aspirates of the breast has been described5,Shells have also been designed for more specific use in histopathology, e.g. the Pathology Expert Consultation System which has been implemented for tumours of the breast, lung, ovary and endometrium6. One of the most ambitiousprojects is Intellipath which combines an expert system with a diagnostic workstation l i e d to a video-disc’. The user can search a large amount of textual information together with literature references. The videodisc is used to display high quality photomicrographs. Part of the package is a sophisticated expert system which can be used for diagnostic consultations. The Intellipath system was originally designed for lymph node pathology but it is hoped that a large number of other modules should be available by 1992. PROBLEMS WITH EXPERT SYSTEMS

One major problem in the design of expert systems is the way in which uncertainty is dealt with. Uncertainty and variability are an important factor in histological diagnosis. There may be uncertainty about the presence of a finding and the degree to which it is present (e.g. are these structures really Call-€her bodies: what is the degree of nuclear pleomorphism?).There are mcertainties about how to interpret facts and what their significance is. Several strategies for dealing with uncertainty have been studied. These include Bayes theorem, the certainty factor model used in MYCIN,Dempster-Shafer reasoning and fuzzy logic*. The application of all these strategies can be problematic. There are doubts as to their statistical soundness, especially when facts may be interdependent to a variable degree. There may be insuftIcient data on the weight to give to Merent probability factors.

A specific criticism of expert systems as applied to histopathology is that the rule format is unnatural, diseases are usually described by their manifestations rather than the reverse. The representation of histological knowledge by a large number of rules is inelegant and the knowledge base difficult to validate. It is, however, possible to design a knowledge base structure that displaysknowledge in a form that is more familiar to pathologists, as has been described for breast diseaseg. It is the intention of this paper to demonstrate the use of expert systems in histopathology by describing the development of an expert system designed to aid in the interpretation of biopsies of inflammatory diseases of the skin. The system can act as an expert shell, i.e. it is not specific to this one particular domain and therefore easily adaptable to other problem areas.

Methods The system consists of two parts, a computer program and the rule base. The program was written using the language Pascal and compiled using Borland Turbo Pascal version 4 for an JBM compatible personal computer (PC). The program can be further divided into the inference unit and the skin-specific unit. The relationships of these units are shown in Figure 1. THE INFERENCE UNIT

This unit reads rules from the rule-base and stores them in memory. The number of rules stored is limited only by the amount of memory available to the computer and as many as 1000 rules can be handled on a PC with 640 kilobytes of random access memory. The inference engine uses the technique of backward chaining to arrive at a diagnosis. This involves going through each diagnosis and ascertaining whether the conditions necessary to make this diagnosis are true. When the system is 6rst asked to make a diagnosis it attempts to do so using the available facts. If it fails to make a diagnosis it tries a second time, but this time if the truth of a fact is unknown it asks the operator. The unit is programmed to avoid asking questions in an inefficient manner. If any available fact disproves a diagnosis then that diagnosis is discarded. The unit asks about diagnoses for which it has some supporting evidencebefore asking about diagnoses where there is none. The inference unit also has the ability to explaln to the operator why it arrived at a particular diagnosis. The operator can then change any of the conditions entered to see what effect this will have. Interrogation of the system is useful in identifying those features which are crucial to making the diagnosis and can aid in difflcult differential diagnoses.

An expert system for dermatopathology

2 71

Figure 1. Structure of the expert system.

THE ‘SKIN-SPECIFIC’ U N I T

The inference engine will operate more efficiently if relevant facts are entered at the start. To assist in this, ‘dermdx’has a menu-based facility whereby the operator can enter facts about the cell types and any epidermal changes present. This is the only part of the program

which is specific for skin pathology but the principles applied are easily adaptable to other organ systems or diseases. THE RULE-BASE

The unit containing the specific rules for diagnosis is not

1. if eosinophils are many there is spongiosis present then there is eosinophilic spongiosis 2. if or there is focal parakeratosis there is a significant deep infiltrate there are eosinophils present the epidermis is thin then there are features not seen in classic lichen planus

3. if or -lymphocytes are present there are few lymphocytes then lymphocytes are absent or scanty

In rule 1the final line is true if all the conditions are true. In rules 2 and 3 the final line is true if any of the conditions is true. The tilde indicates a negative: ’ -lymphocytes are present’, is true if ‘lymphocytes are present’ is false.

Figure 2. Rule structure.

272

A.Rubin

a computer program but a text file. As such it can be modified using any text editor or word processor, as long as the file is saved as a straight ASCII textfile. All the rules are of the form ‘if’ followed by a number of conditions (Figure 2.) These are followed by the word ‘then’ and then the action. Rules are of two types. Most rules are ‘and’ rules, all the conditions must be satisfied for the action to be true. Some rules are of ‘or’type, if any of the conditions is satisfied then the action is true. Conditions may be of positive or negative type. By using combinations and hierarchies of rules it is possible to build up complex conditions. There is no facility for expressing quantitative information or calculating probabilities. Rules for inflammatory diseases of the skin were written by reference to standard textbooks, most of the information being taken from Ackerman’s Histologic Diagnosis of Znrflammatory Skin Diseasesl0.

1. Select major features.

2. Find a feature. 3. Could it be.

4. Delete a fwt.

USING THE PROGRAM

On starting a session with the expert system the user must decide how much prior information about the biopsy to give (Figure 3). At this stage facts can be entered into memory in two ways. First, the menu-based skin-specific unit is used for entering information on inflammatory cell types and density of inflammation and also for facts on epidermal changes such as parakeratosis or bullae (Figure 4). Secondly, information can be given by asking the system to hunt for keywords or phrases in the rule-base. For example, if the operator has noticed basement membrane thickening in the biopsy he can enter this phrase or part of it. The program will then search for any conditionscontaining this phrase and ask the user whether they are true (Figure 5). If the inferenceunit is unable to make a diagnosiswith the information given it initially, it asks the operator questions until either a diagnosis can be made, or the inference unit concludes that it is unable to make a diagnosis on the information given. The inference unit has been programmed to be very efficient in the way that it asks for information and is usually able to arrive at a diagnosis without asking large numbers of irrelevant questions. On arriving at a diagnosis the user has several options. He can ask the system to explain how it arrived at that particular diagnosis. The system will then chain back through all the conditions, either positive or negative, which had to be satisfied for it to arrive at the

5. Make a diagnosis. 6. Explain dagnosis.

x. Exit. Figure 3. Opening menu of ‘dermdx’.

1. Select major features. 2. Plnd a feature. 3. Could it be. 4. Delete a fact.

1. Select major features. 5. Make a diagnosis.

6. Explaindiagnosis.

neutrophils plasma cells

x. Exit. Figure 4. The 'skin-specific' menus enable information such as inflammatory cull types and density of inflammation to be emUy entered into the system.

there are many eosinophils? Yes Is it true that: there is spongiosis present? Yes Is it true that: there is acantholysispresent? Pigum 5. The inference unit selects what questions to ask by backward chaintng through the rules. Here it is attempting to make a diagnosis of pemphigus vulgaris.

An expert system lor dermatopathology

2 73

A second approach is to use the ‘could it be’ facility. The user enters a particular diagnosis and if that diagnosis is available to the system then the user is questioned until it can establish whether that diagnosis is true or not.

1. Select major features. 2. Find a feature.

3. Could it be. 4. Delete a fact.

Assessment

there is a lichenoid interface dermatitis a r m e d there is vacuolar basal layer degeneration atlimed there is irregular epidermal hyperplasia affirmed the lesion is solitary denied there are features not seen in classic lichen planus denied therefore d lichen planus affirmed Press a key Figure 6. The system is capable of explaining how it reached a particular diagnosis.

diagnosis (Figure 6). Using this information, the operator can see how changing any of the given facts affects the system’s diagnosis. Conditions can be removed from memory and new ones added before the system is asked to attempt making a diagnosis again.

Twenty biopsies of inflammatory skin biopsies were taken from the files of the department of histopathology. These cases had well-established diagnoses with good clinical and histological correlation and most had been discussed at clinico-pathological meetings. The diagnoses achieved using the system are compared to the established diagnoses in Table 1.

Discussion Expert systems have been described as ‘computer software that can function as a consultant, providing guidance, advice and assistance in decision making’. They may provide knowledge of a particular problem that can normally only be provided by long term specialization and work experience. A pathologist interested in using an expert system to aid in diagnosis

Table 1. Comparison of the expert system’s diagnosis wzrsus previously established diagnosis in 20 cases Case no. ~

Established diagnosis

System’s diagnosis

Bullous pemphigoid Chickenpox kishmaniasis Jessner’s lymphocytic infiltrate Lichen niditus Lupus vulgaris Actinic porokeratosis Xanthogranuloma Acute psoriasis Discoid lupus erythematosus Sarcoid Psoriasis Subacute eczema Rosacea Necrobiosis lipoidica Lichen planus Porphyria cutanea tarda Psoriasis Erythema dyschromicum perstans Dermatitis herpetiformis

Bullous pemphigoid Herpes virus infection Leishmaniasis Jessner’s lyrnphocytic infiltrate or deep gyrate erythema Lichen niditus Lupus vulgaris or rosacea Actinic porokeratosis Xanthogranuloma Guttate psoriasis Acute discoid lupus erythematosus Lupus vulgaris. rosacea, sarcoid, zirconium or beryllium granulomas Guttate psoriasis Non-specific spongiotic dermatitis Lupus vulgaris or rosacea Granuloma annulare or necrobiosis lipoidica Lichen planus Cell poor pemphigoid Psoriasis Erythema dyschromicum perstans or post-inflammatory pigment alteration Dermatitis herpetiformis.DH-like drug reaction or bullous disease of childhood

~

1. 2. 3. 4.

5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20.

274

A.Rubin

will have several options. He may purchase a sophisticated system with a work station linked to a video-disc. Such systems will be relatively expensive and of most interest to large teaching institutions. At the other extreme it is possible for pathologists to use expert system shells to construct their own systems by drawing up their own rule-base. This would not require any programming skills on the part of the pathologist but it would demand a familiarity with the principles of expert systems. It has been recommended that construction of an expert system requires the co-operation of a computer scientist and a ‘domain specialist’, in this case a pathologist. Dermatopathology is a good example of a discipline where the use of an expert system may be helpful. A vast number of potential diagnoses have to be considered when examining a case and there are many complex histological patterns associated with these diagnoses. Most non-specialist pathologists might encounter significant difficulty in dealing with such cases and may only be able to report a biopsy with any degree of accuracy after lengthy recourse to textbooks. The system, ‘dermdx’, is an attempt to help pathologists, especially those in trainiig or without specialist knowledge of dermatopathology, in making a diagnosis. The system fulfilsmost of the requirements expected of an expert system. The rule-base contains knowledge which is usually familiar only to specialists. It is able to provide the user with an explanation of its reasoning and can perform a ‘what if‘, function by which the user can examine the effect of changing conditions on the diagnosis. One possible deficiency of the system is that there is no ability for dealing with uncertainty or with probabilistic information. Dealing with uncertainty is a difficult problem in the field of expert systems. Some systems do so in ways that are statistically invalid. The Intellipath lymph node system relies on Bayes theorem to provide probability figures for diagnoses. However, the reliability of such a model depends on having an immense amount of statistical data which is not available, and is only sound if histological features vary independently of one another, which is usually not the case. Consequently, it may be preferable to deal with the problem by simplifying it and applying heuristic rules as is done here. Assessment of the system using 20 test cases showed that the system gave a single correct diagnosis in 12 cases and that in seven cases the correct diagnosis was among those suggested. One mistaken diagnosis was given. In the case of granulomatous conditions of the skin the system could not provide a specific diagnosis but this reflects uncertainties that are often present when making a histological diagnosis. It is possible that further

refinement of the rule-base or the use of secondary rulebases for difficult differential diagnostic problems would enable a more speciec diagnosis to be made. The ability of the system to make valid diagnoses will depend more on the rules entered into the rule-base than the computer program itself. The system has been structured so that drawing up of a rule-base is relatively straightforward and does not require any programming skills. The performance of the system will then depend more on the knowledge of the rule-base author and his ability to translate his diagnostic skills into a rule format. The system is not limited to use in dermatopathology and can easily be adapted to any problem domain. Whether systems such as this do Rnd a role in diagnostic pathology remains to be seen. Certainly the combined expert system and diagnostic work station may be useful in teaching hospitals. Smaller systems such as ‘dermdx’, which can be run on a PC with no additional equipment may well find use in routine diagnosis. It is doubtful whether any system has been adequately tested by a range of pathologists. The Intellipath system is being tested but currently it carries a disclaimer stating that there is no approval for treating patients based on its answers. It may be that consulting expert systems comes to be a sophisticated way of consulting a book and that reviews of systems join reviews of books in the back pages of journals.

References 1. Feigenbaum FA.Knowledge Engineering for the 1980s. Stanford. California: Stanford University Department of Computer Science. 1982: 1. 2. Bartels PH, Weber JE. expert systems in histopathology I. Introduction and overview. Anal. Quant. Cytol. Histol. 1989:11; 1-7. 3. Spackman KA. Connelly DP. Knowledge-based systems in laboratory medicine and pathology. A review and survey of the field. Arch. Pathol. Lab. Med. 1987; 111;116-119. 4. Healey JC,Spackman KA. Beck JR. Small expert system in clinical pathology. Arch. Pathol. Lab. Med. 1989;113;981-983. 5. Heathfield HA, Kirkham N, Ellis 10, Wlnstanley G. Computer assisted diagnosis of b e needle aspirate of the breast. 1. Clin. Pathd. 1990:44; 168-170. 6. Baak JPA, K w e r PHJ. Development and use of a debased pathology consultation system.Anal. Writ. CMtol. Hfstol. 1988: 10;214-224. 7. Nathwani BN, Heckerman DB. Horvitz EJ.LIncoln TL. Integrated expert systems and videodisc in surgical pathology: an overview. Hum. Pathol. 1990 21; 11-27. 8. Van Ginneken AM. Smeulders AWM.Reasoning in uncertalnties. An analysis of five strategies and their suitabilitg for pathology. Anal. Quant. Cytol. Histol. 1991:13: 93-109. 9. Heathaeld H, Bose D, Kirkham N. Knowledge-based computer system to atd in the histopathologicaldiagnosis ofbreast disease.1. Clin. Pathol. 1991:44; 502-508. 10. Ackerman AB. Histologic Dfagnosis of Z@unrnatory Skfn Diseases. Philadelphia: Lea & Pebiger, 1978.

Design of an expert system and its application to dermatopathology.

Expert systems are computer programs which use inference and knowledge to solve problems which usually require the expertise of a human specialist. Th...
490KB Sizes 0 Downloads 0 Views