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

2 ビュー (過去 30 日間)
tesarj13
tesarj13 2018 年 10 月 21 日
コメント済み: tesarj13 2018 年 10 月 23 日

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.
  1 件のコメント
tesarj13
tesarj13 2018 年 10 月 23 日
Yes. It works. Now the classification is right in 784 of 1000 cases, which is way better then just 1 nematode.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by