Real-Time User-Guided Image Colorization with Learned Deep Priors

Richard Zhang, Jun-Yan Zhu, Phillip Isola, Xinyang Geng, Angela S. Lin, Tianhe Yu, Alexei A. Efros

Introduction

There is something uniquely and powerfully satisfying about the simple act of adding color to black and white imagery. Whether as a way of rekindling old, dormant memories or expressing artistic creativity, people continue to be fascinated by colorization. From remastering classic black and white films, to the enduring popularity of coloring books for all ages, to the surprising enthusiasm for various (often not very good) automatic colorization bots onlinee.g., http://demos.algorithmia.com/colorize-photos/ * indicates equal contribution, this topic continues to fascinate the public.

In computer graphics, two broad approaches to image colorization exist: user-guided edit propagation and data-driven automatic colorization. In the first paradigm, popularized by the seminal work of Levin et al. (2004), a user draws colored strokes over a grayscale image. An optimization procedure then generates a colorized image that matches the user’s scribbles, while also adhering to hand-defined image priors, such as piecewise smoothness. These methods can achieve impressive results but often require intensive user interaction (sometimes over fifty strokes), as each differently colored image region must be explicitly indicated by the user. Because the system purely relies on user inputs for colors, even regions with little color uncertainty, such as green vegetation, need to be specified. Less obviously, even if a user knows what general color an object should take on, it can be surprisingly difficult to select the exact desired natural chrominance.

To address these limitations, researchers have also explored more data-driven colorization methods. These methods colorize a grayscale photo in one of two ways: either by matching it to an exemplar color image in a database and non-parametrically “stealing” colors from that photo, an idea going back to Image Analogies (Hertzmann et al., 2001), or by learning parametric mappings from grayscale to color from large-scale image data. The most recent methods in this paradigm proposed by Iizuka et al. (2016), Larsson et al. (2016), and Zhang et al. (2016), use deep networks and are fully automatic. Although this makes colorizing a new photo cheap and easy, the results often contain incorrect colors and obvious artifacts. More fundamentally, the color of an object, such as a t-shirt, is often inherently ambiguous – it could be blue, red, or green. Current automatic methods aim to choose a single colorization, and do not allow a user to specify their preference for a plausible, or perhaps artistic, alternative.

Might we be able to get the best of both worlds, leveraging large-scale data to learn priors about natural color imagery, while at the same time incorporating user control from traditional edit propagation frameworks? We propose to train a CNN to directly map grayscale images, along with sparse user inputs, to an output colorization. During training, we randomly simulate user inputs, allowing us to bypass the difficulty of collecting user interactions. Though our network is trained with ground truth natural images, the network can colorize objects with different, or even unlikely colorizations, if desired.

Most traditional tools in interactive graphics are defined either procedurally – e.g., as a designed image filter – or as constraints applied in a hand-engineered optimization framework. The behavior of the tool is therefore fully specified by human fiat. This approach is fundamentally limited by the skill of engineers to design complex operations/constraints that actually accomplish what is intended of them. Our approach differs in that the effect of interaction is learned. Through learning, the algorithm may come up with a more powerful procedure for translating user edits to colorized results than would be feasible by human design.

Our contribution are as follows: (1) We end-to-end learn how to propagate sparse user points from large-scale data, by training a deep network to directly predict the mapping from grayscale image and user points to full color image. (2) To guide the user toward making informed decisions, we provide a data-driven color palette, which suggests the most probable colors at any given location. (3) We run a study, showing that even given minimal training with our interface and limited time to colorize an image (1 min), novice users can quickly learn to produce colorizations that can often fool real human judges in a real vs. fake test. (4) Though our system is trained on natural images, it can also generate unusual colorizations. (5) We demonstrate that this framework is not limited to user points, and can, in principle, be trained with any statistic of the output, for example, global color distribution or average image saturation.

Related Work

