Elective DSS and Expert System

DSS and Expert SystemUnit 46 min read

Expert Systems: Rules, Inference, and Applications

Unit 4 of DSS and Expert System explores how expert systems replicate human expertise using knowledge bases, inference engines, and rule-based reasoning. Learn their architecture, types, and real-world applications in healthcare, finance, and diagnostics, with step-by-step examples and comparisons to traditional AI.

What is an Expert System?

An expert system (ES) is an AI program that mimics human expertise in a specific domain by using knowledge bases (facts/rules) and an inference engine to solve complex problems. Unlike general AI, ES focuses on narrow, well-defined tasks where human experts exist.

Key Components

classDiagram
    class KnowledgeBase {
        +Facts (declarative knowledge)
        +Rules (if-then conditions)
    }
    class InferenceEngine {
        +Forward Chaining (data-driven)
        +Backward Chaining (goal-driven)
        +Conflict Resolution
    }
    class UserInterface {
        +Query Input
        +Explanation Facility
    }
    KnowledgeBase --> InferenceEngine : "Uses"
    InferenceEngine --> UserInterface : "Processes"

Knowledge Representation

1. Facts (Declarative Knowledge)

  • Stored as propositions (e.g., Patient(Fever, John)).
  • Represented in predicate logic or frames (structured objects).

2. Rules (Procedural Knowledge)

  • If-Then format:
    IF (Condition1 AND Condition2) THEN (Conclusion)
    
  • Example (Medical Diagnosis):
    IF (Symptom(Fever) AND Symptom(Cough)) THEN (Disease(CommonCold))
    

3. Heuristics

  • Rules of thumb derived from expert experience (e.g., "If blood pressure > 140, check for hypertension").

Inference Engines

Forward Chaining (Data-Driven)

  • Starts with known facts and applies rules to derive new conclusions.
  • Used in monitoring systems (e.g., alarm triggers).

Example: Fire Alarm System

  1. Facts: SmokeDetected(TRUE), Temperature(High)
  2. Rule: IF SmokeDetected(TRUE) AND Temperature(High) THEN Alert(Fire)
  3. Conclusion: Alert(Fire) → Triggers siren.

Backward Chaining (Goal-Driven)

  • Starts with a hypothesis and works backward to verify conditions.
  • Used in diagnostic systems (e.g., medical tests).

Example: Medical Diagnosis

  1. Goal: Disease(Diabetes)
  2. Rule: IF BloodSugar(High) AND Thirst(Excessive) THEN Disease(Diabetes)
  3. Check: Verify BloodSugar(High) and Thirst(Excessive) from patient data.

Types of Expert Systems

Type Example Application
Diagnostic MYCIN (medical diagnosis) Identifies diseases from symptoms.
Interpretive PROSPECTOR (geological analysis) Interprets mineral deposits.
Predictive Stock market analyzers Forecasts trends using historical data.
Prescriptive Loan approval systems Recommends actions (e.g., "Approve loan").
Control Industrial process controllers Adjusts parameters in real-time.

Real-World Applications in Nepal

1. eSewa (Nepal Government)

  • Idea Used: Rule-Based Decision Making
  • How: eSewa’s vehicle tax calculation uses predefined rules (e.g., "If vehicle age > 5 years, apply 20% surcharge").
  • Example:
    • Input: Vehicle(Age=6, Type=Car)
    • Rule: IF Age > 5 AND Type=Car THEN Tax=BaseTax + 20%
    • Output: Tax=₹5,000 + 20% = ₹6,000

2. Khalti (Digital Payments)

  • Idea Used: Fraud Detection (Backward Chaining)
  • How: Khalti’s system checks transactions against fraud rules:
    • Rule: IF Transaction(Amount>₹50,000) AND Location(HighRisk) THEN Flag(Fraud)
    • Example: A ₹60,000 transfer from Kathmandu to Dubai triggers a manual review.

3. NTC (Telecom Billing)

  • Idea Used: Forward Chaining for Billing
  • How: NTC’s billing system applies rules sequentially:
    • Facts: Plan(UnlimitedData), Usage(100GB)
    • Rule: IF Plan=UnlimitedData AND Usage>80GB THEN Warn(SlowSpeed)
    • Output: SMS alert to user.

Worked Example: Loan Approval System (Bank of Kathmandu)

Scenario: A bank uses an expert system to approve loans based on customer data.

Step 1: Define Rules

Rule 1: IF Income > ₹50,000 AND CreditScore > 700 THEN Approve(Loan)
Rule 2: IF Income ≤ ₹50,000 AND Savings > ₹200,000 THEN Approve(Loan)
Rule 3: IF Income ≤ ₹50,000 AND Savings ≤ ₹200,000 THEN Reject(Loan)

Step 2: Input Data

  • Customer A: Income=₹45,000, CreditScore=650, Savings=₹250,000
  • Customer B: Income=₹60,000, CreditScore=680, Savings=₹100,000

Step 3: Apply Inference

Customer Rule Applied Decision
A Rule 2 (Savings > ₹200,000) Approve(Loan)
B Rule 1 (Income > ₹50,000) Approve(Loan)

Visualization of Rule Application:

flowchart TD
    A["Customer A: Income=₹45K"] -->|"Savings=₹250K"| B["Rule 2"]
    B -->|"Savings > ₹200K"| C["Approve Loan"]
    D["Customer B: Income=₹60K"] -->|"CreditScore=680"| E["Rule 1"]
    E -->|"Income > ₹50K"| C

Advantages and Limitations

✅ Advantages

  • Consistency: Rules ensure uniform decisions (no human bias).
  • Explainability: Systems can justify conclusions (e.g., "Loan rejected because savings were low").
  • Speed: Faster than human experts for repetitive tasks.
  • Scalability: Handles large volumes (e.g., NTC billing millions of users).

❌ Limitations

  • Brittleness: Fails outside predefined rules (e.g., a new disease symptom).
  • Knowledge Acquisition Bottleneck: Requires experts to encode rules.
  • No Common Sense: Cannot handle ambiguous or novel situations.

Expert Systems vs. Traditional AI

Feature Expert Systems Traditional AI (ML/DL)
Knowledge Source Human experts (rules) Data (statistical patterns)
Flexibility Rigid (fixed rules) Adaptive (learns from data)
Explainability High (rules are transparent) Low (black-box models)
Example MYCIN (medical diagnosis) Google’s AlphaGo (reinforcement learning)

Exam Tip

  1. Define Clearly: Always start with the components (knowledge base + inference engine) and types of expert systems.
  2. Show Work: For numerical examples (e.g., loan approval), list rules step-by-step and mark the applied rule.
  3. Compare: Questions often ask to contrast expert systems with ML/AI. Use the table above.
  4. Real-World Tie: Link examples to Nepali contexts (e.g., eSewa rules, Khalti fraud detection).
  5. Diagrams: Draw rule-chaining flows or system architectures to visualize inference steps.

Based on the TU BIT syllabus for DSS and Expert System, unit 4.

Discussion

Loading…