显著目标检测评价指标 MAE 和 MSE

MAE:平均绝对误差(mean absolute error),对应位置差值的绝对值之和

MAE = \frac{1}{mn} \sum_{i=1}^{m} \sum_{j=1}^{n} | \hat{y_{ij}}-y_{ij} |

clear;
clc;
% mean absolute error
% smap is saliency map
% gmap is ground truth map
smap = imread('smap.png');
gmap = imread('gt.png');
if size(gmap,3) == 3
    gmap = rgb2gray(gmap);
end

smap = imresize(smap, size(gmap));
smap = mat2gray(smap);  % 使图中值范围[0,1]
gmap = mat2gray(gmap);  % 使图中值范围[0,1]

MAE_value = mean2(abs(smap - gmap));

 

MSE:均方误差(mean squared error),对应位置差值的平方之和

MSE = \frac{1}{mn} \sum_{i=1}^{m} \sum_{j=1}^{n} (\hat{y}_{ij} - y_{ij})^2

clear;
clc;
% mean squared error
% smap is saliency map
% gmap is ground truth map

smap = imread('smap.png');
gmap = imread('gt.png');
if size(gmap,3) == 3
    gmap = rgb2gray(gmap);
end

smap = imresize(smap, size(gmap));
smap = mat2gray(smap);
gmap = mat2gray(gmap);

MSE_value = mean2((smap - gmap)^2);

 

你可能感兴趣的:(Matlab,Salient,Obejct,Detection)