A Novel Framework for Shock Filter Using Partial Differential Equations

In dilation or erosion processes, a shock filter is widely used in signal enhancing or image deburring. Traditionally, sign function is employed in shock filtering for reweighting of edge-detection in images and decides whether a pixel should dilate to the local maximum or evolve to the local minimum. Some researchers replace sign function with tanh function or arctan function, trying to change the evolution tracks of the pixels when filtering is in progress. However, analysis here reveals that only function replacement does usually not work. This paper revisits first shock filters and their modifications. Then, a fuzzy shock filter is proposed after a membership function in a shock filter model is adopted to adjust the evolve rate of image pixels. The proposed filter is a parameter tuning system, which unites several formulations of shock filters into one fuzzy framework. Experimental results show that the new filter is flexible and robust and can converge fast.


Introduction
Image enhancement is a method for improving the quality or sharpening certain details of an image and is widely used in many fields such as fingerprint recognition [1], medical image processing [2][3][4], remote sense image processing [5], and underwater image processing [6].There is an enormous amount of different approaches to performing image enhancing, which can broadly be divided into domain transform [2,5,7,8], histogram equalization [3,9], and feature-oriented filtering [10][11][12][13].As a feature-oriented filtering approach, shock filters are easily implemented and are effective in edge enhancing in image enhancing tasks.
In the past few years, there has been a growing amount of research concerning partial differential equations (PDEs) for computer vision and image processing [8,[14][15][16][17][18][19].PDEs have come into a general framework for enhancement purposes and are developed in a coupled or independent manner.Shock filters are such a PDE-based approach for the enhancement of image signals proposed by Osher and Rudin [12], which is attractive for many other applications such as motion deblurring [20], geometry processing [13], and image restoration [21].In contrast to Fourier-or wavelet-based methods, or linear approaches, shock filters avoid Gibbs phenomena in spatial domains.
The first shock filter was proposed by Kramer and Bruckner in 1975 [22], where the Laplacian of a pixel was calculated first and the sign of the Laplacian was employed to decide which influence zone the pixel belongs to.If the Laplacian is positive, the pixel is considered to be in a maximum influence zone and will perform a dilation process, while if the Laplacian is negative, the pixel belongs to a minimum influence zone and will perform an erosion process.The dilation and erosion processes are iterated until the borderlines between the maximum and minimum zones are sharply discontinued to an appropriate level.Kramer and Bruckner formulated their shock filters in a discrete way.In contrast to their discrete shock filter, Osher and Rudin introduced a continuous shock filter based on PDEs [12], which most of the current shock filter formulations are based on for modification.
Shock filters are popular in many applications [23][24][25] because of several advantages: Firstly, they create sharp discontinuities at edges in images and flat signals in other area.Second, they do not change the total variation of an image, so they are stable.However, although the conventional shock filters are attractive in many fields, especially in image enhancing, they are noise sensitive and will enhance the noise when they enhance the signals.
The goal of this paper is to propose a novel shock filter called a fuzzy shock filter, which is an adapted version of the shock filters.It provides a general framework for the different function that estimates the flow direction of the pixels; namely, we can select different functions or different parameters to sharpen or flatten a pixel in the same framework.The proposed fuzzy shock filter is more flexible and robust.
The paper is organized as follows.In Section 2, we revisit the formulation of the conventional shock filter proposed by Osher and Rudin and then other modified formulations are provided and discussed.In Section 3, we start by analyzing the value of edge response of images and then propose our fuzzy shock filter.Section 4 shows a number of experimental results of the proposed method, and some comparisons are provided.Section 5 concludes the paper.

Shock Filter and Its Modifications
The formulation of the conventional shock filter is described as Equation ( 1).Considering a continuous image I(x, y) : R 2 → R .Then, a sequence of sharpened images {I(x, y, t)|t ≥ 0} evolve by the PDE: where ∇I is the gradient of I, I(x, y, 0) is the original image, sign(x) is the sign function, and ∆I is Laplacian of I (as shown in Figure 1).
Entropy 2017, 19, x 2 of 10 to their discrete shock filter, Osher and Rudin introduced a continuous shock filter based on PDEs [12], which most of the current shock filter formulations are based on for modification.Shock filters are popular in many applications [23][24][25] because of several advantages: Firstly, they create sharp discontinuities at edges in images and flat signals in other area.Second, they do not change the total variation of an image, so they are stable.However, although the conventional shock filters are attractive in many fields, especially in image enhancing, they are noise sensitive and will enhance the noise when they enhance the signals.
The goal of this paper is to propose a novel shock filter called a fuzzy shock filter, which is an adapted version of the shock filters.It provides a general framework for the different function that estimates the flow direction of the pixels; namely, we can select different functions or different parameters to sharpen or flatten a pixel in the same framework.The proposed fuzzy shock filter is more flexible and robust.
The paper is organized as follows.In Section 2, we revisit the formulation of the conventional shock filter proposed by Osher and Rudin and then other modified formulations are provided and discussed.In Section 3, we start by analyzing the value of edge response of images and then propose our fuzzy shock filter.Section 4 shows a number of experimental results of the proposed method, and some comparisons are provided.Section 5 concludes the paper.

Shock Filter and Its Modifications
The formulation of the conventional shock filter is described as Equation (1).Considering a continuous image where I ∇ is the gradient of I , ( , ,0) I x y is the original image, sign(x) is the sign function, and I Δ is Laplacian of I (as shown in Figure 1).A number of modifications of the shock filter have been proposed in recent years.The second derivative of an image has been used as an edge detector instead of a Laplacian operator, and better performances are reported in other papers [13,26,27].For instance, more recently, it was mentioned in [13] that ( ) ( ) with t H , the Hessian of t I , is adopted as an edge detector.To make the filters A number of modifications of the shock filter have been proposed in recent years.The second derivative of an image has been used as an edge detector instead of a Laplacian operator, and better performances are reported in other papers [13,26,27].For instance, more recently, it was mentioned in [13] that (∇I t ) T H t (∇I t ) with H t , the Hessian of I t , is adopted as an edge detector.To make the filters more robust, the edge detector can even take the convolution with Gaussian in [26].Taking into account of the modification of edge detectors and note I(x, y, t) as I t , then shock filter can be described as Entropy 2017, 19, 142 where L(I t ) is an edge detector such as Laplacian or the second derivative of I t along the gradient direction.Another way to improve the shock filter is to replace the sign function with other functions such as tanh (hyperbolic tangent function) and atan (arctan function) [28], as shown in Figure 1.In Equations ( 1)-( 3), sign, tanh, and atan functions are defined, respectively, as π .
In the shock filter, the sign function is employed to find the sign of the edge response value of an image pixel and different sign will be further used to decide which influence zone (maximum zone or minimum zone) the pixel belongs to.The extended shock filter is given by where the F function can be sign(x), tanh(x), or atan(x).

Edge Response Value Analysis
In Equation (3), L(I t ) can be any second-order edge detector.We adopt which corresponds to the second derivative of image I in the direction of the normal to the isophotes.Take Figure 2a (Shape) as the test image for instance: We iterated Equation (3) several times.Figure 3 shows the changes in L(I) values at different iteration times when F(s) = tanh(s).Situations are similar when F(s) = atan(s).In the experiments, we tested Model (3) using ( ) tanh( ) , respectively.Figure 4 shows the values of the peak signal-to-noise ratio (PSNR) at different iteration times during the filtering.It is obvious in Figure 4 that the trends of the PSNR coincide when the F function is sign, tanh, or atan.Therefore, it is easy to deduce again that to merely replace sign(x) with tanh(x) or atan(x) will not change the filtering result.In the experiments, we tested Model (3) using F(s) = tanh(s), F(s) = atan(s), and F(s) = sign(s), respectively.Figure 4 shows the values of the peak signal-to-noise ratio (PSNR) at different iteration times during the filtering.It is obvious in Figure 4 that the trends of the PSNR coincide when the F function is sign, tanh, or atan.Therefore, it is easy to deduce again that to merely replace sign(x) with tanh(x) or atan(x) will not change the filtering result.

Fuzzy Shock Filter
The F function in the shock filter is used to decide which influence zone a pixel belongs to.If a pixel belongs to an influence zone of a local maximum, the pixel will be enhanced (the value of it will be increased in proportion to its gradient); otherwise, it will be flattened (the value of it will be decreased in proportion to its gradient).Noise can also be enhanced if they are in a maximum zone

Fuzzy Shock Filter
The F function in the shock filter is used to decide which influence zone a pixel belongs to.If a pixel belongs to an influence zone of a local maximum, the pixel will be enhanced (the value of it will be increased in proportion to its gradient); otherwise, it will be flattened (the value of it will be decreased in proportion to its gradient).Noise can also be enhanced if they are in a maximum zone during the shock filter.Thus, we introduce a fuzzy membership function gaussmf into shock filter and modify it to

Fuzzy Shock Filter
The F function in the shock filter is used to decide which influence zone a pixel belongs to.If a pixel belongs to an influence zone of a local maximum, the pixel will be enhanced (the value of it will be increased in proportion to its gradient); otherwise, it will be flattened (the value of it will be decreased in proportion to its gradient).Noise can also be enhanced if they are in a maximum zone during the shock filter.Thus, we introduce a fuzzy membership function gaussmf into shock filter and modify it to  Figure 6 shows the PSNR values at different iteration times for different fuzzy filters where ( , ) c σ = (0.2, 0.7), (5, 1), (0.3, 1), together with a conventional shock filter.It is easy to find that the PSNR for the shock filter is coincide with that of fuzzy filter with ( , ) c σ = (5, 1).We can also deduce from Figure 6 that certain fuzzy shock filters have better performances than conventional shock filters as far as PSNR concerned.Figure 6 shows the PSNR values at different iteration times for different fuzzy filters where (σ, c) = (0.2, 0.7), (5, 1), (0.3, 1), together with a conventional shock filter.It is easy to find that the PSNR for the shock filter is coincide with that of fuzzy filter with (σ, c) = (5, 1).We can also deduce from Figure 6 that certain fuzzy shock filters have better performances than conventional shock filters as far as PSNR concerned.

Experiments
We demonstrate the effectiveness and robustness of our method using a variety of images, as shown in Figures 7-10.We start our experiment with comparing conventional shock filter and the proposed fuzzy shock filter as shown in Figure 7. Several filters are applied to the "Shape" dataset.We observe that the filtering results of different filters are similar in a visual way.

Experiments
We demonstrate the effectiveness and robustness of our method using a variety of images, as shown in Figures 7-10.We start our experiment with comparing conventional shock filter and the proposed fuzzy shock filter as shown in Figure 7. Several filters are applied to the "Shape" dataset.We observe that the filtering results of different filters are similar in a visual way.

Experiments
We demonstrate the effectiveness and robustness of our method using a variety of images, as shown in Figures 7-10.We start our experiment with comparing conventional shock filter and the proposed fuzzy shock filter as shown in Figure 7. Several filters are applied to the "Shape" dataset.We observe that the filtering results of different filters are similar in a visual way.

Experiments
We demonstrate the effectiveness and robustness of our method using a variety of images, as shown in Figures 7-10.We start our experiment with comparing conventional shock filter and the proposed fuzzy shock filter as shown in Figure 7. Several filters are applied to the "Shape" dataset.We observe that the filtering results of different filters are similar in a visual way.Figures 8 and 9 show the filtering results of two dataset (Giraffe and Shape) at different iteration times using the proposed fuzzy shock filter with (σ, c) = (5, 0.6).It is obvious to find that our filter converges fast.Figure 10 show the comparison of the proposed fuzzy shock filter with different (σ, c) parameters when iteration times t = 5.
On the other hand, the peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM) [29]  where µ s is the mean value of s, σ 2 s is the variance of s, and σ xy is the standard deviation of x and y. c 1 = (k 1 L) 2 , c 2 = (k 2 L) 2 are constants for stability, where L is a dynamic range of pixel value.In our experiments, k 1 = 0.01, k 2 = 0.03.It can be deduced that the value range of SSIM is from −1 to 1, and the SSIM of the two same images is 1.Table 1 shows the PSNR and SSIM of the Shape data at different iteration times using different filters, where sign, atan, and tanh note three filters described in Equation (3), FS(s, t) means the proposed fuzzy shock filter with (σ, c) = (s, t).

