Application of Smooth Fuzzy Model in Image Denoising and Edge Detection

: In this paper, the bounded variation property of fuzzy models with smooth compositions have been studied, and they have been compared with the standard fuzzy composition (e.g., min– max). Moreover, the contribution of the bounded variation of the smooth fuzzy model for the noise removal and edge preservation of the digital images has been investigated. Different simulations on the test images have been employed to verify the results. The performance index related to the detected edges of the smooth fuzzy models in the presence of both Gaussian and Impulse (also known as salt-and-pepper noise) noises of different densities has been found to be higher than the standard well-known fuzzy models (e.g., min–max composition), which demonstrates the efﬁciency of smooth compositions in comparison to the standard composition.


Introduction
Edge detection is a useful step toward visual object detection and image segmentation. An edge is normally extracted by the observation of the intensity changes inside the region of interest of the entire image. Therefore, different gradient calculation measures have been developed in the literature to find the abrupt changes of the pixel's qualities. The Robert edge detection algorithm, as a basic method of edge detection, calculates the discrete differentiation between the diagonally adjacent pixels [1,2]. Similarly, Sobel edge detection and Prewitt edge detection perform the same process of differentiation inside the horizontal and vertical masks, respectively. Canny edge detection is considered as the standard edge detection technique, where the process is performed in three stages. Firstly, the image goes through the Gaussian filter to be smoothed. Secondly, the directional gradient is calculated to estimate the edges. The third step is the post-processing, where it is attempted to thin the edges [3]. The smoothing of the image is also used in the other well-established algorithms of edge detection, such as Laplacian of Gaussian (LoG), where the sum of the second derivative of the Gaussian function is used [4]. However, the variation of the pixel values across the region of interest and the induced noises during the recording and transformation can degenerate the image detection process. Readers interested in a survey of the mentioned algorithms are referred to [1,5,6].
The wider applications of the image processing algorithms in industry, robotics, military, geography, and medical diagnosis detection have acted as a motor for the development of the recent algorithms in the image segmentation [7][8][9], morphological operations [3], and noise removal [10]. The basic edge detection algorithms have been highly extended in recent years. For instance, for the better smoothing of images, the geometry of images has been used upon the bandlet transformation to improve the performance of edge detection algorithms in [11]. The Faber Shcauder wavelet transformation has been used with a bilateral filtering method in [12]. Many research works also have been performed to tackle the noise reduction problem in edge detection.
Normally, it is impossible to identify the kind or level of noise in an image; however, it is believed that the impulse (type) noises are more related to the image acquisition process (i.e., scanning and motion blurring) and the Gaussian (type) noises are related to the transmission process. Hence, many researchers have focused on soft computing methods and fuzzy models for the development of the robust algorithms of the edge detection of the noisy images [5,13,14]. Soft computing methods and fuzzy models, in general, can incorporate more parameters and different high-pass or low-pass filters into the edge detection algorithm and therefore preserve the edges while simultaneously smoothing the noises [1].
Several applications of the standard fuzzy logic-based edge detection have been reported in the literature. In [1], the type-2 fuzzy model has been employed. The anisotropic filtering has been developed in [15]. In [16], a modified region growing procedure is introduced to evaluate the distance between a pixel and the region. However, the shortages of the fuzzy models in general are as follows: • Although it is proved that the fuzzy models can approximate any continuous function in the compact set, their derivative is not continuous. In other words, the fuzzy models are not smooth [17]. • The type-2 fuzzy logics improve the performance of the edge detection algorithms; however, they demand higher computational power in parallel.

•
The selection of the best shape of membership function (MF) is mostly a problematic matter in the design step, and many developed methods are only applicable to a special shape of MF.
Therefore, in the present manuscript, we intend to employ the smooth fuzzy compositions (SFCs) for edge detection and noise removal purposes. The novelties and contributions of the proposed method are as follows: • The fuzzy models with smooth compositions are classified as type-1 fuzzy models. Therefore, they do not call for notably higher computational power compared to the standard fuzzy models of min-max and product-sum compositions. • Considering the structural properties, the smooth fuzzy models (SFMs) are bounded variation functions, enabling them to dampen the noises in the image, even at low signal-to-noise ratios (SNRs).

