Elamur Research

Vision Transformers for Dense Prediction

Paper · 2021 · René Ranftl, Alexey Bochkovskiy and Vladlen Koltun

Summary

A photograph can make it easy to recognize an object and hard to say exactly where it ends. For a depth estimator, a narrow foreground structure has to appear at a different distance from the surface behind it. For semantic segmentation, a category has to be assigned to each pixel, including those where neighboring objects meet. Both tasks depend on fine spatial evidence and an understanding of the surrounding scene. Vision Transformers for Dense Prediction asks whether the encoder, which extracts features for the final prediction, can serve both needs better. The authors introduce the dense prediction transformer, or DPT, which couples a vision transformer encoder with a convolutional decoder.

DPT starts with a grid of image regions, each represented by a vector called a token. The transformer keeps that initial grid through its successive layers. Self-attention lets each token draw on other regions across the image, so features can acquire broader context without moving onto progressively smaller grids during those layers. The grid is still coarser than the input image. Finer distinctions within a region can travel in the components of its vector. To supply the decoder, DPT brings together features from several encoder stages. It incorporates a special token inherited from the classification backbone, puts the image tokens back in spatial order, and resamples their features to several resolutions. Convolutional fusion then builds a prediction from coarse features to finer ones.

The authors train the general-purpose depth predictor on a collection of about 1.4 million images and test it on datasets outside that collection. Against the original published MiDaS baseline, they report an average relative gain of more than 23% for DPT-Hybrid and 28% for DPT-Large. Both also outperform the convolutional architecture behind MiDaS when it is retrained on the expanded collection. The depth examples illustrate improvements at narrow structures and across broad regions that should have coherent depth. For semantic segmentation, DPT-Hybrid reaches 49.02% mean intersection over union on the ADE20K validation set. This metric measures how closely predicted category regions overlap the reference regions.

The authors also obtain leading results after adapting DPT-Hybrid to NYUv2 and KITTI for depth, and to Pascal Context for segmentation. The smaller datasets specialize a predictor that has already received substantial training. The encoder choice depends on the setting. DPT-Large leads the main depth comparison, while DPT-Hybrid, which draws on early convolutional features as well as transformer outputs, does better on ADE20K. The authors suggest that ADE20K’s smaller training collection may help explain this ranking. The experiments show that a common approach to reconstructing outputs from transformer features can support both continuous depth estimates and discrete category labels, with performance sensitive to the encoder and its training conditions.

Deep dive: Vision Transformers for Dense Prediction

Vision Transformers for Dense Prediction introduces DPT, which turns image patch features into detailed depth maps and pixel-level category predictions. · about 79 minutes to read

The problem and its context

The scene and its boundaries

An image classification system can produce a useful answer after identifying the dominant content of a photograph. The answer applies to the image as a whole. In dense prediction, the answer refers to a location. The system has to produce an organized array of estimates, with the position of an estimate telling the reader which part of the image it describes. A good scene-level interpretation can help produce the array, but it leaves open where each estimate should go.

Depth and semantic segmentation make this difference concrete. Monocular depth estimation uses a single image to infer the spatial arrangement of a scene in depth. It is a regression task because the quantity being predicted can vary continuously. Semantic segmentation asks which category belongs at each pixel. This makes it a labeling task with a discrete choice at each position. The decoder has to give the two outputs different numerical forms. Their common demand is for features that retain enough spatial specificity to place estimates where the evidence supports them.

A broad surface illustrates why the amount of context matters. Different parts of the surface can have different appearances and still belong to a coherent arrangement in depth. Local evidence alone may leave their relationship uncertain. Evidence from elsewhere in the image can inform how their estimates fit together. Near the edge of the surface, the decision changes. A small shift in location can cross into a different part of the scene, and a smooth continuation of the original estimate would obscure that transition.

The same distinction arises in labeling. Recognizing a category can depend on seeing more of the scene than the immediate vicinity of a pixel. Assigning that category at its outer edge can depend on a subtle difference between adjacent places. A single image can therefore call for broad agreement in some places and abrupt differences in others. The authors aim to make both kinds of evidence available while the network develops its interpretation of the image.

The standard architecture in the paper’s account has an encoder and a decoder. The encoder transforms the image into learned features, which are numerical representations that later operations can use. A backbone is the principal network used to extract those features. In dense prediction it is commonly taken from image classification and initialized with weights learned from a large collection such as ImageNet. The decoder aggregates features and expresses a prediction in the required spatial form.

This organization gives a decoder designer two resources to consider. One is the ability of the decoder to combine evidence. The other is the quality of the evidence the encoder supplies. Enlarging a feature map makes more positions available for an eventual prediction. Locating a boundary at those positions depends on the content of the features. A decoder can learn to infer detail from related clues, but its ability to use a particular spatial distinction directly depends on whether that distinction remained accessible through encoding. The paper makes this dependence a reason to study the backbone itself.

Why encoders use smaller maps

A conventional convolutional encoder processes the image as a series of spatial feature maps. A convolution applies a learned linear operation to a neighborhood and repeats the operation across the map. Nonlinear operations between convolutions allow the sequence to express increasingly complex relationships. A feature early in this sequence depends on a limited region of the input. A later feature can combine several earlier ones, each carrying evidence from its own neighborhood.

The receptive field is the part of the input that can influence a feature. A stack of local operations grows its receptive field as evidence passes through the layers. If nearby features are repeatedly combined, input regions that began far apart can eventually contribute to a common representation. This sequential route to broad context is effective. It makes the cost of developing that context depend on the number and size of the intermediate representations.

Downsampling helps keep those representations manageable. On a coarser grid, neighboring feature positions lie farther apart relative to the original image. A local filter on the coarser map can cover a broader stretch of the image than one on a finer map. The later operations also have fewer spatial positions to process. A typical convolutional backbone can therefore increase its contextual reach, develop abstract features, and limit the memory occupied by intermediate activations within the same succession of stages.

Those stages supply the decoder with a natural hierarchy of scales. They also make it harder to obtain precise spatial evidence from the deepest features. Consider a feature on a coarse grid whose input region includes an object and some of its background. The feature may be very informative about the identity of the object. The exact position at which the image changes from object to background can be harder to read from it. Later computations can build a good-looking output grid by enlargement, but the location of a boundary still has to be inferred from the information on hand.

This accounts for the different consequences of a coarse final representation in classification and dense prediction. A classifier can often use an object feature without resolving the edge that gave rise to it. A labeling decoder has to make a series of decisions around the edge. A depth decoder may have to place neighboring locations at very different estimated distances. The paper argues that the loss of granularity accumulated during encoding has a direct bearing on the errors that can occur in these outputs.

Early fully convolutional systems provide the background for this pattern. The authors point to work including OverFeat and fully convolutional semantic segmentation as predecessors of the architectures they discuss. Spatial maps carry the features through the network, and learned operations over those maps help generate spatial predictions. DPT retains maps and convolutions in reconstruction. Its change is to the process that creates the encoder features supplied to that reconstruction. OverFeat and Fully Convolutional Networks for Semantic Segmentation.

How earlier designs kept detail available

The paper describes several approaches to the tradeoff. One increases the resolution at which an image enters the network. With more samples to start from, a small structure may remain visible over more feature positions even after downsampling. The remedy depends on what the computation can accommodate. The backbone still has to process the larger representations, and its sequence of local operations still determines how widely features can gather evidence.

Another approach enlarges the reach of a convolution without changing the size of its output map at that step. In a dilated convolution, the filter takes its samples from positions spaced apart on the grid. This lets one operation draw evidence from a wider neighborhood while keeping a dense array of output positions. The paper places dilation among the ways convolutional predictors can build useful context while limiting the need to reduce spatial resolution.

Skip connections address access to information from a different direction. A decoder receives an earlier encoder feature directly, in addition to features that have undergone later processing. This path can make a relatively fine spatial map available during reconstruction even if the deepest features occupy a coarse grid. A decoder that has acquired a broad interpretation can use the earlier feature to refine where that interpretation applies. The authors cite U-Net as an example of the broader practice of using intermediate encoder stages in the reconstruction pathway. U-Net.

Earlier work also performs fusion across spatial scales or maintains several resolutions in parallel. The paper distinguishes designs in which maps are taken from different pooling stages and progressively enlarged from designs in which several resolutions continue to participate in the network’s computations. Keeping a fine map alongside coarser maps gives later stages access to both a dense array of spatial positions and features that cover wider areas.

These developments clarify what DPT takes from prior work. Direct routes from intermediate layers remain useful. A hierarchy of feature sizes still helps organize reconstruction. Architecture can give different feature sources different roles. The question DPT changes is how the encoder itself expands the contextual reach of its features. If interactions can span the image within an encoder layer, the architecture has another way to make context available on a grid whose dimensions stay fixed.

What attention changes about context

The paper situates attention in a line of work on translation, sequence processing, and image analysis. It identifies the transformer with self-attention and points to its success in natural language processing, particularly at substantial capacity and training scale. Earlier visual systems had already investigated attention in image computation. The direct precedent for DPT is ViT, which showed how a transformer operating on image tokens could be used for classification. Natural language processing, Neural Machine Translation by Jointly Learning to Align and Translate, Attention Is All You Need, and Vision Transformer.

The relevant operation takes a collection of elements and updates each element using information from the collection. In the visual encoder those elements are representations of image regions. An update for a region near one side of the image can draw on features associated with the other side. This is what gives the transformer portion of the encoder its global receptive field. It makes an image-wide interaction available in each layer after embedding.

Availability and use are distinct. A layer can place much of its emphasis on nearby regions in spite of having access to distant ones. A deeper layer can select or combine evidence over a wider area without changing the collection’s spatial organization. DPT is designed around the possibility of these different behaviors within the same grid. The ability to exchange information over the image supplies the contextual reach. The association between each token and an input region continues to supply its spatial address.

This distinction also explains why a transformer that expects a collection of vectors needs explicit information about image position. The arrangement of the regions is part of the evidence. An encoder should be able to distinguish two images whose local content is similar but whose regions are ordered differently. The learned position embeddings give attention access to that arrangement. Later, the decoder uses the association with the original regions to recover ordinary spatial maps from the updated vectors.

The authors also take a lesson about training from the earlier research. High-capacity transformers can require enough data to develop useful representations. The availability of supervision is therefore part of the case for investigating dense depth estimation. Earlier depth work had shown that multiple sources of depth data could be brought into a common training procedure if differences in representation and global scale were handled appropriately. That gives the paper a setting in which an encoder can be evaluated with unusually extensive task supervision.

What has to change when the answer is spatial

An image classification transformer supplies a special vector for an image-level decision. Because this readout token has no patch address, a decoder needs to decide whether and how to use it. Treating it as an additional place on the image grid would give it a spatial interpretation that it did not have in the encoder. Yet it may have collected useful information about the image through attention. DPT turns the decoder’s treatment of this vector into an explicit architectural choice.

The classification backbone also supplies several layers of features on a common grid. A conventional multiscale decoder expects spatial maps of different sizes. The encoder therefore gives DPT a collection of possible sources distinguished by processing depth, and the decoder needs a collection of inputs distinguished by their role in spatial reconstruction. DPT has to select the former and construct the latter. A feature’s position in the transformer and the resolution at which the decoder receives it become separate choices.

Both decisions follow from taking a previously successful encoder seriously as a source of features for a different output. A classifier can read a global representation from late in the network. A dense predictor benefits from paths that carry earlier and later features into reconstruction. DPT gives those features a spatial arrangement, changes their sizes to fit the decoder, and provides the fused result to a task-specific head. This is the architectural problem that the authors solve in addition to selecting a transformer as the backbone.

The method, step by step

From an image to a spatial prediction

DPT begins with a collection of small image representations. In the direct patch variants, each comes from a square of pixels. In the hybrid variant, the representations are taken from a convolutional feature map. Position information identifies where these vectors come from, and a separate readout vector accompanies them. The transformer layers repeatedly update the collection. Each resulting patch feature still has an address that the decoder can use.

