Skip to contentScholarGate
LibraryBookshelfDeskReview StudioAssistant
Sign in
On this page
IntuitionHow it worksWhen to use itStrengths & limitationsCommon pitfallsApplicationsFrequently asked🔒 Read the full methodSourcesRelated methods
Cite this pageSpotted an issue on this page? Report or suggest a fix →
Home›Deep learning›Siamese Neural Network
Machine learningMetric learning

Siamese Neural Network

Siamese Neural Network (Deep Metric Learning) · Also known as: twin network, Siamese neural network, contrastive metric network, Siyam ağı

A Siamese network is a deep architecture with two (or more) identical, weight-sharing branches that map inputs into an embedding space where similar inputs land close together and dissimilar ones far apart. Introduced by Bromley, LeCun, and colleagues in 1993 for signature verification and revived by Koch et al. (2015) for one-shot image recognition, it learns a similarity metric rather than fixed class labels, making it ideal for verification, matching, and few-shot tasks.

ScholarGate
  1. Machine learning
  2. v1
  3. 2 Sources
  4. PUBLISHED
Cite this page →
Tools & resources
Download slides
Learn & explore

Read the full method

Members only

Sign in with a free account to read this section.

Sign in

Method map

The neighbourhood of related methods — select a node to explore.

Siamese Network
AutoencoderOnline Metric LearningSelf-supervised Few-shot…Self-supervised Metric l…

When to use it

Use a Siamese network for similarity, verification, and matching tasks, and where classes are numerous, open-ended, or have very few examples — signature/face verification, person re-identification, signature and image matching, duplicate/near-duplicate detection, sentence-similarity, and one-/few-shot recognition. Its strengths are learning a reusable similarity metric and handling unseen classes without retraining. The costs: it trains on pairs/triplets, so performance depends heavily on pair/triplet sampling (hard-negative mining is often needed), it can be harder to train than a plain classifier, and the learned metric is only as good as the training pairs' coverage. When the class set is fixed and examples are plentiful, a standard classifier is simpler; modern self-supervised contrastive methods extend the same twin-encoder idea at scale.

Strengths & limitations

Strengths
  • Learns a reusable similarity metric, not a fixed label set.
  • Handles open-ended/new classes and one-/few-shot recognition without retraining.
  • Weight sharing yields comparable, meaningful embeddings.
  • Versatile across modalities (images, signatures, text, audio).
Limitations
  • Trains on pairs/triplets; performance hinges on pair/triplet sampling.
  • Often needs hard-negative mining and is trickier to train than a classifier.
  • The metric only generalizes as far as the training pairs' coverage.
  • Pairwise training can be computationally heavier per effective example.

Frequently asked

Why must the two branches share weights?

Weight sharing ensures both inputs are mapped by exactly the same function into the same embedding space, so the distance between their embeddings is meaningful and symmetric. Without shared weights the two branches could embed similar inputs incomparably, making the learned distance unreliable.

What is the difference between contrastive and triplet loss?

Contrastive loss works on pairs: pull similar pairs together, push dissimilar pairs apart beyond a margin. Triplet loss works on an (anchor, positive, negative) triple: make the anchor-positive distance smaller than the anchor-negative distance by a margin. Triplet loss directly optimizes relative ranking and is common in modern metric learning.

How does a Siamese network do one-shot recognition?

It learns a general similarity metric during training. At test time it embeds the query and each candidate reference (one example per class) and assigns the query to the nearest reference embedding. Because it compares similarities rather than predicting fixed labels, a single reference per new class suffices — no retraining.

Sources

  1. Bromley, J., Guyon, I., LeCun, Y., Säckinger, E., & Shah, R. (1993). Signature verification using a 'Siamese' time delay neural network. Advances in Neural Information Processing Systems, 6. link ↗
  2. Koch, G., Zemel, R., & Salakhutdinov, R. (2015). Siamese neural networks for one-shot image recognition. ICML Deep Learning Workshop. link ↗

How to cite this page

ScholarGate. (2026, June 2). Siamese Neural Network (Deep Metric Learning). ScholarGate. https://scholargate.app/en/deep-learning/siamese-network

Related methods

Autoencoder

Which method?

Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.

  • AutoencoderDeep learning↔ compare
Compare side by side →

Referenced by

Online Metric LearningSelf-supervised Few-shot LearningSelf-supervised Metric learning

Similar methods

Metric LearningSelf-supervised Metric learningEnsemble Metric LearningRobust Metric LearningSemi-supervised Metric LearningOnline Metric LearningBayesian Metric LearningFew-shot Learning

Related reference concepts

Self-Supervised and Representation LearningObject Recognition and DetectionConvolutional and Sequence ModelsSupport Vector Machines and Kernel MethodsSupport Vector ClassificationDeep Learning

Spotted an issue on this page? Report or suggest a fix →

ScholarGate — Siamese Network (Siamese Neural Network (Deep Metric Learning)). Retrieved 2026-07-21 from https://scholargate.app/en/deep-learning/siamese-network · Dataset: https://doi.org/10.5281/zenodo.20539026
Quick facts
Originator
Jane Bromley & Yann LeCun et al.; popularized by Koch et al.
Year
1993
Type
Deep metric-learning architecture
Subfamily
Metric learning
Structure
Two weight-sharing twin encoders
Learns
An embedding where similar inputs are close
Related methods
Autoencoder
ScholarGate

A content-first reference library for research methods — what each one is, how it works, and where it comes from.

Open data (CC-BY)

Explore

  • Library
  • Search the library…
  • Browse by field
  • Fields
  • Journey
  • Compare
  • Which method?

Reference

  • Subjects
  • Atlas
  • Glossary
  • Methodology
  • Philosophy

Your tools

  • Bookshelf
  • Desk
  • Chat

Company

  • About
  • Pricing
  • Contact
  • Suggest a method

Entries are compiled from published sources for reference. Verifying the accuracy and suitability of any information for your own use remains your responsibility.

© 2026 ScholarGate · A research-method reference library
  • Privacy
  • Cookies
  • Terms
  • Delete account