Classification of AlexNet deep dreams is always wrong (always nematode)

2 次查看(过去 30 天)

I followed up the tutorial about AlexNet deep dreams and let the network dreamed about 'daisy' (index 986)

 net = alexnet;
 I = deepDreamImage(net,23,986);

Now, documentation says that image 'I' highlights the features learned by a network. I thought that this dreamed image should be classified as selected channel (daisy in my case), but it is not:

 I_resized = imresize(I,[227 227]);
 classify(net,I_resized)
 >> ans = 
    categorical 
       nematode

Moreover dreams of ALL channels are classified as 'nematode' :

net = alexnet;
%%
num_of_classes = 10;
classifications = cell(1000,num_of_classes);
scores = zeros(1000,num_of_classes);
I_dreamed = zeros(227,227,3,1000);
for class_i = 1:1000
    I = deepDreamImage(net,23,class_i);
    I_resized = imresize(I,[227 227]);% resize for classification
    I_dreamed(:,:,:,class_i) = I_resized;
      p = predict(net,I_resized);
      [p3,i3] = maxk(p,num_of_classes);%get first N classes with strongest response
      classifications(class_i,:)=net.Layers(end).ClassNames(i3);% save classes names
      scores(class_i,:) = p3; % save scores
   end

'classifications' variable is same in every row: 'nematode' 'spotlight' 'fire screen' 'stove' 'volcano' 'digital clock' 'matchstick' 'wing' 'lampshade' 'window screen'

'scores' are not same, but very similar.

(I also tried different (1000 and 10 000) 'NumIterations', and classification was still nematode )

Why isn't "daisy dream" classified as daisy? Why is everything classified as 'nematode'?

采纳的回答

Johannes Bergstrom
Johannes Bergstrom 2018-10-22
编辑:Johannes Bergstrom 2018-10-22
Try setting the 'OutputScaling' value to 'none'.
By default, the deepDreamImage function scales the output pixel values in the interval [0,1], which changes the results of classification.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by