Professional Documents
Culture Documents
Expert Systems in AI
Course teacher:
Dr. S. Syed Rafiammal
Assistant Professor, ECE department
BS Abdur Rahman Crescent Institute of Science and Technology
What is an Expert System?
https://www.javatpoint.com/expert-systems-in-artificial-intelligence
Motive
• The system helps in decision making for
complex problems using both facts and
heuristics like a human expert.
• It is called so because it contains the expert
knowledge of a specific domain and can solve
any complex problem of that particular
domain.
• These systems are designed for a specific
domain, such as medicine, science, etc.
Components of Expert System
https://www.javatpoint.com/expert-
systems-in-artificial-intelligence
User Interface
• It is an interface that helps a non-expert
user to communicate with the expert system
to find a solution
• With the help of a user interface, the expert
system interacts with the user, takes queries as
an input in a readable format, and passes it to
the inference engine.
• After getting the response from the inference
engine, it displays the output to the user.
Inference Engine(Rules of Engine)
• The inference engine is known as the brain of the expert system as it
is the main processing unit of the system.
• It applies inference rules to the knowledge base to derive a
conclusion or deduce new information.
• It helps in deriving an error-free solution of queries asked by the user.
• With the help of an inference engine, the system extracts the
knowledge from the knowledge base.
There are two types of inference engine:
• Deterministic Inference engine: The conclusions drawn from this type
of inference engine are assumed to be true. It is based
on facts and rules.
• Probabilistic Inference engine: This type of inference engine contains
uncertainty in conclusions, and based on the probability.
Knowledge Base
• These rules are based on visual symptoms observed in the leaf images.
• Machine Learning Component: Use a neural network (in
this case, a convolutional neural network or CNN) to learn
from the images. Train the model on the labeled dataset to
classify leaf images into healthy or disease categories.
• Inference Engine: Implement an inference engine that
combines the output from the rule-based component and
the machine learning component. It can be as simple as
considering the rule-based diagnosis unless the confidence
of the neural network prediction is high.
if confidence >= 0.8:
diagnosis = neural_network_prediction
Example Python program for Rule based expert system
with machine learning
# Rule-Based Component
def rule_based_diagnosis(leaf_image):
# Implement rules to diagnose based on visual symptoms
# Example: Check for yellow spots, curling leaves, brown spots,
wilted leaves, etc.
if yellow_spots and curling_leaves:
return "Yellow Leaf Curl Virus"
elif brown_spots and wilted_leaves:
return "Fungal Infection"
else:
return "Healthy"
# Machine Learning Component (Neural Network)
def neural_network_diagnosis(leaf_image):
# Use a pre-trained CNN model or train one on the dataset
# Return the predicted class (disease or healthy)
# Inference Engine
def expert_system_diagnosis(leaf_image):
rule_based = rule_based_diagnosis(leaf_image)
neural_network, confidence = neural_network_diagnosis(leaf_image)