I am doing a project on sign language recognition through CNN.
My Dataset
300 images for each alphabet and one special symbol for space. Images are taken from three individuals. Each image has hand centered in white background. Resolution is 640*480. So in total 27 labels and 8100 images.
Code
I am using pretrained AlexNet in PyTorch and have changed fully connected layers according the need of the project. I am training for 10 epochs. Batch size is 32. Loss function is Negative Log Likelihood Loss and optimizer is Adam.
AlexNet(
(features): Sequential(
(0): Conv2d(3, 64, kernel_size=(11, 11), stride=(4, 4), padding=(2, 2))
(1): ReLU(inplace=True)
(2): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
(3): Conv2d(64, 192, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))
(4): ReLU(inplace=True)
(5): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
(6): Conv2d(192, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(7): ReLU(inplace=True)
(8): Conv2d(384, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(9): ReLU(inplace=True)
(10): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(11): ReLU(inplace=True)
(12): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
)
(avgpool): AdaptiveAvgPool2d(output_size=(6, 6))
(classifier): Sequential(
(0): Linear(in_features=9216, out_features=1024, bias=True)
(1): ReLU()
(2): Dropout(p=0.5, inplace=False)
(3): Linear(in_features=1024, out_features=512, bias=True)
(4): ReLU()
(5): Dropout(p=0.5, inplace=False)
(6): Linear(in_features=512, out_features=27, bias=True)
(7): LogSoftmax()
)
)
Problem
The problem I am facing is that the model is giving very high confidence about 90-100 % on images that have no hand gesture in them or contain wrong hand gesture. I have tried adding dropout layers, training for more epochs but nothing seems to solve this problem. Is there something wrong with the model or the dataset needs to be changed/updated?