Coder Social home page Coder Social logo

kevinlin311tw / caffe-deepbinarycode Goto Github PK

View Code? Open in Web Editor NEW
205.0 25.0 83.0 104.13 MB

Supervised Semantics-preserving Deep Hashing (TPAMI18)

Home Page: https://arxiv.org/abs/1507.00101v2

License: Other

CMake 3.00% Makefile 0.68% Gnuplot 0.04% MATLAB 1.25% C++ 80.18% Cuda 4.50% M 0.01% Shell 0.44% Python 8.42% Protocol Buffer 1.49%
caffe hashing deep-learning convolutional-neural-networks image-retrieval supervised-learning

caffe-deepbinarycode's Introduction

Caffe-DeepBinaryCode

Supervised Learning of Semantics-Preserving Deep Hashing (SSDH)

Created by Kevin Lin, Huei-Fang Yang, and Chu-Song Chen at Academia Sinica, Taipei, Taiwan.

Introduction

This paper presents a simple yet effective supervised deep hash approach that constructs binary hash codes from labeled data for large-scale image search. We assume that the semantic labels are governed by several latent attributes with each attribute on or off, and classification relies on these attributes. Based on this assumption, our approach, dubbed supervised semantics-preserving deep hashing (SSDH), constructs hash functions as a latent layer in a deep network and the binary codes are learned by minimizing an objective function defined over classification error and other desirable hash codes properties. With this design, SSDH has a nice characteristic that classification and retrieval are unified in a single learning model. Moreover, SSDH performs joint learning of image representations, hash codes, and classification in a point-wised manner, and thus is scalable to large-scale datasets. SSDH is simple and can be realized by a slight enhancement of an existing deep architecture for classification; yet it is effective and outperforms other hashing approaches on several benchmarks and large datasets. Compared with state-of-the-art approaches, SSDH achieves higher retrieval accuracy, while the classification performance is not sacrificed.

The TPAMI pre-print can be found in the following arXiv preprint. Presentation slide can be found here

Citing the deep hashing work

If you find our work useful in your research, please consider citing:

Supervised Learning of Semantics-Preserving Hash via Deep Convolutional Neural Networks
Huei-Fang Yang, Kevin Lin, Chu-Song Chen
IEEE Transactions on Pattern Analysis and Machine Intelligence (​TPAMI), 2017

Supervised Learning of Semantics-Preserving Hashing via Deep Neural Networks for Large-Scale Image Search
Huei-Fang Yang, Kevin Lin, Chu-Song Chen
arXiv preprint arXiv:1507.00101

Prerequisites

  1. MATLAB (tested with 2012b on 64-bit Linux)
  2. Caffe's prerequisites

Install Caffe-DeepBinaryCode

Adjust Makefile.config and simply run the following commands:

$ make all -j8
$ make test -j8
$ make matcaffe
$ ./prepare.sh

For a faster build, compile in parallel by doing make all -j8 where 8 is the number of parallel threads for compilation (a good choice for the number of threads is the number of cores in your machine).

Demo

Launch matlab and run demo.m. This demo will generate 48-bits binary codes for each image using the proposed SSDH.

>> demo

Retrieval evaluation on CIFAR10

Launch matalb and run run_cifar10.m to perform the evaluation of precision at k and mean average precision (mAP) at k. In this CIFAR10 demo, we employ all the test images (10,000 images) as the query set, and we select all the training images (50,000 images) to form the database (In the paper, only 1,000 test images are used as the query to comply with the settings in other methods). We computed mAP based on the entire retrieval list, thus we set k = 50,000 in this experiment. The bit length of binary codes is 48. This process takes around 12 minutes.

>> run_cifar10

Then, you will get the mAP result as follows.

>> MAP = 0.913361

Moreover, simply run the following commands to generate the precision at k curves:

$ cd analysis
$ gnuplot plot-p-at-k.gnuplot 

You will reproduce the precision curves with respect to different number of top retrieved samples when the 48-bit hash codes are used in the evaluation.

Train SSDH on CIFAR10

