# On Multi-Quadric Based RBF–FD Method for Second-Order Diffusion Filters

## Abstract

The usual three-node approximations for the first-order spatial derivatives in the radial basis functions-based finite difference (RBF-FD) scheme allows relatively smaller time step size than the standard scheme (forward difference in time and central difference in space) in obtaining stable results. In this paper, to better mimic the continuous model, we use nine nodal points in RBF–FD approximation of first-order spatial derivatives. We then employ these approximations to solve a two-dimensional nonlinear diffusion equation from image processing. The constructed numerical scheme is shown to be stable and allows up to obtain four times bigger time step size than the standard scheme.

## Keywords

Multi-quadric RBF Stability Nonlinear diffusion filter Image processing Finite difference method## Introduction

The method of radial basis functions (RBF) is an important tool for the interpolation of multidimensional scattered data. Franke [7] has tested the performance of various basis functions (multi-quadric, Gaussian and splines) for the interpolation of scattered data and concluded that the multi-quadric (MQ) basis produces the most accurate results when compared with other basis functions. This observation led to development of accurate numerical schemes for the partial differential equations [2, 9, 13, 14, 15, 16, 21].

In most of the existing works on RBF-FD-based numerical schemes, the spatial derivatives have been approximated with values of the underlying function at grid points on one principal direction, for example, \(u_x\) has been approximated with values of *u* at grid points on the *X*-axis. This enables the user to employ efficient algorithms for solving the resulting system of equations. However, these three node-based schemes, in general, suffer from heavy numerical dissipation which hinders their application in image processing [5, 10, 20].

To address this issue, in this paper, an RBF–FD-based scheme is employed to obtain the \(3\times {3}\) stencil approximations for the first-order spatial derivatives. These stencils have been used to approximate the spatial derivatives in the nonlinear parabolic partial differential equation, and the time derivative is discretized using the forward difference approximation.

Further, we analyze the stability of the proposed scheme and show that it is stable under some restriction on the time step size. This restriction (bound) on the time step size is a function of the grid size and shape parameter of the radial basis functions.

The rest of the paper is organized as follows. In Sect. 2, the RBF–FD scheme for solving unsteady partial differential equations is presented. In Sect. 3, the stability analysis of the proposed scheme for two-dimensional linear diffusion equation is carried out. Finally, Sect. 4 constitutes the concluding remarks.

## An RBF–FD Scheme for Unsteady Problems

*u*is an unknown function, \(\mathbf x \in \mathbb {R}^{d}\), \(\mathscr {L}\) is a linear partial differential operator, and \(\dfrac{\partial {u}}{\partial {n}}\) is a directional derivative of

*u*in the outward normal direction

*n*. To solve this equation, we employ RBF–FD scheme [4, 21], which is briefly described as follows.

*N*be the total number of centers in the computational domain, and let

*u*values at \(n_{i}(<< N)\) centers of the local support \(\mathbf {C}_{i}\). Symbolically, this is given by

*A*) in Eq. (5). The last row in the matrix

*A*is used to have the zero sum of the coefficients.

In this work, the computations are carried out with multi-quadric and Gaussian basis functions, which are defined as \(\phi (r) = \sqrt{1+\epsilon ^2 r^2}\) and \(\phi (r) = e^{-\epsilon ^2 r^2}\), respectively. Here, *r* is the Euclidean distance between the center \(\mathbf x\) and \(\mathbf x _{i}\), and \(\epsilon\) is the (scaling) shape parameter of the basis function. It has been realized that this parameter plays an important role in the accuracy of the numerical solution [1, 2].

Note that throughout this article, we take uniform distribution of the nodes to compare our scheme with the finite difference method, which can be easily applied as the structure of the underlying nodal points (pixels) is uniform.

## Diffusion Filters in Image Processing

### Linear Diffusion Filter

In this section, we demonstrate the performance of finite difference and RBF–FD schemes for a two-dimensional heat equation with an application in image processing.

*D*is a function of the edge detector \(|\nabla {u}|\) which aims to accelerate the diffusion process in the homogeneous regions and slows down the diffusion in the non-uniform regions [12]. A typical

*D*which possesses the required characteristics is

### Stability of the RBF–FD Scheme

#### Five-Node Approximation

*X*and

*Y*directions, we obtain the following scheme for (8)

*u*(

*x*,

*y*;

*t*) at the pixel (

*i*,

*j*) at time \(n\varDelta {t}\). Here, the coefficients in Eq. (10) can be obtained by solving the local system (5) with \(n_i=5\). It can be observed that, in case of MQ, \(d_2=d_3=d_4=d_5=\dfrac{1}{h^2}+\dfrac{5}{6}\epsilon ^2\) and \(d_1=-\dfrac{4}{h^2}-\dfrac{10}{3}\epsilon ^2\), where

