Machine Learning/Model
[CNN] CNN 패딩 Padding (Convolution Neural Network)
파송송
2022. 9. 29. 15:01
728x90
Padding
- convolution 연산 전에 input data 주변에 특정 값을 채우는 것
Padding 하는 이유
- kernel을 이용하여 특징을 추출할 때 마다 이미지가 축소됨
- 가장자리 픽셀은 output에 한번만 영향을 미침 (정보를 버리는 것)
- 위의 문제를 해결하기 위해 사용하는 것이 Padding
- 기존의 크기를 위지하는 이미지를 얻게 됨
- 위의 사진의 p = 1 (1 pixel로 padding)
- 새로 생긴 pixel에는 default로 0이 들어간다
Valid and Same convolution
- valid Convolution
- No Padding
- \( (n\times n) * (f \times f) \to (n-f+1) \times (n-f+1) \)
- Same Convolution
- input 이미지 크기와 convolution 후 이미지 크기가 같은 것
- \((n\times n) * (f \times f) \to (n+2p-f+1) \times (n+2p-f+1)\)
- \( (n+2p-f+1) = n \)
- \( p = \frac{f-1}{2} \)
- f가 홀수인 이유
- p가 나누어 떨어지게 됨
- 중심 pixel이 존재하여 중심 pixel이 존재하게 할 수 있음
https://www.youtube.com/c/Deeplearningai
DeepLearningAI
Welcome to the official DeepLearning.AI YouTube channel! Here you can find the videos from our Coursera programs on machine learning as well as recorded events. DeepLearning.AI was founded in 2017 by machine learning and education pioneer Andrew Ng to fill
www.youtube.com
728x90