Hand Posture Recognition with CNN
目錄
問題
使用CNN來辨識出3種手部姿勢,我們會被給予5組(從不同人、不同拍攝情況)資料集。
資料集會被儲存進9個分開的檔案夾。
檔案夾0000-0002, 0003-0005, 0006-0008分別包含了姿勢1、姿勢2、姿勢3。
每個檔案夾有20個圖檔。每個圖檔皆為32*32的灰階圖。
解決
使用keras來建立CNN的模型,使用給予的圖片訓練,並會探討Drop Out、BN Layers的使用
這次使用Colab來見建構CNN
上傳.zip並解壓縮
import 我們需要的Library
使用老師給的範例整理我們所需的資料
寫成一個簡單的函式方便我們在主程式呼叫訓練與測試資料
作圖以及儲存訓練圖
結果
Model With No Drop Out & No BN Layers
batch_size = 360
num_classes = 3
epochs = 200
Tanh(32)->Relu(32)->Relu(28)->Flatten->Relu(128)->softmax
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Accuracy = 0.838…
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Accuracy = 0.886…
Model With No Drop Out & With BN Layers
batch_size = 360
num_classes = 3
epochs = 200
好玩的是,我們在每一成CNN後又加上BN Layer 結果反而讓網路訓練不起來
但是卻能發現在validation上確實使用BNLayers有明顯的提升速度
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Accuracy = 0.347222…
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Accuracy = 0.405555…
(Best) Model With Drop Out & No BN Layers
batch_size = 360
num_classes = 3
epochs = 200
Tanh(32)->Relu(32)->Relu(28)->Flatten->Relu(128)->softmax

Accuracy = 0.96111…

Accuracy = 0.97222…
Model With Drop Out & With BN Layers
batch_size = 360
num_classes = 3
epochs = 200
好玩的是,我們在每一成CNN後又加上BN Layer 結果反而讓網路訓練不起來

Accuracy = 0.66666…

Accuracy = 0.34444…