After selected layers, DPT sends a copy of the current features towards reconstruction. It uses the readout to enrich the patch features in its default configuration, gives the features the arrangement of the original patch grid, and then produces a map of the appropriate size for that stage of the decoder. The decoder starts with coarse features and moves toward finer ones. A final head computes the output required by depth estimation or semantic segmentation.

How DPT turns image features into a dense output

The steps in order.

How DPT turns image features into a dense outputStep 1: Embed patches or features from a convolutional network1. Embed patches or features from a convolutional networkStep 2: Supply positions and a separate readout vector2. Supply positions and a separate readout vectorStep 3: Update the tokens through transformer layers3. Update the tokens through transformer layersStep 4: Take features from selected encoder stages4. Take features from selected encoder stagesStep 5: Arrange and resample them as spatial maps5. Arrange and resample them as spatial mapsStep 6: Fuse features from coarse to fine6. Fuse features from coarse to fineStep 7: Produce depth estimates or semantic category scores7. Produce depth estimates or semantic category scores

The paper uses ViT-Base, ViT-Large, and ViT-Hybrid to name the underlying visual backbones. DPT-Base, DPT-Large, and DPT-Hybrid are the corresponding dense predictors. Each DPT variant includes the feature routes and reconstruction operations needed to turn its encoder outputs into a spatial result. The authors release the trained predictors with the accompanying DPT implementation.

A grid appears at several points in the calculation. The input grid has a pixel at every position. The transformer associates a vector with each position on the embedding grid. The decoder works with several grids on which contextual features have been arranged and resized. The final grid holds the prediction. The spacing of predicted values is consequently a property of the output construction. The spacing of the tokens describes how the transformer organizes features while it is developing them.

Forming the image tokens

For the Base and Large versions, the encoder divides the input into square patches without overlap. It flattens each patch and applies a learned linear projection to the resulting vector. Flattening takes the values in the patch in a consistent order. The projection computes a new vector from those values. This produces a token of the width expected by the transformer while preserving a known association with the patch location.

The spatial dimensions of the input are written as:

H × W

H denotes the height and W the width, both measured in pixels. The multiplication sign separates the dimensions in this shape expression. The area of a square patch, in pixel positions, is:

p²

Here p is the patch side length in pixels. The superscript indicates that the patch extends p positions along each spatial axis. In the experiments the patch side length is:

p = 16

The symbol p again denotes the side length. A regular patch partition then gives this count of spatial tokens:

Nₚ = HW / p²

Nₚ is the number of input patches and therefore the number of tokens associated with image locations. H and W are the input dimensions, HW is their product, and division by p² gives the number of patch areas in the image. This expression assumes that the image fits the patch grid. The readout vector is additional to those Nₚ vectors.

The patch projection also sets the feature dimension. ViT-Base uses:

D = 768

D counts the components of each token vector. The feature values at a given address fit in this width throughout the Base transformer. ViT-Large uses:

D = 1024

D denotes the same quantity here for the Large encoder. These dimensions describe the width of the representation at an address. The number of available addresses depends on the patch size and the input dimensions.

The authors use the projection widths to explain how a representation based on patches can retain finer evidence. For example, two patches might each contain a transition from one region to another, with the transition occurring at a different point inside each patch. Their vectors can encode that difference even though each vector occupies just one address on the patch grid. A useful representation can therefore carry some information at a finer granularity than the grid spacing. Whether a particular distinction survives depends on what the learned projection and later computations represent.

The Hybrid variant obtains its tokens from a ResNet50. The embedding network produces a spatial feature map before any transformer layers run. A feature vector at a location on that map takes the place of an embedded patch. The paper gives its spatial resolution as:

1/16

The fraction describes the map’s scale relative to the input along each spatial dimension. The authors note that this grid is finer than the coarsest feature maps commonly used in convolutional backbones. Earlier Hybrid features are available on their own grids and can be routed directly to the decoder. The embedding network is based on the design described in Deep Residual Learning for Image Recognition.

The supplement specifies a pre-activation ResNet50 with group normalization and weight standardization. Pre-activation concerns the placement of normalization and activation before convolutional processing in the residual design. Group normalization works with groups of feature channels, and weight standardization concerns the weights used by the convolution. After its initial stem, the embedding network has four stages. Each reduces spatial resolution before applying residual blocks. The early outputs are useful candidates for the decoder because they were computed on finer grids than the one used to form the transformer’s input.

This choice gives the hybrid embedding network two routes into the prediction. Its later features determine what the transformer sees. Its earlier spatial features can also get to the decoder through direct connections. A change to the embedding can therefore affect the transformer’s input and the finer detail available to convolutional fusion. These distinct routes matter when comparing the Hybrid configuration with the direct patch encoders.

Adding positions and contextualizing the tokens

DPT supplies learned position embeddings so that the transformer has information about the origins of the image features. The content of a token provides evidence from its associated region. The positional part tells the network where that evidence belongs. This matters when the same kind of local appearance has a different meaning in different parts of the scene or when an update depends on the arrangement of several regions.

The readout token joins the image tokens at embedding. It is inherited from ViT’s use of a special token to form a global representation for classification. It participates during the encoder computation, with the same feature dimension as the image tokens, and has no patch associated with it. The initial collection is:

t⁰ = {t₀⁰, …, t[Nₚ]⁰}

Here t⁰ is the whole collection before transformer processing. The superscript ⁰ identifies this initial stage. The subscript ₀ identifies the readout token, and the image tokens start at the next index. The brackets in t[Nₚ]⁰ indicate that the patch count Nₚ is the index of the last patch token. Braces enclose the collection, and the ellipsis stands for the entries between the first listed token and the final one. An individual token at this stage satisfies:

tₙ⁰ ∈ ℝᴰ

The symbol n is the token index, and ∈ indicates membership in the space on the right. ℝᴰ is the space of real-valued vectors with D components. The superscript ⁰ again refers to the state before the transformer layers. The readout and the image tokens all have this common width within a chosen backbone.

Successive transformer layers update those vectors through multi-headed self-attention. Self-attention gets the features used for an update from the same collection as the feature being updated. A head supplies one set of such relationships. Several heads allow a layer to compute several sets of relationships in parallel. For an image token, the possible sources include the other patch locations and the readout. A feature can change in response to distant regions while keeping its association with the patch whose address it occupies.

The paper denotes the current collection after a layer by tˡ, where l identifies that layer’s place in the sequence. L denotes the total number of transformer layers. ViT-Base has 12 layers. ViT-Large has 24 and uses the wider patch representation. ViT-Hybrid has 12 transformer layers after its convolutional embedding. The count of patch tokens stays fixed through the transformer portion of any one forward pass.

The encoder can thus process image evidence repeatedly at the resolution established by embedding. A later vector need not represent the same kind of evidence as an earlier vector at its address. The earlier one may offer information close to the initial visual representation. More layers allow the later one to express relationships that have taken shape through successive updates. Both are accessible in principle to a decoder, even though their shapes would give no clue about which layer produced them.

Global receptive field in this description applies from the transformer’s input onward. The patch projection has to form its features first. The Hybrid variant also does convolutional computation before attention begins. Once the transformer receives its tokens, it can incorporate information across their spatial arrangement within a layer. The decoder’s design takes advantage of this contextual access while retaining the ability to read spatial evidence from selected stages.

Choosing where features leave the encoder

In the direct patch versions, the decoder receives four collections of tokens from different parts of the transformer. A skip connection gives the decoder direct access to an intermediate representation while that representation can continue through the encoder. The spatial sizes of the token collections are the same at their points of extraction. What differs is the processing each collection has undergone. DPT then assigns the earlier features to finer decoder maps and the later features to coarser ones.

The Large variant selects:

l = {5, 12, 18, 24}

The symbol l identifies the layers whose output features are used. The braces enclose the selected indices within ViT-Large. They span the sequence from a relatively early stage to the final layer. For the Base variant, the selection is:

l = {3, 6, 9, 12}

The symbol l again identifies the layer indices made available to the decoder, here within ViT-Base. A spatial token at a particular patch address can therefore enter reconstruction through several routes, with its feature values drawn from the different stages in this selection.

The Hybrid design uses a different source for the finer part of its hierarchy. The supplement denotes a ResNet stage output by RN, where N indexes the stage. R0 is the feature map produced by the earliest downsampling stage, and R1 comes from the next stage. The Hybrid decoder receives both maps. They already have spatial axes, and they provide early features computed before contextualization in the transformer. The remaining inputs are transformer outputs at:

l = {9, 12}

The symbol l denotes the selected ViT-Hybrid layer indices, and both entries refer to layers after the convolutional embedding. Their maps provide the later features of the Hybrid decoder hierarchy. Together with the two ResNet maps, they give the decoder the same overall progression from finer, earlier evidence to coarser, later evidence that the authors arrange for the patch variants.

Which layer supplies a feature and where that feature enters reconstruction are related choices. Moving a skip to an earlier transformer layer changes which representation reaches a particular fusion stage, even if the source shape stays the same. Changing the resampling operation on a fixed source changes the spatial layout seen by the decoder. DPT’s architecture makes each decision explicit. It can gather features based on how far they have passed through the encoder, then organize their spatial sizes for the process that will combine them.

Preparing the features for a spatial map

The bridge between selected transformer outputs and the decoder is called Reassemble. It applies three operations in a fixed order:

Reassembleₛᴰ̂(t) = (Resampleₛ ∘ Concatenate ∘ Read)(t)

The argument t is the token collection from an encoder layer. Read handles the vector without a patch address. Concatenate organizes the resulting patch vectors in a spatial array. Resampleₛ changes the map to the size and channel width requested by the decoder. The composition sign ∘ means that the operation farthest to the right acts first. The subscript s specifies the spatial divisor used to obtain the new map from the input image dimensions. D̂ denotes the output channel count of that map.

Read has this input and output signature:

Read: ℝ^((Nₚ + 1) × D) → ℝ^(Nₚ × D)

The letter ℝ indicates real-valued arrays, with the dimensions given in the exponent. Nₚ is the count of patch vectors and D is their feature dimension. The added 1 is the readout vector. The multiplication signs separate the token and feature dimensions. The arrow gives the direction from the incoming collection to an arrangement with only patch-addressed vectors.

The authors try several ways of producing that result. The simplest passes the patch vectors onward as they are:

Read_ignore(t) = {t₁, …, t[Nₚ]}

Read_ignore names the operation that omits the readout at this point. The collection t is its input, t₁ is the first patch vector, and t[Nₚ] is the last one. The ellipsis represents the patch vectors in between. The readout t₀ is absent from the output collection. Patch features can still reflect the interactions they had with it in the encoder, since omitting the readout here leaves those earlier computations in place.

A second choice uses the readout as an addition to each image token:

Read_add(t) = {t₁ + t₀, …, t[Nₚ] + t₀}

Read_add denotes the rule based on addition. The input t contains t₀, the readout, and the patch tokens t₁ through t[Nₚ]. The plus sign indicates componentwise vector addition. For every patch, the operation produces one vector at that patch’s address. What varies across positions is the original patch vector, with a common contribution from the readout added to each.

The default architecture uses projection:

Read_proj(t) = {mlp(cat(t₁, t₀)), …, mlp(cat(t[Nₚ], t₀))}

Read_proj names the projection rule. The collection t supplies readout t₀ and the indexed patch tokens from t₁ to t[Nₚ]. The ellipsis stands for the same calculation at intermediate patch positions. The function cat places the components of the patch and readout vectors one after the other. The paper uses mlp for the learned transformation that follows. Here it is a linear layer and a GELU activation, a nonlinear operation on the projected features. Each result has the original token width D.

Joining the vectors before applying the layer makes their components separately available to the projection. It can assign different learned weights to information coming from the patch and information coming from the readout. The readout is common to all patch calculations for the image at that stage, and the calculation also depends on the feature at the particular address. This yields a collection that incorporates image-wide evidence while leaving the number of spatial positions determined by the input regions.

The three choices all have the same signature because they solve the same geometric problem. The decoder needs a single vector for each spatial address in the embedding grid. Read controls what that vector contains. The rest of Reassemble can proceed regardless of which readout treatment is used. This organization lets the authors test the role of the classification token without changing the way the next operation places features on a spatial map.

