Siamese Network

Siamese Networks are a special type of neural networks introduced by Yann LeCun and his colleagues in NIPS 1994 (http://www.worldscientific.com/doi/pdf/10.1142/S0218001493000339). The basic idea behind them is that like the 'Siamese Twins', the network consists of two different Neural Networks, both sharing the same architecture and weights.

Here, you can see the Siamese architecture:

During the training phase the pair-network is presented with a training pair (X1, X2), where the two inputs are different yet similar, for example, X1 = He is smart, and X2 = He is a wise man. The two neural networks will produce two different results; the combined network can be thought of as a scalar energy function measuring the similarity between the training pair (X1, X2), defined as:

The goal of the Siamese network is that the energy between the training-pair (X1, X2) should be less than energy between any other imposter pair (X1, ).

This is achieved by using a contrastive loss function for training.

During the training phase the network is given as input a training pair, and a label associated with it, telling it is a genuine pair or an impostor pair: (X1, X2, Y)i is the ith training sample. The contrastive Loss function is calculated:

L

where, with LG being the partial loss for a genuine pair, and LI the partial loss for an impostor pair and P the number of training samples. The label Y has a value 0 when the pairs are genuine and has value 1 when the presented pairs are imposter pairs. The partial loss LG and Lshould be designed in such a manner that the minimization of contrastive loss L(W) will decrease the energy of genuine pairs and increase the energy of imposter pairs. This is achieved by choosing the partial loss LG as monotonically increasing and partial loss LI as monotonically decreasing f. One possible choice is using cosine similarity for calculating the partial loss.

The weights are adjusted using the backpropagation algorithm.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.121.153