Methods of AI: Introduction - PDF
Document Details

Uploaded by MiraculousLake
Heilbronn University of Applied Sciences
Marco Wagner
Tags
Related
Summary
This document presents an introduction to Artificial Intelligence (AI) methods. It covers topics such as knowledge-based systems, machine learning, and neural networks. The course material is from Professor Dr. Marco Wagner, Heilbronn University.
Full Transcript
Campus Sontheim Methods of AI Introduction Prof. Dr. Marco Wagner / Fakultät Technik Campus Sontheim Preliminaries Prof. Dr. Marco Wagner / Fakultät Technik About me Dr. Marco Wagner, 41 years old, married, 2 daughters Born and raised in Heilbronn 2002 A...
Campus Sontheim Methods of AI Introduction Prof. Dr. Marco Wagner / Fakultät Technik Campus Sontheim Preliminaries Prof. Dr. Marco Wagner / Fakultät Technik About me Dr. Marco Wagner, 41 years old, married, 2 daughters Born and raised in Heilbronn 2002 Abitur, Technisches Gymnasium Heilbronn 2003-2008 Student Automotive Systems Engineering (ASE), Dipl.-Ing. (FH) 2008-2014 Scientific Assistant, Heilbronn University 2009-2015 PhD Student, University Koblenz-Landau, Department of Computer Science PhD thesis: „An adaptive Software and System Architecture for Driver Assistance Systems applied to truck and trailer combinations“ 2014-2024 Bosch Group 10/2014-01/2019 Research Engineer „Communication and Network Technologies“, Bosch Research 02/2019-07/2019 Lead Systems Architect Product Area „Autonomous Shuttle Transport Solutions“, Bosch Automated Driving 08/2019-03/2021 Technical Product Manager / Business Development Manager „Middleware & Tools automated driving“, Bosch Automated Driving 04/2021-02/2024 Head of Solution „Vehicle App Development for Software-defined Vehicles“, ETAS GmbH Lecturing 2013 „Informatik 2“, Maschinenbau, Heilbronner Institut für lebenslanges Lernen (HILL) 2017-2019 „Einführung in die Digitaltechnik“, ASE, Heilbronn University 2020-2024 „Einführung in AUTOSAR“, ASE, Heilbronn University Since 03/2024 Professor “AI in technical systems”, Heilbronn University Prof. Dr. Marco Wagner / Fakultät Technik Learning objectives > General you can explain the ideas of AI, its benefits and shortcomings you are aware of the heritage of today’s AI landscape > Methods you are aware of the broad scope of AI methods and can give examples you are able differentiate between the different methods and approaches you are able to explain selected methods and algorithms Designed by Wannapik you are able to make use of selected methods on smaller problems Prof. Dr. Marco Wagner / Fakultät Technik Learning objectives Topics we’ll be touching: Method perspective > Machine Learning > Knowledge-based Systems Decision Trees & Random Forests Knowledge Representation Regression Semantics Clustering Reasoning Classification (Support Vector Machines…) > Data in AI > Neural Networks Data & Knowledge Artificial Neurons Data handling Feed-Forward Neural Networks Data analysis Training techniques (Backpropagation…) > Programming AI systems Deep Learning Python basics AI libraries & development environments Prof. Dr. Marco Wagner / Fakultät Technik Learning objectives Topics we’ll be touching: UseCase perspective > Machine Learning Predictive Maintenance > Knowledge-based Systems Decision Trees & Random Forests Demand Knowledge Representation Digital Twin Semantic Web Regression Forecasting Quality Semantics Expert Clustering Assurance Systems Reasoning Classification (Support Vector Machines…) > Data in AI > Neural Networks Computer Optimization in Data & Knowledge Artificial Neurons Vision Logistics Robotics Data handling Feed-Forward Neural Networks Development Production Data analysis Training techniques (Backpropagation…) … > Programming AI systems Deep Learning Python basics AI libraries & development environments Prof. Dr. Marco Wagner / Fakultät Technik About this course “The plan” * KW Topic KW Topic 40 Introduction & Knowledge-based Systems I 47 Machine Learning: Clustering II 41 Knowledge-based Systems II 48 Machine Learning: Regression Anyone on 42 Data in AI 49 Machine Learning: Classification “Exkursion” ? 43 Machine Learning: Intro 50 Artificial Neural Networks 44 Machine Learning: Decision Trees & Random 51 Deep Learning Forest I 01 [ Buffer / Project ] 45 Machine Learning: Decision Trees & Random Forest II 02 [ Buffer / Project ] 46 Machine Learning: Clustering I Prof. Dr. Marco Wagner / Fakultät Technik * "Planning replaces coincidence by error", Albert Einstein About this course Working Mode > Mixed working mode: Input in form of classic lecture Practical live sessions Voluntary exercises to be done outside the lectures > Language: Slides: English (with important terms in German as well) Lecture language is German / English upon request > Exam: tbd: test or project during semester (English/German) final during exam period (English/German) Pictures: wikimedia Prof. Dr. Marco Wagner / Fakultät Technik Literature & Further Reading > Wolfgang Ertel - Grundkurs > Ralf Otte - Künstliche Intelligenz für Künstliche Intelligenz dummies Good for: Recap AI in general Good for: Recap AI in general Available: SpringerLink Available: LIV > Russel et. al - Artificial Intelligence - > Jörg Frochte - Maschinelles Lernen A modern approach Good for: Further reading ML Good for: Further reading Available: LIV (real book & Available: LIV e-book) Prof. Dr. Marco Wagner / Fakultät Technik Campus Sontheim Methods of AI: Introduction Prof. Dr. Marco Wagner / Fakultät Technik Outline: Introduction to Artificial Intelligence > Terms and Definitions Intelligence Artificial Intelligence Classification of AI methods AI vs. Machine Learning vs. Deep Learning > A brief history of AI > Categories of artificial intelligence Categorization approaches Turing Test > Summary Prof. Dr. Marco Wagner / Fakultät Technik Terms and Definitions What is Intelligence? Intelligenz (von lateinisch intellegere „erkennen“, „einsehen“; „verstehen“; wörtlich „wählen zwischen …“ von lateinisch inter „zwischen“ und legere „lesen, wählen“) ist Intelligence has been defined in many ways: the capacity for die kognitive bzw. geistige Leistungsfähigkeit speziell im Problemlösen. Der Begriff abstraction, logic, understanding, self-awareness, learning, umfasst die Gesamtheit unterschiedlich ausgeprägter kognitiver Fähigkeiten zur emotional knowledge, reasoning, planning, creativity, critical Lösung eines logischen, sprachlichen, mathematischen oder sinnorientierten thinking, and problem-solving. It can be described as the ability Problems. Da einzelne kognitive Fähigkeiten unterschiedlich stark ausgeprägt sein to perceive or infer information; and to retain it as knowledge to können und keine Einigkeit darüber besteht, wie diese zu bestimmen und zu be applied to adaptive behaviors within an environment or unterscheiden sind, gibt es neben der bereits erwähnten Definition keine context English wikipedia, as of Jan. 2024, referring to: weiterführende, allgemeingültige Definition der Intelligenz. Vielmehr schlagen die R. R. Sharma, „Emotional Intelligence from 17th Century to verschiedenen Intelligenztheorien unterschiedliche Operationalisierungen des 21st Century: Perspectives and Directions for Future Research“, Vision, Bd. 12, Nr. 1, S. 59–66, Jan. 2008, doi: alltagssprachlichen Begriffs vor. German wikipedia, as of Jan. 2024 10.1177/097226290801200108. 1) the ability to learn or understand or to deal with new or trying situations (reason) also : the skilled use of reason 2) the ability to apply knowledge to manipulate one's environment or to think abstractly as measured by objective criteria (such as tests) Webster, Merriam, „Definition of INTELLIGENCE“. Zugegriffen: 12. Januar 2024. [Online]. Verfügbar unter: https://www.merriam-webster.com/dictionary/intelligence Prof. Dr. Marco Wagner / Fakultät Technik Terms and Definitions What is Artificial Intelligence? “Some definitions of artificial intelligence,organized into four categories” Russell, S. J., Norvig, P., & Davis, E. (2010). Artificial intelligence: a modern approach. 3rd ed. Upper Saddle River, NJ, Prentice Hall. Prof. Dr. Marco Wagner / Fakultät Technik Terms and Definitions What is Artificial Intelligence? Künstliche Intelligenz (KI), auch artifizielle Intelligenz (AI), englisch artificial intelligence, ist ein Teilgebiet der Informatik, es umfasst alle Anstrengungen, deren Ziel es ist, Maschinen intelligent zu machen. Dabei wird Intelligenz verstanden als Artificial intelligence (AI) is the intelligence of machines or die Eigenschaft, die ein Wesen befähigt, angemessen und vorausschauend in seiner software, as opposed to the intelligence of humans or Umgebung zu agieren; dazu gehört die Fähigkeit, Umgebungsdaten wahrzunehmen, animals. It is a field of study in computer science that d. h. Sinneseindrücke zu haben, und darauf zu reagieren, Informationen develops and studies intelligent machines. Such aufzunehmen, zu verarbeiten und als Wissen zu speichern, Sprache zu verstehen machines may be called AIs. und zu erzeugen, Probleme zu lösen und Ziele zu erreichen. English wikipedia, as of Jan. 2024 German wikipedia, as of Jan. 2024 „Artificial Intelligence is the science of making machines do things that would require intelligence if done by men.“ 1. A branch of computer science dealing with the “artificial intelligence (AI), the ability of a digital Minsky, M. L. (1966). ARTIFICIAL INTELLIGENCE. Scientific American, 215(3), 246–263. simulation of intelligent behavior in computers. computer or computer-controlled robot to http://www.jstor.org/stable/24931058 2. The capability of a machine to imitate intelligent perform tasks commonly associated with human behavior. intelligent beings.” Webster, Merriam, „Definition of ARTIFICIAL INTELLIGENCE“. Zugegriffen: 12. Januar 2024. „Artificial intelligence (AI) | Definition, Examples, [Online]. Verfügbar unter: Types, Applications, Companies, & Facts | https://www.merriam-webster.com/dictionary/artificial+int Britannica“. Zugegriffen: 12. Januar 2024. elligence [Online]. Verfügbar unter: https://www.britannica.com/technology/artificial-i ntelligence Prof. Dr. Marco Wagner / Fakultät Technik Terms and Definitions What is Artificial Intelligence? 1. A branch of computer science dealing with the simulation of intelligent behavior in computers. 2. The capability of a machine to imitate intelligent human behavior. Webster, Merriam, „Definition of ARTIFICIAL INTELLIGENCE“. Zugegriffen: 12. Januar 2024. [Online]. Verfügbar unter: https://www.merriam-webster.com/dictionary/artificial+int elligence Prof. Dr. Marco Wagner / Fakultät Technik Terms and Definitions „Subsets of AI - Javatpoint“. Zugegriffen: 12. Januar Pedamkar, Priya, „How Artificial Intelligence Works? | L. Wang, Z. Liu, A. Liu, und F. Tao, „Artificial intelligence 2024. [Online]. Verfügbar unter: Working & Basic Components Of AI“, EDUCBA. in product lifecycle management“, The International https://www.javatpoint.com/subsets-of-ai Zugegriffen: 12. Januar 2024. [Online]. Verfügbar unter: Journal of Advanced Manufacturing Technology, Bd. https://www.educba.com/how-artificial-intelligence-works 114, März 2021 Prof. Dr. Marco Wagner / Fakultät Technik The AI shelf Terms and Definitions Logic Probabilistic reasoning MaxEnt Predicate Logic Propositional Model Bayesian Bayesian PROLOG … networks statistics Fuzzy logic … Logic Checking Alternative classification approach Problem solving and search Machine Learning > AI as a field of computer science Simulated annealing Support Vector Machines providing various approaches, Breadth-first Depth-first Naive Bayes A* search … Classification Clustering … algorithms and methods search search classifier > “AI shelf” containing these ”tools” to Artificial Neural Networks Evolutionary Algorithms solve real-world problems Feed-Forward Neural Deep Neuro- Networks Learning evolution Particle Back- Artificial Genetic Genetic propagation Neurons … Algorithms Programming Swarm … Optimization Prof. Dr. Marco Wagner / Fakultät Technik Terms and Definitions > Artificial Intelligence AI is the broad concept of developing machines that can simulate human thinking, reasoning and behavior. > Machine Learning ML is a subset of AI wherein computer systems learn from the environment and, in turn, use these learnings to improve experiences and processes. All machine learning is AI, but not all AI is machine learning. > Deep Learning DL is is part of a broader family of machine learning methods based on artificial neural networks. DL uses multiple layers to progressively extract higher-level features from the raw input. > Data Science Data Science is the processing, analysis and extraction of „Artificial Intelligence vs. Machine Learning vs. Data Science“. Zugegriffen: 12. Januar 2024. [Online]. relevant assumptions from data. It’s about finding hidden Verfügbar unter: patterns in the data. A Data Scientist makes use of machine https://www.deviq.io/insights/artificial-intelligence-vs-mac hine-learning-vs-data-science learning in order to predict future events. Prof. Dr. Marco Wagner / Fakultät Technik Outline: Introduction to Artificial Intelligence > Terms and Definitions Intelligence Artificial Intelligence Classification of AI methods AI vs. Machine Learning vs. Deep Learning > A brief history of AI > Categories of artificial intelligence Categorization approaches Turing Test > Summary Prof. Dr. Marco Wagner / Fakultät Technik A brief history of AI Renaissance of First design Marvin Minsky Neural Ian Goodfellow Warren google google for a designs the Networks: Vladimir Vapnik to introduce McCulloch and First chatbot self-driving car researcher programmable first Neuronal NETtalk to designed the Generative Walter Pitts “ELIZA” is to drive on propose a new machine by Computer convert written first Support Adversarial develop the created California model called Charles based on text into Vector Machine Networks first artificial freeway “transformer” Babbage & Ada vacuum tubes phonetic (GANs) neuron transcriptions Lovelace 2011 2022 1941 1950 1980s 1995 2005 2016 1642 1955 * * * 1951 1965 1986 1997 2009 2015 2017 1837 1943 First AI winter Second AI winter AI system OpenAI Richard Stanford The term 1974-1980 Feigenbaum 1987-1993 watson to win launches British team “Artificial IBM’s Deep vehicle to win chatGPT, the First Alan Turing develops “Jeopardy” google’s incl. Alan Intelligence” is Blue beats DARPA fastest growing mechanical introduces the expert systems & AlphaGo beats Turing cracks born for the chess world challenge by online service, calculating Turing Test to emulate Apple launches Lee Sedol in Go the Enigma Dartmouth champion Garry crossing the ever machine by human Siri code Artificial Kasparov desert Blaise Pascal decisions Intelligence autonomously conference Prof. Dr. Marco Wagner / Fakultät Technik * Source of picture: Vectorportal.com A brief history of AI W. Ertel, Grundkurs Künstliche Intelligenz: eine praxisorientierte Einführung, 5. Auflage. in Computational Intelligence. Wiesbaden [Heidelberg]: Springer Vieweg, 2021. Prof. Dr. Marco Wagner / Fakultät Technik * Source of picture: Vectorportal.com Outline: Introduction to Artificial Intelligence > Terms and Definitions Intelligence Artificial Intelligence Classification of AI methods AI vs. Machine Learning vs. Deep Learning > A brief history of AI > Categories of artificial intelligence Categorization approaches Turing Test > Summary Prof. Dr. Marco Wagner / Fakultät Technik Categories of artificial intelligence Focus on two approaches > The common approach rough categorization into two classes > The 8 level approach introduced by Ralf Otte MCruz (WMF), CC BY-SA 4.0 , via Wikimedia Commons Prof. Dr. Marco Wagner / Fakultät Technik Categories of artificial intelligence The common approach: weak vs. strong AI > Weak AI (also known as narrow AI) does not exhibit any creativity, nor no creativity does it have the explicit ability to independently learn in the universal sense. Its learning abilities are mostly limited to training of detection patterns (machine learning) or comparison and search operations with large quantities of data. Weak AI > Using weak AI, clearly defined tasks can be handled based on a defined methodology in order to solve more complex problems which, however, clearly defined tasks are recurrent and precisely specified. The benefits of weak AI are especially relevant in automation and controlling of processes as well as in speech recognition and processing. For example: Text and image recognition, speech recognition, translation of text, navigation systems, etc. solving practical problems > Digital assistant systems like Alexa, Siri and Google Assistant also belong to the category of weak AI. Source: „Weak vs. strong AI“, University Würzburg-Schweinfurt. Zugegriffen: 12. Januar 2024. [Online]. Verfügbar unter: https://ki.thws.de/en/about/strong-vs-weak-ai-a-definition/ Prof. Dr. Marco Wagner / Fakultät Technik Categories of artificial intelligence The common approach: weak vs. strong AI mutual understanding > Realization of strong AI is not yet within reach: The objective between human and underlying the concept of strong AI is machine to allow natural and artificial intelligence media (e.g. humans and robots) to establish a level of mutual understanding and trust when working Strong AI in a joint field of activity. independently develop and Thus, efficient human-machine collaboration could be learned and define tasks facilitated, for example. > Strong AI is able to independently recognize and define tasks and independently develop and expand upon knowledge in the corresponding application domain study and analyse problems study and analyse problems in order to find an adequate solution, to find adequate solutions and the problems can also be new or creative. Source: „Weak vs. strong AI“, University Würzburg-Schweinfurt. Zugegriffen: 12. Januar 2024. [Online]. Verfügbar unter: https://ki.thws.de/en/about/strong-vs-weak-ai-a-definition/ Prof. Dr. Marco Wagner / Fakultät Technik Categories of artificial intelligence The 8 level approach Level 1: deductive intelligence physical systems > Published by Prof. Dr. Ralf Otte, chair for industrial automation and Level 2: inductive intelligence artificial intelligence, Technische Hochschule Ulm in > Differentiates between eight level, five of them being reachable for physical systems, three of them only for biological systems Level 3: cognitive intelligence Level 4: conscious intelligence Level 5: self-conscious intelligence Level 6: sensitive intelligence biological systems R. Otte, „Intelligenz und Bewusstsein“, Aus Politik und Zeitgeschichte, Level 7: willing intelligence 2023, [Online]. Verfügbar unter: https://www.bpb.de/shop/zeitschriften/apuz/kuenstliche-intelligenz-2023/54149 5/intelligenz-und-bewusstsein/ Level 8: self-conscious, willing intelligence Prof. Dr. Marco Wagner / Fakultät Technik Categories of artificial intelligence The 8 level approach Level 1: deductive intelligence physical systems > Level 1: deductive intelligence [deduktive Intelligenz (mathematische, logische Level 2: inductive intelligence Intelligenz)] Systems based on Propositional Logic (Aussagenlogik) able to derive decisions out of given expressions Level 3: cognitive intelligence unable to adapt to environment > Example: Ambient Temperature Control Loop Level 4: conscious intelligence Controller to influence the ambient temperature based its current value Rules like: (1) IF Error < -2 °C (too hot) Level 5: self-conscious intelligence THEN shut down heating valve (2) IF Error >= -2 °C AND IF Error 2°C (too cold) THEN open heating valve Level 7: willing intelligence Level 8: self-conscious, willing intelligence Prof. Dr. Marco Wagner / Fakultät Technik Categories of artificial intelligence The 8 level approach Level 1: deductive intelligence physical systems > Level 2: inductive intelligence [induktive Intelligenz (lernende Intelligenz)] Level 2: inductive intelligence Systems able to adapt their internal model to changing environments unable to explore states not being trained beforehand > Example: deriving new knowledge out of known rules and facts Level 3: cognitive intelligence Rules: (1) The successor of any number n is n + 1 Level 4: conscious intelligence (2) The successor of any even number is an odd number Fact: Level 5: self-conscious intelligence Number 8 is an even number Findings: Level 6: sensitive intelligence biological (1) The successor of 8 is 9 systems (2) 9 is an odd number Level 7: willing intelligence Level 8: self-conscious, willing intelligence Prof. Dr. Marco Wagner / Fakultät Technik Categories of artificial intelligence The 8 level approach Level 1: deductive intelligence physical systems > Level 3: cognitive intelligence [kognitive Intelligenz (kombinierte deduktive und induktive Level 2: inductive intelligence Intelligenz)] Systems based on a combination of deductive and inductive methods limited abilities to simulate creativity (e.g. paint new pictures in the style of a specific Level 3: cognitive intelligence artist) examples: chatGPT, IBM Watson, (partly) autonomous vehicles Level 4: conscious intelligence > Simple example: self-learning calculator we create an AI system that learns how to add two numbers on its own therefore, we train it with a number of examples (e.g. 100 examples, summands Level 5: self-conscious intelligence between 1 and 100) result: a system working fairly good, as long as we do not use it for summands Level 6: sensitive intelligence smaller than 1 or larger than 100 biological systems a b a+b 1 3 4 9 Level 7: willing intelligence self-learning 25 70 95 17 12 calculator 42 7 49 Level 8: self-conscious, willing … intelligence Prof. Dr. Marco Wagner / Fakultät Technik Categories of artificial intelligence The 8 level approach Level 1: deductive intelligence physical systems > Level 4: conscious intelligence [bewusste Intelligenz (wahrnehmende Intelligenz)] Level 2: inductive intelligence Systems/creatures able to perceive its environment and derive mental states out of that e.g. pain, colors, music experienced subjectively Level 3: cognitive intelligence not reached by any technical system today > Level 5: self-conscious intelligence [selbstbewusste Intelligenz (selbstwahrnehmende Level 4: conscious intelligence Intelligenz)] Systems/creatures able to perceive a inner consciousness of themselves not reached by any technical system today Level 5: self-conscious intelligence Level 6: sensitive intelligence biological systems Level 7: willing intelligence Level 8: self-conscious, willing intelligence Prof. Dr. Marco Wagner / Fakultät Technik Categories of artificial intelligence The 8 level approach Level 1: deductive intelligence physical systems > Level 6: sensitive intelligence [fühlende Intelligenz (Wahrnehmungs-qualifizierende Level 2: inductive intelligence Intelligenz] Systems/creatures able to feel (e.g. fear, joy) not clear if it ever can be reached by any technical system Level 3: cognitive intelligence > Level 7: willing intelligence [wollende Intelligenz (Wahrnehmungs-optimierende Intelligenz)] Level 4: conscious intelligence Equals to animal intelligence Systems/creatures with own intentions, trying to optimize their environment to achieve these intentions Level 5: self-conscious intelligence Ethically controversial whether this should be targeted or not > Level 8: self-conscious, willing intelligence [selbstbewusste, wollende Intelligenz Level 6: sensitive intelligence (Selbstwahrnehmungs-optimierende Intelligenz)] biological systems Transhumanist systems/organisms example from science fiction: cyborg Level 7: willing intelligence Ethically controversial whether this should be targeted or not Level 8: self-conscious, willing intelligence Prof. Dr. Marco Wagner / Fakultät Technik Turing Test aka Imitation Game The Turing Test, > proposed by Alan Turing in 1950, > evaluates a machine's ability to exhibit intelligent behavior indistinguishable from that of a human during natural language conversations. > In this test, a human judge (C) engages in text-based conversations with both a machine (A) and a human (B) without knowing which is which. > If the judge cannot reliably differentiate between the two based on their responses, the machine is considered to have passed the Turing Test. > This test is a benchmark for measuring the advancement of artificial intelligence and its ability to emulate human-like source of picture: wikipedia cognitive abilities, particularly in the context of language comprehension and generation.. Prof. Dr. Marco Wagner / Fakultät Technik Turing Test aka Imitation Game Weaknesses > Exclusive focus on the linguistic behaviour language-based experiment no capable of testing other forms of systems > Irrelevance "AI researchers have devoted little attention to passing the Turing test." Most technical systems are measured using specific goals (e.g. precision in object detection) > The “Turing trap” The Turing test may lead to creating a system imitating a human being as good as possible rather than creating the best source of picture: wikipedia possible system Russel, Stuart und Norvig, Peter, Artificial Intelligence: A Modern Approach, 4th edition. Pearson, 2021. [Online]. Verfügbar unter: https://aima.cs.berkeley.edu/ Prof. Dr. Marco Wagner / Fakultät Technik Summary: Introduction to Artificial Intelligence 1. A branch of computer science dealing with > Terms and Definitions the simulation of intelligent behavior in computers. Intelligence 2. The capability of a machine to imitate intelligent human behavior. Artificial Intelligence Classification of AI methods AI vs. Machine Learning vs. Deep Learning > A brief history of AI > Categories of artificial intelligence Categorization approaches Turing Test > Summary Prof. Dr. Marco Wagner / Fakultät Technik Campus Sontheim Thank you! Prof. Dr. Marco Wagner / Fakultät Technik | 35 Campus Sontheim Methods of AI Knowledge-based Systems Prof. Dr. Marco Wagner / Fakultät Technik Outline: Knowledge-based Systems > Introduction: what are Knowledge-based systems > Knowledge Representation: PROLOG > Excursion: Fundamentals of Logic & Reasoning Propositional Logic (Aussagenlogik) Predicate Logic (Prädikatenlogik) - First-order logic (Prädikatenlogik erster Stufe) - Higher-Order Logic (Logik höherer Stufe) Summary: Fundamentals of Logic & Reasoning > Summary: Knowledge-based Systems Prof. Dr. Marco Wagner / Fakultät Technik Knowledge-based Systems Knowledge-based Systems aka Expert Systems > In artificial intelligence (AI), a program or Knowledge Engineer User software system is referred to as an expert system when it is capable of providing User Interface Benutzerschnittstelle solutions to problems within a limited Explanation Knowledge domain of expertise (knowledge domain) that Inference Engine Acquisition Facility Inferenzkomponente are comparable in quality to those of a Erklärungskomponente Wissenserwerbs- Komponente human expert or even surpass them (expert Knowledge Base knowledge). (Source: Gabler) Wissensbasis Prof. Dr. Marco Wagner / Fakultät Technik Knowledge-based Systems Knowledge-based Systems aka Expert Systems Knowledge Engineer User > Knowledge Engineer: Expert in collecting and systematizing expert knowledge and implementing it into a knowledge-based system > Explanation Facility: Provides answers to questions about the how User Interface and why. In particular, the decisions made by the expert system during Benutzerschnittstelle the problem-solving process must be clearly and precisely justified. > Inference Engine: A software component of an intelligent system that Explanation Knowledge Inference Engine Acquisition applies logical rules to the knowledge base to deduce new information. Facility Inferenzkomponente Wissenserwerbs- > Knowledge Acquisition: Knowledge acquisition involves various Erklärungskomponente Komponente organizational, systematic, and software-related measures necessary for establishing a knowledge base, as well as the utilization of text Knowledge Base Wissensbasis analysis and learning techniques. > Knowledge Base: Explicit, descriptive (non-procedural) representation of knowledge required to solve specific tasks within a domain. Prof. Dr. Marco Wagner / Fakultät Technik Knowledge-based Systems Example: Kaleidos > Expert System for automatic monitoring and risk assessment through the surveillance of the ancient monuments of Pavia > Knowledge stored through rules-based reasoning based on facts (e.g. physics, building location, materials used…) and current measurements > Kaleidos monitors measurement units on-site and derives a condition estimation just as a human expert would do picture source: Lancini, S., Lazzari, M., Masera, A., Salvaneschi, P. (1997). Diagnosing Ancient Monuments with Expert Software, Structural Engineering International, 7(4), pp. 288-291 Prof. Dr. Marco Wagner / Fakultät Technik Knowledge-based Systems Example: SiExPro > Expert System to support the planning and installation of protection mechanisms for electrical power systems > Systems guides the user through question-answer dialog, derives a protection concept and helps to define its parameters > Kaleidos monitors measurement units on-site and derives a condition estimation just as a human expert would do picture source: Ganjavi M.R (2008) Protection system coordination using expert system (Nitsch J, Styczynski Z, eds). MAFO 25, Magdeburg. ISBN 978-3-940961-15-0 Prof. Dr. Marco Wagner / Fakultät Technik Knowledge-based Systems Key factor: knowledge representation > Many approaches have been developed over Knowledge Engineer User time > Examples: User Interface based on Logic Programming Languages Benutzerschnittstelle (e.g. PROLOG) Explanation Knowledge Inference Engine Acquisition based on logical calculus Facility Inferenzkomponente Wissenserwerbs- Erklärungskomponente based on semantic networks & ontologies Komponente … Knowledge Base Wissensbasis Prof. Dr. Marco Wagner / Fakultät Technik Knowledge-based Systems Knowledge representation with PROLOG > Declarative programming language: the program is a set of facts and rules, which define relations > A computation is initiated by running a query over the program > First appearance: 1972 Prof. Dr. Marco Wagner / Fakultät Technik Knowledge-based Systems Knowledge representation with PROLOG Rules Rules in PROLOG Define data in PROLOG Query in PROLOG IF family is albatross and nostrils(external_tubular). color is white live(at_sea). THEN bird(laysan_albatross) :- bill(hooked). ?- bird(X). bird is laysan albatross. family(albatross), size(large). X = black_footed_albatross color(white). wings(long_narrow). IF color(dark). family is albatross and bird(lblack_footed_albatross) :- color is dark family(albatross), THEN color(dark). bird is black footed albatross. family(albatross) :- IF order(tubenose), order is tubenose and size(large), size large and wings(long_narrow). wings long narrow THEN order(tubenose) :- family is albatross. nostrils(external_tubular), live(at_sea), IF bill(hooked). bill is hooked and lives at sea and nostrils are extended tabular example source: Marco Block-Berlitz. “Vorlesung Künstliche Intelligenz - Expertensysteme”, FU Berlin THEN order is tubenose. Prof. Dr. Marco Wagner / Fakultät Technik Excursion: Logic and Reasoning > Introduction: what are Knowledge-based systems > Knowledge Representation: PROLOG > Excursion: Fundamentals of Logic & Reasoning Propositional Logic (Aussagenlogik) Predicate Logic (Prädikatenlogik) - First-order logic (Prädikatenlogik erster Stufe) - Higher-Order Logic (Logik höherer Stufe) Summary: Fundamentals of Logic & Reasoning > Summary: Knowledge-based Systems Prof. Dr. Marco Wagner / Fakultät Technik Fundamentals of Logic & Reasoning Some simple examples: every child knows: Premise 1: if I break something, Mum and Dad are angry Premise 2: if Mum and Dad are angry, I will be punished Conclusion: if I break something, I will be punished the ancient greek knew already: Premise 1: all humans are mortal Premise 2: all greek are human Conclusion: all greek are mortal a simple logical puzzle: Premise 1: Jim is either the brother of Jack or the brother of Glenn Premise 2: Jim is not the brother of Glenn Conclusion: if Jim is the brother of Jack Prof. Dr. Marco Wagner / Fakultät Technik Fundamentals of Logic & Reasoning Some simple examples: This concept is called Syllogism (Syllogismus): two premises (Voraussetzungen) lead to a conclusion (Schlussfolgerung) every child knows: Premise 1: if I break something, Mum and Dad are angry A syllogism consists of three parts: Premise 2: if Mum and Dad are angry, I will be punished 1) Major premise 2) greek Minor premise Conclusion: if I break something, I will be punished the ancient knew already: 3) Conclusion Premise 1: all humans are mortal Premise 2: all greek are human Example: Major premise: All mortals die. Conclusion: all greek are mortal Minor premise: All men are mortals. a simple logical puzzle: Conclusion: All men die. Premise 1: Jim is either the brother of Jack or the brother of Glenn Premise 2: Jim is not the brother of Glenn This is also an early example for a formal language (Formale Sprache) as it includes both a syntax and semantics. Conclusion: if Jim is the brother of Jack Prof. Dr. Marco Wagner / Fakultät Technik Outline: Logic and Reasoning > Introduction: what are Knowledge-based systems > Knowledge Representation: PROLOG > Excursion: Fundamentals of Logic & Reasoning Propositional Logic (Aussagenlogik) Predicate Logic (Prädikatenlogik) - First-order logic (Prädikatenlogik erster Stufe) - Higher-Order Logic (Logik höherer Stufe) Summary: Fundamentals of Logic & Reasoning > Summary: Knowledge-based Systems Prof. Dr. Marco Wagner / Fakultät Technik Propositional Logic (Aussagenlogik) Propositions (Aussagen) > Propositional logic deals with propositions (Aussagen) and relations (Verknüpfungen) between propositions > Propositions can be either true or false > Examples for propositions: Tom’s hair is blond Luxury cars are expensive > Propositional logic tries to relate propositions in order to generate new propositions > Propositions are related by using logical connectives (Verknüpfungsoperatoren / Junktoren) like e.g. AND (UND) OR (ODER) Prof. Dr. Marco Wagner / Fakultät Technik Propositional Logic (Aussagenlogik) Logical connectives (Verknüpfungsoperatoren / Junktoren): Binary connectives (zweistellige Verknüpfungen) Unary connectives (einstellige Verknüpfungen) Conjunction Disjunction Exclusive OR Implication Equivalence AND OR XOR if…then if and only if Negation (Konjunktion) (Disjunktion) (Antivalenz) (Implikation) (Äquivalenz) NOT (Negation) a b a∧b a∨b axb a→b a↔b a ¬a false false false false false true true false false false true false true true ture false true true true false false true true false false true true true true false true true miliar? sounds fa em b e r boolean Prof. Dr. Marco Wagner / Fakultät Technik rem alg e bra! Propositional Logic (Aussagenlogik) Formulas (Formeln) > Propositional logic introduces propositions (Aussagen) that are either true or false > Propositions can be related using logical connectives (Verknüpfungsoperatoren / Junktoren) > Using the logical connectives and propositions, formulas (Formeln) are derived > Formulas can be either Properties Example Example formula satisfiable (erfüllbar) If it is raining THEN the street is wet a ∧ b, a ∧ ¬b, … not satisfiable (nicht The car is expensive AND the car is cheap a ∧ ¬a erfüllbar / Widerspruch) valid (allgemeingültig) Tom has blond hair OR Tom has no blond hair a ∨ ¬a Prof. Dr. Marco Wagner / Fakultät Technik Propositional Logic (Aussagenlogik) Tautology (Tautologie) > A tautology (Tautologie) is a formula that is true in every possible interpretation > While not making much sense in daily life, tautologies are essential in order to proof correctness of conclusions in order to reduce formulas Tautology Everyday life rule Remark Example law of excluded middle Any valuation must assign a true or a ∨ ¬a The cat is black or the cat is not black (Regel des ausgeschlossenen Dritten) false, nothing else double negative The opposite of the opposite of a ↔ ¬(¬a) It rains, since it is false that it doesn’t rain (doppelte Verneinung) proposition is the proposition itself logical deduction If a implies b and a is true, then b is (a → b) if it rains (a), then the street is wet (b). ((a → b) ∧ a) → b (Deduktionsregel) true as well It has rained(a), thus the street is wet (b). If I break something, Mum and Dad are angry. If Mum and Dad polysyllogism If a implies b and b implies c, then a (a → b) ∧ (b → c) → (a → c) are angry, I will be punished. (Kettenschluss) implies c Conclusion: if I break something, I will be punished Prof. Dr. Marco Wagner / Fakultät Technik Propositional Logic (Aussagenlogik) Summary propositional logic > Propositional logic deals with propositions (Aussagen) and relations (Verknüpfungen) between propositions to build formulas (Formeln) > Tautologies (Tautologien) can help to minimize or proof the correctness of formulas > Using propositional logic, computers are able to conduct deductive reasoning and hence can think logically > One problem remains: the propositional satisfiability problem aka “SAT” (Erfüllbarkeitsproblem): propositional logic cannot create generalized clauses Example: “this frog is green” is possible, but not “all frogs are green” since propositional logic does not provide quantifiers (Quantoren) Hence, we need to extend propositional logic: predicate logic Prof. Dr. Marco Wagner / Fakultät Technik Outline: Logic and Reasoning > Introduction: what are Knowledge-based systems > Knowledge Representation: PROLOG > Excursion: Fundamentals of Logic & Reasoning Propositional Logic (Aussagenlogik) Predicate Logic (Prädikatenlogik) - First-order logic (Prädikatenlogik erster Stufe) - Higher-Order Logic (Logik höherer Stufe) Summary: Fundamentals of Logic & Reasoning > Summary: Knowledge-based Systems Prof. Dr. Marco Wagner / Fakultät Technik First-order logic (Prädikatenlogik erster Stufe) Functions (Funktion) > First-order logic allows to introduce Functions: > example: “Romeo is a cat” can be depicted as cat(X) where X is a variable representing an individual > now we can use this function to create false and true propositions: cat(Tom) is false (since Tom is a human being) cat(Romeo) is true and: human(Tom) is true > gain: we now have divided the original statement into its formal parts “Romeo is a cat” => cat(Romeo) Individual Predicate Predicate Individual Prof. Dr. Marco Wagner / Fakultät Technik First-order logic (Prädikatenlogik erster Stufe) Quantifiers (Quantoren) Quantifier Symbol Meaning universal quantifier ∀ forall existential quantifier ∃ exists > example: “if something is a cat, then it is fluffy (flauschig)” represented as ∀X: cat(X) → fluffy(X) > be aware that just because we can formulate something it is not necessarily true (see example above) Prof. Dr. Marco Wagner / Fakultät Technik First-order logic (Prädikatenlogik erster Stufe) Functions (Funktion) > First-order logic allows to introduce Functions: > example: “Romeo is a cat” can be depicted as cat(X) where X is a variable representing an individual > now we can use this function to create false and true propositions: cat(Tom) is false (since Tom is a human being) cat(Romeo) is true and: human(Tom) is true > gain: we now have divided the original statement into its formal parts “Romeo is a cat” => cat(Romeo) Individual Predicate Predicate Individual Prof. Dr. Marco Wagner / Fakultät Technik First-order logic (Prädikatenlogik erster Stufe) Some more examples Statement Formal expression nobody likes cake ¬∃X: like(X, cake) not everybody likes cake ¬∀X: like(X, cake) everybody likes himself ∀X: like(X, X) somebody likes somebody ∃X ∃Y: like(X, Y) somebody is the child of Kate and William ∃X: child(X, Kate, William) Prof. Dr. Marco Wagner / Fakultät Technik Outline: Logic and Reasoning > Introduction: what are Knowledge-based systems > Knowledge Representation: PROLOG > Excursion: Fundamentals of Logic & Reasoning Propositional Logic (Aussagenlogik) Predicate Logic (Prädikatenlogik) - First-order logic (Prädikatenlogik erster Stufe) - Higher-Order Logic (Logik höherer Stufe) Summary: Fundamentals of Logic & Reasoning > Summary: Knowledge-based Systems Prof. Dr. Marco Wagner / Fakultät Technik Higher-Order Logic (Logik höherer Stufe) Extends First-Order Logic by > Additional quantifiers allows to quantify over sets (Mengen), not only over individuals allows to define relations (Relationen) > Stronger semantics allows to define an assignment (Belegfunktion) to an individual or set > Be aware! Higher-Order Logic is no longer decideable! Prof. Dr. Marco Wagner / Fakultät Technik Outline: Logic and Reasoning > Introduction: what are Knowledge-based systems > Knowledge Representation: PROLOG > Excursion: Fundamentals of Logic & Reasoning Propositional Logic (Aussagenlogik) Predicate Logic (Prädikatenlogik) - First-order logic (Prädikatenlogik erster Stufe) - Higher-Order Logic (Logik höherer Stufe) Summary: Fundamentals of Logic & Reasoning > Summary: Knowledge-based Systems Prof. Dr. Marco Wagner / Fakultät Technik Summary: Logic and Reasoning Logic Characteristics Remarks Correct and complete (vollständig), decidable Propositional Logic wide use in AI, no quantifiers (entscheidbar) with expotential complexity, limited (Aussagenlogik) expressiveness available First-order logic Correct and complete, not decidable (but proven (Gödel 1929), wide use in (Prädikatenlogik erster semidecidable), medium expressiveness, quantifiers AI, logic programming (PROLOG Stufe) partly available etc.), expert systems Inconsistent or incomplete, not decideable, high Higher-Order Logic (Logik inconsistent (Gödel 1931), used for expressivness, quantifiers available, mathematical höherer Stufe) induction (vollständige Induktion), peano arithmetic some specific AI methods Prof. Dr. Marco Wagner / Fakultät Technik Summary: Logic and Reasoning How does this help us to “create knowledge”? > Option 1: Deductive reasoning (Deduktion) -> create new knowledge by running through the chain of causality (Kausalkette) modus ponens (“forward chaining”) 1. If P, then Q. Example: 1. If today is Monday, then there are lectures. 2. P. 2. Today is Monday. 3. Therefore, Q. 3. Therefore, there are lectures. modus tollens (“"the law of contrapositive") Example: 1. If P, then Q. 1. If it is a car, then it has wheels. 2. Not Q. 2. It does not have wheels. 3. Therefore, not P. 3. Therefore, it is not a car. Prof. Dr. Marco Wagner / Fakultät Technik Summary: Logic and Reasoning How does this help us to “create knowledge”? > Option 2: Abductive reasoning (Abduktion) Abductive reasoning allows inferring a as an explanation of b Result These screws are made of stainless steel. Rule All screws in this box are made of stainless steel. Case These screws are out of this box. Prof. Dr. Marco Wagner / Fakultät Technik Summary: Logic and Reasoning How does this help us to “create knowledge”? > Option 3: Inductive reasoning (Induktion) Inductive reasoning allows inferring new rules Case These screws are out of this box. Result These screws are made of stainless steel. Rule All screws in this box are made of stainless steel. Be careful: the truth of the conclusion of an inductive argument is at best probable, based upon the evidence given! Prof. Dr. Marco Wagner / Fakultät Technik Fundamentals of Logic & Reasoning Further readings: Scott Sullivan An Introduction To Traditional Logic: Classical Reasoning For Contemporary Gerhard Schurz 2005 Logik, Grund- und Aufbaukurs in Aussagen- und Prädikatenlogik 2., korrigierte und erweiterte Auflage. 2020 Ralf Otte Künstliche Intelligenz für dummies 2. Auflage. 2023 Prof. Dr. Marco Wagner / Fakultät Technik Outline: Logic and Reasoning > Introduction: what are Knowledge-based systems > Knowledge Representation: PROLOG > Excursion: Fundamentals of Logic & Reasoning Propositional Logic (Aussagenlogik) Predicate Logic (Prädikatenlogik) - First-order logic (Prädikatenlogik erster Stufe) - Higher-Order Logic (Logik höherer Stufe) Summary: Fundamentals of Logic & Reasoning > Summary: Knowledge-based Systems Prof. Dr. Marco Wagner / Fakultät Technik Summary: Knowledge-based Systems Knowledge-based Systems aka Expert Systems > In artificial intelligence (AI), a program or software system is referred to as an expert system when it is capable of providing solutions to problems within a limited domain of expertise (knowledge domain) that are comparable in quality to those of a human expert or even surpass them (expert knowledge). (Source: Gabler) Example: 1. If P, then Q. > New knowledge can be “created” using Logic & 2. Not Q. 1. 2. If it is a car, then it has wheels. It does not have wheels. 3. Therefore, not P. Reasoning 3. Therefore, it is not a car. > Very traditional approach that also has some relevance until today Prof. Dr. Marco Wagner / Fakultät Technik Summary: Knowledge-based Systems > Up next: a modern Knowledge-based System based on “Semantic Web” Technologies picture source: wikimedia Prof. Dr. Marco Wagner / Fakultät Technik Campus Sontheim Thank you! Prof. Dr. Marco Wagner / Fakultät Technik | 35 Campus Sontheim Methods of Artificial Intelligence Semantic Web Prof. Dr. Marco Wagner / Fakultät Technik Outline: Semantic Web > Introduction: Why & What > Knowledge Representation with Ontologies Core elements of an ontology > The Semantic Web Tech Stack RDF, OWL etc. > Hands on: create your first ontology Using Protege and Apache Jena Fuseki > Real world examples FOAF Industry 4.0 > Summary Prof. Dr. Marco Wagner / Fakultät Technik Knowledge-based Systems Key factor: knowledge representation > Many approaches have been developed over Knowledge Engineer User time > Examples: User Interface based on Logic Programming Languages Benutzerschnittstelle (e.g. PROLOG) Explanation Knowledge Inference Engine Acquisition based on logical calculus Facility Inferenzkomponente Wissenserwerbs- Erklärungskomponente based on semantic networks & ontologies Komponente … Knowledge Base Wissensbasis Prof. Dr. Marco Wagner / Fakultät Technik ReCap! Knowledge Representation: Ontologies > To represent knowledge, we need a formal knowledge modeling -> Ontologies: Syntax: common symbols and concepts Semantics: agreement about their meaning Taxonomy: classifications of concepts Thesauri: associations and relations of concepts Ontologies: rules and knowledge about which relations are allowed / make sense image source: Florian Thiery, “Ontology Scheme”, wikimedia.org, CC 4.0 Prof. Dr. Marco Wagner / Fakultät Technik Knowledge Representation: Ontologies Definition: Ontology > Ontology in philosophy: “Ontology is the philosophical study of the nature of being, existence, or reality, as well as the basic categories of being and their relations” > Ontology in Computer Science: “An ontology is an explicit, formal specification of a shared conceptualization. The term is borrowed from philosophy, where an ontology is a systematic account of existence. For AI systems, what ‘exists’ is which can be represented” (T.R. Gruber: “A translation approach to portable ontology specifications. Knowledge Acquisition, 5(2); 199-220, 1993) Important properties: ➔ conceptualization: abstract model identifying relevant concept & relations in a domain ➔ explicit: meaning of all concepts must be defined ➔ formal: machine readable & understandable ➔ shared: agreed on between all stakeholders Prof. Dr. Marco Wagner / Fakultät Technik Outline: Semantic Web > Introduction: Why & What > Knowledge Representation with Ontologies Core elements of an ontology > The Semantic Web Tech Stack RDF, OWL etc. > Hands on: create your first ontology Using Protege and Apache Jena Fuseki > Real world examples FOAF Industry 4.0 > Summary Prof. Dr. Marco Wagner / Fakultät Technik Knowledge Representation: Ontologies Core elements of an Ontology: Concepts & Conceptualization shared between sender & receiver Concept symbolizes refers to Symbol Object stands for “person” … Prof. Dr. Marco Wagner / Fakultät Technik Knowledge Representation: Ontologies Core elements of an Ontology: Classes > Elements of representation: classes, relations & instances > Classes Ontology abstract groups of objects representing a concept Representation characterized via their attributes > Attributes Classes name-value pairs Relations informal description semi-formal description Instances Person “A person is characterized by given name name, date of birth and birthplace” family name date of birth birthplace … Prof. Dr. Marco Wagner / Fakultät Technik Knowledge Representation: Ontologies Core elements of an Ontology: Relations > Classes can be related to each other > Relations are special attributes, whose values are objects of Ontology other classes Representation Classes Relations Instances image source: H. Sack, “Ontology in Philosophy and Computer Science”, Lecture within MOOC “Knowledge Engineering with Semantic Web Technologies”, OpenHPI Prof. Dr. Marco Wagner / Fakultät Technik Knowledge Representation: Ontologies Core elements of an Ontology: Relations > Rules (Constraints) can be defined for Relations and Attributes Ontology > This ensures only valid values are used for modeling Representation knowledge Classes Relations Instances image source: H. Sack, “Ontology in Philosophy and Computer Science”, Lecture within MOOC “Knowledge Engineering with Semantic Web Technologies”, OpenHPI Prof. Dr. Marco Wagner / Fakultät Technik Knowledge Representation: Ontologies Core elements of an Ontology: Classes & Relations > Classes, relations, and constraints can be put together to form Statements / Assertions Ontology Representation > Special form of Assertion: formal Axioms Classes example: “it is not possible to have a date of birth that lays Relations in the future” Instances > Axioms describe knowledge that can’t be described with the help of other existing components Prof. Dr. Marco Wagner / Fakultät Technik Knowledge Representation: Ontologies Core elements of an Ontology: Classes & Relations > Be cautious with the “Open World Assumption” (OWA) Ontology > Question: Can sheep fly? Sheep ⊆ Animal ∧ ∀hasLimbs.Leg Representation Sheep are a subset of animals and all sheep have legs as limbs Classes > Answer under OWA assumption: No, idea, but probably yes Relations Instances > Under OWA we return “don’t know” unless we have a clear statement (or can infer) > In the real world, we use incomplete information on a daily basis Prof. Dr. Marco Wagner / Fakultät Technik Knowledge Representation: Ontologies Core elements of an Ontology: Instances > Instances describe individuals of an ontology Ontology Representation birthplace Classes isBornIn Porbandar, Person Gujarat Relations is subClass of isBornIn Instances is a Mahatma Man Gandhi Terminological Assertional Knowledge Knowledge Prof. Dr. Marco Wagner / Fakultät Technik Knowledge Representation: Ontologies Types of Ontologies > Top-Level Ontology general, cross-domain ontology describes general concepts > Domain Ontology important concepts within a domain (e.g. I4.0) introduces domain-specific terms specifies terms introduced in top-level ontology > Task Ontology important concepts with regard to a specific task or activity (e.g. cooking instructions) specifies terms introduced in top-level ontology > Application Ontolog