# Time Parallel Denoising Algorithm Based on P-M Equation for Real Image

Authors: Guoliang He
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

This paper combines the regularized Perona and Malik model with the time parareal algorithm to denoise the real image which has the characteristics of typical Gaussian noise. This method can remove the noise stably and effectively and has high calculation efficiency. For the real color image of6000×4000 pixels, the time cost can be shortened from one minute in serial computing to a few seconds based on our combination method if we do not care about the requirement of computing hardware. This provides some reference for practical engineering application.


---

## Body

## 1. Introduction

Image denoising is a process of reducing noise in digital image. Digital image is often contaminated by noise from imaging equipment and external environment in the process of digitization and transmission, which makes an image have a variety of noises in practical applications. These noises cause a lot of detrimental effects on the analysis and application of image. In addition, the process of image regeneration will be inevitably be polluted by noise, which also damages the quality of the image. These noises not only influence people’s visual effect but also lead to some difficulty for the subsequent analysis of the image. Therefore, it is necessary to denoise the image in order to improve signal to noise ratio (SNR).Traditional image denoising methods include the following [1–3]: mean filter (MF), geometric mean filter (GMF), inverse harmonic mean filter (IHMF), Wiener filter (WF), median filter (MF), morphological noise filter (MNF), wavelet denoising (WD), variational filtering (VF), and differential equation filtering (DEF). The MF uses the neighborhood average method, which is suitable for removing the particle noise in the scanned image. GMF can achieve the same smoothness as MF, but more image details will be lost in the process of filtering. The IHMF is suitable for dealing with impulse noise and has good effect on “salt” noise, but it needs to know in advance whether the noise is dark noise or bright noise; in other words, selecting on appropriate filter order is necessary. If the order symbol selected is inappropriate, it may cause very bad consequences. AWF can adjust the output of the noisy image according to the local variance of the image. The larger the local variance is, the stronger the smoothing effect of the filter is. The filtering effect of this method is better than that of the MF, and it is useful to retain the edge of the image and other high-frequency parts, but the calculation is also large. MF is a commonly used nonlinear smoothing filter. Its basic idea is to replace the value of a point in a digital image or digital sequence with the median value of each point in a field of that point, so that isolated noise points can be eliminated. Therefore, MF is very effective for filtering salt and pepper noise in an image. However, if an image has many details, especially for those with many points, lines, and spires, median filtering is not suitable for image noise reduction. Morphological noise filter combines open operation and close operation to filter noise. The applicable image type of this method is that the object size in the image is relatively large, and there is no small details.General speaking, according to the characteristics of high frequency noise, neighborhood average method can effectively suppress the noise, but it can also cause the fuzzy phenomenon. The fuzzy degree is usually proportional to the domain radius [2, 4, 5].In addition, wavelet denoising, total variation denoising model, such as TV model, deep learning-based denoising methods, such as NL means method, etc., are good at dealing with some problems at present [6–9], but the noise processing of real image with large size is still of inefficiency. They all inevitably face the same problem: although the CPU’s or GPU’s performance has been improved by hundreds of times, it is far from meeting the real-time computing needs, which largely limits the use of these algorithms because people cannot bear to wait for several minutes to process a single photograph. Therefore, there is still a distance between these denoising methods and the practical application.The real image noise is usually signal related, but there is no clear distribution to simulate, which brings great difficulties to the practical application. Generally speaking, the global distribution of noise image is not Gaussian distribution, but the noise of different channels of all local image blocks can be approximately regarded as the Gaussian distribution with different variance [11, 12], which provides a good theoretical support for deducing the actual image noise.PDE method, a kind of image processing method which rises in recent years, has achieved good results in image processing [13–15]. This kind of method has the characteristics of anisotropy. In image denoising, it can depress the noise and keep the edge well, especially for Gaussian type noise. Recently, the research of image processing method based on PDE is a hot research direction of image denoising and has achieved some theoretical and practical application results. The basic idea of denoising method based on differential equation is to establish an initial condition of noise image as a certain nonlinear PDE (i.e., filtering results), using the diffusion characteristics of differential equation to continuously reduce the high-frequency part, solving the diffusion PDE, and getting the solution at different times. The solution of PDE mainly adopts the time iteration method, which makes the image approach to the desired mode gradually through the iteration. The typical representative of this algorithm is Perona and Malik’s equation as well as the subsequent improvement [16]. This method has a large selection in determining the diffusion coefficient and has the function of backward diffusion as well as forward diffusion. Therefore, it has the ability of smoothing the image and sharpening the edge. Besides, a large number of experiments show that this kind of method has a good effect in removing Gaussian noise [11, 12].It is also worth noting that although PDE method as mentioned above has achieved good results in image processing with low noise density, the denoising effect is not good in image processing with high noise variance, and the processing time is significantly higher than low density. Time parallel-based algorithm is a fast algorithm to solve time-related problems, which can effectively improve the efficiency of calculation [17–19]. It is a desirable method in the situation of high demand for calculation time. It should be noted that although large-scale parallel computing devices do not seem to be available frequently, with the rapid development of cloud computing and edge computing, the computing environment supported by hardware will be greatly improved, thus providing more possibilities and opportunities for image parallel computing [10].Perona and Malik proposed a PDE filter-based nonlinear diffusion model (P-M model) [16]. P-M is a nonlinear anisotropic method, which aims to overcome the shortcomings of fuzzy edge and edge position moving in linear filtering method. The basic idea is to reduce the diffusion coefficient where the image features are strong and enhance the diffusion coefficient where the image features are weak. The anisotropic denoising model determines the diffusion speed according to the gradient value of the image, so that it can meet the requirements of both noise depression and edge preservation. These models, represented by P-M equation, have been widely used in image enhancement, image segmentation, edge detection, and other fields and achieved good results. The below part gives a brief introduction to the P-M model.Perona and Malik first proposed a nonlinear P-M model that can maintain the boundary. The primary P-M model is:(1)∂Ix,y,t∂t=divg∇I⋅∇I,Ix,y,0=I0,where I0is the original image, Ix,y,t is the diffusion image of the original image at time t, ∇ is the gradient operator, div is the gr=1 divergence operator, and gr is the diffusion coefficient. The ideal diffusion coefficient gr should make the anisotropic diffusion fast in the region where the gray level changes gently and low-speed diffusion or even nonproliferation function in the position where the gray level changes sharply (i.e., the image feature), so gr>0 is a nonincreasing function. If the model degenerates into heat conduction equation, Perona and Malik give two diffusion coefficients:
(2)gr=e−r/K2,where the constant K is related to the variance of noise. P-M model is an improved partial differential equation of heat conduction, which can adaptively control the diffusion velocity by the function gr. The P-M model makes use of the function gr to control the diffusion speed, that is to say, the method increases the smoothing intensity inside the region while decreases the smoothing intensity at the edge. In the P-M model, the diffusion size is determined by the absolute value of the gradient of the pixel. If the absolute value of the gradient of a point in the image is greater than the K value, the gradient value will slowly decrease with the increase of the number of iterations in the process of iteration, playing the role of maintaining the edge. However, if the absolute value of the gradient of the point is less than the K value, the gradient value will soon tend to 0 in the process of iteration, playing a smooth effect. In the P-M model, the edge is identified by the gradient differential operator.It should be noted that P-M Equation (1) can bring good results in suppressing noise and preserving important features of image, but it is ill-conditioned and unstable. In order to eliminate the “ill-condition” of the P-M equation and maintain the well posed property, the image is presmoothed by using the original Gaussian convoluting image. Catte introduces a regular P-M model in [20]:
(3)It=divg∇Iσ∇I,where Iσx,y,t=Gσ∗Ix,y,t. Here, Gσ is the Gaussian function with variance σ, and ∗ is convolution. The regularized P-M model can eliminate the noise better than the mean value method and can overcome the ill-pose of the initial value of the P-M model. This model (3) is a regularization model in space domain, which overcomes the sensitive ∇Irelation to noise. We can prove that the solution of the regularization model is unique, and the solution is stably depended on initial value continuously [20, 21]. This paper is aimed at developing the numerical solution of the second order nonlinear diffusion Equation (3) efficiently.


