Introduction to Artificial Intelligence and Machine Learning

nisharobinrohit 69 views 43 slides Aug 17, 2024
Slide 1
Slide 1 of 64
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64

About This Presentation

Introduction to AI ML and DL


Slide Content

1 Artificial Intelligence Vs Machine Learning Vs Deep Learning An “intelligent” computer uses Artificial Intelligence to think like a human and perform tasks on its own.  Machine learning is how a computer system develops its intelligence. One way to train a computer to mimic human reasoning is to use a neural network ( Deep Learning ) , which is a series of algorithms that are modelled after the human brain.

DEEP LEARNING Deep learning is a type of Machine Learning and artificial intelligence that imitates the way humans gain certain types of knowledge . 01 Deep learning is an important element of data science, which includes statistics and Predictive Modeling 02 Algorithms in Deep Learning KNN ( K – Nearest Neighbor) method Artificial Neural Network (ANN) Convolutional Neural Network (CNN) Recurrent Neural Network(RNN) Deep Neural Network (DNN) Deep Belief Network (DBN) Back Propagation 03

It lessens the need for feature engineering. It eradicates all those costs that are needless. It easily identifies difficult defects. It results in the best-in-class performance on problems.  DEEP LEARNING Advantages of Deep Learning

DEEP LEARNING Disadvantages of Deep Learning  It requires an sample amount of data. It is quite expensive to train. It does not have strong theoretical groundwork.

DEEP LEARNING Virtual Assistants Vision for Driverless, Autonomous Cars Service and Chat Bots Examples of Deep Learning Translations  Facial Recognition Shopping and Entertainment Aerospace and Defense

MACHINE LEARNING Machine learning is a subfield of artificial intelligence, which is broadly defined as the capability of a machine to imitate intelligent human behavior Definition machine learning allows the user to feed a computer algorithm an immense amount of data and have the computer analyze and make data-driven recommendations and decisions based on only the input data. Supervised, Unsupervised, and Reinforcement Learning TYPES OF ML Machine learning is how a computer system develops its intelligence Definition machine learning allows self-driving cars to instantaneously adapt to changing road conditions, while at the same time learning from new road situations . ML used in everyday life Why do we use ML

MACHINE LEARNING Agriculture  Extraction Predictive analytics Medical diagnosis Speech recognition Image recognition Cyber security Smart assistants  Examples of machine learning

ARTIFICIAL INTELLIGENCE Artificial intelligence is the simulation of human intelligence processes by machines, especially computer systems.  “AI,” is the ability for a computer to think and learn. With AI, computers can perform tasks that are typically done by people, including processing language, problem-solving, and learning. .

ARTIFICIAL INTELLIGENCE ORIGINAL DEFINITION OF AI the science and engineering of making intelligent machines ”. A B C AI in real life AI is a combination of Machine Learning techniques and Deep Learning.  AI in everyday life Voice assistants, image recognition for face unlock in cellphones, and ML-based financial fraud detection  

ARTIFICIAL INTELLIGENCE AI is important? Artificial intelligence forms the basis for all computer learning and is the future of all complex decision making AI and its function Artificial intelligence (AI) makes it possible for machines to learn from experience, adjust to new inputs and perform human-like tasks.  GOALS OF AI? Develop problem-solving ability. Incorporate knowledge representation. ... Facilitate planning. ... Allow continuous learning. ... Encourage social Intelligence. Promote creativity. .

NEURAL NETWORK A neural network is a method in artificial intelligence that teaches computers to process data in a way that is inspired by the human brain. It is a type of machine learning process, called deep learning, that uses interconnected nodes or neurons in a layered structure that resembles the human brain. Neural networks, also known as artificial neural networks (ANNs) or simulated neural networks (SNNs). Neural Networks are a subset of Machine Learning techniques which learn the data and patterns in a different way utilizing Neurons and Hidden layers.

13 AI Use Cases in Maritime Planning Shipment of Containers - Predictive Scheduling. Organizing Containers Positioning. Voyage Planning and Route Forecasting. Optimizing Fuel Consumption and Emissions Reduction. Autonomous Ships and Port Operations. Predictive Maintenance. Dynamic Pricing for the Shipping Industry.