Returning tokens to spatial order

The next operation uses the original order of the patches. If a token came from a patch near the upper edge of the image, the decoder places its vector in the corresponding row and column of the feature map. The established correspondence still applies after attention because the transformer’s updates have left the patch addresses intact. A feature can contain data gathered from distant regions and enter reconstruction at the position associated with its own patch.

The formal mapping is:

Concatenate: ℝ^(Nₚ × D) → ℝ^((H/p) × (W/p) × D)

Concatenate is the spatial placement operation. ℝ indicates an array of real-valued entries. Nₚ counts the patch positions and D is the feature width at each position. H and W give the height and width of the input in pixels, and p is the patch side length. Dividing the two input dimensions by p yields the height and width of the restored grid. The signs × separate dimensions, and the arrow points to the resulting array. Each location holds the D channels of its patch vector.

This use of Concatenate is about spatial arrangement. The cat operation in the projected readout joins feature components within a single vector. Here, the vector’s components become channels and the vectors are distributed over the image plane. Their placement gives the convolutional decoder a neighborhood structure. Features close together in the reconstructed grid correspond to nearby input regions, even if the evidence used to compute an individual feature comes from a wider area.

That property gives attention and convolution compatible roles. Attention uses relationships across regions to build a contextualized feature. A later convolution can use several nearby contextualized features to refine a spatial decision. Reassembly makes the link by recovering where on the map each contextualized feature belongs. There is no need to infer a position for the readout because Read has already distributed its contribution or omitted it.

Making the decoder’s feature scales

The reassembled grid at first has the spatial dimensions of the embedding. DPT uses a resampling layer to supply a map at the size needed by each decoder stage:

Resampleₛ: ℝ^((H/p) × (W/p) × D) → ℝ^((H/s) × (W/s) × D̂)

Resampleₛ is the operation that sets the output scale and width. H and W are the original image dimensions. The divisor p gives the input size of the map along each axis, while s gives its requested output size. D is the incoming channel count, and D̂ is the output channel count. The spaces denoted by ℝ contain real-valued arrays. The multiplication signs separate dimensions, and the arrow indicates the direction of the change.

The implementation first uses a 1 × 1 convolution to project the incoming features to the required width. This kernel covers one location, so the operation can combine channels at that location without shifting information across the grid. It is followed by a spatial operation with a 3 × 3 kernel. The spatial operation depends on the target size relative to the incoming patch grid.

s ≥ p

Here s is the target spatial divisor, p is the patch side length, and ≥ means greater than or equal to. The target is equally coarse or coarser. This branch uses a convolution, with stride used to reduce the spatial dimensions when downsampling is required. A stride determines the spacing between positions at which the filter is applied.

s < p

The symbols s and p retain the same meanings. The < sign indicates that the output divisor is smaller, so the output grid is finer than the input grid. Here the paper uses a strided transpose convolution, a learned operation used to enlarge the spatial map. Both branches work on channels already projected to the decoder’s target width.

D̂ = 256

D̂ is the default number of channels in a reassembled feature map. This width gives the decoder a common channel dimension for its features, while the choice of s decides which resolution a particular representation supplies. The Hybrid variant has earlier ResNet features that already come with spatial organization and a different origin from its later transformer maps.

The resampling step explains how DPT constructs a multiscale decoder from an encoder with a constant transformer grid. Shallow and deep feature sources differ in their contents before resampling. The spatial hierarchy emerges when each selected source is given the scale at which fusion will use it. A later feature can organize broad aspects of the prediction on a coarse map, even though the calculation that formed it operated with the same set of patch addresses as an earlier feature.

Combining maps and producing the task output

Fusion follows the feature hierarchy from coarse to fine. The authors base the fusion blocks on RefineNet. At a stage of the decoder, the incoming representation is processed with the features supplied for that part of the hierarchy. Residual convolutional units provide learned refinements. A residual unit allows an input to travel by a shortcut while a learned branch computes changes to it. The architecture can thus combine information already developed in the decoder with evidence from another encoder stage.

The decoder doubles spatial resolution at each fusion stage. Its finer stages can use higher-resolution maps drawn from earlier encoder processing. By the end of fusion, the shared feature map is at half the resolution of the input image. The task-specific head completes the route to an image-sized result. Which head is used determines whether the decoder’s features are read as a single spatial quantity or as multiple category scores.

Batch normalization in the residual units is task dependent. Segmentation uses it in the fusion layers. When it is enabled, the authors omit the bias of the preceding convolution. Depth estimation runs the decoder without batch normalization because the authors found it detrimental in their regression setup. The shared reconstruction design therefore includes a choice about feature normalization that is made separately for the two tasks.

The depth head has 3 convolutional layers. The first reduces the number of feature channels by half. The head then uses bilinear interpolation to enlarge the representation to the input image dimensions. Bilinear interpolation determines values on the finer grid from nearby values on the incoming grid. The second convolution outputs 32 channels, and the final linear projection produces a non-negative scalar at each pixel.

The scalar is an inverse-depth estimate. Inverse depth expresses distance on a reciprocal scale. Its use here also reflects how the training procedure deals with the global scale and shift of predictions. A non-negative scalar tells the reader the form of the quantity produced by the head. The training loss determines which numerical differences between the prediction and the reference matter during learning.

The segmentation head gives each pixel a vector of category scores, called logits. A first convolutional block preserves the feature dimension. The final projection uses as many output channels as there are semantic categories. For segmentation, the head predicts its logits at the decoder’s half-resolution grid, and bilinear interpolation enlarges the logits to the full output size. This puts the interpolation after the category projection, where the values being enlarged are category scores.

A separate auxiliary head receives the output of the penultimate fusion layer, the one just before the last fusion stage. Its prediction supplies additional supervision during training. The authors give the auxiliary loss a weight of 0.2. Both this head and the main head use dropout at a rate of 0.1 before the final classification layer. Dropout modifies which feature activations are used during training as a form of regularization. The main head provides the category predictions evaluated at test time.

Accepting an image of a different size

Because the patch grid is formed from the current input, its token count changes when the image dimensions change. For the embedding procedure, the spatial dimensions must be divisible by p. A transformer can operate on the resulting collection at its new length. This gives DPT a route to using the same encoder at more than one input size.

The learned positional values correspond to a particular spatial arrangement and need adjustment for a different grid. DPT follows ViT by linearly interpolating the position embeddings to the dimensions required by the input. The interpolation can be performed for each image. The resulting positional representations accompany the tokens at their new set of spatial addresses before contextual processing begins.

Reassembly then uses the current image dimensions to arrange the patch vectors, and the convolutional decoder can operate with maps of varying spatial size. The input must also align with the decoder’s stride of 32 pixels. This accounts for the decoder’s schedule of spatial changes. The architecture can process sizes that satisfy these requirements, with the positional interpolation providing the connection between the learned parameters and the current grid.

Learning across depth datasets

For depth, the authors build on the data-mixing procedure of the earlier MiDaS work. They take the collection previously called MIX 5 and extend it with five additional datasets. The resulting collection, MIX 6, contains about 1.4 million images. Among the added sources are BlendedMVS and TartanAir. ApolloScape and IRS also contribute. The authors use the mixture to train a general-purpose depth predictor before measuring transfer outside the contributing datasets.

The learning procedure has to let sources with different depth conventions contribute to the same predictor. The authors work in inverse depth and use a trimmed loss invariant to scale and shift. The loss can judge the spatial pattern of the prediction while accommodating a common factor and offset. Trimming is part of the inherited robust objective. The paper identifies it through the earlier MiDaS protocol and explains why its treatment of ambiguity is useful for combining supervision.

The objective also includes gradient matching. A spatial gradient describes how a value changes across neighboring locations. Gradient matching encourages changes in the prediction to agree with changes in the reference depth representation. Such supervision concerns where depth rises, falls, or transitions across a region. The combination of the two losses gives the optimizer information about the estimated values under the depth convention and about their spatial variation.

The authors use multi-objective optimization together with Adam. The backbone starts from ImageNet-pretrained weights and uses a learning rate of 1e-5. The randomly initialized decoder uses 1e-4. These settings give the part of the network already trained on images and the part being built for dense prediction different update scales. Supervision from the depth data then trains the whole predictor for its new output. Adam.

The depth schedule starts with 60 epochs on a curated subset. Training on MIX 6 then runs for 60 epochs. The paper defines an epoch for this procedure as 72,000 update steps, with a batch size of 16. The image preparation specifies resizing with the longer side at 384 pixels and training on random square crops of size 384. Random horizontal flips give another way of varying the input during training.

The dataset mixture also has an explicit sampling rule. The authors first draw datasets uniformly and then select examples from the chosen datasets. They use this approach because the batch size cannot be divided evenly among the data sources. Choosing a source is a separate sampling decision from choosing an image. A large component therefore does not determine the probability of selecting its source simply through the number of images it contributes. The overall collection size describes what is available, and the sampling rule describes how it is presented to the optimizer.

Preparing depth predictions for adaptation

A predictor learned with a scale- and shift-invariant objective can produce useful relative structure with an inconvenient numerical magnitude for a destination benchmark. If training immediately used a loss sensitive to that magnitude, a large global mismatch could dominate the early updates. The authors address this before fine-tuning DPT-Hybrid on NYUv2 or KITTI.

For each image in the destination training set, they run the initial network and robustly align its prediction to the reference values. This produces a scale and a shift for each training sample. The authors average these scales and shifts separately across the training set. They then apply the resulting common scale and shift to the predictions before evaluating the destination loss. The averages prepare the initial predictions for adaptation using information from the destination training set. Fine-tuning.

The adaptation uses the depth loss introduced by Eigen and colleagues. For KITTI, the authors disable gradient matching because the reference depths are sparse. A spatial-change term has a different supply of reference information when depth values are available only at selected locations. The adaptation procedure consequently brings together a pretrained relative-depth predictor, an initial adjustment to the destination’s range, and a loss suited to the available supervision.

This training alignment also has a different purpose from aligning an individual prediction to its reference for evaluation. The training procedure estimates shared parameters from training samples and uses them to adjust the predictions entering the fine-tuning objective. An evaluation protocol can instead assess a prediction under the ambiguity it is designed to allow. The two operations answer different questions about what the depth predictor has learned and how it can be used.

Learning to assign semantic categories

The segmentation runs also begin with an ImageNet-initialized backbone and a randomly initialized decoder. The primary objective uses cross-entropy to supervise the category scores. It responds to the score given to the reference category in relation to the scores available for the other categories. The auxiliary output contributes its weighted term from the intermediate fusion stage. Normalization in the fusion blocks and dropout in both heads follow the segmentation configuration described above.

The optimizer is stochastic gradient descent with momentum of 0.9. Momentum carries information from earlier updates into the current optimization step. The learning rate is 0.002 and is scheduled polynomially with a decay factor of 0.9. The decay setting governs the learning-rate schedule. The momentum setting governs how update directions are carried forward.

Segmentation uses batches of 48. The image resize setting is 520 pixels in side length, and training uses random square crops of size 480. Horizontal flips and random changes of scale provide augmentation. The range given for random rescaling is:

(0.5, 2.0)

The values 0.5 and 2.0 are the bounds on the image scale factor, with parentheses denoting the interval as written by the authors. Rescaling varies how large structures appear in the training input. The random crop supplies the square region on which that training example is presented. Test-time multi-scale inference is a further choice, made for generating predictions during evaluation.

The ADE20K segmentation training lasts 240 epochs. In the smaller segmentation study, the authors fine-tune DPT-Hybrid on Pascal Context for 50 epochs, keeping the other segmentation hyper-parameters. The architecture continues to develop contextual features, arrange them on maps, and fuse them over several resolutions. The supervision, category head, and choice of inference procedure specify how those features are assessed in the labeling task.

Experiments and results

The comparisons and what they measure

The principal depth comparison asks whether a predictor trained with a large mixed collection can estimate depth on datasets outside that collection. The smaller benchmark comparisons ask how well the trained representation adapts when destination supervision is provided. The segmentation experiments measure spatial category predictions after training for that task. Each answers a different question, even though the experiments use the same overall approach to encoding and reconstruction.