## 2. Numerical Method of the P-M Model

For the P-M equation, the classical finite difference time-space total discretization mainly has two kinds of schemes: explicit and implicit. The explicit method does not need to solve large discrete linear equations and can directly compute large images. However, this method is very strict to the time step and the space step, which results in that the image dimension discretized directly can be very large and costs much iteration time actually. On the other hand, the implicit method has no limitation on the time discretization, but it needs to solve a set of equations repeatedly. If the implicit method is used to do with the large image, because the dimension of discrete equations is very huge and the singularity is very serious, it inevitably brings the low computational efficiency.Aiming at P-M model, this paper combines explicit method, implicit method, and time parareal algorithm to construct a new time parallel iterative format. This algorithm adopts explicit computing in relatively fine time grids and implicit computing in rough time grids and accelerates the iteration by time parareal method. It can deal with large image directly and save more time in denoising.For ease of discretization, the two-dimensional regularized P-M equation can be rewritten in the following form (for detailed introduction, please refer to literature [16, 20]):
(4)∂It=∂xg∇Iσ⋅∂Ix+∂yg∇Iσ⋅∂Iy.LetNmaxx, Nmaxy, and Nmaxt represent the maximum iteration steps in the X direction, Y direction, and time direction, respectively. For the sake of simplicity, we take the equal steps in the x direction and y direction, that is, Δx=Δy=h, and Δt=τ is the time step, the grid coordinate is xi,yi,tnn=ih,jh,nτ, 0<i≤Nmaxx,0<j≤Nmaxy,0<n≤Nt=Nmaxt, Ii,jn is the approximate value of Iih,jh,nτ, and let gi,j=g∇Iσi,j.The time explicit difference format is introduced first. In reference [13], Perona and Malik give the following explicit difference scheme to solve Equation (4):
(5)Ii,jn+1=Ii,jn+λ⋅gNn⋅∇NnI+gSs⋅∇SnI+gEn⋅∇EnI+gWw⋅∇WnI.In the above explicit scheme (5), N, S, E, and W present North, South, East, and West, respectively, and λ=τ/h. Because the region normalized h is generally small, for example, h=0.001, the stability of numerical solution for the explicit relation (5) needs theoretically the time step is λ=1000τ,λ<0.25, namely, τ<0.00025 is required. If the symbol ∇in formula (5), difference quotient, is used, the specific discrete form is follows:
(6)∇NIi,j=Ii,j+1−Ii,j,⋅∇EIi,j=Ii+1,j−Ii,j,∇SIi,j=Ii,j−1−Ii,j,⋅∇wIi,j=Ii−1,j−Ii,j.Let us see the time semi-implicit difference scheme. The right side of Equation (3) can be written as:
(7)divg∇I=∂∂xg∂I∂x+∂∂yg∂I∂y.In practical application, a divergence discretization format called “half point” discretization [13, 23] is often used. The main idea includes the following steps.First, calculate the value ofgIx at “half point” in the “East, West” direction and “half point” in the “South, North” direction, respectively, and then, the implicit format is obtained as follows:
(8)Ii,jn+1=Ii,jn+τ⋅gi−1,jn+gi,jn2⋅Ii−1,jn+1−Ii,jn+1+gi+1,jn+gi,jn2⋅Ii+1,jn+1−Ii,jn+1+gi,j−1n+gi,jn2⋅Ii,j−1n+1−Ii,jn+1+gi,j+1n+gi,jn2⋅Ii,j+1n+1−Ii,jn+1.In the above formula (8), the value of gr at “half point” is approximated by the average of two adjacent whole points, that is,
(9)gi,j+1/2≈gi,j+1+gi,j2,⋯gi,j−1/2≈gi,j−1+gi,j2,gi+1/2,j≈gi+1,j+gi,j2,⋯gi−1/2,j≈gi−1,j+gi,j2.Thus, by using semi-implicit scheme, a system of linear equations is obtained, which is represented by matrix as follows:(10)In+1=In+τ⋅An⋅Inn+1,where Ii,jn and Ii,jn+1 present the approximate image for the nth time step and next time step, respectively. Equation (10) is an implicit format, and τis a time step. The above formula can be written as follows:
(11)In+1=1−τ⋅An−1In.IfIn+1 or In is a matrix of M×N, then matrix A is a dimensional sparse matrix, but not a tridiagonal matrix. Because the coefficient matrix is very large and the solution efficiency is not high, Weickert and Scharr proposed the additive operator splitting (AOS) algorithm in [22]:
(12)1−2τ⋅AxnI1n+1=In,1−2τ⋅AynI2n+1=In.Then, the mean value of the two terms is calculated as a complete iterative process:(13)In+1=12I1n+1+I2n+1.Note: it is worthy of note that AOS algorithm is absolutely stable. It can choose a large time step to improve the efficiency of calculation and satisfy the invariance of digital rotation.The time parallel computing method is described below. P-M equation is time-dependent. Due to the irreversibility of time evolution, time-dependent equation can only be solved by strict time iteration algorithms. Until 2001, Lions and others proposed a real-time parallel algorithm based on time decomposition for solving time-depended problems (parareal algorithm) [13, 24, 25]. From this method was firstly proposed to today, it has been widely studied and applied in a few years. The algorithm decomposes the unsteady phase of Eulerian time differential system and solves the problem iteratively on the rough and fine grids of different scales, respectively.Here is a brief introduction to the parareal algorithm [13], including some improvements to make it suitable for the problems we need to calculate. Suppose the following time-dependent equations are generally considered:
(14)∂u∂t=Du,t∈t0,t1,ut0=u0.For the above differential system,D is a differential operator independent of time differential, either linear or nonlinear. For example, for the two-dimensional heat conduction equation, the linear operator D=auxx+uyy, where a is a constant greater than 0.For the above model Equation (14), the basic idea of time parareal is to divide the whole calculation time into several subintervals and then calculate in each subinterval at the same time. The basic algorithm is as follows:
(i)
Step 1: given precisionε>0, with the idea of domain decomposition, the time interval t0,t1 is divided into the following equidistant subintervals (rough time grids):(15)Γ=t0=T0<T1⋯<Tn<Tn+1⋯<TNt−1<TNt=t1,For convenience, letΔT=Tn+1−Tn. For the whole time interval t0,t1, the solution defined in the whole interval can be transformed into N subproblems defined in each subinterval Tn,Tn+1, n=1,2,⋯Nt(ii)
Step 2: based on the rough time gridsΓ, take the explicit or implicit serial methods to calculate the sketchy approximate of the whole time points uTn:u1,u2,⋯,un,⋯,uNt−1,uNt. For the convenience of the discussion, the calculation format on Γ can be written as follows:(16)un+1=CΔtun,n=12⋯Nt,,whereCΔt is a numerical calculation format, for example, implicit or explicit.
(iii)
Step 3: subdivide each subintervalTn,Tn+1 into fine intercells:(17)Tn=Tn0<Tn1⋯Tni<Tni+1⋯<Tns=Tn+1,where s is number of the points in every subinterval Tn,Tn+1.
(iv)
Set the time interval length after subdivision isδt=Tni+1−Tni. Assign the value un,n=1,2,⋯,Nt obtained in the second step to n subintervals as the initial condition of each interval. Solve parallelly Equation (14) in each intercells Tn−1,Tn,n=1,2,⋯,Nt:(18)un1,un2,⋯,uni,uni+1,⋯uns,n=1,2,⋯,Nt.We can write the calculation format as follows:(19)uni+1=Fδtuni,i=12⋯s.(v)
Step 4: correct the solutionuni on the rough grids by combining the solution obtained on the fine grids and then finish one-time iterative solution:(20)un+1k+1=CΔtunk+1+Fδtunk−CΔtunk,k=0,1,2,⋯,M,where the superscripts k+1 and k are the number of iterative correction, and M is maxim correction steps.
(vi)
Step 5: if the error meets the accuracy,uk+1−uk<ε, the iteration will be stopped; otherwise, the iteration will go to the second step to continue the iterationNote: in order to realize parallel computing quickly, rough and fine time grids are divided before each iteration. In each iteration, the results calculated in the last iteration need to be transmitted to the corresponding computing cells.This paper combines AOS algorithm based on P-M model with time parareal method to denoise image. First of all, AOS is used to solve the approximate value on the rough time steps, since the fine intercell length is generally small after subinterval is subdivided, which can meet the requirements of the explicit method. Thus, explicit format can be used for parallel calculation on each subinterval, to increase the calculation accuracy and speed. The main discrete formats of our algorithm on denoising are listed below.First, the implicit difference dispersion of Equation (3) is obtained
(21)Ii,jn+1=Ii,jn+τ⋅gi−1,jn+gi,jn2⋅Ii−1,jn+1−Ii,jn+1+gi+1,jn+gi,jn2⋅Ii+1,jn+1−Ii,jn+1+gi,j−1n+gi,jn2⋅Ii,j−1n+1−Ii,jn+1+gi,j+1n+gi,jn2⋅Ii,j+1n+1−Ii,jn+1.The AOS methods (12) and (13) are used to solve the above discrete scheme (21). The initial guess values obtained on the rough time grids are set as the initial value of intercell parallel computing.Next, on the fine grids, use the following explicit scheme for calculation:(22)Ii,jn+1=Ii,jn+λ⋅gNn⋅∇NnI+gSs⋅∇SnI+gEn⋅∇EnI+gWw⋅∇WnI.Furthermore, use the formula to correct the previous two calculations:(23)un+1k+1=CΔtunk+1+Fδtunk−CΔtunk.Take the corrected results as the initial value of the next iteration. Computing in this way, we continue to iterate until reach the ideal degree of accuracy.Note: parareal algorithm is very efficient for time-dependent equation(s). Compared with traditional domain parallel methods, the remarkable feature of this algorithm is its time parallel. Many test examples show that the algorithm has fast convergence, high efficiency, and easy to program. It is also worth noting that if one can consider the time variable as a special spatial variable, he can use the domain decomposition algorithm based on spatial variables to calculate the change of time dimension. Therefore, in this sense, time parareal algorithm is also a domain decomposition algorithm, which is just a nonoverlapping domain decomposition algorithm.


