Papers › MatteFormer: Transformer-Based Image Matting via Prior-Tokens

MatteFormer: Transformer-Based Image Matting via Prior-Tokens

29 Mar 2022CVPR 2022 1arXiv:2203.15662archive 2025-07-28

Gyutae Park, Sungjoon Son, Jaeyoung Yoo, SeHo Kim, Nojun Kwak

In this paper, we propose a transformer-based image matting model called MatteFormer, which takes full advantage of trimap information in the transformer block. Our method first introduces a prior-token which is a global representation of each trimap region (e.g. foreground, background and unknown). These prior-tokens are used as global priors and participate in the self-attention mechanism of each block. Each stage of the encoder is composed of PAST (Prior-Attentive Swin Transformer) block, which is based on the Swin Transformer block, but differs in a couple of aspects: 1) It has PA-WSA (Prior-Attentive Window Self-Attention) layer, performing self-attention not only with spatial-tokens but also with prior-tokens. 2) It has prior-memory which saves prior-tokens accumulatively from the previous blocks and transfers them to the next block. We evaluate our MatteFormer on the commonly used image matting datasets: Composition-1k and Distinctions-646. Experiment results show that our proposed method achieves state-of-the-art performance with a large margin. Our codes are available at https://github.com/webtoon/matteformer.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology 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.15662")

Code

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

By repository: official repository: 7 samples from 1 repository, 4 ran; 1 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

webtoon/matteformer officialmentioned in papermentioned on GitHubpytorch 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

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

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

Licence: 1 of the 8 samples is 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 webtoon/matteformer. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “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.

PAWSA webtoon/matteformer/networks/encoders/MatteFormer.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · be3f1570f7ddf136 · report
PatchEmbed webtoon/matteformer/networks/encoders/MatteFormer.py official repository ran · metamorphic tier: deterministic fingerprinted Apache-2.0 (permissive) · 129c03641741d697 · report
SpectralNorm webtoon/matteformer/networks/encoders/MatteFormer.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · e489b0e620c2827e · report
window_partition webtoon/matteformer/networks/encoders/MatteFormer.py official repository ran · fixture could not drive it Apache-2.0 (permissive) · 93033d45b73cce18 · report
BasicLayer webtoon/matteformer/networks/encoders/MatteFormer.py official repository unverified Apache-2.0 (permissive) · 0ff17c6f3aabd80e · report
MatteFormer webtoon/matteformer/networks/encoders/MatteFormer.py official repository unverified Apache-2.0 (permissive) · af540816b46af375 · report
PASTBlock webtoon/matteformer/networks/encoders/MatteFormer.py official repository unverified Apache-2.0 (permissive) · 42d0760afaf8ab98 · report
l2normalize identical code first harvested elsewhere ran · our draft was wrong fingerprinted licence of this copy not recorded · bedff51745d2cf84 · report

Tasks

Image Matting

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Matting Composition-1K MatteFormer Conn 18.9 #5 of 13 Archive leaderboard report
Image Matting Composition-1K MatteFormer Grad 8.7 #5 of 13 Archive leaderboard report
Image Matting Composition-1K MatteFormer MSE 4.0 #5 of 13 Archive leaderboard report
Image Matting Composition-1K MatteFormer SAD 23.8 #5 of 13 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

AttentionSwin TransformerTransformer

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