/Siamese-Neural-Networks

Implementation of the Siamese Neural Networks in PyTorch using MNIST dataset

Primary LanguagePython

PWC

Siamese Neural Networks for One-shot Image Recognition

An implementation of the Siamese Neural Networks in PyTorch, trained and tested on the MNIST dataset.

Requirements

  • torchvision==0.5.0
  • torch==1.4.0
  • numpy==1.16.3
  • pytorch_lightning==0.5.3.2
  • Pillow==7.0.0

requirements.txt is provided

Instructions

This project uses PyTorch Lightning which is a lightweight wrapper on PyTorch. This project follows the LightningModule format.

Simply running cpu_run.py or gpu_run.py downloads the MNIST dataset and starts training.

Results

Highest 10-way one-shot accuracy on the held-out test set is 97.5% which is comparable to supervised classification models. Support set is manually picked.

Train Loss Val Acc

References