*h*is the grid size in both

*X*and

*Y*directions [1]. Equation (10) can be rewritten as

*U*is non-negative and the sum of all the coefficients of

*U*on the right hand side of (11) is equal to 1. These conditions enforce the restriction on time step size given by

In Fig. (1), the time step size bound for (11) is plotted against the shape parameter \(\epsilon\) with \(h=\frac{1}{2}\). One can observe from this figure that the time step size bound for finite difference scheme dominates both the MQ and Gaussian scheme bounds for all the values of the shape parameter. Therefore, the RBF–FD schemes with five-node approximation are relatively less efficient than the standard finite difference scheme.

#### Nine-Node Approximation

*n*-th time level.

*U*, which can be obtained using single index \(l={(i-1)N+j}\) with

*N*being the number of grid points in a principal axis direction, enables us to rewrite (14) as

*I*is the identity matrix and

*S*is the sparse matrix representing the convolution of

*U*with small convolution kernel of \(\varDelta {t}\times L\). The stability of (15) is guaranteed if spectral radius of the iteration matrix \((I+S)\) is less than 1 [3, 8]. One may note that this condition also ensures the stability of

*S*at each row are given in the following order:

*S*is \(\varDelta {t}(-4\alpha ^2-2\beta ^2)\). Therefore, the diagonal dominant condition will be satisfied if

### Validation

In Fig. 3, we considered a cameraman image and corrupted it with Gaussian noise of mean zero and variance 0.05. This noisy image is evolved under (8), with various values for *D*, to get a noise-free image. The parameters used in this process are \(\varDelta {t}=0.2\), \(\varDelta {x}=\varDelta {y}=1\), and the number of iterations is 2, where the high-quality filtered image is obtained. One can see from this figure that MQ is more stable, for larger *D*, than the finite difference and Gaussian schemes.

*u*being the filtered image and \(u_0\) being the reference image, is minimum when \(\epsilon =0.4\). These simulations show that RBF-based approximations may produce relatively high accurate solutions than with the standard finite difference scheme. This result encourages us to employ RBF-based schemes for the approximation of nonlinear diffusion filters.

Comparison of numerical schemes

Image | Noise level | Scheme | \(\varDelta {t}\) | \(\epsilon\) | PSNR | \(\varDelta {t}_{max}\) | PSNR index | \(T_{\varDelta {t}}\) | No of iterations |
---|---|---|---|---|---|---|---|---|---|

Lena | 0.01 | FD | 0.25 | – | 29.43 | 0.25 | 13 | 3.25 | 13 |

Gaussian | 0.25 | 0.8 | 28.14 | 0.46 | 14 | 3.5 | 8 | ||

MQ | 0.25 | 0.4 | 28.60 | 0.37 | 22 | 5.5 | 15 | ||

0.04 | FD | 0.25 | – | 25.77 | 0.25 | 12 | 3 | 12 | |

Gaussian | 0.25 | 0.8 | 25.11 | 0.46 | 13 | 3.25 | 7 | ||

MQ | 0.25 | 0.4 | 25.30 | 0.37 | 19 | 4.75 | 13 | ||

0.08 | FD | 0.25 | – | 21.18 | 0.25 | 10 | 2.5 | 10 | |

Gaussian | 0.25 | 0.9 | 21.24 | 0.44 | 14 | 3.5 | 8 | ||

MQ | 0.25 | 0.4 | 21.55 | 0.37 | 21 | 5.25 | 14 | ||

Peppers | 0.01 | FD | 0.25 | – | 27.93 | 0.25 | 12 | 3 | 12 |

Gaussian | 0.25 | 0.9 | 26.80 | 0.44 | 12 | 3 | 7 | ||

MQ | 0.25 | 0.4 | 27.05 | 0.37 | 20 | 5 | 14 | ||

0.05 | FD | 0.25 | – | 23.75 | 0.25 | 10 | 2.5 | 10 | |

Gaussian | 0.25 | 0.8 | 23.22 | 0.46 | 11 | 2.75 | 6 | ||

MQ | 0.25 | 0.4 | 23.45 | 0.37 | 17 | 4.25 | 12 | ||

0.1 | FD | 0.25 | – | 19.24 | 0.25 | 8 | 2 | 8 | |

Gaussian | 0.25 | 0.9 | 19.05 | 0.44 | 9 | 2.25 | 6 | ||