Simply run the following command to train SSDH:

$ cd /examples/SSDH
$ ./train.sh

After 50,000 iterations, the top-1 error rate is around 10% on the test set of CIFAR10 dataset:

I1221 16:27:44.764175  2985 solver.cpp:326] Iteration 50000, loss = -0.10567
I1221 16:27:44.764205  2985 solver.cpp:346] Iteration 50000, Testing net (#0)
I1221 16:27:58.907842  2985 solver.cpp:414]     Test net output #0: accuracy = 0.8989
I1221 16:27:58.907877  2985 solver.cpp:414]     Test net output #1: loss: 50%-fire-rate = 0.000621793 (* 1 = 0.000621793 loss)
I1221 16:27:58.907886  2985 solver.cpp:414]     Test net output #2: loss: classfication-error = 0.369317 (* 1 = 0.369317 loss)
I1221 16:27:58.907892  2985 solver.cpp:414]     Test net output #3: loss: forcing-binary = -0.114405 (* 1 = -0.114405 loss)
I1221 16:27:58.907897  2985 solver.cpp:331] Optimization Done.
I1221 16:27:58.907902  2985 caffe.cpp:214] Optimization Done.

The training process takes roughly 2~3 hours on a desktop with Titian X GPU. You will finally get your model named SSDH48_iter_xxxxxx.caffemodel under folder /examples/SSDH/

To use the model, modify the model_file in demo.m to link to your model:

    model_file = './YOUR/MODEL/PATH/filename.caffemodel';

Launch matlab, run demo.m and enjoy!

>> demo

Train SSDH on another dataset

It should be easy to train the model using another dataset as long as that dataset has label annotations.

  1. Convert your training/test set into leveldb/lmdb format using create_imagenet.sh.
  2. Modify the source in /example/SSDH/train_val.prototxt to link to your training/test set.
  3. Run ./examples/SSDH/train.sh, and start training on your dataset.

Resources

Note: This documentation may contain links to third party websites, which are provided for your convenience only. Third party websites may be subject to the third party’s terms, conditions, and privacy statements.

If ./prepare.sh fails to download data, you may manually download the resouces from:

  1. 48-bit SSDH model: MEGA, DropBox

  2. CIFAR10 dataset (jpg format): MEGA, DropBox, BaiduYun

  3. AlexNet pretrained networks: MEGA, DropBox, BaiduYun

FAQ

Q: I have followed the instructions in README, and ran the evaluation code. As shown in README that I will get the mAP around 90%, however, I can only get about 10% mAP. Could you please give me some suggestions?

A: You may have this problem if you didn’t launch matlab at caffe's root folder, which will automatically include important folders into PATH. Two ways to solve this problem: First, run startup.m before you run run_cifar10.m. Second, open ./matlab/feat_batch.m and change line 36 d = load('./matlab/+caffe/imagenet/ilsvrc_2012_mean.mat'); to d = load('THE-PATH-OF-THIS-REPO-IN-YOU-COMPUTER/matlab/+caffe/imagenet/ilsvrc_2012_mean.mat');. Then run run_cifar10.m.

Contact

Please feel free to leave suggestions or comments to Kevin Lin ([email protected]), Huei-Fang Yang ([email protected]) or Chu-Song Chen ([email protected])

caffe-deepbinarycode's People

Contributors

kevinlin311tw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

caffe-deepbinarycode's Issues

Training doesn't converge when training on the ILSVRC12 dataset

@kevinlin311tw Hi kevin,

Recently I have used the DeepBinaryCode to train CNN model on the ILSVRC12 dataset. The train_val.prototxt and the solver.prototxt is taken from SSDH-VGG16-48.

I changed the latent layer in train_val.prototxt (L498) to make sure the feature encoded with 512 bits. As the ILSVRC12 dataset contains 1000 classes, I also changed the fc8_classification layer to 1000 (L574).

All seemed right. But training doesn't converge, after iterating 1000 times, the accuracy is still 0.001, i.e. 1/1000.

Any advice or help for me so I can make the training converge on the ILSVRC12 dataset?

