A Siamese network consists of two identical subnetworks that share the same weights followed by
a distance calculation layer. The input of a Siamese network is a pair of images (Pi, Pj) and a label
yij . If the two images are deemed from the same equivalence class, the pair is called a positive pair, and the target value is yij = 0. Whereas for a pair of images from different equivalence classes, the pair is called a negative pair, and the target value is yij = 1. The target value yij can be interpreted as the desired distance between the embedding vectors. The input images (Pi, Pj) are fed to the twin subnetworks to produce two vector representations f(Pi) , f(Pj) that are used to calculate a proxy distance. The training of a Siamese network is done on a collection of positive and negative pairs.
The application should:
Load the Fashion-MNIST dataset (use keras.datasets.fashion_mnist.load_data).
Split the dataset such that the images with labels in ['top', 'trouser', 'pullover', 'coat', 'sandal', 'ankle boot'] are used for training and testing
The images with labels in ['dress', 'sneaker', 'bag', 'shirt'] are only used for testing.
None of these images should be used during training.
Implement and test the contrastive loss function described earlier.
Build a Siamese network.
Train the Siamese network on your training set.
Plot the training and validation error vs time.
The siamese network should have generalisation capability.
Evaluate the generalisation capability of the network by testing it with pairs from the set of images with labels ['top', 'trouser', 'pullover', 'coat', 'sandal', 'ankle boot'], testing it with pairs from the set of images with labels ['top', 'trouser', 'pullover', 'coat', 'sandal', 'ankle boot'] union ['dress', 'sneaker', 'bag', 'shirt'] testing it with pairs from the set of images with labels in ['dress', 'sneaker', 'bag', 'shirt']
The functional model of Keras is needed to implement the Siamese network.
For the shared network of the Siamese network, the CNN network architecture
Number of layers and filters can be increased to improve performance.
About the recuiterMember since Jul 22, 2017 Ananya
from Maharashtra, India