Module 1: Bayesian Filtering; Recurrent Neural Networks, Deep Neural Networks, Deep Reinforcement Learning.

BAYESIAN FILTERING A Bayes filter is an algorithm used in computer science for calculating the probabilities of multiple beliefs to allow a robot to infer its position and orientation. Essentially, Bayes filters allow robots to continuously update their most likely position within a coordinate system, based on the most recently acquired sensor data. This is a recursive algorithm. It consists of two parts: prediction and innovation. If the variables are normally distributed and the transitions are linear, the Bayes filter becomes equal to the Kalman filter.

16 Email- Filtering: It wasn’t long after the  creation of email  that email spam became a growing problem. Nowadays, we have spam filters in place to protect our inboxes from being inundated with unwanted messages, promotions and chain letters. One such method of filtering emails uses a Bayesian interpretation of probability and is known as a Bayesian filter.

Bayesian spam filter A Bayesian filter is an email spam filter that uses  Bayesian logic . This means it uses a Bayesian interpretation of probability and Bayes’ theorem to calculate how likely it is an email is spam. But that’s all a bit technical. A statistician named Thomas Bayes  came up with an equation that allows new information to update the outcome of a probability calculation. 17

How to identify Spam mails? Spam characteristically contains certain content and features. For instance,  certain keywords, header content, content length  and so on can all indicate the likelihood of the email being spam. So, an email subjected to a Bayesian filter will get analysed based on these characteristics and assigned a probability of being spam. The more of these characteristics that a message has, the more likely it is to end up in your spam folder. 18

How it works A Bayesian filter works by comparing your incoming email with a database of emails, which are categorised into ‘spam’ and ‘not spam’. Bayes’ theorem is used to learn from these prior messages. Then, the filter can calculate a spam probability score against each new message entering your inbox. This “ learning ” process also happens on the fly. For example, every time you instruct the filter to spam or quarantine certain messages, it will incorporate that data into future actions. So, the Bayesian filter will improve with time – even as spammers invent new ways to get their emails through.  19

For example We know that approximately  55% of all email sent today is spam . This means that, out of 1000 emails, 550 of them are spam, 450 are legitimate. So, a message going through a Bayesian filter is 55% likely to be spam. The filter will consider all sorts of spam characteristics. For instance, say an email with ‘act now’ in the header has a 20% chance of being spam, and a 10% chance of not being spam. The filter will apply this, and build on the previous information. So: Out of those 1000 emails, 550 are spam, and 20% (or 110) of those have ‘act now’ in the header. Of the 450 emails that aren’t spam, 10% (or 45) have ‘act now’ in the header. 20

This means that, in this example, 155 messages have ‘act now’ in the header, and 110 (or 70%) of them are spam. This would mean that, to the Bayesian filter, an email with ‘act now’ in its header has a 70% chance of being spam. Then, the Bayesian filter will search the email for the next characteristic. But this time, it will start with this 70% chance of being spam. And so on. 21

A Bayesian filter In short, a Bayesian filter is an  email spam  filter. It looks for certain characteristics in emails and uses them to calculate the probability of that email being spam. For every spam characteristic found, a Bayesian filter will increase the probability that the email is spam. If the filter eventually estimates that the email has a 99% or higher probability of being spam, into the spam folder it goes. 22

A c t i o n s  Often the world is dynamic since  actions carried out by the robot ,  actions carried out by other agents ,  or just the time passing by change the world.  How can we incorporate such actions ?

Typical Actions  The robot turns its wheels to move  The robot uses its manipulator to grasp an object  Plants grow over time …  Actions are never carried out with absolute certainty .  In contrast to measurements, actions generally increase the uncertainty .

Modeling Actions  To incorporate the outcome of an action u into the current “ belief ” , we use the conditional pdf P(x|u,x ʼ )  This term specifies the pdf that executing u changes the state from x ʼ to x .

Example: Closing the door

State Transitions P(x|u,x ʼ ) for u = “ close door ” : If the door is open, the action “ close door ” succeeds in 90% of all cases. c l o s e d 0.1 o p e n 1 0.9