MQ | 0.25 | 0.4 | 19.18 | 0.37 | 15 | 3.75 | 11 | ||

House | 0.01 | FD | 0.25 | – | 29.39 | 0.25 | 15 | 3.75 | 15 |

Gaussian | 0.25 | 0.8 | 28.36 | 0.46 | 16 | 4 | 9 | ||

MQ | 0.25 | 0.4 | 28.81 | 0.37 | 25 | 6.25 | 17 | ||

0.05 | FD | 0.25 | – | 24.27 | 0.25 | 13 | 3.25 | 13 | |

Gaussian | 0.25 | 1 | 23.97 | 0.44 | 13 | 3.25 | 8 | ||

MQ | 0.25 | 0.4 | 24.14 | 0.37 | 24 | 6 | 17 | ||

0.1 | FD | 0.25 | – | 19.49 | 0.25 | 12 | 3 | 12 | |

Gaussian | 0.25 | 1 | 19.73 | 0.44 | 24 | 6 | 14 | ||

MQ | 0.25 | 0.4 | 20.18 | 0.37 | 45 | 11.25 | 31 |

### Nonlinear Diffusion Filter

#### Algorithm

*U*, of (8). We can rewrite (8) as

- (i)
Calculate \(f^{n}_1:=(D u_{x})^{n}\), \(f_2:=(D u_{y})^{n}\) by using the first-order derivate approximating stencils, for a given \(\epsilon\). Here, \((D u_{x})^{n}\) denotes the approximation of \((D u_{x})\) at the

*n*-th time level. - (ii)
Calculate \(g^{n}:=\partial _{x}f_1^{n}+\partial _{y}f_2^{n}\) by applying the same stencils for \(f_1^{n}\) and \(f_2^{n}\).

- (iii)
Update

*U*: \(U^{n+1}=U^{n}+\varDelta {t} g^{n}\), where \(U^n\) denotes the numerical solution at the*n*-th time level.

It can be easily seen, by assuming *D* is non-negative and bounded above by 1, that the stability of this new scheme is guaranteed if (20) is satisfied.

The performance of the nonlinear diffusion filter with standard finite difference scheme, Gaussian and MQ schemes is shown in Fig. 5.

*PSNR index*represents the iteration number at which maximum PSNR is obtained for the chosen \(\epsilon\) with step size \(\varDelta {t}=0.25\). \(T_{\varDelta {t}}\) denotes the time required to obtain the filtered image with maximum PSNR. This is obtained by multiplying

*PSNR index*with \(\varDelta {t}\). The last column of the table denotes the required number of iterations with the improved time step size \(\varDelta {t}_{max}\): \(\displaystyle \textit{Number of Iterations}=\lceil {\frac{ T_{\varDelta {t}}}{\varDelta {t}_{max}}}\rceil\), where \(\lceil \rceil\) denotes the ceiling function. One can infer from this table that the RBF (Gaussian) with \(\epsilon \in {(0.8,1)}\) is up to two times more efficient than the finite difference and RBF (MQ) schemes, since RBF (Gaussian) requires up to half the number of iterations as that of FD scheme. However, this scheme is inaccurate for larger values of \(\epsilon\) as the stencil weights tend to zero as \(\epsilon\) increases. To check the efficiency of RBF (MQ), for \(\epsilon >1\), we performed simulations on

*Lena*image for various noise levels; see Table 2. One can infer from this table that the RBF (MQ) is more stable as it allows up to 12 times bigger time step size than FD. Moreover, from the last column one can see that the RBF (MQ) is up to four times more efficient than FD, with a reasonable quality processed image. It is important to note here that the higher \(\epsilon\) improves efficiency while compromising the image quality; see Fig. 7.

Comparison of FD, MQ and Gaussian schemes

Image | Noise level | Scheme | \(\varDelta {t}\) | \(\epsilon\) | PSNR | \(\varDelta {t}_{max}\) | PSNR index | \(T_{\varDelta {t}}\) | No of Iterations |
---|---|---|---|---|---|---|---|---|---|

Lena | 0.01 | FD | 0.25 | - | 29.44 | 0.25 | 13 | 3.25 | 13 |

MQ | 0.25 | 1 | 28.34 | 0.41 | 19 | 4.75 | 12 | ||

MQ | 0.25 | 21 | 27.26 | 2.58 | 31 | 7.75 | 3 | ||

MQ | 0.25 | 41 | 27.19 | 2.87 | 33 | 8.25 | 3 | ||

Gaussian | 0.25 | 0.6 | 28.49 | 0.57 | 16 | 4 | 8 | ||

