0% found this document useful (0 votes)
49 views34 pages

Artifical Intellegence

Uploaded by

Trynos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views34 pages

Artifical Intellegence

Uploaded by

Trynos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

Artificial intelligence

What is Artificial Intelligence

• Artificial Intelligence is concerned with “how to make computers do


things at which, at the moment, people are better.”
• (E. Rich. Artificial Intelligence. McGraw-Hill, 1983)
• Artificial intelligence involves the automation of intelligent behaviour.
How graphs can be used in AI
• A graph is a collection of nodes or vertices between which there can be edges.
• Each node has a name.
• An edge can have an associated label which is a numerical value.

• One common representation is that the nodes represent


places and the edge labels represent the distances
between those places.
• Edges are only included in the graph when there is a
route available for direct travel between the pair of
nodes
How graphs can be used in AI
• to find the shortest route between node
A and node D we need to consider all
of the possible routes and calculating
the overall distance for each route
• For A to B to C to D overall distance is
40 + 10 + 40 = 90
• For A to B to F to E to D overall distance
is 40 + 15 + 20 + 5 = 80, which is the
shortest
• For A to F to E to D overall distance is
60 + 20 + 5 = 85
• For A to F to B to C to D overall distance
is 60 + 15 + 10 + 40 = 125
Shortest path algorithms
• Dijkstra’s algorithm (pronounced dyke – strah) is a method of finding
the shortest path between two points on a graph.
• Each point on the graph is called a node or a vertex
• It is the basis of technology such as GPS tracking and, therefore, is an
important part of AI.
Dijkstra’s algorithm

• Identify the source node (S) where the path starts.


• Create an empty set called the ShortestPath set.
• Create another set called RemainingNodes and put all of the nodes
into this including the source node (S).
• Create a record that stores:
• node names
• calculated values for the distance to the node from the source node
• the sequence of nodes in the route to the node.
• Set the distance value for the source node S to be 0.
Dijkstra’s algorithm
• Set the distance value for all other nodes to be INFINITY where this is to be
set as a large value greater than any value that will be calculated.
• While the ShortestPath set does not include all of the nodes do the
following:
• Pick the node (N) from the RemainingNodes set that has the lowest distance value.
• Move this node into the ShortestPath set.
• For each node in the RemainingNodes set that is adjacent to N:
• Calculate a new distance value by adding the value given by the label of the edge connecting the
two nodes to the already stored distance for N.

• If this value is less than the value currently stored replace this stored value by the new one that
has been calculated.

• If a new value has been stored enter the sequence of nodes used to obtain this value
Dijkstra’s algorithm
A* algorithm
• One of the disadvantages of Dijktra is that it has to visit every node
before it completes its job
• A* algorithm is based on Dijkstra, but adds an extra heuristic (h) value
– an ‘intelligent guess’ on how far we have to go to reach the
destination most efficiently.
• The use of heuristics means that we can find the shortest path between
two points much quicker than if we investigated EVERY pathway before
finding the shortest path
• The A* algorithm is a slight variation of Dijkstra’s algorithm which
makes use of heuristics to increase the algorithm’s effeciency
A* Algorithm
How can an Algorithm use heuristics?
Consider the following graph
Just like the previous graphs we have seen, the distances
between each node are clearly shown here

But what is also shown is the straight line distance from each
node to the destination node
A* Algorithm
• This additional information is what enables
A* algorithm to make use of heuristic
because this algorithm (as it visits each
node ) works out not only the distance
from start, but also the shortest possible to
the end node
• by considering both when comparing
possible pathways , we can often disregard
certain pathways because a node ‘s
shortest possible distance to the end node ,
may already be further than another path
A* Algorith
• Use the A* algorithm to work out the short route from A to F
1 create a queue of all nodes with starting at the front and add to
each their distance from the starting node, heuristic distance to the
end node

2 Remove the front node and add to the visited list along with its
distance from the start node

3 Update the data of each node connected to the visited node


(distance from end node and their sum)

4 Reorganise the queue so that the node are ordered in terms of


the sum of the distances (shortest list)

5 Repeat the steps above until all the nodes have been visited
( moved to the front and dropped down to the visited list)
A* Algorithm Use the A* algorithm to work out the short route from A to F
A B C D E F
G=0 G=∞ G=∞ G=∞ G=∞ G=∞
H=80 H=90 H=70 H=50 H=20 H=0
F=80 F=∞ F=∞ F=∞ F=∞ F=∞

C B D E F
G=25 G=210 G=∞ G=∞ G=∞
H=70 H=90 H=50 H=20 H=0
F=95 F=300 F=∞ F=∞ F=∞

B D E F
G=210 G=76 G=201 G=∞
H=90 H=50 H=20 H=0
F=300 F=126 F=221 F=∞

D E B F
G=76 G=201 G=210 G=∞
H=50 H=20 H=90 H=0
F=126 F=221 F=300 F=∞

D E B F
G=76 G=201 G=210 G=∞
H=50 H=20 H=90 H=0
F=126 F=221 F=300 F=∞

E B F
G=201 G=210 G=383 A=0 C=25 D=75 E=201 F=383
H=20 H=90 H=0
F=221 F=300 F=383

