Expert Systems Notes

Intelligent Systems

What is Knowledge?

  • Knowledge is a theoretical or practical understanding of a subject or domain.

  • It's the sum of what is currently known.

  • Knowledge is power, and those who possess it are called experts.

Rules as a Knowledge Representation Technique

  • Experts often express knowledge as rules for problem-solving.

  • A rule in AI is an IF-THEN structure, relating information/facts (IF part) to an action (THEN part).

  • These are called production rules or just rules.

  • Rules describe how to solve a problem and are easy to create and understand.

  • Any rule consists of two parts:

    • The IF part: antecedent (premise or condition).

    • The THEN part: consequent (conclusion or action).

  • The basic syntax of a rule is:

    • IF <antecedent> THEN <consequent>

  • A rule can have multiple antecedents joined by AND (conjunction), OR (disjunction), or a combination.

  • Avoid mixing conjunctions and disjunctions in the same rule.

Rule Types

  • Relation: IF the 'fuel tank' is empty THEN the car is dead

  • Recommendation: IF the season is autumn AND the sky is cloudy AND the forecast is drizzle THEN the advice is 'take an umbrella'

  • Directive: IF the car is dead AND the 'fuel tank' is empty THEN the action is 'refuel the car'

  • Heuristic: IF the spill is liquid AND the 'spill pH' < 6 AND the 'spill smell' is vinegar THEN the 'spill material' is 'acetic acid'

  • Strategy:

    • IF the car is dead THEN the action is 'check the fuel tank'; step1 is complete

    • IF step1 is complete AND the 'fuel tank' is full THEN the action is 'check the battery'; step2 is complete

Expert Systems (XPS)

  • Rely on internally represented knowledge to perform tasks.

  • Use reasoning methods to derive new knowledge.

  • Usually restricted to a specific problem domain; some try to capture more general knowledge.

What is an Expert System?
  • Definition 1: A computer system that emulates the decision-making ability of a human expert in a restricted domain.

  • Definition 2: An intelligent computer program that uses knowledge and inference procedures to solve problems that require significant human expertise.

  • Sometimes called knowledge-based systems.

Concepts and Characteristics of XPS
  • Knowledge Acquisition: Transfer of knowledge from humans to computers or directly from the environment (machine learning, neural networks).

  • Knowledge Representation: Suitable for storing and processing knowledge in computers.

  • Inference: Mechanism that generates new conclusions from existing knowledge.

  • Explanation: Illustrates how and why a solution was generated.

The Key to XPS Success
  • Convincing ideas: rules, cognitive models.

  • Practical applications: medicine, computer technology, etc.

  • Separation of knowledge and inference: expert system shell (allows reuse for different domains).

  • Concentration on domain knowledge: general reasoning is too complicated.

When (Not) to Use an XPS
  • Not suitable for all domains and tasks.

  • Not useful/preferable when:

    • Efficient conventional algorithms are known.

    • The main challenge is computation, not knowledge.

    • Knowledge cannot be captured efficiently or used effectively.

    • Users are reluctant due to task criticality, high risk, or high-security demands.

The Main Players in the Expert System Development Team

  • Domain Expert: Knowledgeable and skilled person in a specific area, with deep knowledge and practical experience. Must be able to communicate knowledge, be willing to participate, and commit time.

  • Knowledge Engineer: Capable of designing, building, and testing an expert system. Interviews the domain expert, chooses development software, encodes knowledge, tests, revises, and integrates the system.

  • Programmer: Responsible for programming, describing domain knowledge in computer-understandable terms. Needs skills in symbolic programming (LISP, Prolog, OPS5) and conventional languages (C, Pascal, FORTRAN, Basic). Develops knowledge/data representation structures, control structure, and dialogue structure if a shell isn't used.

  • Project Manager: Leader of the development team, responsible for keeping the project on track, meeting deliverables and milestones, and interacting with team members.

  • End-user: Person who uses the expert system. System acceptance depends on user satisfaction and comfort.

