A Generic Knowledge Based Medical Diagnosis Expert System

Xin Huang, Xuejiao Tang, Wenbin Zhang, Shichao Pei, Ji Zhang, Wensheng Gan, Mingli Zhang, Zhen Liu, Ruijun Chen, Yiyi Huang

Introduction

Artificial Intelligence has become a cornerstone of modern medical diagnostics. However, many traditional expert systems remain "black boxes," offering text-heavy outputs that are difficult for clinicians and patients to interpret. Furthermore, these systems are often hard-coded for specific medical domains, limiting their flexibility. This paper introduces a generic Medical Knowledge Based System (MKBS) designed to bridge the gap between complex symbolic reasoning and human usability. By integrating a logic-based Prolog backend with a modern Java-based graphical user interface (GUI), the system provides transparent, visual decision-making paths for a variety of diseases.

System Architecture

The MKBS is designed as an "expert system shell" (exshell), where the reasoning logic is decoupled from the specific medical data. This modularity allows the system to be adapted to different medical domains simply by updating the underlying rule files.

High-level system architecture of the MKBS including the knowledge base, inference engine, and user interface.

The architecture consists of four primary components:

  1. Knowledge Base: A hybrid repository where diagnostic logic is stored as hierarchical IF-THEN rules, and descriptive disease properties (e.g., treatments, subtypes) are organized within a semantic net.
  2. Inference Engine: Utilizing a backward-chaining approach, the engine starts with a hypothetical diagnosis and works backward to verify if the patient's symptoms (facts) support the goal.
  3. Working Memory: Stores the current facts and intermediate results during a diagnostic session.
  4. User Interface: A Java-based GUI that facilitates real-time interaction, rule editing, and visualization of the reasoning process.

Methodology and Implementation

To handle the inherent ambiguity of medical symptoms, the system employs Certainty Factors (CF). These values, ranging from 0 (definitely false) to 1 (definitely true), quantify the confidence in a diagnosis. The system calculates the final certainty using the formula $CF = RuleCF \times PremiseCF$.

The technical implementation leverages JIProlog, a Java-based Prolog interpreter, to manage the symbolic logic. Communication between the logic server and the Java application is handled via socket-based messaging. For visualization, the system uses the yFiles library to transform standard Prolog traces into intuitive "Decision Making Trees."

Results and Case Studies

The system's efficacy was evaluated using a knowledge base covering 23 diseases, including asthma, diabetes, and various cancers. A primary highlight is the system's ability to visualize its reasoning.

A visualized decision tree for a Tuberculosis diagnosis, showing symptoms and their associated certainty factors.

In a case study for Tuberculosis, the system processed symptoms such as a "mild ongoing cough," "weight loss," and "blood in sputum." It successfully navigated the rule hierarchy to provide a diagnosis with a calculated certainty factor of 0.45. Unlike traditional systems, the MKBS presented this result as a clear tree diagram, allowing the user to trace exactly how the conclusion was reached. Additionally, the semantic net component allowed for complex property searches, such as distinguishing between small-cell and non-small-cell lung cancers and their respective treatments.

Conclusion and Future Directions

The MKBS represents a significant step toward making medical expert systems more transparent and adaptable. By providing a generic shell and visual logic maps, it empowers both medical professionals and patients to understand the "why" behind a diagnosis.

However, challenges remain. Expanding the knowledge base beyond the initial 23 diseases requires extensive knowledge engineering. Future work will focus on refining the inference rules for semantic networks and conducting clinical validation studies to assess the system's utility in real-world medical environments.

Summary updated

Abstract

In this paper, we design and implement a generic medical knowledge based system (MKBS) for identifying diseases from several symptoms. In this system, some important aspects like knowledge bases system, knowledge representation, inference engine have been addressed. The system asks users different questions and inference engines will use the certainty factor to prune out low possible solutions. The proposed disease diagnosis system also uses a graphical user interface (GUI) to facilitate users to interact with the expert system. Our expert system is generic and flexible, which can be integrated with any rule bases system in disease diagnosis.
BibTeX
@inproceedings{huang2021generic,
  author = {Xin Huang and Xuejiao Tang and Wenbin Zhang and Shichao Pei and Ji Zhang and Wensheng Gan and Mingli Zhang and Zhen Liu and Ruijun Chen and Yiyi Huang},
  title = {{A Generic Knowledge Based Medical Diagnosis Expert System}},
  booktitle = {iiWAS},
  year = {2021},
  doi = {10.1145/3487664.3487728},
}
Figure