# Colorful Image Colorization

Grayscale photo colorization can yield vibrant, realistic colors

Richard Zhang, Phillip Isola, Alexei A. Efros · arXiv · 2016-3-28

- **Problem** Colorizers trained with regression losses produce washed-out photos, because averaging several plausible colors yields gray.
- **Method** The authors predict a probability over 313 color bins per pixel, reweight rare colors in the loss, and decode with an annealed mean.
- **Results** The method fooled humans on 32% of trials in a colorization Turing test, significantly higher than previous methods.

## Why grayscale colorization is underdetermined

A grayscale image keeps only lightness, so two of the three color dimensions are missing and any colorizer has to guess them. Scene semantics and surface texture still constrain those guesses for many regions, so grass, sky and similar objects can be colored with reasonable confidence. The target is a plausible color rather than the true one, which makes the task more tractable.

Color supervision comes almost for free, because any color photograph supplies its own lightness input and its own ab target. Earlier convolutional colorizers trained on such data produced washed-out output, and the authors link this to the Euclidean regression losses those models inherited.

## Why a squared-error loss averages colors toward gray

The network maps the lightness channel \\(X\\), with \\(H \\times W \\times 1\\) values, to the two chroma channels \\(Y\\), with \\(H \\times W \\times 2\\) values, both defined in CIE Lab. A Euclidean loss between predicted and true ab values is the obvious first objective, since distances in Lab track perceived color difference.

When an object could take several distinct ab values, the minimizer of squared error is their average, and that average tends to be grayish. If the set of plausible colors is non-convex, the average can fall outside that set and produce an implausible color.

## Predicting a color distribution over quantized bins

The ab plane is discretized on a grid of spacing 10, and only the 313 bins that lie inside the gamut are kept as classes. For each pixel, the network outputs a probability over those Q bins, written as \\(\\hat{Z} = G(X)\\).

Each ground-truth color is converted into a soft target that spreads weight over its five nearest bins, with weights set by a Gaussian kernel of distance and \\(\\sigma = 5\\). Hard one-hot targets would also work, but the authors found that soft targets trained faster and helped the network learn how neighboring output bins relate.

Training minimizes a weighted multinomial cross entropy, \\\[ L\_{cl}(\\hat Z, Z) = -\\sum\_{h,w} v(Z\_{h,w}) \\sum\_q Z\_{h,w,q} \\log(\\hat Z\_{h,w,q}) \\\]. The minus sign turns the log-likelihood into a loss to be minimized, and the weight \\(v(\\cdot)\\) rescales each pixel according to the rarity of its color class.

## Rebalancing rare colors

Natural images contain many desaturated pixels from clouds, pavement and walls, so the ab histogram is strongly skewed. Counting over 1.3M ImageNet training images, the authors found desaturated values occur orders of magnitude more often than saturated ones.

Without correction, the loss is dominated by these desaturated bins, so each pixel is weighted by a value derived from its nearest bin. The empirical bin distribution is smoothed with a Gaussian kernel, mixed with a uniform distribution, inverted, and normalized so the expected weight under the data equals 1.

Setting \\(\\lambda = 1\\) removes the rebalancing, and that variant is the one the paper calls Ours (class).

## From a color distribution to one color

Taking the mode of each pixel's distribution gives vibrant colors that can be spatially inconsistent, as in red splotches on a bus. Taking the mean gives spatially consistent colors that are desaturated, with an unnatural sepia tone.

The annealed-mean sharpens each pixel's distribution with a temperature and then takes the expectation, \\\[ \\mathcal{H}(Z\_{h,w}) = \\mathbb{E}\[f\_T(Z\_{h,w})\], \\quad f\_T(z) = \\frac{\\exp(\\log(z)/T)}{\\sum\_q \\exp(\\log(z\_q)/T)} \\\]. With \\(T = 1\\) the distribution is unchanged, a smaller \\(T\\) makes it more peaked, and \\(T\\) approaching 0 yields a one-hot at the mode.

The authors chose \\(T = 0.38\\), a setting that keeps the vibrancy of the mode while staying spatially coherent like the mean. The decoding works on each pixel independently with one parameter and runs inside the feed-forward pass, although the whole system is not trained end to end.

## Fooling observers in a real-versus-fake test

