Unsharp Mask Guided Filtering

The goal of this paper is guided image filtering, which emphasizes the importance of structure transfer during filtering by means of an additional guidance image. Where classical guided filters transfer structures using hand-designed functions, recent guided filters have been considerably advanced through parametric learning of deep networks. The state-of-the-art leverages deep networks to estimate the two core coefficients of the guided filter. In this work, we posit that simultaneously estimating both coefficients is suboptimal, resulting in halo artifacts and structure inconsistencies. Inspired by unsharp masking, a classical technique for edge enhancement that requires only a single coefficient, we propose a new and simplified formulation of the guided filter. Our formulation enjoys a filtering prior from a low-pass filter and enables explicit structure transfer by estimating a single coefficient. Based on our proposed formulation, we introduce a successive guided filtering network, which provides multiple filtering results from a single network, allowing for a trade-off between accuracy and efficiency. Extensive ablations, comparisons and analysis show the effectiveness and efficiency of our formulation and network, resulting in state-of-the-art results across filtering tasks like upsampling, denoising, and cross-modality filtering. Code is available at \url{https://github.com/shizenglin/Unsharp-Mask-Guided-Filtering}.


I. INTRODUCTION
I MAGE filtering has been widely used to suppress unwanted signals (e.g., noise) while preserving the desired ones (e.g., edges) in image processing tasks like image restoration [1]- [3], boundary detection [4]- [6], texture segmentation [7]- [9], and image detail enhancement [10]- [12]. Standard filters, such as Gaussian filters and box mean filters, swiftly process input imagery but suffer from content-blindness, i.e., they treat noise, texture, and structure identically. To mitigate contentblindness, guided filters [13]- [18], have received a great amount of attention from the community. The key idea of guided filtering is to leverage an additional guidance image as a structure prior and transfer the structure of the guidance image to a target image. By doing so, it strives to preserve salient features, such as edges and corners, while suppressing noise. The goal of this paper is guided image filtering.
Classical guided filtering, e.g., [13], [19]- [21], performs structure-transferring by relying on hand-designed functions. Nonetheless, it is known to suffer from halo artifacts and structure inconsistency problems (see Fig. 1), and it may require a considerable computational cost. In recent years, guided image filtering has advanced by deep convolutional neural networks. Both Li et al. [22] and Hui et al. [23] demonstrate the benefits of learning-based guided filtering over classical guided filtering. These works and their follow-ups, e.g., [24]- [26], directly predict the filtered output by means of feature fusion from the guidance and target images. Yet, The authors are with the Informatics Institute of the University of Amsterdam, Amsterdam, the Netherlands. this implicit way of structure-transferring may fail to transfer the desired edges and may suffer from transferring undesired content to the target image [26], [27].
Pan et al. [27] propose an alternative way to perform deep guided filtering. Rather than directly predicting the filtered image, they leverage a shared deep convolutional neural network to estimate the two coefficients of the original guided filtering formulation [13]. While their approach obtains impressive filtering results in a variety of applications, we observe their network has difficulty disentangling the representations of the two coefficients, resulting in halo artifacts and structure inconsistencies, see Fig. 1. Building on the work of Pan et al. [27], we propose a new guided filtering formulation, which depends on a single coefficient and is therefore more suitable to be solved by a single deep convolutional neural network.
We take inspiration from another classical structuretransferring filter: unsharp masking [28]- [31]. From the original guided filter by He et al. [13] we first derive a simplified guided filtering formulation by eliminating one of its two coefficients. So there is only one coefficient left to be estimated for deciding how to perform edge enhancement, akin to unsharp masking. To arrive at our formulation, we rely on the filtering prior used in unsharp masking and perform guided filtering on the unsharp masks rather than the raw target and guidance images themselves. The proposed formulation enables us to intuitively understand how the guided filter performs edge-preservation and structure-transferring, as there is only one coefficient in the formulation, rather than two in [27]. The coefficient explicitly controls how structures need to be transferred from guidance image to target image and we learn it adaptively by a single network. To that end, we introduce a successive guided filtering network. The network obtains multiple filtering results by training a single network. It allows a trade-off between accuracy and efficiency by choosing different filtering results during inference. This leads to fast convergence and improved performance. Experimental evaluation on seven datasets shows the effectiveness of our proposed filtering formulation and network on multiple applications, such as upsampling, denoising, and cross-modality filtering.
II. BACKGROUND AND RELATED WORK In guided filtering, we are given an image pair (I, G), where the image pair has been properly registered by default. Image I needs to be filtered, e.g., due to the presence of noise or due to low resolution because it is captured by a cheap sensor. Guidance image G contains less noise and is of high resolution with sharp edges, e.g., because it is captured by accurate sensors under good light conditions. The low-quality image I can be enhanced by filtering under the guidance of highquality image G. Such a guided filtering process is defined Fig. 1: Motivation of this paper. We show an example of depth upsampling (16×) using an RGB image as guidance. Both the conventional guided filter by He et al. [13] and the state-of-the-art deep guided filter by Pan et al. [27] explicitly estimate two coefficients, respectively (ā,b) and (f α , f β ). In their current formulation, however, both methods are likely to over-smooth edges (compare edges in blue boxes) and transfer unwanted textures (compare highlighted details in red boxes). Our proposed guided filter, taking inspiration from unsharp masking, only requires learning a single coefficient f a (notation details provided in Sections 2 and 3). As a result, we obtain a more desirable upsampling result, free of undesirable structures and textures from the guidance image. asÎ = F(I, G), where F(·) denotes the filter function and I denotes the filtered output image. Below, we first review the benefits and weaknesses of classical guided filter functions and existing deep guided filter functions. We then present how our proposal can be an improved guided filtering solution by establishing a link to unsharp masking.

A. Classical guided filtering
The guided image filter [13] assumes that the filtered output imageÎ is a linear transform of the guidance image G at a window w k centered at pixel k: where a k and b k are two constants in window w k . Their values can be obtained by solving: Here, is a regularization parameter penalizing large values for a k . The optimal values of a k and b k are computed as: Here,Ḡ k and σ 2 k are the mean and variance of G in w k ,Ī k is the mean of I in w k , and |w| is the number of pixels in w k . For ease of analysis, the guidance image G and filtering target image I are assumed to be the same [13], although the general case remains valid. As a result, we can obtain: Based on this, the regions and edges with variance (σ 2 k ) much larger than are preserved, whereas those with variance (σ 2 k ) much smaller than are smoothed. Hence, takes control of the filtering. However, the value of in the guided image filter [13] is fixed. As such, halos are unavoidable when the filter is forced to smooth some edges [13], [19]- [21]. An edge-aware weighted guided image filter is proposed in [20] to overcome this problem, where varies spatially rather than being fixed: where λ and ε are two small constants and σ 2 k is the variance of G in a 3 × 3 window centered at the pixel k. Γ G measures the importance of a pixel k with respect to the whole guidance image. Kou et al. [19] propose a multi-scale edge-aware weighted guided image filter, in which Γ G is computed by multiplying the variances of multiple windows. By taking the edge direction into consideration, Sun et al. [21] further improve the filter's performance. However, predefined parameters still remain in all these three methods.
Another limitation of classical guided image filters is their assumption that the target image and the guidance image have the same structure. In practice, there are also situations conceivable where an edge appears in one image, but not in the other. To address this issue, recent works [32]- [36] enhance guided image filters by considering the mutual structure information in both the target and the guidance images. These methods typically build on iterative algorithms that minimize global objective functions. The guidance signals are updated at each iteration to enforce the outputs to have similar structure as the target images. These global optimization methods generally use hand-crafted objectives that usually involve fidelity and regularization terms. The fidelity term captures the consistency between the filtering output and the target image. The regularization term, typically modeled using a weighted L2 norm [37], encourages the filtering output to have a similar structure as the guidance image. However, such hand-crafted regularizers may not transfer the desired structures from the guidance image to the filtering output [26], [27]. For this reason we prefer a guided filtering solution based on end-to-end deep representation learning.

B. Deep guided filtering
Li et al. [22], [26] introduce the concept of deep guided image filtering based on an end-to-end trainable network. Two independent convolutional networks f I and f G first process the target image and guidance image separately. Then their outputs from the last layers are concatenated and forwarded to another convolutional network f IG to generate the final output. We define the method as: where ⊕ denotes the channel concatenation operator. Several works follow the same definition but vary in their feature fusion strategies [23]- [25]. AlBahar et al. [24] introduce a bi-directional feature transformer to replace the concatenation operation. Su et al. [25] propose a pixel-adaptive convolution to fuse the outputs of networks f I and f G adaptively on the pixel level. Hui et al. [23] propose to perform multi-scale guided depth upsampling based on spectral decomposition, where low-frequency components of the target images are directly upsampled by bicubic interpolation and the highfrequency components are upsampled by learning two convolutional networks. The high-frequency domain learning leads to an improved performance. Wu et al. [38] alternatively combine convolutional networks and traditional guided image filters. Two independent convolutional networks f I and f G first amend the target image and the guidance image, and then feed their outputs into the traditional guided image filter F IG [13]: Rather than directly predicting the filtered image, Pan et al. [27] leverage deep neural networks to estimate the two coefficients of the original guided filtering formulation [13] based on a spatially-variant linear representation model, leading to impressive filtering results. It is defined as: where f α and f β are two convolutional networks, and denotes element-wise multiplication. To reduce the complexity of learning, in the implementation Pan et al. [27] learn a single network and predict an output with two channels, one channel for f α and another channel for f β . However, we observe that the shared network has difficulty disentangling the representations of the two coefficients, resulting in halo artifacts and structure inconsistencies. Differently, we propose a new guided filtering formulation, which depends on a single coefficient only and is therefore more suitable to be solved by a single deep convolutional neural network. The aforementioned existing deep guided filtering works implicitly perform structure-transferring by learning a joint filtering network, usually resulting in undesired filtering performance [27], [39], [40]. Recent works [39]- [45] take inspiration from coupled dictionary learning [46], and incorporate sparse priors into their deep networks for explicit structuretransferring. Marivani et al. [40]- [43] propose a learned multimodal convolutional sparse coding network with a deep unfolding method for explicitly fusing information from the target and guidance image modalities. Deng et al. propose a deep coupled ISTA network with a multimodal dictionary learning algorithm [45], and a common and unique information splitting network with multi-modal convolutional sparse coding [39], for the sake of explicitly modeling the knowledge from the guidance image modality. Most of these works focus on guided image super-resolution. In this work, we propose an explicit structure-transferring method for general guided filtering problems. In particular, we propose a guided filtering formulation with a single coefficient, and we learn to estimate the coefficient to explicitly decide how to transfer the desirable structures from guidance image to target image. As we will demonstrate, this leads to more desirable filtering results.

C. Unsharp masking
Our formulation is inspired by the classical sharpness enhancement technique of unsharp masking [28]- [31], which can be described by the equation: where an enhanced image is represented byÎ, an original image by I, an unsharp mask by (I − F L (I)) where F L denotes a low-pass filter like Gaussian filters or box mean filters, and an amount coefficient by λ which controls the volume of enhancement achieved at the output. Essentially, guided filtering shares the same function of edges enhancement as unsharp masking by means of the structure-transferring from an additional guidance image. Based on this viewpoint, we derive a simplified guided filtering formulation from the original guided filter [13], with only one coefficient to be estimated, akin to the formulation of unsharp masking in Eq. (10).

III. FILTERING FORMULATION
Here, we outline our new guided filtering formulation, in which only one coefficient needs to be estimated. Compared to estimating two coefficients (a, b) as in the original guided filtering formulation and subsequent deep learning variants, our formulation is more suitable to be solved with one single deep network. We start the derivation of our guided filtering formulation from the classical guided filter [13], summarized in Eq. (1), Eq. (3) and Eq. (4). In Eq. (1),Î is a linear transform of G in a window w k centered at the pixel k. When we apply the linear model to all local windows in the entire image, a pixel i is involved in all the overlapping windows w k that covers i. In this case, the value ofÎ i in Eq. (1) is not identical when it is computed in different windows. So after computing (a k , b k ) for all windows w k in the image, we compute the filtered output imageÎ i by averaging all the possible values ofÎ i with: Similar in spirit to unsharp masking, summarized in Eq. (10), we want to maintain only the coefficient a to control the volume of structure to be transferred from guidance G to the filtered output imageÎ. Thus, we put Eq. (4) into Eq. (11) to eliminate b, and obtain: Next, we rewrite the formulation as: where I i = 1 |w| k∈wiĪ k . SinceḠ k is the output of a mean filter, it's assumed thatḠ k is close to its mean in the window w i . Next we rewrite Eq. (13) as followŝ whereā i = 1 |w| k∈wi a k , and G i = 1 |w| k∈wiḠ k . For convenience, we will omit subscript i in the following.
The formulation in Eq. (14) enables us to intuitively understand how the guided filter performs edge-preservation and structure-transferring. Specifically, the target image I is first smoothed to remove unwanted components like noise/textures, and the smoothing result is denoted by I. However, the smoothing process usually suffers from the loss of sharp edges, leading to a blurred output. To enhance the edges, an unsharp mask (G − G) with fine edges generated from the guidance image G is added to I under the control of the coefficient a, leading to the structure being transferred from the guidance image to the filtered output imageÎ. Finally, we rewrite Eq. (14) to obtain a more general formulation for deep guided filtering: where I m = I − F L (I) and G m = G − F L (G) denote the unsharp masks of the target image and the guidance image, which contain the structures of the guidance and the target images. F L denotes a linear shift-invariant low-pass filter like the Gaussian filter or the box mean filter. f a denotes the amount function, which controls the volume of structure to be transferred from the guidance image to the filtered output image. Next, we will elaborate on this function. Amount function f a . The output of f a is the volume of the structure to be transferred from the guidance image to the filtered output image. Thus, the input of f a should involve the structure of both the target and the guidance image, which together determine the output, i.e., f a (I m , G m ). Ideally, f a should determine the structure-transferring in a pixel-adaptive fashion. It can be a manually designed function as the function a of the guided filter in Eq. (3). It also can be estimated by learning a deep neural network. Compared to hand-crafted functions, learnable functions are more flexible and allow for a better generalization to various image conditions. Successive filtering. Successive operations of the same filter generally result in a more desirable output, thus we develop a successive guided filtering based on our formulation in Eq. (15). Instead of directly iterating the filtering outputÎ, we iterate the outputs of f a as the function decides the effect of filtering. Let f a be a composition of a set of basic functions {f in which • denotes the function composition operation, such as ). With f a we obtain a successive filtering formulation from Eq. (15), In the next section we will detail how to implement our filters with deep convolutional neural networks.

IV. FILTERING NETWORK
There is a function f a in our formulation, which governs a guided filtering coefficient. We propose to solve this function with a single convolutional neural network.
Network for amount function f a . The function f a decides how to transfer the structure of the guidance image to the filtered output image. There are two inputs G m and I m for this function. Two options are available for the network architecture. Like [23], [26], we can separately process these two inputs with two different sub-networks at first, and then fuse their outputs with another sub-network. Alternatively, we can concatenate these two inputs together and forward the concatenation into a single network, similar to the framework of [27]. Empirically, we find that the second option is easily implemented and achieves a desirable filtering accuracy and efficiency. Thus, we design the network of f a with the second option in this work.
In our approach the unsharp masks, rather than the raw images themselves, are used as the inputs of the network. The unsharp mask is more sparse than the raw image itself, since most regions in the unsharp mask are close to zero. The learning of spatially-sparse data usually requires a large receptive field. The dilated convolution is a popular technique to enlarge the receptive fields in convolutional networks [47], [48]. We design our network by cascading four dilated convolutional layers with increasing dilation factors, where all the dilated convolutional layers have the same channel number of 24 and the same kernel size of 3 × 3. Their dilation factors are set to {1, 2, 4, 8}. Leaky ReLU with a negative slope of 0.1 is used as an activation function after each dilated convolutional layer. Finally, a 1 × 1 convolution layer generates the target output for f a .
Network for successive filtering. To develop a network for the successive filtering formulation in Eq. (17), we consider the network of the basic functions {f (l) a } L l=1 as a convolutional block, as shown in Fig. 2 (a). Then stacking this block multiple times results in a deep network for f a . There are two outputs in the block. By concatenating its input and its feature maps from the last layer results in the first output. The concatenation output allows feeding the previous multi-level outputs to the following blocks, leading to improved performance. We develop the second output by using a convolutional layer on top of the last layer of the block, for the sake of balancing accuracy and efficiency.
Stacking more blocks results in higher accuracy at the expense of an increased computational complexity. To allow users to choose between accuracy and computational complexity, we generate filtering outputs from each block. If users want to obtain filtering results fast, the filtering results from the first blocks can be used. When the accuracy is more important, the filtering results from the later blocks can be used. In short, we obtain multiple filtering results while training one single network. The overall network architecture is visualized in Fig. 2 (b).
Optimization. During training, we are given N samples {(I n , G n , Z n )} N n=1 , with I n ∈ I the target image, G n ∈ G the guidance image and Z n ∈ Z the task-dependent groundtruth output image. Our goal is to learn the parameters θ of the network for f a . Two types of loss, L 1 loss and L 2 loss, have been widely used in deep guided filtering works. Early works, like [22], [23], have adopted a L 2 loss, while recent works, like [24], [27], prefer a L 1 loss because it is less sensitive to outliers and leads to less blurry results compared to a L 2 loss [49], [50]. Following these recent works, we minimize the difference between filtered output imageÎ and its ground-truth Z using the L 1 loss, which is defined as: V. EXPERIMENTS In this section, we provide extensive experimental evaluations. Section V-A introduces the experimental setup. Sections V-B, V-C, V-D, and V-E emphasize ablations, comparisons and analysis. Sections V-F, V-G, and V-H show further qualitative and quantitative results, and state-of-the-art comparisons on various applications, including upsampling, denoising, and cross-modality filtering.

A. Experimental setup
Image upsampling datasets. We perform upsampling experiments on NYU Depth V2 [51], and Sintel optical flow 24  [52]. For NYU Depth V2 we follow [26]. We use the first 1000 RGB/depth pairs for training and the remaining 449 pairs for testing, where each low-resolution depth image is generated by applying a nearest-neighbor interpolation. For Sintel, following [25], 908 samples, and 133 samples from clean pass are used for training, and testing, where each lowresolution flow image is generated by applying a bilinear interpolation. Image denoising datasets. We perform denoising experiments also on NYU Depth V2 [51], as well as on BSDS500 [53]. For NYU Depth V2, we use the same split as for upsampling. BSDS500 contains 500 natural images. We train on the training set (200 images) and the validation set (100 images). We evaluate on the provided test set (200 images). Following [54], to train a blind Gaussian denoiser, random Gaussian noise is added to the clean training depth images in NYU Depth V2 and the clean RGB images in BSDS500, with a noise level σ ∈ [0, 55]. For testing, we consider three noise levels, σ = {15, 25, 50}. Thus, three separate noisy test images are generated for each original test image.
Pre-processing. For all datasets, we normalize the input images by scaling their pixel values to the range [0, 1]. According to Eq. (15), the guidance image G and target image I should have the same number of channels. In the depth/RGB dataset, the target is the 1-channel depth image. Thus, rgb2gray operation is used to transform a 3-channel RGB image into a 1-channel grayscale image as guidance. During training, we augment the images by randomly cropping 256 × 256 patches. No cropping is performed during testing.
Network and optimization. The proposed network is optimized in an end-to-end manner. We implement the network with TensorFlow on a machine with a single GTX 1080 Ti GPU. The optimizer is Adam with a mini-batch of 1. We set β 1 to 0.9, β 2 to 0.999, and the initial learning rate to 0.0001. Optimization is terminated after 1000 epochs.  [13] and the weighted guided filter [20] are used for f a , our filter is denoted by "Ours + GF" and "Ours + WGF", respectively. Our filters perform at least as good as the baselines. B. Unsharp-mask guided filtering without learning.
The goal of the first experiment is to validate our formulation as a valid guided filter. Here we do not rely on any deep learning for estimating f a . Instead, we use the function a of the guided filter [13] and the weighted guided filter (WGF) [20] as f a . F L (G) and F L (I) are generated by cascaded box mean filters. Using our formulation as a conventional guided filter, we provide qualitative and quantitative results to demonstrate that our filter performs as good as, or even better than the guided filter [13] and the weighted guided filter [20].
Qualitative results. The first example performs edgepreserving smoothing on a gray-scale image. The second example is about detail enhancement. For both, the target image and guided image are identical. Fig. 3 and Fig. 4 show the results of filtering, where we can see that our filter performs as good as the guided filter [13] in preserving structures. In the third example, we denoise a no-flash image under the guidance of its flash version to verify the effect of structure-transferring. The denoising results of our filter and the guided filter [13] in Fig. 5 are consistent and don't have gradient reversal artifacts.
Quantitative results. Next, we compare our filter with the guided filter (GF) [13] and the weighted guided filter (WGF) [20] for natural image denoising on BSDS500 and depth upsampling on NYU Depth V2. There are two hyperparameters, r and in GF and WGF. Grid-search is used to find the optimal hyperparameters. The results in Table I show that our filter performs at least as good as the guided filter [13] and the weighted guided filter [20], indicating that our formulation makes sense as a guided filter.

C. Unsharp-mask guided filtering with learning
Next, we assess the benefit of our formulation when f a is learned by a neural network. We compare to four baselines: (i) DMSG [23], (ii) DGF [38] (iii) DJF [26], and (iv) SVLRM [27]. The experiments are performed on NYU Depth V2 [51]  e) The smoothing result obtained by the guided filter [13]; f) Our smoothing result. Both our filter and guided filter [13] can preserve good edges while removing noise.    [23]. Compared to DGF, our approach better recovers finer edges as shown in the regions marked by the red boxes, and avoids producing artifacts as shown in the regions marked by the black boxes.
We compare these baselines separately. For each comparison, the network for f a is the same as the network used in the compared method. We use a box mean filter with radius r = 8 to obtain F L (I) and F L (G). For depth upsampling (16×), we first upsample the low-resolution depth image by bicubic interpolation to obtain the target resolution for F L (I). We also use the upsampled depth image as the input of the network, following [26], [27], [38]. One exception is the comparison with DMSG [23] which uses the original low-resolution depth image as the input of the network. Comparison with DMSG [23]. Fig. 6 (a) demonstrates our approach achieves better upsampling results than DMSG [23] in terms of RMSE. DMSG performs depth upsampling based on spectral decomposition. Specifically, a low-resolution depth image is first decomposed into low-frequency components and high-frequency components. The low-frequency components are directly upsampled by bicubic interpolation. The high-frequency components are upsampled by learning two convolutional networks. The first network is used to obtain multi-scale guidance. The other one performs multiscale joint upsampling. The difference between our method and DMSG mainly lies in two aspects. First, we don't use the first network and just use the second network for amount function f a to explicitly perform structure transfer instead of directly predicting the filtered output image. We find that our approach avoids halo effects more successfully, as shown in Fig. 6 (d) and (e). Second, Hui et al. use a Gaussian filter to smooth the low-resolution target depth image when generating its low-frequency components. After that, they upsample the low-frequency components by bicubic interpolation. However, this step is likely to produce artifacts, as shown in Fig. 6 (f). Since the network learning focuses on upsampling highfrequency components, the artifacts still remain in the final upsampling output, as shown in Fig. 6 (d). By contrast, we first upsample the low-resolution target depth image before smoothing. By doing so, the artifacts generated by bicubic interpolation can be removed by smoothing, as shown in Fig.  6 (g).
Comparison with DGF [38]. Wu et al. [38] learn two networks to amend the guidance and target images before feeding them to the guided filter [13]. The learned guidance and target images fit the guided filter [13] better than the original ones. However, DGF still suffers from the halo problem since its final filtering output is generated by the guided filter [13]. Our approach performs better than DGF [38] for both upsampling and denoising tasks, as demonstrated in Fig. 7 (a) and (b). As shown in Fig. 7 (e) and (g), the important edges are unavoidable to be smoothed because the structure-transferring is performed in an undesirable fashion. By contrast, our approach performs better on preserving and transferring important structures, as shown in 7 (f) and (h), as the amount function f a is learned in a pixel-adaptive way through a deep neural network instead of designed manually.
Comparison with DJF [26]. The network in our method directly uses the unsharp masks of the target image and the guided image as inputs, and learns to estimate the amount function f a for explicitly deciding how to transfer the desired structure from the guidance image to the target image. By contrast, the network in DJF [26] uses the original guidance image and target image as inputs, and directly predicts filtered output relying on feature fusion. The implicit structure transfer is likely to cause slow convergence and the unwanted contents to be transferred from guidance image to target image, as shown in Fig. 8. From Fig. 8 (a) and (b), we can see our approach convergences faster and achieves better filtering performance than DJF [26] on both upsampling and denoising tasks.
Comparison with SVLRM [27]. Lastly, we compare to the state-of-the-art in deep guided filtering, namely SVLRM [27]. Here, we analyze two drawbacks of SVLRM [27], as illustrated in Fig. 9 (c-e). First, f α (I, G) and f β (I, G) is likely to learn similar structure information. This is because they share the same training dependencies; such as input, network architecture and objective function. As a result, f α (I, G) can't  [38]. The parameters of the guided filter [13] used in DGF are r = 4, = 0.1 2 . Our learned amount function performs better on structure-transferring than the manually designed one as shown in the region marked by red boxes of (g) and (e). Thus, our filter reduces the oversmoothing of important edges as shown in the region marked by black boxes of (e) and (f).
transfer the desired structure from guidance G to the output image of f β (I, G). Second, SVLRM behaves like DJF [26] when the filtering performance is determined by f β (I, G). The implicit joint filtering causes slow convergence and the unwanted structures are transferred. By contrast, our approach focuses on estimating the amount function f a for explicit structure transfer, leading to more desirable filtering results, as illustrated in Fig. 9 (h-j). Fig. 9 (a) and (b) demonstrate the better performance of our approach compared to SVLRM [27], for both upsampling and denoising. Amount function f a . When we estimate the amount function f a through a convolutional neural network, the network architecture plays an important role in filtering performance. We have compared our filtering formulation with several baselines when f a is estimated by different networks used in these baselines. Generally, we found deep networks perform better than shallow networks, e.g., the network of SVLRM with a depth of 12 achieves an RMSE of 7.23 for upsampling (16×) and a PSNR of 40.27 for denoising (σ = 50), better than the RMSE of 8.19 and the PSNR of 39.59 obtained by the network of DJF with a depth of 6. One explanation for this is the fact that the deep network has more ability to express complex functions than shallow ones. In Eq.(15), we use the unsharp masks of the target image and guidance image as the input of the amount function network f a . The raw target image and guidance image can also be the input. Next, we perform an experiment to study which input performs better. The network of DJF [26] is used for f a . On NYU Depth V2, using the unsharp mask as input achieves an RMSE of 8.19 for upsampling (16×) and a PSNR of 39.59 for denoising (σ = 50), better than the RMSE of 8.64 and the PSNR of 39.31 obtained by using the raw image as input. We find that using the unsharp mask as input not only achieves better filtering performance, but also convergences faster because network learning can focus on extracting the desired structure without the interference of redundant signals from the smooth basis of the image.
Smoothing filter F L . To obtain the unsharp masks G m and I m , we need a smoothing filter for F L (I) and F L (G). Next, we explore how the smoothing process affects the final filtering performance, we compare three different smoothing filters with different hyper-parameters on NYU Depth V2 for  Fig. 9: Comparison with SVLRM [27].
In SVLRM, f α and f β are likely to learn the same structure information. In this case, f α can't transfer the structure desired by f β , resulting from over-smoothing of edges as shown in the regions marked by the blue boxes of (d) and (e). When the filtering output is determined by f β , SVLRM behaves like DJF [26], causing the transfer of unwanted contents from guidance image to target image as shown in the regions marked by the red boxes of (c-e). By contrast, our approach resolve the problems of SVLRM by explicitly learning structure-transferring, leading to more desirable filtering results as shown in regions marked by the blue and red boxes of (h-j).
Filter size r/ < 16× depth upsampling. The hyper-parameter is the filtering size r for the box filter, or the Gaussian variance σ for the Gaussian and bilateral filters. We use three different values: (4,8,16). The network of DJF [22] is used for f a . As shown in Fig. 10, our method is robust across filter type and size. We opt for the box filter with a filtering size of 8 throughout our experiments because it is simple, efficient and effective.

