Learning from a few samples is a difficult task in machine learning. The siamese network architecture provides a computationally reasonable way to check the similarity of sample pairs.
This implementation provides an example to test this concept, by generating a sample of pairs of similar and non-similar input images.
- Create a toy database, generate different shapes pairs label logic: 1 - similar shapes ; 0 - different shapes
- Visualize data
- Create the siamese model
- Test similarity with the reference image
With high similarity:
With low similarity, below the threshold:
- Siamese Neural Networks for One-shot Image Recognition, G Koch et al
- Few-Shot Learning with Siamese Networks and Label Tuning T Muller arXiv:2203.14655 [cs.CL]
/Enjoy.