Prior interactive colorization work focused on local control, such as user strokes (Levin et al., 2004; Huang et al., 2005). Because the strokes are propagated using low-level similarity metrics, such as spatial offset and intensity difference, numerous user edits are typically required to achieve realistic results. To reduce user efforts, later methods focused on designing better similarity metrics (Qu et al., 2006; Luan et al., 2007) and utilizing long-range connections (An and Pellacini, 2008; Xu et al., 2009). Learning machinery, such as boosting (Li et al., 2008), local linear embeddings (Chen et al., 2012), feature discrimination (Xu et al., 2013), and more recently, neural networks (Endo et al., 2016), have been proposed to automatically learn similarity between pixels given user strokes and input images. In addition to local control, varying the color theme (Wang et al., 2010; Li et al., 2015) and color palette (Chang et al., 2015) are popular methods of expressive global control. We show that we can integrate global hints to our network and control colorization results by altering the color distribution and average saturation (see Section 3.3). Concurrently, Sangkloy et al. (2017) developed a system to translate sketches to real images, with support for user color strokes, while PaintsChainer (2017) and Frans (2017) have developed open-source interactive online applications for line-drawing colorization.

Early semi-automatic methods (Welsh et al., 2002; Irony et al., 2005; Liu et al., 2008; Chia et al., 2011; Gupta et al., 2012) utilize an example-based approach that transfers color statistics from a reference image or multiple images (Morimoto et al., 2009; Liu et al., 2014) to the input grayscale image with techniques such as color transfer (Reinhard et al., 2001) and image analogies (Hertzmann et al., 2001). These methods work remarkably well when the input and the reference share similar content. However, finding reference images is time-consuming and can be challenging for rare objects or complex scenes, even when using semi-automatic retrieval methods (Chia et al., 2011). In addition, some algorithms (Irony et al., 2005; Chia et al., 2011) involve tedious manual efforts on defining corresponding regions between images.

Recently, fully automatic methods (Deshpande et al., 2015; Cheng et al., 2015; Iizuka et al., 2016; Zhang et al., 2016; Larsson et al., 2016; Isola et al., 2017) have been proposed. The recent methods from train CNNs (LeCun et al., 1998) on large-scale image collections (Russakovsky et al., 2015; Zhou et al., 2014) to directly map grayscale images to output colors. The networks can learn to combine low and high-level cues to perform colorization, and have been shown to produce realistic results, as determined by human judgments (Zhang et al., 2016). However, these approaches aim to produce a single plausible result, even though colorization is intrinsically an ill-posed problem with multi-modal uncertainty (Charpiat et al., 2008). Larsson et al. (2016) provide some post-hoc control through globally biasing the hue, or by matching global statistics to a target histogram. Our work addresses this problem by learning to integrate input hints in an end-to-end manner.

Deep neural networks (Krizhevsky et al., 2012) excel at extracting rich semantics from images, from middle-level concepts like material (Bell et al., 2015; Wang et al., 2016) and segmentation (Xie and Tu, 2015), to high-level knowledge such as objects (Girshick et al., 2014) and scene categories (Zhou et al., 2014). All of this information could potentially benefit semantic image editing, i.e. changing the high-level visual content with minimal user interaction. Recently, neural networks have shown impressive results for various image processing tasks, such as photo enhancement (Yan et al., 2016), sketch simplification (Simo-Serra et al., 2016), style transfer (Gatys et al., 2016; Selim et al., 2016), inpainting (Pathak et al., 2016), image blending (Zhu et al., 2015) and denoising (Gharbi et al., 2016). Most of these works built image filtering pipelines and trained networks that produce a filtered version of the input image with different low-level local details. However, none of these methods allowed dramatic, high-level modification of the visual appearance, nor do they provide diverse outputs in a user controllable fashion. On the contrary, we train a network that takes an input image as well as minimal user guidance and produces global changes in the image with a few clicks. Barnes et al. (2009) emphasize that control and interactivity are key to image editing, because user intervention not only can correct errors, but can also help explore the vast design space of creative image manipulation. We incorporate this concept into an intuitive interface that provides expressive controls as well as real-time feedback. Zhu et al. (2016) provided an interactive deep image synthesis interface that builds on an image prior learned by a deep generative network. Xu et al. (2016) train a deep network for interactive object segmentation. Isola et al. (2017) and Sangkloy et al. (2017) train networks to generate images from sketches, using synthetic sketches generated by edge detection algorithms for training data.

