
Q. The number of parameters after RGB input array pass through convolutional layer
이미지가 RGB Scale과 같이 3개의 Depth를 가졌을 때, Convolutional Layer를 지나가면서 어떻게 Filtering이 될까?
[+] e.g. : In Latin, exempli gratia; = for example
참고 : How Do Convolutional Layers Work in Deep Learning Neural Networks?
Multiple Channels : Color images have multiple channels, typically one for each color channel, such as Red Green Blue.
Multiple Channels images (= RGB Color images)
A filter must always have the same number of channels as the input, often referred to as "depth".
[!] Filter의 Depth는 Input Array의 Depth와 같아야 하는구나!
Channels = Depth
If an input image has 3 channels (e.g. a depth of 3), then a filter applied to that image must also have 3 channels (e.g. a depth of 3). In 3x3 filter size case, a 3x3 filter would in fact be 3x3x3 or [3,3,3] for rows, columns, and depth.
따라서 input array의 depth가 3일 경우, Filter 또한 depth가 3이 된다.
원래는 이미지도 2차원, 필터도 2차원이지만 Depth, 즉 Channels에 의하여 3차원이 됨.
Regardless of the depth of the input and depth of the filter, the filter is applied to the input using a dot product operation which results in a single value.
input array의 depth와 filter의 depth와 무관하게, 필터링 이후의 output은 1개의 Depth가 된다(?)
즉 RGB image array -> Filter = 1개의 output
This means that if a convolutional layer has 32 filters, these 32 filters are not just two-dimensional for the two-dimensional image input, but are also three-dimensional, having specific filter weights for each of the three channels.
[!] Input array의 depth가 1이 아닐 경우, Convolutional Layer의 Filter들은 모두 3차원
[?] 아 Depth가 1이여도 존재하는 것이므로 3차원이긴 한건가?
또한 Filter들은 각각의 input channel에 대한 특정한 filter weight, 즉 Filter 요소값을 가지고 있다.
[!] 오호, 1개의 필터는 Red Channel, Green Channel, Blue Channel에 대한 각기 다른 필터를 가지는 것이구나
Yet, each filter results in a single feature map. Which means that the depth of the output of applying the convolutional layer with 32 filter is 32 for the 32 feature maps created.
[!] 필터는 Depth와 무관하게 무조건 1개의 값, 즉 Feature map, 다시 말해 특징맵을 만들어낸다.
단순히 말해, 32개의 필터를 가진 Convolutional Layer는 32개의 Output을 만들어낸다
ex)
3개의 Channel (=Depth)를 가진 이미지 (
128x128x3)는
3x3x3사이즈의 필터 32개로 각각 들어가서 아래와 같이 연산된다.
128x128x1Red input array3x3x1Red Filter126x126x1Red output
128x128x1Green input array3x3x1Green Filter126x126x1Green output
128x128x1Blue input array3x3x1Blue Filter126x126x1Blue outputFinally, (Dot product?)
126x126x1Red output +126x126x1Green output +126x126x1Blue output
126x126x1위와 같은 필터당 연산이 필터 개수 만큼 이루어지므로
총 32개의126x126x1Feature map이 생성됨