Skip to content

Image understanding, generation, and 3D reconstruction · Semantic, instance and promptable segmentation · VIS011 · Architecture

DeepLab family

DeepLab uses atrous convolution and multi-scale context for semantic segmentation. The family evolved from atrous features with dense CRF refinement to later atrous spatial pyramid pooling and encoder-decoder designs;

Runs in CodeSplash (Experimental) Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

A CodeSplash method runs this entry in Python and R. Set it up from the method's page. The methods that run it are Experimental.

Do it in CodeSplash Run it on your own data. It's in the Experimental lane in the app.

Availability
Runs in CodeSplash (Experimental)
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran here in one language.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

DeepLab uses atrous convolution and multi-scale context for semantic segmentation. The family evolved from atrous features with dense CRF refinement to later atrous spatial pyramid pooling and encoder-decoder designs; these developments are grouped rather than counted as many checkpoints.

Question / hypotheses

Which receptive-field scales and output stride preserve both scene context and segmentation boundaries? This is a modeling/evaluation question, not a formal null-hypothesis test.

Architecture / computational structure

Dilated convolutions enlarge receptive fields without the same downsampling. Atrous spatial pyramid branches capture several scales; later DeepLabv3+ adds a decoder and atrous separable convolution. A dense CRF belongs to particular earlier configurations, not every version.

Assumptions

Sparse atrous sampling can create gridding effects or miss narrow structures. Large dilation on small feature maps samples padding heavily. Domain-specific texture and boundary characteristics may require different scale settings.

Formula / computational definition

Atrous filtering is y[p]=∑kw[k]x[p+r k]y[p]=\sum_kw[k]x[p+r\,k], with dilation r. ASPP concatenates multiple dilation branches and an optional global-context branch before projection; segmentation commonly optimizes per-pixel cross-entropy.

Parameters and notation

Notation: Here p is an output spatial index, k a kernel offset, w[k] its learned filter coefficient, x the input feature map and r the integer dilation. In two dimensions, both p and k are vectors; the 1D example illustrates the same indexing mechanism.

Learned or estimated: Backbone, atrous/ASPP filters, decoder/projection and class-head weights; CRF parameters apply only to declared CRF variants.

Hyperparameters and effects: Version, output stride, dilation rates, crop size, decoder width, class loss and optional CRF settings. Dilation must be interpreted relative to feature stride and image scale.

Fitting, fine-tuning, and adaptation

Load a version-compatible backbone/decoder, train a target class head, then unfreeze later stages with reduced learning rates. Revisit dilation and crop scale using training/validation image geometry. Check source-class retention and target boundaries; changing output stride or CRF processing requires re-evaluation.

How to use and calibrate

Split by independent image source, scene, subject or capture sequence before augmentation; keep near-duplicate frames and crops in the same split. Measure class IoU, boundary accuracy, small/thin-object recall, scale robustness and end-to-end cost. State the exact DeepLab generation and whether CRF or multi-scale inference is included.

Example application

Segment scenes with objects spanning several spatial scales while preserving a controllable output stride. This is a proposed use case, not a claim of validated performance on supplied real data.

Interpretation / pitfalls

Watch out

A training loss, confidence score or attention map is not a p-value or causal explanation. Confidence calibration, annotation quality and distribution-shift performance need separate assessment. A correct component calculation does not validate the full architecture, checkpoint or deployment pipeline.

Python and R code examples

Scope: One-dimensional atrous cross-correlation at dilation 1 and 2, isolating receptive-field expansion without adding kernel weights; not a DeepLab segmentation model. Use the shared setup. Dependencies: NumPy / base R. Validation: Python executed; R unexecuted.

Full-model route: Python: a verified DeepLab generation; R: native torch atrous components or bridge. The example isolates dilation and shows how its receptive field changes, not a full ASPP/decoder network.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — One-dimensional atrous cross-correlation at dilation 1 and 2, isolating receptive-field expansion without adding kernel weights; not a DeepLab segmentation model. Use the shared setup.

Shared setup for this chapter
import numpy as np
from itertools import permutations
def softmax(x):
    x=np.asarray(x,dtype=float)
    e=np.exp(x-x.max(axis=-1,keepdims=True))
    return e/e.sum(axis=-1,keepdims=True)
def bilinear(a,y,x):
    y=float(np.clip(y,0,a.shape[0]-1)); x=float(np.clip(x,0,a.shape[1]-1))
    y0=int(np.floor(y)); x0=int(np.floor(x))
    y1=min(y0+1,a.shape[0]-1); x1=min(x0+1,a.shape[1]-1)
    dy=y-y0; dx=x-x0
    return (1-dy)*((1-dx)*a[y0,x0]+dx*a[y0,x1])+dy*((1-dx)*a[y1,x0]+dx*a[y1,x1])
x=np.arange(9,dtype=float); kernel=np.array([1.,2.,1.])
def atrous(d):
    return np.array([kernel@x[i+d*np.arange(3)] for i in range(len(x)-2*d)])
y1=atrous(1); y2=atrous(2)
assert len(y1)==7 and len(y2)==5 and np.allclose(y2,[8,12,16,20,24])
print('dilation 1:',y1,'dilation 2:',y2,'effective widths:',3,5)
R

Component demo, not a trained model — One-dimensional atrous cross-correlation at dilation 1 and 2, isolating receptive-field expansion without adding kernel weights; not a DeepLab segmentation model. Use the shared setup.

Shared setup for this chapter
softmax <- function(x) {
  if(is.null(dim(x))) {e<-exp(x-max(x)); return(e/sum(e))}
  t(apply(x,1,function(v) {e<-exp(v-max(v)); e/sum(e)}))
}
bilinear <- function(a,y,x) {
  y<-min(max(y,0),nrow(a)-1); x<-min(max(x,0),ncol(a)-1)
  y0<-floor(y); x0<-floor(x); y1<-min(y0+1,nrow(a)-1); x1<-min(x0+1,ncol(a)-1)
  dy<-y-y0; dx<-x-x0
  (1-dy)*((1-dx)*a[y0+1,x0+1]+dx*a[y0+1,x1+1])+dy*((1-dx)*a[y1+1,x0+1]+dx*a[y1+1,x1+1])
}
x<-0:8; kernel<-c(1,2,1)
atrous<-function(d) sapply(seq_len(length(x)-2*d),function(i) sum(kernel*x[i+d*(0:2)]))
y1<-atrous(1); y2<-atrous(2)
stopifnot(length(y1)==7,length(y2)==5,max(abs(y2-c(8,12,16,20,24)))<1e-12)
print(list(dilation_1=y1,dilation_2=y2,effective_widths=c(3,5)))

Sources

From the CodeSplash reference, entry VIS011.