# CNN
contributed by <`kylekylehaha`>
###### tags: `Data Science`
## Introduction
CNN 可以**用來減少 parameter 的數量**。那何時可以用呢?當我們的任務是看某個點和它附近的狀況時,可以使用 CNN。因為有時某個點的附近就是可以描述那個點。像是: 一張圖片中找到一台車,我們可以找到輪子、後視鏡等特徵、就可以判斷出車子,而非找出整輛車。
除了圖片,graph 也適合用 CNN:可以從 node 的 neighbor 來推斷。
---
## Why CNN for Image (3 Property)
1. Some patterns are much smaller than the whole image.(e.g., 鳥嘴) Thus, a neuron does not have to see the whole image to discover the pattern.
2. The sampe patterns apper in different regions.
3. Subsampling the pixels will not change the object.
---
## Overall Process

- Convolution: 等同於 extract feature(includes property1 and property2)
- Max Pooling: 等同於 subsampling(includes proeprty3)
CNN 和 Fully Connected 其實是兄弟,差在前面有做 convolution & max pooling。
### Convolution
Filter 猶如 small mask,視為抽某個 pattern 的東西,小的 feature extracter。Those are the network parameters to be learned.


有 n 個 filter,就有 n 個 feature map。

> 利用 filter 來達到 shared weight。
### Max Pooling

> 4 個取一個,達到 max pooling。不一定要 4 取 1

> Each filter is a channel.