Models were trained on 1.3M ImageNet training images and validated and tested on separate 10k-image splits of the ImageNet validation set. Ours (full) is compared with Ours (class), Ours (L2), Ours (L2, ft), Larsson et al., Dahl, a Gray baseline and a Random baseline.

Each pair showed a color photo next to a recolorized version, with 256×256 images shown for one second each, followed by 10 practice trials with feedback and 40 test pairs without feedback. Each algorithm was judged by 40 participants, and each participant completed at most one session. On 10% of the trials the ground truth was paired with the Random baseline, and participants labeled the random colorizations as fake 87% of the time.

The full method fooled participants on 32% of trials, a rate above every compared algorithm at p \< 0.05 except Larsson et al., where the difference was not significant at p = 0.10.

Some pairs fooled participants more than half the time, which the authors attribute to poor white balance in the ground truth that the method corrects toward a more typical appearance. On the pairs where participants were never fooled, the method left visible artifacts such as yellow blotches on trucks.

## Classifier and pixel-accuracy checks

A VGG network trained on real color photos reached 68.3% on ground truth and 52.7% on grayscale inputs. Recolorizing with the full method raised this to 56.0%, while Larsson et al. reached 59.4%, the highest of the compared methods. A VGG network fine-tuned on grayscale inputs reaches 63.5% as a reference point.

Colorizing images before classification improves a color-trained classifier on grayscale input without any further training.

The AuC metric counts the share of predicted ab values within a thresholded L2 distance of ground truth, sweeps thresholds from 0 to 150, and integrates the resulting curve. Ours (class) scores 91.6 and Ours (L2) scores 91.2 in the non-rebalanced column, with Larsson et al. at 91.7 and Gray at 89.1, while Ours (full) scores 89.5. Because the metric is dominated by desaturated pixels, predicting gray everywhere already scores close to the full method.

Ours (L2) trained from scratch falls below Ours (class), and fine-tuning it from the classification network brings it to 91.5, which the authors read as evidence that the L2 objective is accurate but hard to optimize from scratch.

Under the class-balanced variant, which reweights pixels inversely by color class probability, Ours (full) scores 67.3, against 65.9 for Larsson et al., 65.1 for Ours (class) and 58.0 for Gray.

## Colorization as a pretext task

The model is akin to an autoencoder, but its input and output are different channels of the same image, so the authors call it a cross-channel encoder. Colorization therefore supplies its own target from raw color data, as in other self-supervised approaches.

AlexNet was retrained on colorization with the full method for 450k iterations, its internal layers were frozen, and linear classifiers were trained on each convolutional layer for ImageNet classification. AlexNet trained directly on ImageNet classification serves as the ceiling for this test.

For all three random or grayscale-based baselines, color inputs score about 6% above grayscale inputs, and this gap stays roughly constant across layers. The conv1 layer is weaker than competing self-supervised methods but comparable to methods that also take grayscale input, and the gap closes by conv2, after which the method stays competitive.

In the non-linear probe of Table 3, Ours reaches 35.2 at conv5, while Noroozi & Favaro reach 38.1 in the same table. The text describes the method as best across methods at conv5 and Noroozi & Favaro as best on all layers, which does not match the table at conv5, so the table values are the ones to read.

## Transfer to PASCAL tasks

Two fine-tuning modes were tested: one keeps grayscale input, and the other gives conv1 a full 3-channel Lab input with the ab weights initialized to zero. The layers were rescaled with the method of prior work so that they learn at the same rate.

The grayscale result is approximately equal to Donahue et al., and the color-input result is above the other tested algorithms.

On PASCAL VOC 2007 detection with Fast R-CNN, Doersch et al. reach 51.1%, the k-means baseline reaches 45.6%, and ImageNet semantic supervision reaches 56.8%. The text gives 46.9% and 47.9% for the gray and color inputs of this method, whereas Table 2 lists 46.1 and 46.9 in its detection column for those rows.

The authors state that the representation achieves state-of-the-art numbers on classification and segmentation, but detection stays below ImageNet pre-training.

## Limits of the evidence

For artificial objects such as modems and clothes, colors are ambiguous and the output can mix red and blue incoherently.

The L2 objective was harder to optimize from scratch than the classification objective. On PASCAL detection, all self-supervised methods in the comparison fall short of ImageNet semantic supervision.

