├── E-measure.jpg ├── Emeasure.m ├── Foreground Map.png ├── Ground Truth.png ├── README.md └── demo.m /E-measure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DengPingFan/E-measure/997d8085f9be4d3cf0cd7aa3441f925f7e7b813e/E-measure.jpg -------------------------------------------------------------------------------- /Emeasure.m: -------------------------------------------------------------------------------- 1 | function [score]= Emeasure(FM,GT) 2 | % Emeasure Compute the Enhanced Alignment measure (as proposed in "Enhanced-alignment 3 | % Measure for Binary Foreground Map Evaluation" [Deng-Ping Fan et. al - IJCAI'18 oral paper]) 4 | % Usage: 5 | % score = Emeasure(FM,GT) 6 | % Input: 7 | % FM - Binary foreground map. Type: double. 8 | % GT - Binary ground truth. Type: double. 9 | % Output: 10 | % score - The Enhanced alignment score 11 | 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Important Note:%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | %The code is for academic purposes only. Please cite this paper if you make use of it: 14 | 15 | %@conference{Fan2018Enhanced, title={Enhanced-alignment Measure for Binary Foreground Map Evaluation}, 16 | % author={Fan, Deng-Ping and Gong, Cheng and Cao, Yang and Ren, Bo and Cheng, Ming-Ming and Borji, Ali}, 17 | % year = {2018}, 18 | % booktitle = {IJCAI} 19 | % } 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 21 | 22 | FM = logical(FM); 23 | GT = logical(GT); 24 | 25 | %Use double for computations. 26 | dFM = double(FM); 27 | dGT = double(GT); 28 | 29 | %Special case: 30 | if (sum(dGT(:))==0)% if the GT is completely black 31 | enhanced_matrix = 1.0 - dFM; %only calculate the black area of intersection 32 | elseif(sum(~dGT(:))==0)%if the GT is completely white 33 | enhanced_matrix = dFM; %only calcualte the white area of intersection 34 | else 35 | %Normal case: 36 | 37 | %1.compute alignment matrix 38 | align_matrix = AlignmentTerm(dFM,dGT); 39 | %2.compute enhanced alignment matrix 40 | enhanced_matrix = EnhancedAlignmentTerm(align_matrix); 41 | end 42 | 43 | %3.Emeasure score 44 | [w,h] = size(GT); 45 | score = sum(enhanced_matrix(:))./(w*h - 1 + eps); 46 | end 47 | 48 | % Alignment Term 49 | function [align_Matrix] = AlignmentTerm(dFM,dGT) 50 | 51 | %compute global mean 52 | mu_FM = mean2(dFM); 53 | mu_GT = mean2(dGT); 54 | 55 | %compute the bias matrix 56 | align_FM = dFM - mu_FM; 57 | align_GT = dGT - mu_GT; 58 | 59 | %compute alignment matrix 60 | align_Matrix = 2.*(align_GT.*align_FM)./(align_GT.*align_GT + align_FM.*align_FM + eps); 61 | 62 | end 63 | 64 | % Enhanced Alignment Term function. f(x) = 1/4*(1 + x)^2) 65 | function enhanced = EnhancedAlignmentTerm(align_Matrix) 66 | enhanced = ((align_Matrix + 1).^2)/4; 67 | end 68 | 69 | 70 | -------------------------------------------------------------------------------- /Foreground Map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DengPingFan/E-measure/997d8085f9be4d3cf0cd7aa3441f925f7e7b813e/Foreground Map.png -------------------------------------------------------------------------------- /Ground Truth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DengPingFan/E-measure/997d8085f9be4d3cf0cd7aa3441f925f7e7b813e/Ground Truth.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # E-measure: Enhanced-alignment Measure for Binary Foreground Map Evaluation 2 | 3 | ![alt tag](E-measure.jpg) 4 | 5 | ## Publication 6 | [Deng-Ping Fan](http://dpfan.net), [GongCheng], CaoYang, RenBo, [Ming-Ming Cheng](http://mmcheng.net) and [Ali Borji](http://crcv.ucf.edu/people/faculty/Borji/) 7 | 8 | **Enhanced-alignment Measure for Binary Foreground Map Evaluation.** **IJCAI, 2018** 9 | 10 | [[pdf](https://arxiv.org/abs/1805.10421)] 11 | 12 | ## Usage 13 | 14 | Requirement: 15 | 16 | 1. Matlab 17 | 18 | Matlab Example 19 | 20 | You can just run the demo.m to get the evaluation results. 21 | 22 | ## If our code is useful for you, please cite our paper 23 | @inproceedings{FanStructMeasureICCV17, 24 | title={Structure-measure: A New Way to Evaluate Foreground Maps}, 25 | author={Deng-Ping Fan and Ming-Ming Cheng and Yun Liu and Tao Li and Ali Borji}, 26 | booktitle={IEEE International Conference on Computer Vision}, 27 | year={2017} 28 | } 29 | 30 | @inproceedings{Fan2018Enhanced, 31 | title={Enhanced-alignment Measure for Binary Foreground Map Evaluation}, 32 | author={Deng-Ping Fan, Cheng Gong, Yang Cao, Bo Ren, Ming-Ming Cheng, Ali Borji}, 33 | booktitle={IJCAI}, 34 | year={2018}, 35 | organization={AAAI Press} 36 | } 37 | -------------------------------------------------------------------------------- /demo.m: -------------------------------------------------------------------------------- 1 | close all; clear; clc; 2 | 3 | % set the RoodDir according to your own environment 4 | RootDir = pwd; 5 | 6 | %load GT 7 | GT = imread(fullfile(RootDir,'Ground Truth.png')); 8 | %load FM 9 | FM = imread(fullfile(RootDir,'Foreground Map.png')); 10 | 11 | %compute Emeasure score 12 | score = Emeasure(FM,GT); 13 | 14 | fprintf('The similarity score between FM and GT is:%.3f\n',score); 15 | --------------------------------------------------------------------------------