Unit 6 Uncertainty.pptx

31 May 2023
1 sur 60

Unit 6 Uncertainty.pptx

• 1. Sanjivani Rural Education Society’s Sanjivani College of Engineering, Kopargaon-423603 (AnAutonomous Institute Affiliated to Savitribai Phule Pune University, Pune) NAAC ‘A’GradeAccredited, ISO 9001:2015 Certified Department of Information Technology (NBA Accredited) Department:- Information Technology Name of Subject:- Artificial Intelligence Class:- TYIT Subject Code:- IT313 Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 2. Course Objectives: 1. To understand the basic principles of Artificial Intelligence 2. To provide an understanding of uninformed search strategies. 3. To provide an understanding of informed search strategies. 4. To study the concepts of Knowledge based system. 5. To learn and understand use of fuzzy logic and neural networks. 6. To learn and understand various application domain of Artificial Intelligence. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 3. Uncertainty Till now, we have learned knowledge representation using first-order logic and propositional logic with certainty, which means we were sure about the predicates. With this knowledge representation, we might write A→B, which means if A is true then B is true, but consider a situation where we are not sure about whether A is true or not then we cannot express this statement, this situation is called uncertainty.  So to represent uncertain knowledge, where we are not sure about the predicates, we need uncertain reasoning or probabilistic reasoning. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 4. Non Monotonic Reasoning  In Non-monotonic reasoning, some conclusions may be invalidated if we add some more information to our knowledge base.  Logic will be said as non-monotonic if some conclusions can be invalidated by adding more knowledge into our knowledge base.  Non-monotonic reasoning deals with incomplete and uncertain models.  "Human perceptions for various things in daily life”, is a general example of non-monotonic reasoning.  Example: Let suppose the knowledge base contains the following knowledge; Birds can fly Penguins cannot fly Pitty is a bird So from the above sentences, we can conclude that Pitty can fly. However, if we add one another sentence into knowledge base "Pitty is a penguin", which concludes "Pitty cannot fly", so it invalidates the above conclusion. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 5. Non Monotonic Reasoning Advantages of Non-monotonic reasoning:  For real-world systems such as Robot navigation, we can use non-monotonic reasoning.  In Non-monotonic reasoning, we can choose probabilistic facts or can make assumptions. Sanjivani College of Engineering, Kopargaon Dept of Information Technology Disadvantages of Non-monotonic Reasoning:  In non-monotonic reasoning, the old facts may be invalidated by adding new sentences.  It cannot be used for theorem proving.
• 6. Logics for Non Monotonic Reasoning Suppose the purchasing agent is investigating purchasing holidays. A resort may be adjacent to a beach or away from a beach. This is not symmetric; if the resort was adjacent to a beach, the knowledge provider would specify this.  Thus, it is reasonable to have the clause away_from_beach ← ∼ on_beach. This clause enables an agent to infer that a resort is away from the beach if the agent is not told it is adjacent to a beach. A cooperative system tries to not mislead. If we are told the resort is on the beach, we would expect that resort users would have access to the beach. If they have access to a beach, we would expect them to be able to swim at the beach. Thus, we would expect the following defaults: beach_access ←on_beach 𝖠 ∼ abbeach_access. swim_at_beach ←beach_access 𝖠 ∼ abswim_at_beach. A cooperative system would tell us if a resort on the beach has no beach access or if there is no swimming. We could also specify that, if there is an enclosed bay and a big city, then there is no swimming, by default: abswim_at_beach ←enclosed_bay 𝖠big_city 𝖠 ∼ abno_swimming_near_city. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 7. Semantic Network Semantic Networks or Semantic Net is a knowledge representation technique used for propositional information. Though its versions were long being used in philosophy, cognitive science (in the form of semantic memory), and linguistics, Semantic Network’s implementation in computer science was first developed for artificial intelligence and machine learning.  It is a knowledge base that represents concepts in a network and the systematic relations between them. Semantic Network is a directed or undirected graph consisting of vertices. These vertices represent concepts and edges, which further represent semantic relations between concepts, mapping or connecting semantic fields.  Moreover, it is termed as Associative Networks, as it processes the knowledge about accepted meanings in adjacent regions. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 8. Semantic Network A semantic net (or semantic network) is a knowledge representation technique used for propositional information. So it is also called a propositional net. Semantic nets convey meaning. They are two dimensional representations of knowledge.  Mathematically a semantic net can be defined as a labeled directed graph. The main idea behind semantic nets is that the meaning of a concept comes from the ways in which it is connected to other concepts. In semantic net, information is represented as a set of nodes connected to each other by set of labeled arcs, which represent relationships among the nodes. INHERITANCE REASONING  Semantic net allows us to perform inheritance reasoning as all members of a class will inherit all the properties of super class .  We could use inheritance to derive the additional relation. Semantic nets allow multiple inheritance.  So an object can belong to more than one category and a category can be a subset of more than one another category. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 9. Semantic Network SEMANTIC NETWORK EXAMPLES: Some of the examples of Semantic Networks are: 1. WordNet: A lexical database of English that groups English words into sets of synonyms (synsets), provides definitions, and records semantic relations between them. 2. Gellish Model: It is a formal language that is defined as a network of relations between concepts and names of concepts. It started out as an engineering modeling language ("Generic Engineering Language", giving it the name, "Gellish") 3. Logical Descriptions: Semantic Networks can also be used to represent logical descriptions like Charles Sanders Peirce’s existential graphs or John F. Sowa's conceptual graphs. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 10. Semantic Network  AI agents have to store and organize information in their memory. One of the ways they do this is by using semantic networks.  Semantic networks are a way of representing relationships between objects and ideas. For example, a network might tell a computer the relationship between different animals (a cat IS A mammal, a cat HAS whiskers). Below is an example image of a semantic network; Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 11. Components of Semantic Network Semantic Networks can further be defined by specifying its fundamental components, which are: 1. Lexical Components - Consists of;  Nodes represent the object or concept.  Links: Denoting relation between nodes.  Labels: Denoting particular objects & relations. 2. Structural Component - Here the links and nodes form a directed graph wherein the labels are placed on the link and nodes. 3. Semantic Component - The meanings here are related to the links and labels of nodes, whereas the facts are dependent on the approved areas. 4. Procedural Part - The creation of new links and nodes is permitted by constructors, whereas the destructors are responsible for the removal of links and nodes. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 12. Example · Tom caught a cat · Tom is owned by rashan. · Tom is brown in colour. · Dogs like bones. · The dog sat on the mat. · A dog is a mammal. · A cat is an instance animal · All mammals are animals. · Mammals have fur.  This network contains examples of isa relation, as well as some other, more domain-specific relations like sat_on, like, caught, is_coloured, is_owned_by.  In this network, we could use inheritance to derive the additional relation; sat_on (Tom,Mat) Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 13. Advantages & Disadvantages Advantages: Semantic nets have the ability to represent default values for categories. In the above figure John has one leg while he is a person and all persons have two legs. So persons have two legs has only default status which can be overridden by a specific value. 1. They convey some meaning in a transparent manner. 2. They nets are simple and easy to understand. 3. They are easy to translate into PROLOG. Disadvantages: Sanjivani College of Engineering, Kopargaon Dept of Information Technology semantic One of the drawbacks of network is that the links between the objects represent only binary relations. For example, the sentence Run(RajdhaniExpress, Chandigarh, Delhi, Tomorrow) cannot be asserted directly. There is no standard definition of link names.
• 14. Truth Maintenance System  TMS is a “Truth Maintenance System” which implements to permit a form of non-monotonic reasoning by permitting the addition of changing statements to a knowledge base.  It is also known as “Belief-Revision” or “Revision Management Systems“.  Role of Truth Maintenance System: 1.The main job of TMS is to maintain “consistency of knowledge” being used by the problem solver and not to perform any inference functions. 2.TMS also gives the inference – component, the latitude to perform non-monotonic inferences. 3.When discoveries made, this more recent information can displace previous conclusions that are no longer valid. 14 K. S. Ubale Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 15. Justification based Truth Maintenance Systems  JTMS utilizes three types of nodes, where each node is associated with an assertion; 1. Premises: Their justifications (provided by the IE) have no antecedents. 2. Contradictions: They are no different from other nodes expect that the IE has explicitly designated them as contradictions. It a contradiction node becomes believed, JTMS must signal the IE and the IE must assure that the contradiction node is no longer believed. 3. Assumptions: These are also designated by the IE. An assumption is enabled if the IE has instructed the JTMS to believe it. If an assumption node has a valid justification, then it is treated as a “regular” node. In dependency networks the following symbols are used for representation : Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 16. JTMS node’s labels  Nodes can be either IN or OUT where; 1. IN means “believed”. 2. OUT means “not believed”. Sanjivani College of Engineering, Kopargaon Dept of Information Technology N1 is “OUT”  Consider the following 4 cases; N1 is “IN” (not N1) is “IN” (not N1) is “OUT” Note: A node being “IN” does not mean a node is “true”. Contradiction (not N1) is true N1 is true Unknown
• 17. JTMS justifications Here N1 and N2 are the antecedents of justification, J1, and N3 is the consequent. The informant is ignored or it may record information from the external systems. A justification is valid if its antecedents are : IN.  Example justification: N1 N2 J1 N3 Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 18. Prepositional specification of a JTMS JTMS is defined by the following two sets:  The set of enabled assumptions A.  The set of justifications J. The set of justifications grows monotonically, because justifications cannot be removed. Justifications are Horn clauses, therefore we can think of them as implications in PL.  JTMS nodes are propositional symbols. They form the JTMS belief set, Bel. The fundamental task of JTMS is to answer queries about whether a given node holds(is “N”) in a given set of beliefs and justifications. JTMS classified node N, as “IN” iff; 1. The node is an enabled assumption or a premise. 2. Bel U J |--PL N Otherwise node N is “ OUT ”. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 19. Example of JTMS: How it helps the IE to improve its efficiency Consider the following example: JTMS maintains the records of previous IE work, which is why there is no need to re-compute the label for G in the third case. It has already been computed in case (a). That is, it is already known that if D and F are IN, G will be IN. Changing the JTMS state can be caused by; 1. Adding a new assertion(enabled assumption or premise) or a justification. 2. Retracting an enabled assumption. Whenever the IE changes the JTMS state, the later must; 1. Identify the change exactly. 2. Carry as much work forward as it is logically possible. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 20. Adding information to JTMS  There are three ways to add information to the JTMS state; 1. Add a justification: Check whether the consequent of the justification is IN. If yes, do nothing. If no, check if the justification is valid(ie. Its antecedents are IN) and if yes, make the new justification the supporting justification for the consequent. 2. Enable an assumption: i. If the node was not an assumption and was IN(for which it must have had a valid justification), remove its valid support and mark it as an enabled assumption. ii. Check if this assumption was IN. If yes, do nothing. iii. Check any justification where this assumption is an antecedent to see if it now becomes valid and if yes change the status of the consequent. 3. Declare a premise. In all these cases, the JTMS must; 1. Create a new node or justification, if necessary. 2. Propagate the consequences(run the “Propagate-Inness” algorithm). Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 21. Propagating Inness: Example  Consider the following dependency network; Let A becomes an enabled assumption, The network changes as follows; Note that we only change nodes from OUT to IN. Because there is a finite number of nodes, this process must terminate at some point. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 22. Propagating Outness: Example  Consider the following dependency network; Consider the modified version of the example network; Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 23. How JTMS simulates default reasoning  Consider the following default rules; MA  A MB  B MC  C A & B  ┴ B & C  ┴ Assume that A, B and C are all declared as enabled assumptions. Here is the corresponding network; Assume the IE decides to retract A. The resulting network is the following; To get rid of the new contradiction, assume that the IE decides to retract B; Note that the resulting network does not satisfy the requirement that in a default theory an assumption must be IN unless it causes a contradiction. To correct this situation, A must be enabled again. The resulting network is the following; Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 24. Justification based Truth Maintenance Systems  This is a simple TMS in that it does not know anything about the structure of the assertions themselves.  Each supported belief (assertion) in has a justification. Each justification has two parts: An IN-List -- which supports beliefs held. An OUT-List -- which supports beliefs not held.  An assertion is connected to its justification by an arrow. One assertion can feed another justification thus creating the network.  Assertions may be labelled with a belief status. An assertion is valid if every assertion in the IN-List is believed and none in the OUT-List are believed. An assertion is non-monotonic is the OUT-List is not empty or if any assertion in the IN-List is non-monotonic. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 25. Justification based Truth Maintenance Systems  A Justification-based truth maintenance system (JTMS) is a simple TMS where one can examine the consequences of the current set of assumptions. In JTMS labels are attached to arcs from sentence nodes to justification nodes. This label is either "+" or "-". Then, for a justification node we can talk of its in-list, the list of its inputs with "+" label, and of its out-list, the list of its inputs with "-" label.  The meaning of sentences is not known. We can have a node representing a sentence p and one representing ~p and the two will be totally unrelated, unless relations are established between them by justifications.  For example, we can write:  Which says that if both p and ~p are IN we have a contradiction. Sanjivani College of Engineering, Kopargaon Dept of Information Technology  The association of IN or OUT labels with the nodes in a dependency network defines an in-out-labeling function.  This function is consistent if: 1. The label of a justification node is IN iff the labels of all the sentence nodes in its in-list are all IN and the labels of all the sentence nodes in its out-list are OUT. 2. The label of a sentence node is IN iff it is a premise, or an enabled assumption node, or it has an input from a justification node with label IN.
• 26. Example 26 Here is a simple dependency network: This last command Sanjivani College of Engineering, Kopargaon Dept of Information Technology will recognize that a contradiction exists and will invoke a contradiction handler that should state that the node "contradiction" is a contradiction and that some of the assumptions in {A, C} should be retracted.
• 27. Fuzzy logic 2 7  Fuzzy logic is an approach to variable processing that allows for multiple possible truth values to be processed through the same variable.  Fuzzy logic attempts to solve problems with an open, imprecise spectrum of data and heuristics that makes it possible to obtain an array of accurate conclusions.  Fuzzy logic is designed to solve problems by considering all available information and making the best possible decision given the input.  Fuzzy logic in AI: •In artificial intelligence (AI) systems, fuzzy logic is used to imitate human reasoning and cognition. Rather than strictly binary cases of truth, fuzzy logic includes 0 and 1 as extreme cases of truth but with various intermediate degrees of truth. • As a result, fuzzy logic is well-suited for the following; 1. Engineering for decisions without clear certainties and uncertainties, or with imprecise data -- such as with natural language processing technologies; and 2. Regulating and controlling machine outputs, according to multiple inputs/input variables -- such as with temperature control systems. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 28. What is Fuzzy Logic?  The 'Fuzzy' word means the things that are not clear. Sometimes, we cannot decide in real life that the given problem or statement is either true or false. At that time, this concept provides many values between the true and false and gives the flexibility to find the best solution to that problem. Example of Fuzzy Logic as comparing to Boolean Logic; 1. Fuzzy logic contains the multiple logical values and these values are the truth values of a variable or problem between 0 and 1. This concept provides the possibilities which are not given by computers, but similar to the range of possibilities generated by humans. 2. In the Boolean system, only two possibilities (0 and 1) exist, where 1 denotes the absolute truth value and 0 denotes the absolute false value. But in the fuzzy system, there are multiple possibilities present between the 0 and 1, which are partially false and partially true. 3. The Fuzzy logic can be implemented in systems such as micro-controllers, workstation-based or large network-based systems for achieving the definite output. It can also be implemented in both hardware or software. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 29. Characteristics of Fuzzy Logic 1. This concept is flexible and we can easily understand and implement it. 2. It is used for helping the minimization of the logics created by the human. 3. It is the best method for finding the solution of those problems which are suitable for approximate or uncertain reasoning. 4. It always offers two values, which denote the two possible solutions for a problem and statement. 5. It allows users to build or create the functions which are non-linear of arbitrary complexity. 6. In fuzzy logic, everything is a matter of degree. 7. In the Fuzzy logic, any system which is logical can be easily fuzzified. 8. It is based on natural language processing. 9. It is also used by the quantitative analysts for improving their algorithm's execution. 10.It also allows users to integrate with the programming. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 30. Architecture of a Fuzzy Logic System  In the architecture of the Fuzzy Logic system, each component plays an important role.  The architecture consists of the different four components which are given below. 1. Rule Base 2. Fuzzification 3. Inference Engine 4. Defuzzification Following diagram shows the architecture or process of a Fuzzy Logic system: Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 31. Architecture of a Fuzzy Logic System 1. Rule Base: Rule Base is a component used for storing the set of rules and the If-Then conditions given by the experts are used for controlling the decision-making systems. There are so many updates that come in the Fuzzy theory recently, which offers effective methods for designing and tuning of fuzzy controllers. These updates or developments decreases the number of fuzzy set of rules. 2. Fuzzification: Fuzzification is a module or component for transforming the system inputs, i.e., it converts the crisp number into fuzzy steps. The crisp numbers are those inputs which are measured by the sensors and then fuzzification passed them into the control systems for further processing.  This component divides the input signals into following five states in any Fuzzy Logic system: 1. Large Positive (LP) 2. Medium Positive (MP) 3. Small (S) 4. Medium Negative (MN) 5. Large negative (LN) Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 32. Architecture of a Fuzzy Logic System 3. Inference Engine: This component is a main component in any Fuzzy Logic system (FLS), because all the information is processed in the Inference Engine.  It allows users to find the matching degree between the current fuzzy input and the rules. After the matching degree, this system determines which rule is to be added according to the given input field. When all rules are fired, then they are combined for developing the control actions. 4. Defuzzification:  Defuzzification is a module or component, which takes the fuzzy set inputs generated by the Inference Engine, and then transforms them into a crisp value. It is the last step in the process of a fuzzy logic system. The crisp value is a type of value which is acceptable by the user. Various techniques are present to do this, but the user has to select the best one for reducing the errors. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 33. Membership function The membership function is a function which represents the graph of fuzzy sets, and allows users to quantify the linguistic term. It is a graph which is used for mapping each element of x to the value between 0 and 1. This function is also known as indicator or characteristics function. This function of Membership was introduced in the first papers of fuzzy set by Zadeh. For the Fuzzy set B, the membership function for X is defined as; μB:X → [0,1]. In this function X, each element of set B is mapped to the value between 0 and 1. This is called a degree of membership or membership value.  The fuzzy set approach provides a much better representation of the tallness of a person.. The membership function defines the fuzzy set for the possible values underneath of it on the horizontal axis. The vertical axis, on a scale of 0 to 1 Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 34. Linguistic variable, linguistic term, fuzzy rules Linguistic variable: A linguistic variable is a variable whose values are sentences in a natural or artificial language. For example, the values of the fuzzy variable height could be tall, very tall, very very tall, somewhat tall, not very tall, tall but not very tall, quite tall, more or less tall.  Tall is a linguistic value or primary term If age is a linguistic variable then its term set is T(age) = { young, not young, very young, not very young,…… middle aged, not middle aged, … old, not old, very old, more or less old, not very old,…not very young and not very old,…}.  Fuzzy rules are useful for modeling human thinking, perception (Opinion,view) and judgment. A fuzzy if-then rule is of the form “If x is A then y is B” where A and B are linguistic values defined by fuzzy sets on universes of discourse X and Y, respectively. “x is A” is called antecedent and “y is B” is called consequent. Sanjivani College of Engineering, Kopargaon Dept of Information Technology  Example: If pressure is high, then volume is small. If the road is slippery, then driving is dangerous. If the fruit is ripe, then it is soft.
• 35. Membership function  A membership function provides a measure of the degree of similarity of an element to a fuzzy set.  Membership functions can; – either be chosen by the user arbitrarily, based on the user’s experience (MF chosen by two users could be different depending upon their experiences, perspectives, etc.) –Or be designed using machine learning methods (e.g., artificial neural networks, genetic algorithms, etc.) There are different shapes of membership functions; 1. Triangular, 2. Trapezoidal, 3. Gaussian, etc Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 36. Types of Membership function  Triangular membership function: A triangular membership function is specified by three parameters {a, b, c} a, b and c represent the x coordinates of the three vertices of µA (x) in a fuzzy set A (a: lower boundary and c: upper boundary where membership degree is zero, b: the centre where membership degree is 1)  Trapezoid membership function: A trapezoidal membership function is specified by four parameters {a, b, c, d} as follows;  Gaussian membership function: – c: centre – s: width – m: fuzzification factor (e.g., m=2) Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 37. Classical Set  Classical Set: A Set is any well defined collection of objects. An object in a set is called an element or member of that set. Sets are defined by a simple statement, describing whether a particular element having a certain property belongs to that particular set. A = {a1 ,a2 ,a3 ,……,an }  If the elements ai (i = 1,2,3,….,n) of a set A are subset of universal set X, then set A can be represented for all elements x ϵ X by its x ϵ X characteristics function µA (x) = 1 if otherwise 0. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 38. Fuzzy Set  Fuzzy Set:  Fuzzy sets theory is an extension of classical set theory. Elements have varying degree of membership. A logic based on two truth values, True and False is sometimes insufficient when describing human reasoning.  Fuzzy Logic uses the whole interval between 0 (false) and 1 (true) to describe human reasoning.  A Fuzzy Set is any set that allows its members to have different degree of membership, called membership function, having interval [0,1]. Fuzzy Logic is derived from fuzzy set theory. Many degree of membership (between 0 to 1) are allowed. Thus a membership function µA (x) is associated with a fuzzy sets Ã such that the function maps every element of universe of discourse X to the interval [0,1]. The mapping is written as: µÃ (x): X → [0,1]. Fuzzy set is defined as follows; If X is an universe of discourse and x is a particular element of X, then a fuzzy set A defined on X and can be written as a collection of ordered pairs A = {(x, µÃ (x)), x є X } Example: Let X = {g1 , g2 , g3 , g4 , g5 } be the reference set of students. Let Ã be the fuzzy set of “smart” students, where “smart” is fuzzy term. Ã = {(g1 ,0.4)(g2 ,0.5)(g3 ,1)(g4 ,0.9)(g5 ,0.8)} Here Ã indicates that the smartness of g1 is 0.4 and so on. Operations performed on fuzzy set: 1. Union 2. Intersection 3. Complement Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 39. Example of a Fuzzy Logic System Let us consider an air conditioning system with 5-level fuzzy logic system. This system adjusts the temperature of air conditioner by comparing the room temperature and the target temperature value. Algorithm: 1. Define linguistic Variables and terms (start) 2. Construct membership functions for them. (start) 3. Construct knowledge base of rules (start) 4. Convert crisp data into fuzzy data sets using membership functions. (fuzzification) 5. Evaluate rules in the rule base. from each rule. (Inference Engine) 6. Combine results (Inference Engine) 7. Convert output data into non-fuzzy values. (defuzzification) Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 40. Example of a Fuzzy Logic System - Development Step 1 − Define linguistic variables and terms Linguistic variables are input and output variables in the form of simple words or sentences. For room temperature, cold, warm, hot, etc., are linguistic terms. Temperature (t) = {very-cold, cold, warm, very-warm, hot} Every member of this set is a linguistic term and it can cover some portion of overall temperature values. Step 2 − Construct membership functions for them The membership functions of temperature variable are as shown ; Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 41. Example of a Fuzzy Logic System - Development Step3 − Construct knowledge base rules Create a matrix of room temperature values versus target temperature values that an air conditioning system is expected to provide. Build a set of rules into the knowledge base in the form of IF-THEN-ELSE structures. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 42. Example of a Fuzzy Logic System - Development Step 4 − Obtain fuzzy value Fuzzy set operations perform evaluation of rules. The operations used for OR and AND are Max and Min respectively. Combine all results of evaluation to form a final result. This result is a fuzzy value. Step 5 − Perform defuzzification Defuzzification is then performed according to membership function for output variable. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 43. Application Areas of Fuzzy Logic The key application areas of fuzzy logic are as given; 1. Automotive Systems  Automatic Gearboxes  Four-Wheel Steering  Vehicle environment control 2. Consumer Electronic Goods  Hi-Fi Systems  Photocopiers  Still and Video Cameras  Television Sanjivani College of Engineering, Kopargaon Dept of Information Technology 3. Domestic Goods  Microwave Ovens  Refrigerators  Toasters  Vacuum Cleaners  Washing Machines 4. Environment Control  Air Conditioners/Dryers/Heaters  Humidifiers
• 44. Advantages and Disadvantages 44 to complex life, including human Sanjivani College of Engineering, Kopargaon Dept of Information Technology  Advantages of FLSs: 1. Mathematical concepts within fuzzy reasoning are very simple. 2. You can modify a FLS by just adding or deleting rules due to flexibility of fuzzy logic. 3. Fuzzy logic Systems can take imprecise, distorted, noisy input information. 4. FLSs are easy to construct and understand. 5. Fuzzy logic is a solution problems in all fields of medicine, as it resembles reasoning and decision making.  Disadvantages of FLSs: 1. There is no systematic approach to fuzzy system designing. 2. They are understandable only when simple. 3. They are suitable for the problems which do not need high accuracy.
• 45. Statistical/ Probability Reasoning 4 5  Probabilistic reasoning is a way of knowledge representation where we apply the concept of probability to indicate the uncertainty in knowledge.  In probabilistic reasoning, we combine probability theory with logic to handle the uncertainty. In the real world, there are lots of scenarios, where the certainty of something is not confirmed, such as "It will rain today," "behavior of someone for some situations," "A match between two teams or two players." These are probable sentences for which we can assume that it will happen but not sure about it, so here we use probabilistic reasoning.  Need of probabilistic reasoning in AI:  When there are unpredictable outcomes.  When specifications or possibilities of predicates becomes too large to handle.  When an unknown error occurs during an experiment.  In probabilistic reasoning, there are two ways to solve problems with uncertain knowledge: 1. Bayes' rule 2. Bayesian Statistics Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 46. Basic Terminologies 1. Probability: Probability can be defined as a chance that an uncertain event will occur. It is the numerical measure of the likelihood that an event will occur.  The value of probability always remains between 0 and 1 that represent ideal uncertainties. 1. 0 ≤ P(A) ≤ 1, where P(A) is the probability of an event A. 2. P(A) = 0, indicates total uncertainty in an event A. 3. P(A) =1, indicates total certainty in an event A.  We can find the probability of an uncertain event by using the below formula. 2. Event: Each possible outcome of a variable is called an event. 3. Sample space: The collection of all possible events is called sample space. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 47. Basic Terminologies 4. Random variables: Random variables are used to represent the events and objects in the real world. 5. Prior probability: The prior probability of an event is probability computed before observing new information. 6. Posterior Probability: The probability that is calculated after all evidence or information has taken into account. It is a combination of prior probability and new information. 7.Conditional probability: Conditional probability is a probability of occurring an event when another event has already happened. Let's suppose, we want to calculate the event A when event B has already occurred, "the probability of A under the conditions of B", and If the probability of A is given and we need to find the probability of B, it can be written as: Where P(A⋀B)= Joint probability of a and B P(B)= Marginal probability of B. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 48. Conditional Probability Example It can be explained by using the below Venn diagram, where B is occurred event, so sample space will be reduced to set B, and now we can only calculate event A when event B is already occurred by dividing the probability of P(A⋀B) by P( B ). Example: In a class, there are 70% of the students who like English and 40% of the students who likes English and mathematics, and then what is the percent of students those who like English also like mathematics? Solution: Let, A is an event that a student likes Mathematics B is an event that a student likes English. Hence, 57% are the students who like English also like Mathematics. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 49. Bayes' theorem in Artificial intelligence  Bayes' theorem is also known as Bayes' rule, Bayes' law, or Bayesian reasoning, which determines the probability of an event with uncertain knowledge.  In probability theory, it relates the conditional probability and marginal probabilities of two random events.  Bayes' theorem was named after the British mathematician Thomas Bayes. The Bayesian inference is an application of Bayes' theorem, which is fundamental to Bayesian statistics.  It is a way to calculate the value of P(B|A) with the knowledge of P(A|B). Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 50. Bayes' theorem in Artificial intelligence  The above equation (a) is called as Bayes' rule or Bayes' theorem. This equation is basic of most modern AI systems for probabilistic inference. Where; 1. P(A|B) is known as posterior, which we need to calculate, and it will be read as Probability of hypothesis A when we have occurred an evidence B. 2. P(B|A) is called the likelihood, in which we consider that hypothesis is true, then we calculate the probability of evidence. 3. P(A) is called the prior probability, probability of hypothesis before considering the evidence 4. P(B) is called marginal probability, pure probability of an evidence. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 51. Bayes' theorem Example Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 52. Applications • Credit card fraud detection • Spam filtering • Medical diagnosis • Patterns in customer dataset/marketing campaign performance • Help robots make decisions • Reconstructing clean images from noisy images • Weather prediction • Speech emotion recognition • Optical character recognition • Forensic analysis Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 53. Bayesian Belief Network in AI Bayesian belief network is key computer technology for dealing with probabilistic events and to solve a problem which has uncertainty. We can define a Bayesian network as; "A Bayesian network is a probabilistic graphical model which represents a set of variables and their conditional dependencies using a directed acyclic graph.“  It is also called a Bayes network, belief network, decision network, or Bayesian model. Bayesian networks are probabilistic, because these networks are built from a probability distribution, and also use probability theory for prediction and anomaly detection. It can also be used in various tasks including prediction, anomaly detection, diagnostics, automated insight, reasoning, time series prediction, and decision making under uncertainty. Bayesian Network can be used for building models from data and experts opinions, and it consists of two parts; 1. Directed Acyclic Graph 2. Table of conditional probabilities. The generalized form of Bayesian network that represents and solve decision problems under uncertain knowledge is known as an Influence diagram.  A Bayesian network graph is made up of nodes and Arcs (directed links), where; Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 54. Basic Terminologies of Bayesian Belief Network  The Bayesian network has mainly two components: 1. Causal Component 2. Actual numbers Each node in the Bayesian network has condition probability distribution P(Xi |Parent(Xi) ), which determines the effect of the parent on that node.  Bayesian network is based on Joint probability distribution and conditional probability.  Joint probability distribution: If we have variables x1, x2, x3,....., xn, then the probabilities of a different combination of x1, x2, x3.. xn, are known as Joint probability distribution. P[x1, x2, x3,....., xn], it can be written as the following way in terms of the joint probability distribution. = P[x1| x2, x3,....., xn]P[x2, x3,....., xn] = P[x1| x2, x3,....., xn]P[x2|x3,....., xn]....P[xn-1|xn] P[xn]. In general for each variable Xi, we can write the equation as: P(Xi|Xi-1,........., X1) = P(Xi |Parents(Xi )) Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 55. Example Harry installed a new burglar alarm at his home to detect burglary. The alarm reliably responds at detecting a burglary but also responds for minor earthquakes. Harry has two neighbors David and Sophia, who have taken a responsibility to inform Harry at work when they hear the alarm. David always calls Harry when he hears the alarm, but sometimes he got confused with the phone ringing and calls at that time too. On the other hand, Sophia likes to listen to high music, so sometimes she misses to hear the alarm. Here we would like to compute the probability of Burglary Alarm. Problem: Calculate the probability that alarm has sounded, but there is neither a burglary, nor an earthquake occurred, and David and Sophia both called the Harry. Solution: Sanjivani College of Engineering, Kopargaon Dept of Information Technology 2K 1. The Bayesian network for the above problem is given below. The network structure is showing that burglary and earthquake is the parent node of the alarm and directly affecting the probability of alarm's going off, but David and Sophia's calls depend on alarm probability. 2. The network is representing that our assumptions do not directly perceive the burglary and also do not notice the minor earthquake, and they also not confer before calling. 3. The conditional distributions for each node are given as conditional probabilities table or CPT. 4. Each row in the CPT must be sum to 1 because all the entries in the table represent an exhaustive set of cases for the variable. 5. In CPT, a boolean variable with k boolean parents contains probabilities. Hence, if there are two parents, then CPT will contain 4 probability values.
• 56. Example List of all events occurring in this network:  Burglary (B)  Earthquake(E)  Alarm(A)  David Calls(D)  Sophia calls(S) We can write the events of problem statement in the form of probability: P[D, S, A, B, E], can rewrite the above probability statement using joint probability distribution: P[D, S, A, B, E] = P[D | S, A, B, E]. P[S, A, B, E] = P[D | S, A, B, E]. P[S | A, B, E]. P[A, B, E] = P [D| A]. P [ S| A, B, E]. P[ A, B, E] = P[D | A]. P[ S | A]. P[A| B, E]. P[B, E] = P[D | A ]. P[S | A]. P[A| B, E]. P[B |E]. P[E] Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 57. Example Let's take the observed probability for the Burglary and earthquake component: 1. P(B= True) = 0.002, which is the probability of burglary. 2. P(B= False)= 0.998, which is the probability of no burglary. 3. P(E= True)= 0.001, which is the probability of a minor earthquake 4. P(E= False)= 0.999, Which is the probability that an earthquake not occurred. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 58. Example 58 From the formula of joint distribution, we can write the problem statement in the form of probability distribution: P(S, D, A, ¬B, ¬E) = P (S|A) *P (D|A)*P (A|¬B ^ ¬E) *P (¬B) *P (¬E). = 0.75* 0.91* 0.001* 0.998*0.999 = 0.00068045. Hence, a Bayesian network can answer any query about the domain by using Joint distribution. The semantics of Bayesian Network: There are two ways to understand the semantics of the Bayesian network, which is given below: 1. To understand the network as the representation of the Joint probability distribution. It is helpful to understand how to construct the network. 2. To understand the network as an encoding of a collection of conditional independence statements. It is helpful in designing inference procedure. Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 59. References 50 • “Artificial intelligence: A modern approach”, S. J. Russell and P. Norvig, Pearson, 3rd Edition • “Artificial Intelligence”, Elaine R. and Kevin K., McGraw Hill, 2nd edition Sanjivani College of Engineering, Kopargaon Dept of Information Technology
• 60. Thank you Sanjivani College of Engineering, Kopargaon Dept of Information Technology K. S. Ubale