Papers › End-to-End Transformer Based Model for Image Captioning

End-to-End Transformer Based Model for Image Captioning

29 Mar 2022arXiv:2203.15350archive 2025-07-28

Yiyu Wang, Jungang Xu, Yingfei Sun

CNN-LSTM based architectures have played an important role in image captioning, but limited by the training efficiency and expression ability, researchers began to explore the CNN-Transformer based models and achieved great success. Meanwhile, almost all recent works adopt Faster R-CNN as the backbone encoder to extract region-level features from given images. However, Faster R-CNN needs a pre-training on an additional dataset, which divides the image captioning task into two stages and limits its potential applications. In this paper, we build a pure Transformer-based model, which integrates image captioning into one stage and realizes end-to-end training. Firstly, we adopt SwinTransformer to replace Faster R-CNN as the backbone encoder to extract grid-level features from given images; Then, referring to Transformer, we build a refining encoder and a decoder. The refining encoder refines the grid features by capturing the intra-relationship between them, and the decoder decodes the refined features into captions word by word. Furthermore, in order to increase the interaction between multi-modal (vision and language) features to enhance the modeling capability, we calculate the mean pooling of grid features as the global feature, then introduce it into refining encoder to refine with grid features together, and add a pre-fusion process of refined global feature and generated words in decoder. To validate the effectiveness of our proposed model, we conduct experiments on MSCOCO dataset. The experimental results compared to existing published works demonstrate that our model achieves new state-of-the-art performances of 138.2% (single model) and 141.0% (ensemble of 4 models) CIDEr scores on `Karpathy' offline test split and 136.0% (c5) and 138.3% (c40) CIDEr scores on the official online test server. Trained models and source code will be released.

PaperPDFCodeCode Syntology ranMethod as code

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 33 code samples harvested from 2 repositories linked to this paper: 17 ran (of which 9 constructed an object rather than computing a result; 14 with no instrument failure: 1 honoured, 2 violated, 11 with no contract checked; 3 where Syntology's instrument failed) · 16 unverified. Where Syntology's instrument failed: 1 where our contract draft was wrong; 2 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 15 samples from 1 repository, 8 ran (5 with no instrument failure; 3 where Syntology's instrument failed); community (archive-listed): 18 samples from 1 repository, 9 ran (9 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

232525/PureT officialmentioned on GitHubpytorchSyntology: 15 samples, 8 ran (3 instrument-failed) · 7 unverified report
jchenghu/expansionnet_v2 mentioned on GitHubpytorchSyntology: 18 samples, 9 ran (0 instrument-failed) · 9 unverified 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

33 samples harvested: 17 ran (of which 9 constructed an object rather than computing a result; 14 with no instrument failure: 1 honoured, 2 violated, 11 with no contract checked; 3 where Syntology's instrument failed) · 16 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · honoured contract
2ran · violated contract
1ran · our draft was wrong
2ran; the contract check could not run
11ran
16unverified

Licence: 15 of the 33 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 2 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. For 4 samples that ran, the graph records a signature this page does not show: for a class the fixture built without calling, the harness called the object with inputs it made up itself, so the recorded signature is the harness's probe, not the fixture's arguments. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

232525/PureT official repository 15 samples, 8 ran (3 instrument-failed) · 7 unverified
DecoderLayer in 43 papers models/pure_transformer.py ran no licence file found · pointer only · 1ba18af6ffb51016 · report fixture: returned DecoderLayer · level recorded 2026-09-22
FeedForward in 198 papers models/pure_transformer.py ran no licence file found · pointer only · 2b5d0b9e88a90691 · report fixture: returned FeedForward · level recorded 2026-09-22
MultiHeadSelfAttention in 17 papers models/pure_transformer.py ran fingerprinted no licence file found · pointer only · 1b4e47ec99e1e927 · report fixture: signature q:Tensor/3/float, k:Tensor/3/float, v:Tensor/3/float, mask:NoneType/0/? · returned Tensor · level recorded 2026-09-24
activation in 30 papers models/pure_transformer.py ran · our draft was wrong no licence file found · pointer only · a7b560d30ae66959 · report fixture: signature act:str/0/str · returned ReLU · level recorded 2026-09-22
expand_tensor models/pure_transformer.py ran; the contract check could not run (RAISES) fingerprinted no licence file found · pointer only · 84c9e795607ff8d1 · report fixture: signature tensor:Tensor/2/float, size:int/0/int, dim:int/0/int · returned Tensor · level recorded 2026-09-22
position_embedding in 8 papers models/pure_transformer.py ran; the contract check could not run (RAISES) fingerprinted no licence file found · pointer only · e344c95038ed76fd · report fixture: signature input:Tensor/1/float, d_model:int/0/int · returned Tensor · level recorded 2026-09-22
sinusoid_encoding_table models/pure_transformer.py ran · honoured contract fingerprinted no licence file found · pointer only · 35fbc756acf92321 · report fixture: signature max_len:int/0/int, d_model:int/0/int, padding_idx:int/0/int · returned Tensor · level recorded 2026-09-22
subsequent_mask in 38 papers models/pure_transformer.py ran · violated contract no licence file found · pointer only · d52f2d9e7e545563 · report fixture: signature size:int/0/int · returned Tensor · level recorded 2026-09-22
BasicLayer in 56 papers models/pure_transformer.py unverified no licence file found · pointer only · a383a407c29985a1 · report
BasicModel models/pure_transformer.py unverified no licence file found · pointer only · 5b2d8e2e4e7f8a89 · report
Decoder in 210 papers models/pure_transformer.py unverified no licence file found · pointer only · 08f74e27081d74e9 · report
Encoder in 278 papers models/pure_transformer.py unverified no licence file found · pointer only · 67c9f8c281deae2e · report
EncoderLayer in 73 papers models/pure_transformer.py unverified no licence file found · pointer only · 0fd3949590683cc4 · report
PureT models/pure_transformer.py unverified no licence file found · pointer only · cbce59c76431bd39 · report
SwinTransformerBlock in 35 papers models/pure_transformer.py unverified no licence file found · pointer only · 284c0f72a6c81f95 · report
jchenghu/expansionnet_v2 community (archive-listed) 18 samples, 9 ran (0 instrument-failed) · 9 unverified
DropPath in 75 papers
census: 17 implementations from 17 papers, 8 distinct outputs across 3 buckets, one shared input per bucket
models/End_ExpansionNet_v2.py ran fingerprinted MIT (permissive) · d14d5773d2c8e320 · report fixture: returned DropPath · level recorded 2026-09-22
EmbeddingLayer in 10 papers models/End_ExpansionNet_v2.py ran · metamorphic tier: deterministic MIT (permissive) · 8dc0059690e3667f · report fixture: returned EmbeddingLayer · level recorded 2026-09-22
EncoderLayer in 73 papers models/End_ExpansionNet_v2.py ran · metamorphic tier: deterministic MIT (permissive) · fafb495b474a7acd · report fixture: returned EncoderLayer · level recorded 2026-09-22
FeedForward in 198 papers models/End_ExpansionNet_v2.py ran · metamorphic tier: deterministic MIT (permissive) · 47ef05333de71076 · report fixture: returned FeedForward · level recorded 2026-09-22
MultiHeadAttention in 124 papers
census: 9 implementations from 7 papers, 9 distinct outputs across 3 buckets, one shared input per bucket
models/End_ExpansionNet_v2.py ran · metamorphic tier: deterministic MIT (permissive) · ac6767df3a332ab9 · report fixture: returned MultiHeadAttention · level recorded 2026-09-22
PatchEmbed in 123 papers
census: 9 implementations from 9 papers, 6 distinct outputs on one shared input
models/End_ExpansionNet_v2.py ran · metamorphic tier: deterministic MIT (permissive) · 4e15874ef9b1a7e7 · report fixture: returned PatchEmbed · level recorded 2026-09-22
StaticExpansionBlock models/End_ExpansionNet_v2.py ran MIT (permissive) · 44e7ad9330aa17b8 · report fixture: signature x:Tensor/3/float, n_indexes:Tensor/1/int, mask:Tensor/3/float · returned Tensor · level recorded 2026-09-24
WindowAttention in 50 papers models/End_ExpansionNet_v2.py ran · metamorphic tier: deterministic MIT (permissive) · 5fd5f10dcdb2c664 · report fixture: returned WindowAttention · level recorded 2026-09-22
to_2tuple in 25 papers models/End_ExpansionNet_v2.py ran · violated contract fingerprinted MIT (permissive) · 905129493d469a67 · report fixture: signature x:list/1/int · returned list · level recorded 2026-09-22
BasicLayer in 56 papers models/End_ExpansionNet_v2.py unverified MIT (permissive) · 57addd57b713784d · report
CaptioningModel models/End_ExpansionNet_v2.py unverified MIT (permissive) · 7e1f0615f9be6815 · report
DecoderLayer in 43 papers models/End_ExpansionNet_v2.py unverified MIT (permissive) · 3bafaef1eb838048 · report
DynamicExpansionBlock models/End_ExpansionNet_v2.py unverified MIT (permissive) · b525d13f285adc10 · report
End_ExpansionNet_v2 models/End_ExpansionNet_v2.py unverified MIT (permissive) · 9cf97124f3e0546a · report
SwinTransformer in 15 papers models/End_ExpansionNet_v2.py unverified MIT (permissive) · d4ca4e9d197b7459 · report
SwinTransformerBlock in 35 papers models/End_ExpansionNet_v2.py unverified MIT (permissive) · 2b3a7a150945b433 · report
create_no_peak_and_pad_mask models/End_ExpansionNet_v2.py unverified MIT (permissive) · f20981676e57f873 · report
create_pad_mask models/End_ExpansionNet_v2.py unverified MIT (permissive) · bb0dd55c83a9c845 · report

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it. Siblings are assemblies lifted from this paper in the same batch for the same method: alternative readings kept side by side; none replaces or supersedes another.

2 assemblies on this paper: 2 harvested, 0 generated, listed in 1 groups (siblings lifted in one batch form one group).

2 sibling assemblies for End-to-End Transformer Based Model (harvested), lifted in the same batch on 2026-09-09: alternative readings kept side by side; none replaces or supersedes another.

harvested Assembly for End-to-End Transformer Based Model (graph method: End-to-End Transformer Based Model). 24 bricks; individually on a fixture: 15 ran (of which 9 constructed an object rather than computing a result; 11 with no instrument failure: 0 honoured, 1 violated, 10 with no contract checked; 4 where Syntology's instrument failed) · 9 unverified. The assembly has not been run end-to-end.

one of 2 siblings

  1. End_ExpansionNet_v2 entry · level 0 · unverified · 9cf97124f3e0546a
  2. CaptioningModel helper · level 0 · unverified · 7e1f0615f9be6815
  3. DecoderLayer helper · level 0 · unverified · 3bafaef1eb838048
  4. EmbeddingLayer helper · level 1 · ran · 8dc0059690e3667f
  5. EncoderLayer helper · level 1 · ran · fafb495b474a7acd
  6. SwinTransformer model · level 0 · unverified · d4ca4e9d197b7459
  7. create_no_peak_and_pad_mask helper · level 0 · unverified · f20981676e57f873
  8. create_pad_mask helper · level 0 · unverified · bb0dd55c83a9c845
  9. DynamicExpansionBlock helper · level 0 · unverified · b525d13f285adc10
  10. FeedForward helper · level 1 · ran · 47ef05333de71076
  11. MultiHeadAttention helper · level 1 · ran · ac6767df3a332ab9
  12. StaticExpansionBlock helper · level 1 · ran · 44e7ad9330aa17b8
  13. BasicLayer helper · level 0 · unverified · 57addd57b713784d
  14. PatchEmbed model · level 1 · ran · 4e15874ef9b1a7e7
  15. PatchMerging model · level 1 · ran · 3056cb457a463605
  16. trunc_normal_ helper · level 1 · ran; the contract check could not run · c76d18678f19d332
  17. SwinTransformerBlock helper · level 0 · unverified · 2b3a7a150945b433
  18. to_2tuple helper · level 1 · ran · violated contract · 905129493d469a67
  19. _no_grad_trunc_normal_ helper · level 1 · ran; the contract check could not run · fa2dd3be10cf9804
  20. DropPath helper · level 1 · ran · d14d5773d2c8e320
  21. Mlp model · level 1 · ran · a1715055832f71fd
  22. WindowAttention model · level 1 · ran · 5fd5f10dcdb2c664
  23. window_partition helper · level 2 · ran; the contract check could not run · 144d10b49baeb8a6
  24. window_reverse helper · level 1 · ran · our draft was wrong · 61bf152e6a42a184

harvested Assembly for End-to-End Transformer Based Model (graph method: End-to-End Transformer Based Model). 21 bricks; individually on a fixture: 14 ran (of which 6 constructed an object rather than computing a result; 9 with no instrument failure: 1 honoured, 1 violated, 7 with no contract checked; 5 where Syntology's instrument failed) · 7 unverified. The assembly has not been run end-to-end.

one of 2 siblings

  1. PureT entry · level 0 · unverified · cbce59c76431bd39
  2. BasicModel helper · level 0 · unverified · 5b2d8e2e4e7f8a89
  3. Decoder model · level 0 · unverified · 08f74e27081d74e9
  4. Encoder model · level 0 · unverified · 67c9f8c281deae2e
  5. activation helper · level 1 · ran · our draft was wrong · a7b560d30ae66959
  6. expand_tensor helper · level 1 · ran; the contract check could not run (RAISES) · 84c9e795607ff8d1
  7. subsequent_mask helper · level 1 · ran · violated contract · d52f2d9e7e545563
  8. DecoderLayer helper · level 1 · ran · 1ba18af6ffb51016
  9. sinusoid_encoding_table helper · level 1 · ran · honoured contract · 35fbc756acf92321
  10. EncoderLayer helper · level 0 · unverified · 0fd3949590683cc4
  11. FeedForward model · level 1 · ran · 2b5d0b9e88a90691
  12. MultiHeadSelfAttention model · level 1 · ran · 1b4e47ec99e1e927
  13. position_embedding helper · level 1 · ran; the contract check could not run (RAISES) · e344c95038ed76fd
  14. WindowAttention model · level 1 · ran · f9d5ef7b9fad38f8
  15. window_partition helper · level 2 · ran; the contract check could not run · 144d10b49baeb8a6
  16. window_reverse helper · level 1 · ran · our draft was wrong · 61bf152e6a42a184
  17. BasicLayer helper · level 0 · unverified · a383a407c29985a1
  18. Mlp helper · level 1 · ran · a1715055832f71fd
  19. PatchEmbed helper · level 1 · ran · a589ea44edeb86e7
  20. PatchMerging helper · level 1 · ran · 3056cb457a463605
  21. SwinTransformerBlock helper · level 0 · unverified · 284c0f72a6c81f95

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2203.15350") returns these assemblies with each brick's role and wiring (how to connect).

Tasks

DecoderImage Captioning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEConvolutionDense ConnectionsDropoutFaster R-CNNLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerRPNResidual ConnectionRoIPoolSoftmaxTransformer

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