Gaussian | 0.25 | 0.8 | 28.45 | 0.46 | 13 | 3.25 | 8 | ||

Gaussian | 0.25 | 1 | 28.39 | 0.44 | 12 | 3 | 7 | ||

0.04 | FD | 0.25 | – | 25.83 | 0.25 | 13 | 3.25 | 13 | |

MQ | 0.25 | 1 | 25.28 | 0.41 | 20 | 5 | 13 | ||

MQ | 0.25 | 21 | 24.73 | 2.58 | 32 | 8 | 4 | ||

MQ | 0.25 | 41 | 24.70 | 2.87 | 33 | 8.25 | 3 | ||

Gaussian | 0.25 | 0.6 | 25.13 | 0.57 | 16 | 4 | 8 | ||

Gaussian | 0.25 | 0.8 | 25.14 | 0.46 | 13 | 3.25 | 8 | ||

Gaussian | 0.25 | 1 | 25.14 | 0.44 | 12 | 3 | 7 | ||

0.08 | FD | 0.25 | – | 21.28 | 0.25 | 11 | 2.75 | 11 | |

MQ | 0.25 | 1 | 21.27 | 0.41 | 17 | 4.25 | 11 | ||

MQ | 0.25 | 21 | 20.94 | 2.58 | 23 | 5.75 | 3 | ||

MQ | 0.25 | 41 | 20.91 | 2.87 | 23 | 5.75 | 2 | ||

Gaussian | 0.25 | 0.6 | 21.04 | 0.57 | 22 | 5.5 | 10 | ||

Gaussian | 0.25 | 0.8 | 21.04 | 0.46 | 18 | 4.5 | 10 | ||

Gaussian | 0.25 | 1 | 21.04 | 0.44 | 17 | 4.25 | 10 |

## Conclusions

In this paper, we have analyzed multi-quadric and Gaussian-based RBF–FD schemes for two-dimensional linear and nonlinear diffusion equations. It has been shown that the stability of RBF–FD scheme, derived using three-node approximation for first-order spatial derivatives, is guaranteed for a relatively smaller time step size than that of the standard finite difference scheme.

We have improved the time step size bound for RBF–FD scheme by considering nine nodes in the approximation of first-order spatial derivatives. We then analyzed the stability of the resulting \(5\times {5}\) stencil scheme for two-dimensional parabolic equations, and shown that this scheme allows up to four times larger time step size than the standard finite difference scheme.

To analyze the practical applicability of the proposed RBF–FD scheme, we have considered a second-order nonlinear partial differential equation from image processing. We showed that the Gaussian-based RBF–FD scheme for \(\epsilon \in {(0.8,1)}\) is twice efficient than multi-quadric and finite difference schemes. Further, for larger values of the shape parameter \(\epsilon\), we demonstrated that the MQ scheme is up to four times more efficient than the standard finite difference scheme. We emphasize here that this gain in efficiency with MQ scheme comes at the expense of filtered image quality. Therefore one should be cautious about trade-off between efficiency and the processed image quality while employing the MQ-based RBF–FD scheme for a nonlinear diffusion filter.

In future, we wish to work on the selection of optimal shape parameter for multi-quadric and Gaussian-based RBF–FD schemes to solve the time-dependent higher-order nonlinear partial differential equations.

## Notes

### Acknowledgements

The authors would like to thank the anonymous reviewers for their valuable suggestions and comments for improving the quality of the paper.

### Conflict of interest

### Conflicts of interest

On behalf of all authors, the corresponding author states that there is no conflict of interest.

## References