Thanks.

the retrieval performance worse than classification performance

hi,Kevin, I have a question that why the retrieval map is lower than classification accuracy in imagenet dataset, but is can stay the same in mnist or cifar dataset? For my own model, it reduces about 20%, and there is no problem with mean data. Have you ever meet the similar problem or could you please give me some suggestion? thank you so much!

softmax in cifar10

hi Kevin,I have a problem about the softmax loss function in CIFAR10 dataset.It seems that you don't use softmax to predict the probility for every class ?and direct use the fc9 outputs to calculate the accuracy?

Question about Objective Function

Hi,

Does this implementation scale the objective loss function? If you don't scale each of the three loss parts, aren't they implicitly weighted then based on their raw values (since you set alpha beta and gamma to 1 in your experiments)?

Please let me know if I'm missing something. Thanks for your time!

Can not understand the definition in the paper

Let I = {I n } n=1 be the N images and Y = {y n }
be their associated label vectors, where M denotes the total
number of class labels. An entry of y n is 1 if an image I n
belongs to the corresponding class and 0 otherwise.

Porting to Tensorflow / Keras. Help Needed

Hello

I am trying to reproduce the results of this paper using Keras. I have implemented the loss function as seen in the paper, but the accuracy of the classifier never goes above 10%.
To test the loss implementation, I am using a tiny CNN trained from scratch. The model structure is as seen in the image attached. I have also tried building on top of a pre-trained VGG16, but the results are the same.
model
As seen from the name, the second last layer called "latent_48bit" is the latent layer with the sigmoid activation. The final layer is the softmax classifier.

Is the model architecture correct?

Also, can you help me with the loss function? I believe that's where I am going wrong.

Confuse about the figure

What is the number of red dot in the last layer???
the number of green dot is one??? or not ??
what is the meaning of that??? Thanks very much!!!
numbers

Cannot converge when I training with cifar10

