Professional Documents
Culture Documents
Machine Learning: Aigerim Bogyrbayeva
Machine Learning: Aigerim Bogyrbayeva
Aigerim Bogyrbayeva
Lecture 2
Agenda
● Feature engineering
○ Feature selection
○ Feature extraction
■ In Computer Vision
■ In Natural Language Processing
But, first, what we have covered in previous class?
● Most of the time, Feature Engineering will have more effect than
a model selection!
How we see the world?
How computers see the world?
How computers see the world?
How computers see the world?
Computer Vision
3 4 76 2 13 23 61 72
G - green
54 45 45 23 54 54 13 117
3 4 76 2 13 23 61 72
54 45 45 23 54 54 13 117
R - red 76 13 61 72
45 54 13 117
How computer see the images?
3 4 2 23
B - blue
54 45 23 54
3 4 76 2 13 23 61 72
G - green
54 45 45 23 54 54 13 117
3 4 76 2 13 23 61 72
54 45 45 23 54 54 13 117
R - red 76 13 61 72
45 54 13 117
How computer see the images?
3 4 2 23
Gray- 54 45 23 54
scale 76 13 61 72
45 54 13 117
How computer see the images?
3 4 2 23
B - blue
54 45 23 54
3 4 76 2 13 23 61 72
G - green
54 45 45 23 54 54 13 117
1600x1200 = 1 920 000
3 4 76 2 13 23 61 72
54 45 45 23 54 54 13 117
R - red 76 13 61 72
45 54 13 117 1600x1200
How computer see the images?
3 4 2 23
B - blue
54 45 23 54
3 4 76 2 13 23 61 72
G - green
54 45 45 23 54 54 13 117
1600x1200 = 1 920 000
3 4 76 2 13 23 61 72
But, what if we have 54 45 45 23 54 54 13 117
1 million images? R - red 76 13 61 72
45 54 13 117 1600x1200
How computer see the images?
3 4 2 23
B - blue
54 45 23 54
3 4 76 2 13 23 61 72
G - green
54 45 45 23 54 54 13 117
1600x1200 = 1 920 000
3 4 76 2 13 23 61 72
1000 px
Get the important features
1 5 6 7 ... 5 6 4 6
93 - 55 = 38 in the y-direction
Image Gradients
Image Gradients magnitud
e dy
direction
dx
Image Gradients magnitud
e dy
direction
dx
Image Gradients
Image Gradients
Image Gradients
Gradient
Histogram
Histogram of Oriented Gradients (HOG)
1 5 6 7 ... 5 6 4 6
1x3780
HOG features
HOG features
8. OpenCV will be required
HOG features
9. Read the image (using OpenCV, image
name is angelhack.jpg) and assign it to
image variable
HOG features
https://stackoverflow.com/questions/6090399/get-hog-image-features-from-
opencv-python
ImageNet (14 millions of images)
ImageNet (14 millions of images)
ImageNet (14 millions of images)
ImageNet (14 millions of images)
ImageNet (14 millions of images)
ImageNet (14 millions of images)
Low level visual features: High level visual features:
edges, contrast, … , style, object orientation
saturation
ImageNet (14 millions of images)
Low level visual features: High level visual features:
edges, contrast, … , style, object orientation
saturation
classifier
Image features
1) Hand-crafted features
2) Generic features
3) Deep learning features
Natural Language Processing
Word Embeddings
1) Get the deep features from any kind of Convolutional Neural Network
2) Work with any kind of word embeddings
Next week we will have Quiz 1 (10%)
1. Lecture 1
2. Lecture 2