An Advanced AFWMF Model for Identifying High Random-Valued Impulse Noise for Image Processing

: In this study, a novel adaptive fuzzy weighted mean filter (AFWMF) model based on the directional median technique and fuzzy inference is presented for solving the restoring high-ratio random-valued noise in image processing. This study aims, not only to obtain information from each direction of the filtering window, but also to gain information from every pixel of the filtering windows completely. Thus, in order to implement preserving details and textures for better restoration in high-noise cases, this study utilizes the directional median to build the membership function in fuzzy inference dynamically, then calculates the weighted window corresponding to the filtering window using fuzzy inference to represent the importance of valuable pixels. Finally, the restoration pixel is calculated using the weighted window and the filtering window for the weighted mean. Subsequently, this new AFWMF model significantly improves performances in the measurement of the peak signal to noise ratio (PSNR) value for preserving detail and fixed image in noise density within the range of 20–70% for the five well-known experimental images. In extensive experiments, this study also shows the better performance of identifying the proposed peak signal-to-removal noise ratio (PSRNR) and evaluating psycho-visual tests than other listed filter methods. Furthermore, the proposed AFWMF model also has a better structural similarity index measure (SSIM) value of another indicator. Conclusively, two interesting and meaning findings are identified: (1) the proposed AFWMF model is generally the best model among the 10 listed filtering methods for image processing in terms of the measurement of two quantitative indicators for both the PSNR and SSIM values; (2) different impulse noise densities should be made for different filtering methods, and thus, this is an important and interesting issue when aiming to identify an appropriate filtering model from a variety of images for processing various noise densities.


Introduction
Impulse noise frequently contaminates digital photographs. A sensor or a noisy transmission medium can pollute the source, making it inaccurate [1,2]. When an image is polluted, this means that some parts of the image are replaced by impulse noise [3,4]. There are two forms of noise in general. One form of noise is known as salt and pepper noise. It has a fixed value at both ends of the gray scale. In 8-bit grayscale, pixels contain noise values of 0 and 255. Another type is called uniform impulse noise or random-valued impulse noise. This noise will disperse its pixel values from 0 to 255 equally [5]. There have been several techniques used for removing salt and pepper noise, and some of them have proven to be effective [6][7][8][9]. However, many academic researchers are still interested in developing a random-valued impulse filter.
Many spatial filters have been developed for removing impulse noise. The most powerful spatial filter is the median filter [1,10,11]. By using this filter, we can remove the impulse noise from random values. The median filter replaces the filtering window's centered pixels with the filtering window's median. This filter applies a median operation for every pixel. Therefore, it modifies both undisturbed pixels and pixels with noise, and some detail which must be preserved in an image is removed [1]. Some modified median filters, such as the weighted median filter [12] and the center-weighted median filter [13], have been implemented to solve this problem. These two filters can operate effectively at low noise ratios but not at high noise ratios, since their performance in terms of spurious and missing detections is constrained [12]. This is resolved by using a switching median filter [13,14]. This filter is mainly used for noise median filtering and detection mechanisms. A threshold is used in the detection stage to detect whether the data are tainted [12]. The filtering process is executed only if the filter contains noise.
Later, various methods for reducing random-valued impulse noise were devised, such as the tri-state median filter [15], the directional weighted median filter [16], the modified switching median filter [17], the fuzzy-reasoning median filter [18], the simple adaptive median filter [19], the efficient decision-based algorithm [20], neural networks and fuzzy decisions [21], the elimination of impulse noise using an efficient algorithm [22], and threshold Boolean filtering [23], but these methods can fail at noise ratios over than 50 percent when using ranking order absolute difference [3,4] and adaptive switching median filters [12]. The above filters apply the standard median filter at the filtering stage. In general, the median filter could be poor when used with high noise ratios of over 50%. As a result, the adaptive fuzzy weighted mean filter (AFWMF) model is proposed to be used in this study for reducing and overcoming this problem, as it does not rely primarily on the median operation to replace noise.
The AFWMF model uses a directional median to preserve detail and calculate the weights of pixels in the filtering window with fuzzy rules. Each weight is represented as a pixel, which should provide useful information for restoration to enhance filtering performance. Fuzzy inference membership functions can change dynamically depending on the distribution of the filter window to manage random-valued impulse noise. As a result, it is expected that the AFWMF model will enhance filtering performance. In addition, the detection of the switching framework will affect the filter stage of the same framework directly. Therefore, this study modifies the ROR (robust outlyingness ratio) detection algorithm, using fuzzy rules to make the ROR algorithm more precise and powerful.
This study is structured in the following order. Section 2 reviews the ROR detection algorithm and filter order. Section 3 introduces the AFWMF model in detail. Section 4 summarizes the proposed algorithm of the AFWMF model. Section 5 contains the empirical results obtained, illustrating the accuracy of the novel method using multiple testing photos. Finally, conclusions are drawn in Section 5.

