An implementation of the paper Siamese Neural Networks for One-shot Image Recognition. The model architecture is as below (taken from the paper):
With the only difference being same learning rate for all parameters, instead of layer wise learning rate as in the paper. With this, achieves 93% accuracy with 30k pairs.
- Training loss and validation accuracy are logged via TensorBoard.
- Best model as per validation accuracy saved at the end of training.
- PyTorch
- Augmentor
- Download the Omniglot 'background' and 'evaluation' zip files from here.
- Run
data_prep.py
to split the dataset into train-val-test:
python data_prep.py <DATA_DIR>
where DATA_DIR
is the directory containing both the unzipped files.
- Run train.py to train the model:
python train.py <DATA_DIR>
- Hyperparameters such as learning rate, number of pairs for training, augmentation etc. can be changed in
train.py
.