## 3. Results and Discussion

In order to test the denoising effect of the above-mentioned parallel algorithm based on iteration, the time explicit method, the implicit method, and the time parareal computing technique of P-M equation are used to denoise the noisy image. In order to evaluate the denoising effect, we introduce the mean squared error (MSE) to assess the approximation degree to original clear image and choose termination index of the denoising. The mean square deviation measure of image is given by the following formula:(24)MSE=∑i=1M∑j=1NIi,j−I∧i,j2Mx⋅Ny.In the above formula (24), Ix,y is the noisy image, I∧x,y is the denoised image, Mx,Ny are the number of pixels in the x,y direction of the image. Based on the above definition, the smaller the mean square deviation measure is, the closer the denoised image is to the original image, the better of the denoising effect is.For the sake of simplicity, firstly, we choose a gray image to illustrate the effect of denoising based on time parareal and P-M model. Since the noise of the actual image can be approximated by Gaussian noise, here, we add some Gaussian noise to the original image to get the noisy image. The first part (part a) in Figure1 is the selected actual image of 6000×4000 pixels. The b part is a noisy image-attached normal Gaussian noise with standard deviation of 15. Part c in Figure 1 is the result of denoising image based on the time parareal method and P-M model.Figure 1
Original image, noisy image, and denoising image.
(a)
Original image(b)
Noisy image (σ=15)(c)
Denoising imageFigure2 shows the different distribution in strong contrast and low contrast area of Gaussian noise image with variance of 15. Since the variance of noise is 15, it is relatively small compared with the maximum value 255 of gray image, so there is obvious noise pollution in the light part of image. In the light and dark part of the two small images on the right, the influence of noise can also be seen clearly. This kind of influence is similar to the image we take in the dark scene or high ISO light sensitive situation, so this kind of experiment has a good representativeness in real image capture and processing.Figure 2
Different distribution of Gaussian noise image (σ=15).The following Figure3 is the MSE change curve depended on time of the above-mentioned landscape denoising using the explicit, implicit, and time parareal algorithm. The abscissa is the time, and the ordinate represents the value of MSE. The top curve represented by a circle in the figure comes from the time parareal algorithm, the middle curve represented by a plus sign comes from the implicit serial algorithm, and the next curve with a small rectangle comes from the time serial algorithm. In order to ensure the accuracy and convergence of denoising, the time step of explicit scheme is 0.0005, and maxim iteration step is 4000; the time step of implicit scheme is 0.05 times, and the result of 400 iterations is adopted; the parareal calculation scheme is divided the interval t0,t1 into 100 subintervals and adopts implicit scheme, each subinterval is divided into 120 small intercells, and 3 rounds of parallel iteration is finished.Figure 3
MSE comparison of time parareal method and explicit and implicit method.Note: the denoising method based on PDE generally achieves a better denoising effect after appropriate number of time iteration, but the curve of time parareal algorithm is not a simple curve changing with time, because the time parareal algorithm is paralleled between regions and the converging to the original equation is a whole process, and does not simply come from the sample data after the parallel algorithm converges with time. So, the solution here is to select a parallel computing result after global convergence as the representative of the solution in different time steps and then make these computing results evenly distributed on the computing time axis. So, the time axis here is the last round of parallel iteration, that is, the change of MSE with time in the third round (see the circle-solid curve in the following Figure2).It can be seen from Figure2 that, in general, the algorithm based on time parareal can save computing time effectively when the computing hardware resources (100 computing cells/processes) are ignored. The implicit format takes a relatively large time step. Although each iteration needs to solve two tridiagonal equations, the overall time spent is relatively small. However, the explicit serial computing is relatively simple; since a relatively small step is taken here, the time spent is actually the longest one and not dominant among the three methods. The following table shows the minimal MSE value and corresponding the cost time and iterations of explicit format, implicit format, and time parareal format.From Table1, we can get intuitively, the smaller the MSE, the closer the denoised image is to the original image, the better the denoising effect. Besides, because the explicit method requires a strict time step and there are many iterations needed, the iteration takes a lot of time. It takes about 1 minute to reach the minimum value, but the MSE values are generally smaller, and the MSE minimum computed is also the smallest one. Although the implicit method can take a larger step size, in order to ensure the effect of denoising, the step size should not be too large, which requires less time than the explicit method and is relatively stable. For the parareal algorithm, in theory, if the number of iterations is enough, the convergence of the calculation is determined by the step size of the fine grids. However, because the number of iterations is relatively small (only 3 turns), the MSE value is also affected by the step size of the rough grids. In this way, the MSE is the largest of the three, but the time is really saved.Table 1
Efficiency comparison for different methods.
Min (MSE)Time (s)IterationsExplicit method0.30664757.449693794Implicit method0.47813516.06848359Parareal method0.6240975.051357—Figure4 is a denoised image based on the time parareal method. The effect is better in the distribution of strong contrast and low contrast than the local mean method mentioned in the introduction. Although the time parareal MSE is larger than the explicit and implicit schemes, the L2 norm represents the macrodistribution level of noise, so there is little difference in the macroperformance of the image after denoising. In fact, for small-scale images, for the same scale of noise level, the explicit, implicit, and time parareal method cost the same time to denoise, they can also achieve the same noise level. Furthermore, if we choose different steps to calculate, the difference is not conspicuous.Figure 4
Denoising effect of Gaussian noise overlay (σ=15).In addition, the three discrete methods, in general, smoothen the image features in different degrees while smoothing the noise, but pay attention to the twigs on the rock, based on P-M method; the processing effect is relatively good at the noise level of variance 15.Here are also three points worth noting: first, large-scale parallel computing devices do not seem to be often available, but the development of cloud computing and edge computing provides more possibilities for image parallel computing. Secondly, generally speaking, the convergence of time parareal algorithm is related to the governing equation. If the equation is highly nonlinear, the time step should be relatively small, or a more stable method should be used, such as implicit method or multistep method. Finally, because the calculation range of time is usually uncertain, we cannot deal with time parallelism completely according to the spatial parallel algorithm, which is also different from spatial parallelism.


## 4. Conclusions

Based the above discussion of the classical nonlinear diffusion equation, P-M model, a fast denoising method is obtained by combining the unconditionally stable explicit and implicit schemes with the time parareal computing. Experimental results show that the parallel algorithm can effectively remove the noise while maintaining the image edge information. Compared with the traditional explicit method, the effect of noise removal is not as good as that of implicit method, and the running time is far less than that of implicit method. It is about a few percent of the implicit scheme. Therefore, the image denoising algorithm based on time parareal and P-M model is an efficient and feasible numerical scheme, which can be applied to large-scale image denoising and has a good application prospect.



---

*Source: 8008912-2022-08-11.xml*