•
The results for the bounded variation property are general for all MF selections.
The bounded variation property of the smooth compositions is the backbone of the proposed approach in the manuscript, and we have compared the total variation denoising of the smooth fuzzy compositions to the standard fuzzy compositions through quantitative methods. Upon this characteristic, therefore, the smooth fuzzy models would preserve the edges and important information of the images. This capacity has been demonstrated through the comparison of Pratt's figure of merit (PFOM) values of the different models.
Two cases of Gaussian noise and Impulse noise have been considered in the simulations. Considering that the source and type of the noises usually are not determined, and the proposed method is able to remove both types of noises, the results are highly applicable to real applications.
Therefore, the structure of the manuscript is as follows. We begin with the preliminaries of the functional analysis and then introduce the general fuzzy modeling and the smooth fuzzy modeling schemes. In the next section, we elaborate on the bounded variation property of the smooth fuzzy compositions and contrast the total variation denoising of the smooth fuzzy compositions toward the standard fuzzy compositions. After that, we employ the obtained results for the edge detection of the images and demonstrate the higher performance of the smooth compositions over the standard fuzzy compositions for the edge detection. Finally, the results are discussed, and the paper is concluded.

Mathematical Background
In this section, for the convenience of the reader, we review some mathematical backgrounds from [17].
The infimum of such c is called the Lipschitz constant.

Proposition 1.
If ψ is differentiable on (a, b) and its derivative ψ is increasing, then ψ is convex.

Proposition 2.
Let ψ be a convex function on (a, b). ψ is then Lipschitz, and thus absolutely continuous, on each closed, bounded subinterval [c, d] of (a, b).

Lemma 1.
Let the function ψ be absolutely continuous on the closed, bounded interval [a, b]. Then, f is the difference of increasing absolutely continuous functions and, in particular, is of bounded variation.

General Structure of Fuzzy Systems
After reviewing the mathematical preliminaries from [17], we continue to the main part of the manuscript. We consider a system of multiple inputs and single output to facilitate the theory development; however, it is clear to us that our results can be extended for multiple inputmultiple output systems since the multiple output part can be easily decomposed into several single outputs of the system. We consider a system where the state depends on the last n states of the system as follows: x(k + 1) = h x(k), x(k − 1), . . . , x(k − n + 1) .
We call every i-th past state of the system state x i ; hence, the system definition changes to be as follows: For every state of the system, we consider an interval where each state has the highest probability of existence in that interval. Hence, we partition the interval into 2N + 1 regions and assign an MF for each region.
To complete the fuzzy system definition, we need to assign rules for the data in each region of domain of the inputs and outputs. In mathematical terms, we consider the following: where the function x(k + 1) := g(x), x = [x 1 , . . . , x n ], 0 ∈ x is about to approximate the system dynamics h(x) in the corresponding interval. The fuzzy rules we have just constructed are supposed to have two IF and THEN parts, which can be interpreted to make a mathematical inference based on the fuzzy values employing the compositions of t-norms and s-norms. Different types of t-norms and s-norms have been introduced in the literature [18][19][20], where the min-max composition and product-sum composition are the mostly used compositions and are shown as follows: II: We consider that the output of a fuzzy model is determined upon the centroid defuzzification formula, given by