Methods

We train a deep network to predict the color of an image, given the grayscale version and user inputs. In Section 3.1, we describe the objective of the network. We then describe the two variants of our system (i) the Local Hints Network in Section 3.2, which uses sparse user points, and (ii) the Global Hints Network in Section 3.3, which uses global statistics. In Section 3.4, we define our network architecture.

The inputs to our system are a grayscale image X∈\mathdsRH×W×1\mathbf{X}\in\mathds{R}^{H\times W\times 1}, along with an input user tensor U\mathbf{U}. The grayscale image is the LL, or lightness in the CIE LabLab color space, channel. The output of the system is Y^∈\mathdsRH×W×2\mathbf{\widehat{Y}}\in\mathds{R}^{H\times W\times 2}, the estimate of the abab color channels of the image. The mapping is learned with a CNN F\mathcal{F}, parameterized by θ\theta, with the network architecture specified in Section 3.4 and shown in Figure 2. We train the network to minimize the objective function in Equation 1, across D\mathcal{D}, which represents a dataset of grayscale images, user inputs, and desired output colorizations. Loss function L\mathcal{L} describes how close the network output is to the ground truth.

We train two variants of our network, with local user hints Ul\mathbf{U}_{l} and global user hints Ug\mathbf{U}_{g}. During training, the hints are generated by giving the network a “peek”, or projection, of the ground truth color Y\mathbf{Y} using functions Pl\mathcal{P}_{l} and Pg\mathcal{P}_{g}, respectively.

The minimization problems for the Local and Global Hints Networks are then described below in Equation 3. Because we are using functions Pl,Pg\mathcal{P}_{l},\mathcal{P}_{g} to synethtically generate user inputs, our dataset only needs to contain grayscale and color images. We use the 1.3M ImageNet dataset (Russakovsky et al., 2015).

Next, we describe the specifics of the local and global variants.

2. Local Hints Network

The Local Hints Network uses sparse user points as input. We describe the input, how we simulate user points, and features of our user interface.

The user points are parameterized as Xab∈\mathdsRH×W×2\mathbf{X}_{ab}\in\mathds{R}^{H\times W\times 2}, a sparse tensor with abab values for the points provided by the user and Bab∈\mathdsBH×W×1\mathbf{B}_{ab}\in\mathds{B}^{H\times W\times 1}, a binary mask indicating which points are provided by the user. The mask differentiates unspecified points from user-specified gray points with (a,b)=0(a,b)=0. Together, the tensors form input tensor Ul={Xab,Bab}∈\mathdsRH×W×3\mathbf{U}_{l}=\{\mathbf{X}_{ab},\mathbf{B}_{ab}\}\in\mathds{R}^{H\times W\times 3}.

One challenge in training deep networks is collecting training data. While data for automatic colorization is readily available – any color image can be broken up into its color and grayscale components – an appropriate mechanism for acquiring user interaction data is far less obvious. Gathering this on a large scale is not only expensive, but also comes with a chicken and egg problem, as user interaction behavior will be dependent on the system performance itself. We bypass this issue by training with synthetically generated user interactions. A concern with this approach is the potential domain gap between the generated data and test-time usage. However, we found that even through randomly sampling, we are able to cover the input space adequately and train an effective system.

We sample small patches and reveal the average patch color to the network. For each image, the number of points are drawn from a geometric distribution with p=18p=\tfrac{1}{8}. Each point location is sampled from a 2-D Gaussian with \mu=\tfrac{1}{2}[H,W]^{T},\Sigma=diag\big{(}\big{[}\big{(}\tfrac{H}{4}\big{)}^{2},\big{(}\tfrac{W}{4}\big{)}^{2}\big{]}\big{)}, as we expect users to more often click on points in the center of the image. The revealed patch size is drawn uniformly from size 1×11\times 1 to 9×99\times 9, with the average abab within the patch revealed to the network. Lastly, we desire the correct limiting characteristic – given all of the points by the user, the network should simply copy the colors from the input to the output. To encourage this, we provide the full ground truth color to the image for 1% of the training instances. Though the network should implicitly learn to copy any provided user points to the output, there is no explicit constraint for the network to do so exactly. Note that these design decisions for projection function Pl(Y)\mathcal{P}_{l}(\mathbf{Y}) were initially selected based on intuition, found to work well, but not finely tuned.

