STF
A learned image compression model with Transformer blocks in both its encoder and its decoder.
Diffusion and generative · 2,348 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
- 99.9M
- Operations
- 2,348
- Framework
- PyTorch
- Recurrent
- No
- Published
- CVPR 2022
- Cited by
- 309 (as of 24 October 2026)
- Authors
- Renjie Zou, Chunfeng Song, Zhaoxiang Zhang
- Source
- GitHub: Googolxx/STF
- 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
- m20180
- Graph hash
- c314dd1efedb340c486a7eccd9ee75c3493690b4071f960ad6dd8d7d55ebd558
- Skeleton hash
- 6952249fa5e3dc99055b19dbbe2bb2e2367d8b90b11fb41db7cb379fc6424eb7
- Architecture hash
- 071de9bfb9be5fc72f3f6b78bf04a28fec3090e2be8d94a76a359e37e76861ec
- Diagram SHA-256
- 825275bc70f90e24e961a95f423c06621592b5fe990dcab1910b00f764bff9b6
- 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
STF (Symmetrical TransFormer) is a learned lossy image compression model whose encoder and decoder are both built from Transformer blocks. The paper starts from the observation that CNN-based compression models are not designed to capture local redundancy, especially non-repetitive textures, which hurts reconstruction quality. Its answer is attention computed within local windows.
The encoder splits the image into patches and passes them through Transformer blocks and patch merging layers, which reduce the resolution and double the channels. The decoder mirrors it with Transformer blocks, patch splitting layers and a de-embedding layer. The paper sets the patch size to 2, the window size to 4 and the channel number C to 48. Layer normalization is used because the authors found generalized divisive normalization (GDN) unstable in a deep Transformer-based architecture. The latent is coded with a channel-wise auto-regressive entropy model.
Training used 256×256 crops of 300k images from the OpenImages dataset. On the Kodak dataset, the paper reports that when trained for MSE and measured by PSNR its CNN-based and STF models perform very closely and outperform the other learned compression methods it compared. The authors describe the design as possibly the first exploration of an up-sampling transformer, especially for image compression.
Key idea. The paper introduces window-based local attention for learned image compression and a Symmetrical TransFormer with Transformer blocks in both the down-sampling encoder and the up-sampling decoder.
- stf
- symmetrical transformer
- learned image compression
- lossy image compression
- window-based attention
- window attention
- transformer image codec
- neural image compression
- rate-distortion
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{zou2022devildetailswindowbasedattention,
title={The Devil Is in the Details: Window-based Attention for Image Compression},
author={Renjie Zou and Chunfeng Song and Zhaoxiang Zhang},
year={2022},
eprint={2203.08450},
archivePrefix={arXiv},
primaryClass={eess.IV},
url={https://arxiv.org/abs/2203.08450},
}