A Hyperspectral Anomaly Detection Algorithm Based on Morphological Profile and Attribute Filter with Band Selection and Automatic Determination of Maximum Area

Anomaly detection is one of the most challenging topics in hyperspectral imaging due to the high spectral resolution of the images and the lack of spatial and spectral information about the anomaly. In this paper, a novel hyperspectral anomaly detection method called morphological profile and attribute filter (MPAF) algorithm is proposed. Aiming to increase the detection accuracy and reduce computing time, it consists of three steps. First, select a band containing rich information for anomaly detection using a novel band selection algorithm based on entropy and histogram counts. Second, remove the background of the selected band with morphological profile. Third, filter the false anomalous pixels with attribute filter. A novel algorithm is also proposed in this paper to define the maximum area of anomalous objects. Experiments were run on real hyperspectral datasets to evaluate the performance, and analysis was also conducted to verify the contribution of each step of MPAF. The results show that the performance of MPAF yields competitive results in terms of average area under the curve (AUC) for receiver operating characteristic (ROC), precision-recall, and computing time, i.e., 0.9916, 0.7055, and 0.25 s, respectively. Compared with four other anomaly detection algorithms, MPAF yielded the highest average AUC for ROC and precision-recall in eight out of thirteen and nine out of thirteen datasets, respectively. Further analysis also proved that each step of MPAF has its effectiveness in the detection performance.