Our interface consists of a drawing pad, showing user points overlaid on the grayscale input image, a display updating the colorization result in real-time, a data-driven color palette that suggests likely color for a given location (as shown in Figure 3), and a regular abab gamut based on the lightness of the current point. A user is always free to add, move, delete, or change the color of any existing points. Please see our supplemental video for a detailed introduction of our interface, along with several demonstrations.

Picking a plausible color is an important step towards realistic colorization. Without the proper tools, selecting a color can be difficult for a novice user to intuit. For every pixel, we predict a probability distribution over output colors Z^∈\mathdsRH×W×Q\mathbf{\widehat{Z}}\in\mathds{R}^{H\times W\times Q}, where QQ is the number of quantized color bins. We use the parametrization of the CIE LabLab color space from Zhang et al. (2016) – the abab space is divided into 10×1010\times 10 bins, and the Q=313Q=313 bins that are in-gamut are kept. The mapping from the input grayscale image and user points to predicted color distribution Z^\mathbf{\widehat{Z}} is learned with network Gl\mathcal{G}_{l}, parametrized by ψl\psi_{l}. Ground truth distribution Z\mathbf{Z} is encoded from ground truth colors Y\mathbf{Y} with the soft-encoding scheme from (Zhang et al., 2016) – a real abab color value is expressed as a convex combination of its 10 nearest bin centers, weighted by a Gaussian kernel with σ=5\sigma=5. We use a cross-entropy loss function for every pixel to measure the distance between predicted and ground truth distributions, and sum over all pixels.

Network Gl\mathcal{G}_{l} is trained to minimize expected classification loss over the training set. We further describe the network architecture in Section 3.4.

To provide discrete color suggestions, we soften the softmax distribution at the queried pixel, to make it less peaky, and perform weighted k-means clustering (with K=9K=9) to find modes of the distribution. For example, the system often recommends plausible colors based on the type of object, material and texture, for example, suggesting different shades of green the vegetation in Figure 3. For objects with diverse colors such as a parrot, our system will provide a wide range of suggestions. Once a user selects a suggested color, our system will produce the colorization result in real-time. In Figure 3, we show six possible colorizations based on the different choices for the parrot’s feather. The color suggestions are continuously updated as the user adds additional points.

3. Global Hints Network

An advantage of the end-to-end learning framework is that it may be easily adapted to different types of user inputs. We show an additional use case, where the user provides global statistics, described by a global histogram Xhist∈ΔQ\mathbf{X}_{hist}\in\Delta^{Q} and average image saturation Xsat∈\mathbf{X}_{sat}\in. Whether or not the inputs are provided is indexed by indicator variables Bhist,Bsat∈\mathdsB\mathbf{B}_{hist},\mathbf{B}_{sat}\in\mathds{B}, respectively. The user input to the system is then Ug={Xhist,Bhist,Xsat,Bsat}∈\mathdsRe1×1×(Q+3)\mathbf{U}_{g}=\{\mathbf{X}_{hist},\mathbf{B}_{hist},\mathbf{X}_{sat},\mathbf{B}_{sat}\}\in\mathds{Re}^{1\times 1\times(Q+3)}.

We compute global histograms by resizing the color Y\mathbf{Y} to quarter resolution using bilinear interpolation, encoding each pixel in quantized abab space, and averaging spatially. Saturation is computed by converting the ground truth image to HSV colorspace and averaging over the S channel spatially. We randomly reveal the ground truth colorization distribution, ground truth saturation, both, or neither, to the network during training.

4. Network Architecture

