Order of labels in Alexnet's outputs vs. order of labels in ImageNet 2010

조회 수: 2 (최근 30일)
Soan Duong
Soan Duong 2020년 9월 21일
댓글: Madhav Thakker 2020년 9월 26일
Hi all,
Do you know the difference between the order of labels in the Alexnet's output and the order of labels in ImageNet 2010?
As far as I know, Alexnet in MATLAB was trained with ImageNet 2010.
I got the Alexnet's outputs the first 1000 image from the test set of ImageNet 2010, then I compared the outputs with the corresponding ground-truth (ImageNet 2010 data were downloaded at http://www.image-net.org/challenges/LSVRC/2010/downloads). However, I got just 5/1000 label matched.
Thus, I am thinking that the order of labels in Alexnet's outputs and the order of labels in ImageNet 2010 are different. Do you know how different they are?
Any help would be highly appreciated.
Best,
Soan
  댓글 수: 2
Walter Roberson
Walter Roberson 2020년 9월 26일
Do the two have the same statistics? If the two match in a sorted histogram, then it would be a class rename (for whatever reason), but if the statistics do not match then they would seem to be reflecting different images.

댓글을 달려면 로그인하십시오.

답변 (1개)

Madhav Thakker
Madhav Thakker 2020년 9월 24일
Hi Saon,
You can get the labels for the pretrained Alexnet in MATLAB by loading the pretrained model.
net = alexnet;
net.Layers(25,1).Classes
You can get the labels of ImageNet 2010 from the offical ImageNet site and compare the labels. I can't think of a reason why MATLAB Alexnet's labels will be different from offical ImageNet labels.
Hope this helps.
  댓글 수: 4
Soan Duong
Soan Duong 2020년 9월 26일
Sure. Below is the code that I used to obtain the output labels of AlexNet.
clear
net = alexnet;
% Get name of classes (AlexNet's output)
labels = net.Layers(end).Classes;
% Write the labels into a text file
fid = fopen('alexnet_labels.txt','w');
for k = 1 : length(labels)
fprintf( fid, '%s\n', labels(k) );
end
fclose(fid);
I have also attached the text files of the labels that I got from the ImageNet2010 (imagenet_labels.txt) and from the above MATLAB code (alexnet_labels.txt). Do you have any idea to match those sets of labels?
Madhav Thakker
Madhav Thakker 2020년 9월 26일
Hi Saon, can you share the source of your ImageNet labels (imagenet_labels.txt). A link from where you got the labels might be helpful.

댓글을 달려면 로그인하십시오.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by