Smooth Fuzzy Models
In [18,[21][22][23], the smooth fuzzy models are generally constructed upon the utilization of SFCs instead of the standard fuzzy compositions introduced above. The SFCs are smooth t-norms and smooth s-norms, and are shown as follows: III: IV: To facilitate the explanation, we assume r = 2, corresponding to the MFs µ a (x) and µ b (x), along with two state variables. Then, the fuzzy model can be written as follows: where µ 1 (x) and µ 2 (x) are the MFs from the system state vector For more details on such calculations, interested readers are referred to [23][24][25][26][27][28][29][30][31][32].

Lemma 2.
The composition of smooth fuzzy operators class B is Lipschitz with respect to the MF.

Proof of Lemma 2.
To prove the lemma, we must check that the derivatives of the s-t composition class B with respect to MF are increasing in the interval [0, 1]. Hence, based upon Propositions 1 and 2, the proof is complete.
For two MFs µ a (x) and µ b (x), we define B as follows: Therefore, the derivative using the chain rule will be as follows: and B ≥ 0, j = a, b.

Corollary 1. The s-t smooth composition class B is absolutely continuous.
Proof of Corollary 1. Corollary 1 can be deduced from Lemma 2, Propositions 1 and 2.

Theorem 1. The s-t smooth composition class B is a bounded variation function.
Proof of Theorem 1. Theorem 1 can be deduced from Corollary 1 and Lemma 1.

Comparison of Bounded Variation of Different Fuzzy Compositions
The functions of the bounded variations property have been studied widely in the literature [17,[33][34][35][36][37][38], and many researchers have worked on their applications for edge preservation and noise reduction. In the previous section, we concluded that the smooth compositions are bounded variation functions of MF. Hence, in this section, we demonstrate what the bounded variation property means for the smooth fuzzy compositions and quantify the noise removal capacity of different fuzzy compositions. We employ the PFOM as the instrument for this purpose.

Instrumentation (Pratt's Figure of Merit)
Pratt in [39,40] introduced a figure of merit as an index for errors in edge detection as follows: where I I is the number of ideal edge points, I A is the number of actual or detected edge points, α is a scaling constant (typically equal to 1/9), and d is the separation distance of the actual edge point normal to the line of ideal edge points. In the literature [5,[41][42][43][44], various approaches are provided to compute distance d. Some possible definitions of distance, which compute the distance between the position of two pixels (v 1 , w 1 ) and (v 2 , w 2 ), are as follows: 1.
City block distance, based on four-connectivity, provides only horizontal and vertical distances for movements:

2.
Chessboard distance, based on eight-connectivity, provides diagonal distances for movements as well as horizontal and vertical distances for movements: 3. Euclidean distance measures the actual physical distance as

Illustrations
In this section, we consider the "Euclidean distance" between MFs and compare the performance of the different t-norm operators. Two MFs of the Gaussian shapes are considered as follows: The outputs of different t-norm operators have been studied with these MFs. The t-norm operators in the study are (i) the smooth fuzzy t-norm type B and (ii) the standard fuzzy t-norm min. As has been shown in Figure 1, the performance of the two t-norm operators is the same under the normal condition. Now, we consider the noisy conditions.
Therefore, the MFs can be considered as follows: The impacts of the two t-norm operators are different, as illustrated in Figure 2. • Scenario 2: Both MFs are considered with the additive noise as follows: Therefore, the MFs can be considered as follows: The impacts of the two t-norm operators are different, as illustrated in Figure 2. It is evident from the comparison of the PFOM corresponding to the different t-norm operators, summarized in Tables 1 and 2, that the smooth operator shows a higher level of tolerance to the noises.

Application to Edge Detection of Images
In this section, we verify how the employment of smooth fuzzy compositions removes noises and preserves the edges of the images. In the previous section, it was demonstrated that smooth fuzzy compositions outperformed the standard fuzzy compositions in dampening the effect of the noises. Therefore, for the edge detection of images, the application of the smooth compositions has been compared to the standard fuzzy compositions, and to make a fair comparison, the same structure of the fuzzy model has been considered for both types of compositions.

Non-Fuzzy Edge Detection
In the classical edge detection algorithm, the Sobel operators are employed as the vertical and horizontal derivative approximations of the image. The algorithm employs Sobel operators throughout the horizontal axis and vertical axis, as follows: which act as three-by-three convolution masks on the image. Therefore, the gradients along both axes are determined as follows: where * represents the convolution operator. It is attempted to detect the zero-crossings of the first-order directional derivative in the gradient direction of the image by the minimization of the following function:

Fuzzy Edge Detection
For the fuzzy edge detection algorithm, we consider four inputs to the fuzzy system. The first two inputs are the vertical and horizontal derivative approximations of the image, h horiz and h vert , respectively. The third input to the fuzzy system is the output of the image through a convolution mask of a low-pass filter, which is as follows: The fourth input to the fuzzy system is the output of a convolution mask of a high-pass filter, which is as follows: Consequently, the fuzzy model g(x) can be constructed upon the suitable synchronization of the rules on the inputs. The rule basis for this fuzzy system is shown in Table 3. The MFs for all the inputs and the output are shown in Figure 3. The range on which the MFs are defined is flexible for the inputs and can extend further than 255 or lower than 0. However, the range of MF is fixed for the output, [0, 255]. If h horiz is Medium and h vert is Medium, then output is High. 3 If h horiz is High and h vert is High, then output is High. 4 If l p is Low and h vert is Medium, then output is Low. 5 If l p is Low and h horiz is Medium, then output is Low. 6 If hp is Low and h vert is Medium, then output is High. 7 If hp is Low and h horiz is Medium, then output is High.  The fuzzy model detects the edges of the image in the range from 0 to 255. It is known that in the grayscale format, 255 corresponds to white and 0 means black, and therefore, the closer a pixel is to 255, the greater the probability of the pixel being identified as an edge pixel. Figure 4 illustrates the developed fuzzy inference system for this paper.  Therefore, very similar to (30), the zero-crossings detection of the image can be carried out through the minimization of the first-order derivative of the fuzzy model as follows: The numerical solution of the minimization problem (33) is equal to the minimization of the norm function ||g|| over the bounded variation search space of the image Ω, rewritten as follows:

Noise Removal Characteristics of the Smooth Fuzzy Model
We consider the noisy image f (x) as the output of the fuzzy model designed for the edge detection, added to the independently and identically distributed zero-mean Gaussian random variable η, as f (x) = g(x) + η. We amplify the minimization problem (34) to estimate the denoised image g(x) as the solution of the following problem: where λ is a positive parameter. The first term in the minimization avoids the solution from the oscillation behavior in the edge detection and smooths the images. The second term runs the smooth fuzzy model to remove the noise and to be close to the edges.

Lemma 3. The solution of the minimization problem (35) exists and is unique and stable with respect to the perturbations.
Proof of Lemma 3. See [45].

Proposition 3.
The same conclusions of the noise-removing capacity of the smooth fuzzy models can be deduced for the definition of the Laplace noise and the minimization problem shown below: Proof of Proposition 3. See [46,47].

Proposition 4.
The same conclusions of the noise-removing capacity of the smooth fuzzy models can be deduced for the definition of the Poisson noise and the minimization problem shown below: Proof of Proposition 4. See [48].

The Proposed Procedure
The grayscale image is used as the input to the fuzzy model of the edge detector system. Canny is used as the ideal edge detector for comparison using the PFOM value. A threshold filter is applied to the output image of the fuzzy model (fuzzy inference system) in such a way that the pixels with values higher than the threshold can be considered as the edge pixels (with pixel value being equal to 255), and the rest are considered as the non-edges (with a pixel value equal to 0). This process is called binarization.
In fact, in the binarization process, the threshold value for each image is selected adaptively. The output of the fuzzy inference system is a denoised gray-scale image with the edge pixels being more discernible than those of the input. Since the output pixels have values between 0 and 255, the threshold value will be a value in this range that provides the maximum PFOM in comparison with the ideal edge-detected image. In other words, a loop sweeps the interval of [0, 255] and selects the value that maximizes the PFOM. Finally, the edge-detected image pixel values will be either 0 or 255, which is called binarization. The employed procedure is illustrated in Algorithm 1 and Figure 5.

Comparison Instrument
Before proceeding to the edge detection, we need to choose the most fitted measure of distance, according to Section 3.1. The difference of the distance measures has been illustrated by the numerical comparison of an example in Figure 6, in which the pixel "aa" is located at (2, 1) and the pixel "bb" is located at (3, 3). The measures introduced above are used for the calculation of distance between the pixels as follows: The "Euclidean distance" is based on the actual physical distance; however, the "Chessboard distance" can demonstrate movement in eight directions, which are almost all possible movements in an image. Secondly, with the employment of the "Chessboard distance," the detected edges would have the same probability of belonging to the ideal edges.

Results and Discussions
For the purpose of simulation, we consider two sets of images: (1) three images from MATLAB repository (Table 4) and (2) five X-ray images available online (Table 5). Table 4. MATLAB Images.
X-ray 1 X-ray 2 X-ray 3 X-ray 4 X-ray 5 In Table 6, we show the results for applying the proposed method on each of the images and calculating the PFOM value under two types of noise: Gaussian and Impulse. Note that in these tables, the Gaussian noise is denoted by "G" with three different variance levels: 0.001, 0.002, and 0.003. Similarly, the Impulse noise is denoted by "I" with three different density levels: 0.25%, 0.50%, and 1%. As shown in Table 6, the PFOM values related to the smooth composition are higher than those of the standard composition in all cases. Tables 7-14 also provide a visual demonstration supporting this conclusion. As is quite obvious from these tables, the density of noise in the edge-detected images of smooth composition is always less than that of the standard composition. Furthermore, the Canny edge detector is also highly prone to noises and is unable to decrease the noise density.

Experimental Results
This subsection of the manuscript dives deeper into the details of the visual tables, i.e., Tables 7-14. Table 7 shows that: • In all cases, the Canny edge detector detects more edge pixels than both fuzzy compositions.
• As the level of noise increases, all three methods become adversely affected by the noise, and still more edges are detected by Canny. • However, in all cases, the PFOM value for the smooth composition is always greater than the PFOM value for the standard composition, according to Table 6. Table 8 shows that: • In all cases, the Canny edge detector detects more edge pixels than both fuzzy compositions. • As the level of noise increases, Canny and standard composition become adversely affected by the noise, and still more edges are detected by Canny; however, most of the detected edges by Canny are misdetections due to the impact of noise. As is obvious from this table, the smooth composition provides a better image with reduced noise density. • In all cases, the PFOM value for the smooth composition is always greater than the PFOM value for the standard composition, according to Table 6. Table 9 shows the following: • In all cases, the Canny edge detector detects more edge pixels than both fuzzy compositions. • As the level of noise increases, Canny and standard composition become adversely affected by noise, and still more edges are detected by Canny; however, most of the detected edges by Canny are misdetections due to the impact of noise. As is obvious from this table, the standard and smooth compositions provide a better image with reduced noise density. • However, in all cases, the PFOM value for the smooth composition is always greater than the PFOM value for the standard composition, according to Table 6. Table 10 shows the following: • In all cases, the Canny edge detector detects more edge pixels than both fuzzy compositions. • As the level of noise increases, Canny and standard composition become adversely affected by the noise, and still more edges are detected by Canny; however, most of the detected edges by Canny are misdetections due to the impact of noise. As is obvious from this table, the smooth composition provides a better image with reduced noise density. • In all cases, the PFOM value for the smooth composition is always greater than the PFOM value for the standard composition, according to Table 6.
For Tables 11-13, the same points of Table 10 can be made. Therefore, for the sake of brevity, the points are not mentioned. Table 14 shows the following: • In all cases, the Canny edge detector detects more edge pixels than both fuzzy compositions. • As the level of noise increases, all three methods become adversely affected by the noise, and still more edges are detected by Canny; however, most of the detected edges by Canny are misdetections due to the impact of noise. As is obvious from this table, the standard composition as well as the smooth composition somehow show equal performance in reducing noise density. • However, in all cases, the PFOM value for the smooth composition is always greater than the PFOM value for the standard composition, according to Table 6.    Table 10. Edge-detected image of "X-ray 1" after binarization for different noises.  Table 11. Edge-detected image of "X-ray 2" after binarization for different noises.

Conclusions
The contribution of the present manuscript is twofold. Firstly, it studies the bounded variation of the smooth fuzzy models and quantifies the results for the application of different fuzzy compositions for noise removal. On the other hand, it applies the smooth fuzzy compositions for the edge detection of digital images. The results have been expressed in terms of the widely used Pratt's Figure of Merit (PFOM) as well as the visual observations of the images in the presence of the different levels of noise. The presented experiments could show the superiority of the smooth fuzzy filters over the standard fuzzy filters through numerical comparisons of the error in performance and visual observation. In the theoretical studies, the involved MF has not been supposed to have a special shape, and therefore, we leave the designer free to select it based on the desire for the improvement of the fuzzy edge detection algorithm by the involvement of the smooth compositions.

Future Works
Fuzzy edge detection methods are being widely used in the processing of medical images. Hence, future work can be dedicated to the application of the proposed technique in a wide range of investigations on the extension of the earlier works on the detection of diabetic retinopathy [49], in the maculopathy of eye fundus images [50], or for brain tumor detection and treatments [51][52][53]. In addition, other types of smooth compositions can be used in the wider domain of datasets for comparison with the standard fuzzy compositions for noise removal and edge recovery.