๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
TIL/Coursera(Google ML Bootcamp)

[Convolutional Neural Networks] Foundations of Convolutional Neural Networks :: seoftware

by seowit 2021. 9. 13.

๐Ÿ“œ ๊ฐ•์˜ ์ •๋ฆฌ 

 

* Cousera ๊ฐ•์˜ ์ค‘ Andrew Ng ๊ต์ˆ˜๋‹˜์˜ Convolutional Neural Network ๊ฐ•์˜๋ฅผ ๊ณต๋ถ€ํ•˜๊ณ  ์ •๋ฆฌํ•œ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.

* ์ด๋ฏธ์ง€ ์ถœ์ฒ˜ : Deeplearning.AI


Computer Vision

Image Classification, Object Detection, Neural Style Transfer ๋“ฑ์ด Computer Vision์— ํฌํ•จ๋œ๋‹ค. 

Edge Detection Example

convolution filter๋ฅผ ํ†ตํ•ด ์•„๋ž˜์™€ ๊ฐ™์ด featrue๋ฅผ ๋ฝ‘์•„๋‚ผ ์ˆ˜ ์žˆ๋‹ค. ์ดˆ๊ธฐ layer์—์„œ๋Š” ํฐ ํŠน์ง•, ํ›„๋ฐ˜ layer์—์„œ๋Š” detailํ•œ ํŠน์ง•์ด ์ถ”์ถœ๋œ๋‹ค.

conv filter(=kernel)์ด ์–ด๋–ป๊ฒŒ ์ž‘์šฉ ๋ฐฉ๋ฒ•์€ input ์ด๋ฏธ์ง€์— ๋Œ€ํ•ด conv filter๊ฐ€ convolution ์—ฐ์‚ฐ์„ ์ง„ํ–‰ํ•œ๋‹ค. conv filter์˜ ๊ตฌ์„ฑ์— ๋”ฐ๋ผ ์ถ”์ถœ๋˜๋Š” ํŠน์ง•์ด ๋‹ค๋ฅด๋‹ค. ์•„๋ž˜๋Š” ์ˆ˜์ง์„ ์„ ์ถ”์ถœํ•˜๋Š” conv filter์˜ ์˜ˆ์‹œ์ด๋‹ค.

 

Padding

convolutional filter๋ฅผ ์ ์šฉํ•  ๋•Œ๋งˆ๋‹ค input size = n, kernel size = k๋ผ๊ณ  ํ•  ๋•Œ, output size = n-k+1์ด ๋œ๋‹ค. convolutional filter๊ฐ€ ๊ณ„์† ๋ฐ˜๋ณต๋˜๋ฉด output size๊ฐ€ ๊ณ„์† ์ž‘์•„์ง€๊ฒŒ ๋˜๋Š” ๋ฌธ์ œ์™€ ๊ฐ€์žฅ์ž๋ฆฌ์— ์žˆ๋Š” ํ”ฝ์…€์€ ์ค‘์•™ ๋ถ€๋ถ„์˜ ํ”ฝ์…€๋ณด๋‹ค ๋ฐ˜์˜์ด ์ž˜ ์•ˆ๋˜๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค.

์ด๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์ด padding์ด๋‹ค

 

Strided Convolutions

Convolutions Over Volumn

input image์˜ ์ฑ„๋„ ๊ฐœ์ˆ˜์™€ convoutional filter์˜ ์ฑ„๋„ ๊ฐœ์ˆ˜๋Š” ๊ฐ™์•„์•ผ ํ•œ๋‹ค. ์•„์›ƒํ’‹์— ๋ณผ๋ฅจ์„ ์ฃผ๊ณ  ์‹ถ์œผ๋ฉด conv filter๋ฅผ ์—ฌ๋Ÿฌ ์ข…๋ฅ˜๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.

 

One layer of Convolutional Network

input size๊ฐ€ ์•„๋ฌด๋ฆฌ ์ปค๋„ ํ•™์Šตํ•  ํŒŒ๋ผ๋ฏธํ„ฐ๋Š” 280๊ฐœ๋กœ ๊ณ ์ •์ ์ด๋‹ค.

 

๋…ธํ…Œ์ด์…˜ ์ •๋ฆฌ

 

Pooling

์ด๋ฏธ์ง€์˜ ํฌ๊ธฐ๋ฅผ ์ค„์ด๋Š” ์—ญํ• ์„ ํ•œ๋‹ค.

max pooling, average pooling์ด ์žˆ๋‹ค

 

CNN Example

๋ณดํ†ต ๊ฐ€์ค‘์น˜๊ฐ€ ์žˆ๋Š” ๊ฒƒ์„ ๋ ˆ์ด์–ด๋ผ๊ณ  ํ•˜๋Š”๋ฐ, Pooling์€ ๊ฐ€์ค‘์น˜๊ฐ€ ์—†์œผ๋ฏ€๋กœ, conv์™€ pooling layer๋ฅผ ํ•œ ์„ธํŠธ๋กœ ๋ฌถ์–ด์„œ layer1์ด๋ผ๊ณ  ํ•œ๋‹ค.

 

Why convolutions?

 

๋Œ“๊ธ€