# Deep learning Keras CNN part > 05/07 Keras CNN --- >### Convolutional Neural Network (CNN) 可以將圖片切割成300*300的點,丟入到神經網路,但是今天如果Weight太多將會造成training時間過長或是太耗資源。 所以可以思考在一張圖中真的左上角跟右下角的點,會是有關聯的嗎? Property 1,2,3 what,where,size,大小的變化並沒有太多影響,但不能縮到太小。 ## Hyper-parameters of Convolutional Layer Filter Size Zero-padding Stride Depth (total number of filters) #### Filter Size 怎麼設計看自己,但如果設計不好可能會造成損失圖像資訊,所以用到Zero-padding #### Zero-padding 對原始圖像補零,使得在做fiter時可保留原始邊界重要資訊,甚至可出現重要資訊。 #### Stride 要不要跨大步走,用得要很小心,很有可能會跳過重要的圖像資訊。 #### Convolution on RGB Image 分別設計三個filter對圖像conv後相加 ![](https://i.imgur.com/KpnliuM.png) ### Depth 以往cv都是自己設定filter,但在DL是要讓電腦自己去學習怎樣的filter是好的,能找出特徵的 ![](https://i.imgur.com/Vlokpym.png) ### 看懂模型filter p.194 ## Pooling Layer Why do we need pooling layers?  Reduce the number of weights(減少太多的權重)  Prevent overfitting(避免過度訓練)  Max pooling  Consider the existence of patterns in each region Max pooling v.s. average pooling Max 主要找出特徵中最明顯的,是否有出現過 average 主要找出重覆特徵的地方 e.g. 魚鱗 ###### tags: 'keras' 'deep learning' 'python'