The aim of this project is to study parameterizable classifier using the concept of Siamese Networks. Performance of different losses are tested, including triplet loss and center loss.
This project exploits 2 methods, triplet loss and center loss, to train a siamese network that learns to identify the similarity between 2 images. The project is written using Tensorflow v2.0. We recommend to run the codes in the Interactive Window in Visual Code as the codes are written in a cell-by-cell fashion.
The repository is organized in such a way:
The main training, including data pre-processing, and analysis of both methods are done in main_triplet_loss.py and main_center_loss.py
The last cell of each above-mentioned script is the saving of .tsv files of encoding vectors and metadata for tensorboard embedding projector. To show them in tensorboard, use the command in the command window:
tensorboard --logdir PATH_TO_FILES (e.g. tensorboard --logdir log/centerloss)
Note: Make sure the directory contains projector_config.pbtxt, mnist_sprite.jpg, feature_vecs.tsv, and metadata.tsv