When I following the instructions training with cifar10 dataset, the net didn't converge.Part of the log is:
I0314 17:24:00.262361 27053 solver.cpp:258] Train net output #2: loss: forcing-binary = -0.124964 (* 1 = -0.124964 loss)
I0314 17:24:00.262364 27053 solver.cpp:571] Iteration 17100, lr = 0.001
I0314 17:24:19.773170 27053 solver.cpp:242] Iteration 17200, loss = 2.21847
I0314 17:24:19.773236 27053 solver.cpp:258] Train net output #0: loss: 50%-fire-rate = 0.0034709 (* 1 = 0.0034709 loss)
I0314 17:24:19.773241 27053 solver.cpp:258] Train net output #1: loss: classfication-error = 2.33997 (* 1 = 2.33997 loss)
I0314 17:24:19.773246 27053 solver.cpp:258] Train net output #2: loss: forcing-binary = -0.124965 (* 1 = -0.124965 loss)
I0314 17:24:19.773259 27053 solver.cpp:571] Iteration 17200, lr = 0.001
I0314 17:24:39.260385 27053 solver.cpp:242] Iteration 17300, loss = 2.17777
I0314 17:24:39.260422 27053 solver.cpp:258] Train net output #0: loss: 50%-fire-rate = 0.00347071 (* 1 = 0.00347071 loss)
I0314 17:24:39.260427 27053 solver.cpp:258] Train net output #1: loss: classfication-error = 2.29926 (* 1 = 2.29926 loss)
I0314 17:24:39.260432 27053 solver.cpp:258] Train net output #2: loss: forcing-binary = -0.124964 (* 1 = -0.124964 loss)
I0314 17:24:39.260435 27053 solver.cpp:571] Iteration 17300, lr = 0.001
I0314 17:24:58.870244 27053 solver.cpp:242] Iteration 17400, loss = 2.16347
I0314 17:24:58.870337 27053 solver.cpp:258] Train net output #0: loss: 50%-fire-rate = 0.00347057 (* 1 = 0.00347057 loss)
I0314 17:24:58.870344 27053 solver.cpp:258] Train net output #1: loss: classfication-error = 2.28496 (* 1 = 2.28496 loss)
I0314 17:24:58.870350 27053 solver.cpp:258] Train net output #2: loss: forcing-binary = -0.124964 (* 1 = -0.124964 loss)
I0314 17:24:58.870357 27053 solver.cpp:571] Iteration 17400, lr = 0.001
The loss just stay near 2.2.
And I've mentioned you used 3 kinds of losses to calculate the result, so I just delete one of the loss layers, use two kinds of losses and it converged. Log is as following:
267646 (* 1 = 0.267646 loss)
I0315 01:15:36.250314 501 solver.cpp:571] Iteration 37600, lr = 0.0001
I0315 01:15:55.113540 501 solver.cpp:242] Iteration 37700, loss = 0.305098
I0315 01:15:55.113579 501 solver.cpp:258] Train net output #0: loss: 50%-fire-rate = 0.000179385 (* 1 = 0.000179385 loss)
I0315 01:15:55.113590 501 solver.cpp:258] Train net output #1: loss: classfication-error = 0.304919 (* 1 = 0.304919 loss)
I0315 01:15:55.113598 501 solver.cpp:571] Iteration 37700, lr = 0.0001
I0315 01:16:14.149433 501 solver.cpp:242] Iteration 37800, loss = 0.283406
I0315 01:16:14.149519 501 solver.cpp:258] Train net output #0: loss: 50%-fire-rate = 0.000153867 (* 1 = 0.000153867 loss)
I0315 01:16:14.149533 501 solver.cpp:258] Train net output #1: loss: classfication-error = 0.283253 (* 1 = 0.283253 loss)
I0315 01:16:14.149544 501 solver.cpp:571] Iteration 37800, lr = 0.0001
I0315 01:16:33.261036 501 solver.cpp:242] Iteration 37900, loss = 0.147353
I0315 01:16:33.261082 501 solver.cpp:258] Train net output #0: loss: 50%-fire-rate = 0.000290852 (* 1 = 0.000290852 loss)
I0315 01:16:33.261096 501 solver.cpp:258] Train net output #1: loss: classfication-error = 0.147062 (* 1 = 0.147062 loss)
I0315 01:16:33.261106 501 solver.cpp:571] Iteration 37900, lr = 0.0001
I0315 01:16:51.728065 501 solver.cpp:346] Iteration 38000, Testing net (#0)
So What caused this, and how to solve the problem?Thank you.

Python code for generating binary codes

@kevinlin311tw Hi Kevin, I have written a small Python code to generate binary codes. It may be useful for someone interested in Python:

#coding=utf-8

import numpy as np
import sys,os
import matplotlib
matplotlib.use('Agg')
import caffe
import time
import cv2

MODEL = "snapshots__iter_80000.caffemodel"
PROTO = "deploy.prototxt"
MEAN = "mean.npy"

class binaryCodesGenerator(object):

  def __init__(self, gpuid, modelDir):
    self.gpuid = gpuid
    self.model = os.path.join(modelDir, MODEL)
    self.proto = os.path.join(modelDir, PROTO)
    self.mean = os.path.join(modelDir, MEAN)
    self.initcaffe()

  def initcaffe(self):
    caffe.set_device(self.gpuid)
    caffe.set_mode_gpu()
    self.net = caffe.Net(self.proto, self.model, caffe.TEST)
    self.net.forward()
    self.transformer = caffe.io.Transformer({'data': self.net.blobs['data'].data.shape})
    self.transformer.set_transpose('data', (2,0,1))
    self.transformer.set_mean('data', np.load(self.mean).mean(1).mean(1))
    self.transformer.set_raw_scale('data', 255)
    self.transformer.set_channel_swap('data', (2,1,0))

  def hashing(self, image):
    array = np.fromstring(image, dtype='uint8')
    im = cv2.imdecode(array,1)
    im = im / 255.
    im = im[:,:,(2,1,0)]
    self.net.blobs['data'].data[...] = self.transformer.preprocess('data', im)
    self.net.forward()
    # obtain the output probabilities
    feat = self.net.blobs['encode_neuron'].data[0]
    # generate binary codes
    binary_codes = feat > 0.5
    binary_codes = binary_codes.astype(int)
    return binary_codes


if __name__ == "__main__":
    gpuID = 5
    bCG = binaryCodesGenerator(gpuID, '/raid/yuanyong/imagenet/hashing_release')
    # img1
    img_path = '009_0001.jpg'
    with open(img_path,'rb') as infile:
      buf = infile.read()
    binary_codes_1 = bCG.hashing(buf)
    # img2
    img_path = '056_0002.jpg'
    with open(img_path,'rb') as infile:
      buf = infile.read()
    binary_codes_2 = bCG.hashing(buf)
    # compute hamming distance
    hamming_dis = np.count_nonzero(binary_codes_1 != binary_codes_2)
    print "hamming distance: %d" % hamming_dis

Issue about the classification error

I have a small question about the equation 4 in your T-PAMI paper.

The estimated value of y_nm is the softmax output of the output layer. But that value never goes less than zero or greater than 1. Therefore the first and second terms in the equation will never exist. It will always be the L1/ L2 norm term only. Am I correct in my understanding or is there something I am missing. I would really appreciate your reply.

Thank you

Still getting 10% MAP with Cifar10

Hey, when you guys say that one should launch matlab at caffe's root folder, what exactly do you mean?
I've done all that is suggested but still get 10% MAP when I execute the run_cifar10 code. :/
Any other things that I should do you could think of?

K1_EuclideanLoss has two input

Hi Kevin:
Why K1_EuclideanLoss and K2_EuclideanLoss has two same input?
I believe you are doing the same work on both input, in SSDH case, the latent_sigmoid layer output.
Why? Am I wrong,or miss something?

Thanks for your time.

-Yip

Cannot converge when I switch cifar10 to caltec101 dataset

Help me figure it out, thanks.
Below is the steps I followed to conduct my experiment.
A: I split caltec101 to two disjoint dataset:
1, train.txt with 7357 images
2, val.txt with 1788 images
then I pack them into leveldb by run create_imagenet.sh.
B: I train the net followed the step when I train on cifar10. I did not modified the training and caffe net param and use 48 bits as default

C: When I train the model, I noticed the log show as below. That was not I want contrast to when I finished training on cifar10 I got "Test net output #0: accuracy = 0.903437".

FYI

I0903 21:10:34.141065 29794 solver.cpp:317] Iteration 50000, loss = 15.486
I0903 21:10:34.141099 29794 solver.cpp:337] Iteration 50000, Testing net (#0)
I0903 21:10:41.981957 29794 solver.cpp:404] Test net output #0: accuracy = 0.0915625
I0903 21:10:41.982012 29794 solver.cpp:404] Test net output #1: loss: 50%-fire-rate = 0.00132921 (* 1 = 0.00132921 loss)
I0903 21:10:41.982022 29794 solver.cpp:404] Test net output #2: loss: classfication-error = 12.1441 (* 1 = 12.1441 loss)
I0903 21:10:41.982028 29794 solver.cpp:404] Test net output #3: loss: forcing-binary = -0.00390625 (* 1 = -0.00390625 loss)
I0903 21:10:41.982033 29794 solver.cpp:322] Optimization Done.
I0903 21:10:41.982038 29794 caffe.cpp:254] Optimization Done.