The paper uses two versions of the convolutional depth comparison for distinct purposes. The published MiDaS system gives a reference against which the authors state relative progress under the earlier cross-dataset evaluation protocol. A retrained version of its fully convolutional architecture shows what happens when that alternative receives the enlarged training collection. The comparison against the original sets the numerical reference. The comparison with the updated baseline addresses how much can be explained by DPT’s access to the extra data.

The authors also look at sample predictions. An aggregate error can establish improvement across a benchmark, while the examples give particular places to look for it. In depth these places include narrow structures and broad, fairly uniform regions. For segmentation they include the edges of category regions and areas that can be broken up by inconsistent labels. The images help relate the scores to the type of spatial improvement the architecture was designed to support.

Depth on datasets left out of training

The paper follows the earlier MiDaS protocol for zero-shot cross-dataset transfer. Here zero-shot means that the target datasets did not contribute to the depth training mixture and that the predictor is evaluated without first adapting to them. A successful prediction must use the visual and geometric relationships learned through the mixed supervision. This tests generalization across data sources, which is the aim of the general-purpose depth configuration.

The underlying depth measures are errors, for which lower values are better. The paper summarizes the comparison through relative improvement against the original MiDaS results. DPT-Hybrid shows an average relative gain of more than 23%, while the results discussion reports 28% for DPT-Large. The percentages refer to the evaluation across held-out depth datasets under that protocol. They express a comparative gain and have a different meaning from an error reported for one particular reference dataset.

Average relative gain over published MiDaS on held-out depth datasets

DPT-Large leads the reported transfer comparison, and DPT-Hybrid also improves substantially over MiDaS.

Average relative gain over published MiDaS on held-out depth datasetsDPT-Hybrid, reported as greater than the plotted value: 23DPT-Hybrid, reported as greater than theplotted value23DPT-Large (this paper): 28DPT-Large (this paper)28
The numbers
System or settingaverage relative improvement %
DPT-Hybrid, reported as greater than the plotted value23
DPT-Large (this paper)28

The Hybrid label identifies its plotted value as a bound. The paper’s wording establishes that its average gain exceeds that value. The chart shows these gains in the direction in which a larger gain is preferable. The benchmark metrics summarized by those gains are reported as errors. That distinction matters because the very same system can have a smaller error and a larger improvement relative to the reference.

The comparison includes transfer beyond the sources that provided the training examples. An ordinary validation split from a training source can retain properties of that source’s images and references. The cross-dataset protocol asks what happens when the predictor is applied outside the collection of contributing sources. The size and variety of MIX 6 define the opportunities the systems had for learning. Holding out entire evaluation datasets gives the resulting estimate of transfer its meaning.

What changes when MiDaS gets MIX 6

The authors retrain the convolutional architecture behind MiDaS on MIX 6. It improves over the original. This establishes that the expanded training data benefit the convolutional alternative as well as providing the conditions for DPT’s main experiment. Both DPT variants still score better than the retrained comparison. The advantage therefore survives a comparison in which the convolutional system has access to the enlarged collection.

The result supports an architectural contribution at the level of the complete predictor. The encoder family determines how features are formed, contextualized, and passed forward. DPT also supplies a particular interface from those features to its decoder. The retraining comparison holds the enlarged training resource in common. Its purpose is to test the explanation that the published-baseline gain could be accounted for entirely by giving DPT more task supervision.

The capacity comparison adds detail. DPT-Hybrid is comparable to MiDaS in capacity according to the authors. The large configuration is about 3 times as large as MiDaS. The Hybrid result shows a gain for a system closer in size to the convolutional baseline, while the Large result shows the strongest reported transfer performance with additional capacity. Both are relevant to evaluating the design. They offer different evidence about what can be achieved at the available parameter scales.

The authors interpret the enlarged-mixture experiment as evidence that DPT uses the added training opportunity effectively. The baseline’s own improvement is important to that account. It confirms that the new data helped even when the backbone stayed convolutional. DPT’s stronger result against that updated system shows that performance depends on how the predictor processes the images and supervision, as well as on receiving the enlarged collection.

Where the depth maps look different

In the qualitative comparisons, the authors point to broad homogeneous areas where the convolutional prediction is less coherent. One example concerns sky. An area like this can extend across a substantial part of the image while providing relatively few local changes from which to infer a sensible variation in depth. The DPT examples show estimates that agree more consistently over such regions. They also illustrate improved relative placement of parts of the scene when that placement depends on a broader view of the image.

A narrow tree branch presents a different spatial problem. Its predicted depth has to be distinguished from what appears immediately behind it. If the estimate passes smoothly across that location, the region occupied by the branch can disappear from the depth map. The paper shows examples in which DPT preserves such fine structure more clearly. The result can matter at a small number of positions even when much of the surrounding image looks similar between predictors.

The supplementary examples compare DPT and MiDaS at the same input setting of 384 pixels. Both receive the same resolution in those comparisons. The visible gain in fine detail can therefore arise from how the predictors represent and reconstruct features at that setting. Greater input resolution is unnecessary to account for the difference shown in those examples.

The authors also observe that especially large transfer gains occur where evaluation uses dense, high-resolution depth references. Such references make fine spatial discrepancies available to the error calculation across more of the image. The authors suggest that DPT’s better detail could help explain the pattern. They use the additional images to illustrate the kinds of regions in which the difference is visible. The benchmark comparisons measure whole-prediction performance and the examples locate particular consequences in recognizable scenes.

The coherence and detail observations are complementary. A cleaner depth description over an extensive region can improve the estimated geometry over much of an image. Preserving a narrow feature can improve the spatial precision of the map even though its extent is limited. The architecture supplies image-wide contextual access and features from several processing depths. The qualitative comparisons describe output behavior consistent with using those sources for both kinds of decision.

Depth on NYUv2 and the KITTI Eigen split

The smaller depth studies take DPT-Hybrid and adapt it using destination training examples from NYUv2 and KITTI. These tests concern supervised specialization. Compared with the zero-shot procedure, the destination images and their labels now supply learning signals. They also provide the scale and shift estimates that prepare the initial predictions for the destination loss.

For KITTI, the evaluation follows the Eigen split. The configuration omits gradient matching during adaptation because the dataset provides sparse depth references. NYUv2 supplies the other smaller depth comparison. The authors report that the adapted predictor matches or improves the leading results across the measures considered on each dataset. This establishes that the general-purpose depth representation can be put to use in these supervised benchmark settings.

The training preparation is part of what the smaller comparisons demonstrate. The starting predictor has learned under a loss that tolerates differences in global scale and shift. Aligning it on the destination training samples places its output in a suitable range before task-specific optimization proceeds. This allows the experiment to test how well prior depth learning can be transferred. It also explains why small destination data and large prior training are compatible descriptions of the same result.

The characteristics of the reference labels help determine what supervision the adapted system can use. For KITTI, the authors change the loss to fit the sparse measurements. In both studies, the network’s features come from the same broad depth preparation, with its final behavior adjusted to the destination. The performance belongs to a concrete adaptation procedure whose steps account for the original depth ambiguity and the available form of ground truth.

Region agreement on ADE20K

For semantic segmentation, the paper evaluates predictions using both pixel accuracy and mean intersection over union. Pixel accuracy, abbreviated pixAcc, measures how often the predicted category agrees with the reference at an evaluated pixel. Intersection over union, or IoU, compares two regions for a category. The intersection contains locations where prediction and reference both assign the category. The union contains locations assigned to the category by either. The mean measure, mIoU, averages the resulting category scores.

The measures see different aspects of the label map. Pixel accuracy gives an error at any evaluated position where the label is wrong. The mean overlap measure summarizes agreement category by category. If the predicted extent of a category crosses its true boundary, the extra area adds to the union without adding to the intersection. Leaving out part of a reference region likewise reduces agreement. This makes the overlap measure relevant to the paper’s focus on the shapes and boundaries of semantic predictions.

The authors train on ADE20K for 240 epochs and evaluate on its validation set. DPT-Hybrid achieves 49.02% mIoU, the paper’s headline segmentation result. It ranks above the fully convolutional approaches in the comparison. DPT-Large performs slightly worse than DPT-Hybrid. The segmentation scores reflect the authors’ use of multi-scale inference, so they describe validation performance under that evaluation procedure.

The change in ordering relative to the depth comparison is informative. In the large-scale depth setting, DPT-Large leads the reported transfer results. On ADE20K the Hybrid configuration leads the Large one. The authors suggest that the smaller amount of training data for segmentation may help explain its outcome. The two studies also change the targets and the learning procedure. The measured ranking is specific to each setting, and the difference gives a concrete instance in which the variant with more capacity does not give the stronger score.

The qualitative segmentation examples show clearer delineation along some object edges and less clutter in some predictions. A better boundary places a change of category closer to the change in the image that it is meant to describe. Reduced clutter can make the prediction in a region agree more consistently with the category of that region. Either change can improve overlap, depending on how the predicted region compares with the reference. The illustrations show these forms of improvement directly, while the validation score combines their effects with the other label decisions.

Segmentation after adaptation to Pascal Context

The Pascal Context experiment asks how well the segmentation approach carries over to a smaller destination dataset. The authors fine-tune DPT-Hybrid for 50 epochs with the other segmentation hyper-parameters retained. They assess the resulting label maps on the Pascal Context validation set. The paper reports a leading result in that comparison and shows examples from Pascal Context alongside the ADE20K examples.

The adaptation gives the decoder a new set of supervised images for its category output while retaining its way of combining contextual and spatial features. This is useful evidence about reusing the segmentation architecture, since the destination experiment evaluates a trained predictor after specialization. The result measures performance with the benefit of earlier learning and the retained training recipe.

The ADE20K and Pascal Context experiments have complementary roles. The main ADE20K run tests the architecture against established convolutional predictors under a competitive segmentation protocol. Pascal Context tests transfer to a smaller segmentation collection through further training. Depth adds a separate output type to the evidence. DPT’s architecture can support both tasks while giving the heads, losses, and adaptation procedures the freedom to reflect the particular targets.

Inference time and the comparison in practice

The latency experiment uses square inputs 384 pixels wide and averages timings over 400 runs. The processor is an Intel Xeon Platinum 8280 running at 2.70GHz. It has 8 physical cores in the measurement setup. The accelerator used for the test is an Nvidia RTX 2080. On this workload, the authors find comparable inference latency for DPT-Hybrid, DPT-Large, and the convolutional architecture underlying MiDaS.

The Large result is notable in relation to its parameter count. The authors explain the measured speed by pointing to the parallel computation exposed by its width and comparatively shallow structure. The amount of learned capacity and the elapsed time therefore offer different descriptions of the same predictor on this hardware. The chosen input shape and execution setup define the workload for which the timing evidence applies.

In the depth experiment, the Hybrid variant improves transfer over MiDaS at comparable capacity and with similar measured latency. The Large variant supplies the strongest reported transfer result and remains competitive in the fixed-size timing test despite its larger capacity. On ADE20K, Hybrid gives the stronger validation result. Taken together, the measurements show why the paper presents the variants in terms of the task, training collection, and evaluated workload. Those conditions determine what the additional encoder capacity delivers and how it affects the comparison with the convolutional alternative.

What the ablations show

A validation experiment for choosing the decoder’s inputs

Several of DPT’s design decisions arise at the point where the encoder hands its features to the decoder. A transformer gives the designer many candidate outputs with the same spatial dimensions. Some come from early in the calculation and some come from much later. There is also a vector that can participate in all of those stages but has no position of its own in the image. The authors use a smaller depth experiment to decide which features to collect and how to incorporate that extra vector. They also compare backbones and examine how trained predictors behave when the dimensions of the input change.

The architecture comparisons use three sources chosen for the quality of their depth supervision. Together they contain about 41,000 images. The authors hold out a portion from each source, obtaining about 1,000 validation images in total. They follow the depth training protocol and hyper-parameters already described, with ViT-Base as the default backbone when the comparison permits it. The validation data in this experiment come from the same sources as the reduced training mixture. That makes the study a way to compare architectural choices on held-out examples from those sources. The main transfer experiment, which holds out entire datasets, addresses generalization at the level of the data source.

