GithubHelp home page GithubHelp logo

aravindhm / deep-goggle Goto Github PK

View Code? Open in Web Editor NEW
168.0 168.0 75.0 415 KB

Source code for "Understanding Deep Image Representations by Inverting Them", CVPR 2015

License: BSD 2-Clause "Simplified" License

MATLAB 99.80% M 0.20%

deep-goggle's People

Contributors

anguyen8 avatar aravindhm avatar hosnasattar avatar orthographic-pedant 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

deep-goggle's Issues

Can't find imagenet-caffe-ref.mat

It seems that experiment_cnn will put imagenet-caffe-ref.mat in the top level "experiment' folder, rather than under "network", and then it can't find it.

Reference to non-existent field 'weights'.

hi,
I try to run the experiment_cnn, but I get error immediately after
Starting an expeirmentrunning experiment ILSVRC2012_val_00000013
do you have any idea why I get this error?
Reference to non-existent field 'weights'.
Error in vl_simplenn (line 288)
res(i+1).x = vl_nnconv(res(i).x, l.weights{1}, l.weights{2}, ...
Error in compute_features (line 19)
res = vl_simplenn(net, x0);
Error in experiment_run>run_one (line 74)
feats = compute_features(net, im, exp.opts);
Error in experiment_run (line 11)
run_one(exp{i}) ;
Error in experiment_cnn (line 157)
experiment_run(exp) ;

how to run my own networks

hi, I want to visualize my own networks, the following code is used:

net=load('imagenet-caffe-alex');

im = imread('peppers.png') ;
im_ = single(im) ;
im_ = imresize(im_, net.normalization.imageSize(1:2)) ;
im_ = im_ - net.normalization.averageImage ;

res = vl_simplenn(net, im_) ;

y0=res(end-1).x;

res_inverse = invert_nn(net, y0, 'imgSize',net.normalization.imageSize,'normalize',get_cnn_normalize(net.normalization),'denormalize',...
get_cnn_denormalize(net.normalization),'numRepeats',1);

it can work well. However, if I want to visualize the other layers, such as y0=res(2).x, the following error information occurs:

Array dimensions must match for binary array op.

Error in invert_nn>nndistance (line 255)
d = x - w ;

Error in invert_nn>nndistance_forward (line 244)
res_.x = nndistance(res.x, ly.w, ly.mask) ;

Error in vl_simplenn (line 250)
res(i+1) = l.forward(l, res(i), res(i+1)) ;

Error in invert_nn (line 116)
res = vl_simplenn(net, x); % x is the random initialized image

I have checked the error, but fail to solve this problem. Thanks in advance!

in invert_nn.m about backpropagation

if opts.lambdaL2 > 0 % Cost and derivative of L\beta norm
r_ = sum(x(:).^opts.beta) ;
dr_ = opts.beta * x.^(opts.beta-1) ;
E(3,t) = opts.lambdaL2/2 * r_ ;
dr = dr + opts.lambdaL2/2 * dr_ ;

In there, opts.lanbdaL2 seems like a empirical parameter. I would like to ask for advice about how to calculate the proper value of opts.lanbdaL2. Thank you very much.

What about a specific subset of features from a layer?

Hey, I hope you are well.
I am trying to run your reconstruction for the an intermediate layer of the VGG-16 (ReLU2_2) which has 128 channels. Is there any possibility to use a subset of those 128 channels (like say 40 of my choice, based on a criteria that I develop) to reconstruct the input image. I see in your paper that you did divide the channels into two parts in one experiment. If possible, some directions on how to achieve this would be greatly appreciated. Thank you for your time.

Question about two subsets of feature channels mentioned in your paper

Hi there, may I ask a question about something you mentioned in your original paper, which is irrelevant to this project I believe?
In page 8 of your paper, you said and I quote here: "CNN-A contains in fact two subsets of feature
channels which are independent for the first several layers(up to norm2)". You also said that this idea was mentioned in Krizhevsky's paper, but I didn't find relevant contents. I have to say I didn't go through Krizhevsky's paper, could you tell me where can I find it, and Is there any other paper that mentioned similar ideas? Looking forward to your reply.

running my own vgg19 network

i m trying
net = load('imagenet-vgg-verydeep-19.mat') ;

im = imread('peppers.png') ;
im_ = single(im) ;
im_ = imresize(im_, net.meta.normalization.imageSize(1:2)) ;
res = vl_simplenn(net, im_) ;
y0=res(end-1).x;
res = invert_nn(net, y0, 'imgSize',net.meta.normalization.imageSize(1:2),'normalize',get_cnn_normalize(net.meta.normalization),'denormalize',get_cnn_denormalize(net.meta.normalization),'numRepeats',1);
Error: File: invert_nn.m Line: 46 Column: 6
The input character is not valid in MATLAB statements or expressions.
can u help me with that error?

how to extract features from layer 43 (RELU)-vgg19

sorry for asking again but i want to extract features of layer 43 of vgg19 model (RELU)
and whenever i try y0=res(end-3).x;
it result in an error
Error using -
Array dimensions must match for binary array op.

Error in invert_nn>nndistance (line 255)
d = x - w ;

Error in invert_nn>nndistance_forward (line 244)
res_.x = nndistance(res.x, ly.w, ly.mask) ;

Error in vl_simplenn (line 374)
res(i+1) = l.forward(l, res(i), res(i+1)) ;
although y0=res(end-2).x; have the same dimension as (end-3)
can u help?

matlabpool removed

Hello!
While trying to run experiment_cnn.m I get the following error:

'matlabpool' has been removed. With appropriate code changes, use 'parpool' instead.

Error in experiment_run (line 3)
if matlabpool('size') > 0

Error in experiment_cnn (line 157)
experiment_run(exp) ;

Caused by:
Unrecognized function or variable 'matlabpool'.

Unfortunately just changing it to parpool does not work.
Thanks for the attention

Wrong Net object

I run the experiment_cnn as the README.MD does.
However, I got the following error message:

Reference to non-existent field 'meta'.
Error in experiment_run>run_one (line 41)
    exp.opts.normalize = get_cnn_normalize(net.meta.normalization) ;

I got the CNN-A net from the link you provide: http://www.robots.ox.ac.uk/~aravindh/networks.html
the CNN-A net imagenet-caffe-ref.mat does not have a field meta

However, it does have net.normalization.

I thought it is because the net in your link is too old?

Should I download a newer imagenet-caffe-ref.mat in MatConvNet homepage?

thanks a lot @aravindhm

GOT Inf when traing

iter:00002 sq. rec. err:  0.7921; obj:  0.8761;
iter:00003 sq. rec. err:    1.26; obj:   1.514;
iter:00004 sq. rec. err:  0.9479; obj:   1.649;
iter:00005 sq. rec. err:  0.8712; obj:   2.981;
iter:00006 sq. rec. err:  0.7573; obj:   14.77;
iter:00007 sq. rec. err:   598.7; obj:1.639e+11;
iter:00008 sq. rec. err:1.914e+20; obj:     Inf;
iter:00009 sq. rec. err:6.738e+19; obj:     NaN;
iter:00010 sq. rec. err:   0.998; obj:     NaN;
iter:00011 sq. rec. err:   0.998; obj:     NaN;
iter:00012 sq. rec. err:   0.998; obj:     NaN;
iter:00013 sq. rec. err:   0.998; obj:     NaN;

When I reconstruct a picture from VGG19_ layer 30 or later I got this .....

How could this happen?

filnames of images inverted in the paper

Hi,
could you provide the filenames of the images from imagenet validation (mokey, man holding fsh, texture etc etc.) whose results were reported in the paper?

thanks

How to reconstruct from sift?

Thanks for sharing this fantastic work! I managed to run experiment_cnn.m file, but I don't know how to run the sift experiment. I use this code to use a sift model:

image_for_sift = {'data/imagenet12-val/ILSVRC2012_val_00000043.JPEG'};
exp{end+1} = experiment_init('dsift',1,image_for_sift{1},ver,'cnn_sift',opts3);
experiment_run(exp) ;

It gives me this error:

Reference to non-existent field 'normalization'.
Error in compute_features (line 13)
normalize = get_cnn_normalize(net.normalization);

can you give me some hints?

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.