https://github.com/fedden/tensorflowsiameseneuralnetwork
Image Similarity Siamese Neural Network
https://github.com/fedden/tensorflowsiameseneuralnetwork
Last synced: over 1 year ago
JSON representation
Image Similarity Siamese Neural Network
- Host: GitHub
- URL: https://github.com/fedden/tensorflowsiameseneuralnetwork
- Owner: fedden
- License: mit
- Created: 2018-03-08T23:02:02.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T23:43:19.000Z (over 8 years ago)
- Last Synced: 2025-01-19T05:47:49.057Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 30.7 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Siamese Network Tensorflow
Siamese network is a neural network that contain two or more identical subnetwork. The purpose of this network is to find the similarity or comparing the relationship between two comparable things. Unlike classification task that uses cross entropy as the loss function, siamese network usually uses contrastive loss or triplet loss.
This project follows Hadsell-et-al.'06 [1] by computing the Euclidean distance on the output of the shared network and by optimizing the contrastive loss (see paper for more details).
[1] "Dimensionality Reduction by Learning an Invariant Mapping"
http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
## Run
Train the model
```bash
git clone https://github.com/ardiya/siamesenetwork-tensorflow
python train.py
```
Tensorboard Visualization(After training)
```bash
tensorboard --logdir=train.log
```
## Image retrieval
Image retrieval uses the trained model to extract the features and get the most similar image using cosine similarity.
[See here](https://github.com/ardiya/siamesenetwork-tensorflow/blob/master/Similar%20image%20retrieval.ipynb "See the code here")