Can not understand the loss functions

K1_EuclideanLoss will enforce each node in encode_neuron to be 0 or 1.
K2_EuclideanLoss will ensure each node in encode_neuron has a 50% chance of being 0 or 1.
How ??? thanks!!!

About NUS-WIDE dataset

In your paper, "The downloaded images are divided into a training set of 97,214 images and a test set of 65,075 images". To know it for sure, can you upload your NUS-WIDE training and testing txt? Thank you!

i trained on my own dataset,bu the accuracy is 0.058

I1116 18:09:20.180027 9262 solver.cpp:258] Train net output #2: loss: forcing-binary = -0.125 (* 1 = -0.125 loss)
I1116 18:09:20.180032 9262 solver.cpp:571] Iteration 49500, lr = 0.0001
I1116 18:09:33.337271 9262 solver.cpp:242] Iteration 49600, loss = 2.20369
I1116 18:09:33.337370 9262 solver.cpp:258] Train net output #0: loss: 50%-fire-rate = 0.078342 (* 1 = 0.078342 loss)
I1116 18:09:33.337389 9262 solver.cpp:258] Train net output #1: loss: classfication-error = 2.25035 (* 1 = 2.25035 loss)
I1116 18:09:33.337394 9262 solver.cpp:258] Train net output #2: loss: forcing-binary = -0.125 (* 1 = -0.125 loss)
I1116 18:09:33.337399 9262 solver.cpp:571] Iteration 49600, lr = 0.0001
I1116 18:09:46.505617 9262 solver.cpp:242] Iteration 49700, loss = 4.80791
I1116 18:09:46.505666 9262 solver.cpp:258] Train net output #0: loss: 50%-fire-rate = 0.078342 (* 1 = 0.078342 loss)
I1116 18:09:46.505671 9262 solver.cpp:258] Train net output #1: loss: classfication-error = 4.85457 (* 1 = 4.85457 loss)
I1116 18:09:46.505676 9262 solver.cpp:258] Train net output #2: loss: forcing-binary = -0.125 (* 1 = -0.125 loss)
I1116 18:09:46.505679 9262 solver.cpp:571] Iteration 49700, lr = 0.0001
I1116 18:09:59.674759 9262 solver.cpp:242] Iteration 49800, loss = 4.90798
I1116 18:09:59.674805 9262 solver.cpp:258] Train net output #0: loss: 50%-fire-rate = 0.078342 (* 1 = 0.078342 loss)
I1116 18:09:59.674811 9262 solver.cpp:258] Train net output #1: loss: classfication-error = 4.95464 (* 1 = 4.95464 loss)
I1116 18:09:59.674815 9262 solver.cpp:258] Train net output #2: loss: forcing-binary = -0.125 (* 1 = -0.125 loss)
I1116 18:09:59.674820 9262 solver.cpp:571] Iteration 49800, lr = 0.0001
I1116 18:10:12.822674 9262 solver.cpp:242] Iteration 49900, loss = 4.80472
I1116 18:10:12.822844 9262 solver.cpp:258] Train net output #0: loss: 50%-fire-rate = 0.078342 (* 1 = 0.078342 loss)
I1116 18:10:12.822870 9262 solver.cpp:258] Train net output #1: loss: classfication-error = 4.85138 (* 1 = 4.85138 loss)
I1116 18:10:12.822875 9262 solver.cpp:258] Train net output #2: loss: forcing-binary = -0.125 (* 1 = -0.125 loss)
I1116 18:10:12.822898 9262 solver.cpp:571] Iteration 49900, lr = 0.0001
I1116 18:10:25.875818 9262 solver.cpp:449] Snapshotting to binary proto file SSDH48_iter_50000.caffemodel
I1116 18:10:26.749424 9262 solver.cpp:734] Snapshotting solver state to binary proto fileSSDH48_iter_50000.solverstate
I1116 18:10:27.045744 9262 solver.cpp:326] Iteration 50000, loss = 2.2021
I1116 18:10:27.045768 9262 solver.cpp:346] Iteration 50000, Testing net (#0)
I1116 18:10:39.996009 9262 solver.cpp:414] Test net output #0: accuracy = 0.0591
I1116 18:10:39.996035 9262 solver.cpp:414] Test net output #1: loss: 50%-fire-rate = 0.0783422 (* 1 = 0.0783422 loss)
I1116 18:10:39.996040 9262 solver.cpp:414] Test net output #2: loss: classfication-error = 2.82341 (* 1 = 2.82341 loss)
I1116 18:10:39.996044 9262 solver.cpp:414] Test net output #3: loss: forcing-binary = -0.125 (* 1 = -0.125 loss)
I1116 18:10:39.996060 9262 solver.cpp:331] Optimization Done.
I1116 18:10:39.996064 9262 caffe.cpp:214] Optimization Done.