We show our network architecture in Figure 2. The main colorization branch is used by both Local Hints and Global Hints networks. We then describe the layers which are only used for the Local Hints Network, namely processing the sparse user input Ul\mathbf{U}_{l} and the color distribution prediction branch, both shown in red. Finally, we describe the Global Hints Network-specific input branch, shown in green, as well as its integration in the main network.

The main branch of our network, F\mathcal{F}, uses a U-Net architecture (Ronneberger et al., 2015), which has been shown to work well for a variety of conditional generation tasks (Isola et al., 2017). We also utilize design principles from (Simonyan and Zisserman, 2014) and (Yu and Koltun, 2016). The network is formed by 10 convolutional blocks, conv1-10. In conv1-4, in every block, feature tensors are progressively halved spatially, while doubling in the feature dimension. Each block contains 2-3 conv-relu pairs. In the second half, conv7-10, spatial resolution is recovered, while feature dimensions are halved. In block conv5-6, instead of halving the spatial resolution, dilated convolutions with factor 2 is used. This has an equal effect on the receptive field of each unit with respect to the input pixels, but allows the network to keep additional information in the bottleneck. Symmetric shortcut connections are added to help the network recover spatial information (Ronneberger et al., 2015). For example, the conv2 and conv3 blocks are connected to the conv8 and conv9 blocks, respectively. This also enables easy accessibility to important low-level information for later layers; for example, the lightness value will limit the extent of the abab gamut. Changes in spatial resolution are achieved using subsampling or upsampling operations, and each convolution uses a 3×33\times 3 kernel. BatchNorm layers are added after each convolutional block, which has been shown to help training.

A subset of our network architecture, namely conv1-8 without the shortcut connections, was used by Zhang et al. (2016). For these layers, we fine-tune from these pre-trained weights. The added conv9, conv10 layers and shortcut connections are trained from scratch. A last conv layer, which is a 1×11\times 1 kernel, maps between conv10 and the output color. Because the abab gamut is bounded, we add a final tanh layer on the output, as is common practice when generating images (Goodfellow et al., 2014; Zhu et al., 2016).

4.2. Local Hints Network

The layers specific to the Local Hints Network are shown in red in Figure 2. Sparse user points are integrated by concatenation with the input grayscale image. As a side task, we also predict a color distribution at each pixel (conditioned on the grayscale and user points) to recommend to the user. The task of predicting a color distribution is undoubtedly related to the task of predicting a single colorization, so we reuse features from the main branch. We use a hypercolumn approach (Hariharan et al., 2015; Larsson et al., 2016) by concatenating features from multiple layers of the main branch, and learning a two-layer classifier on top. Network Gl\mathcal{G}_{l} is composed of the main branch, up to conv8, along with this side branch. The side task should not affect the main task’s representation, so we do not back-propagate the gradients from the side task into the main branch. To save computation, we predict the distribution at a quarter resolution, and apply bilinear upsampling to predict at full resolution.

4.3. Global Hints Network

Because the global inputs have no spatial information, we choose to integrate the information into the middle of the main colorization network. As shown in the top green branch in Figure 2, the inputs are processed through 4 conv-relu layers, with kernel size 1×11\times 1 and 512 channels each. This feature map is repeated spatially to match the size of the conv4 feature in the main branch, \mathdsR\nicefracH8×\nicefracW8×512\mathds{R}^{\nicefrac{{H}}{{8}}\times\nicefrac{{W}}{{8}}\times 512}, and merged by summation, a similar strategy to the one used by Iizuka et al. (2016).

Experiments

We detail qualitative and quantitative experiments with our system. In Section 4.1, we first automatically test the Local Hints Network. We then describe our user study in Section 4.2. The results suggest that even with little training and just 1 minute to work with an image, novice users can quickly create realistic colorizations. In Section 4.3, we show qualitative examples on unusual colorizations. In Section 4.4 we evaluate our Global Hints Network. In Section 4.5, we investigate how the Local Hints Network reconciles two colors within a single segment. Finally, we show qualitative examples on legacy grayscale images in Section 4.6.

