{'fraction_non_alphanumeric': 0.02814105558150397, 'fraction_numerical': 0.008913280398567647, 'mean_word_length': 4.955725544738062, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Synthesizing a 4D Spatio-Angular Consistent Light Field from a Single Image

Synthesizing a densely sampled light field from a single image is highly beneficial for many applications. The conventional method reconstructs a depth map and relies on physical-based rendering and a secondary network to improve the synthesized novel views. Simple pixel-based loss also limits the network by making it rely on pixel intensity cue rather than geometric reasoning. In this study, we show that a different geometric representation, namely, appearance flow, can be used to synthesize a light field from a single image robustly and directly. A single end-to-end deep neural network that does not require a physical-based approach nor a post-processing subnetwork is proposed. Two novel loss functions based on known light field domain knowledge are presented to enable the network to preserve the spatio-angular consistency between sub-aperture images effectively. Experimental results show that the proposed model successfully synthesizes dense light fields and qualitatively and quantitatively outperforms the previous model . The method can be generalized to arbitrary scenes, rather than focusing on a particular class of object. The synthesized light field can be used for various applications, such as depth estimation and refocusing.


Introduction
Light fields have attracted considerable interest from computer vision and graphic communities due to their capability to capture multiple light rays from various directions. Recent studies on light fields utilized densely sampled light fields captured by light field cameras. Many applications, such as depth estimation [16,17,24,25], refocusing [14], and 3D reconstruction [9,20], exploit the rich information of light fields. Promoting a single image into a densely sampled light field can also elevate existing AR/VR experiences.
At present, a light field image is captured using either plenoptic cameras [1] or camera arrays [23]. However, the absence of the only available consumer light field camera, i.e. Lytro, has created a gap between consumers and light field experiences. We focus on filling this gap so that end users can experience the advantages of light field imaging. The idea is to synthesize a light field using only a single image, which can be easily obtained in the real world. Synthesizing a 4D light field is a severely ill-posed problem, but the impact of such work is considerably significant. The geometry information from a single image should be inferred and used to synthesize the surrounding angular images. Light field synthesis has attracted considerable attention in recent years [10,18,21,26,28]. Previous approaches can be grouped into two based on the input type, namely, single and multi-view inputs. The multi-view input utilizes multiple images from specific viewpoints to infer the geometric clue and use it to synthesize the light field. However, only a few consumer cameras can simultaneously capture multi-view images, thus making the approach unsuitable for general use.
Existing methods involving a single input utilize a depth image-based rendering (DIBR) technique to synthesize the light field [18]. The work is inspired by previous view synthesis techniques using geometry estimation [4,5,6,27]. However, [18] is highly dependent on the estimated depth quality and physical-based depth warping to synthesize angular images. The depth-based approach also suffers from a non-Lambertian surface and difficulty in reconstructing the occlusion region.
In this study, we develop a novel deep neural network for light field synthesis that utilizes the appearance flow to synthesize novel views. We also introduce a spatio-angular consistent loss function that helps the network learn robustly and efficiently. The loss function consists of global and local losses. A post-processing method is applied to improve the quality of complex scenes. The experimental results show that the proposed method outperforms the conventional single image-based approach in qualitative and quantitative evaluations. Figure 1 shows the results of the proposed method.
The key contributions of this study are summarized as follows.
• Robust alternative geometric representation to synthesize light field without using physical-based approach.
• Novel spatio-angular consistent loss that imposes geometric reasoning to the network.
• Capability to be generalized to arbitrary scenes rather than a specific class of object compared with the previous approach.
• Single and fast end-to-end full learning based deep neural network model.

Related Works
Learning based light field synthesis has been investigated by many researchers in the past few years [10,18,21,26,28,15]. On the basis of the number of input images, related approaches are divided into multi-view image [10,26,21,28] and single image [18,15] based methods. Multi-view image-based light field synthesis is impractical due to its specific input pattern. Meanwhile a single image-based light field synthesis is severely ill-posed although it is the most practical approach for light field synthesis.
Sparse-input Light Field Synthesis Wanner and Goldluecke [22] introduced a light field super resolution framework adopting estimated depth information and variational optimization to fill missing views by using a sparse light field image. Phase-based light field synthesis from a microbaseline stereo pair was proposed by Zhang et al. [29]. Those studies were rooted on traditional approaches that use complex processing and various optimization approaches. Meanwhile, learning-based view synthesis produces better results by using an end-to-end training strategy. Zhou et al. [30] proposed a new geometric representation called appearance flow to synthesize image with a novel view. However, the proposed representation did not generalize well to a scene with multiple objects and non-homogenous background. Flynn et al. [4] introduced a deep learning approach to synthesize a novel view with a wide baseline using images with their pose information. Zhou et al. [31] presented a novel geometric representation called multi-plane images to synthesize a horizontal light field from a narrow baseline camera. However, these approaches require camera pose information to synthesize the novel view which is not commonly available in the real world.
Kalantari et al. [10] introduced the first learning based light field synthesis solution. They utilized four corner images to synthesize a 4D light field using a depth estimation and color refinement approach. The inputs to the depth estimation network were mean and variance images, as inspired by the depth estimation work of [19]. Wu et al. [26] utilized an epipolar plane image (EPI) obtained from sparse input images and synthesized an up-sampled EPI through a specially designed blur kernel. Wang et al. [21] employed a pseudo 4DCNN represented as 2D strided convolution and 3DCNN, where the light field image was synthesized in a step-by-step manner by fixing each angular resolution. Yeung et al. [28] applied a high dimensional convolutional kernel to infer spatial and angular information from sparse input images. In summary, sparse input image-based light field synthesis focuses on synthesizing in-between views and could be regarded as solving an interpolation problem. The specific input sampling pattern hinders its practical usage.
Single-input Light Field Synthesis Srinivasan et al. [18] introduced the first solution to solve light field synthesis from a single image. They proposed a single image based depth estimation to obtain the approximate geometry of a scene. Then, the estimated depth is utilized to synthesize a novel view using the DIBR approach. However, their method is constrained to a non-Lambertian scene and highly dependent on pixel intensity. Ruan et al. [15] used a Wasserstein GAN to synthesize a light field image. The framework relies on GAN capability guided by perceptual and EPI losses to synthesize novel views. In this study, we focus on solving the problem of single-image light field synthesis. Contrary to [18], we propose an alternative geometric representation to synthesize a light field image. Furthermore, we present a light field based loss function that enables the network to learn geometric reasoning.

Light Field Synthesis Formulation
This study aims to synthesize a 4D light field L(x, y, u, v) given a single image that serves as the central sub-aperture image (SAI) L(x, y, 0, 0). We follow the twoplane parametrization light field L(x, y, u, v), introduced by [12], where (x, y) and (u, v) are the coordinates in spatial and angular planes, respectively. In general, the light field synthesis problem is formulated as DIBR problem, which is described as follows: where d(u) and d(v) are the disparity in x and y directions, respectively. Disparity depends on the depth information of the central image and the novel angular coordinate (u, v). We address the light field synthesis problem by using an approximation function f (·) represented as a deep convolutional neural network rather than relying on depth information, as described in Function f solves a highly ill-posed problem. An appearance flow is estimated to extrapolate the central view to each SAI in the 4D light field. Appearance flow represents 2D coordinate vectors specifying where to reuse or copy pixels to reconstruct the novel view. Considering that the ground truth light field appearance flow is difficult and expensive to obtain, the proposed network is designed to estimate appearance flow in an unsupervised manner. Appearance flow [30] is accompanied with few blurs, preserves color identities, and removes the dependency on the physical-based approach to synthesize novel views.
To make the problem tractable, function f is decomposed into three sub-problems, namely, appearance flow estimation for each viewpoint (u, v), image shifting with respect to the central view, and novel view extrapolation: Each sub-problem can be defined as follows.
where F is the proposed DenseFlowNet that estimates appearance flow L f for each novel angular view. S performs angular shifting to the position ∇(u, v) of novel views. W is the warping function for shifted image L s (x, y, u, v) using its corresponding appearance flow L f (x, y, u, v). Image warping is performed using a bilinear sampler module [8] to produce light field imageL(x, y, u, v).
The proposed objective function is defined as where θ denotes the deep neural network parameters. The problem formulation and objective function enable the network to estimate an appearance flow for each SAI (u, v) in an unsupervised manner through the supervision of synthesized pixels. The common pixel-wise loss is not utilized in the proposed method because it does not enforce the geometry constraint to the network. Instead, we rely on the known light field domain knowledge and design two geometrically constrained losses, i.e. global L g (θ) and local L e (θ) light field losses. Both loss functions are useful in preserving the spatio-angular consistency between light field SAIs. In addition, we propose a regularization loss ψ tv (θ) to the estimated appearance flow to reduce the jittering artifacts. Each loss is weighted using the global loss weight λ g and the local loss weight λ e . ψ tv is the flow regularization weight. The proposed network consists of mostly convolution operations without physical-based computation, resulting in low computational complexity. The overall network structure is shown in Figure 2. The details of each sub-problem are explained in the following sections.
Reference image Appearance flow Figure 3: Visualization of the estimated appearance flow using DenseFlowNet. The estimated appearance flow successfully identifies and separates the object of interest in the scene.

Appearance Flow Estimation
To estimate an accurate and dense appearance flow, DenseFlowNet is designed to extract all important representations in the image. The network consists of dense skip connections that connect each layer with the following layers. In the proposed network, we use four dense blocks in which each block has three convolution layers followed by the ReLU activation function [13]. Batch normalization and average pooling in the transition layer are removed. Instead, we use dilated convolution to allow the network to have access to the entire input image without reducing its spatial resolution. An extra convolution block at the final layer estimates the flow for each novel view. The final convolution layer does not have an activation function. Additional details about the network structure, i.e. kernel size and dilation rate, are available in the supplementary material.
In particular, the proposed flow estimation network produces coordinate vectors (x, y) to sample from L s (x, y, u, v), which is used by the bilinear sampler to synthesize the novel viewL(x, y, u, v). The appearance flow is visualized in Figure 3. The brighter pixel indicates the pixel have bigger displacement. The input to the network is the luminance (Y ) component which is used to compute the loss. The luminance component is widely used in super-resolution [3] and light field synthesis [28]. We learn F to estimate the appearance flow for all novel views by minimizing the loss between the extrapolated novel viewŝ L(x, y, u, v) and ground truth light field L(x, y, u, v).

Image Shifting
Appearance flow represents the coordinates in x and y directions only. Therefore, the information in z (depth) direction is lacking. This condition leads to a poor result and contains unpleasing artifacts when compared with DIBR approaches [10,18] that have pre-defined geometrical constraints.
To alleviate this problem, we propose an input shifting technique S, for light field synthesis with respect to the novel view coordinate. This technique is inspired by the work of Xie et al. [27], in which the input image is shifted to guide the network in synthesizing the corresponding stereo image. We extend it to three directions (i.e. horizontal, vertical, and diagonal). The shifting operation can be formally written as follows: where η is the constant angular shift value in horizontal and vertical directions. ∆u and ∆v are the angular distances between novel and central views. Considering the redundancy in light field SAI, we can partially imitate how a pixel shifts in each angular position and utilize this to provide better intialization. The η value is fixed based on the disparity between SAI in the target light field. The value of η corresponds to the width of the light field baseline. Figure 4 shows an image shifting result, in which several regions in EPI exhibit similar slopes to the ground truth light field. Considering that image shifting does not consider parallax, the network is required to estimate the flow that fixes the incorrectly shifted pixels. Compared with accurate flow estimation of the entire pixels in the image, the network is only required to fix a few regions in the image. Furthermore, image shifting reduces the range of the estimated appearance flow in the outer angular resolution.

Light Field Loss
Although image shifting alleviates the amount of network training burden, a good objective function for learning the relation between angular views should be developed. Simple pixel-wise loss, which is commonly used by conventional approaches, cannot provide proper geometric reasoning to the network. It encourage the network to look at dominant pixel color individually instead of understanding the whole scene. We propose a novel 4D light field loss, which is formulated as where M (L) and V (L) are the mean and variance of a light field computed for all pixel in the SAIs as follows.
Computing the light field mean is equivalent to obtaining the refocus image at zero disparity. The refocused image correlates to the depth of the light field image. Therefore, the synthesized light field depth can be explicitly evaluated in an efficient way. Meanwhile, variance captures the difference between SAIs and helps the network learn the occlusion and edge region. This is known from the light field depth estimation work of [19,24,25], who utilized two representations to compute defocus and correspondence responses. Kalantari et al. [10] also employed the mean and variance image as the input to their depth estimation network. Here, we show that mean and variance image can be used as loss function to help the network learn the light field geometry.
Although 4D global loss captures geometric information globally, the network should learn the local geometric rela- tion between SAIs in a refined manner. The idea is to help the network explicitly understand the shifting of pixels the horizontal and vertical directions in the angular domain. We compute the mean and variance for each row and column in the 4D light field, similar to the direction of EPI sliced conventionally. The losses at each row and column are accumulated to obtain the final local loss. The process can be formulated as The objective function encourages the network to learn the fine geometric relation between SAIs by supervising a particular direction. Figure 5 shows an example to prove the effect of local light field loss. The proposed loss overcome the simple pixel-based loss limitation.

Loss Regularization
An inconsistent appearance flow might appear and cause artifacts between SAIs. This problem is expected because appearance flow is estimated from a single image in an unsupervised manner. Ground truth light field appearance flow is required to fix this issue. However, it is expensive and difficult to obtain, especially in the real-world scene. An alternative approach is to use the conventional flow estimation method into the ground truth light field and compare it with the estimated flow. However, this approach is tedious and increases framework complexity. Thus, we present a strategy to remedy inconsistent and incorrect flow by incorporating a regularization term into the loss function.
Artifacts mostly occur in the region with fine edges due to the incorrect representation extracted by the network. Total variation regularization is applied to estimate the flow and thus handle artifacts. Total variation is commonly used for noise removal in image processing. The idea is to smoothen noisy flow while keeping edge information. We show that total variation can also be applied to suppress noise in the flow. L 2 minimization is performed on the gradient of the estimated flow is performed. Therefore, regularization is performed separately for each coordinate (x, y) and then combined, as described in A small weight is applied to control the regularization effect. We want the network to estimate diverse and sparse flow for complex scenes while suppressing inconsistent flow. Another advantage of flow regularization is that the network can handle noisy input and synthesize a denoised light field as shown in Figure 6.

Experimental Results
We evaluate the performance of the proposed framework qualitatively and quantitatively. We then compare its performance with that of a state-of-the-art method of light field synthesis from a single image [18].
We utilize three datasets, namely, Flower, Toys [18], and General [10]. For the evaluation, all networks are re-trained with the corresponding dataset. The network is trained in an end-to-end fashion for 150,000 iterations with a batch size of 1. Hyperparameters η, λ e , λ g and λ tv are set to 0.8, 10, 10 and 1e −6 , respectively. We use Adam optimizer [11] as our optimization algorithm with the default parameters. The proposed network is implemented using TensorFlow [2]. Training is performed for approximately 15 h on NVIDIA GTX 1080Ti GPU with 11GB of memory and Intel i7-7700 @3.60 GHz CPU with 16GB of memory. For the inference time, the network runs approximately for 0.5 s when synthesizing a single light field image. Readers are urged to watch the supplementary video for improved understanding and elaborated results. More technical details regarding training are available in supplementary material.

Flower Dataset
The light field images in the Flower dataset have a clear distinction between the background and foreground. The flower in the foreground has a more dominant color than the object in the background. In our work, we carefully randomize our test set (200 images) so as not to contain any data in the training set (3,100 images). We remove unusable light field images that contains considerable noise. To train and test the dataset, we downsample the original size into 256×192×8×8 by using bilinear interpolation due to the GPU memory limitation. To evaluate performance, we upsample the synthesized light field into the original size before measuring the PSNR and SSIM metrics. Therefore, a fair comparison between the state-of-the-art method [18] is conducted at the original size. Figure 7 shows a comparison between the proposed method and Srinivasan's work [18] using 20 random samples. The average PSNR and SSIM for the Flower test set is shown in Table 1. The proposed method significantly outperforms the state-of-the-art method significantly in most cases. Moreover, the average PSNR and SSIM metric increases by approximately 4 dB and 0.07, respectively. Figure 8 shows a qualitative evaluation of data #5, data #10, and #12. Data #5 and #10 have multiple flowers with a similar color at different locations. Srinivasan's work fails on this kind of scene due to its dependency on finding a single object with a dominant color, which leads to inaccurate depth estimation. As shown in the error map, pixels with the flower in the back have many errors. Data #12 shows scene with single flower commonly found in the Flower dataset. The error map and zoomed in images shows the proposed method handles occlusion better and have less artifact. Meanwhile, our network is capable of robustly estimating the flower geometry and location. Data #10 is an example of difficult data with specular in the background. Srinivasan's work cannot estimate depth in those regions. Overall, the proposed work performs better than Srinivasan's method due to our image shifting approach and the proposed loss function.

Toys and General Dataset
We utilize Toys and General datasets to verify the performance of the proposed model. Unlike the Flower dataset, Toys and General datasets have more variance in object class in arbitrary location. Figure 8 [10] is expected to outperform the proposed work because the former uses four inputs to synthesize the light field. It only serves as the upper baseline of this specific dataset and not for any comparison due to the different number of input images. However, the proposed network outperforms [18], which proves its capability for general scenes.

Post-processing
Flow extraction from a complex scene is difficult, especially in the discontinuity region. Incorrect estimation leads to artifacts that reduce the light field coherence in the angular domain. To handle this problem, we propose a post-processing method inspired by cost aggregation in stereo matching. We regard appearance flow as the cost volume and apply an edge-aware filter (guided filter [7]) to it. Through the flow aggregation, noisy flow is smoothed, and important edge information are maintained. Flow aggregation is performed before applying the bilinear sampler module. Post-processing improves the performance by up to 1 dB for the General dataset. As shown in Table 2, postprocessing does not considerably affect the Flower dataset because, the estimated appearance flow is already accurate.

Ablation Study
To reveal the discriminate power of the proposed light field synthesis network, we evaluate the performance of different loss functions, namely, pixel-wise L1 loss, global loss, local loss, and local-global loss. Table 3 shows the (a) Reference image (b) Depth from synthesized LF and refocus image at foreground (c) Depth from ground truth LF and refocus image at background Figure 9: Visual comparison of depth estimation using CAE [25] and synthetic defocus result. quantitative evaluation of each loss function's effect on the network. The simple pixel-wise loss is outperformed by the proposed loss functions. Meanwhile, individually, local loss achieves satisfactory performance, and the combination with global loss leads to improved performance. Global and local losses complement each other by forcing local and global consistency. Additionally, we also show that the synthesized light field can be used for common light field applications, such as depth estimation and refocusing. Figure 9 shows convincing depth estimation and synthetic defocus blur result. This findings confirms that the synthesized light field is geometrically correct and can be used in various light field processing applications.

Conclusion
In this study, we develop an end-to-end deep model for light field synthesis from a single image by using appearance flow. Novel light field based loss functions are introduced to preserve spatio-angular consistency and remove the dependency of pixel intensity. A regularization and post-processing strategy are presented to address complex scene. The experimental results show that the proposed network qualitatively and quantitatively outperforms the stateof-the-art single image based light field synthesis algorithm. The proposed method can also be generalized to arbitrary scenes better than previous work. Future work will include wide-baseline light field synthesis and explicit handling of view-dependent reflection.