my dataset is 1020 as train images and 340 as val images, i make it look like your dataset with labels, and make them into lmdb , but the result is not good , can you tell me why?thank you so much!

How to run the demo correctly?

1. when I run demo there are some errors list below. How to fix this?

2. I check the output file "binary48.mat" in matlab, shows that each bit is '1' . is it correct?

3, I cannot found data/cifar10/demo_imgs in the git while it was mentioned in below error message, seems like it is a must?

ERROR MESSAGES
Starting parallel pool (parpool) using the 'local' profile ... connected to 12 workers.
Preparing /data/cifar10/demo_imgs/bus1.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Preparing /data/cifar10/demo_imgs/car1.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Preparing /data/cifar10/demo_imgs/air2.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Preparing /data/cifar10/demo_imgs/bus2.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Preparing /data/cifar10/demo_imgs/air1.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Preparing /data/cifar10/demo_imgs/bird2.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Preparing /data/cifar10/demo_imgs/horse2.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Preparing /data/cifar10/demo_imgs/car2.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Preparing /data/cifar10/demo_imgs/bird1.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Preparing /data/cifar10/demo_imgs/horse1.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Elapsed time is 19.322657 seconds.
Batch 1 out of 2 50.00% Complete ETA 19.32 seconds
W0608 04:26:31.412638 133063 net.hpp:41] DEPRECATED: ForwardPrefilled() will be removed in a future version. Use Forward().
Elapsed time is 0.067123 seconds.
Elapsed time is 19.393612 seconds.
Preparing /data/cifar10/demo_imgs/deer2.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Preparing /data/cifar10/demo_imgs/deer1.jpg
Warning: Problems with file
In prepare_batch>(parfor body) at 42
In parallel_function>make_general_channel/channel_general at 914
In remoteParallelFunction at 38
Elapsed time is 0.055933 seconds.
Batch 2 out of 2 100.00% Complete ETA 0.00 seconds
Elapsed time is 0.020130 seconds.
Elapsed time is 0.076484 seconds.
Elapsed time is 19.470295 seconds.
Cleared 0 solvers and 1 stand-alone nets
A figure's "Position" property does not have a fixed set of property values.
Error using imshow (line 208)
IMSHOW unable to display image.