Basic Structure of a Rule-based Expert System

  • Knowledge Base: Contains domain knowledge as a set of rules. Each rule specifies a relation, recommendation, directive, strategy, or heuristic with an IF-THEN structure. When the condition is satisfied, the rule fires, and the action is executed.

  • Database: Includes facts used to match against the IF parts of rules in the knowledge base.

  • Inference Engine: Carries out reasoning to reach a solution, linking rules in the knowledge base with facts in the database.

  • Explanation Facilities: Allows the user to ask how a conclusion was reached and why a specific fact is needed.

  • User Interface: Means of communication between the user and the expert system.

Fundamental Characteristics of an Expert System

  • Performs at a human expert level in a narrow, specialized domain.

  • High-quality performance is most important.

  • Explanation capability: reviews its reasoning and explains its decisions.

  • Employs symbolic reasoning and permits inexact reasoning; can deal with incomplete, uncertain, and fuzzy data.

Can Expert Systems Make Mistakes?
  • Yes, because even human experts make mistakes.

Do Conventional Programs Have an Advantage over Expert Systems?
  • Conventional programs require complete and exact data.

  • Expert systems can work with incomplete or fuzzy data and still arrive at reasonable conclusions.

  • Knowledge is separated from processing in expert systems (knowledge base and inference engine are split up).

  • New rules easily add knowledge, and the system can be modified by changing or subtracting rules.

Comparison of Expert Systems with Conventional Systems and Human Experts

Feature

Human Experts

Expert Systems

Conventional Programs

Knowledge Representation

Rules of thumb or heuristics

Rules, symbolic reasoning

Algorithms, well-defined operations

Knowledge Form

Compiled form in the brain

Clear separation from processing

Do not separate knowledge from control structure

Explanation Capability

Can explain reasoning details

Can trace rules fired and explain how conclusions were reached and why data was needed

Do not explain how results were obtained or why data was needed

Reasoning

Inexact reasoning, deals with incomplete/uncertain/fuzzy information

Permitt inexact reasoning, deals with incomplete/uncertain/fuzzy data

Work only on problems where data is complete and exact

Handling Incomplete Data

Can make mistakes

Can make mistakes

Provide no solution or a wrong one

Quality Enhancement

Years of learning and training (slow, inefficient, expensive)

Adding new rules or adjusting old ones (easy to accomplish)

Changing program code (affects both knowledge and its processing, making changes difficult)

Forward Chaining and Backward Chaining Inference Techniques

  • Knowledge is represented by IF-THEN production rules.

  • Data is represented by facts about the current situation.

  • The inference engine compares rules with facts.

Match-Fire Procedure
  • When the IF part of a rule matches a fact, the rule is fired, and its THEN part is executed, possibly adding a new fact.

  • Matching rule IF parts to facts produces inference chains, indicating how rules are applied to reach a conclusion.

Chaining Types
  • Forward chaining: data-driven reasoning, starts from known data and proceeds forward.

  • Backward chaining: goal-driven reasoning, starts with a hypothetical solution and attempts to find evidence to prove it.

Forward Chaining
  • Gathers information and infers from it whatever can be inferred.

  • A real system might fire many rules, deriving facts unrelated to the goal.

Backward Chaining
  • Searches for rules with the desired solution in their THEN parts.

  • If a rule is found and its IF part matches database data, the rule is fired, and the goal is proved.

How do We Choose between Forward and Backward Chaining?
  • Study how a domain expert solves the problem.

  • Forward chaining: expert gathers information and infers from it.
    *Design for expert system for analysis and interpretation

  • Backward chaining: expert starts with a hypothetical solution and seeks facts to prove it.
    *Design for expert systems for diagnostic purposes

Can We Combine Forward and Backward Chaining?
  • Many expert system shells use a combination.

  • The basic mechanism is usually backward chaining.

  • Forward chaining is used when a new fact is established to maximize the use of new data.