Skip to content
SimNet: Learning Non-Metric Visual Similarity for Image Retrieval
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
RMAC
data
info
LossRegul.m
Readme.md
addCustomLossLayer.m
getBatch.m
imdb_random_vectors.m
init_simnet_dag.m
init_simnet_simplenn.m
l1LossBackward.m
l1LossForward.m
load_img_data.m
test.m
train.m

Readme.md

SimNet: similarity network for image retrieval

Matlab code for the paper "Learning Non-Metric Visual Similarity for Image Retrieval", in which a similarity network is proposed to estimate a visual similarity score for ranking images in visual retrieval problems.

info

Prerequisits

Datasets

In our experiments, we use the following image retrieval datasets:

Usage

Training

  1. Download training data from:
  1. In load_img_data.m file, set path to the training data accordingly.

  2. Run train.m to train the model.

Alternatively, to use your own data, create the images struct with the fields:

  • images.data [4-D single] (1,D,2,N) array with the pairs of feature vectors, where D is the dimensionality of the feature vectors and N the number of pairs in the dataset.
  • images.label [4-D single] (1,1,1,N) array with the label of each pair, with 1 being a mathcing pair and -1 being a non-matching pair
  • images.set [Nx1 double] N dimensional vector with the set of each pair, with 1 being training set and 2 being validation set.
  • images.cosines [4-D single] (1,1,1,N) array with the cosine similarity between the pair of feature vectors.

Test

For Oxford and Paris datasets:

  1. Save datasets as:
  • datasets/{ox,pa}/Images with the dataset images (without queries)
  • datasets/{ox,pa}/Queries with the dataset queries (cropped and renamed with their corresponding id).
  1. Run test.m

  2. Accuracy can be measured with the algorithms provided by the datasets.

Download pre-trained models from:

Results

Results obtained with the LandmarksExtra training set:

Method Oxford Paris
Cosine 0.665 0.638
OASIS 0.619 0.853
Linear 0.602 0.581
SimNet 0.718 0.757
SimNet* 0.808 0.891

Citation

@article{Garcia2017Learning,
       author    = {Noa Garcia and George Vogiatzis},
       title     = {Learning Non-Metric Visual Similarity for Image Retrieval},
       journal   = {arXiv preprint arXiv:1709.01353},
       year      = {2017},
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.