1 of 12

CSE 163

Convolutions�

Suh Young Choi�

🎶 Listening to: Inception soundtrack

💬 Before Class: What’s been your favorite before-class music so far?

2 of 12

Announcements

Project Proposal open now on Gradescope

  • Make sure you have access!
  • Group-finding form can be found in Ed post #249 (this closes tonight)
  • Full spec can be found on the course website

HW5 and LR5 due on Thursday (last one of the quarter!)

2

3 of 12

This Time

  • Convolutions
  • Kernel operations

Last Time

  • numpy arrays
  • Broadcasting
  • Images

3

4 of 12

Images as

Matrices

4

Grey-scale images can be represented as matrices.

Grey-scale: 255

Grey-scale: 0

data = imageio.imread(‘...’)�

data[rows, columns] = #

5 of 12

Color Images

When you overlap each color channel, it creates a picture we are used to seeing.

  • Pixels on your monitor let out specified R/G/B light

5

data[rows, columns, channels] = #

6 of 12

Convolution

When wanting to use “local” information, we commonly use a sliding window approach (i.e. a convolution)

Move the sliding window across the image, and compute the sum of the element wise product of the window (kernel) and image

6

3

3

2

1

0

0

0

1

3

1

3

1

2

2

3

2

0

0

2

2

2

0

0

0

1

Image

0

1

2

2

2

0

0

1

2

Kernel

7 of 12

Convolution Example

7

8 of 12

Common Kernels

What do the numbers in the kernel do?

8

Identity

Edge Detection

Sharpen

Box Blur

9 of 12

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

9

10 of 12

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

10

11 of 12

LR topics may include:

  • How convolutions work
  • Kernel operations

11

12 of 12

Before Next Time

  • Complete Lesson 20
    • Remember not for points, but do go towards Checkpoint Tokens
  • HW5 and LR5 due tomorrow
  • Go to section!

Next Time

  • Machine learning with images

12