CvT: Introducing Convolutions to Vision Transformers
Paper · 2021 · Haiping Wu, Bin Xiao, Noel Codella et al.
Summary
A photograph can contain clues at several scales. Neighboring pixels may trace the edge of an object, while features at opposite ends of the image may help identify the same scene. The Vision Transformer, or ViT, can compare distant regions directly through attention. Its first operation, however, divides the image into disjoint patches, so pixels that are close together can enter the system through separate representations. The CvT paper asks how a vision Transformer can take advantage of these local relationships from the beginning while retaining the ability to compare regions across the image. The question is especially important when the training collection is smaller than those on which ViT first demonstrated its strongest results. Transformer and attention
CvT uses convolution in two places. At the start of each stage, a filter moves across the image or a grid of features. Its windows overlap, allowing adjacent output tokens to reflect some of the same input. A token is a vector of features associated with a location. As the stages progress, the grid gets coarser and each token carries more feature channels. Within a stage, each attention block uses convolution to prepare queries, keys, and values. A query determines what evidence a position seeks, a key helps establish whether an evidence source is relevant, and a value provides the content available from that source. In the default design, queries cover the stage’s spatial grid and read from coarser key and value grids.
On ImageNet-1k validation, CvT-13 achieves 81.6% top-1 accuracy and CvT-21 achieves 82.5%. Top-1 accuracy measures how often the classifier’s highest-ranked category agrees with the reference label. For CvT-21, the authors report an accuracy advantage of 0.5% over DeiT-B with 63% fewer parameters and 60% fewer floating-point operations. With pretraining on ImageNet-22k and fine-tuning on ImageNet-1k, the wider CvT-W24 reaches 87.7% top-1 accuracy on the ImageNet-1k validation set. It also leads the reported comparisons on each of the downstream classification tasks tested. Fine-tuning
The authors find that CvT can omit the learned vectors that ViT uses to identify patch positions. Removing these vectors preserves CvT’s classification performance in the reported comparison. The same change lowers DeiT-S’s ImageNet top-1 accuracy by 1.8%. CvT still uses spatial layout whenever a convolution reads a neighborhood on the grid. Omitting the separate position vectors lets the architecture accommodate a different grid without having to adapt a table tied to the original one. The paper tests the resulting design through image classification and shows how it can be trained at one input resolution and adapted at another.
Deep dive: CvT: Introducing Convolutions to Vision Transformers
CvT uses convolution to build image tokens and prepare them for attention, improving ImageNet classification while reducing computation. · about 69 minutes to read
The problem and its context
What a patch tells a Transformer
Image classification turns a field of visual evidence into a category. A small part of an image may contain a strong clue, such as a texture or a characteristic outline. Its meaning can depend on what appears elsewhere. An edge may belong to the object that determines the category, to a different object, or to something in the background. The usefulness of the edge depends in part on which other features go with it. Early vision Transformers offered a direct way to relate those features across a scene. Their attention layers could compare the representations of distant image regions, with the strength of each connection depending on what the regions contained.
ViT adapts the Transformer to images by creating a sequence. It divides an image into non-overlapping patches, described in the paper as 16 × 16 pixels, and represents each patch as a token. Think of the token as a list of feature values summarizing what was found in that portion of the image. The sequence gives the Transformer the kind of input its blocks expect. A learned position vector is added to each patch representation so the later operations can use information about where the patch came from. That position is coarse in the sense that it identifies a region of the patch grid.
Dividing the image into disjoint patches decides which visual details can be considered together when the tokens are first formed. Imagine a contour running from one patch into its neighbor. The token on either side can describe its own segment of the contour. The continuity between those segments has to be represented later, using the already formed tokens. If the same contour falls wholly inside a patch, its parts can contribute together to the original representation. The partition therefore affects which relationships are directly visible at the embedding step, even when the two contours look similar in the image.
Once the sequence has been formed, ViT uses repeated Transformer blocks. The self-attention part of a block brings information together across tokens. A position can attend to another because their current features make that connection useful. The feed-forward part of the block applies a learned transformation separately at each position. It processes the representation after the exchange of information. Repeating these operations gives the architecture a succession of opportunities to reinterpret the patches in light of one another before making a prediction about the entire image.
A patch position vector and the patch’s visual representation carry different kinds of evidence. The first supplies a cue associated with a place on the grid. The second describes the contents of a region. If the classifier benefits from recognizing how a texture continues into the region below, its later operations have to make use of both the contents and the spatial arrangement of the relevant tokens. A neighborhood filter offers another way to express that relationship. It receives the lower region at a particular offset in its input window and can use that offset directly in forming a feature. The filter supplies a recurring spatial operation wherever the same arrangement appears.
The paper describes original ViT as an important demonstration that a Transformer could serve as the main architecture for image classification. Its account emphasizes the scale of the training data in that demonstration, including ImageNet-22k and JFT-300M. With smaller training collections, the authors describe an accuracy gap between vision Transformers and convolutional networks of comparable size. They point to ResNets as an example of the latter. This sets up the practical question behind CvT. A visual architecture that receives fewer training examples may benefit from having common spatial relationships built into more of its computations.
That explanation is a hypothesis about what the design makes easy to learn. A system can in principle learn from the image examples that neighboring features are often related. A system with spatial filters already has a way to consider the same kind of relationship in each neighborhood it visits. The samples then help it learn which arrangements matter for recognition. The distinction is between learning the useful patterns and having a consistent operation with which to look for them. CvT explores whether the simple act of giving the Transformer more of that structure improves the resulting classifier.
Why the authors start from neighborhoods
Convolutional networks make locality part of their computation. A filter examines a window of input values around an output position. This window is its local receptive field, the set of positions that can directly contribute to the feature it is forming. The filter uses shared weights, meaning that it performs the same learned operation at different locations. The different positions inside the window can have different weights. Thus the operation can learn a preference for a particular arrangement and look for it throughout the grid.
This is an inductive bias, an assumption built into the architecture about the kinds of structure that will be useful. Here the assumption is that recurring arrangements of neighboring inputs are informative. An edge, for example, involves a change across nearby locations, and a texture involves patterns within a region. The architecture does not prescribe which edge or texture matters. It supplies an operation that can learn such distinctions and reuse them. Sharing the operation also means the classifier can use evidence from one region to learn a filter that will be applied in another.
A feature grid records where the filter found a pattern. A response at one location can then become part of the input to a filter at the next layer. At a later stage, a neighborhood can contain features for several parts of a shape, each of which was formed from lower-level evidence. This is the hierarchy the authors associate with convolutional networks. The progression from simple detail to larger patterns depends on the operations building on one another. A later window can cover a broader portion of the original image because the features within it already summarize earlier neighborhoods.
Sub-sampling changes the spacing of the positions at which that information is stored. A finer grid offers more places to keep localized features. A coarser grid has fewer locations, with each one representing evidence over a broader area. A network can expand the number of channels, or feature components per location, as the grid becomes coarser. Spatial resolution and channel width serve different purposes. A large number of positions allows finer distinctions about where evidence occurs. More channels allow a more detailed description of the evidence stored at a given position. CvT uses these controls together as the representation changes from stage to stage.
The authors associate local filtering, weight sharing, and spatial sub-sampling with some tolerance to shifts, changes of scale, and distortion. A filter can respond to a recurring arrangement at multiple places because it uses the same weights there. A hierarchy gives patterns with different spatial footprints opportunities to influence different levels of the representation. These properties motivate the design. They explain why the authors expect a classifier to benefit from convolution even when attention already allows information to travel across the image.
Attention allocates its weights using the features of the current input. When a token looks for related evidence, a remote position can contribute strongly if the comparison supports it. Another image can yield a different connection between those positions. A convolution uses the same learned set of weights over its window each time it is applied. Its output varies with the features in the window. The choice of which offsets are available to that operation is part of the architecture. These are complementary ways of using visual structure. One gives consistent access to an immediate region, and the other allows connections to depend on the evidence across the scene.
Consider an image in which the ends of a long shape are visible and the middle is visually ambiguous. Local filters can help form a representation of the structure around either end. A later attention operation can use that evidence to decide whether the two ends should contribute to each other. If the local representations contain only an incomplete description of each end, the comparison has less evidence to work with. If processing stops at the local window, the ends may remain separate when their relationship is important. CvT places convolution where it can change the representations presented to attention while allowing attention to compare them across locations.
How earlier designs treated spatial information
The paper places CvT among several attempts to improve vision Transformers after the introduction of ViT. DeiT explores how to train a visual Transformer with greater data efficiency, including through distillation. Distillation supplies guidance from a teacher during training. That approach addresses a related problem through the training procedure. It matters to the CvT comparison because the initial gap with convolutional networks gives a reason to examine both architecture and training. A strong patch-based reference uses the practices developed to improve this kind of classifier under the smaller-data conditions.
The Conditional Position encodings Visual Transformer, or CPVT, addresses the handling of position. A learned set of vectors associated with a training grid raises a practical question when the image changes size. Some positions in the new grid may lack a direct counterpart in the old one. Interpolation, in this setting, means adapting the positional representation from the old grid to the new positions. The paper describes CPVT as generating position information conditionally, which lets it process different image sizes without that interpolation. Its intervention concerns the way a separate spatial signal is supplied to the Transformer.
Transformer-iN-Transformer, or TNT, gives a finer visual scale its own attention computation. An inner Transformer processes pixel embeddings. An outer Transformer processes patch embeddings. The inner operation gives the system a way to represent relationships among features at the finer level, while the outer operation can relate representations at the patch level. In the authors’ account, this design addresses the gap between the detail of the original image and the coarser units that a conventional ViT takes into its attention stack.
Tokens-to-Token ViT, or T2T, changes the construction of the token sequence. Neighboring tokens are collected within a sliding window and concatenated, meaning their feature components are placed together in a longer representation. This is repeated to build tokens progressively. The authors distinguish those steps from the Transformer backbone that follows, where the sequence length is fixed. They also identify the cost of concatenating several tokens. Their description connects that cost with the use of a comparatively narrow design in the later Transformer. CvT can choose the output feature width directly through the number of filters in a convolutional embedding.
Pyramid Vision Transformer, or PVT, builds several spatial scales into the Transformer backbone. The motivating applications include dense prediction, in which outputs are associated with positions in the image. A single coarse feature grid gives such a system a limited choice of spatial representations. Keeping a fine grid throughout the backbone makes attention more expensive. A pyramid provides several resolutions and allows operations to run on a reduced set of spatial positions where appropriate. CvT shares the use of a hierarchy and uses learned strided convolutions when forming lower-resolution features. A location on its coarser grid can therefore include evidence from the window around the sampled position.
The interest in dense outputs grew alongside the use of attention in other areas of vision. The CvT paper cites work on image generation, enhancement, video processing, and segmentation. It also discusses object detection, where the task includes locating objects. An image classifier can use a representation that collects enough evidence for a category, while a detector has to provide information about where an object was found. This helps explain why the number of scales available from a backbone and its ability to work with different image sizes were already significant design concerns. End-to-End Object Detection with Transformers
Where convolution and attention had met before
Prior work also approached the combination from the side of convolutional networks. The paper describes non-local networks as using global attention to connect distant features. Local relation networks use adaptive weights within a local region. In that case, the features in the window influence how evidence is combined, giving the aggregation a dependence on the input. BoTNet makes another placement choice. It puts global self-attention into the final bottleneck blocks of a ResNet by replacing spatial convolutions there. These studies illustrate how the behavior of a convolutional backbone can change when some of its computations can form input-dependent relationships.
In language and speech research, the authors identify work putting convolutions into Transformer architectures. Convolution had been used to take over the work of attention, to provide a parallel path, or to add another computation in sequence with the existing block. The paper also cites work in which convolutions transform attention maps before the maps are passed to later layers. The location of the convolution gives it a particular responsibility in each design. For example, an operation on an attention map receives comparisons after they have been made. A convolution used to generate queries and keys changes the representations on which those comparisons are based. Pay Less Attention with Lightweight and Dynamic Convolutions
The research question for CvT is consequently one of placement and scale. The authors want each new stage to start with tokens that already reflect their neighborhoods. They also want individual attention blocks to consult the current spatial context before comparing those tokens. A spatial hierarchy can limit the number of positions carried into later stages, and the projections can control how much evidence is presented to each query. Understanding the architecture requires following those choices separately, since the grid used by an entire stage and the grids that an attention operation reads have different functions.
The method, step by step
From the image grid to a prediction
CvT has three stages. Each stage starts with a spatial operation that creates the tokens for that part of the network. At the first stage, the input is the image, with values arranged by height, width, and channel. At a later stage, the input is a grid of features assembled from the preceding stage’s output. A convolution runs over the grid and produces a feature vector at each of its output locations. The resulting map is flattened into a sequence so that the tokens can enter a stack of Transformer blocks.
The convolution at a stage entrance is called the convolutional token embedding. Its job is to decide what evidence enters the stage and at what spatial scale. Moving a learned window across the input lets the embedding use features from nearby positions. The windows overlap, so an input feature near the boundary of one output region can also contribute to another. The embedding normalizes the resulting vectors before they reach the first block. Later embeddings produce coarser grids and more channels per spatial token, carrying the representation toward larger visual patterns.
Inside a stage, each block prepares attention inputs using a second kind of convolution. This is called convolutional projection. The block restores the spatial tokens to their grid and forms query, key, and value representations from their neighborhoods. It then returns the results to sequence form for attention. A query can draw on the keys and values distributed across the grid for that branch, so the comparison can still connect distant regions. The feed-forward part transforms the resulting features at each position. Repetition allows a local projection to work on features that already incorporate information passed by the preceding attention computation.
In the last stage, CvT adds a classification token. This is a separate vector that can gather evidence for the category of the entire image through the final stage’s blocks. The earlier stages are devoted to features at spatial locations. After the last block, the classification token’s representation goes to a multilayer perceptron, or MLP. This fully connected prediction head transforms the representation into scores for the image classes. The classifier’s first choice is the category with the highest score.
How CvT turns an image into a class prediction
The steps in order.
The flattening and reshaping operations keep a correspondence between a sequence entry and its location on the grid. They change how the features are laid out for the next operation. A convolution needs the height, width, and ordering so it can find neighbors along either spatial axis. Attention consumes a sequence of vectors. When features from a block are reshaped again, they occupy the locations associated with the block’s queries. Their contents can include information from other locations because attention has operated in the meantime.
This sequence of operations gives CvT two ways to control how many positions are used. The stage entrance sets the size of the spatial representation that the stage will work on. A block can then use fewer projected locations as evidence for attention, while still providing an updated vector at each query location. The first choice changes the number of spatial tokens available for all the blocks in the stage. The second choice changes what each query reads inside the attention computation. Keeping these two grid changes distinct makes both the method and its cost accounting easier to follow.
How the embedding chooses its windows
A convolution has a kernel, the window of weights through which it examines the input. The stride gives the distance from one window position to the next. A stride smaller than the kernel gives successive windows some input locations in common. Padding extends the grid at the boundaries for the purpose of placing the window. These settings determine which locations can be read together and how many output locations are formed. The number of channels in the output depends on the choice of filters and can be set separately from those spatial dimensions.
Think of the kernel encountering a region where a thin line continues across the boundary that would separate two disjoint patches. With overlapping windows, a single output vector can depend on features from both sides of that boundary. A nearby window may also see some of the line, with its input locations appearing at other offsets in the kernel. Overlap gives neighboring tokens evidence in common while allowing them to respond to different arrangements around their centers. The output is a grid of learned features produced at the chosen spacing.
The paper expresses the input to a stage as a real-valued array.
xᵢ₋₁ ∈ ℝ^(Hᵢ₋₁ × Wᵢ₋₁ × Cᵢ₋₁)
The index i identifies the stage, and i−1 identifies the preceding grid in this notation. The array xᵢ₋₁ contains the image at the first stage or the preceding stage’s features at a later entrance. The membership sign ∈ indicates that its entries are drawn from the real-valued array space denoted by ℝ with the indicated shape. The caret ^ introduces this shape, and the × signs separate its axes. Hᵢ₋₁ gives its height, Wᵢ₋₁ gives its width, and Cᵢ₋₁ gives the channel count at each location.
The output is described in the same terms, with the dimensions chosen for the new stage.
f(xᵢ₋₁) ∈ ℝ^(Hᵢ × Wᵢ × Cᵢ)
The function f is the learned convolution. The parentheses indicate that it takes xᵢ₋₁, the input array, as its argument. On the right, ∈ places the result in a real-valued space ℝ with the dimensions following ^. The × signs delimit the height Hᵢ, the width Wᵢ, and the channel count Cᵢ for stage i. The convolution uses a square kernel of size s × s, with s giving the extent of the window on either spatial axis. The stride is s−o, where o specifies how far the next window overlaps the previous one along the direction of travel. The padding is p on each side.
The height counts how many successive placements of the window are possible on the padded grid.
Hᵢ = ⌊(Hᵢ₋₁ + 2p − s) / (s − o) + 1⌋
Hᵢ on the left of the equals sign is the output height at stage i. Hᵢ₋₁ is the input height. Adding 2p gives the height with padding p at both ends, and subtracting s, the kernel size, accounts for the space used by the first window. The slash / divides the remaining travel by the stride s−o, where o is the overlap term. The + 1 includes the first window. The floor marks ⌊ ⌋ keep the whole-number count, since the window only advances in complete stride intervals. The inner parentheses group the available travel and the stride, respectively.
The width is obtained by counting placements in the horizontal direction.
Wᵢ = ⌊(Wᵢ₋₁ + 2p − s) / (s − o) + 1⌋
Here Wᵢ denotes the width of the new grid, and Wᵢ₋₁ denotes the input width. The equals sign assigns the count to Wᵢ. 2p adds the padding p from both sides. Subtracting the kernel extent s gives the distance left for moving the window after its initial placement. The division / uses the stride s−o, with overlap o. The grouped expressions identify the distance and step length used in that division. The + 1 counts the starting location, and the brackets ⌊ ⌋ round the count down to a whole number. Height and width can differ, since each formula starts from the corresponding input dimension.
CvT flattens the output to the following token array shape.
HᵢWᵢ × Cᵢ
Hᵢ and Wᵢ are the grid dimensions at stage i. Writing them together indicates their product, the total number of spatial locations and thus the number of tokens at this point. The × separates this length from the feature axis of size Cᵢ, the number of channels in each vector. The next operation is layer normalization. It standardizes features in the token representation before the block stack processes them. The token array still has the same spatial correspondence after normalization. Layer Normalization
The shape rules make it possible to decrease the sequence length while increasing the width of each token. The height and width formulas depend on the input grid, the window, and how the window is moved and padded. They have no term for the output channel count. Increasing that count changes the representation at each output location. CvT uses this independence to get progressively coarser spatial grids with wider feature vectors. The intervening Transformer blocks help determine what those vectors can convey to the next embedding.
The term local refers here to which entries the window consults directly. By the time a later embedding is applied, those entries can already contain information from widely separated regions of the original image. A spatial neighborhood in a later feature map can therefore combine several representations whose contents extend beyond that neighborhood. A window may be local in its access to the current grid and broad in the visual evidence that reaches it. The architecture can make repeated use of spatial arrangement even after attention has enriched the individual vectors.
Preparing queries, keys, and values
Self-attention updates a token by letting it read from a collection of other feature vectors derived from the same input sequence. To do this, it uses a query for the position making the read and keys for the positions available to it. Each comparison contributes to the weight that a value will receive. The value is the content transported through that connection. It may carry different feature components from the key because matching a source and using information from it are different jobs. In multi-head self-attention, this process runs in several feature spaces, giving the block more than one way to compare and combine what it sees.
In a conventional ViT block, each of the three projections applies a learned linear transformation at a position to the vector already there. The same transformation is used across locations for a given branch. A query can consequently reflect any neighborhood information the token obtained in earlier computations. At the projection step itself, the only vector used is the one at that location. CvT changes this step so that information from neighboring places on the current grid can participate in forming the projection.
The new operation can affect both sides of an attention match. Suppose two spatial tokens carry similar responses to an edge. Around the first token, nearby features might indicate a continuous boundary. Around the second, the adjacent responses might indicate a repeated texture. Looking at the neighboring tokens gives the query and key projections a way to make these situations distinguishable. The value projection can also combine features that help describe the evidence available around its location. This is the kind of ambiguity that the authors expect local context to reduce.
Each branch has its own projection. The operation begins by reconstructing the spatial grid from the token sequence. A convolution produces new features at the projected locations, and flattening allows the output to be used by attention. The paper gives a shared expression for any of the branches.
xᵢ[q/k/v] = Flatten(Conv2d(Reshape2D(xᵢ), s))
xᵢ is the sequence before projection, and i here identifies the layer. The notation [q/k/v] uses slashes to indicate a choice between the query, key, and value branches. xᵢ[q/k/v] is the sequence for the selected branch. The equals sign identifies the expression that produces it. Reshape2D restores the spatial arrangement, Conv2d is the depth-wise separable convolution, and s specifies the kernel size. Flatten converts the projected grid back to a sequence of vectors. Commas separate the convolution’s input and kernel size, and the nested parentheses indicate that the operations begin with the reshape and end with flattening.
The convolution is depth-wise separable because it breaks spatial filtering and the mixing of channels into distinct steps. The depth-wise part uses a spatial window on each channel independently. A feature can thereby reflect a pattern among nearby locations within that channel. Batch normalization then normalizes the intermediate channel responses. Finally, a point-wise convolution combines the channels at each output location. The feature presented to attention can incorporate both the evidence filtered from the neighborhood and the combination of channels needed by that branch.
A 1 × 1 kernel illustrates how this relates to the original position-wise projection. Such a kernel has only the current location inside its window. Mixing channels at that location performs the kind of feature transformation used by a linear projection. With a larger spatial kernel, neighboring locations can affect the result. The authors use this relationship to describe their projection as a generalization of the original operation. The spatial procedure concerns tokens that can be laid out as rows and columns. The classification token, introduced in the last stage, is a separate representation for the image as a whole.
Convolutional projection affects what attention compares. It does not restrict the reach of the subsequent comparison to the window used in the projection. The window supplies related features to each particular query, key, or value. Once these projections are built, the query can compare itself with keys across the available key grid. A query derived in part from a nearby contour can still match a key at the far side of the image. The convolution establishes the context for interpreting the local feature, and the attention weights determine which projected evidence contributes to the update.
Separating the two costs of attention
The authors consider the cost of constructing the projections separately from the cost of using them. A conventional spatial convolution can be expensive because it learns a set of connections between channels for each position in its kernel. The following is the parameter count used in the paper’s comparison for a full convolution with the same input and output channel width.
s²C²
The symbol s is the side length of the square kernel, so s² counts the positions in its window. C is the number of channels in a token vector. Squaring C counts the pairings between input and output channels. The two squared quantities are multiplied, as indicated by their juxtaposition. This counts the weights needed to connect every channel pair at each position of the kernel in the paper’s cost argument.
The paper uses the following order of growth for the arithmetic performed by that convolution.
𝒪(s²C²T)
The 𝒪 notation describes how the number of floating-point operations grows with the combined quantities in parentheses. s² counts the spatial positions in a kernel of side s, and C² counts pairs for channel width C. T gives the token count over which the convolution operates. The multiplication combines the work per position with the number of positions at which it is performed.
In CvT’s projection, the point-wise operation already supplies the channel mixing associated with the original position-wise linear projection. The additional spatial weights in the paper’s comparison have the following count.
s²C
s² is the area of the kernel with side length s. C gives the number of channels receiving their own spatial filters. The product counts one set of spatial weights per channel. A single channel’s filter has no need for separate spatial weights for each of the possible output channels, since channel mixing takes place in the point-wise operation. The count represents the extra spatial parameters relative to the position-wise projection in the authors’ comparison.
The additional arithmetic is described by the corresponding growth term.
𝒪(s²CT)
The operator 𝒪 gives the growth of the floating-point work attributed to the spatial step. Inside its parentheses, s² counts the weights in a square spatial filter of side s. One such filter is applied for each of the C feature channels at the locations represented by T. The product therefore describes the added spatial computation across the token grid. It is an overhead relative to the original linear projection in the paper’s accounting. The later attention operation has its own cost.
CvT reduces that later cost by letting queries read from a more sparsely sampled grid. In the default configuration, the convolution for queries uses stride 1. The spatial query resolution is maintained. The key and value convolutions use stride 2, so their windows are placed at greater intervals along both dimensions of the grid. Keys and values use corresponding locations because the comparison with a key determines how much of its associated value is used.
Though there are fewer key and value locations, every spatial query retains access to the whole set of projected evidence. The information gathered at a given query can then be written back at that query’s location. This lets the block reduce its attention work while maintaining the organization of the sequence that later blocks expect. The coarse projection does not determine which query locations will be updated. It determines where the evidence for those updates can be read.
The authors describe a 4-fold reduction in key and value token counts under the default stride choice, and a 4-fold reduction in work for the associated attention computation. That analysis is about the part of the block affected by the length of the key and value sequences. The query projection and the feed-forward transformation still operate over the query positions. There are also costs at the stage entrances and at the classification head. The change in total arithmetic for the classifier is measured separately from the reduction described for attention.
The retained keys and values come from learned windows. A feature located between sampling centers can still contribute if it falls inside a window. The output then represents some of the evidence from that neighborhood at the selected location. The authors expect nearby patches frequently to contain related information, making the smaller collection of keys and values a reasonable representation for classification. The cost trade comes from giving up some locations as individually accessible evidence. A query can use the features gathered into the retained value at a location, with one attention weight for that value.
The stage embedding and the projection use stride for different purposes. At an embedding, stride controls the size of the feature grid entering a stack of blocks. The network must work with that grid until the next stage entrance. For keys and values, stride controls the number of sources consulted within an attention operation. The query grid remains available to the feed-forward transformation and the following block. These different responsibilities also permit the authors to search for different key and value strides within a single stage layout.
Using spatial order without a table of positions
At the points where CvT applies a convolution, a feature’s relation to other locations follows from how the features are placed on the grid. A filter can weight the input above its center differently from the input beside it. A stage embedding uses this structure before the first attention computation at that scale. The projection brings the arrangement into the construction of queries, keys, and values throughout the stage. The authors therefore design CvT without adding a learned position vector to each spatial token.
A position vector associated with a fixed grid identifies a location in that grid. CvT’s convolutions use the arrangement of the inputs within each window. When the height or width changes, the embedding rules give the new dimensions and the filters can be applied at the resulting locations. The attention sequences can grow or shrink with those grids. The arrangement avoids having to find corresponding entries in a table of vectors learned for the positions at a particular training resolution.
The classification experiments test whether the separate position signal improves the accuracy of a design that already uses spatial order in this way. There are two parts to the reasoning. The architectural argument explains how spatial relationships can affect the representation without the added vectors. The comparison measures whether the classifier benefits from including those vectors anyway. An ability to process different grid sizes comes from the shared operations and the way the sequence is formed. Accuracy at the chosen size is evaluated on the trained classifier.
Choosing capacity and training the classifier
The family uses the same three-stage organization with different numbers of Transformer blocks and different feature widths. CvT-13 and CvT-21 encode the total block count in their names. The reported counts of learned parameters are 19.98M and 31.54M, respectively. CvT-W24 is the wide configuration. It increases the width of the token representation at each stage and has 298.3M parameters. The authors use it to see how the same architectural operations perform when given more capacity and larger-scale pretraining.
The architecture description tracks several settings that affect capacity. In the paper’s architecture notation, Hᵢ denotes the number of heads in attention module i, and Dᵢ denotes the feature dimension in that module. This use of Hᵢ belongs to the architecture description, where the quantity is a head count. In the embedding shape it denotes grid height. The notation Rᵢ gives the expansion ratio for MLP layer i. The ratio controls the width of the intermediate features used in the feed-forward part of a block. It can be varied while keeping the spatial grid and query stride fixed.
The training setup uses AdamW to update the network weights. Weight decay is set to 0.05 for CvT-13 and 0.1 for CvT-21 and CvT-W24. This is a regularization setting applied during optimization. The initial learning rate is 0.02. It controls the scale of the optimizer’s updates and follows a cosine decay schedule over training. The total batch size is 2048 images per update, and the training runs for 300 epochs. An epoch describes a pass through the training data.
The authors follow the augmentation and regularization procedure of the earlier vision Transformer training work they cite. Augmentation changes the examples presented during training. Regularization is used to shape what is learned from those examples. The default ImageNet training size is 224 × 224. The input dimensions affect how many windows the first embedding can place and how many spatial locations the later stages receive. Consequently, the image size matters to the computation as well as to the visual detail available in the input.
For the larger-data experiments the authors pretrain on ImageNet-22k, then fine-tune on the target dataset. Pretraining forms the initial visual representations from the larger collection. Fine-tuning updates those representations on the target task. The paper describes a transition from 224 × 224 pretraining inputs to 384 × 384 fine-tuning inputs. At the larger size the stage embeddings produce grids from the new input dimensions, and the authors adapt the weights to this setting during fine-tuning.
The optimizer for fine-tuning is stochastic gradient descent, or SGD, with momentum of 0.9. Momentum carries a contribution from earlier updates into the ongoing direction of the optimization. The total batch size is 512. The ImageNet-1k target is fine-tuned for 20,000 steps. CIFAR-10 and CIFAR-100 each use 10,000 steps. Oxford-IIIT Pets and Oxford-IIIT Flowers-102 each use 500 steps. A step is an optimizer update, so each budget identifies the number of updates made on the particular target. The authors identify the CvT repository on GitHub as the planned location for their code release.
Experiments and results
What the evaluations measure
The principal benchmark is ImageNet-1k. The paper describes the dataset as comprising 1.3M images and 1k classes. Its larger superset, ImageNet-22k, contains 14M images spanning 22k classes. In the compact experiments, ImageNet-1k is the training and evaluation benchmark. In the experiments with larger-scale pretraining, ImageNet-22k supplies the initial training data and ImageNet-1k is a target for adaptation. These regimes answer different questions about the same basic architecture. The compact experiments ask how CvT fares with training confined to ImageNet-1k. The larger regime asks how well the design works when it can first learn from an expanded collection.
The main performance measure is top-1 accuracy on the evaluation images. The classifier gives a score to each class, and its highest-scoring class is compared with the label. The resulting accuracy describes the fraction of examples classified correctly by that decision rule. The authors’ ImageNet comparison also includes ImageNet Real and the matched-frequency set from ImageNet V2. The named headline results below refer to the ImageNet-1k validation comparison. The larger transfer experiment follows the same top-1 criterion for each target classification task, using the labels of that task.
The efficiency comparisons report parameters and floating-point operations, abbreviated FLOPs. Parameters measure the amount of learned state. FLOPs measure arithmetic performed for the stated configuration. The two can change for different reasons. For example, changing a projection’s sampling interval can change how many times its weights are applied and how many comparisons follow, without requiring a new kernel width. The combination of results shows the arithmetic and parameter budgets of the configurations that achieve the reported accuracies.
The baselines span different answers to the problem of visual representation. DeiT brings a data-efficient training approach to a patch-based vision Transformer. PVT, T2T, and TNT address related questions about spatial scale or local structure. ResNet represents the convolutional classifier family against which the authors describe the gap that motivated CvT. With larger-scale pretraining, ViT provides the Transformer comparison and Big Transfer, or BiT, supplies convolutional references. The comparisons concern these complete systems, including the dimensions and training procedures associated with the reported outcomes.
The compact configurations on ImageNet-1k
CvT-21 obtains 82.5% top-1 accuracy on ImageNet-1k validation. The authors report that this is 0.5% higher in top-1 accuracy than DeiT-B, with reductions of 63% in learned parameters and 60% in FLOPs. This comparison brings together the two objectives of the design. The CvT configuration assigns the correct class the highest score on more validation examples and uses smaller budgets by both measures. The savings are for the whole compared configurations. Convolutional projections affect a part of that budget, and the number and size of features passed through successive stages also influence it.
The smaller CvT-13 achieves 81.6% top-1 accuracy on ImageNet-1k validation. The reported advantage is 1.7% over PVT-Small and 0.8% over T2T-ViTₜ-14. The corresponding margin over TNT-S is 0.2%. The authors compare CvT-13 with these systems at a lower parameter count. Each baseline already introduces a mechanism for a problem that CvT takes up. PVT uses a pyramid, T2T brings neighboring tokens together during token formation, and TNT adds processing at the pixel level. These comparisons establish the performance of CvT-13 among those tested approaches to visual structure.
In the comparison with convolutional networks, the paper describes CvT-13 as using 20M parameters and 4.5G FLOPs. The setup gives the parameter count more precisely as 19.98M. CvT-13 is reported to exceed ResNet-152 by 3.2% in ImageNet top-1 accuracy. This places the result in the setting that motivates the architecture. An attention-based classifier with local spatial operations and a hierarchy can compare favorably with a convolutional classifier on the smaller ImageNet training regime.
The compact comparisons matter because they test CvT under the data condition that prompted the paper’s design. The authors can assess the architecture using ImageNet-1k training and validation without the larger pretraining run. A difference against another complete classifier describes its benchmark standing in that regime. The separate effects of using a convolution for the token embedding or the attention projection require experiments that change those operations within a more closely matched setting. The accuracy here is the result of putting the components and the specified training procedure together.
Adjusting the amount of work by stage
The authors also run a neural architecture search, or NAS, directly on ImageNet-1k. The variables are the stride for key and value projections and the feed-forward MLP expansion ratio. The search can use strides 1 and 2, and expansion ratios 2 and 4. Varying the stride sets the density at which attention can read the stage’s features. Changing the expansion ratio sets how much intermediate capacity is used when independently transforming each token. The search lets the configuration allocate both kinds of work across the network.
The candidates range from 2.59G to 4.03G FLOPs and from 13.66M to 19.88M parameters. These ranges describe the candidate space. The selected configuration, CvT-13-NAS, uses stride 2 for keys and values and expansion ratio 2 in the first and last stages. In most layers of the middle stage, it uses stride 1 and expansion ratio 4. The authors characterize the resulting arrangement as bottleneck-like. The middle part of the network is where the selected configuration spends more per block on the density of attention evidence and the width of the feed-forward transformation.
This allocation makes use of the distinct functions of the search settings. A block with a denser key grid can give separate attention weights to more locations. The expansion ratio influences what the subsequent per-token operation can do with the features that have been gathered. The search evaluates these choices together. The selected result shows the performance of that allocation, including the cheaper settings at the ends of the hierarchy and the denser, wider computation in much of its middle.
CvT-13-NAS achieves 82.2% top-1 accuracy in the ImageNet-1k evaluation with fewer parameters than the manually configured CvT-13. The compact variants and CvT-21 can be read together by looking at their accuracy on the same benchmark.
CvT variants on ImageNet-1k validation by top-1 accuracy
Architecture search improves on the compact manual configuration, and the larger manual variant leads this comparison.
The numbers
| System or setting | top-1 accuracy % |
|---|---|
| CvT-13 | 81.6 |
| CvT-13-NAS | 82.2 |
| CvT-21 (this paper) | 82.5 |
The search demonstrates a way to improve a compact design inside the CvT family. Its candidate choices leave the stage hierarchy in place and act on the work done by the blocks. CvT-21 represents a separate manual configuration with a larger parameter count and a different distribution of capacity. The plotted accuracy values describe where the resulting classifiers fall on the benchmark. The search ranges describe the cost envelope within which the compact allocation was chosen.
Larger pretraining and the wide configuration
The authors test the architecture at a larger scale with CvT-W24. Its wider token representations allow more channels to be processed in each stage, and ImageNet-22k supplies the pretraining data. The target for the headline comparison is still ImageNet-1k. The classifier is adapted to that benchmark, after which the performance is measured on its validation set. The paper specifies that the pretraining route for this result uses ImageNet-22k without additional JFT-300M data.
CvT-W24 reaches 87.7% top-1 accuracy on ImageNet-1k validation under this procedure. The paper reports an advantage of 2.5% over ViT-L/16 in ImageNet top-1 accuracy, with similar parameter counts and FLOPs. This is the comparison that bears on the large-scale use of the design. Local processing at stage entrances and inside the blocks remains part of a competitive configuration when the token representations and training collection are enlarged.
The comparison specifies the resolution used for adaptation. The table caption gives 384 × 384 as the ImageNet-1k fine-tuning size for the configurations marked as pretrained on ImageNet-22k, with an exception for BiT-M, which is fine-tuned at 480 × 480. A larger input grid changes the number of spatial locations that can be formed by the embedding and the detail available at a given stage. The sizes therefore identify part of the experimental conditions under which accuracy and cost are compared.
The sequence of training in this experiment also shows how the authors use the change of grid size in practice. The fine-tuning procedure allows the weights to adapt to the input resolution and the target classification task. The convolutional kernels can be used on the new grids without adapting a separate learned table of spatial positions. The headline accuracy is the outcome of the full route, which includes the wide configuration, the larger pretraining collection, and target fine-tuning. It complements the compact comparisons by demonstrating the design at a different scale of capacity and data.
Adapting the learned features to other classification tasks
The downstream experiments begin with ImageNet-22k pretraining for each system in the comparison. The authors then fine-tune on CIFAR-10, CIFAR-100, Oxford-IIIT Pets, and Oxford-IIIT Flowers-102. Each target supplies its own images and category labels for adaptation. The resulting top-1 accuracy concerns the highest-ranked prediction in that target’s category set. The protocols specify update budgets for the CIFAR tasks and for the Oxford tasks, so the evaluated outcomes describe the use of pretrained weights followed by target-specific learning.
CvT-W24 obtains the best reported top-1 accuracy on each downstream task considered. Among the references is BiT-R152x4, which the paper describes as having more than 3× the parameter count of CvT-W24. The rankings show that the wide CvT transfers successfully across the reported tasks even when the comparison includes a larger convolutional configuration. The shared pretraining dataset gives the comparisons a common source of initial visual evidence. Each system then adapts that evidence using its own learned representations.
Transfer here entails updating the classifier on the target task. The resulting scores reflect its ability to start with features learned on ImageNet-22k and modify them for another set of labels. This complements the ImageNet-1k result, where the headline score is measured after adaptation from the encompassing collection to the main benchmark. The downstream comparisons extend the tested use of the architecture to other classification datasets, while keeping the pretraining source common across the systems under comparison.
What the ablations show
What the position vectors were doing
The position-embedding experiment starts with a question about an input that can be removed without changing the shape of the spatial tokens. In the configuration with position embeddings, each token receives an additional learned vector associated with its location. The comparison turns that addition off. The token still occupies a place in the sequence, and CvT can still put it back at the corresponding place on the feature grid. Its convolutions continue to use that grid. The authors report no degradation in classification performance when they remove the position embeddings from CvT. They therefore leave the vectors out of the standard configuration.
The paper applies the same deletion to DeiT-S. There, removing the position embedding reduces ImageNet top-1 accuracy by 1.8%. The operation removes a source of information about how patches are arranged with respect to one another. The visual information within a patch still enters the classifier through its patch representation. The experiment shows that this remaining information was less effective for classification in DeiT-S once the added position signal was gone. CvT’s response to the deletion suggests that the need for an explicit position signal depends on how the surrounding architecture handles the grid.
One way to see the difference is to imagine a central feature that looks similar in several regions of an image. In one region the neighboring response immediately above it is strong. In another region the strong response lies to its side. A position vector can distinguish the locations of the central features. Using the arrangement of the neighboring responses then requires further computation. A convolution can incorporate that arrangement directly into the features it produces, since the slots above and beside its center have their own weights. A later comparison can use this distinction even if the image category depends on reading evidence from somewhere far away.
The deletion probes the usefulness of an extra positional input after those computations have been made available. It does not have to establish that the kernels reconstruct the same information carried by the position vectors. The two mechanisms give the classifier access to different cues. A vector indexed by location can signal something about a place on the grid regardless of its contents. A convolution can reveal a pattern among the features found around a place. The measured result says the latter form of spatial processing is sufficient within the tested CvT design to maintain its classification score when the separate vectors are removed.
This experiment is especially useful because the change also has a consequence outside the accuracy measurement. Once the vectors are gone, a new spatial grid requires no new assignment of learned location vectors. The benefit follows from the way the architecture is defined. The classification comparison tells the authors what they give up on their benchmark by taking advantage of that simpler arrangement. The comparison with DeiT-S demonstrates why the same choice would need its own evidence in a different architecture.
Where the embedding makes a difference
The token-embedding experiment changes what enters a stage. The authors substitute a non-overlapping patch embedding for CvT’s convolutional token embedding and report that ImageNet top-1 accuracy falls by 0.8% in the comparison with CvT-13. A feature crossing a patch boundary illustrates what can change. The patch construction can pass on evidence from each side separately, leaving a later operation to relate the pieces. An overlapping convolution can bring both into the receptive field of an output token. The classification score reflects what the remaining blocks ultimately make of the representations they receive.
This question is separate from whether the classifier knows which place a token represents. Imagine retaining an explicit position vector in both embedding configurations. The vectors can still indicate that the patches on either side of a boundary are adjacent. The overlapping embedding supplies another piece of information. It lets a filter respond to an arrangement that straddles the boundary before the rest of the stage starts. The authors make this comparison with position embeddings included and report a 0.3% improvement in ImageNet top-1 accuracy from introducing the convolutional token embedding. Thus the embedding can help even when the classifier already receives a location signal.
The discussion also reports a 0.1% decline in ImageNet top-1 accuracy for the comparison that combines the convolutional and position embeddings. The prose uses the same row label when identifying the CvT-13 reference and when describing that combined condition, which makes its row assignments hard to reconcile. The size and direction of the change given by the authors are clear. Their interpretation is that adding position embeddings confers no accuracy benefit in this convolutional setting. The broader deletion experiment provides independent context for their decision to omit those vectors.
A stage entrance also controls the evidence available across the depth of the stage. Once the embedding produces its output, every block there receives features derived from that representation. A convolutional projection in a later block may bring adjacent tokens together again. It can use whatever traces of a visual pattern those tokens contain. How the pattern was divided or brought together at the embedding step affects those traces. This explains why the embedding can matter even in a network that uses spatial filters repeatedly after the tokens have been formed.
The intervention covers the embedding operation as implemented. It does not separately change how much the windows overlap while matching all other features of the embedding. The results support a learned overlapping embedding as a replacement for the tested patch construction. They leave room for several aspects of that replacement to contribute. The geometry shows how a pattern can become available as a unit at a stage entrance. The accuracy comparison measures the practical value of the full change, without identifying what fraction of the gain came from patterns situated near a patch boundary.
Why the projection matters after the embedding
The projection ablation moves the intervention inside the attention block. The authors choose, by stage, whether the block should use the standard position-wise linear projection or their convolutional alternative. The linear operation transforms the features already stored at a location. Those features can reflect earlier attention updates or a convolutional embedding. With a convolutional projection, features at neighboring locations can also influence the representation made at that point in the block. The experiment asks whether the classifier benefits from making the current neighborhood available again when forming the inputs to attention.
ImageNet top-1 accuracy is 80.6% at the linear-projection endpoint and 81.5% at the endpoint with convolutional projection throughout. The authors also find progressively better accuracy in the reported configurations as more stages use convolutional projection. This supports using the spatial operation within the repeated blocks as well as at the points where the stage grids are created. The endpoint is the outcome of this particular ablation. Its role is to measure the effect of the projection comparison, so the appropriate reading uses the two configurations from that experiment.
Attention projection variants on ImageNet by top-1 accuracy
Using convolutional projection throughout the hierarchy gives the higher accuracy in this ablation.
The numbers
| System or setting | top-1 accuracy % |
|---|---|
| Position-wise linear projection | 80.6 |
| Convolutional projection in all stages (this paper) | 81.5 |
The placement of the operation gives it more than one way to affect the result. A convolution in the query branch can change what evidence a location seeks by making its surroundings part of the request. In the key branch it can change whether another location appears to offer a good match. In the value branch it can change the information delivered through a match. Since keys and queries shape the weights and values determine what those weights act on, the intervention can affect both the selection of evidence and the content selected. The accuracy comparison reports their combined consequence.
Suppose two locations both contain a feature that responds to a strong edge. When the neighborhood of one includes evidence for a larger contour, the convolution can expose a distinction the local edge response alone leaves unresolved. The query or key could then help attention make a different comparison. The paper’s explanation of semantic ambiguity follows this logic. Its evidence is the change in the classifier’s top-ranked predictions as measured across ImageNet. The score does not show how often that particular distinction was used. It establishes that the tested way of giving the comparison access to a neighborhood improved the outcome.
The stagewise results concern cumulative configurations. Using the operation in more stages can change the features handed from one stage to the next, and those altered features can then change what subsequent projections do. A steady improvement through the reported configurations is evidence that using the operation more widely was productive in this hierarchy. A contribution assigned to a particular stage would require comparisons in which the choices elsewhere were held constant. The paper reports the progression as support for the projection design, rather than as a ranking of the stages according to their individual need for local context.
What the classifier gives up when attention reads fewer positions
The stride ablation retains convolutional projection in all the Transformer blocks and varies how densely the key and value grids are formed. With stride 2 for keys and values, the authors report 30% fewer FLOPs and a reduction of 0.3% in ImageNet top-1 accuracy. They adopt this setting as the default for its lower computational and memory demands. The accuracy comparison supplies the cost of that choice on the classification benchmark. The FLOP figure supplies the change in arithmetic for the evaluated network. The two measures are needed together to understand why the lower-accuracy setting is the default.
A query can only assign separate weights to locations that have separate keys. With a denser grid, nearby features can each have a distinct entry. With a coarser grid, some of those features may still reach attention through a convolutional window, but they arrive as part of a representation associated with a retained location. A query can read the resulting value. It cannot separately select every spatial contribution that was combined in forming the entry. This is the loss of precision that the stride comparison tests indirectly through its effect on the final image label.
Redundancy gives a reason why the effect on that label can be small. Consider a region in which adjacent features express much the same texture, or nearby points along a contour all carry similar evidence. A filter can pick up the recurring response at its sampled locations, and a query can read a summary that is sufficient for classification. In a region containing neighboring features with different meanings, a denser grid could instead be useful because each response can receive its own attention weight. The measured accuracy change reflects the net effect of using fewer independently readable locations across the evaluation set. The paper does not quantify how much redundancy exists or which examples depended on the missing distinctions.
Holding the query stride fixed is part of the intervention’s meaning. Every spatial query still produces an update at the stage resolution. The next block gets a representation at each of those locations. What changes is how much separately indexed evidence a query can consult when producing that update. This distinguishes the ablation from increasing the stride of the stage embedding, which would reduce the spatial representation carried through the rest of the stage. The authors can therefore save work within attention while leaving the number of spatial outputs from the block intact.
The arithmetic estimate in the method concerns the attention work affected by the key and value lengths. The 30% result covers the classifier measured in the ablation. Feed-forward layers, the query branch, and the embedding operations still have to do their work. The two cost accounts describe different scopes of the same intervention. In particular, the FLOP result is the direct evidence for savings in the complete measured configuration. The argument for lower memory use follows from needing fewer entries in the attention computation, while the comparison gives no numerical measure of peak memory.
What the search adds to the stride experiment
The search shows another way to use the same controls. The uniform stride comparison asks what happens when the evidence grid is coarsened across the blocks. The selected CvT-13-NAS configuration uses denser key and value grids in most layers of the middle stage and coarser grids at the ends of the hierarchy. It also uses a larger feed-forward expansion in much of the middle stage. The selected design therefore spends more of its computation there on both retrieving information across locations and transforming the resulting feature vectors. This is evidence that the ordinary stride setting can be varied within a useful compact CvT configuration.
The search explores a joint choice. A denser evidence grid changes which features can be addressed separately. A larger feed-forward expansion changes the capacity available for processing the information that attention assembles. If one part changes what reaches the other, the gain from allowing both to vary need not match the gain from changing either in isolation. The result for the selected configuration does not identify how much of its advantage comes from either one. That would require comparisons within the selected allocation, changing one setting at a time while retaining the others.
There is a further difference between choosing a stride for a particular stage and choosing it for the whole classifier. Grids at different stages have different resolutions, so a change in sampling density can change the amount of arithmetic by different amounts. The features also have different histories by the time they reach those grids. The selected allocation indicates that preserving more evidence locations and more feed-forward capacity in part of the hierarchy can work well within the tested search space. It does not establish that the middle stage has the same role in every member of the family or in a network trained for another task.
The reported settings can be read alongside the projection comparison without treating the search as another test of convolution against a linear operation. The projection comparison asks whether to make attention inputs with a filter that can consult neighbors. The stride comparison asks how often to place that filter’s window for the evidence branches. The search varies that second choice together with feed-forward width. These experiments progressively narrow the design questions. The evidence for using a convolution, the efficiency case for sampling a coarser key and value grid, and the evidence for a particular distribution of work each rest on different comparisons.
Their numerical outcomes consequently cannot be assembled by adding the reported changes in accuracy. The spatial embedding can affect what the projection has to work with. A change in projection can affect the features delivered to the feed-forward operation. The position signal may be useful in one of these settings and dispensable in another. The ablations establish the measured effects of specific interventions. They leave the full set of interactions among those interventions open, including how the network would respond to different combinations of stage resolution, local filtering, and attention density.
Limitations
Where the authors qualify their claims
The authors present resolution flexibility as a potential benefit for a wider range of vision tasks. Their design removes a concrete obstacle to changing grid size. The convolutional operations can apply their weights at the locations the new input supplies, and the classifier has no learned position table whose entries must be assigned to that new grid. This is an architectural result. Classifying images well after changing resolution depends on how the network’s features respond and on the conditions under which it is trained and evaluated.
The experiment that illustrates resolution flexibility uses further training at the target size. The fine-tuning updates can alter the filters and the use of their responses once the image occupies a different grid. A test of a fixed set of weights across different input sizes would ask a distinct question. It would measure how well a trained classifier copes with changed window placements and changed numbers of tokens in the absence of adaptation. The paper’s procedure provides evidence for making the transition with fine-tuning. It leaves the accuracy of a fixed classifier across other sizes undetermined.
The authors also acknowledge a price for their default projection stride. The coarser grids make attention cheaper and the classifier’s top-1 accuracy declines in the reported stride comparison. The authors deem that trade worthwhile for the design they evaluate. Their reasoning depends in part on nearby features carrying related information. If a task depends on distinctions among those features, the same trade can be different. The observed change is evidence about the classification task and the tested stride intervention. It gives no general estimate of the price of coarsening the evidence grid wherever spatial precision matters.
The paper connects the design to tolerance of shifts, scale changes, and distortion. It grounds that motivation in mechanisms also used by convolutional networks, including local windows, recurring filter weights, and the use of several spatial scales. Such mechanisms give plausible reasons to expect a classifier to reuse visual patterns in different circumstances. The experiments primarily assess how the architecture classifies images and how it compares in operation count and parameter count. The broader claim about the architecture’s value for other vision settings is framed as an opportunity. The robustness motivation likewise needs to be distinguished from a direct measurement of robustness to named changes in the input.
The authors’ narrower claims have concrete supporting comparisons. Accuracy holds up when the position vectors are dropped in CvT. The projection stride comparison supplies an accuracy and arithmetic cost for a particular reduction. The comparison with earlier classifiers shows how the complete configurations perform under the paper’s stated regimes. The possible wider advantages arise from the same design, but the paper’s evidence for each one has a different boundary. Some benefits follow directly from the way a grid or an array is formed. Others concern the behavior of trained classifiers and depend on what the evaluation actually measures.
What changing the input size can change besides the token count
A further limit follows from the mechanics of the method. A convolution that accepts a new grid still has to decide which positions its kernel covers. Changing the input dimensions can change how the kernel fits at the boundaries and how its strided placements align with important features. The kernels remain usable, but a detail may now occur at a different offset in a window or contribute to a different collection of tokens. As the grids pass through successive embeddings, the changes can propagate to the attention inputs. Taking away the position table does not make these geometric effects disappear.
The number of positions processed by each stage can also change. The attention block will make comparisons using the queries and the key and value grids obtained at the new size. A coarser evidence grid remains possible, but its size depends on the stage grid from which it was formed. The absence of a fixed table addresses how the classifier accepts the sequence. It does not give a bound on the arithmetic or memory required for every input shape that the spatial operations can handle. The paper’s efficiency results apply to the conditions under which those operations were counted.
The effects of resolution and object scale also need separate readings. Adjusting an image to a different input size changes the grid used for its representation. An object covering a smaller or larger share of the scene changes the visual relationships presented to the filters, even on a fixed input grid. A stage hierarchy makes several feature resolutions available as information advances through the network. This is a reason to investigate both sources of variation. The pretraining and adaptation procedure changes resolution under a particular training plan. It does not measure how the score changes when object scale alone is varied.
The fine-tuning procedure changes the effective data seen by the classifier as well as its input dimensions. The weights are updated for a target dataset, and the final score is measured after those updates. For the wide configuration, the target validation result shows the performance of the route from large-scale pretraining through adaptation. Isolating what the resolution change contributed would require a counterpart at a different resolution with comparable training and evaluation conditions. Without that intervention, the result shows that the change is workable as part of the procedure, while leaving its independent effect on the score unspecified.
There is also no direct comparison of how the two position-embedding settings behave across a range of resolutions. Removing the vectors simplifies the transition by deleting a grid-specific input. The location ablation addresses the accuracy effect of deleting that input in the evaluated configuration. Those findings support the architectural choice for the authors’ procedure. They leave questions about how the configurations would compare at varied sizes, including whether the relative accuracy of the two settings changes with the representation’s spatial granularity.
What classification leaves unresolved about spatial detail
The evaluation gives a single category to each image. A classifier can reach the correct answer using evidence assembled from several regions without recovering the precise position of each contributing feature. This is a useful property for recognition, but it gives the top-1 score limited power to test whether a representation retains the spatial distinctions needed for other tasks. For example, two features may both help identify an object. A classifier can profit from a value that combines them. A system that has to identify where the features occur may need to distinguish their contributions at a finer scale.
The stage grids supply positions where representations can be stored. Keeping that structure is one of the reasons the architecture is relevant to dense prediction. The classification experiments do not attach detection or segmentation heads to the backbone to measure how useful those representations are for spatial outputs. The paper discusses such tasks when motivating a multiscale architecture and describing related work. That motivation identifies a possible use for the stage features. It gives no empirical comparison of CvT with other backbones for locating objects or assigning outputs across an image.
The default projection shows why even a geometrically organized output can leave this question open. A spatial query receives a mixture of values from a coarser evidence grid. Its output retains the query’s location. At the same time, the information available for independent use by attention has already been grouped by the projection. Whether a later computation can recover a particular local distinction depends on what survived in the vectors and on how later blocks process them. The score for the image category does not reveal which distinctions remain separately recoverable.
The position-vector result has a similar scope. It establishes that the tested classification configuration can dispense with a grid-indexed learned signal. In a task where the desired output itself includes a location, a feature’s absolute or relative place might bear more directly on the answer. CvT can still use the spatial layout through convolution. The classification ablation does not quantify how much information about location its features preserve, or whether an explicit position input would be useful once a different task reads those features. The use of the grid makes such a test plausible. It cannot substitute for the test.
The experiments could also leave ambiguity within classification itself. The top-1 measure records a correct or incorrect first choice. It does not identify which pieces of evidence caused that choice or how other class scores changed. When accuracy is maintained after position vectors are removed, the set of correctly classified images could remain similar or could change in ways that balance overall. The result establishes performance under the reported measure. It supplies no analysis of how frequently the architectures rely on the same location cues or make the same errors.
How far the evidence reaches on robustness
The robustness limit follows from what is varied in the experiments. Applying a learned kernel at many locations makes it possible for similar local patterns to elicit related responses. How stable those responses remain after a shift depends partly on the kernel placements. A pattern can move relative to the sampling interval, changing which part of a window sees it or which output location represents it. Close to a padded boundary, the available neighbors can change as well. These are consequences of the stated operations, so exact stability of the final classification under a shift does not follow from weight sharing alone.
Scale and distortion raise related questions. A feature can occupy a different collection of offsets within a window after rescaling. Distortion can change local arrangements that a learned filter uses to recognize a pattern. A hierarchy gives the network access to representations at several scales. Its response to a changed image still depends on the learned filters, the stage transitions, and the comparisons made by attention. The architecture offers ways to learn useful responses to varying images, and the classification scores show how well it performs under its evaluation conditions. They do not identify the degree of robustness to individual transformations.
The reported comparisons include ImageNet Real and the matched-frequency evaluation from ImageNet V2 alongside the ImageNet benchmark. These evaluations belong to the paper’s classification evidence. A comparison across evaluation collections can reflect several differences at once. A test aimed at robustness to a shift or a change in scale would vary that property in a way that allows the result to be related to the change. The paper does not report such an isolated intervention for the robustness properties it invokes in motivating the architecture.
Even a favorable overall classification result leaves open how individual images respond to a change. A prediction can remain correct while the feature representations and attention weights change considerably. A prediction can also change after a seemingly modest perturbation to a feature that happens to be important in that image. Without results that pair corresponding images or otherwise identify the perturbation, the aggregate score does not distinguish these patterns of behavior. Convolution’s value as a structural assumption and the robustness of a classifier trained with it are separate levels of evidence.
Removing learned position vectors is also an intervention on the classifier, rather than on its input. It asks whether an explicit grid-indexed signal helps achieve the measured accuracy. Moving an object tests how the same classifier responds to a changed arrangement of image content. A convolutional architecture can use the grid differently when that content moves even though it receives no position vectors. The deletion experiment supports the conclusion about the usefulness of the vectors. It leaves the stability of predictions under moved content unmeasured.
What the experiments can attribute to particular operations
The ablations go further towards isolating an architectural cause than comparisons with independently developed classifiers. Their resolution is still the level of the intervention. The embedding test substitutes one way of forming tokens for another. Its changes include how adjacent evidence enters a token, and the resulting representation becomes the input to every subsequent block at that scale. The comparison supports the tested embedding. It does not separate overlap from all the other properties of the operation, such as how the kernel weights combine the channels and offsets available in the window.
The projection comparison similarly evaluates a replacement with several elements. The convolutional branch uses spatial filtering, intermediate batch normalization, and a point-wise operation. The linear branch takes its input from the vector at the current location. Their comparison measures what happens when the full projection is replaced. It cannot estimate independently how much of the outcome depends on the kernel’s spatial extent, how the intermediate responses are normalized, or what the final channel mixing does with those responses. A spatial explanation is consistent with the design and the ablation. Numerical attribution to individual steps would require additional interventions.
Applying the change by stage gives evidence about its use across the hierarchy. It does not provide separate comparisons for using the spatial filter on queries alone, keys alone, or values alone. Such variations would distinguish the effect of enriching the representation that seeks evidence from the effect of enriching the representations that are searched and read. In the paper’s comparison these mechanisms can operate together. A change in what counts as a good match can change which values matter, and a change in those values can change what the same match contributes. Accuracy represents the resulting interaction.
The placement of the classification token is another feature of the architecture without a separate comparison in the reported ablations. Introducing it in the final stage means the earlier stages develop spatial representations without dedicating a token to the image label. Its contribution to parameter use or classification performance is not isolated from the rest of the design. The same is true of the choice to apply the prediction head to that token. These choices describe how the tested classifier operates. The evidence for them comes through that complete classifier’s performance.
The hierarchy has a comparable evidentiary limit. The stagewise projection experiment keeps the hierarchy as the setting for varying the operation. It does not compare the three-stage arrangement with a single spatial resolution while otherwise retaining the convolutional design in a controlled way. A hierarchy can influence accuracy by changing which features are collected together and can influence cost by changing sequence lengths. The paper shows the outcomes available when those choices are combined. It provides less direct evidence about the size of the contribution of the hierarchy on its own.
Evidence about one interaction does appear in the cases that vary the embedding and the presence of position vectors. There, the comparison reveals how the result of an embedding substitution depends on the surrounding configuration. That dependence is precisely why it would be difficult to transport a numerical gain from one ablation into another setting. An embedding can alter the usefulness of a projection, and a projection can alter what information is available to later layers. The ablation scores offer evidence at their own operating points. They leave combinations not included in the comparisons unmeasured.
How much confidence small accuracy changes support
The paper reports point estimates and changes in accuracy for the component comparisons. It does not give run-to-run variation for those comparisons. This matters most for the interpretation of small reported changes. An observed decline when adding a position embedding to a convolutional setting can support the authors’ decision to keep the simpler configuration. A general claim that the additional vectors reliably harm classification would require knowing how frequently that direction of change recurs under comparable training. The reported comparison does not supply that frequency or the spread of results across runs.
The issue also applies to a modest accuracy cost accepted for efficiency. A setting that uses less arithmetic presents a concrete resource difference under the paper’s counting procedure. The estimated effect on accuracy comes from the trained settings being compared. A nearby result in top-1 accuracy can be sufficient for the authors to choose their default, given the FLOP reduction. The paper gives no basis for estimating how precisely the size of the accuracy cost would carry over to another run, a differently sized variant, or a different use of the backbone.
Classification scores also provide no measure of which predictions switch when an operation is changed. A small aggregate change can arise because a small group is newly misclassified. It can also arise from improvements and losses on different images that mostly offset one another. The same reasoning applies when accuracy is preserved after a component is removed. The benchmark outcome describes the net score. Examining predictions under both settings would be needed to learn whether the intervention systematically helps or hurts examples with particular kinds of spatial structure.
The attribution problem becomes especially important when interpreting the smallest embedding comparison. The prose reports the small change associated with using both kinds of embedding and includes an ambiguous row reference. The ambiguity concerns how conditions are identified in the discussion, while the absence of uncertainty estimates concerns what can be inferred from the reported magnitudes. The broader position ablation gives a separate reason for omitting the learned grid vectors. Together the comparisons support the authors’ implementation choice without determining a precise general effect of adding those vectors to every convolutional vision Transformer.
Small changes between complete systems deserve similar care. Their outcomes incorporate architecture, capacity, and training decisions. An ImageNet advantage is evidence of better performance for the configuration that produced it. Explaining that advantage through a single mechanism requires an intervention targeted to that mechanism and sufficient evidence to tell the size of its effect. The paper supplies several such interventions at the component level. It does not establish that each numerical margin between independently developed systems is entirely explained by one of them.
What the efficiency measures cover
The paper reports learned parameter counts and floating-point operations. The parameter count indicates how much learned state a configuration has. The FLOP count indicates the amount of arithmetic in the counted computation at the stated input setting. Both are directly relevant to the architecture’s claim of economy. They are different from elapsed time, which also depends on how the operations are implemented and executed. A design that uses less arithmetic has removed some work in the sense the paper measures. The paper does not report timing experiments from which to infer the size of the speed gain on a particular device.
The use of depth-wise filtering illustrates the distinction. Splitting spatial filtering from channel mixing reduces the number of spatial weights and the arithmetic described by the cost argument. Executing the resulting operation also involves intermediate responses and a normalization step. The runtime consequences depend on how those operations are scheduled and how data move between them. The analytical comparison describes the savings from changing the form of the projection. It leaves open what proportion of the elapsed time in a particular implementation comes from the operations being saved.
The stride argument has a related boundary. Fewer projected keys and values give the attention computation fewer entries to process. That can reduce the size of intermediate arrays, which explains the authors’ interest in the setting for memory use. Peak memory also depends on what is kept during the other layers and during training. The FLOP measurement does not indicate which arrays dominate peak use or how their lifetimes interact. The reported comparison gives a numerical result for arithmetic. An estimate for memory would need to account for the arrays that coexist during the relevant computation.
Parameters also describe the learned part of the classifier. Activations created during processing can depend on the input resolution, the stage grid, the number of channels, and the batch being run. Consequently a favorable parameter comparison gives limited guidance about the total memory needed at a particular resolution or batch size. The paper shows that a compact CvT can attain strong accuracy with a relatively small learned configuration. How those parameters and the associated activations translate into a deployment or training footprint is a separate measurement.
The computational comparison likewise depends on the settings of the evaluated networks. The difference in arithmetic between two architectures at one input size need not describe the difference after their grids grow. Each architecture has its own rule for introducing tokens and reducing their number. The paper supplies the structure needed to understand why CvT’s attention work depends on two grid sizes. Its comparisons establish the reported costs at the operating points used. They do not give a measured cost curve across input resolutions.
There is a distinction between the arithmetic for using a trained network and the total work to obtain it. The latter includes the repeated updates during learning, pretraining when it is used, and candidate evaluation when the configuration is searched. Training settings give useful context for those costs, but the paper’s parameter and FLOP comparisons refer to the evaluated configurations. A result that uses fewer FLOPs for its counted computation can still come from a training or search route with substantial resource requirements. The reported measures describe specific aspects of efficiency rather than the full cost of arriving at the result.
What the data regimes establish about learning from less data
The compact ImageNet-1k experiments address a genuine part of the motivation. They show that the authors can obtain competitive performance in a regime that does not use ImageNet-22k pretraining. The baseline comparisons establish where those CvT configurations stand under the reported conditions. A systematic test of data efficiency could ask how the architecture’s advantage changes as examples are taken away or added while its other settings are held fixed. The paper evaluates particular data regimes. It does not trace that kind of learning curve.
That distinction affects the explanation based on visual inductive bias. The paper gives plausible reasons why local windows can help when data are less abundant. Improvements from the internal ablations add evidence that the spatial operations are useful on the tested benchmark. The experiments do not estimate how many examples are saved by building those operations into the architecture. A classifier can reach a higher score in a particular regime for several reasons, including the way its capacity and computation are distributed. The evidence shows what the combined design achieves at the tested scale.
The comparison with DeiT is informative in this respect. The paper presents DeiT as a data-efficient training approach for a visual Transformer, so its performance reflects more than the initial ViT patch design. Comparing with it puts CvT alongside an approach specifically developed to improve the smaller-data regime. The result concerns the complete classifiers and procedures represented in the comparison. It does not independently estimate the contributions of architecture, optimization, and regularization to the gap. CvT’s internal changes answer a more focused set of architectural questions under their own training setup.
The large-scale result changes several conditions together. The wider architecture has more capacity, the initial training draws on the expanded ImageNet collection, and the network is adapted for the target task. The high validation score shows that the design remains effective when used in that pipeline. Isolating the benefit of additional pretraining data would require keeping the network and adaptation conditions comparable while varying the pretraining collection. Isolating the effect of width would require an analogous comparison with the data held fixed. The reported outcome is evidence for the combined configuration and training regime.
The benchmark comparisons also include variation in input size among configurations, as the paper identifies in the large-pretraining comparison. Resolution can affect both visual evidence and arithmetic. A favorable comparison under the reported conditions establishes the standing of the systems as evaluated. It does not fully control for how the systems would perform with a matched resolution and training procedure. The paper’s strongest evidence about individual design components comes from comparisons within CvT, where it intervenes on the embedding, position vectors, projections, or stride.
This distinction also applies to systems that share one part of CvT’s motivation. A pyramid baseline has features at several scales, and another baseline may have a special way of grouping adjacent evidence. The fact that CvT outperforms such a baseline shows the outcome of using the full CvT design in the comparison. It does not determine that the corresponding CvT operation is the sole reason for the advantage. The baselines provide useful context for the task and the resource trade. The ablations narrow what can be said about particular replacements.
How much generality transfer and search demonstrate
The downstream results show the value of the pretrained configurations followed by target-specific adaptation. The compared systems begin with pretraining on the same larger collection, and the target tasks give the authors several settings in which to repeat the procedure. The rankings reflect both the initial representation and what the subsequent optimizer learns from the new data and labels. A comparison using frozen features would ask how much information those representations expose without such adaptation. The paper does not report that comparison.
The targets also share the requirement to predict a category for an image. The evaluation thus shows breadth across classification tasks while retaining a common kind of endpoint. A task that takes intermediate feature maps, produces outputs over spatial locations, or uses the backbone without updating it would exercise other properties of the representations. The paper’s transfer evidence does not determine the ranking for those uses. Its conclusions apply to the tested procedure of starting with pretrained weights and fine-tuning for each target.
Common pretraining data improve the comparability of the transfer setting. The architectures still vary in how they process that data, the number and organization of their learned features, and the capacity available for adaptation. The wide CvT’s favorable ranking therefore establishes the performance of its complete pretraining and fine-tuning route. It does not isolate whether the ranking stems mainly from local filtering, global interactions, the distribution of channel capacity, or the optimization response on the target. The answers would require interventions tailored to the transfer procedure itself.
Architecture search offers a different kind of generality. It shows that the CvT design can support more than one useful allocation of attention density and feed-forward work. The authors choose among specified stride and expansion settings, with resource ranges defining the candidate space. The result identifies a successful point within that space. It does not establish an optimum for other stride values, other width choices, or another resolution hierarchy. It also does not establish that the selected allocation would be chosen if the target evaluation prioritized fine spatial detail.
The paper reports the properties of the selected architecture and the range of candidates. Those facts do not measure the full computation spent on search. The compact searched classifier can compare favorably in cost once selected, while the process of selecting it has its own resource requirements. This is particularly important if the question is the expense of obtaining a classifier for a new setting, rather than the expense of running the one already found. The reported result supports the flexibility of the block controls without supplying that additional cost comparison.
Together, the transfer and search experiments expand the evidence in different directions. Transfer changes the classification target after pretraining. Search changes the organization of work within the compact architecture on ImageNet-1k. Neither comparison varies all the factors that would be needed to infer a universally preferable arrangement of local operations and attention. Their value is in showing that the design remains useful when these particular parts of its use change, with the empirical claim bounded by what was adapted, what was selected, and which task supplied the score.
What came after
Robustness as a research question in its own right
The 2022 paper Towards Robust Vision Transformer cites CvT and names robustness as its focus. That focus connects to a distinction left open by the CvT experiments. CvT gives the classifier filters that can look for recurring local arrangements across the grid, and the hierarchy lets visual features be processed at different scales. These are reasons the authors expect the design to handle some variation in images. Measuring the stability of a prediction under a particular input change is a further step beyond showing that the resulting classifier has good top-1 accuracy. Towards Robust Vision Transformer
The connection can be stated in terms of what information a visual architecture receives. A vision Transformer can use patch identities, features prepared from local neighborhoods, and comparisons across distant locations. CvT changes the local preparation and tests its value for recognition and efficiency. A robustness study centered on visual Transformers takes up the broader question of which architectural choices help the system withstand changes to the evidence it receives. The citation places CvT within the earlier work relevant to that question. The relationship establishes neither a particular reuse of convolutional projection nor a result comparing the robustness of the two approaches.
CvT’s stride experiment gives one concrete example of why the distinction matters. Dense and coarser evidence grids can yield similar overall recognition scores, while making different spatial details available to attention. The scores alone leave open whether that difference matters more when images are altered in a particular way. The position experiment leaves a parallel question about whether removing a grid-indexed input changes sensitivity to the arrangement of visual evidence. These are connections between the problems raised by the papers. The citation and title do not identify which, if either, of those CvT interventions the later study examined.
Efficiency under a different sequence architecture
The 2024 paper Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model also cites CvT. It pursues efficient representation of images using a bidirectional state space approach. CvT tackles efficiency inside a vision Transformer, where part of the work comes from comparing queries with keys and using those comparisons to combine values. The two papers can be connected through the cost of processing visual sequences. CvT manages how many locations are compared and how their features are prepared. Vision Mamba’s stated approach puts a different sequence operation at the center of the representation. Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model
That connection distinguishes the representation of the visual grid from the mechanism that exchanges information among the resulting features. CvT changes the representation through overlapping embeddings and a hierarchy, and it changes the evidence available within attention through its projections. A study organized around a state space approach concerns another way to process a sequence of visual features. The citation establishes that CvT is part of the prior work relevant to that study. It does not specify whether the later paper adopts any of CvT’s embedding choices, compares against a particular CvT configuration, or uses its results to motivate a specific architectural change.
The two citations thus connect to different parts of CvT’s research problem. The robustness paper brings the response of vision Transformers to variation into the foreground. The efficiency paper pursues economical representation with a different kind of sequence computation. CvT’s experiments document what happens when local feature construction, spatial reduction, and global attention are combined in one classifier. The later citations show those questions recurring in wider work on visual architectures, while the details of direct architectural or experimental inheritance remain unspecified.
Cite
Cite as Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan and Lei Zhang. 2021. CvT: Introducing Convolutions to Vision Transformers. IEEE/CVF International Conference on Computer Vision (ICCV).
@inproceedings{wu2021cvt,
title = {{CvT: Introducing Convolutions to Vision Transformers}},
author = {Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan and Lei Zhang},
booktitle = {IEEE/CVF International Conference on Computer Vision (ICCV)},
year = {2021},
doi = {10.1109/iccv48922.2021.00009},
eprint = {2103.15808},
archivePrefix = {arXiv},
url = {https://doi.org/10.1109/iccv48922.2021.00009}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/wu-2021-cvt-introducing-convolutions-vision-transformers/
References
- Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization, 2016. OpenAlex ↗ · Scholar ↗
- Lucas Beyer, Olivier J Hénaff, Alexander Kolesnikov, Xiaohua Zhai, and Aäron van den Oord. Are we done with imagenet? arXiv preprint arXiv:2006.07159, 2020. OpenAlex ↗ · Scholar ↗
- Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, pages 213–229. Springer, 2020. our card
- Hanting Chen, Yunhe Wang, Tianyu Guo, Chang Xu, Yiping Deng, Zhenhua Liu, Siwei Ma, Chunjing Xu, Chao Xu, and Wen Gao. Pre-trained image processing transformer. arXiv preprint arXiv:2012.00364, 2020. OpenAlex ↗ · Scholar ↗
- François Chollet. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1251–1258, 2017. OpenAlex ↗ · Scholar ↗
- Xiangxiang Chu, Bo Zhang, Zhi Tian, Xiaolin Wei, and Huaxia Xia. Do we really need explicit position encodings for vision transformers? arXiv preprint arXiv:2102.10882, 2021. OpenAlex ↗ · Scholar ↗
- Xiyang Dai, Dongdong Chen, Mengchen Liu, Yinpeng Chen, and Lu YUan. Da-nas: Data adapted pruning for efficient neural architecture search. In European Conference on Computer Vision, 2020. OpenAlex ↗ · Scholar ↗
- Zhigang Dai, Bolun Cai, Yugeng Lin, and Junying Chen. Up-detr: Unsupervised pre-training for object detection with transformers. arXiv preprint arXiv:2011.09094, 2020. OpenAlex ↗ · Scholar ↗
- Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009. OpenAlex ↗ · Scholar ↗
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota, 2019. Association for Computational Linguistics. our card
- Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. our card
- Nico Engel, Vasileios Belagiannis, and Klaus Dietmayer. Point transformer. arXiv preprint arXiv:011.00931, 2020. OpenAlex ↗ · Scholar ↗
- Anmol Gulati, James Qin, Chung-Cheng Chiu, Niki Parmar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zhengdong Zhang, Yonghui Wu, et al. Conformer: Convolution-augmented transformer for speech recognition. arXiv preprint arXiv:2005.08100, 2020. our card
- Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, and Yunhe Wang. Transformer in transformer. arXiv preprint arXiv:2103.00112, 2021. OpenAlex ↗ · Scholar ↗
- Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. our card
- Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. our card
- Han Hu, Zheng Zhang, Zhenda Xie, and Stephen Lin. Local relation networks for image recognition. arXiv preprint arXiv:1904.11491, 2019. OpenAlex ↗ · Scholar ↗
- Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, and Neil Houlsby. Big transfer (bit): General visual representation learning. arXiv preprint arXiv:1912.11370, 6(2):8, 2019. OpenAlex ↗ · Scholar ↗
- Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. OpenAlex ↗ · Scholar ↗
- Yann Lecun, Patrick Haffner, Léon Bottou, and Yoshua Bengio. Object recognition with gradient-based learning. In Contour and Grouping in Computer Vision. Springer, 1999. OpenAlex ↗ · Scholar ↗
- Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017. our card
- Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In Indian Conference on Computer Vision, Graphics and Image Processing, Dec 2008. OpenAlex ↗ · Scholar ↗
- Omkar M. Parkhi, Andrea Vedaldi, Andrew Zisserman, and C. V. Jawahar. Cats and dogs. In IEEE Conference on Computer Vision and Pattern Recognition, 2012. OpenAlex ↗ · Scholar ↗
- Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018. OpenAlex ↗ · Scholar ↗
- Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018. OpenAlex ↗ · Scholar ↗
- Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? In International Conference on Machine Learning, pages 5389–5400. PMLR, 2019. OpenAlex ↗ · Scholar ↗
- Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021. OpenAlex ↗ · Scholar ↗
- Zhiqing Sun, Shengcao Cao, Yiming Yang, and Kris Kitani. Rethinking transformer-based set prediction for object detection. arXiv preprint arXiv:2011.10881, 2020. our card
- Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105–6114. PMLR, 2019. our card
- Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020. our card
- Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998–6008, 2017. our card
- Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. our card
- Huiyu Wang, Yukun Zhu, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. Max-deeplab: End-to-end panoptic segmentation with mask transformers. arXiv preprint arXiv:2012.00759, 2020. OpenAlex ↗ · Scholar ↗
- Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. arXiv preprint arXiv:2102.12122, 2021. OpenAlex ↗ · Scholar ↗
- Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018. OpenAlex ↗ · Scholar ↗
- Yuqing Wang, Zhaoliang Xu, Xinlong Wang, Chunhua Shen, Baoshan Cheng, Hao Shen, and Huaxia Xia. End-to-end video instance segmentation with transformers. arXiv preprint arXiv:2011.14503, 2020. OpenAlex ↗ · Scholar ↗
- Yujing Wang, Yaming Yang, Jiangang Bai, Mingliang Zhang, Jing Bai, Jing Yu, Ce Zhang, Gao Huang, and Yunhai Tong. Evolving attention with residual convolutions. arXiv preprint arXiv:2102.12895, 2021. OpenAlex ↗ · Scholar ↗
- Felix Wu, Angela Fan, Alexei Baevski, Yann N Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. arXiv preprint arXiv:1901.10430, 2019. our card
- Zhanghao Wu, Zhijian Liu, Ji Lin, Yujun Lin, and Song Han. Lite transformer with long-short range attention. arXiv preprint arXiv:2004.11886, 2020. OpenAlex ↗ · Scholar ↗
- Fuzhi Yang, Huan Yang, Jianlong Fu, Hongtao Lu, and Baining Guo. Learning texture transformer network for image super-resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5791–5800, 2020. OpenAlex ↗ · Scholar ↗
- Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021. our card
- Yanhong Zeng, Jianlong Fu, and Hongyang Chao. Learning joint spatial-temporal transformations for video inpainting. In European Conference on Computer Vision, pages 528–543. Springer, 2020. OpenAlex ↗ · Scholar ↗
- Minghang Zheng, Peng Gao, Xiaogang Wang, Hongsheng Li, and Hao Dong. End-to-end object detection with adaptive clustering transformer. arXiv preprint arXiv:2011.09315, 2020. OpenAlex ↗ · Scholar ↗
- Luowei Zhou, Yingbo Zhou, Jason J. Corso, Richard Socher, and Caiming Xiong. End-to-end dense video captioning with masked transformer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018. OpenAlex ↗ · Scholar ↗
- Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159, 2020. OpenAlex ↗ · Scholar ↗