The measure used for these comparisons is relative absolute deviation after affine alignment to the reference. An affine adjustment allows a common scale and a common shift. Once those have been accounted for, a prediction can still disagree with the reference because its estimates vary incorrectly within the scene. Imagine a predictor that gives plausible depth to a large surface but makes a small piece of foreground appear to belong to it. A common adjustment of the whole output leaves the relationship between that foreground piece and the surface substantially as the predictor gave it. The aligned comparison remains sensitive to errors in those relationships.

This choice of measure fits the design of the mixed-source training objective. The authors want to compare the spatial estimates the configurations develop while allowing for the global numerical ambiguity that the objective was built to accommodate. The error consequently speaks to the quality of the spatial prediction under alignment. A reader interested in whether the raw outputs already use a particular scale would need a different measurement. In the ablations, the ability to place parts of the scene in agreement with their depth references after adjustment is the common basis on which design choices are judged.

The comparisons vary different kinds of choices. Changing the encoder layers from which features are taken examines the routing of information within a design. Changing the readout rule examines the interface through which a specific vector reaches the decoder. Substituting an entire backbone can alter its capacity, its way of embedding the image and its preparation before depth training. The inference-resolution study changes the workload presented to a trained network. Each result is most informative about the particular decision the authors varied.

Choosing layers when the grid stays the same

A designer working with a conventional backbone can use changes in spatial size as a first guide to the available encoder outputs. A reduction marks a point where the network has moved to a different grid. In DPT’s patch-based transformer, there is no such event inside the encoder. The output of an early layer and the output of a deep layer have corresponding spatial addresses. Reassembly can make either one fit a chosen decoder slot. Merely inspecting the shape of a tensor therefore provides little guidance about whether it will offer the right evidence for that part of reconstruction.

The authors compare different placements of the direct routes from transformer layers to the decoder. The favorable configurations collect features at both shallow and deep stages. In their interpretation, earlier stages offer useful low-level evidence, and later stages offer features that have undergone more extensive processing. The chosen combination yields better aligned depth predictions in the validation experiment. That outcome is the reason the authors retain a spread of layers in the subsequent experiments.

An earlier feature already contributes to the later layers through the ordinary encoder computation. Giving it a direct route to fusion changes how the decoder can use it. A deep layer has transformed the earlier evidence to support its own representation. If an early distinction survives there in an altered form, the decoder has to learn to read that form. With a skip connection, it can also use the earlier representation directly. The difference is akin to being able to consult a preliminary description alongside one that has already combined its evidence with many other observations.

For instance, consider a patch where a local appearance changes abruptly. An early representation might express details of that transition that are valuable when locating it. Later processing can help determine whether the transition belongs to a significant depth change. These are possible uses of the available features. The ablation measures the value of the chosen combination for the prediction, so it cannot assign a particular contour or depth relationship to a specific layer. Its result supports the availability of earlier features alongside the contextual features developed later.

What the skip comparison changes is the source of the representation supplied to part of the decoder hierarchy. The feature can arrive at the requested decoder resolution whether its source lies early or late in the transformer. The shape of the received map therefore need not reveal how far the underlying representation traveled through the encoder. This is why the experiment matters even though DPT already has a procedure for constructing maps at suitable sizes. An appropriate map size makes fusion possible. A useful source makes that map informative.

The assignment of earlier outputs to finer maps is part of the configuration in which the stage selections are used. An early feature can contribute to decisions taken at the finer end of reconstruction while the deeper features help organize the interpretation at coarser scales. The reported comparison favors a particular use of processing depth within this arrangement. It leaves open how the same intermediate representations would fare if distributed differently across decoder scales or if a different fusion design consumed them.

There is a further implication for understanding the encoder. If all stages produced practically interchangeable spatial evidence, replacing an early decoder input with a later one could have little effect while its target size stayed fixed. The observed advantage of mixing depths shows that this interchangeability is too strong an assumption for DPT. A constant grid describes the places at which the features are stored. The skip experiment demonstrates that processing history affects what a decoder can do with features stored at those places.

What the early convolutional route contributes in Hybrid

The Hybrid variant gives the authors a choice unavailable in the direct patch encoders. Before the transformer runs, the embedding network has already computed features at several stages. The decoder can take some of these directly. Alternatively, it can receive its features from transformer layers, including layers relatively close to the point where the embedding network supplies the initial tokens. The comparison tests whether those later features are sufficient for the finer decoder inputs under the authors’ depth protocol.

The depth validation favors access to the early convolutional maps. The paper labels them R0 and R1. R0 comes from the earliest reduction in spatial size within the ResNet stages, and R1 is its counterpart at the next stage. These maps enter the reconstruction pathway alongside outputs from later transformer processing. The authors adopt this feature selection for the subsequent Hybrid experiments.

The result distinguishes the functions of the ResNet more precisely than a comparison between Hybrid and Base alone could. In Hybrid, a later ResNet map prepares the collection on which the transformer operates. The ablation concerns the additional use of earlier maps by the decoder. When those maps help, there is an empirical reason to preserve the direct path as part of the architecture. The benefit of using the ResNet in this configuration consequently includes the evidence made available at multiple points in its convolutional computation.

Earlier ResNet maps have spatial sampling and processing histories of their own. Compared with the map used for the transformer’s input, they come from earlier stages, before further reductions and transformations have taken place. A finely sampled feature may help the decoder position a change in depth. A later feature can help establish the significance of that change within the scene. This explanation is consistent with the design and the measured gain. The ablation evaluates the resulting depth estimate and leaves the contributions of individual visual properties, such as edge location or surface texture, unresolved.

There is a useful distinction between access to the input and access to a particular representation of it. The later transformer features are influenced by the input regions from which the early maps were computed. The early maps nonetheless offer the decoder evidence in a form that has undergone fewer changes. Their benefit illustrates why a powerful contextual encoder can still gain from direct access to upstream features. The accuracy result is about the combination of feature routes, even though all routes ultimately start from the same image.

This comparison also narrows the interpretation of the Hybrid backbone’s performance elsewhere in the paper. Its early maps are active ingredients of the tested dense architecture. Treating Hybrid as just a transformer that receives a different kind of embedding would miss the direct influence those maps have on reconstruction. Conversely, the improvement from the direct paths is measured within the Hybrid design. It gives no separate estimate of what the early convolutional maps would achieve with different transformer outputs or with an independently redesigned decoder.

Whether the decoder benefits from the readout

The readout comparison holds the spatial problem fixed. Each rule has to produce a collection with one vector for each image region. The authors vary what the decoder gets from the extra token when constructing that collection. One option passes along the patch features alone. Another adds the readout vector component by component at every patch. The third gives a learned layer both a patch vector and the readout as jointly available inputs. All three outputs can be laid out on the same spatial grid after this operation.

Leaving out the readout at this interface gives good depth performance. This result has a precise scope. The token still participates in the transformer, where its interactions can affect the patch vectors. The decoder simply receives those patch vectors without a further contribution from the readout. The comparison shows that the spatial tokens produced by the encoder already give reconstruction a strong starting point. It does not test an encoder whose readout was removed from all of its attention calculations.

Adding the readout produces worse results than omitting it at reassembly. That is a consequential distinction between two ways of supplying exactly the same number of spatial vectors downstream. Addition gives the two contributors to a component a fixed relationship. At a given feature index, the patch value and the readout value reach the next operation through their sum. The same readout contribution is used at every patch. Shape compatibility makes this operation feasible, but it puts a strong restriction on how the two representations enter the decoder.

Projection gives the best average result of the tested rules, by a slight margin over omission. The joint vector keeps the readout and patch components individually available to the weights of the learned layer. A projected feature can depend heavily on the patch, heavily on the readout, or on a combination of the two. The output also passes through the activation that follows the linear projection. Since different patch vectors enter the calculation at different positions, the same readout can have a different effect on the resulting features across an image.

The comparison gives a specific reason for including projection in the default architecture. It shows that the readout is useful through the tested learned interface, while the quality of a simpler injection can fall below the performance already obtainable from the patch vectors. The slight average margin over omission also bounds the size of the conclusion. The central reconstruction pathway already works with spatial tokens alone at its input. Projection improves that pathway in the validation experiment and is carried into the main configurations.

A closer reading separates the measured advantage of the whole projection from possible explanations for it. The projected rule has learned parameters and can alter the spatial feature as well as incorporating the readout. The reported alternatives do not include a corresponding learned transformation applied solely to the patch vectors. Thus the observed gain does not give a separate numerical attribution to the readout’s contents, the extra transformation, or their interaction. The paper establishes a preference among practical rules for the interface.

The difference between omission and addition also makes the result informative independently of projection. The omitted-readout case allows patch features to retain their existing form at reassembly. The addition case requires all patches to accommodate a common change before the decoder can process them. A global token can therefore carry potentially useful information while a particular operation for supplying it produces a poorer downstream representation. Taken together, the two results explain why the authors assess the interface itself as a design choice.

Backbone comparisons at different capacities

Changing the backbone affects a larger portion of the predictor. The authors compare how several encoders work within the depth architecture, including the convolutional backbone associated with the original MiDaS system. Among the tested alternatives in the reduced depth study, ViT-Large yields the best validation performance. Its parameter count is close to triple the count of either the Hybrid or Base encoder. The comparison gives evidence about the performance available at that capacity with the rest of the DPT pathway in use.

The two smaller transformer backbones give a more direct comparison at a similar parameter scale. Hybrid attains better depth validation results than Base, and its performance is reasonably close to what the Large encoder achieves. These outcomes motivate the authors’ description of Hybrid as a useful balance of capacity and accuracy. The Hybrid configuration includes both a different embedding and a different selection of sources for the decoder. The favorable result therefore belongs to its way of gathering and routing features as well as to the available parameter budget.

The comparison with ResNext101-WSL helps place Base’s performance in context. The convolutional encoder was pretrained with weak supervision on a billion-scale corpus in addition to its ImageNet preparation. The earlier depth work had found this preparation beneficial. Its performance in the ablation thus comes from a backbone that already has a substantial source of useful visual training. It is an especially relevant reference because it corresponds to the architecture behind the published MiDaS predictor.

Plain ViT-Base performs at a comparable level to this convolutional encoder in the paper’s depth ablation. Hybrid and Large yield better results, even though their pretraining used considerably less data than the weakly supervised convolutional alternative. The distinction among the transformer variants matters. Base establishes that the patch-based route can compete in this setting. The stronger showing of the other backbones depends on their particular configurations. The experiment gives an ordering among concrete pretrained encoders and their associated decoder inputs.

Parameter matches also answer different questions depending on which systems are compared. The Hybrid–Base comparison gives evidence that a change to the feature pathway can be valuable without the increase in size associated with Large. The Large result shows what choosing the wider, deeper transformer can deliver in this study. Comparisons with the convolutional reference carry a further difference in pretraining. Reading all of them as estimates of the effect of a single architecture decision would give the rankings a precision they cannot support.

The validation measure is held common within the depth study, so these performance differences are meaningful for the aligned estimation problem. The work required to reach a particular score is a separate consideration. Parameter count says how much learned capacity the selected backbone has, and the latency study addresses execution under a particular workload. A similar parameter count between two options gives the capacity comparison its force. It does not specify whether both options make the same use of time or memory.

How better preparation reaches the spatial output

The paper also compares ViT-Base with a variant prepared through a more data-efficient classification training procedure. The ordinary DeiT-Base architecture matches ViT-Base. The distilled version used in the comparison introduces an additional distillation token, associated with its earlier training. DPT leaves this extra token out of Reassemble. The decoder still receives spatial features through the same general interface. Training Data-Efficient Image Transformers & Distillation Through Attention.

The distilled configuration improves depth validation performance over ordinary ViT-Base. This is evidence that useful changes in the encoder’s preparation can reach the depth output without adding a new kind of decoder input. A patch vector made available to the decoder can reflect what the backbone learned during classification training. Distillation can therefore affect the prediction through the quality of the features Reassemble already handles.