Integrating the Outcome of Actions P ( x | u )   P ( x | u , x ') P ( x ') dx ' P ( x | u )   P ( x | u , x ') P ( x ') Continuous case: Discrete case:

Example: The Resulting Belief P ( closed | u )   P ( closed | u , x ') P ( x ')  P ( closed | u , open ) P ( open ) P ( closed | u , closed ) P ( closed ) 9 5 1 3 15      10 8 1 8 16 P ( open | u )   P ( open | u , x ') P ( x ')  P ( open | u , open ) P ( open ) P ( open | u , closed ) P ( closed ) 1 5 3 1      10 8 1 8 16  1  P ( closed | u )

Me a s u re m e n ts  Bayes rule P ( x z )  P ( z | x ) P ( x )  likelihood  prior P ( z ) evidence

Bayes Filters: Framework  Given:  Stream of observations z and action data u: d t  { u 1 , z 1 … , u t , z t }  Sensor model P(z|x).  Action model P(x|u,x ’ ) .  Prior probability of the system state P(x).  Wanted:  Estimate of the state X of a dynamical system.  The posterior of the state is also called Belief : Bel ( x t )  P ( x t | u 1 , z 1 … , u t , z t )

Markov Assumption p ( z t | x 0: t , z 1: t  1 , u 1: t )  p ( z t | x t ) p ( x t | x 1: t  1 , z 1: t  1 , u 1: t )  p ( x t | x t  1 , u t ) Underlying Assumptions  Static world  Independent noise  Perfect model, no approximation errors

  P ( z t | x t )  P ( x t | u t , x t  1 ) Bel ( x t  1 ) dx t  1 Bayes Filters Bayes z = observation u = action x = state  P ( x t | u 1 , z 1 … , u t , z t )   P ( z t | x t , u 1 , z 1 , … , u t ) P ( x t | u 1 , z 1 , … , u t )   P ( z t | x t ) P ( x t | u 1 , z 1 , … , u t )   P ( z t | x t )  P ( x t | u 1 , z 1 , … , u t , x t  1 ) P ( x t  1 | u 1 , z 1 , … , u t ) dx t  1   P ( z t | x t )  P ( x t | u t , x t  1 ) P ( x t  1 | u 1 , z 1 , … , u t ) dx t  1   P ( z t | x t )  P ( x t | u t , x t  1 ) P ( x t  1 | u 1 , z 1 , … , z t  1 ) dx t  1 Bel ( x t ) Mark o v Mark o v Total prob. Mark o v

13 Bayes Filter Algorithm 1. Algorithm Bayes_filter ( Bel(x),d ): 2.   3. If d is a perceptual data item z then 4. For all x do Bel '( x )  P ( z | x ) Bel ( x )     Bel '( x ) For all x do Bel '( x )    1 Bel '( x ) Else if d is an action data item u then 5. 6. 7. 8. 9. 10. 11. For all x do Bel '( x )   P ( x | u , x ') Bel ( x ') dx ' 12. Return Bel ʼ (x)

Example Applications  Robot localization:  Observations are range readings (continuous)  States are positions on a map (continuous)  Speech recognition HMMs:  Observations are acoustic signals (continuous valued)  States are specific positions in specific words (so, tens of thousands)  Machine translation HMMs:  Observations are words (tens of thousands)  States are translation options

Example: Robot Localization t=0 Sensor model: never more than 1 mistake Know the heading (North, East, South or West) Motion model: may not execute action with small prob. 0 1 P r ob Example from Michael Pfeiffer

Example: Robot Localization Prob 0 1 t=1 Lighter grey: was possible to get the reading, but less likely b/ c required 1 mistake

Example: Robot Localization 1 t=2 P r ob

Example: Robot Localization 1 t=3 P r ob

Example: Robot Localization 1 t=4 P r ob

Example: Robot Localization 1 t=5 P r ob

16 Summary  Bayes rule allows us to compute probabilities that are hard to assess otherwise.  Under the Markov assumption, recursive Bayesian updating can be used to efficiently combine evidence.  Bayes filters are a probabilistic tool for estimating the state of dynamic systems.

Recurrent Neural network Recurrent Neural Network(RNN) are a type of  Neural Network  where the output from previous step are fed as input to the current step.   In traditional neural networks, all the inputs and outputs are independent of each other, but in cases like when it is required to predict the next word of a sentence, the previous words are required and hence there is a need to remember the previous words.  

Recurrent neural network The main and most important feature of RNN is Hidden state, which remembers some information about a sequence. RNN have a “memory” which remembers all information about what has been calculated

Recurrent Neural Network

Recurrent neural network

Recurrent neural network Why Recurrent Neural Networks: RNN were created because there were a few issues in the feed-forward neural network: Cannot handle sequential data Considers only the current input Cannot memorize previous inputs

Recurrent neural network How Does Recurrent Neural Networks Work? In Recurrent Neural networks, the information cycles through a loop to the middle hidden layer.

Recurrent neural network Training through RNN A single time step of the input is provided to the network. Then calculate its current state using set of current input and the previous state. The current ht becomes ht-1 for the next time step. One can go as many time steps according to the problem and join the information from all the previous states.

Recurrent neural network Once all the time steps are completed the final current state is used to calculate the output. The output is then compared to the actual output i.e the target output and the error is generated. The error is then back-propagated to the network to update the weights and hence the network (RNN) is trained.

TYPES OF RECURRENT NEURAL NETWORKS (RNNS) One to One One to Many Many to One Many to Many Also note that while feed-forward neural networks map one input to one output, RNNs can map one to many, many to many (translation) and many to one (classifying a voice).

Recurrent Neural Network One to One RNN One-to-one  is a simple neural network. It is commonly used for machine learning problems that have a single input and output

Recurrent Neural Network One-to-many  has a single input and multiple outputs. This is used for generating image captions .

Recurrent Neural Network Many-to-one  takes a sequence of multiple inputs and predicts a single output. It is popular in sentiment classification, where the input is text and the output is a category like positive/negative/neutral.

Recurrent Neural Network Many-to-many  takes multiple inputs and outputs. The most common application is machine translation.

Deep Neural Network 56

Deep Neural Networks A deep neural network (DNN) is an ANN with multiple hidden layers between the input and output layers. Similar to shallow ANNs, DNNs can model complex non-linear relationships. The main purpose of a neural network is to receive a set of inputs, perform progressively complex calculations on them, and give output to solve real world problems like classification. We restrict ourselves to feed forward neural networks. 57

Deep Neural Networks We have an input, an output, and a flow of sequential data in a deep network. 58

Deep Neural Networks In deep learning, the number of hidden layers, mostly non-linear, can be large; say about 1000 layers. DL models produce much better results than normal ML networks. Mostly use the gradient descent method for optimizing the network and minimizing the loss function. Imagenet , a repository of millions of digital images to classify a dataset into categories like cats and dogs. DL nets are increasingly used for dynamic images apart from static ones and for time series and text analysis. 59

Deep Neural Networks Training the data sets forms an important part of Deep Learning models. In addition, Backpropagation is the main algorithm in training DL models. DL deals with training large neural networks with complex input output transformations. One example of DL is the mapping of a photo to the name of the person(s) in photo as they do on social networks and describing a picture with a phrase is another recent application of DL. 60

Deep Neural Networks 61

Deep Neural Networks Neural networks are functions that have inputs like x1,x2,x3…that are transformed to outputs like y1,y2,y3(z1,z2,z3) and so on in two (shallow networks) or several intermediate operations also called layers (deep networks). The weights and biases change from layer to layer. ‘w’ and ‘v’ are the weights or synapses of layers of the neural networks. The best use case of deep learning is the supervised learning problem. Here, we have large set of data inputs with a desired set of outputs. 62

Deep Neural Networks 63

Deep Neural Networks Here we apply back propagation algorithm to get correct output prediction. The most basic data set of deep learning is the MNIST( Modified National Institute of Standards and Technology  database), a dataset of handwritten digits. We can train deep a Convolutional Neural Network with Keras to classify images of handwritten digits from this dataset. The firing or activation of a neural net classifier produces a score. For example, to classify patients as sick and healthy, we consider parameters such as height, weight and body temperature, blood pressure etc. A high score means patient is sick and a low score means he is healthy. 64

Deep Neural Networks Each node in output and hidden layers has its own classifiers. The input layer takes inputs and passes on its scores to the next hidden layer for further activation and this goes on till the output is reached. This progress from input to output from left to right in the forward direction is called  forward propagation. Credit assignment path (CAP) in a neural network is the series of transformations starting from the input to the output. CAPs elaborate probable causal connections between the input and the output. 65