CNN can't predict images outside the dataset
I am using celeba dataset to train my CNN face landmark detection model. Here is my model
class LandmarkModel:
def __init__(self,inp_shape):
self.model = models.Sequential()
self.model.add(layers.Conv2D(16, (3, 3), activation='relu', input_shape=inp_shape))#l1
self.model.add(layers.Conv2D(32,(3, 3), activation='relu'))
self.model.add(layers.MaxPooling2D((2, 2)))
self.model.add(layers.Conv2D(64,(3, 3), activation='relu'))
self.model.add(layers.Flatten())
self.model.add(layers.Dense(512))
self.model.add(layers.Dense(10))
def getModel(self):
return self.model
I have trained my model for around 5k-6k images with loss of 0.1. When I use image from dataset that is outside of training sample I get correct prediction. But when I use my own clicked images predictions are completely off. I have clicked photos exactly like in dataset. I have also tried with downloaded celeb images still wrong predictions. What is the reason of this behavior?
Topic cnn convolutional-neural-network computer-vision deep-learning
Category Data Science