3
votes

I am trying to implement a siamese neural network by building a face recognition model with keras. Previously I have implemented a CNN face recognition model (with keras) by using classification so my dataset has already been split into training data,training labels, validation data, validation labels and test data. The dataset that I have used for that purpose consists of 226 image classes. I used 2799 images for training and 226 images for validation. Now I would like to use the dataset for the purpose of training a siamese neural network. How can I split the data for the purpose?

1

1 Answers

4
votes

For a Siamese NN, you will require a very less number of images per class. These networks learn to differentiate instead of classification. If you take a single inage from each class meaning 226 classes, then:

  • Form pairs of images. If both the images in a pair belong to the same class, then the associated label is 1 else it is set to 0. So the maximum number of pairs is very huge ( 226^226 ). Limit these pairs to a certain number.

See this blog.