Conclusions
We studied the shock filter and its modifications and have proposed a fuzzy shock filter using a fuzzy membership function.The proposed fuzzy shock filter presented the shock filter in a new way whereby several shock filter formulations can be united into one framework through the proposed membership function.The new fuzzy shock filter has provided a new parameter tuning shock filter model, which is flexible and robust, and can converge in short iteration times.

Figure 2 .
Figure 2. Input data (Shape and Giraffe) and filtered data obtained using our fuzzy shock filter.(a,c) The initial images; (b,d) The filtered images using the proposed filter with 5 σ = and c = 0.6.Figure 2. Input data (Shape and Giraffe) and filtered data obtained using our fuzzy shock filter.(a,c) The initial images; (b,d) The filtered images using the proposed filter with σ = 5 and c = 0.6.

Figure 2 .Figure 2 .Figure 3 .
Figure 2. Input data (Shape and Giraffe) and filtered data obtained using our fuzzy shock filter.(a,c) The initial images; (b,d) The filtered images using the proposed filter with 5 σ = and c = 0.6.

Entropy 2017, 19 , x 5 of 10 Figure 4 .
Figure 4.The trend of the peak signal-to-noise ratio (PSNR) at different iteration times.

Figure 4 .
Figure 4.The trend of the peak signal-to-noise ratio (PSNR) at different iteration times.
= − ∇I t gaussmf(|L (I t )|, σ, c)sign(L(I t )) L (I t ) = Norm(L(I t )) I 0 = I(x, y) (5) where gaussmf(x, σ, c) = e −(x−c) 2 2σ 2 is employed as a membership function, Norm is normalization function and |*| is the absolute value of *.Tuning the parameter pair (σ, c) in Equation (5) to different values can obtain different filters.Figure 5 shows that, when (σ, c) = (5, 1), the function curve of gaussmf is very similar to that of the tanh function.Namely, different (σ, c) results in different change track of a pixel in the image, and different filters are therefore obtained.

