vlfeat / matconvnet

MatConvNet: CNNs for MATLAB
Other
1.4k stars 752 forks source link

What does the accuracy this graph indicates ? #959

Open amalzoheirm opened 7 years ago

amalzoheirm commented 7 years ago

dr khaled comment 1

hawescm1 commented 7 years ago

The graph with title "objective" shows you both train and test error for the "softmax log loss", while the "top1err" graph shows train and test error for top-1 error, which is the error that the most probable class prediction makes (for multi-class classification problems, like CIFAR-10 which has 10 classes) against the true class label. Top-5 error on the other hand only counts an error if the true class isn't within the 5 most probably class predictions at the output of the network.

hawescm1 commented 7 years ago

From the looks of it, your network is not generalizing and is overfit to the training data.

amalzoheirm commented 7 years ago

How can i calculate accuracy from this graph?

hawescm1 commented 7 years ago

Well, you can calculate two types of accuracy from your graph, specifically the middle graph of top1error. Your training accuracy, in percent, would be simply:

accuracyTrain = 100 * (1 - top1error_train);

Your generalization accuracy (accuracy on data the network has never seen before) in percent would then be

accuracyGen = 100 * (1 - top1error_val);

where top1error_train represents the blue circles and top1error_val represents the red (orange?) circles. Thus I see your generalization accuracy at about 40% and your training 'accuracy' at about 99%...

However, judging from your graphs, your network is overfit to the training data or else your validation data is not generated by the same probability distribution as your training data, since the top1error differs so greatly between training data and validation data...

amalzoheirm commented 7 years ago

thank you for answer

amalzoheirm commented 7 years ago

i want to know if accuracy increase correctly or not i stopped run and continue run by adding new dataset after 50 epoch every time capture1 1

Addhi86 commented 7 years ago

@hawescm1 @vedaldi

image

The error value of training at 150th Epoch is 0.28. But when I check the training accuracy by testing the training images. it shows me 100% accuracy.I am confuse that why it is showing different result. the accuracy should be around 69-70%. I am calculating the training accuracy like that: Set 1 is for training images.

test_image = find(imdb.images.set==3) ;
correct = 0;
ncorrect = 0;
for i=1:length(test_image)
    im = (imdb.images.data(:,:,:,test_image(:,i))) ;
    res = [];
    %dzdy = [] ;
    res = vl_simplenn(net, im,[],res,'mode', 'test') ;
    scores = squeeze(gather(res(end).x)) ;
    [bestScore(i,:), best(i,:)] = max(scores) ;
    if (best(i,:) == imdb.images.label(test_image(:,i)))
        correct = correct + 1;
    else
        ncorrect = ncorrect + 1;
    end  
end