B F 386 is longer
G=210 G=383 so F remain
H=90 H=0
F=300 F=383
Artificial Intelligence (AI)
• shows the link between artificial intelligence (AI), machine learning and deep
learning.
• Deep learning is a subset of machine learning, which is itself a subset of AI.
Artificial intelligence,
machine
learning and deep learning
Artificial Intelligence (AI)
• shows the link between artificial intelligence (AI), machine learning and deep
learning.
• Deep learning is a subset of machine learning, which is itself a subset of AI.
Artificial Intelligence
• AI can be thought of as a machine with cognitive abilities such as problem solving and learning from
examples.
• All of these can be measured against human benchmarks such as reasoning, speech and sight.
• AI is often split into three categories.
• 1 Narrow AI is when a machine has superior performance to a human when doing one specific task.
• 2 General AI is when a machine is similar in its performance to a human in any intellectual task.
• 3 Strong AI is when a machine has superior performance to a human in many tasks
Artificial intelligence,
machine
learning and deep learning
Artificial Intelligence (AI)
• shows the link between artificial intelligence (AI), machine learning and deep
learning.
• Deep learning is a subset of machine learning, which is itself a subset of AI.
Artificial Intelligence
• AI can be thought of as a machine with cognitive abilities such as problem solving and learning from
examples.
• All of these can be measured against human benchmarks such as reasoning, speech and sight.
• AI is often split into three categories.
• 1 Narrow AI is when a machine has superior performance to a human when doing one specific task.
• 2 General AI is when a machine is similar in its performance to a human in any intellectual task.
• 3 Strong AI is when a machine has superior performance to a human in many tasks
Machine learning
• Machine learning is a subset of AI, in which the algorithms are
‘trained’ and learn from their past experiences and examples.
• The system can make predictions or even take decisions based on
previous scenarios.
• They can offer fast and accurate outcomes due to very powerful
processing capability
• One of the key factors is the ability to manage and analyse
considerable volumes of complex data
Machine learning
A good example is a search engine

The search engine will learn from its past performance, meaning its ability to carry out searches becomes
more sophisticated and accurate.
Labelled and unlabelled data
• Labelled data – data where we know the target answer and the data object is fully recognized
• Unlabelled data – data where objects are undefined and need to be manually recognised.
• Now, suppose you want to automatically count the types of birds seen in a bird sanctuary.
• The proposed system will consider bird features such as shape of beak, colour of feathers, body size, and so
on.
• This requires the use of labelled data to allow the birds to be recognised by the system
Labelled and unlabelled data
• Machine learning recognises the birds as labelled data, allowing it to be
trained.
• Once trained, it is able to recognise each type of bird from the original
data set.
• Algorithms are used to analyse the incoming data (by comparing it to bird
features already recognised by the model) and to learn from this data.
• Informed decisions are then made based on what it has learned.
• Thus, in this example, it is able to recognise new data and produce an
output automatically showing how many of each type of bird was
detected.
Types of machine learning
• There are a number of different types of
machine learning, including
supervised,
unsupervised learning,
reinforcement and
 semi-supervised (active).
Supervised learning

• Supervised learning makes use of regression analysis and


classification analysis.
• It is used to predict future outcomes based on past data:
• » The system requires both an input and an output to be given to the model so it can be
trained.
• » The model uses labelled data, so the desired output for a given input is known.
• » Algorithms receive a set of inputs and the correct outputs to permit the learning process.
• » Once trained, the model is run using labelled data.
• » The results are compared with the expected output; if there are any errors, the model needs
further refinement.
• » The model is run with unlabelled data to predict the outcome.
• An example of supervised learning is categorising emails as relevant
or spam/ junk without human intervention.
Unsupervised learning

• Systems are able to identify hidden patterns from the input data provided;
• they are not trained using the ‘right’ answer.
• By making data more readable and more organised, patterns, similarities
and anomalies will become evident (unsupervised learning makes use of
density estimation and k-mean clustering; in other words, it classifies
unlabelled real data).
• Algorithms evaluate the data to find any hidden patterns or structures
within the data set.
• An example is used in product marketing: a group of individuals with
similar purchasing behaviour are regarded as a single unit for promotions.
Reinforcement learning

• The system is not trained. It learns on the basis of ‘reward and


punishment’ when carrying out an action (in other words, it uses trial
and error in algorithms to determine which action gives the
highest/optimal outcome).
• This type of learning helps to increase the efficiency of the system by
making use of optimisation techniques.
• Examples include search engines, online games and robotics.
Semi-supervised (active) learning

• Semi-supervised learning makes use of labelled and unlabelled data to train


algorithms that can interactively query the source data and produce a desired output.
• It makes as much use of unlabelled data as possible (this is for cost reasons, since
unlabelled data is less expensive than labelled data when carrying out data
categorisation).
• A small amount of labelled data is used combined with large amounts of unlabelled
data.
• Examples of uses include the classification of web pages into sport, science, leisure,
finance, and so on.
• A web crawler is used to look at large amounts of unlabelled web pages, which is
much cheaper than going through millions of web pages and manually annotating
(labelling) them.
Deep learning
• Deep learning structures algorithms in layers (input layer, output
layer and hidden layer(s)) to create an artificial neural network that
can learn and make intelligent decisions on its own.
• Its artificial neural networks are based on the interconnections
between neurons in the human brain.
• The system is able to think like a human using these neural networks,
and its performance improves with more data
Deep learning
• The hidden layers are where data from the input layer is processed
into something which can be sent to the output layer.
• Artificial neural networks are excellent at identifying patterns which
would be too complex or time consuming for humans to carry out.

You might also like