Papers › The Devil Is in the Details: Window-based Attention for Image Compression

The Devil Is in the Details: Window-based Attention for Image Compression

16 Mar 2022CVPR 2022 1arXiv:2203.08450archive 2025-07-28

Renjie Zou, Chunfeng Song, Zhaoxiang Zhang

Learned image compression methods have exhibited superior rate-distortion performance than classical image compression standards. Most existing learned image compression models are based on Convolutional Neural Networks (CNNs). Despite great contributions, a main drawback of CNN based model is that its structure is not designed for capturing local redundancy, especially the non-repetitive textures, which severely affects the reconstruction quality. Therefore, how to make full use of both global structure and local texture becomes the core problem for learning-based image compression. Inspired by recent progresses of Vision Transformer (ViT) and Swin Transformer, we found that combining the local-aware attention mechanism with the global-related feature learning could meet the expectation in image compression. In this paper, we first extensively study the effects of multiple kinds of attention mechanisms for local features learning, then introduce a more straightforward yet effective window-based local attention block. The proposed window-based attention is very flexible which could work as a plug-and-play component to enhance CNN and Transformer models. Moreover, we propose a novel Symmetrical TransFormer (STF) framework with absolute transformer blocks in the down-sampling encoder and up-sampling decoder. Extensive experimental evaluations have shown that the proposed method is effective and outperforms the state-of-the-art methods. The code is publicly available at https://github.com/Googolxx/STF.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2203.08450")

Code

Syntology Ran 12 of 15 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 3 ran · honoured contract; 3 ran · our draft was wrong; 1 ran · fixture could not drive it; 5 ran with no contract checked.

By repository: official repository: 15 samples from 1 repository, 12 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

googolxx/stf officialmentioned in paperpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 12 ran; 3 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

3ran · honoured contract
3ran · our draft was wrong
1ran · fixture could not drive it
5ran
3unverified

Licence: 0 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from googolxx/stf. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

conv googolxx/stf/compressai/models/utils.py official repository ran · our draft was wrong Apache-2.0 (permissive) · f2cea3e9848ae52d · report
conv1x1 googolxx/stf/compressai/layers/layers.py official repository ran Apache-2.0 (permissive) · 15eae621014906be · report
conv3x3 googolxx/stf/compressai/layers/layers.py official repository ran Apache-2.0 (permissive) · 0cbeed6985b2cf30 · report
find_named_buffer googolxx/stf/compressai/models/utils.py official repository ran · honoured contract Apache-2.0 (permissive) · a94389b554ddc179 · report
get_scale_table googolxx/stf/compressai/models/cnn.py official repository ran · honoured contract Apache-2.0 (permissive) · feb29b32fc1ec50e · report
get_scale_table googolxx/stf/compressai/models/stf.py official repository ran · honoured contract Apache-2.0 (permissive) · 1eca81f63e28f103 · report
ste_round googolxx/stf/compressai/ops/ops.py official repository ran fingerprinted Apache-2.0 (permissive) · 8e528b0db078ab0e · report
subpel_conv3x3 googolxx/stf/compressai/layers/layers.py official repository ran Apache-2.0 (permissive) · 8bc3a872b71e34f4 · report
window_partition googolxx/stf/compressai/models/stf.py official repository ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · f6b2d702fc756d64 · report
window_partition googolxx/stf/compressai/layers/win_attention.py official repository ran fingerprinted Apache-2.0 (permissive) · 565f4668acf5b8f4 · report
window_reverse googolxx/stf/compressai/layers/win_attention.py official repository ran · our draft was wrong Apache-2.0 (permissive) · fb32094c6dbece71 · report
window_reverse googolxx/stf/compressai/models/stf.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 7b0d02f75bf6b439 · report
find_named_module googolxx/stf/compressai/models/utils.py official repository unverified Apache-2.0 (permissive) · 0b4d7c9d1baaf828 · report
lower_bound_bwd googolxx/stf/compressai/ops/bound_ops.py official repository unverified Apache-2.0 (permissive) · 07f8484bf7fe9b22 · report
lower_bound_fwd googolxx/stf/compressai/ops/bound_ops.py official repository unverified Apache-2.0 (permissive) · 9d2139d32f9bca32 · report

Tasks

DecoderImage Compression

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Compression kodak WACNN BD-Rate over VTM-17.0 -2.95 #6 of 8 Archive leaderboard report
Image Compression kodak STF BD-Rate over VTM-17.0 -2.48 #7 of 8 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxStochastic DepthSwin TransformerTransformerVision Transformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections