Translated from Quora what is Siamese neural networks, what applications is they good for, and why?
The twin neural network is a kind of neural network architecture with two or more identical sub-networks. The same here means that they have the same parameters and weights with the same configuration. Parameter updates are performed on two subnets.
Twin neural networks are popular in tasks involving the discovery of the relationship between similarities or two comparable things. Some examples are the retelling score, where the input is two sentences, and the output is how similar they are to the score; or signature verification to determine whether two signatures are from the same person. Typically, in such a task, two identical sub-networks are used to process two inputs, and the other module obtains their output and produces the final output. The image below is from Bromley et al (1993) [1]. They propose a twin architecture for signature verification tasks.
Twin structures perform well in these tasks, and there are several reasons why subnet sharing weights mean that training requires fewer parameters, which means less data is needed and it is not easy to fit. Each subnet essentially produces a representation of its input. ("Signature eigenvectors" in the picture). If your input is of the same type, such as matching two sentences or matching two images, it is meaningful to use similar models to handle similar input. This allows you to have a presentation vector with the same semantics, making them easier to compare. -
Question answer, some recent studies use twin architectures to score questions and answer candidates for correlations [2]. So one input is a question, the other input is an answer, and the output is related to the answer. The questions and answers don't look exactly the same, but if the goal is to extract similarities or links between them, the twin architecture can work well.
The following two articles were cited
[1] Signature verification using a "Siamese"
Time Delay Neural Network
[2] abcnn:attention-based convolutional Neural Network
For Modeling sentence Pairs