The AuC measures raw accuracy, while the method aims for plausibility, and its non-rebalanced form is dominated by desaturated pixels. The Larsson et al. difference in the human test was not significant at p = 0.10, and each algorithm was judged by 40 participants.

## Beyond the ImageNet test split

On the LEARCH test set of 240 SUN scene images, the method scores 90.1 AuC CMF against 88.8 for Deshpande et al. and 89.3 for grayscale. In the real-versus-fake test on the same set, it reaches 17.2 ± 1.9 against 9.8 ± 1.5 for Deshpande et al.

Applied to legacy black-and-white photographs, the model still gives usable colors, even though those photographs have low-level statistics that differ from its training photos.

Against Deep Colorization, the comparison is qualitative on 23 hand-picked test images, and Table 6 lists 4.9s/image for Deep Colorization against 21.1ms/image in Caffe for this method. The Deep Colorization test set was 1344 SUN images, and the authors could not obtain results on it.

## Paper info

- **Authors**: Richard Zhang, Phillip Isola, Alexei A. Efros
- **Venue**: arXiv · Preprint
- **First published**: 2016-3-28
- **Added**: 2026-11-12
- **Updated**: 2016-10-5
- **Version**: v5
- **arXiv**: 1603.08511
- **Category**: cs.CV
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1603.08511v5) · [PDF ↗](https://arxiv.org/pdf/1603.08511v5)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Richard Zhang, Phillip Isola, Alexei A. Efros (2016). Colorful Image Colorization. arXiv:1603.08511v5. https://arxiv.org/abs/1603.08511v5

**BibTeX**

```
@misc{zhang2016colorful,
  title = {{Colorful Image Colorization}},
  author = {Richard Zhang and Phillip Isola and Alexei A. Efros},
  year = {2016},
  eprint = {1603.08511},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1603.08511v5}
}
```

## Other paper commentary

- [Deep Neural Networks are Easily Fooled: High Confidence Predictions for Unrecognizable Images](https://refivu.com/en/papers/f4c978c2-8ce0-412c-af24-4039197ac185-deep-neural-networks-are-easily-fooled-high-confidence.md)
- [BDD100K: A Diverse Driving Dataset for Heterogeneous Multitask Learning](https://refivu.com/en/papers/d564e564-2508-4ec4-987a-011445b39696-bdd100k-a-diverse-driving-dataset-for-heterogeneous.md)
- [The Effectiveness of Data Augmentation in Image Classification using Deep Learning](https://refivu.com/en/papers/dce0e6e2-408a-4750-8e27-0acf7a41b5e6-the-effectiveness-of-data-augmentation-in-image.md)
- [Holistically-Nested Edge Detection](https://refivu.com/en/papers/4e4005ad-53a4-40bd-8c81-abf1f3ea35bf-holistically-nested-edge-detection.md)
- [Multi-View 3D Object Detection Network for Autonomous Driving](https://refivu.com/en/papers/f58134ec-87c8-446c-9cb7-11f607b68051-multi-view-3d-object-detection-network-for-autonomous.md)
- [Return of the Devil in the Details: Delving Deep into Convolutional Nets](https://refivu.com/en/papers/799263cd-4207-4a10-a587-306f8a7610b7-return-of-the-devil-in-the-details-delving.md)
- [Continual Lifelong Learning with Neural Networks: A Review](https://refivu.com/en/papers/322eae66-d551-4a11-a5e4-5955f903b100-continual-lifelong-learning-with-neural-networks-a-review.md)
- [A Comparative Analysis of XGBoost](https://refivu.com/en/papers/e2cd85b1-68fe-463c-be8d-ad73613040b8-a-comparative-analysis-of-xgboost.md)
- [Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks](https://refivu.com/en/papers/1c58c569-ccc9-46f2-b934-b34b865af6d4-improved-semantic-representations-from-tree-structured-long.md)
- [Selective Kernel Networks](https://refivu.com/en/papers/958e4edd-4fd5-43a9-a954-172b1f630ca0-selective-kernel-networks.md)

## Terms in this paper

- [ImageNet](https://refivu.com/en/terms/5eadad128667-imagenet)
- [AUC](https://refivu.com/en/terms/017a335bbf0e-auc)
- [Euclidean loss](https://refivu.com/en/terms/f2efb09940d7-euclidean-loss)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/15523601-cc75-4645-8e4f-8d58aa39d74f-colorful-image-colorization)