- 1.Bayona V, Moscoso M, Carretero M, Kindein M. RBF-FD formulas and convergence properties. J. Comput. Phys. 2010;229:8281–95.CrossRefGoogle Scholar
- 2.Bayona V, Moscoso M, Kindelan M. Gaussian RBF-FD weights and its corresponding local truncation errors. Engineering Analysis with Boundary Elements. 2012;36(9):1361–9. http://www.sciencedirect.com/science/article/pii/S0955799712000720.MathSciNetCrossRefGoogle Scholar
- 3.Bulirsch R, Stoer J. Introduction to numerical analysis. Heidelberg: Springer; 2002.zbMATHGoogle Scholar
- 4.Chandhini G, Sanyasiraju YVSS. Local RBF-FD solutions for steady convection-diffusion problems. Int J Num Methods Eng. 2007;72(3):352–78. https://onlinelibrary.wiley.com/doi/abs/10.1002/nme.2024.MathSciNetCrossRefGoogle Scholar
- 5.Chen D, MacLachlan S, Kilmer M. Iterative parameter-choice and multigrid methods for anisotropic diffusion denoising. SIAM J Sci Comput. 2011;33(5):2972–94. https://doi.org/10.1137/100796066.MathSciNetCrossRefzbMATHGoogle Scholar
- 6.Fornberg B, Lehto E, Powell C. Stable calculation of gaussian-based RBF-FD stencils. Comput Math Appl. 2013;65(4):627–37. http://www.sciencedirect.com/science/article/pii/S0898122112006529.MathSciNetCrossRefGoogle Scholar
- 7.Franke R. Scattered data interpolation: tests of some method. Math Comput. 1982;38(157):181–200. http://www.jstor.org/stable/2007474.MathSciNetzbMATHGoogle Scholar
- 8.Hajiaboli MR. An anisotropic fourth-order diffusion filter for image noise removal. Int J Comput Vis. 2011;92(2):177–91.MathSciNetCrossRefGoogle Scholar
- 9.Kansa EJ. Multiquadrics- a scattered data approximation scheme with applications to computational fluid-dynamics-ii: Solutions to parabolic, hyperbolic and elliptic partial differential equations. Comput Math Appl. 1990;19:147–61.MathSciNetCrossRefGoogle Scholar
- 10.Mahipal J, Sharma SK, Sundar S. On a generalized \(5\times {5}\) stencil scheme for nonlinear diffusion filtering. Int J Adv Eng Sci Appl Math. 2016;8(3):194–206. https://doi.org/10.1007/s12572-016-0163-4.MathSciNetCrossRefzbMATHGoogle Scholar
- 11.Michelli CA. Interpolation of scattered data: distance matrices and conditionally positive definite functions. Construct Approx. 1986;2:11–22.MathSciNetCrossRefGoogle Scholar
- 12.Perona P, Malik J. Scale-space and edge detection using anisotropic diffusion. IEEE Trans Pattern Anal Mach Intell. 1990;12(7):629–39.CrossRefGoogle Scholar
- 13.Petras A, Ling L, Ruuth S. An RBF-FD closest point method for solving pdes on surfaces. J Comput Phys. 2018;370:43–57. http://www.sciencedirect.com/science/article/pii/S002199911830322X.MathSciNetCrossRefGoogle Scholar
- 14.Sanyasiraju Y, Chandhini G. Local radial basis function based gridfree scheme for unsteady incompressible viscous flows. J Comput Phys. 2008;227(20):8922–48. http://www.sciencedirect.com/science/article/pii/S0021999108003690.MathSciNetCrossRefGoogle Scholar
- 15.Shankar V, Wright GB, Kirby RM, Fogelson AL. A radial basis function (RBF)-finite difference (FD) method for diffusion and reaction-diffusion equations on surfaces. J Sci Comput. 2015;63(3):745–68. https://doi.org/10.1007/s10915-014-9914-1.MathSciNetCrossRefzbMATHGoogle Scholar
- 16.Slak J, Kosec G. Refined rbf-fd solution of linear elasticity problem. In: 2018 3rd International Conference on Smart and Sustainable Technologies (SpliTech). pp. 1–6 (2018).Google Scholar
- 17.Wang W, Wang Y, Wu Y, Lin T, Li S, Chen B. Quantification of full left ventricular metrics via deep regression learning with contour-guidance. IEEE Access. 2019;7:47918–28.CrossRefGoogle Scholar
- 18.Wang Y, Chen W, Zhou S, Yu T, Zhang Y. Mtv: modified total variation model for image noise removal. Electron Lett. 2011;47(10):592–4.CrossRefGoogle Scholar
- 19.Wang YQ, Guo J, Chen W, Zhang W. Fast communication: Image denoising using modified perona malik model based on directional laplacian. Signal Process. 2013;93(9):2548–58. https://doi.org/10.1016/j.sigpro.2013.02.020.CrossRefGoogle Scholar
- 20.Weickert J, Scharr H. A scheme for coherence-enhancing diffusion filtering with optimized rotation invariance. J Vis Commun Image Rep. 2002;13(1):103–18.CrossRefGoogle Scholar
- 21.Wright G, Fornberg B. Scattered node compact finite difference-type formulas generated from radial basis functions. J Comput Phys. 2006;212:99–123.MathSciNetCrossRefGoogle Scholar
- 22.Zhou S, Lu Y, Li N, Wang Y. Extension of the virtual electric field model using bilateral-like filter for active contours. Signal Image Video Process. 2019. https://doi.org/10.1007/s11760-019-01456-x.CrossRefGoogle Scholar