AI Lab
Lecture: 21.11.2024
Sangeeta Biswas, Ph.D.
Associate Professor,
University of Rajshahi, Rajshahi-6205, Bangladesh
AI, ML, and DL
Artificial Intelligence (AI)
Machine Learning (ML)
AI
Deep Learning (DL)
AI ⊃ ML ⊃ DL
2
Machine Learning Vs Deep Learning
DL Log of DL
NonDL
Me
3
Pioneers of DL
● They won
Turing Prize
in 2018
4
Awards in the Bag of DL
● John Hopfield and Geoffrey
Hinton were awarded Nobel
Prize in Physics in 2024
● Because of them and many
more researchers we
entered in a successful DL
era.
5
Deep Neural Network
● Deep Learning (DL) is a field of AI that uses Deep Neural Network (DNN)s to
teach computers to process data in a way inspired by the human brain.
● A DNN consists of interconnected nodes or artificial neurons in a multi-layered
structure.
● DNNs can recognize data patterns like complex pictures, text, and sounds to
produce accurate insights and predictions.
6
Why DNN is So Impressive!
DNN achieves:
● Discriminative power
● Predictive Power
● Generative power
Because of the generative power,
DNN could build a helpful,obedient
Genie or a harmful Frankenstein for
us.
Frankenstein
DNN
Genie
7
Universal Function Approximator
The main strong point of a deep
Neural Network (DNN) is its
universality power.
An DNN can approximate any
function no matter how
complicated the function is if we
can ensure that the network has
sufficient number of neurons.
8
Artificial Neuron
Artificial neuron is nothing but a composite
function, (𝒈 𝒇)(𝒙)
𝒖 = 𝒇(𝒙)
𝒙 𝒇(𝒙) 𝒈(𝒖) 𝒚
𝒚 = 𝒈(𝒖)
where Artificial Neuron
● 𝒙 is input and 𝒚 is output
● 𝒇(𝒙) is a linear function
● 𝒈(𝒖) is generally a nonlinear function
9
Artificial Neuron
In an artificial neuron, at first input is multiplied by 𝒃
a weight and summed with bias.
𝒚 = 𝒈(𝒇(𝒙))
𝒙 𝒘 𝒇(𝒙) 𝒈(𝒖) 𝒚
𝒖 = 𝒇(𝒙) = 𝒘𝒙 + 𝒃
where
Artificial Neuron
● 𝒘 is weight which decides how much
influence 𝒙 will have on 𝒖.
● 𝒃 is bias which ensures that 𝒖 is not too big or
too small on average
10
Artificial Neuron
For a vector 𝒙, weight 𝒘 is a vector and bias 𝒃 is a 𝒃
scalar. 𝒙 𝒘1
1
𝒖 = 𝒇(𝒙) 𝒘2
𝒙2 𝒇(𝒙) 𝒈(𝒖) 𝒚
= 𝒘1 𝒙1 + 𝒘2 𝒙2 + 𝒘3 𝒙3 + 𝒃
𝒘3
= 𝒘T𝒙 + 𝒃 𝒙3
Artificial Neuron
𝒈(𝒖) is known as activation function. Generally
nonlinear functions are used as activation
functions.
11
Artificial Neural Network (ANN)
ANN is nothing but a composite of composite functions:
(𝒈no 𝒇n…….𝒈2o 𝒇2 o 𝒈1o 𝒇1)(𝒙)
𝒃1
𝒘1 𝒇1 𝒈1 𝒘4
𝒘5 𝒇4 𝒈4
𝒘10
𝒘6
Number of 𝒘2 𝒃2 𝒇6 𝒈6 𝒚
𝒙 𝒘7
parameters: 𝒇2 𝒈2
weights + bias 𝒘8 𝒘11
(optional) + any 𝒇5 𝒈5 Output
Input 𝒘3 layer
variables in 𝒈(.) layer
𝒘9
(optional) 𝒇3 𝒈3
Hidden layer
Hidden layer
12
Presently Main Research Areas of DNN
● Natural Language Processing (NLP)
○ NLP is a subfield of AI which which works on giving computers the ability
to interpret, manipulate, and comprehend human language.
○ It includes text to speech generation, sentiment understanding, or
classifying text based on content.
● Large Language Model (LLM)
○ LLM is a branch of AI system that generates human-like text based on
vast amounts of training data.
○ ChatGPT
● Computer Vision (CV)
13
Vision
● Vision: দৃিষ্টি AI
● দৃিষ্টিশিক্তি, দূরদৃিষ্টি, কল্পনা, কল্পনায় দখেত পাওয়ার অিভজ্ঞতা
● Human Vision: A complex process of creating a visual ML
representation of the world around us with the help of our eyes
and brain.
AI
● Computer Vision (CV): DL
○ A complex process of deriving meaningful information from
digital images, videos and other visual inputs with the help
of Computers’ artificial intelligence ability.
○ Different non-neural techniques were used at earlier stage. CV
○ Now-a-days Deep Learning based techniques are
dominating CV
14
Human Vision
Khan et al., ICCIT, Dhaka, 2024
15
Computer Vision Tasks
16
What We will Use
In this Lab, we will focus on only the
Classification problem of CV.
● Linux Environment
● Tensorflow, Keras
● Python
● OpenCV
● Other Python Libraries such as
matplotlib, scikit, pandas
● Google Colab
https://colab.research.google.com/
17
MNIST Fashion Dataset
● 70000 images 28 x 28
○ 60000 for training
○ 10000 for testing
● 10 classes
○ 0: T-shirt/top, 1: Trouser
2: Pullover, 3: Dress
4: Coat, 5: Sandal
6: Shirt, 7: Sneaker
8: Bag, 9: Ankle boot
18
MNIST Digit Dataset
● 70000 images 28 x 28
○ 60000 for training
○ 10000 for testing
● 10 classes
○ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
19
Other Datasets
● CIFAR 10 dataset
○ https://www.cs.toronto.edu/~kriz/cifar.html
○ 60000, 32x32 colour images in 10 classes, with 6000 images per class
○ 50000 training images and 10000 test images
● CIFAR 100 dataset
○ https://www.cs.toronto.edu/~kriz/cifar.html
○ 100 classes containing 600 images each
○ 500 training images and 100 testing images per class
● ImageNet 1000 dataset
○ https://www.image-net.org/
○ 1000 object classes
○ 1281167 training images, 50000 validation images and 100000 test images.
20
Your Own Dataset
Prepare an image dataset capturing pictures using your mobile phone or camera.
● Binary Class
○ For example, merry gold and rose
○ Captured images should not be offensive to any belief of any ethnic group
○ No human beings’ images without their written permission
● At least 500 images for each class
○ Not more than 2 images from an object
● Register your class in the following excel sheet
○ https://docs.google.com/spreadsheets/d/1TIq35QJGJNwPIHzet4V68-sYufE_0iFphDcA3iz07ss
/edit?usp=sharing
○ Two students cannot choose the same class to prepare their dataset
21