D. Successive filtering network
Next, we investigate the effect of the network we designed for our successive filtering formulation. There are multiple amount blocks used in the successive filtering network. We explore how the number of amount blocks L affects the filtering performance on NYU Depth V2 for depth upsampling (16×) and depth denoising (σ = 50). F L is a box mean filter with radius r = 8. For depth upsampling (16×), we first upsample the low-resolution depth image by bicubic interpolation to obtain the target resolution for F L (I) and network learning. We make two observations from the results shown in Table II. First, our model's filtering performance is consistently improved when increasing L from 1 to 5. Second, we can obtain multiple (L) filtering results by training a single network. Each filtering result is as good as the result obtained by an independently trained network. The model's filtering performance doesn't improve a lot when L is increased from 4 to 5. Thus, we opt for L = 4 in the following experiments.

E. Performance analysis.
Next, we analyze the performance of different deep guided filtering methods from three aspects: run-time performance, model parameters and filtering accuracy. For our methods, we use the successive filtering network with L = 4. Thus, we can obtain four filtering models by training a single network, indicated by Ours(Î (1) ), Ours(Î (2) ), Ours(Î (3) ) and Ours(Î (4) ). We perform upsampling (16×) with all methods on the testing datasets (499 RGB/depth pairs) of NYU Depth V2. We perform all the testings on the same machine with an Intel Xeon E5-2640 2.20GHz CPU and an Nvidia GTX 1080 Ti GPU. The average run-time performance on 499 images with the size of 640 × 480 is reported in GPU mode with TensorFlow. From Table III, we can see that Ours(Î (1) ) has the fewest parameters (17 k), and Ours(Î (4) ) achieves the best filtering accuracy (6.07 RMSE). Ours(Î (1) ) achieves a competitive average run-time performance (31 ms) compared to the best one achieved by DJF [22] (29 ms).

