Docsity

Artifical intelligence, Schemes and Mind Maps of Artificial Intelligence

Toggle sidebar
bg1
Advanced Topics
1. Expert Systems
Expert Systems (ES) are computer programs designed to emulate the decision-making ability of a human
expert in a specific domain. They use a knowledge base of human expertise to solve problems that
typically require human intelligence.
Representation in Expert Systems:
The way knowledge is represented is crucial for the effectiveness of an expert system. Common
representation techniques include:
• Rule-Based Systems: Knowledge is represented as a set of IF-THEN rules.
o Example:
o IF (patient has fever) AND (patient has cough) THEN (likely diagnosis is flu)
o IF (patient has fever) AND (patient has sore throat) THEN (likely diagnosis is strep throat)
o IF (engine does not start) AND (battery is dead) THEN (solution is charge battery)
o Explanation: These rules link conditions (premises in the IF part) to conclusions or
actions (actions in the THEN part). The system uses these rules to reason about the
input data.
• Frame-Based Systems: Knowledge is organized into frames, where each frame represents an
object or a concept and contains slots (attributes) with associated values.
o Example: A frame for a "Car":
o Frame: Car
o Slots:
o Make: (Value: Toyota)
o Model: (Value: Camry)
o Color: (Value: Red)
o Engine: (Value: Gasoline)
o Problem: (Value: ?)
o Possible_Solutions: (Value: ?)
o Explanation: When a specific car with a problem is encountered, the "Problem" slot is
filled, and the system can use rules or other knowledge linked to the "Car" frame to
determine "Possible_Solutions".
• Semantic Networks: Knowledge is represented as a graph of nodes (concepts or objects)
connected by edges (relationships).
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Artifical intelligence and more Schemes and Mind Maps Artificial Intelligence in PDF only on Docsity!

Advanced Topics

1. Expert Systems Expert Systems (ES) are computer programs designed to emulate the decision-making ability of a human expert in a specific domain. They use a knowledge base of human expertise to solve problems that typically require human intelligence. Representation in Expert Systems: The way knowledge is represented is crucial for the effectiveness of an expert system. Common representation techniques include: - Rule-Based Systems: Knowledge is represented as a set of IF-THEN rules. o Example: o IF (patient has fever) AND (patient has cough) THEN (likely diagnosis is flu) o IF (patient has fever) AND (patient has sore throat) THEN (likely diagnosis is strep throat) o IF (engine does not start) AND (battery is dead) THEN (solution is charge battery) o Explanation: These rules link conditions (premises in the IF part) to conclusions or actions (actions in the THEN part). The system uses these rules to reason about the input data. - Frame-Based Systems: Knowledge is organized into frames, where each frame represents an object or a concept and contains slots (attributes) with associated values. o Example: A frame for a "Car": o Frame: Car o Slots: o Make: (Value: Toyota) o Model: (Value: Camry) o Color: (Value: Red) o Engine: (Value: Gasoline) o Problem: (Value: ?) o Possible_Solutions: (Value: ?) o Explanation: When a specific car with a problem is encountered, the "Problem" slot is filled, and the system can use rules or other knowledge linked to the "Car" frame to determine "Possible_Solutions". - Semantic Networks: Knowledge is represented as a graph of nodes (concepts or objects) connected by edges (relationships).

