I thought it would be good to start a fresh thread about this particular network type. There are several posts in this forum about it but I thought it would be good to discuss approaches on how to use fastai to help create a dataset and module to get started with.
These resources were useful but if you have any others please share them and I’ll add them.
|Coursera Face Recognition Andrew Ng||Video|
|One Shot Learning with Siamese Networks||Medium Article|
|Siamese Neural Networks for One-shot Image Recognition||Paper|
You’ll finds some classes to help create a siamese network.
In the notebook is how to:
- Create a Siamese Dataset from an already labelled dataset.
- Siamese Network Module
- Currently it is generating pairs of items before training because I thought it would be to easier to evaluate bad data. Pairs could be generated on the fly?
- The Siamese Network Module uses resnet34 by default as an encoder but could use any architecture as an encoder
- You can choose classes to make the validation set. This validation set is hidden from training for better evaluation of the network.
- Embedding Visualisation
- I’ve used Hinge Loss but there are many other choices for loss functions. I’ll add some more and see what they do
- Should we be freezing the encoder?
- How close should our results be to 0 for us to accept them as a good guess
- Do Siamese networks with heads improve results
- The number of pairs we can train on is very large even for a small dataset like this. How should we allow the user to configure the usage of it while preserving good defaults (having an even balance of pairs for each class)