- In a previous lesson, we learned how to perform convolutions on grayscale images. But, how do we perform a convolution on a color image?
- To perform a convolution of this kernel with the given grayscale image, we center our kernel over the pixels of the image, and take each corresponding pixel and kernel value, multiply them together, sum the whole thing up.
- Remember that we can add zero padding around the entire image in order to calculate the kernel convolution of the image withour losing information.
- In color image, Just as we did with grayscale images, we'll start by choosing a filter of a particular size.

- It's customary to add a bias value, which usually has a value of one.

- In this particular example, the resulting convoluted output is a two-dimensional array with the same width and height of the RGB image.
- A convolution with a single 3D filter produces a single convoluted output.
- However, when working with CNNs, it's customary to use more than one 3D filter. If we use more than one filter, then we will get one convoluted output per filter.

- In this example, since we are using three filters, the convoluted output will have a depth of three.
- For example, in order to create three filters with a size of three by three like we have in our example, The code is
ex) tf.keras.conv2D(3, (3,3), ...)
- Remember that when we train the CNN, the values and the three-dimensional kernels will be updated so as to minimize the loss function.
- In essence, max-pooling works the same way as it did for gray-scale images. The difference is that now we have to perform max pooling on each convoluted output.

- In this particular case, when we perform max-pooling on the 3D convoluted output, we get a 3D array that is half the width and height of the convoluted output, but has the same depth.

<Colab Notebook>
- To access the Colab Notebook, login to your Google account and click on the link below:
Google Colaboratory
colab.research.google.com
<소스 코드>
HoYoungChun/TensorFlow_study
Udacity의 Intro to TensorFlow for Deep Learning 강좌 for TF_Certificate 취득 - HoYoungChun/TensorFlow_study
github.com
'인공지능(AI) > Udacity tensorflow 강의' 카테고리의 다른 글
| [Lesson 5] Transfer Learning (0) | 2020.09.28 |
|---|---|
| [Lesson 4] Going Further with CNNs (3) (0) | 2020.09.27 |
| [Lesson 4] Going Further with CNNs (1) (0) | 2020.09.27 |
| [Lesson 3] Introduction to CNNs (2) (0) | 2020.09.26 |
| [Lesson 3] Introduction to CNNs (1) (0) | 2020.09.26 |