We test the system automatically by randomly revealing patches to the algorithm, and measuring PSNR, as shown in Figure 6. The pitfalls of using low-level or per-pixel metrics have been discussed in the automatic colorization regime (Zhang et al., 2016). A system which chooses a plausible but different mode than the ground truth color will be overly penalized, and may even achieve a lower score than an implausible but neutral colorization, such as predicting gray for every pixel (PSNR 22.8). In this context, however, since ground truth colors are revealed to the algorithm, the problem is much more constrained, and PSNR is a more appropriate metric.

With no revealed information, edit propagation methods will default to gray for the whole image. Our system will perform automatic colorization, and provide its best estimate (PSNR 24.4), as described in Table 1. As points are revealed, PSNR incrementally increases across all methods. Our method achieves a higher PSNR than other methods, even up to 500 random points. As the number of points increases, edit propagation techniques such as (Levin et al., 2004) approach our method, and will inevitably surpass it. In the limiting case, where every point is revealed, edit propagation techniques such as (Levin et al., 2004; Barron and Poole, 2016; Endo et al., 2016) will correctly copy the inputs to the outputs (PSNR ∞\infty). Our system is taught to do this, based on 1%1\% of the training examples, but will not do so perfectly (PSNR 37.70). As the number of points increases to the hundreds, knowledge of mid-to-high-level natural image statistics has diminishing importance, and the problem can be solved using low-level optimization.

We also note that our method has been designed with point inputs, whereas previous work has been designed with stroke and point-based inputs in mind. In an interactive setting, the collection cost of strokes versus points is difficult to define, and will heavily depend on factors such as proper optimization of the user interface. However, the results strongly suggest that our method is able to accurately propagate sparse, point-based inputs.

2. Does our system aid the user in generating realistic colorizations?

We run a user study, with the goal of evaluating if novice users, given little training, can quickly produce realistic colorizations using our system. We provide minimal training for 28 test subjects, briefly walking them through our interface for 2 minutes. The subjects are given the goal of producing “realistic colorizations” (without benefit of seeing the ground truth), and are provided 1 minute for each image. Images are randomly drawn from our ImageNet test set. Each subject is given 20 images – 10 images with our algorithm and full interface, including suggested colors, and 10 images with our algorithm but no color suggestions, for a total of 560 images (280 per test setting). We evaluate the resulting colorizations, along with automatic colorization, by running a real vs. fake test on Amazon Mechanical Turk (AMT), using the procedure proposed by Zhang et al. (2016). AMT evaluators are shown two images in succession for 1 second each – one ground truth and one synthesized – and asked to identify the synthesized. We measure the “fooling rate” of each algorithm; one which produces ground truth colorizations every time would achieve 50%50\% by this metric. The results are shown in Table 2. Note that the results may differ on an absolute scale from previous iterations of this test procedure (Zhang et al., 2016; Isola et al., 2017), due to shifts or biases in the AMT population when the algorithm has been tested. Our network produces a fooling rate of 18.6%18.6\% when run completely automatically (no user inputs). We test our interface without recommended colors, but with HSV sliders and 48 common colors. With this baseline interface, the fooling rate increases dramatically to 27.0%27.0\%, indicating that users quickly acclimated to our network and made dramatic improvements with just 1 minute. When provided the data-driven color palette, the fooling rate further increases to 30.0%30.0\%. This suggests that the color prediction feature can aid users in quickly selecting a desired color.

We show example results from our study in Figures 4 and 5. We compare the annotations to the seminal method proposed by Levin et al. (2004), along with the automatic output from our network. Qualitatively, the added user points typically add (1) saturation when the automatic result is lacking and (2) accurate higher frequency detail, that automatic methods have difficulty producing. Comparing our method to Levin et al. (2004), our method is more effective at finding segment boundaries given sparse user inputs. We do note that the user points are collected by running our system, which provides an advantage. However, collecting these points, with the right colors, is enabled by the interactive nature of our algorithm and our color recommendation system.

3. Does the network generalize to unusual colorizations?

During training, we use natural images, and reveal the ground truth colors to simulate user input. However, there are use cases where the user may intentionally desire an unusual colorization. Will the network be able to follow the inputs in these cases? In Figure 7, we show an unusual colorization guided by the user, giving the actor a green face with three user points on the face. These results suggest that in the absence of nearby user inputs, the network will attempt to find an appropriate colorization for the object, based on the training corpus. However, once an input is provided by the user, the system fills in the segment with the desired color.