The evaluation does not need to read the extra token directly to find a difference. Omitting it from the adapter removes it as a separate decoder input. Any effect of the preparation on the features that do travel to the decoder remains available. This is the same broad distinction that matters for the ordinary readout. An element can participate in the production of a spatial feature without appearing as a separate entry on the spatial map.

The comparison has practical meaning for the architecture because the decoder can work with features from successive improvements in backbone preparation. It also qualifies what can be inferred from the ordinary Base result. Base’s ranking reflects both its architectural form and the features acquired through its initial training. A related backbone at the same general scale can become more useful to the depth predictor when that preparation changes. The paper finds this for the distilled configuration as tested, including its difference in token structure.

A more detailed account of the improvement would require following changes in what the spatial features represent. The paper reports the downstream validation effect. It gives grounds for including the pretraining procedure when identifying the encoder used in an experiment, even when the main feature dimensions and reconstruction operations look familiar. Architectural specifications tell the reader what calculations are available. The training history helps determine what those calculations supply to the decoder when it receives an image.

Testing what happens beyond the training resolution

The authors investigate another consequence of having image-wide connections in every transformer layer. A conventional convolutional encoder starts with local operations. Increasing the resolution at which the same image is presented changes how much of a scene structure fits into an early receptive field. The authors conjecture that DPT may be less sensitive to such a change because its transformer can continue to access the entire collection of image tokens. The question is whether that structural property is accompanied by greater prediction stability in a trained system.

The study uses the depth training resolution of 384 × 384 pixels as its reference. The authors evaluate with larger inputs and express the relative loss in performance with respect to inference at the reference resolution. Smaller losses on that comparison indicate that a predictor better retains its own performance as the input grows. DPT’s tested variants lose performance more gradually than the convolutional alternatives in the study.

Basing the calculation on each predictor’s performance at the reference size is important. A system that changes relatively little under enlargement could still start from an accuracy level different from another system’s. The study asks about the change from each starting point. Its result belongs alongside the absolute comparisons in the main depth evaluation. The two forms of evidence together let a reader distinguish a stronger initial result from a more stable response when the input scale is changed.

Enlargement alters several parts of the computation. There are more spatial tokens. The position embeddings have to fit a new grid. Reassembly and fusion receive different spatial sizes. The global attention mechanism still has access to positions throughout the enlarged image. The measurement consequently supports the authors’ conjecture about DPT’s overall behavior, while the explanation that attention accounts for that behavior remains an interpretation of the full-system comparison.

The scenario also differs from supplying more spatial detail to one predictor in an otherwise fixed comparison. Here the input size itself is the variable being tested, and the reference point is the size on which training took place. More samples can make a structure more visible in the input while changing the scale at which the trained computation encounters it. The error response captures the outcome of those influences together. The improvement the study establishes is greater tolerance of the tested increases, measured as a smaller relative deterioration.

Where the learned attention is concentrated

The supplementary attention maps offer a way to inspect how global access is actually used. The authors take the Large and Hybrid depth predictors and select tokens corresponding to opposite corners, at the upper left and lower right. For each reference token they visualize its attention to positions across the image at different depths in the encoder. The plotted values are averages across 12 attention heads. A map therefore shows the spatial distribution of the aggregate emphasis for a particular reference and layer.

Early layers in the examples tend to concentrate attention nearer the reference position. At later stages, there are frequent instances of attention spanning much more of the image. This pattern makes the meaning of a global receptive field concrete. The architecture offers direct access to distant tokens. A shallow computation can still put much of its weight on a nearby portion of that field, and the relative use of near and far positions can develop further through the encoder.

The examples give some context to the skip results. Two layers can work on the same addresses and differ perceptibly in how they draw on evidence across those addresses. A local concentration in shallow attention and a broad distribution in later attention are compatible with the authors’ interpretation that those layers supply different kinds of features. The validation error from the skip experiment measures the consequence of delivering several such representations to the decoder. The maps concern the behavior of selected layers and tokens in individual depth examples. They support the interpretation at a different level.

An average across heads is also a particular kind of observation. It can be broad because individual heads each distribute attention widely, or because their concentrations differ geographically. A selected patch may have a distinct relationship with another location in one head, and that relationship can be difficult to see in the average. These figures give a view of aggregate spatial emphasis. Their contribution to understanding the encoder is greatest when the reader keeps the reference positions, chosen images, and averaging procedure in view. Interpretability.

The weights in these figures also have a narrower meaning than the importance of a region to the final prediction. Attention is one part of the computation of features, and the decoder receives evidence from multiple stages. A weight can help describe how a particular update uses available information. Determining what would happen to the output if a specific relationship were changed would take an intervention in the computation. The displayed examples support a description of learned spatial behavior, with the consequences of individual relationships left unmeasured.

How segmentation gains are distributed across labels

The supplementary segmentation analysis asks how the improvement in region overlap is distributed across the ADE20K validation categories. The authors compare IoU separately for the categories with the baseline from Zhang and colleagues. They see a general tendency for scores to improve. They report no clear pattern among categories that would identify a distinctive set of labels as the beneficiaries of the new architecture.

This analysis gives the headline mean a more specific context. A gain in mean overlap can come from strong changes for a small set of labels, smaller changes for many labels, or a mixture of gains and losses. Looking at separate scores lets the authors comment on the broad direction across categories. The absence of a strong pattern is also informative. It gives little support to an explanation in which a readily identifiable class of objects accounts for the improvement.

The per-category measure still combines several possible sources of error. A predicted region can include extra pixels around its edges. It can omit part of the reference region. It can also assign an incorrect label to an area inside an otherwise plausible extent. All can affect the overlap for a category. The reported category comparison measures how well the predicted regions agree overall. The sample segmentation images illustrate more specific behaviors, such as clearer boundaries, without partitioning the category scores into contributions from those behaviors.

The paper’s most controlled component comparisons are on depth estimation. The ADE20K category analysis supplies a different kind of evidence about the architecture as used for segmentation. It examines which labels benefit in the reported validation results. It leaves unanswered how the choice of readout, the position of the skips, or the scale of the features would individually affect each category. The ablations and the category analysis are informative about different aspects of the same dense prediction design.

Limitations

What the authors say about data and capacity

The authors make ample training data a condition in their account of DPT’s strongest performance. The general-purpose depth experiment gives the transformer a substantial mixture after image-classification pretraining and an initial period of depth training on curated data. This is the evidential setting for the paper’s strongest case for the Large encoder. The smaller destination studies establish a related ability to specialize a network whose representations have already developed through earlier training.

The authors use qualified language about the effect of dataset size on ADE20K. They suggest that the smaller task collection may help explain the stronger showing of Hybrid there. Their two leading task experiments differ in what must be predicted, how the prediction is supervised, and how the network is optimized and evaluated. The difference in the variant ranking is a result. Assigning that difference to the quantity of training data is a hypothesis. A comparison across data quantities within a common task, with a common procedure and closely matched training conditions, would address that hypothesis more directly.

The nature of the extra data is also relevant. The mixed-source depth collection changes the range of supervision available as well as its amount. The components come from several sources, and their contributions during optimization are governed by the source-sampling rule. The common representation and objective make the different sources usable together. A reader can therefore attribute the reported outcomes to training on the expanded mixture under the specified procedure. An image count alone supplies too little information to predict the same benefit from another collection.

The comparison in which the convolutional network receives the expanded mixture is an important control. It establishes that the DPT advantage persists after the baseline has access to the added training material. It permits a causal statement about the adequacy of a particular explanation, namely that extra exposure on its own is insufficient to account for the remaining ranking. Estimating how the relative performance of the two architectures develops with progressively greater supervision would require a series of matched data conditions. The smaller diagnostic study serves the choice of components and uses its own validation arrangement. It supplies little direct evidence for a curve relating size of training collection to transfer performance.

Fine-tuning on a smaller collection also leaves a careful-reader limit on claims about data efficiency. The destination training can be small in relation to the depth mixture and still receive the benefit of well-developed features. The adaptation demonstrates that those features can be made useful for images and targets from another collection. Learning the same predictor with only the destination supervision is a different experimental condition. The paper’s positive result concerns gains available when a substantial starting representation can be carried into a smaller task.

The pretraining ablation shows why the resources preceding task training belong in this account. Encoders prepared with different procedures can deliver different depth results even when the decoder interface is much the same. The convolutional reference also comes with extensive weakly supervised preparation. In a comparison intended to identify a good downstream backbone, these are meaningful properties of the candidate encoders. In a comparison intended to assign the effect solely to their computation after initialization, they are variables that would need tighter control. The paper gives the stronger evidence for the first purpose.

The authors’ qualification about depth values

The training objective explicitly accommodates a global scale and shift in the depth representation. The authors point out that the resulting predictions can have magnitudes far from those of the destination references. The freedom to use a different overall scale helps multiple sources provide supervision for the spatial structure of depth. It also means that the raw numerical output needs interpretation in light of the training objective.

There are distinct consequences for evaluation and adaptation. In the reduced depth validation study, affine alignment allows the prediction and reference to be compared after adjustment. A system can therefore score well by getting the spatial arrangement right under that transformation. Such a score gives limited evidence about the initial numerical range of its output. A task that needs depth values in a particular convention asks for a further property, and the relative-depth objective gives the general-purpose network freedom in that respect.

In the fine-tuning studies, scale and shift are estimated using the destination training set. The authors average the estimated parameters and use the averages to make initial outputs more compatible with the destination loss. This is a step in the supervised procedure. It helps avoid beginning adaptation with an error dominated by global magnitude. Its success depends on the availability of destination training references and is measured through the adapted depth results.

The averages have a particular purpose within that recipe. A shared transformation can make the overall range of outputs more suitable for optimization without being the best adjustment for every training image. The subsequent updates to network weights can continue to shape the prediction for that dataset. The paper’s fine-tuning results thus support the combined procedure of initial alignment and learning. They do not separately establish the accuracy of applying the average adjustment as a complete solution for new scenes without further adaptation.

A second explicit qualification arises from the sparsity of KITTI’s reference depth. The authors change the loss there by omitting gradient matching. The available references therefore determine which spatial constraints enter the destination training. Because the outputs are dense, it is easy to overlook this difference between the form of a prediction and the form of the supervision behind it. The reported benchmark result is evidence for the predictor under the available annotations and the specified loss. A comparison focused specifically on unmeasured spatial structures would require reference evidence that can register those structures.

How much information a stable grid guarantees

The architecture description separates the transformer stages from the embedding that precedes them. Constant spatial sampling applies within those transformer stages. The first operation in a patch encoder has already collected a region’s values into a vector at a single location on its new grid. In Hybrid, spatial resolutions have changed during the convolutional embedding. The paper argues that useful pixel-scale information can be retained within the feature channels and made available during reconstruction. That is a claim about a representational possibility.

A careful reader can draw a stronger distinction between the features having room for detail and a trained network actually keeping a usable record of it. The same grid address can hold a vector encoding the exact position of a change within the associated patch, or it can hold a vector that chiefly identifies what is present there. Both vectors fit the shape expected by the transformer. The stable grid allows downstream layers to refer to the same patch position. It places few restrictions on which distinctions the learned vector continues to express.

The paper’s embedding dimensions support the argument that a patch can carry informative internal structure. The experiments demonstrate that selected fine details appear more successfully in DPT predictions. Neither form of evidence identifies what percentage of within-patch information reaches a particular layer or how directly the decoder can recover it. Those questions would call for a measurement that specifies the visual distinctions to be tracked and examines whether the trained features preserve them across the pathway.

The implications are especially clear when considering the decoder’s output grid. Reconstructing an estimate at every pixel provides many places to express a distinction. Whether that distinction is backed by the source features depends on what reaches fusion and how the head uses it. A prediction can draw on detailed evidence retained from the input. It can also infer a likely arrangement from more indirect contextual cues. A well-placed output in one example does not determine which of these routes generated it.