o Example: A semantic network for car problems: ▪ Nodes: Car, Engine, Battery, Fuel System, DoesNotStart, LowPower, NoFuel ▪ Edges: ▪ (Car) --has-part--> (Engine) ▪ (Engine) --powered-by--> (Battery) ▪ (Engine) --requires--> (Fuel System) ▪ (Car) --symptom--> (DoesNotStart) ▪ (Battery) --condition--> (LowPower) ▪ (Fuel System) --condition--> (NoFuel) ▪ (DoesNotStart) --caused-by--> (LowPower) ▪ (DoesNotStart) --caused-by--> (NoFuel) o Explanation: The network shows relationships between car components, symptoms, and potential causes, allowing the system to trace possible reasons for a problem. Expert System Shells: An expert system shell is a software development environment containing the essential components for building an expert system. It provides the structure and tools, allowing developers to focus on encoding the domain-specific knowledge. Key components of a shell include:

  • Knowledge Base Editor: For creating and modifying the knowledge base (rules, frames, etc.).
  • Inference Engine: The core of the shell, responsible for reasoning with the knowledge base to derive conclusions. Common inference mechanisms include forward chaining (data-driven) and backward chaining (goal-driven).
  • User Interface: For interacting with the end-user, allowing them to input information and receive advice or explanations.
  • Explanation Facility: Enables the system to explain its reasoning process, showing the rules or steps it followed to reach a conclusion.
  • Debugging Tools: To help developers identify and fix errors in the knowledge base. Examples of Expert System Shells:
  • CLIPS (C Language Integrated Production System): A widely used rule-based programming language and shell developed by NASA.
  • JESS (Java Expert System Shell): A rule engine and scripting environment for building expert systems in Java.
  • Drools: An open-source business rule management system with a powerful inference engine.