Figure 4 .
Figure 4.The trend of the peak signal-to-noise ratio (PSNR) at different iteration times.
a membership function, Norm is normalization function and |*| is the absolute value of *.Tuning the parameter pair ( , ) c σ in Equation (5) to different values can obtain different filters.Figure 5 shows that, when ( , ) 5,1 c σ =( ), the function curve of gaussmf is very similar to that of the tanh function.Namely, different ( , ) c σ results in different change track of a pixel in the image, and different filters are therefore obtained.

Figure 6 .
Figure 6.PSNR at different iteration times for different filters.

Figure 6 .
Figure 6.PSNR at different iteration times for different filters.

Figure 6 .
Figure 6.PSNR at different iteration times for different filters.

Figures 8 and 9 9 .
Figures 8 and 9 show the filtering results of two dataset (Giraffe and Shape) at different iteration times using the proposed fuzzy shock filter with ( , ) c σ

Figures 8 and 9 Figure 10 .
Figures 8 and 9 show the filtering results of two dataset (Giraffe and Shape) at different iteration times using the proposed fuzzy shock filter with ( , ) c σ are two widely used objective standard for image quality evaluation: b is image bit, MSE describes the Mean Square Error between the original image and the processed image.The larger the value of PSNR is, the less distortion the processed image has.SSIM is a standard to evaluate the structure similarity between two images, which is introduced firstly by Laboratory for Image and Video Engineering at University of Texas at Austin.Given two images x and y, the SSIM of them is calculated bySSI M(x, y) = 2µ x µ y + c 1 2σ xy + c 2 µ 2 x + µ 2 y + c 1 σ 2 x + σ 2 y + c 2 PSNR = 10 × log( (2 b − 1) 2 MSE )where

Table 1 .
Evaluation using PSNR and the structural similarity index (SSIM).