The possibility of losing or transforming detail applies during reassembly and fusion as well as during encoding. Coarsening a map from a deeper layer organizes its contribution to reconstruction at a broader spatial scale. Early feature maps can then help refine the result. The eventual boundary is a property of the interactions among those representations and the head. The output examples establish spatial improvements from the trained system, while the role of an individual map in preserving a particular contour remains open.

Hybrid makes it particularly hard to infer a single path for all the recovered detail. Its decoder can use fine convolutional features drawn from before the transformer as well as subsequent representations developed through global attention. The ablation shows that the earlier route has value. The architecture and experiment thus support an account in which both paths contribute, with the frequency and circumstances of their particular contributions left unspecified. This is an inferred limit on the explanation of the gains, alongside the authors’ stated qualification about where spatial resolution stays fixed.

How directly the experiments explain the gains

The authors connect DPT’s better depth and segmentation outputs with contextual reach and the preservation of fine spatial evidence. There is a coherent case for that interpretation. Image-wide interactions are available throughout the transformer, selected intermediate features improve the validation result, some attention maps become more extensive at later layers, and the output examples illustrate benefits at large and small scales. These pieces of evidence describe compatible aspects of the design. They are measured at different points within a complicated predictor.

For a careful reader, evidence for the complete architecture is more direct than evidence for the size of any one mechanism’s contribution. The transfer comparisons with MiDaS change the encoder family and the path by which selected features reach reconstruction. Different variants can also change how tokens are obtained, how many parameters the encoder has, and the visual features available from pretraining. The matched training mixture deals with access to the expanded supervision. A separate comparison fixing the other relevant inputs to reconstruction while changing the reach of attention would be needed to estimate that particular mechanism’s effect.

Similar care is needed when using the readout experiment to explain a whole-system improvement. Replacing the readout rule within DPT does provide a focused test. The difference in the validation outcome belongs to the tested rules on the reduced depth mixture. The change from omission to projection also adds a learned transformation to the interface. The comparison supports a concrete choice in the predictor. It cannot tell how much of the larger transfer gain comes from this component or what share of its local advantage is due specifically to readout information.

Nor does evidence about the use of early features identify the kind of local information that determines a result. A lower validation error when early features are supplied shows that those features help under the selected decoder and supervision. Locating the improvements precisely would require a measure that distinguished, for instance, transition placement from consistency over the interior of a region. With the existing evidence, a reader can connect the architectural motivation to the types of output shown and leave the causal breakdown unresolved.

The attention maps contribute observations about selected positions in trained depth predictors. They are especially useful for establishing that the availability of global context has different visible consequences at different depths. An observed weight distribution does not by itself reveal whether suppressing a particular connection would alter a tree branch in the depth map, or how a later layer might compensate for such a change. The measurement supports a description of the computation. Its connection to individual prediction successes is a question the paper does not experimentally isolate.

There is also a task boundary on the component studies. The authors use the reduced mixture and aligned validation measure to select choices for depth. The final design is then evaluated successfully on segmentation with a different output and learning procedure. The outcomes justify using the architecture in both settings as tested. The relative contributions of particular skips and readout treatments in segmentation, individually and in combination, would need comparisons under segmentation supervision and metrics. The ADE20K category inspection concerns the distribution of final performance, which is a separate issue.

Which errors the reported benchmarks can identify

The relative gain across the held-out depth evaluations is an aggregate. Its purpose is to describe performance over several destinations under the transfer protocol. A small number of reported averages is valuable in a comparison whose ambition is cross-dataset robustness. It reduces the variation within those destinations to a result that is easy to compare. That convenience gives it limited power to identify who benefits within an image or which types of scene produce a persistent failure.

The authors point to especially favorable gains where depth references are dense and high resolution. Their suggestion that improved fine detail helps account for these gains is supported by the kinds of structure visible in the examples. A high-resolution reference can register a narrow region that a sparser reference has little opportunity to score. The dataset comparison still brings along differences in the scenes and the evaluation conditions. The reported observation is an association between the nature of the evaluations and the gains, without an independent change in measurement density within an otherwise common comparison.

A further limit follows from the form of the visual evidence. An example can show that a predictor gives a more coherent estimate over a broad surface in a particular scene. Another can show that a slender structure is preserved. These comparisons help the reader interpret the architectural goal and see a concrete difference in the outputs. A frequency estimate for such successes would require a sample designed to count them and criteria for what qualifies as successful. The aggregate benchmark scores do not supply those quantities separately.

The same consideration applies to the segmentation illustrations. A well-aligned outline and reduced clutter can both increase region agreement. For a given label, the overlap measure responds to all discrepancies in the predicted and reference regions. The class analysis indicates a broadly favorable trend but finds no strong pattern among labels. Together these pieces of evidence establish improved region prediction on the evaluated data and show examples of better spatial delineation. They do not measure boundary accuracy independently or determine how much such accuracy contributes to the reported mean.

The segmentation results also depend on the use of inference at several scales. That is part of the procedure under which the reported comparisons are obtained. A reader considering the result under another inference procedure needs to allow for the effect of that choice. An experiment with matched single-scale conditions would be the appropriate way to measure how much of the reported score or ranking carries over. Neither the segmentation mean nor the depth resolution study provides that specific comparison.

The benchmark alignments and data splits are likewise part of the scope of each claim. Zero-shot depth transfer concerns unseen destination sources under the earlier evaluation protocol. Small-dataset adaptation has supervised destination training. ADE20K and Pascal Context use validation results for their respective segmentation settings. Success in these different comparisons gives evidence for several uses of the architecture. It leaves variation across other image populations and reference conditions to their own measurements.

Admissible input sizes, robustness, and computational resources

The authors specify how to make the architecture work with variable input dimensions. The patch grid has to fit the input, and the decoder imposes its own stride alignment. The learned position embeddings are adjusted to the new grid by interpolation. This describes when and how a different input shape can be processed by the same architecture. The conditions apply before making any claim about how the quality of a prediction responds to the new size.

Their resolution experiment gives evidence about a particular kind of change. It begins at the depth training size and examines enlargement. The observed advantage concerns a more gradual degradation under the increases they test. The experiment does not determine the effect of much smaller images, changes in aspect ratio examined independently, or analogous changes for segmentation. Interpolating position information makes a computation possible under the shape constraints. Prediction stability is an empirical property of the trained system presented with that computation.

Latency is similarly scoped. The paper uses one fixed input workload and a specified processor and accelerator. The timings show that the two leading DPT configurations are competitive with the convolutional comparator in that setting. The authors attribute the Large variant’s showing to the parallel work available in its comparatively wide computation. The measured time establishes a useful case in which the difference in parameter count does not imply a corresponding difference in delay.

A careful reader should distinguish that finding from a characterization of resource growth with input size. Increasing input dimensions changes how many spatial tokens take part in attention and changes the volume of features processed by the decoder. The paper’s accuracy-versus-resolution analysis and its fixed-workload timing answer separate questions. Taken together, they give no timing curve for the larger resolutions, and elapsed inference time alone supplies little information about memory demand or total training effort. Those properties remain specific measurement questions for any other workload.

There is consequently a limit to the joint claim about speed and flexibility. At the specified workload, the measured latency supports use of the architecture alongside familiar convolutional alternatives. At increased input resolutions, the accuracy experiment supports comparatively graceful degradation in the tested depth systems. Evaluating a larger input under a fixed resource budget would require both quantities to be measured there. The paper supplies a concrete speed comparison and a concrete robustness comparison under their respective conditions.

How far the task evidence extends

The same overall reconstruction pathway is used successfully for continuous depth estimates and discrete category scores. This supports the authors’ characterization of DPT as an architecture for dense prediction. The common feature pathway is only part of the evaluated setup. The two tasks use supervision, heads, normalization choices, and inference procedures suited to their respective outputs. The evidence demonstrates useful reuse of an architecture with those task-specific decisions in place.

A careful reader can infer an architectural opportunity for another dense task. The decoder interface exposes contextualized transformer features at several spatial scales, and a head can express a task’s required prediction. The accuracy of such an extension would depend on whether those features contain the relevant evidence, how the head uses them, and what data and loss make the desired output learnable. Compatibility with the interface supplies a reason the architecture can be tried. The existing experiments measure a particular range of target properties.

The distinction applies equally to possible changes within the demonstrated tasks. A different classification pretraining procedure can change the quality of the depth features, as the backbone ablation shows. Different reference coverage can change what fine detail is supervised or measured. A decoder with another method of combining features could alter the importance of an early skip. The results support the evaluated DPT configurations and give reasons for several of their choices. Their component rankings retain the conditions under which the authors observed them.

What came after

Feature learning and the use of transformer capacity

The later citation from DINOv2 brings the question of acquiring visual features into contact with DPT’s question of how to use them. DINOv2 concerns learning robust visual representations without supervision. DPT takes features developed through earlier visual training and tests what an encoder and decoder can make of them for dense prediction. The contrast in research emphasis is visible in the questions each title poses. Knowing how to acquire a representation and knowing how to turn intermediate features into a map are complementary problems.

DPT’s classification pretraining comparison makes the connection concrete on its own side. A change in backbone preparation can improve aligned depth estimation while the reconstruction pathway still uses its usual spatial inputs. A paper concerned with robust features addresses a source of variation the DPT experiments show to be consequential. The citation establishes that DINOv2 engages with that earlier dense prediction work. The precise role of DPT’s feature selection, Reassemble operation, and decoder in the later investigation is unspecified. DINOv2.

A later study of large vision transformers cites DPT from the perspective of encoder capacity. DPT gives an example of a downstream use in which the value of a larger encoder can be measured. The deeper and wider variant is particularly effective in the main depth setting. The smaller Hybrid configuration does better on ADE20K. That difference makes the task setting central when connecting the scale of visual representations to the performance of a complete prediction system.

The later title specifies a study of scaling the vision transformer itself. DPT’s experiments concern the consequences of choosing among particular backbones inside a spatial predictor. These two inquiries meet at the point where an encoder’s capacity has to be converted into a useful downstream output. The citation places the earlier work in the later scaling study’s technical context. Which DPT components, if any, are used in its experiments remains unspecified. Scaling Vision Transformers to 22 Billion Parameters.

Depth in a broader geometric setting

NoPe-NeRF cites the paper from a study of optimizing a neural radiance field without a pose prior. This is the later work whose stated subject lies closest to DPT’s depth results. DPT produces an estimate tied to the pixels of a single view. The later work’s title identifies a problem involving a scene representation and the absence of a prior for pose. Their connection puts a per-image geometric description in the context of a broader geometric objective.

The relevant distinction within DPT is between predicting relative structure in a view and fitting that structure to a particular numerical convention. The original training procedure allows affine ambiguity, and the smaller depth experiments deal with it explicitly before specialization. Any account of a technical connection to a later geometric objective would therefore need to identify which depth quantity was used and how it related to the other geometric variables. The citation establishes the connection between the works. The exact use of a DPT prediction or a particular alignment in NoPe-NeRF remains unspecified. NoPe-NeRF.

Spatial outputs in interactive image work

Visual ChatGPT cites DPT in research concerned with conversation, drawing, and editing in a visual setting. The change in emphasis is from predicting a spatial property accurately to making visual capabilities useful in interactions with a user. DPT’s result has a defined form in that setting. A depth estimate describes geometry at image locations, and a segmentation output describes where categories are predicted to occur. These outputs are examples of visual information organized in a way that preserves a relationship to the image being discussed.

This thematic connection follows from the tasks the papers identify. DPT develops a predictor with a concrete spatial interface. An interactive image study addresses operations that can be requested and understood in relation to an image. Which predictor supports an operation, which spatial output it consumes, and how that output affects an edit are implementation questions. The citation from Visual ChatGPT establishes a link to DPT without specifying the operations in which its architecture or outputs participate. Visual ChatGPT.

Composition, evaluation, and image generation

T2I-CompBench++ cites DPT in a benchmark concerned with composition in text-to-image generation. The relationship is between evaluating the contents of an image and estimating properties that have a location within it. A dense output such as a category map describes how predicted regions occupy image space. A depth map describes another aspect of their arrangement. DPT demonstrates how a visual transformer can support these sorts of spatial descriptions through an explicit reconstruction pathway.