Consider a rule-based expert system for diagnosing simple plant problems: Knowledge Base (Rules):

  1. IF (leaves are yellow) AND (soil is wet) THEN (likely problem is overwatering)
  2. IF (leaves are yellow) AND (soil is dry) THEN (likely problem is underwatering)
  3. IF (leaves have brown spots) THEN (likely problem is fungal infection)
  4. IF (plant is wilting) AND (soil is dry) THEN (likely problem is underwatering) Inference Engine: Uses forward chaining. User Input:
  • Leaves are yellow.
  • Soil is wet. Reasoning: The inference engine matches the input against the rules. Rule 1's conditions are met. Output: Likely problem is overwatering. Explanation: The system could explain that it used Rule 1, which states "IF (leaves are yellow) AND (soil is wet) THEN (likely problem is overwatering)," and the user provided information matching the conditions. 2. Game Playing AI in game playing involves developing algorithms that can play games, often with the goal of playing optimally or at a human expert level. Games provide well-defined environments with clear rules, making them excellent testbeds for AI techniques. Minimax Search Procedure: The Minimax algorithm is a fundamental decision-making algorithm used in two-player zero-sum games (where one player's gain is the other's loss), such as chess, tic-tac-toe, and checkers. It aims to find the optimal move for the current player (the "maximizing player") by considering all possible moves for both players. How it Works:
  1. Game Tree Generation: The algorithm explores the game state space by generating a game tree, starting from the current state. Each node in the tree represents a game state, and the edges represent possible moves.
  2. Terminal State Evaluation: The leaves of the game tree are terminal states (e.g., a win, loss, or draw). These states are assigned a utility value (a score) that indicates the outcome for the maximizing player. A positive value indicates a win for the maximizer, a negative value indicates a loss, and zero indicates a draw.
  1. Backpropagation of Values: The algorithm then propagates these utility values up the tree, alternating between maximizing and minimizing levels: o Maximizing Player's Turn: At these levels, the algorithm chooses the move that leads to the state with the highest utility value among its children. o Minimizing Player's Turn: At these levels (representing the opponent's moves), the algorithm assumes the opponent will choose the move that leads to the state with the lowest utility value (the worst outcome for the maximizing player). Example (Tic-Tac-Toe): Consider a simple tic-tac-toe game where 'X' is the maximizing player and 'O' is the minimizing player. The algorithm explores possible moves, evaluates terminal states (win/loss/draw), and backpropagates the scores. X's Turn /| / | ... ... ... (Possible moves for X) / | O's Turn O's Turn O's Turn /|\ /|\ /| ... ... ... ... ... ... (Possible moves for O) / | \ / | \ / | Terminal Terminal Terminal ... (Win X) (Draw) (Lose X) The terminal states are evaluated (+1 for X win, - 1 for O win, 0 for draw). The values are then propagated up. At O's turn, the minimum value of the children is chosen. At X's turn, the maximum value is chosen. The initial move for X is selected based on the branch that leads to the highest minimax value. Alpha-Beta Pruning: Alpha-Beta pruning is an optimization technique for the Minimax algorithm that reduces the number of nodes explored in the game tree without affecting the final result. It works by maintaining two values:
  • Alpha (α): The best (highest) value found so far for the maximizing player along the current path.
  • Beta (β): The best (lowest) value found so far for the minimizing player along the current path. How it Works:

Ant Colony System (ACS): The Ant Colony System is a probabilistic metaheuristic inspired by the foraging behavior of ant colonies. Ants initially explore the environment randomly, but when they find a food source, they deposit pheromone trails on the path back to the nest. Subsequent ants are more likely to follow paths with stronger pheromone concentrations. Over time, shorter paths tend to have higher pheromone concentrations because they can be traversed more quickly, leading to a positive feedback loop that allows the colony to find the shortest path to food. Development of Ant Colony System: The Ant Colony System was developed by Marco Dorigo and colleagues in the early 1990s. The initial algorithm, Ant System, laid the foundation, and subsequent improvements led to the Ant Colony System and its variants. Key ideas in its development include:

  • Pheromone Trails: Artificial ants deposit pheromone on the edges of a graph representing the problem space.
  • Probabilistic Decision Making: Ants probabilistically choose their next move based on the pheromone concentration and the heuristic desirability of the move.
  • Pheromone Evaporation: Pheromone trails evaporate over time, preventing premature convergence to suboptimal solutions and allowing the exploration of new paths.
  • Local Pheromone Update: Ants update the pheromone on the edges they traverse, influencing the decisions of subsequent ants.
  • Global Pheromone Update: After all ants have completed a tour, the pheromone on the best tour found so far is reinforced. Application of Ant Colony System: ACS has been successfully applied to a wide range of combinatorial optimization problems, including:
  • Traveling Salesperson Problem (TSP): Finding the shortest tour that visits each city exactly once and returns to the starting city. o Example: Ants traverse a graph where cities are nodes and distances are edge weights. They build tours probabilistically based on pheromone and distance, and the pheromone is updated on the best tours.
  • Vehicle Routing Problem (VRP): Designing optimal routes for a fleet of vehicles to serve a set of customers. o Example: Ants construct routes for vehicles to visit customers with specific demands, considering capacity constraints and travel distances.
  • Graph Coloring: Assigning colors to the vertices of a graph such that no two adjacent vertices share the same color.

o Example: Ants iteratively try to color the vertices, using pheromone to guide them towards valid colorings.

  • Job Shop Scheduling: Finding an optimal schedule for a set of jobs to be processed on a set of machines with specific constraints. o Example: Ants build schedules by selecting operations and machines, using pheromone to represent good scheduling decisions.
  • Network Routing: Finding optimal paths for data packets in a network. o Example: Ants explore network paths, and pheromone indicates the desirability of certain links based on congestion and latency. Working of Ant Colony System: The basic steps of the Ant Colony System algorithm are as follows:
  1. Initialization: o Initialize pheromone levels on all edges of the graph representing the problem. Typically, a small uniform value is used. o Place a population of artificial ants at starting nodes (e.g., a city in TSP).
  2. Ant Colony Construction: o Each ant iteratively builds a solution (e.g., a tour in TSP) by probabilistically selecting the next component (e.g., the next city to visit). o The probability of choosing a particular move is influenced by two factors: ▪ Pheromone Concentration: Higher pheromone levels on an edge increase the probability of that edge being chosen. ▪ Heuristic Information: Problem-specific heuristics (e.g., the inverse of the distance to a city in TSP) can also influence the decision. o Ants typically maintain a memory of the components they have already visited to ensure a valid solution. o Local Pheromone Update: While constructing the solution, ants often perform a local pheromone update on the edges they traverse, reducing the pheromone level slightly to encourage exploration of other paths.
  3. Pheromone Update: o Once all ants have completed their solutions (tours), the pheromone trails are updated. o Pheromone Evaporation: The pheromone on all edges is decreased by a certain factor to simulate evaporation.