# Impulsive Noise Removal with an Adaptive Weighted Arithmetic Mean Operator for Any Noise Density
## 3 Weighted Arithmetic Mean Based Fuzzy Filter Algorithm
### Noise Detection Phase Based on Fuzzy Open-Close Operators
The authors pointed out that if the VIF is applied to the original image and to a linear contrast enhancement of it with no added noise, then VIF returns a value larger than unity. To compute the VIF measure we follow the steps outlined in [31]. ### Parameter Selection

In this section, some experiments are carried out to determine the best parameter values of the algorithm according to the considered performance measures. #### 4.3.1 Noise Detection Function

The performance of the AWAM noise detection function was deeply studied in [14] according to the values of the threshold \(t\). In this section, a comparison with other known noise detection functions is performed. Namely, the noise detection functions introduced in [2] (OCS), [3] (Fabijanska) and [13] (c-FMMOCS) are considered and their performance is compared with respect to two configurations of the AWAM noise detection function: both with \(N=5\); \(T=T_{\mathbf{M}}\) and \(I=I_{\mathbf{GD}}\), i.e., the minimum t-norm and its residual implication, the Godel implication, given by

\[T_{\mathbf{M}}(x,y)=\min\{x,y\},\quad I_{\mathbf{GD}}(x,y)=\left\{ \begin{array} []{ll}1,&\text{if }x\leq y,\\ y,&\text{if }x>y;\end{array} \right.\]

\(B\) a flat structuring element with an squared shape of size 5 (a \(5\times 5\) matrix of 255 values) and one with \(t=0\) and the other one with \(t=10\). To evaluate the performance we compute the values of \(F_{1}\), Accuracy and the False Positive Rate (FPR) obtained by the aforementioned noise detection functions in the training set images, as three examples of well-known performance measures in binary classification tasks. In Figure 3 we show the evolution of the mean value of these measures with respect to the noise density. It is clear from the figure that both configurations of the AWAM noise detection functionsoutperform heavily the other noise detection functions at low noise densities while all the noise detection functions obtain similar results for high densities. Therefore, we will consider the configuration with \(t=10\) as the best configuration of the parameters for this noise detection function. #### 4.3.2 Noise Filter

Using the performance measures introduced in Section 4.2 and the training set of images, we found the best parameters of the AWAM filter for each level of noise between 5% and 98%. These parameters are:

* the considered distance, where \(d=1\) corresponds to Manhattan distance, \(d=2\), to Euclidean distance and \(d=3\), to infinity distance. * the value of the exponential base of the weights \(w_{k}\) in Expression (3). * the number of noncorrupted pixels in the neighborhood of the considered pixel needed in order to do the aggregation. To find the optimal values of the parameters, a 3-D grid of possible values of the three parameters is considered, where \(d\in\{1,2,3\}\), \(\beta\in\{1.25+0.25\cdot i,\;i\in\{0,\ldots,7\}\}\), \(n\in\{3,\ldots,10\}\) (It is possible that the algorithm is unable to find the minimum quantity of non-noisy pixels to restore a noisy pixel even when the search window increases till the whole image. This will happen when the algorithm is applied to small images corrupted with high-density noise. In this case, the WAM operator is applied to the non-noisy pixels that were found even when the minimum quantity has not been reached). The \(\beta\) and \(n\) values included in the grid were chosen in order to guarantee a reasonable exponential decay of the weights of the WAM operator and a reasonable minimum quantity of non-noisy pixels to aggregate to restore a noisy pixel. For each similarity measure, and for each value of the grid, we find the mean of the values of the similarity measure for all the images of the training database and we select the value of the grid that obtains the best mean value for this similarity measure. The optimal value of these parameters for each noise level are shown in Table 1. As seen in the table, as the noise level increases, the optimal value of the parameter \(n\) also grows according to all the considered similarity measures.