4. Is the system able to incorporate global statistics?

We train a variant of our system, taking global statistics as inputs, instead of local points. As described in Table 1, when given the ground truth statistics, such as the global histogram of colors or average saturation, the network achieves a higher PSNR scores, 27.9 and 25.6, respectively, than when performing automatic colorization (24.4), indicating that the network has learned how to fuse global statistics. We also test on the SUN-6 dataset, shown in Table 3, proposed by Deshpande et al. (2015). We show higher performance than Despande et al. (2015) and almost equal performance with Larsson et al. (2016), which fuses the predictions from an automatic colorization network with a ground truth histogram using an energy minimization procedure.

The network has only been trained on images with its own ground truth histogram. In Figure 9, we qualitatively the network’s generalization ability by computing the global histogram on separate reference images, and apply them to a photograph. The bird is an interesting test case, as it can be plausibly colorized in many different ways. We observe that that the color distributions of the reference input image is successfully transferred to the target grayscale image. Furthermore, the colorizations are realistic and diverse.

5. How does the system respond to multiple colors within an equiluminant segment?

In natural images, chrominance changes almost never appear without a lightness change. In Figure 8(a), we show a toy example of an image of a gray square on top of a black square. If given a 7×77\times 7 point in the center of the image, the system will successfully propagate the color to the center region, as shown in Figures 8(a)(b). However, how does the system respond if given two different colors within the same segment, as shown in Figure 8(d)? Given blue and red points, the system draws a seam between the two colors, as shown in Figure 8(e), where two points are placed symmetrically around the center of the image. Because our system is learned from data, it is difficult to characterize how the system will exactly behave in such a scenario. Qualitatively, we observe that the seam is not straight, and the shape as well as the sharpness of the transition is dependent on the colors. For example, in Figure 8(f), green and pink points produce a harder seam. We found similar behavior under similar scenarios in natural images as well.

6. Is the system able to colorize legacy photographs?

Our system was trained on “synthetic” grayscale images by removing the chrominance channels from color images. We qualitatively test our system on legacy grayscale images, and show some selected results in Figure 10.

Limitations and Discussion

A benefit of our system is that the network predicts user-intended actions based on learned semantic similarities. However, the network can also be over-optimistic and produce undesired non-local effects. For example, points added on a foreground object may cause an undesired change in the background, as shown on the last row in Figure 4. Qualitatively, we found that adding some control points can remedy this. In addition, the network can also fail to completely propagate a user point, as shown in the fifth row in Figure 4. In these instances, the user can fill in the region with additional input.

For scenes with difficult segmentation boundaries, the user sometimes needs to define boundaries explicitly by densely marking either side. Our system can continuously incorporate this information, even with hundreds of input points, as shown on Figure 6. Points can be added to fix color bleeding artifacts when the system has poor underlying segmentation. However, our interface is mainly designed for the “few seconds to couple minutes” interaction regime. For users wanting high-precision control and willing to spend hours per photograph, working in Photoshop is likely a better solution.

Our system is currently trained on points; we find that in this regime random sampling covers the low-dimensional workspace surprisingly well. However, a future step is to better simulate the user, and to effectively incorporate stroke-based inputs that traditional methods utilize. Integration between the local user points and global statistics inputs would be an interesting next step. Our interface code and models are publicly available at https://richzhang.github.io/ideepcolor, along with all images generated from the user study and random global histogram transfer results.

Acknowledgements

We thank members of the Berkeley Artificial Intelligence Research Lab for helpful discussions. We also thank the participants in our user study, along with Aditya Deshpande and Gustav Larsson for providing images for comparison. This work has been supported, in part, by NSF SMA-1514512, a Google Grant, BAIR, and a hardware donation by NVIDIA.

Change Log

v1 Initial release. SIGGRAPH camera ready version. DOI: http://dx.doi.org/10.1145/3072959.3073703

References