Introduction
A hyperspectral image (HSI) is an image cube that consists of hundreds of spatial images of a particular space with different spectral information. It has better spectral information than a multispectral image because of its large number of narrow spectral bands [1]. Its rich information opens the possibility to differentiate several objects of interest based on their spectral signatures. Therefore, it is widely used in many remote-sensing research fields, such as spectral unmixing [2][3][4], target detection [5][6][7], and classification [8][9][10].
Target detection methods in HSI are mainly classified into supervised and unsupervised categories, based on the utilization of prior information. Anomaly detection is an unsupervised target detection method that aims to identify interesting objects that are different from their surroundings, in terms of spatial and spectral domain, without any prior information about the objects [11][12][13]. These objects anomaly detection but also to reduce the computing time of the algorithm. For the second fact, a morphological profile was used to extract the anomalous pixels and an attribute filter was used to filter the false anomalous pixels. Even though we can use an attribute filter to extract the anomalous pixels, it relies on the gray-level thresholds to label pixels in the image before extracting the anomalous pixels. The more complex the image is, the more ineffective it becomes. Meanwhile, the morphological profile extracted anomalous pixels in the image based on their neighborhood, but it was ineffective for removing large objects. Combining the morphological profile and the attribute filter for anomaly detection will improve the detection accuracy because they complement each other. Moreover, in order to address the issue of previous methods also based on the attribute filter, we propose an algorithm to automatically determine the maximum area of the anomaly.
Instead of using spectral signatures from all bands, several anomaly detection methods ( [30,[36][37][38]) applied band selection algorithm to reduce the spectral dimension, remove redundant and interference bands, and as a result, decrease false alarm rate. The selected bands had more discriminative features for anomaly than the discarded bands. This selection gave a positive effect on the performance of the subsequent detection algorithm and reduced the computational complexity. In this work, instead of spectral signatures, we used HSI data's entropy as a means to observe the information quantity of the HSI bands. Entropy is a quantitative metric of the information contained in an image. This gave us a subset of prospective bands to represent the anomalies using a particular threshold. Since anomalies were much smaller than the background, we further selected one band from this subset using an algorithm based on the histogram that ensured the spatial characteristic between anomalies and the background. In addition, the subsequent step dealt with the algorithm to determine the maximum area of anomalies due to this spatial characteristic. Hence, even if there was a false anomalous pixel due to its same signature as the anomaly's in the selected band, this algorithm can detect and remove it based on this spatial requirement. This paper shows that our proposed approach yielded superior results on thirteen datasets that are often used as a benchmark in HSI anomaly detection.
The contribution of this work is developing a new approach for HSI anomaly detection that combines two conventional techniques in image processing, added with new algorithms for band selection and determining the maximum area of anomalies. In the first step, the band selection contributes to less computing time while preserving the most representative band based on the entropy and histogram. Even though we applied conventional techniques for the next steps, we found that the results could be improved by suppressing the false-positive cases. Hence, in the filtering step, we propose the algorithm to determine the maximum area of anomalies automatically, that differs from previous works [30][31][32][33] in terms of automated fashion. This paper shows that the proposed algorithm increased detection performance by avoiding false-positive results.
The rest of this paper is organized as follows. Section 2 reviews the morphological profile and attribute filter. Section 3 describes the detail of the proposed method in this paper. Section 4 shows the parameter settings, results, and our respective analyses. Finally, Section 5 is the conclusion of this study.

Morphological Profile
A morphological profile consists of an opening profile and a closing profile [39], which are created based on mathematical morphology. A mathematical morphology [40] is a set of operations that processes objects in an image based on their shapes. Each pixel in the image is processed based on the value of other pixels in its neighborhood. The neighborhood is defined by the shape and size of the structuring element SE. There are two basic operations in mathematical morphology, i.e., erosion and dilation. Erosion ( ) is defined as a local minimum operator. It selects the minimum value between the manipulated pixel and its neighborhood. On the contrary, dilation (⊕) is defined as a local maximum operator. It selects the maximum value between the manipulated pixel and its neighborhood: (1) where D SE is the domain of SE and f is a grayscale image with indexes of spatial dimensions x and y. Erosion tends to remove bright pixels while dilation tends to remove dark pixels. Other operations of mathematical morphology are called opening and closing, which are derived from erosion and dilation. Opening (ImO) and closing (ImC) are defined as follows: Opening tends to remove bright pixels but is less destructive than erosion. Meanwhile, closing tends to remove dark pixels but is less destructive than dilation.

Attribute Filter
An attribute filter is an adaptive filter introduced by Breen and Jones [41]. It can preserve or remove connected components in an image based on a predefined attribute such as area, standard deviation, the moment of inertia, etc. Here, we briefly describe how the attribute filter worked. Refer to [35] for a detailed explanation.
Binary attribute thinning Γ C is defined as a filter that removes connected components of true pixels, called a binary connected opening, that does not fulfill criterion C. For example, if given C is the area that contains more than 25 pixels, Γ C preserves only the connected components that have more than 25 pixels and removes the others. Whereas, binary attribute thickening Φ C is defined as a filter that removes connected components of false pixels, called binary connected closing, that does not fulfill criterion C.
A grayscale image can be represented as a stack of binary images obtained by thresholding the grayscale image at each of its gray levels. The connected components of a grayscale image are built based on this set of gray levels. If given a set of gray levels g, ranging on the gray levels of f , grayscale attribute thinning γ C and thickening φ C can be defined as follows: where Thresh( f , G) is the binary image obtained by thresholding f at gray level G. In other words, grayscale attribute thinning removes connected components of bright pixels that do not fulfill the criterion C and grayscale attribute thickening removes connected components of dark pixels that do not fulfill the criterion C. not fulfill the criterion . Figure 1 shows that the proposed method, i.e., morphological profile and attribute filter (MPAF), consisted of three steps: (1) selecting a band based on entropy and histogram counts; (2) background removal with the morphological profile (MP); and (3) filtering the image with the attribute filter (AF).

Entropy-and Histogram-Based Band Selection
There were three purposes of this band selection. The first was to classify the selected band as a bright-anomaly (BA) or dark-anomaly (DA) band. Bright-anomaly means the anomaly is shown as bright pixels in the image. Dark-anomaly means the anomaly is shown as dark pixels in the image. The second was to select the most effective band for anomaly detection. The third aimed to reduce computing time.
The adjacent bands of the HSI are highly correlated [30]. Processing all the bands will be inefficient. Therefore, the first step of the proposed band selection was sampling the band in the HSI I as follows: where B k is the index of the band to sample, t is the sampling interval, u is the starting band of the sample image, and X k is the kth sample image. Reducing the spectral resolution will reduce the computational cost. The second step was classifying each sample image as BA or DA and filtering them based on the most frequent classification. In this step, each sample image X k was normalized as follows: where X i k is pixel i of X k ,X is the normalized image, X k is the mean of pixels in the image X k , and σ X k is the standard deviation of pixels on the image X k .
The normalized image made a clear differentiation between background pixels and anomalous pixels. Figure 2 shows the differentiation between the data before and after normalization. Anomalous pixels are shown as small objects in the image, and the other pixels are background pixels, either in images before or after normalization. The histograms after normalization, however, are shifted and expanded so that it is more reliable to take a threshold to define whether the images belong to the band with BA (Figure 2a,b) or DA (Figure 2c,d). Let α denote the threshold to define extreme-bright pixels (whose values v ≥ 1 − α), and extreme-dark pixels (whose value v ≤ α). Then, each sample image was then classified as follows: where B BA is the bright-anomaly band flag, B DA is the dark-anomaly band flag, α is the classification threshold, and q v is the normalized histogram counts at pixel value v.  In order to avoid using bands that contain noise, the samples were filtered using entropy ( ). Entropy was used to measure the information contained in the image. The filtered images ( ) were The sample images were then filtered as follows: where XC is a matrix that contains filtered images, X BA = {X k |B BA = 1} and X DA = {X k |B DA = 1}. X BA is a matrix that contains bright-anomaly images, and X DA is a matrix that contains dark-anomaly images.
In order to avoid using bands that contain noise, the samples were filtered using entropy (H). Entropy was used to measure the information contained in the image. The filtered images (XH) were calculated as follows: where q is the normalized histogram counts and XC j is the jth element of XC. H I is the mean of entropy of all bands in I, and σ H I is the standard deviation of entropy of all bands in I. Figure 3 shows that bands with very low entropy, i.e., bands 148, 156, and 204, cannot be used for anomaly detection. Meanwhile, the other band with average entropy, i.e., band 6, can be used for anomaly detection. The band was then selected as follows: where XS is the selected band and β is a selection coefficient. The image with the above condition will have more background pixels. Thus, this condition will improve the detection rate when using a morphological profile to detect anomalies.

Background Removal
Anomalies are shown as small dark or bright objects in the image. MP was used to detect these objects. Anomalies can be detected by the following equations: where R is the resulting image and se1, which represents the width of the anomaly, and se2 is the width of square SEs. Opening removes small objects from bright pixels and closing removes small objects from dark pixels. Therefore, Equation (16) results in anomalous objects.

Area Filtering
Even though we can detect objects with MP, the shape of SEs is fixed [39]. They are ineffective on non-compact shapes, especially on large objects. Therefore, AF was used to filter these objects: where D is the differential map, κ is the maximum area of anomalous objects, O is the output of the filter, is element-wise multiplication, and se3 is the width of square SE. The criteria used in both attribute filters (γ and φ) is area > κ, which means they will keep the connected components whose area is greater than κ. Therefore, the differential map obtained by Equation (17) will remove the objects whose area is greater than κ. Since D is used for filtering, dilating it with se3 will expand each area on D to avoid losing anomalous pixels during the AF process.

Area of Anomaly
In previous works [30][31][32][33], the limitation of using AF was that the methods need to set the κ manually. Therefore, in this paper, we proposed a novel method to automatically set not only the κ but also the se1.
Anomalous objects in an image usually appear as small objects and have a similar area. We can differentiate the anomalous objects from the background even though they have a similar spectral reflectance. Based on these assumptions, if given a set of areas of suspected anomalous objects, we can model this set as a normal distribution. Thus, we can calculate the maximum area of anomalous objects statistically. Furthermore, to optimize the detection using MP with square SE, the width of SE should be equal to the width of the smallest square containing the anomalous object. It is equivalent to the maximum value between the width and height of the smallest box containing the anomalous object (bounding box).
To extract the suspected anomalous objects from the image, we proposed using differential map D like in Equation (17). In [33], the optimal value for the maximum area of anomalous objects was set to be N/100 pixels, where N is the number of pixels in HSI. Based on this, D was first calculated with κ equal to N/100. The Boolean map BW was then obtained by thresholding the D as follows: where θ is the threshold of the image. The value of θ is set with Otsu's method [42] due to its robust performance. The connected components in BW represent the suspected anomalous objects. Each connected component in BW can be labeled. Then, we can get the area of each connected component and the width and height of each connected component's bounding box.
We let A be the areas of connected components in BW and W be a set of widths and heights of connected components' bounding boxes. κ and se1 are calculated as follows:

Data
In this paper, the proposed method was evaluated on real datasets that have been made available online [43], i.e., Airport-Beach-Urban (ABU) datasets. The data were manually extracted from images of the Airborne Visible/Infrared Imaging Spectrometer (AVIRIS), except for ABU-Beach-4, which was manually extracted from the image of the Reflective Optical System Imaging Spectrometer (ROSIS-03). Each dataset had a reference map that has been manually labeled. Table 1 describes some features of these images.

Results
The performance of MPAF was evaluated with the most widely used metrics, area under the curve (AUC), and the receiver operating characteristic (ROC) [44]. To verify the performance of the proposed method, other methods, i.e., RX [20], FrFE-RX [24], AED [33], and SDBP-D [29] (SDBP with dual window) detectors, were used for comparison. These methods were either frequently cited in the literature or recent algorithms for HSI anomaly-detection applications.
To generate the results in Table 2, optimal parameters of FrFE-RX, AED, SDBP-D methods were selected for each image to get the best AUC. For FrFE-RX, the fractional-order (p) was selected by varying it from 0-1. Since the same datasets were used in AED, we set the maximum area of the anomaly (κ) for each dataset as the same as the values recommended in [33]. The other parameters of AED were kept at AED's default parameter setting, i.e., λ = N/100, σ s = 5, σ s = 0.5, and M = 3. Similarly, for SDBP-D, we used the values recommended in [29] to set the window size (ω in and ω out ) and the percentage of the highest selected density value (P).
For the proposed method, a default parameter setting (t = 10, u = 5, α = 0.15, β = 0.04, se2 = 1, and se3 = 3) was used for most of the datasets, which will be discussed in the next subsection. This setting could achieve acceptable performances for most of the datasets. If only a small number of bands or no band can represent all anomalous pixels in the reference map, the se2 needed to be adjusted. Specifically, for the ABU-Airport-1 and the ABU-Beach-4 datasets, the se2 was set as se2 = 3. Table 2. Area under the curve (AUC) values of receiver operating characteristic (ROC) curves for the compared methods, i.e., morphological profile and attribute filter (MPAF), Reed-Xiaoli (RX), fractional fourier entropy RX (FrFE-RX), attribute and edge-preserving filters detector (AED), and spatial density background purification with dual window (SDBP-D) on the ABU datasets. Bold numbers are used to highlight which score is the best among others in a row.

Airport
As shown in Table 2, the MPAF method achieved the best scores on 61.5% of the datasets (8 out of 13 datasets). The average AUCs of the MPAF method on each ABU dataset were 0.9816, 0.9971, and 0.9962, respectively, and the average of all datasets reached 0.9916. Even though the MPAF method ranked second on the ABU-Airport datasets, the difference was only 0.0076, which is very low. The proposed method also achieved the best score on 50% of the ABU-Airport datasets. The result of the proposed method was also stable, as the minimum AUC score was 0.9718 (ABU-Airport-1). The FrFE-RX method showed better performances than the RX method in most cases, which was consistent with the results reported in [24]. Despite those results, the FrFE-RX's AUCs still could not match the MPAF's AUCs in all cases. Both the AED and the SDBP-D method performed well, but still less effectively than the proposed method. Figures 4-6 show the results obtained by the compared methods for the three scenes. As shown in those figures, anomalous objects can be easily recognized on the MPAF and the AED detection maps visually. On the contrary, it is harder to recognize anomalous objects on the RX and the FrFE-RX detection maps. Most of the MPAF results had fewer false anomalous pixels compared to the AED or the other methods. This means that the attribute filter with the determination of anomaly area proposed     Although the performance of AED was relatively stable, its AUC score was very low, i.e., 0.789, on the ABU-Urban-2 dataset. It was the result of performing image dilation before performing its filtering function. As shown in Figure 6, the anomalous objects were very close to each other. Two or more anomalous objects merged into one after the image dilation step. As a result, the area of the merged objects was greater than the threshold of the filtering function. Meanwhile, our proposed algorithm avoided this drawback by the step to determine the area of anomaly. Although the performance of AED was relatively stable, its AUC score was very low, i.e., 0.789, on the ABU-Urban-2 dataset. It was the result of performing image dilation before performing its filtering function. As shown in Figure 6, the anomalous objects were very close to each other. Two or more anomalous objects merged into one after the image dilation step. As a result, the area of the merged objects was greater than the threshold of the filtering function. Meanwhile, our proposed algorithm avoided this drawback by the step to determine the area of anomaly. Although the performance of AED was relatively stable, its AUC score was very low, i.e., 0.789, on the ABU-Urban-2 dataset. It was the result of performing image dilation before performing its filtering function. As shown in Figure 6, the anomalous objects were very close to each other. Two or more anomalous objects merged into one after the image dilation step. As a result, the area of the merged objects was greater than the threshold of the filtering function. Meanwhile, our proposed algorithm avoided this drawback by the step to determine the area of anomaly. Figures 7-9 show the ROC curves of different methods, i.e., the MPAF, RX, FrFE-RX, and AED methods, for anomaly detection using the ABU datasets. The probability of the detection of MPAF is always greater than 0.9 before the false-alarm rate reaches 0.1. It means that for a low false-alarm rate, the result of the proposed method has promising results.
Remote Sens. 2020, 12, x FOR PEER REVIEW 13 of 22  show the ROC curves of different methods, i.e., the MPAF, RX, FrFE-RX, and AED methods, for anomaly detection using the ABU datasets. The probability of the detection of MPAF is always greater than 0.9 before the false-alarm rate reaches 0.1. It means that for a low false-alarm rate, the result of the proposed method has promising results.    9 show the ROC curves of different methods, i.e., the MPAF, RX, FrFE-RX, and AED methods, for anomaly detection using the ABU datasets. The probability of the detection of MPAF is always greater than 0.9 before the false-alarm rate reaches 0.1. It means that for a low false-alarm rate, the result of the proposed method has promising results.    In observation, since imbalanced datasets may occur between anomaly and background classes, we also evaluated the performance using precision-recall curve. Instead of using the F1-score that summarizes a method's performance for a specific probability threshold, a precision-recall curve provided the performance across different thresholds by its AUC. Figures 10-12 depict the precisionrecall curves of the compared methods for Airport, Beach, and Urban datasets, respectively. Table 3 shows the AUC values of each curve. One can see that MPAF outperformed the other methods in most cases, i.e., nine out of thirteen datasets with the average value reached 0.7055, which is 0.1080 higher than the second-best method, i.e., AED. Based on these results and the definition of precision and recall, it implies that MPAF was the best approach among others in predicting positive anomalies while reducing false ones and capturing the actual anomalies on the scenes.  In observation, since imbalanced datasets may occur between anomaly and background classes, we also evaluated the performance using precision-recall curve. Instead of using the F1-score that summarizes a method's performance for a specific probability threshold, a precision-recall curve provided the performance across different thresholds by its AUC. Figures 10-12 depict the precision-recall curves of the compared methods for Airport, Beach, and Urban datasets, respectively. Table 3 shows the AUC values of each curve. One can see that MPAF outperformed the other methods in most cases, i.e., nine out of thirteen datasets with the average value reached 0.7055, which is 0.1080 higher than the second-best method, i.e., AED. Based on these results and the definition of precision and recall, it implies that MPAF was the best approach among others in predicting positive anomalies while reducing false ones and capturing the actual anomalies on the scenes. In observation, since imbalanced datasets may occur between anomaly and background classes, we also evaluated the performance using precision-recall curve. Instead of using the F1-score that summarizes a method's performance for a specific probability threshold, a precision-recall curve provided the performance across different thresholds by its AUC. Figures 10-12 depict the precisionrecall curves of the compared methods for Airport, Beach, and Urban datasets, respectively. Table 3 shows the AUC values of each curve. One can see that MPAF outperformed the other methods in most cases, i.e., nine out of thirteen datasets with the average value reached 0.7055, which is 0.1080 higher than the second-best method, i.e., AED. Based on these results and the definition of precision and recall, it implies that MPAF was the best approach among others in predicting positive anomalies while reducing false ones and capturing the actual anomalies on the scenes.

Computing Time
In this paper, the computing time of the MPAF is also compared with the other methods. All methods were executed using MATLAB on a computer with Intel(R) Core(TM) i5-4300U CPU and 16 GB RAM. The results are shown in Table 4. It was shown that the proposed method's time is quite fast, ranking second after the RX method. The differences were not too significant (0.03-0.11 s). Moreover, even though the RX method was fast, the AUC results of this method were far less accurate than the AUC results of the proposed method. As expected from the FrFE-RX method, even though it is a modification of the RX method, it required a lot of time to process the datasets and to select the optimum fractional-order, since this process is pixel-based and is done for each band. The computing time of the proposed method should be acceptable since it had promising results. Bold numbers are used to highlight which score is the best among others in a row.

Component Analysis
This subsection analyzes the influence of different parameters on the performance of the MPAF method, the effectiveness of its band-selection method, and the effect of the MP and AF combination on the detection method. These parameters were the maximum area of the anomalous objects κ and the width-of-square SEs, i.e., se1, se2, and se3. AUC was used to evaluate the performance of the MPAF method under different parameter settings. Figure 13 shows the average AUCs of the MPAF on each dataset under the influence of different parameter settings. When analyzing the influence of one parameter, the other parameter was set with the default parameter settings t = 10, u = 5, α = 0.15, β = 0.04, se2 = 1, and se3 = 3. Both κ and se1 were set automatically when analyzing se2 and se3, since they did not depend on other parameters but images. Either κ or se1 was set automatically when analyzing one of these parameters.
As shown at the top of Figure 13, the AUCs depended on the area of the anomaly in the MPAF method, i.e., and 1. The average of AUCs increased from zero before they saturated on a particular value. If either was less than the area of the anomaly or 1 was less than the width of the anomaly, the accuracy of detection was low. It means that the proposed algorithm for setting and 1 was proved to be effective since the AUCs in Table 2 were above 0.97. Furthermore, in a particular case, e.g., ABU-Urban-3, some objects had the same reflectance value as the anomaly. Therefore, if either was greater than the area of the anomaly or 1 was greater than the width of the anomaly, some false anomalous pixels were detected and reduced the AUC of MPAF, as shown in Figure 14. The bottom left of Figure 13 shows the influence of 2 over the detection performance. In the ABU-Urban and ABU-Beach cases, increasing 2 decreased detection performance. This meant that in most cases, the dilation step with 2 was not needed, since 2 = 1 means there was no dilation. In the ABU-Airport case, Figure 15a shows the influence of 2 over AUCs for all the ABU-Airport Figure 13. Influence of the parameters, κ, se1, se2, and se3 over the MPAF performance.
As shown at the top of Figure 13, the AUCs depended on the area of the anomaly in the MPAF method, i.e., κ and se1. The average of AUCs increased from zero before they saturated on a particular value. If either κ was less than the area of the anomaly or se1 was less than the width of the anomaly, the accuracy of detection was low. It means that the proposed algorithm for setting κ and se1 was proved to be effective since the AUCs in Table 2 were above 0.97. Furthermore, in a particular case, e.g., ABU-Urban-3, some objects had the same reflectance value as the anomaly. Therefore, if either κ was greater than the area of the anomaly or se1 was greater than the width of the anomaly, some false anomalous pixels were detected and reduced the AUC of MPAF, as shown in Figure 14.
The bottom left of Figure 13 shows the influence of se2 over the detection performance. In the ABU-Urban and ABU-Beach cases, increasing se2 decreased detection performance. This meant that in most cases, the dilation step with se2 was not needed, since se2 = 1 means there was no dilation. In the ABU-Airport case, Figure 15a shows the influence of se2 over AUCs for all the ABU-Airport datasets. It clearly shows that only ABU-Airport-1 needed the dilation step. Furthermore, at se2 = 1, Figure 15b shows that the maximum of AUCs was 0.8919. This means that the MPAF detected most of the anomaly locations, but not the entire area of each detected anomaly. After the dilation step, the detected anomalous objects were expanded, thus increasing the detection accuracy.
the anomaly, the accuracy of detection was low. It means that the proposed algorithm for setting and 1 was proved to be effective since the AUCs in Table 2 were above 0.97. Furthermore, in a particular case, e.g., ABU-Urban-3, some objects had the same reflectance value as the anomaly. Therefore, if either was greater than the area of the anomaly or 1 was greater than the width of the anomaly, some false anomalous pixels were detected and reduced the AUC of MPAF, as shown in Figure 14. The bottom left of Figure 13 shows the influence of 2 over the detection performance. In the ABU-Urban and ABU-Beach cases, increasing 2 decreased detection performance. This meant that in most cases, the dilation step with 2 was not needed, since 2 = 1 means there was no dilation. In the ABU-Airport case, Figure 15a shows the influence of 2 over AUCs for all the ABU-Airport datasets. It clearly shows that only ABU-Airport-1 needed the dilation step. Furthermore, at 2 = 1, The bottom right of Figure 13 shows the influence of 3 over the detection performance. As expected, the AUCs increased when 3 was increased to a certain value, i.e., 3 = 3. The dilation of the attribute filter expanded the objects in the image. Thus, the objects covered the lost pixels, which were caused by the AF process. The performance went down as 3 was increased further, causing the objects to expand too much. Some false anomalous pixels were detected and reduced the AUC of MPAF.

Band Selection Effectiveness
To analyze the effectiveness of the proposed band selection, we compared the AUCs in Table 2 with the best AUCs of the MPAF without the band selection. The best AUCs were obtained by running the MPAF on each band of each dataset with the same parameter setting as the one that produced the AUCs in Table 2. Then we selected the maximum AUCs from each dataset. This comparison is shown in Table 5. The average differences of the AUC on the ABU datasets were 0.005125, 0.000615, and 0.0008, respectively. Even though the band selection process cannot obtain the best result, its performance is still acceptable since the differences were very low while promoting an automatic process. Furthermore, the time consumed was also low because of the spectral resolution reduction due to this band-selection process.  The bottom right of Figure 13 shows the influence of se3 over the detection performance. As expected, the AUCs increased when se3 was increased to a certain value, i.e., se3 = 3. The dilation of the attribute filter expanded the objects in the image. Thus, the objects covered the lost pixels, which were caused by the AF process. The performance went down as se3 was increased further, causing the objects to expand too much. Some false anomalous pixels were detected and reduced the AUC of MPAF.

Band Selection Effectiveness
To analyze the effectiveness of the proposed band selection, we compared the AUCs in Table 2 with the best AUCs of the MPAF without the band selection. The best AUCs were obtained by running the MPAF on each band of each dataset with the same parameter setting as the one that produced the AUCs in Table 2. Then we selected the maximum AUCs from each dataset. This comparison is shown in Table 5. The average differences of the AUC on the ABU datasets were 0.005125, 0.000615, and 0.0008, respectively. Even though the band selection process cannot obtain the best result, its performance is still acceptable since the differences were very low while promoting an automatic process. Furthermore, the time consumed was also low because of the spectral resolution reduction due to this band-selection process.

MP and AP Effectiveness
To analyze the effect of MP and AF combination on the detection method, we compared the average AUCs of the MPAF in Table 2 with the average AUCs of the MPAF without MP and the MPAF without AF. As shown in Figure 16, the average AUCs of MPAF were always the highest, while the other two AUCs were inconsistent, depending on the datasets. In addition, we evaluated the statistics using a box plot, as shown in Figure 17. The first three boxes from the left correspond to Airport scenes that are performed by MPAF, MPAF without AF, and MPAF without MP, respectively. The following three boxes are for Beach, and the last three are for Urban scenes. One can see that compared with MP without AF and MP without AF, MPAF always showed the highest median values, least dispersed, and the highest minimum AUC values. It proved that combining MP and AF for anomaly detection improves the detection performance.

MP and AP Effectiveness
To analyze the effect of MP and AF combination on the detection method, we compared the average AUCs of the MPAF in Table 2 with the average AUCs of the MPAF without MP and the MPAF without AF. As shown in Figure 16, the average AUCs of MPAF were always the highest, while the other two AUCs were inconsistent, depending on the datasets. In addition, we evaluated the statistics using a box plot, as shown in Figure 17. The first three boxes from the left correspond to Airport scenes that are performed by MPAF, MPAF without AF, and MPAF without MP, respectively. The following three boxes are for Beach, and the last three are for Urban scenes. One can see that compared with MP without AF and MP without AF, MPAF always showed the highest median values, least dispersed, and the highest minimum AUC values. It proved that combining MP and AF for anomaly detection improves the detection performance.

Conclusions
In this paper, we proposed a new hyperspectral anomaly detection algorithm called MPAF, based on the conventional morphological profile and attribute filter that improved with novel band selection and maximum area determination algorithms. This approach uses entropy and histogram counts to reduce the spectral dimension of the hyperspectral image, applies the morphological profile to discard the background pixels, and the attribute filter with a proposed area determination Figure 17. Statistic of AUCs of ROC for different scenarios. From left to right, the first letter of the box's name: A, B, U denotes the datasets, i.e., Airport, Beach, and Urban, respectively, followed by M, MWOA, or MWOM which are for the scenarios, i.e., MPAF, MPAF without AF, and MPAF without MP, respectively.

Conclusions
In this paper, we proposed a new hyperspectral anomaly detection algorithm called MPAF, based on the conventional morphological profile and attribute filter that improved with novel band selection and maximum area determination algorithms. This approach uses entropy and histogram counts to reduce the spectral dimension of the hyperspectral image, applies the morphological profile to discard the background pixels, and the attribute filter with a proposed area determination algorithm to filter the false anomalous pixels. A sensitivity analysis was conducted and proved the effectiveness of each step of the method. The experiments on real hyperspectral images showed that MPAF achieved high detection performances, reaching 0.9916 on average and superiority in 61.5% of thirteen datasets, with only slight differences in 38.5% of cases. In addition, it involved less computing time, i.e., 0.25 s on average. The performance of MPAF in reducing false anomalous pixels was also proven by reaching the highest score in the area under precision-recall curves, which was 0.1080 points higher than that of the state-of-the-art method. This proves that the proposed method is suitable for high-resolution HSIs and offers higher performance than previous methods.