当前位置:网站首页>Infrared dim small target detection: common evaluation indicators

Infrared dim small target detection: common evaluation indicators

2022-07-08 02:16:00 Strawberry sauce toast

This paper summarizes the algorithm evaluation indexes that often appear in the papers in the field of infrared weak and small target detection , And some evaluation indexes are used MATLAB Realization .

At present, the evaluation indicators summarized are the most common , Image detection rate 、ROC These curves are based on a large number of experiments to get data , Then draw tables or curves to objectively evaluate the algorithm .( therefore , There are good ones idea, We must do the experiment as soon as possible !)

The code of this article is all original , If there are deficiencies , Welcome to correct .


Common evaluation indicators (evaluation metrics)

One 、 Detection rate P_d And false alarm rate F_a

Detection rate P_d And false alarm rate F_a The definition of is shown in the figure 1.

                                                                                  chart 1  Detection rate P_d And false alarm rate F_a, Excerpt from [1]

About detection rate P_d The understanding of the :

  1. Single frame image , I got it M Goals , Correct detection of N Goals , be P_d=\frac{N}{M};
  2. In the image sequence , Multiple targets are photographed or appear many times , Suppose the goals co-exist M Time , The target is correctly detected N Time , be P_d=\frac{N}{M}.

About false alarm rate F_a The understanding of the :

  1. Single frame image , If all targets are correctly detected , Then the false alarm rate is 0;
  2. In the image sequence , Image total N frame , The number of detected errors is F, be F_a=\frac{F}{N}

What kind of test results can be regarded as “true detection“?

Two conditions must be met at the same time :

  1. The detection result overlaps with the real target in the image (have overlap pixels);
  2. The difference between the central pixel position of the detection result and the central pixel position of the real target does not exceed a certain range , The literature [1] The medium threshold is 4 pixels.

Two 、 Signal-to-noise ratio (Signal-to-Clutter Ratio,  SCR)

2.1 SCR Definition

SCR=\frac{ |\mu_t-\mu_b|}{ \sigma_b}  ……………… The formula (1)

In style ,\mu_t Represents the average pixel value of the target ,\mu_b, \quad \sigma_b Respectively represent the pixel average value and pixel standard deviation of the background around the target .

                                                                chart 2 Schematic diagram of target and its neighborhood , Excerpt from [1], among d The size does not exceed 20 Pixel

2.2 MATLAB Calculation SCR

2.2.1 Draw a three-dimensional gray image of weak and small targets

When reading literature , You can often see the three-dimensional gray image of the target , The author shows the target before and after enhancement , Or three-dimensional gray images before and after background suppression to visually present the effect of its algorithm to readers .

In addition, drawing the three-dimensional gray image of the target can also intuitively feel the SCR. therefore , Let's first learn how to draw a three-dimensional gray image of the target .

Additional explanation , There are two options for drawing the three-dimensional gray image of the target :

(1) Some articles will choose to draw a three-dimensional gray-scale image of the whole image , Then use the arrow —> Mark the target “ Peak value ”;

(2) You can also choose to draw the local area of the target , Observe whether the local contrast of the target has been enhanced .

Here are two ways MATLAB Code and legend .

%%  Draw a three-dimensional gray-scale image 
img1 = imread('images/1.jpg');
if (size(img1,3) > 1)
    img1 = rgb2gray(img1);
end
subplot(221)
imshow(img1);title(' Original picture ');
sub_img1 = img1(68:88,99:119);   %  Here, you need to manually select the location and size of the target area 
subplot(222)
imshow(sub_img1);title(' Target local image  20*20');

subplot(223)
[y,x] = size(img1);
[X,Y] = meshgrid(1:x, 1:y);
surf(X, Y, img1);title(' Global three-dimensional gray image ');
shading interp;

subplot(224)
[sub_y, sub_x] = size(sub_img1);
[sub_X, sub_Y] = meshgrid(1:sub_x, 1:sub_y);
surf(sub_X, sub_Y, sub_img1);title(' Local three-dimensional gray image ');
shading interp;

                                                                          chart 3 Global and local three-dimensional grayscale images of infrared images with weak and small targets

2.2.2 Goal oriented SCR

  1. The code given in this article is only applicable to grayscale images ;
  2. The reference calculation model is shown in the figure 2.
