Find images that produce feature vectors closest to the feature vector of test image.

170 views
Skip to first unread message

Hieu Do Trung

unread,
May 28, 2015, 6:08:26 AM5/28/15
to caffe...@googlegroups.com

As the title, how can I to find images that "produce feature vectors in the last hidden layer with the smallest Euclidean distance from the feature vector for the test image", just like this:




Axel Angel

unread,
May 29, 2015, 5:23:11 AM5/29/15
to caffe...@googlegroups.com
It seems very easy with Python:
(1) load your network
(2) forward_all your dataset, blobs=['your_last_layer_name']
(3) the return value is a dict, take your_last_layer_name value which is a matrix (list of feature vectors)
(4) compute distances between your image feature and the rest of features, take top-k, where k=6 in this paper.

Hieu Do Trung

unread,
Jun 1, 2015, 12:54:51 AM6/1/15
to caffe...@googlegroups.com
You are my hero :)
Will try it.
Thank you very much.

Cuong Duc

unread,
Jul 7, 2015, 5:54:53 AM7/7/15
to caffe...@googlegroups.com
@Axel Angel: How to take the top-k?

Do I need to modify the accuracy layer in train_val.prototxt to take the top-k?
Thanks
Reply all
Reply to author
Forward
0 new messages