1 of 13

CSE 163

ML and Images

��Suh Young Choi

💬Before Class: Favorite board/card game?

🎵Music: Unwed Sailor

2 of 13

Machine Learning

Terms from machine learning

  • Features / labels
  • Learning algorithm
  • Model
  • Model class
  • Training set / test set
  • Parameters / Hyperparameters

2

3 of 13

ML + Images

How do we do machine learning on images?

  • Simplest: Unroll the image into a vector
  • Complex: Use other tools to extract features from the images

3

10

20

30

40

50

60

70

80

90

10

20

30

40

50

60

70

80

90

Raw Image

Unrolled Image

4 of 13

ML + Images

Pros: Simple transformation (just a call to reshape!)

Cons: It loses the idea of “neighboring” pixels (up/down)

  • Most machine learning models don’t take position of the features into account
  • This is where more complex models like convolutional neural networks come in to encode that local information as features

4

Despite these drawbacks, it can work in practice on some problems!

5 of 13

Neural Network

Based on how our brains �work

5

6 of 13

Example

What is the output for this neuron if the inputs are 0 for the first input and 1 for the second. The activation function is the step function (0 if negative, 1 otherwise). The bias should be subtracted from the weighted sum before applying the activation function.

6

3

-2

4

7 of 13

Example

What is the output for this neuron if the inputs are 0 for the first input and 1 for the second. The activation function is the step function (0 if negative, 1 otherwise). The bias should be subtracted from the weighted sum before applying the activation function.

7

3

-2

4

0

1

8 of 13

Example

What is the output for this neuron if the inputs are 0 for the first input and 1 for the second. The activation function is the step function (0 if negative, 1 otherwise). The bias should be subtracted from the weighted sum before applying the activation function.

8

3

-2

4

0

1

0 * 3 + 1 *(-2) - 4 = -6

9 of 13

Example

What is the output for this neuron if the inputs are 0 for the first input and 1 for the second. The activation function is the step function (0 if negative, 1 otherwise). The bias should be subtracted from the weighted sum before applying the activation function.

9

3

-2

4

0

1

0 * 3 + 1 *(-2) - 4 = -6

squish(-6) = 0

10 of 13

Image Classification

10

11 of 13

Image Classification

For a really long time, image classification was done by painstakingly crafting these features (like edge detectors), by hand.

This kind of worked, but we quickly hit our peak using this method.

Then came the buzz-word… deep learning

11

12 of 13

Image Classification

  • Is this a solved problem?
    • We get pretty decent error rates on challenges like ImageNet
  • What we can’t do
    • Sometimes can’t generalize to other real-world datasets
    • Adversarial attacks

12

13 of 13

Unsupervised

Learning

So far, we have seen supervised machine learning, where we have to explicitly shown the algorithm the labels

Unsupervised machine learning lets the algorithm try to learn trends on its own without providing explicit labels

Examples

  • Clustering
  • Outlier detection

13