CSI_13
CSI_13
ARTIFICIAL
INTELLIGENCE
MSc PHAM NGOC HA
▪ 13.1 Introduction
▪ 13.2 Knowledge Presentation
▪ 13.3 Expert Systems
▪ 13.4 Perception
▪ 13.5 Neuron Network
▪ 13.6 Deep Learning
2
Objectives
▪ Show how expert systems can be used when a human expert is not available.
▪ Show how an artificial agent can be used to simulate mundane tasks performed by human beings.
▪ Show how expert systems and mundane systems can use different search techniques to solve
problems.
▪ Show how the learning process in humans can be simulated, to some extent, using neural networks
that create the electronic version of a neuron called a perceptron.
▪ Show how the deep learning working and the advantages of deep learning.
3
1 - INTRODUCTION
4
1. What is artificial intelligence?
5
2. History of artificial intelligence
▪ Artificial intelligence is an
independent field of study is
relatively new but it has some roots
in the past. We can say that it
started 2400 years ago when the
Greek philosopher Aristotle invented
the concept of logical reasoning.
▪ However, the main idea of a thinking
machine came from Alan Turing,
who proposed the Turing test. The
term ‘artificial intelligence’ was first
coined by John McCarthy in 1956.
▪ Some organizations use mobile robots that Figure 13.3 Simple reflex agent diagram
do delivery jobs such as distributing mail or
correspondence to different rooms.
8
5. Programming languages
▪ Data scientists choose different programming languages based on ease of use, simplicity in
programming syntax, number of machine learning libraries available, integration with other
programs like cloud infrastructure or visualization software, and computational speed and
efficiency. There are two most popular programing languages in AI
1. Python 2. Prolog
This language is widely used by programmers AI developers appreciate it for its high level of
because of its pure syntax and the logical, abstraction, built-in search engine, non-
strictly grammatical construction of the determinism, etc.
program. This is one of the few languages that
● relatively fast development speed; represents the paradigm of declarative
● rich and diverse set of libraries and tools; programming. The learning curve here is quite
● balance of low-level and high-level high.
programming; ● powerful and flexible programming
● allows you to test algorithms without structure;
having to implement them; ● data structuring on the basis of a tree;
● is still being actively developed. ● automatic rollback option..
9
6. Programming languages (cont)
3. LISP 4. JAVA
Since the 1960s, Lisp has been widely Java is, without a doubt, a significant AI
utilized in scientific research in the disciplines programming language. One reason for
of natural languages, theorem proofs, and the this is the language’s widespread use in
solution of artificial intelligence problems. mobile app development. It’s a fantastic
Lisp was intended as a practical match, given how many mobile apps make
mathematical notation for programming, but it use of AI.
quickly became a popular choice among AI Java also makes use of simplified
developers. More importantly, the man who debugging, and its easy-to-use syntax
created Lisp was very influential in the field of offers graphical data presentation and
AI, so much of his work had been incorporates both WORA and Object-
implemented for a long time. Oriented patterns.
10
7. Programming languages (cont)
5. C++ 6. R
C++ is another language that has been R may not be the ideal language for AI,
around for a long time yet is still a viable but it excels at crunching massive
option for AI. One of the reasons for this is numbers, making it superior to Python
the language’s broad flexibility, which makes at scale.
it ideal for resource-intensive applications.
C++ is a low-level language that helps the AI R is a suitable language for Artificial
model in production run more smoothly. And, Intelligence because of its built-in
while C++ isn’t everyone’s first pick for AI functional programming, vectorial
engineers, it’s worth noting that many deep computation, and Object-Oriented
and machine learning libraries are created in nature.
the language. 11
2- Knowledge Presentation
12
1. Introduction
▪ If an artificial agent is supposed to solve some problems related to the real world, it
needs to be able to represent knowledge somehow. Facts are represented as data
structures that can be manipulated by programs stored inside the computer.
▪ There are four common methods for representing knowledge: semantic networks,
frames, predicate logic, and rule-based systems.
▪ Semantic networks were developed in the early 1960s by Richard H. Richens. A semantic
network uses directed graphs to represent knowledge.
▪ Semantic networks use vertices to represent concepts, and edges (denoted by arrows) to
represent the relation between two concepts (Figure 13.3).
Concepts Relations
15
4. Frames presentation
▪ Frames are closely related to semantic
networks. In semantic networks, a graph is
used to represent knowledge: in frames, data
structures (records) are used to represent the
same knowledge.
16
5. Predicate logic
▪ The most common knowledge representation is predicate logic. Predicate logic can be
used to represent complex facts. It is a well-defined language developed via a long
history of theoretical logic.
▪ Propositional logic is a language made up from a set of sentences that can be used
to carry out logical reasoning about the world.
▪ Examples,
▪ P(x) = x is a student.
▪ P(classroom) = Classroom is empty.
▪ P(classroom) = Classroom has 25 students
▪ And we can combine quantifiers and predicates,
▪ (Ɐx)P(x) = x passed the exam.
▪ Meaning: All the x passed the exam.
▪ (Ǝx)P(x) = x passed the exam.
▪ Meaning: Some of the x passed the exam. (At least one of the x has passed the
exam.)
17
6. Predicate logic (cont)
Operators
Propositional logic uses five operators, as
shown below:
Sentence
A sentence in this language is defined recursively as shown below:
1. An uppercase letter, such as A, B, S, or T, that represents a statement in a natural languages,
is a sentence.
2. Any of the two constant values (true and false) is a sentence.
3. If P is a sentence, then ¬P is a sentence.
4. If P and Q are sentences, then P ∨ Q, P ∧ Q, P → Q, and P ↔ Q are sentences
18
7. Rule-based systems
▪ A rule-based system represents knowledge using a set of rules that can be used to
deduce new facts from known facts. The rules express what is true if specific
conditions are met.
▪ A rule-based database is a set of if… then… statements in the form in which A is
called the antecedent and B is called the consequent. Note that in a rule-based
system, each rule is handled independently without any connection to other rules.
19
8. Rule-based systems (cont)
Components
▪ A rule-based system is made up of three components: an interpreter (or inference
engine), a knowledge base, and a fact database, as shown in Figure 18.4.
21
1. Introduction
▪ For example, in medicine, an expert system can narrow down a set of symptoms to a
likely subset of causes, a task normally carried out by a doctor.
▪ Extracting knowledge from an expert is normally a difficult task, for several reasons:
1. The knowledge possessed by the expert is normally heuristic: it is based on
probability rather than certainty.
2. The expert often finds it hard to express their knowledge in such a way that it can
be stored in a knowledge base as exact rules. For example, it is hard for an
electrical engineer to show how, step by step, a faulty electric motor can be
diagnosed. The knowledge is normally intuitive.
3. Knowledge acquisition can only be done via personal interview with the expert,
which can be a tiring and boring task if the interviewer is not an expert in this type of
interview.
24
4. Extracting knowledge (cont)
Figure 13.11: Flow Chart for Developing Case Based Reasoning Expert Systems
26
6. Architecture
▪ An expert system can have up to seven components: user, user interface, inference
engine, knowledge base, fact database, explanation system, and knowledge base editor.
▪ The inference engine is the heart of an expert system: it communicates with the
knowledge base, fact database, and the user interface.
▪ User The user is the entity that uses the system to benefit from the expertise offered.
▪ User interface The user interface allows the user to interact with the system. The user
interface can accept natural language from the user and interpret it for the system.
Most user interfaces also offer a user-friendly menu system
▪ Inference engine The inference engine is the heart of the system that uses the
knowledge base and the fact database to infer the action to be taken.
▪ Knowledge base The knowledge base is a collection of knowledge based on
interviews with experts in the relevant field of expertise.
▪ Fact database The fact database in an expert system is case-based. For each case,
the user enters the available or measured data into the fact database to be used by
the inference engine for that particular case.
▪ Explanation system The explanation system, which may not be included in all
systems, is used to explain the rationale behind the decision made by the inference
engine.
▪ Knowledge base editor The knowledge base editor, which may not be included in all
systems, is used to update the knowledge base if new experience has been obtained 28
from experts in the field.
4- Perception
29
1. Introduction
▪ The first step in natural language processing is speech recognition. In this step, a
speech signal is analyzed and the sequence of words it contains are extracted. The
input to the speech recognition subsystem is a continuous (analog) signal: the output is
a sequence of words. The signal needs to be divided into different sounds, sometimes
called phonemes.
▪ The sounds then need to be combined into words. The detailed process, however, is
beyond the scope of this book: we leave the task to specialized books in speech
recognition.
36
Figure 13.18 overview of Speech recognition
8. Language understanding - Syntactic analysis
▪ The syntactic analysis step is used to define how words are to be grouped in a
sentence.
▪ This is a difficult task in a language like English, in which the function of a word in a
sentence is not determined by its position in the sentence.
▪ For example, in the following two sentences:
it is always John who is rewarded, but in the first sentence John is in the last position
and Mary is in the first position.
A machine that hears any of the above sentences needs to interpret them correctly
and come to the same conclusion no matter which sentence is heard.
37
5 - Neuron Network
38
1. Introduction
39
Figure 13.19 A simplified view of an Artificial Neural Network
2. History of Neural Networks
▪ The first neural network was conceived of by Warren McCulloch and Walter Pitts in
1943. They wrote a seminal paper on how neurons may work and modelled their ideas
by creating a simple neural network using electrical circuits.
▪ This breakthrough model paved the way for neural network research in two areas
Figure 13.20 Biological processes in the brain Figure 13.21 The application of neural networks in AI
40
3. Biological neurons
▪ The human brain has billions of processing units, called neurons. Each
neuron, on average, is connected to several thousand other neurons. A
neuron is made of three parts: soma, axon, and dendrites, as shown in Figure
13.22.
41
4. Perceptron
42
Figure 13.23 A perceptron
5. Example Perceptron
▪ This set of inputs is used to train a perceptron with all equal weights (w1 5 w2 5 w3).
▪ The threshold is set to 0.8. The original weight for all inputs is 50 per cent. The weights
remain the same if the output produced is correct—that is, matches the actual output.
▪ The weights are increased by 10 per cent if the output produced is less than the output
data: the weights are decreased by 10 per cent if the output produced is greater than the
output data.
43
6. Multiple layer
44
Figure 13.24 Multiple layer ANN
7. Applications
45
8. Applications
47
1. Introduction
48
2. TECHNOLOGY
49
3. TECHNOLOGY (cont)
▪ RNNs are called recurrent because they perform the same task for every element of
a sequence, with the output being depended on the previous computations. Or RNNs
have a “memory” which captures information about what has been calculated so far.
52
6. CHALLENGES
53
7. REAL TIME APPLICATIONS
1. Automatic Colorization of Black and White Images
54
Q&A
55