ColorFormer
An automatic colorization network with a hybrid-attention Transformer encoder and a color memory decoder.
Diffusion and generative · 1,064 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 44.8M
- Operations
- 1,064
- Framework
- PyTorch
- Recurrent
- No
- Published
- ECCV 2022, LNCS vol. 13676, pp. 20-36
- Cited by
- 62 (as of 24 October 2026)
- Authors
- Xiaozhong Ji, Boyuan Jiang, Donghao Luo and others
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m15380
- Graph hash
- 3acc2e72b6e1a17272da47393252144f44b0a9a0afccc2536babf91bafdca080
- Skeleton hash
- 440f79dde9bfefb9bda6d83d641ab48cce5c34cffe664bf9b1afa350a57491e5
- Architecture hash
- 12ffac43716984bd93369432d2ca11d725d99b67b311ab40073430234419fb67
- Diagram SHA-256
- 808d34ca3bdf7594b78755c04d23a74fcbc0f9f369f14a94f93e4b17dcee5276
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
ColorFormer is an automatic image colorization model: it colors a grayscale image without any additional reference. The paper starts from the claim that existing methods ignore two key elements, semantic consistency and color richness.
The network is given only the l (luminance) channel of the CIELAB color space and restores the two missing ab (chrominance) channels. Its encoder is a Transformer built around global-local hybrid attention, in which the keys and values of each local window are concatenated with global keys and values computed from a pooled copy of the feature map. Each encoder block also uses shifted-window attention (SW-MSA) for connections across windows. The decoder has four upsampling stages, and between the third and the last one sits a Color Memory (CM) module that supplies color priors as a reference. The memory pairs semantic representations, used as keys, with color priors, used as values, and this correspondence is established before network training. The paper sets the memory to 512 semantic-color pairs, a key dimension of 64 and 4 groups of color priors.
On ImageNet, the paper reports the lowest Fréchet inception distance (FID) among the methods it compared. It also reports colorizing 256 × 256 gray images at 40 FPS with 44.8M model parameters.
Key idea. The paper built ColorFormer, an automatic colorization network that consists of a Transformer-based encoder with global-local hybrid attention and a decoder that queries a color memory.
- colorformer
- image colorization
- automatic colorization
- grayscale to color
- color memory
- hybrid-attention transformer
- glh-transformer
- black and white photo colorization
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@inbook{Ji_2022, title={ColorFormer: Image Colorization via Color Memory Assisted Hybrid-Attention Transformer}, ISBN={9783031197871}, ISSN={1611-3349}, url={http://dx.doi.org/10.1007/978-3-031-19787-1_2}, DOI={10.1007/978-3-031-19787-1_2}, booktitle={Computer Vision – ECCV 2022}, publisher={Springer Nature Switzerland}, author={Ji, Xiaozhong and Jiang, Boyuan and Luo, Donghao and Tao, Guangpin and Chu, Wenqing and Xie, Zhifeng and Wang, Chengjie and Tai, Ying}, year={2022}, pages={20–36} }