Related Work
This section reviewed some related works in this study, including filtering windows and tag windows, robust outlyingness ratio, sparsity ranking, and noise models.

Filtering Window and Tag Window
For handling our proposed method, a filtering window and a tag window were defined as follows. A matrix with the size (R× ) was built for the input image. The filtering window was a square matrix. It had odd (2 + 1) × (2 + 1) dimensions. It is represented as follows: where 1 ≤ ≤ , 1 ≤ ≤ , ≥ 1.
The corresponding binary tag matrix is the same size as . The sub matrix of is called tag window , ; its central pixel is at location ( , ), the same as , on the image, and it is formatted as: When , in Equation (1) was detected as a noisy pixel, , in Equation (2) was set to one; when , was not detected as a noisy pixel, , was set to zero.

Robust Outlyingness Ratio
In order to be more robust and effective, we used a type of coarse-to-fine strategy based on the iterative framework for detecting random-valued impulse noise [12,16,[24][25][26]. We used ROR to estimate whether the current pixel was a noise or not [16]. We briefly reviewed this algorithm as follows: • Coarse stage: 1. Let us consider parameters = 1 and , , as coarse thresholds. We initialized all of them with zeros in the tag matrix. 2. For every pixel in the image, we found its ROR; if it ranged in the fourth level, as shown in Table 1, then that pixel was noise-free. We set the tag to 1; else, we found the relative divergence d among the filtering window's median and active pixels. Then, based on the ROR value of d, we compared it to . We checked whether it was noisy or noise-free. We checked if d was bigger than . According to the r, we updated the tag matrix. 3. If ≤ , = + 1, then we repeated Step 2; else, this stage was completed.
• Fine stage: 1. Let us consider parameters = 1 and , , , as fine thresholds. We initialized all of them with zeros in the tag matrix. 2. For every pixel in the image, we found its ROR; if it ranged in fourth level, as shown in Table 1, then that pixel was noise-free. We set the tag to 1, or else found the relative divergence d among the filtering window's median and active pixel. Then, based on the ROR value of d, we compared it to . We checked whether it was noisy or noise-free. We checked if d was bigger than . According to the r, we updated the tag matrix. Similarly, we calculated the values for all the pixels. 3. If ≤ , = + 1, then we repeated Step 2; else, this stage was completed. and are shown in Table 2. For the ROR algorithm, the operation was carried out in two stages-i.e., detection followed by filtering. For detection, first the ROR was measured to find the impulse of each pixel; then, all the pixels were divided into four levels according to their ROR values.
Second, different decision rules were used to detect the impulse noise based on the absolute deviation from the median in each cluster. In order to make the detection results more accurate and robust, the from-coarse-to-fine strategy and the iterative framework were used for filtering. The structural flowchart of ROR is shown in Figure 1.

Sparsity Ranking
This study uses a method to determine filter order called Sparsity Ranking [27]. Its main idea is that it first selects the region to fix where the noisy ratio is lower, then it better handles more noisy ratio regions later. As the lower noisy ratio region has more uncorrupted pixels, it is easier to restore. Then, there are more useful pixels in the low ratio area for handling noise in more noisy regions.

Noise Model
When the image is polluted, part of the image will be replaced by impulse noise of a random value. The probability of this noise determines the degree of image deterioration. The noise model is given in Equation (3) below.
where is the noise ratio or probability of noise. , is the pixel value at i row and j column. , and , are pixel intensities of gray-scale images at position ( , ); they correspond to the original pixel and the noisy pixel, respectively. The pixel intensity of , is between maximum and minimum ([ , ] in an 8-bit gray-scale image, = 0, = 255). As a result, there are two forms of noise. One form of noise is known as salt and pepper noise. It has a fixed value at both ends of the gray scale. The other type is uniform impulse noise, which has a uniform distribution at [ , ] and is also known as random-valued impulse noise. The second sort of noise was examined in this research.

The Proposed Adaptive Fuzzy Weighted Mean Filter Model
The proposed AFWMF model can be divided into three stages. The first stage is the proposed detection method, which combines ROR and fuzzy rules to build a corresponding tag matrix. In the second stage, we use a filter order method called sparsity ranking [27]; its main idea and process have been discussed in the previous section. The last stage uses fuzzy rules to filter corrupted pixels according to a tag matrix from the first part, while the filtering order is from the second part. Figure 2 represents the system flowchart of the proposed model, and its key concepts and algorithm of main components are described in the next three subsections.

Fuzzy ROR Noise Detection
First, the stop iteration condition in the original ROR algorithm is defined as Equation (4).
where the represents the peak signal to noise ratio (PSNR) of the current iterative process, and represents the PSNR of the previous iterative process. These two PSNRs are compared with the original image; however, the process of restoration does not recognize the original image or the noisy image. Therefore, this study modifies PSNR for stopping iteration. This new stopping condition is called the peak signal-to-removal noise ratio (PSRNR); it can be calculated using fixed images of the previous iteration and the current iteration. PSRNR is defined by extensive experiments and shown as Equations (5) and (6): where is the iteration number, , is the image restoration pixel value in the previous iteration, , is the image restoration pixel value of the current iteration, is the current , and is the previous . By the above criteria, the noise detection skill is named the No-Reference ROR (NR-ROR) algorithm in this study.

Noise Cancellation by Adaptive Fuzzy Directional Weighted Mean
The algorithm we propose is akin to a switching median filter. This filter computes the local image from each picture pixel, rather than only utilizing the median to replace the noise, which is the main difference between our proposed novel method and this filter. More precisely, it utilizes standard deviation and fuzzy inference to estimate the restoration pixel value of the filtering window, where the output of fuzzy inference represents the importance of a pixel. For the above reasons, this filter method is called the AFWMF model in this study. The filtering started after the filtering order was determined as follows: let , ( ) ( = 1 4, = 2) be a set of four filtering windows directing pixels at one place (i,j). This is defined as follows: Accordingly, the standard deviation of four filtering window directions is calculated as shown in Figure 3, and the standard deviation measures the degree of data dispersion [28].
where , ( ) is the mean value of , ( ) and represents total number of elements in , ( ) .
Next, minimum standard deviation is formatted and given as follows: where , means that one of the four directions is closest to each other in the same direction. Therefore, the central pixel value of the window should also be close to them in order to preserve the image detail or texture. For preserving detail or texture, we obtain a reference median from , called , . It is formatted as Equation (10) below.
The standard deviation , of local windows is defined using Equation (11) below.
where , is the mean value of , . Afterwards, we form membership functions. There are three membership functions corresponding to three input fuzzy sets; they are nosie1, no-noise, and noise2, respectively, and are pictured in Figure 4. In Figure 4, the horizontal axis is a pixel value. On the vertical axis, the grade of membership of the element x in the fuzzy set is shown, with values ranging from 0 to 1. These three membership functions are three input fuzzy sets. They are formatted as Equations (12)- (14) below, respectively.
, is a reference value that can retain the details of the picture. , represents the grade of dispersion of the filtering window. Pixels of the window farther from , show that the importance of the pixel is lower; conversely, closer pixels indicate a higher importance. Then, there are two membership functions corresponding to two output fuzzy sets: low and high sets; these are displayed in Figure 5. In Figure 5, the horizontal axis is the importance value, and it ranges from 0 to 1. On the vertical axis, we have the membership function of a fuzzy set denoted by x, and this axis has values from 0 to 1. These two membership functions are output fuzzy sets. They are defined as Equations (15) and (16) below, respectively.
In this study, this characteristic is combined with fuzzy inference to decide the weight corresponding to the pixel. The output (the weight corresponding to the pixel) of the fuzzy inference of the proposed AFWMF model is based on three rules of filter stage as follows: Additionally, we can use the above rules to obtain weights. Subsequently, the restoration pixel value * is calculated and formatted as Equation (17) where is the weight corresponding to the pixel of filtering window, = 0 1, ∈ , , , = { , | − ≤ ≤ + , − ≤ ≤ + } , ∈ , . * is the restoration pixel value, which is regarded as the final output.
In order to preserve details or texture in image and overcome the weakness of median filters, we utilize weights from fuzzy inference. According to Equation (17), the filtering window's pixel values were multiplied by their associated weights to determine which degree of the pixel should be used to filter in the filtering process. The weight of pixel represents the degree of the , with its immediate surroundings; as a result, it will be utilized to regulate the level of restoration that takes place. Pixel weight indicates the level of importance of the pixel, and this characteristic decides how much useful information is needed for restoring.
Finally, the restoring pixel value is obtained with the weighted mean as the final output and shown as Figure 6, in which the number with an underline means that the pixel is corrupted by noise. Figure 7 shows the noise corruption for a light region. Figure 8 shows the member function according to Equations (10) and (11) for shifting their location. Figure 9 shows the noise corruption for a dark region. Figure 10 is the member function according to Equations (10) and (11) for shifting their location.

Algorithm of the Proposed AFWMF Model
The algorithm of proposed AFWMF model is summarized in detail below; this is an improved and enhanced version of the ROR algorithm.

•
The enhanced coarse stage includes the following six steps, as follows: 1. Choose parameters for = 1; initialize the flag matrix to all zero.
2. For every pixel in the image, find its ROR, the relative divergence d among the filtering window's median, and the active pixel. 3. Use the coarse stage of ROR described in Section 2.2 to detect the noise in the active pixel. Good and noisy pixels are represented by zeros and ones, respectively. 4. Following the use of Equations (7)- (14) to build the input membership function and according to three-rules-based filter stage described in Section 3.2, we obtain the pixel weights in a filtering window. 5. By obtaining the value of restoring pixels from Equation (17), let = + 1.
6. Use Equation (5) for judging and stopping the enhanced coarse stage; otherwise, go to Step 2.
• The enhanced fine stage includes the following six steps: 1. Choose parameters for = 1; initialize the flag matrix to all zeros.
2. For every pixel in the image, find its ROR, the relative divergence d among the filtering window's median, and the active pixel. 3. Use the fine stage of ROR described in Section 2.2 to detect the noise in the active pixel. Good and noisy pixels are represented by zeros and ones, respectively. (7)- (14) to build the input membership function. According to the three rules-based filter stage described in Section 3.2, obtain the pixel weights in the filtering window. 5. By obtaining the value of restoring pixel from Equation (17), let = + 1.

Use Equations
6. Use Equation (5) for judging and stopping the enhanced fine stage; otherwise, go to Step 2.

Experiment Results and Discussions
Initially, the estimate matrix for filters, including the mean square error (MSE) and the PSNR, is defined and determined using Equations (18) and (19), respectively. The MSE can be used to compute the PSNR, and the PSNR is a quantitative indicator for evaluating the performance of different filters. Importantly, the smaller the value of MSE is, the better the performance is. Conversely, the PSNR is bigger for a better performance. Moreover, this study uses another quantitative indicator, structural similarity index measure (SSIM), for further measuring the filtering performance, and its formula is defined as Equation (20) below. The SSIM value is an index that is mainly used to predict the perceived quality of digital images and measure the similarity between two images. The difference between the PSNR value and the SSIM value is that the former method estimates absolute errors, and the latter has the structural information that the pixels have strong inter-dependencies when they are spatially close to each other. More importantly, both the PSNR and SSIM values are effective evaluation standards from past studies.
= 10 255 , where R and C represent the dimensions of the image and × is the size of an image. O represents the original image and Y is the image that has been restored. The SSIM gives the similarity measurement between the original and restored image as in Equation (20), where and are the mean intensities of the original and restored images, and are the standard deviations of the original and restored images, is the covariance of the original image and restored image, is the dynamic range of the pixel values, and and are regularization parameters. To further verify the performance of the proposed AFWMF model, five famous testing pictures, including Lena, Peppers, Boat, Gold Hill, and Plane, respectively, are used in this study for the image-processing experiments. They are pictured in Figure 11, which was generated by an 8-bit grey level. All their resolutions are 512 by 512. In order to make the experiments more general and precise, this study conducted two experiment evaluations. One compared the PSRNR of the AFWMF model with the PSNRs of different filters; the other compared the psycho-visual result of the AFWMF model with the psycho-visual results of different filters. The different filters are addressed in BDND [9], DWM [16], EAIF [22], FRDFM [18], SBF [3], SDOOD [29], ROR [25], ASMF [12], and EBDND [30], since they were all identified to have good performances in the literature reviews in this area. The experimental results are described with measurement indexes in the next four subsections, and these results and the different filters are discussed in the last subsection.

Restoration Performance Measurements
This evaluation standard of the performance test uses Equation (19), and the Lena image is first used to compare the proposed AFWMF model with other filters proposed by other studies. The characteristic Lena image has an approximately normal distribution; that is to say that the detail, flat regions, shading, and texture are all included. Thus, the Lena image is an excellent comprehensive testing image for assessing restoration results and comparing restoration performance. Table 3 shows the comparison of the PSNR measurement values in the Lena image; the noise is set from 10% (i.e., 0.1) to 90% (i.e., 0.9). (Note: to lower the overabundance of figures and tables, this study only uses the empirical results of the Lena image as a representative of the demonstration here, but it uses a summary report of a table for completely concluding the results of the five images in this subsection.) From Table 3, it can be seen that the AFWMF model has a slightly worse PSNR value than that of the DWM and ROR filters in the low 10% noise density instance and high 80-90% noise density instance. However, the AFWMF model's PSNR value apparently outperforms the other filter techniques at higher ratios of 20% to 70% noise densities. Importantly, when the ratio of noise density is within 20-70%, the proposed AFWMF model significantly outperforms all the existing filters selected and used for the Lena image in this study. For processing the Lena image, it is ranked in the order AFWMF > DWM > ROR > ASMF > SDOOD > SBF > FRDFM > EAIF > BDND > EBDND in PSNR performance. The proposed AFWMF model is the best filtering model used for the Lena image. For further evaluating the performance of all the five images used in this study, Table  4 and Figure 12 show the additional comparisons of the PSNR average measurements for noise of 10% to 90%. From the above table and figure, this is ranked in the same order as the Lena image of AFWMF  DWM  ROR  ASMF  SDOOD  SBF  FRDFM  EAIF  BDND  EBDND in terms of the performance of the PSNR average value for the five images. Thus, this is effective evidence that the proposed AFWMF model has the best filter technique in this study. Furthermore, Table 5 presents the best filter model at different noise densities in the PSNR average value for the five experimental images. It is found that it is best to use the DWM model for a low 10% noise density, the ROR model for high 80% to 90% noise densities, and the AFWMF model for 20% to 70% noise densities.  (2) 13 (1) 4 4 The bold refers to the best case.

Psycho-Visual Performance Comparison
In order to evaluate the psycho-visual performance in detail preservation, this experiment uses the real restoration image as the testing target to measure different filters for all the five images used. The noise is also set in ratios of 10-90% noise densities, but the 60% random-valued impulse noise here is selected randomly and contaminated in the first figure for the result presentation of the psycho-visual test in this study. Thus, the experiments are run for evaluating the restoration images at 60% noise density (note: due to the need to cut down the complexity of excessive figures and tables, this study only displays the empirical results of 60% noise densities as a representative figure presentation for the five images in this subsection). As a result, Figures 13-17 show the measurement results for the psycho-visual performance comparison in these images for assessing different filtering techniques. Obviously, the proposed AFWMF model is still preferable when compared to the other filtering models by personal observation; however, in order to identify the testing results of psycho-visual comparison, this study invited three experts who specialize in this image processing field to help with the visual evaluation. In particular, Table  6 shows the average ranking of the performance comparison for a noise of 60% made by the three experts. In Table 6, it is indicated that the proposed AFWMF model is still the best one and has a better performance in psycho-visual testing for a ratio of 60% impulse noise density. From Table 6 and these figures, it is clear that the top three models are AFWMF, ROR, and DWM in terms of rank ordering. It is shown that the proposed AFWMF model has better performance than other filtering models in terms of psychovisual comparison and recognition for various testing points, such as shading, flat regions, detail, and edge, from the experts.  In addition, to further evaluate the key impact of the 10 filtering models used for noise interference processing, this study also further describes different levels of noise density for the image processing to improve the visual evaluation of the three experts. They again ranked the images restored by the 10 filters from 10% to 90% of interference for the five experimental images. Subsequently, the average ranking of the performance by the same three experts was calculated and is shown in Tables 7-9 for different levels of noise: 30% (low), 50% (median), and 70% (high), respectively. From Tables 7-9, it is also clear that the proposed AFWMF model performs the second best at a 30% noise density and is the best one in both the 50% and 70% noise densities. In general, the proposed AFWMF model still has the best performance in psycho-visual comparison for the five images compared to the other listed filtering models both generally and comprehensively. Productively and meaningfully, the proposed AFWMF model has a better performance than the other listed filtering models in terms of psycho-visual comparison, regardless of the level (low, medium, or high) of noise density involved. Thus, extra experiments are further needed to provide this evidence in other ways or in other images. Boat  Peppers  Plane  Count  Rank (for Ratio 70%)  BDND  9  10  9  9  9  46  9  DWM  4  4  3  3  6  20  4  EAIF  8  8  8  8  8  40  8  FRDFM  6  5  5  6  4  26  6  SBF  7  7  6  7  7  34  7  SDOOD  3  2  6  4  3  18  3  ROR  2  3  1  1  2  9  2  ASMF  5  6  4  5  5  25  5  EBDND  10  8  9  10 10 47 10 AFWMF 1 1 2 2 1 7 1

Stop Iteration Comparison
It is important to understand the iterative condition of the related ROR algorithm under the picture (or image) and its noise density. In this experiment, this study can interestingly verify the new stop criteria to stop iteration under the original image and noise density unknown and avoid the picture being over-repaired (i.e., the detail texture is removed). Regarding the environment of iteration, the stop condition is set up under the same ROR iterative architecture and the median filter is used to filter out the noise. The iteration number of the original ROR is shown in Table 2, which is based on the original image and the noise density. Referring to Equations (4)-(6), (18) and (19), the number of iterations for the new conditions is provided in this study. Furthermore, the noise density is selected at the low, medium, and high noise levels (30%, 50%, and 70%, respectively) from Table 2 using the same five images.
As a result, the average PSNR of the five images for the verification results is shown in Tables 10 and 11, referring to Table 2 and using Equations (5) and (6), respectively. Table 10 uses the number of iterations estimated from the original ROR, while the stop condition using the PSRNR formula is obtained under the principle of an unknown original image and no noise information in Table 11. In the tables, it is shown that the comparable results of the PSNR value for the proposed AFWMF model are very close to the original ROR method, which uses the known noise density conditions. Therefore, the experimental results show that the proposed AFWMF model can effectively support the stop criterion for the iteration and obtain a set of optimal PSNR values that is very close to the known information conditions of the original image. Afterwards, it is also necessary to compare the PSRNR algorithm with the original ROR algorithm in different parameters to its noise density in Table 2. In fact, the noise density and the original image are not known when the noise is filtered out, and it is not possible for the iteration number to refer to Table 2 from the original ROR method. Therefore, for the experimental fairness of the testing results, the implementing process was tested under the same ROR architecture and the same noise density as that in Table 2. That is, the noise density is also selected in the same low, medium, and high noise levels (30%, 50%, and 70%) for performance comparison. The experimental results are shown in Tables  12-16 for the five images. It is found that in most cases (about 10/15 = 0.67), the empirical result can be very close to the repair effect found in Table 2, where the proposed PSRNR method is used as the stop condition. Thus, the proposed AFWMF model still conclusively has the best result out of all the filter techniques used in this study.

Performance Comparison of SSIM
Afterwards, to further deeply reidentify the performance of the 10 filtering models, this study uses the second measurement indicator (i.e., SSIM value) for processing the noise density of images. Thus, Table 17 and Figure 18 show the SSIM average value at different noise densities from the 10 filter models for the five experimental images. Regarding the empirical results, it is found that the ranking order is AFWMF  ASMF  DWM  ROR  SDOOD  SBF  FRDFM  EAIF  BDND  EBDND in terms of the performance of the SSIM average value. From Tables 4 and 17, two interesting and meaningful findings are defined and determined. (1) The proposed AFWMF model is the best one for processing impulse noise density regardless of the PSNR and SSIM values.

Discussions for the Related Results
From all the experimental results, the study raises some questions related to the different filtering models in the following two directions: (1) The AFWMF model is the best method for denoising signals in almost all noise levels to the Lena, Gold Hill, and Boat images; however, the performance in the Peppers and Plane images is slightly worse in terms of some ratios of noise density when compared to the DWM and ROR models. The possible reasons for the issues mentioned above are that the AFWMF model improves its filtering performance using a more complicated and varied feature, form, or style than that of the other listed filtering models mentioned in this study. (2) The relationship between PSNR and noise density in the 10 listed filter models and the advantages/disadvantages or characteristics of the 10 filter models are discussed in the following: (a) The BDND filter is proven to operate efficiently even under high noise densities. However, the critical parameter needs to be defined in the filtering step of the BDND algorithm. (b) The DWM is based on the differences between the current local pixel and its neighbors aligned with four main directions. Then, the minimum of these four direction indexes is used for impulse detection. It makes full use of the characteristics of impulse and edges to detect and restore noise. DWM has an excellent performance in low-noise conditions. (c) The EIAF algorithm consists of two steps: impulse noise fuzzy detection and impulse noise cancellation. The EAIF has a slightly better performance in PSNR evaluation with 10% and 20% noise. It ranks eighth out of ten models. (d) FRDFM generally has a better performance at a higher noise percentage. For example, under 80% and 90% noise, it ranks fifth among the 10 model methods. However, it only ranks seventh in terms of its overall ranking. (e) SBF ranks sixth overall and has an average performance at various noise percentages. (f) SDOOD ranks fifth, but he ranks poorly in low noise and better in high noise conditions, ranking third with 90% noise. (g) The ROR method does not necessarily have a good performance in the state of low noise, because ROR is an improvement mechanism for DWM under high noise, so it has a better performance under high noise. It is in third place. (h) The method of using ASMF has a good performance under various noise conditions. Its overall ranking is fourth. (i) The EBDND is used for some special cases, so it is more difficult to define the critical parameters. Thus, it does not have a good performance without the definition of special parameters. It has the worst performance in terms of PSNR evaluation. (j) The proposed AFWMF method uses the combined benefits of ROR, DWM, and others, so its overall average has the best performance.

Conclusions
This study has proposed a new filtering framework called the AFWMF model. We proposed four key points and concerns relating to the image processing abilities of this new model. (1) First, this study transforms the original ROR algorithm to an expert system of fuzzy inference, since the use of fuzzy sets of fuzzy inference is a multi-value concept. Thus, the original ROR algorithm is combined with fuzzy inference in the proposed model; then, the empirical results show that the fuzzy ROR can be used more precisely to find noise from pictures (images). (2) Second, this study proposes a new stop condition of PSRNR. In the literature [12,16,25], the noise density and original image are used as references or standards for stop iteration; however, these studies exhibit some drawbacks (or problem), as they do not know what the original image or noise density is. Interestingly, the proposed PSRNR can bridge the gap of the above problem. (3) Third, in general, the median filter only uses a majority decision strategy. This strategy has a serious problem: the median filter is ineffective in filtering out noise when the noise density is over 50%. Thus, this study combines the use of directional medians and fuzzy inference to overcome this problem. (4) Finally, this study uses the fuzzy inference membership function, which can shift dynamically to accommodate random-valued impulse noise according to the distribution of the filter window; thus, it can improve the performance of image processing.
The five well-known images, Lena, Peppers, Boat, Gold Hill, and Plane, were used as the experimental targets for evaluating the proposed AFWMF model. After all the experiments were run, this novel AFWMF model was found to significantly improve processing performances in the measurement of the PSNR value for preserving detail and fixed images at noise densities within the range of 20% to 70% for the experimental images. In extensive experiments, the method described in this study also showed a better performance in evaluating psycho-visual tests and identifying PSRNR than the other listed filter methods. Furthermore, the proposed AFWMF model also has better indicator of SSIM value. Conclusively, the proposed AFWMF model was generally found to be the best model among the listed 10 filtering methods for image processing in terms of the measurement of two quantitative indicators: PSNR and SSIM. From the experiments, five directions were found for presenting the empirical results of the proposed AFWMF model. (1) The proposed AFWMF model had a better performance in terms of the PSNR value and psycho-visual testing than the other filters for different random-valued impulse noises; however, the random-valued impulse noise is very difficult to remove from the related review of the scarce literature. (2) The proposed AFWMF model performed well in terms of restoration performance and sense of sight in this study. (3) The proposed AFWMF model showed a better restoration of detail or texture than the other filters, especially when the noise density ratio was within the range of 20 to 70%. (4) In total, this study provides good evidence that the proposed AFWMF model performs better in terms of PSNR and SSIE values. (5) Meaningfully, it was found that different impulse noise densities should be used with different filtering methods. It is important to find a suitable filtering model for processing images with various noise densities.
Interestingly, three meaningful findings for subsequent image processing applications were identified: (1) The proposed AFWMF model was the best one for processing different impulse noise densities in terms of both the PSNR and SSIM values. (2) It is important to find an appropriate filtering method for use with a variety of images. (3) From the empirical results, it is evident that the DWM model can be used for a low 10% noise density, the ROR model can be used for high 80% and 90% noise densities, and the AFWMF model can be used with 20-70% noise densities. Although the study shows some benefits of image processing, our techniques still need to be improved. For example, providing a new resolution for image processing will be necessary in future research.