function scr = CalculateSCR(img, pos, t_size, d)
%%  Functional specifications : Calculate the... Of weak and small targets SCR
%%  Parameter description : img --  Original image 
%            pos --  The position of the target in the original image 
%            t_size = [a,b]--  Target size 
%            d --  Target neighborhood radius , The final calculated target and the size of its local area are (2d+a)*(2d+b)
   
    % 1.  Go to grayscale 
    if(size(img,3)>1)
        img = rgb2gray(img);
    end
    
    % 2.  The target size is a*b
    a = t_size(1);
    b = t_size(2);
    T = img(ceil(pos(1)-b/2):ceil(pos(1)+b/2), ceil(pos(2)-a/2):ceil(pos(2)+a/2));
    
    % 3.  The target and its surrounding neighborhood , The size is (a+2d)*(b+2d) 
    B = img(ceil(pos(1)-b/2-d):ceil(pos(1)+b/2+d), ceil(pos(2)-a/2-d):ceil(pos(2)+a/2+d));
    B(d:d+b,d:d+a) = 0;
    
    % 4.  Display the target image and background image respectively 
    figure
    imshow(T);title('Target');
    figure
    imshow(B);title('Background');
    
    % 5.  Calculate the gray mean value of the target respectively 、 The gray mean and standard deviation of the background 
    T_avg = mean(T(:));
    B_avg = sum(B(:)) / ((a+2*d)*(b+2*d) - a*b);
    size(B)
    B_1 = B(1:d,:);
    B_2 = B(a+d+1:a+2*d,:);
    B_3 = B(d+1:d+a, 1:d);
    B_4 = B(d+1:d+a, d+b+1: 2*d+b);
    
    B_final = [B_1(:)',B_2(:)',B_3(:)',B_4(:)'];
    size(B_final);
    B_std = std(double(B_final));
    
    % 6.  Calculation SCR
    scr = abs(T_avg - B_avg)/B_std;
end

                                                                chart 4 Original picture 、 Target image and local background image ,

                              The size of the original image here is (150,200), The manually selected target location is pos=(80,108), The target size is t_size=(4,4),d = 10.

3、 ... and 、 Average signal-to-noise ratio (Average SCR, \overline{SCR})

When (1) There are multiple targets in a picture ;(2) When there are multiple targets in the image sequence , The average signal to clutter ratio of the target is used to evaluate the difficulty of multi-target detection and the performance of the algorithm .

The average signal to clutter ratio is defined as :      \overline{SCR} = \frac{1}{N} \sum^{N}_{i=1}{ SCR_i}   …………………… The formula (2)

In style ,N Indicates the number of targets ;SCR_i It means the first one i The signal to clutter ratio of three goals .

The literature [1] in , Also used \overline{SCR_d},\quad\overline{SCR_l}  Respectively represent the average signal to clutter ratio of the detected real target and the undetected real target . Usually , When the detection false alarm rate is determined ,\overline{SCR_d},\quad\overline{SCR_l} The smaller it is , The better the detection performance of the algorithm .

Four 、ROC curve

Weak small target detection ROC Curve and machine learning ROC The curve definition is slightly different .

Weak small target detection ROC curve , With false alarm rate (false-rate, FA) Is the horizontal axis , At the detection rate (Probability of detection, PD) For the vertical axis (FA,PD See part I for the definition of ).

Usually , When the false alarm rate is the same , The higher the detection rate , The better the performance of the algorithm .

                                                                                                chart 5 Different algorithms ROC Curve contrast , Excerpt from [1]

draw ROC The curve is not difficult , The difficulty lies in the need to obtain data through experiments —— The detection rate of different algorithms under the same false alarm rate .

Here is given MATLAB A simple example of drawing a line chart , Contains some tips : Set up x, y The spacing of the axes ; Set lineweight and line style ; Set up x, y Axis description

x = 0:0.5:15;

%%  Here we need to replace it with the experimental results 
Pd_1 = 1 - exp(-x) ;
Pd_2 = 1 - exp(-1/2*x);

%  Set the display style and lineweight LineWidth
plot(x, Pd_1, '-ob', 'LineWidth', 2);
hold on
plot(x, Pd_2, '-*r', 'LineWidth', 1);

%  Set the axis range 
axis([0,15,0,1]);
%  Set the coordinate axis range and interval 
set(gca, 'XTick', [0:5:15]);
set(gca, 'YTick', [0:0.1:1]);

%  Show Legend 
legend('method_1', 'method_2');

%  Display axis description and title 
xlabel('False-rate, F_a');
ylabel('Probability of detection, P_d');
title(' Different algorithms ROC curve ');

                                                                                                      chart 6 ROC figure

reference

[1]   C. Gao et al., “Infrared Patch-Image Model for Small Target Detection in a Single Image,” vol. 22, no. 12, pp. 4996–5009, 2013.

原网站

版权声明
本文为[Strawberry sauce toast]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130540433540.html