Error in demo (line 48)
subplot(4,1,i), imshow(image); title(codes);

Cannot converge when I add image augmentation

I followed your augmentation project, re-compiled SSDH code and found the accuracy cannot converge which kept below 0.01 while training. Can you help me to figure out the reason?
Below steps are where I changed the code followed your augmentation project in SSDH code:
1, src/caffe/proto/caffe.proto
2, src/caffe/data_transformer.cpp
3, train_val.prototxt

the weight of loss function

Hi, kevin
I understand the weight of classification error is in your paper(formula (2)) and the weight of binarization similarity in your paper(formula (7)) is different. So I can't understand what the W stand for in your paper(formula (8)) thx.

No batchnorm layer in your source?

I am trying to use Resnet50. But your src has no files corresponding to batch_norm_layers, therefore the binary has no concept of "batch_norm". How can one build it with batch_norm support? The latest caffe code for the same obviously throws a lot of errors

multi-label classification loss?

Hi, kevin
I can't figure out where did you use multi-label classification loss as you mentioned in your paper(formula (5)). I check all your trainval.prototxt about SSDH and find nothing about using multi-label, all your classification loss is softmaxwithloss. thx.

Where I can get the matcaffe.cpp file?

when I make Compile the matcaffe ,I run the command: make matcaffe. But I get the information:" make: *** No rule to make target 'matlab/caffe/matcaffe.cpp', needed by 'matlab/caffe/caffe.mexa64'. Stop." I look the caffe file and find that There isn't matcaffe.cpp file,where I can get the needed file? and I find caffe file in the matlab file folder isn't named caffe but named +caffe. what should I do for correctly making matcaffe?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.