rcnn mini batch accuracy

조회 수: 3 (최근 30일)
noam freundlich
noam freundlich 2019년 5월 26일
답변: Xiangxue Wang 2020년 9월 28일
Hey, Im trying to train a rcnn to recognize a nose in a thermal picture.
during the training I get 'mini batch accuracy' 100%. my qustion is how is this vaule is calculted?
when I tried to use my rcnn on my own training data it showed very bed results. (most picture are not beining assigned any labeling box).

답변 (1개)

Xiangxue Wang
Xiangxue Wang 2020년 9월 28일
Hi,
I have met the same situation as you described above. I checked their codes for accuracy calculation, it looks like the accuracy definition is number of correctely detected boxes over the number of positive boxes within the training set.
specific function/class is called FasterRCNNEndToEndTrainingSummary
%%FasterRCNNEndToEndTrainingSummary
function [accuracy, numObservations] = iClassificationAccuracyMetric(Y,T)
[~, yIntegers] = max(Y, [], 3);
[t, tIntegers] = max(T, [], 3);
x = (t.* (yIntegers == tIntegers));
numObservations = nnz(T);
if numObservations == 0
% None of the proposals where marked as positive or negative sample
% based on the positive/negative overlap ratios. In this case, the Fast
% R-CNN sub-network does nothing during training and we should report
% [] accuracy.
accuracy = [];
else
accuracy = gather( 100 * (sum(x(:)) / numObservations) );
end
end
For very bad results you mentioned as no assigment of box in test set, I would suggest to lower the threshold when using the detect function to see if any activations in cnn for RPN to be identified. But, based on what you described, I would assume the training doesn't learn much to differentiate the nose from the background. You may think about tweaking your training data somehow during preprocessing.

Community Treasure Hunt

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

Start Hunting!

Translated by