F. Depth and flow upsampling
Tables IV and V show results for upsampling a depth image or optical flow image, under the guidance of its RGB image. We have noted that the existing works use different training settings and evaluation protocols. For fair comparison, we reimplement the main baseline methods under our experimental settings. Our filter performs well, especially on Sintel and the larger upsampling scales on NYU Depth. Different from the related works [23]- [27], [38], our model learns an amount function f a to explicitly decide how to transfer the desired structure from guidance image to target image. Thus, our model can be more effective and efficient to learn the desired output. Fig. 11 show our ability to better recover finer edges.

G. Depth and natural image denoising
Our formulation also allows for standard filtering without a guidance image by simply making G identical to I in Eq. (17). Intuitively, such a setup defines a structure-preservation filter, while the guided variant defines a structure-transfer filter. Next, we evaluate the ability to remove Gaussian noise from depth and natural images. For depth image denoising, its RGB image is used as guidance. For natural image denoising, the target and guidance image are the same RGB image. The quantitative results are shown in Tables VI and VII. We obtain the best PSNR and SSIM scores on both datasets for all three noise levels. Fig. 12 and Fig. 13 highlight our ability to better remove noise and preserve finer edges compared to other filters.

H. Cross-modality filtering
Finally, we demonstrate that our models trained on one modality can be directly applied to other modalities. Here, we use the models trained with RGB/depth image pairs for the joint upsampling of bw/color and RGB/saliency image pairs, and the joint denoising of RGB/NIR and flash/no-flash (a) Guidance (b) Ground truth (c) DMSG [23] (d) DGF [38] (e) DJF [26] (f) SVLRM [27] (g) PAC [27] (h) Ours Fig. 11: Optical flow upsampling (16×) on Sintel. We are able to maintain sharp and thin edges.
Following [26], for the multi-channel target image, i.e., no-flash image, we apply the trained models independently for each channel. For the single-channel guidance image, i.e., NIR   image, we replicate it three times to obtain a 3-channel guidance image. Joint upsampling. To speed up the translation from one image to another image, one strategy is to perform translation at a coarse resolution and then upsample the low-resolution solution back to the original one with a joint image upsampling filter. Here, we demonstrate that our models act as joint upsampling filters well on bw/color and RGB/saliency image pairs translation tasks. For bw/color translation, we use 68 bw images from BSD68 dataset [56], and the colorization model proposed by Lizuka et al. [57] is used as translation model. For RGB/saliency translation, we use 1000 RGB image from ECSSD dataset [58], and the saliency region detection model proposed by Hou et al. [59] as translation model. The input images, i.e., bw images and RGB images, are first downsampled by a factor of 4× using nearest-neighbor interpolation, and then are feed into the translation models to generate the output images. After that, we recover the output images to the original resolution under the guidance of the original input images by various joint upsamling methods. Table VIII shows the quantitative results, and we can see that our model achieves the best performance for both two tasks. The joint upsampling pipeline performs more than two times faster than direct translation on the GPU mode. We also provide the qualitative results in Fig. 14 and 15 to show that the proposed model better recovers finer details.
Joint denoising. We introduce two datasets for the joint denoising experiments. Flash/no-flash [60] consists of 120 image pairs, where the no-flash image is used for denoising under the guidance of its flash version [13], [26], [61], [62]. Nirscene1 [63] consists of 477 RGB/NIR image pairs in 9 categories, where the RGB image is used for denoising under the guidance of its NIR version [26], [62], [64]. Table IX shows that our filter has a better denoising ability than alternatives. Fig. 16 and Fig. 17 provide qualitative results, which shows that our model better preserves important structures while removing noises.
VI. CONCLUSION In this paper, we have introduced a new and simplified guided filter. With inspiration from unsharp masking, our proposed formulation only requires estimating a single coefficient, in contrast to the two entangled coefficients required in current approaches. Based on the proposed formulation, we introduce a successive guided filtering network. Our network allows for a trade-off between accuracy and efficiency by choosing different filtering results during inference. Experimentally, we find that the proposed filtering method better preserves sharp and thin edges, while avoiding unwanted structures transferred from guidance. We furthermore show that our approach is effective for various applications such as upsampling, denoising, and cross-modal filtering. (c) Ground truth [57] (d) GF [13] (e) SVLRM [27] (f) This paper (c) Ground truth [59] (d) GF [13] (e) SVLRM [27] (f) This paper (e) SVLRM [27] (f) This paper (e) SVLRM [27] (f) This paper