A compositional benchmark has its own evaluation targets. Describing a generation benchmark as compositional supplies its research focus, while a claim that it uses a particular depth signal or scoring rule would require methodological information about the benchmark. The citation supports the connection to prior research on extracting spatial information from images. The role of any DPT representation in the actual evaluation procedure is unspecified. T2I-CompBench++.

The Qwen-Image technical report provides a later citation from image generation research. It extends the citation record into a setting in which an image is the output of the system under study. The DPT experiments concern a different direction of inference. They begin with an image and produce estimates of quantities associated with its locations. This places the two works on different sides of a broad research question about the relationship between images and descriptions of what they contain.

For this later report, the citation establishes a connection to the earlier dense prediction architecture and leaves the point of technical dependence unspecified. In particular, the original paper supplies evidence about recovering geometry and category regions from images it receives. That evidence continues to describe the role of its predictor when the citation comes from a study concerned with creating images. Any claim about a specific stage of generation or evaluation would have to identify what the later report does with that predictor. Qwen-Image Technical Report.

Across these later citations, the aspect of DPT with the clearest technical identity is its route from intermediate transformer features to spatial outputs. Learning the features, increasing encoder capacity, optimizing scene geometry, interacting with an image, and evaluating a generated image each put different demands on representations. DPT demonstrated one concrete way of making those representations available for detailed prediction. The later works identify the research settings in which that contribution was cited, while the original depth and segmentation experiments establish what the architecture itself was shown to accomplish.

Cite

Cite as René Ranftl, Alexey Bochkovskiy and Vladlen Koltun. 2021. Vision Transformers for Dense Prediction. IEEE/CVF International Conference on Computer Vision (ICCV).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1109/iccv48922.2021.01196 · arXiv 2103.13413

@inproceedings{ranftl2021vision,
  title = {{Vision Transformers for Dense Prediction}},
  author = {René Ranftl, Alexey Bochkovskiy and Vladlen Koltun},
  booktitle = {IEEE/CVF International Conference on Computer Vision (ICCV)},
  year = {2021},
  doi = {10.1109/iccv48922.2021.01196},
  eprint = {2103.13413},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/iccv48922.2021.01196}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/ranftl-2021-vision-transformers-dense-prediction/

References

54 references, from the paper's own bibliography.

  1. Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. SegNet: A deep convolutional encoder-decoder architecture for image segmentation. IEEE TIP, 39(12):2481–2495, 2017. OpenAlex ↗ · Scholar ↗
  2. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015. our card
  3. Irwan Bello, Barret Zoph, Ashish Vaswani, Jonathon Shlens, and Quoc V Le. Attention augmented convolutional networks. In ICCV, 2019. our card
  4. Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. In NeurIPS, 2020. our card
  5. Vincent Casser, Soeren Pirk, Reza Mahjourian, and Anelia Angelova. Unsupervised learning of depth and ego-motion: A structured approach. In AAAI, 2019. OpenAlex ↗ · Scholar ↗
  6. Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L. Yuille. DeepLab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. TPAMI, 40(4):834–848, 2018. OpenAlex ↗ · Scholar ↗
  7. Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587, 2017. OpenAlex ↗ · Scholar ↗
  8. Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The Cityscapes dataset for semantic urban scene understanding. In CVPR, 2016. OpenAlex ↗ · Scholar ↗
  9. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Fei-Fei Li. ImageNet: A large-scale hierarchical image database. In CVPR, 2009. OpenAlex ↗ · Scholar ↗
  10. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In ACL, 2019. our card
  11. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. our card
  12. David Eigen, Christian Puhrsch, and Rob Fergus. Depth map prediction from a single image using a multi-scale deep network. In NeurIPS, 2014. OpenAlex ↗ · Scholar ↗
  13. Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Batmanghelich, and Dacheng Tao. Deep ordinal regression network for monocular depth estimation. In CVPR, 2018. OpenAlex ↗ · Scholar ↗
  14. Jun Fu, Jing Liu, Yuhang Wang, Yong Li, Yongjun Bao, Jinhui Tang, and Hanqing Lu. Adaptive context network for scene parsing. In ICCV, 2019. OpenAlex ↗ · Scholar ↗
  15. Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? The KITTI vision benchmark suite. In CVPR, 2012. OpenAlex ↗ · Scholar ↗
  16. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. our card
  17. Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (GELUs). arXiv preprint arXiv:1606.08415, 2016. OpenAlex ↗ · Scholar ↗
  18. Xinyu Huang, Peng Wang, Xinjing Cheng, Dingfu Zhou, Qichuan Geng, and Ruigang Yang. The ApolloScape open dataset for autonomous driving and its application. TPAMI, 42(10):2702–2719, 2020. OpenAlex ↗ · Scholar ↗
  19. Diederik P. Kingma and Jimmy Lei Ba. Adam: A method for stochastic optimization. In ICLR, 2015. our card
  20. Jin Han Lee, Myung-Kyu Han, Dong Wook Ko, and Il Hong Suh. From big to small: Multi-scale local planar guidance for monocular depth estimation. arXiv preprint arXiv:1907.10326, 2019. OpenAlex ↗ · Scholar ↗
  21. Zhengqi Li, Tali Dekel, Forrester Cole, Richard Tucker, Noah Snavely, Ce Liu, and William T. Freeman. Learning the depths of moving people by watching frozen people. In CVPR, 2019. OpenAlex ↗ · Scholar ↗
  22. Zhengqi Li and Noah Snavely. MegaDepth: Learning single-view depth prediction from Internet photos. In CVPR, 2018. OpenAlex ↗ · Scholar ↗
  23. Guosheng Lin, Anton Milan, Chunhua Shen, and Ian D. Reid. RefineNet: Multi-path refinement networks for high-resolution semantic segmentation. In CVPR, 2017. OpenAlex ↗ · Scholar ↗
  24. Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: A robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692, 2019. our card
  25. Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens van der Maaten. Exploring the limits of weakly supervised pretraining. In ECCV, 2018. OpenAlex ↗ · Scholar ↗
  26. Roozbeh Mottaghi, Xianjie Chen, Xiaobai Liu, Nam-Gyu Cho, Seong-Whan Lee, Sanja Fidler, Raquel Urtasun, and Alan L. Yuille. The role of context for object detection and semantic segmentation in the wild. In CVPR, 2014. OpenAlex ↗ · Scholar ↗
  27. Hyeonwoo Noh, Seunghoon Hong, and Bohyung Han. Learning deconvolution network for semantic segmentation. In ICCV, 2015. OpenAlex ↗ · Scholar ↗
  28. Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In ICML, 2018. OpenAlex ↗ · Scholar ↗
  29. Prajit Ramachandran, Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jonathon Shlens. Stand-alone self-attention in vision models. In NeurIPS, 2019. OpenAlex ↗ · Scholar ↗
  30. René Ranftl, Katrin Lasinger, David Hafner, Konrad Schindler, and Vladlen Koltun. Towards robust monocular depth estimation: Mixing datasets for zero-shot cross-dataset transfer. TPAMI, 2020. OpenAlex ↗ · Scholar ↗
  31. Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional networks for biomedical image segmentation. In MICCAI, 2015. our card
  32. Ozan Sener and Vladlen Koltun. Multi-task learning as multi-objective optimization. In NeurIPS, 2018. OpenAlex ↗ · Scholar ↗
  33. Pierre Sermanet, David Eigen, Xiang Zhang, Michaël Mathieu, Rob Fergus, and Yann LeCun. OverFeat: Integrated recognition, localization and detection using convolutional networks. In ICLR, 2014. our card
  34. Evan Shelhamer, Jonathan Long, and Trevor Darrell. Fully convolutional networks for semantic segmentation. CVPR, 2015. our card
  35. Nathan Silberman, Derek Hoiem, Pushmeet Kohli, and Rob Fergus. Indoor segmentation and support inference from RGBD images. In ECCV, 2012. OpenAlex ↗ · Scholar ↗
  36. Josef Sivic and Andrew Zisserman. Efficient visual search of videos cast as text retrieval. TPAMI, 31(4):591–606, 2009. OpenAlex ↗ · Scholar ↗
  37. Ke Sun, Bin Xiao, Dong Liu, and Jingdong Wang. Deep high-resolution representation learning for human pose estimation. In CVPR, 2019. OpenAlex ↗ · Scholar ↗
  38. 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
  39. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. our card
  40. Chaoyang Wang, Oliver Wang, Federico Perazzi, and Simon Lucey. Web stereo video supervision for depth prediction from dynamic scenes. In 3DV, 2019. OpenAlex ↗ · Scholar ↗
  41. Huiyu Wang, Yukun Zhu, Bradley Green, Hartwig Adam, Alan L. Yuille, and Liang-Chieh Chen. Axial-DeepLab: Stand-alone axial-attention for panoptic segmentation. In ECCV, 2020. OpenAlex ↗ · Scholar ↗
  42. Jingdong Wang, Ke Sun, Tianheng Cheng, Borui Jiang, Chaorui Deng, Yang Zhao, Dong Liu, Yadong Mu, Mingkui Tan, Xinggang Wang, Wenyu Liu, and Bin Xiao. Deep high-resolution representation learning for visual recognition. TPAMI, 2020. OpenAlex ↗ · Scholar ↗
  43. Qiang Wang, Shizhen Zheng, Qingsong Yan, Fei Deng, Kaiyong Zhao, and Xiaowen Chu. IRS: A large synthetic indoor robotics stereo dataset for disparity and surface normal estimation. arXiv preprint arXiv:1912.09678, 2019. OpenAlex ↗ · Scholar ↗
  44. Wenshan Wang, Delong Zhu, Xiangwei Wang, Yaoyu Hu, Yuheng Qiu, Chen Wang, Yafei Hu, Ashish Kapoor, and Sebastian Scherer. TartanAir: A dataset to push the limits of visual slam. In IROS, 2020. OpenAlex ↗ · Scholar ↗
  45. Ke Xian, Chunhua Shen, Zhiguo Cao, Hao Lu, Yang Xiao, Ruibo Li, and Zhenbo Luo. Monocular relative depth perception with web stereo data supervision. In CVPR, 2018. OpenAlex ↗ · Scholar ↗
  46. Ke Xian, Jianming Zhang, Oliver Wang, Long Mai, Zhe Lin, and Zhiguo Cao. Structure-guided ranking loss for single image depth prediction. In CVPR, 2020. OpenAlex ↗ · Scholar ↗
  47. Yao Yao, Zixin Luo, Shiwei Li, Jingyang Zhang, Yufan Ren, Lei Zhou, Tian Fang, and Long Quan. BlendedMVS: A large-scale dataset for generalized multi-view stereo networks. CVPR, 2020. OpenAlex ↗ · Scholar ↗
  48. Wei Yin, Yifan Liu, Chunhua Shen, and Youliang Yan. Enforcing geometric constraints of virtual normal for depth prediction. In ICCV, 2019. OpenAlex ↗ · Scholar ↗
  49. Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. In ICLR, 2016. OpenAlex ↗ · Scholar ↗
  50. Yuhui Yuan, Xilin Chen, and Jingdong Wang. Object-contextual representations for semantic segmentation. In ECCV, 2020. OpenAlex ↗ · Scholar ↗
  51. Hang Zhang, Chongruo Wu, Zhongyue Zhang, Yi Zhu, Zhi Zhang, Haibin Lin, Yue Sun, Tong He, Jonas Muller, R. Manmatha, Mu Li, and Alexander Smola. ResNeSt: Split-attention networks. arXiv preprint arXiv:2004.08955, 2020. OpenAlex ↗ · Scholar ↗
  52. Hengshuang Zhao, Jiaya Jia, and Vladlen Koltun. Exploring self-attention for image recognition. In CVPR, 2020. OpenAlex ↗ · Scholar ↗
  53. Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In CVPR, 2017. OpenAlex ↗ · Scholar ↗
  54. Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ADE20K dataset. In CVPR, 2017. OpenAlex ↗ · Scholar ↗