All Projects → blaueck → tf-triplet-demo

blaueck / tf-triplet-demo

Licence: other
This project implements triplet loss and semi-hard mining in tensorflow.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to tf-triplet-demo

image triplet loss
Image similarity using Triplet Loss
Stars: ✭ 76 (+484.62%)
Mutual labels:  triplet-loss
TorchBlocks
A PyTorch-based toolkit for natural language processing
Stars: ✭ 85 (+553.85%)
Mutual labels:  triplet-loss
Signature-verification-using-deep-learning
Using SigComp'11 dataset for signature verification
Stars: ✭ 54 (+315.38%)
Mutual labels:  triplet-loss
MHCLN
Deep Metric and Hash Code Learning Network for Content Based Retrieval of Remote Sensing Images
Stars: ✭ 30 (+130.77%)
Mutual labels:  triplet-loss
street2shopTriplet
Challenge the customer to shop task with tripletNet
Stars: ✭ 14 (+7.69%)
Mutual labels:  triplet-loss
triplet-loss-pytorch
Highly efficient PyTorch version of the Semi-hard Triplet loss ⚡️
Stars: ✭ 79 (+507.69%)
Mutual labels:  triplet-loss
pytorch-siamese-triplet
One-Shot Learning with Triplet CNNs in Pytorch
Stars: ✭ 74 (+469.23%)
Mutual labels:  triplet-loss
facenet-pytorch-glint360k
A PyTorch implementation of the 'FaceNet' paper for training a facial recognition model with Triplet Loss using the glint360k dataset. A pre-trained model using Triplet Loss is available for download.
Stars: ✭ 186 (+1330.77%)
Mutual labels:  triplet-loss
triplet
Re-implementation of tripletloss function in FaceNet
Stars: ✭ 94 (+623.08%)
Mutual labels:  triplet-loss
Siamese Triplet
Siamese and triplet networks with online pair/triplet mining in PyTorch
Stars: ✭ 2,564 (+19623.08%)
Mutual labels:  triplet-loss
triplet-net
Keras implementation of "Deep Learning using Triplet Network" by Hoffer and Ailon. https://arxiv.org/pdf/1412.6622.pdf
Stars: ✭ 56 (+330.77%)
Mutual labels:  triplet-loss
triplet-loss-pytorch
A generic triplet data loader for image classification problems,and a triplet loss net demo.
Stars: ✭ 70 (+438.46%)
Mutual labels:  triplet-loss
finetuner
Finetuning any DNN for better embedding on neural search tasks
Stars: ✭ 442 (+3300%)
Mutual labels:  triplet-loss
keras-triplet-center-loss
Simple Keras implementation of Triplet-Center Loss on the MNIST dataset
Stars: ✭ 34 (+161.54%)
Mutual labels:  triplet-loss

Description

This project implements triplet loss and semi-hard mining with tensorflow. It also shows how to train model on mnist, cifar10 or cifar100 with triplet loss.

The semi-hard mining is purely implemented with tensorflow, thus can seamless integrate into tensorflow graph and take advantage of gpu acceleration. It will speed up the training process.

Requirement

  • python==3.6
  • tensorflow==1.6.0
  • matplotlib, for visualization.

Run

# train
python train.py

# tensorboard visualization
tensorboard --logdir log

Tensorboard Visualization

Tensorboard visualization of the mnist data's features. tensorboard_result

Note

1. Number of Features

The number of features uses by default is 2, which makes visualization easy and converges well for mnist dataset. When training with cifar10, the number of features should be more for a better convergece.

2. Semi-Hard Mining

Because the semi-hard mining is implemented in tensorflow, this project uses an end-to-end training process. The 'end-to-end' here means doing semi-hard mining and training at once. It can minimize the overhead involved by the hard mining process.

This approach is possible only if the memory is not the issue. However, training with triplet loss usually require a large batch size for online hard mining, which may need a lot of memory. So it is not always possible using the 'end-to-end' approach for a large model.

One way to work around this memory issue is separating hard mining and training process. It first does serveral times of semi-hard mining to find the hard triplets, and then feed the selected triplets to model for training. The approach involve much more overhead than the one above, but it is suitable for memory limited situation. For how this work, see the code in facenet and try to replace the semi-hard mining code with the one implemented here.

Reference Project

  • facenet, Face recognition using Tensorflow.
  • openface, Face recognition with deep neural networks.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].