# 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.![](https://i.imgur.com/I2YudnN.png) 2. The sampe patterns apper in different regions.![](https://i.imgur.com/mglOH7r.png) 3. Subsampling the pixels will not change the object.![](https://i.imgur.com/5yFh852.png) --- ## Overall Process ![](https://i.imgur.com/xfFkaA3.png) - 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. ![](https://i.imgur.com/K5OzZOP.png) ![](https://i.imgur.com/w1B3M5g.png) 有 n 個 filter,就有 n 個 feature map。 ![](https://i.imgur.com/KM8xHKP.png) > 利用 filter 來達到 shared weight。 ### Max Pooling ![](https://i.imgur.com/J8qUNvf.png) > 4 個取一個,達到 max pooling。不一定要 4 取 1 ![](https://i.imgur.com/VjIF3k2.png) > Each filter is a channel. ![](https://i.imgur.com/jQVwFRC.png)