Simple Algorithm
Deep Learning · Emergence · 28 min

Scattering Transforms

Wavelet cascades with provable stability to deformations: a mathematical model of CNNs.

What should an image representation for classification keep, and what should it throw away? It should not care where an object sits, it should barely change when the object bends a little, and it should still tell a 3 from an 8. Stéphane Mallat's scattering transform achieves all three with no learning at all, a cascade of wavelet filters, moduli and averages, and comes with theorems. It is the clearest mathematical model of why convolution, nonlinearity and pooling work together.

What you’ll learn

  • Define Lipschitz stability to deformations, and derive why the Fourier modulus is translation-invariant yet unstable at high frequencies.
  • Define the windowed scattering transform SJS_J (wavelets, modulus, averaging, paths) and count its paths for JJ scales and LL orientations.
  • State with their hypotheses the theorems on non-expansiveness, energy conservation, translation invariance and stability to deformations, and prove the parts that follow from the frame property and the modulus.
  • Explain why the modulus is the right nonlinearity, how energy flows to low frequencies along frequency-decreasing paths, and what scattering does and does not explain about trained CNNs.

What a representation should ignore

Write a deformation of an image x∈L2(R2)x\in L^2(\R^2) as Lτx(u)=x(u−τ(u))L_\tau x(u)=x(u-\tau(u)), where the displacement field τ\tau moves each point by τ(u)\tau(u). A translation is the special case τ(u)=c\tau(u)=c; a slight stretch, a change of pose or a different handwriting style are small but non-constant τ\tau. A representation Φ\Phi suited to classification should change little under such deformations, in proportion to how much they bend space rather than how far they move it.

DerivationThe Fourier modulus is invariant but unstable
  1. Lcx^(ω)=e−ic⋅ω x^(ω)⟹∣Lcx^∣=∣x^∣\widehat{L_cx}(\omega)=e^{-ic\cdot\omega}\,\hat x(\omega)\quad\Longrightarrow\quad\big|\widehat{L_cx}\big|=|\hat x|

    Translation multiplies the Fourier transform by a phase, so its modulus is exactly translation-invariant:

  2. ξ ⟼ (1−s) ξ,a displacement of ∣s∣ ∣ξ∣\xi\ \longmapsto\ (1-s)\,\xi,\qquad\text{a displacement of }|s|\,|\xi|

    Now dilate slightly: τ(u)=su\tau(u)=su, so ∥∇τ∥∞=∣s∣\norm{\nabla\tau}_\infty=|s|, and take a wave packet x(u)=eiξ⋅uθ(u)x(u)=e^{i\xi\cdot u}\theta(u) with a smooth, fast-decaying window θ\theta. Then Lτx(u)=x((1−s)u)L_\tau x(u)=x((1-s)u) moves the central frequency:

  3. ∥ ∣Lτx^∣−∣x^∣ ∥ ∼ ∣s∣ ∣ξ∣ ∥θ∥=∥∇τ∥∞ ∣ξ∣ ∥x∥\big\lVert\,|\widehat{L_\tau x}|-|\hat x|\,\big\rVert\ \sim\ |s|\,|\xi|\,\norm{\theta}=\norm{\nabla\tau}_\infty\,|\xi|\,\norm{x}

    ∣x^∣|\hat x| is a bump of fixed width (that of θ^\hat\theta) centered at ξ\xi, so moving it by ∣s∣∣ξ∣|s||\xi| changes it by an amount proportional to the displacement (Mallat, 2012):

  4. ψ^λ centered at ∝2−j, width∝2−j⟹shiftwidth=O(∣s∣) for every j\hat\psi_\lambda\ \text{centered at }\propto2^{-j},\ \text{width}\propto2^{-j}\quad\Longrightarrow\quad\frac{\text{shift}}{\text{width}}=O(|s|)\ \text{for every }j

    The ratio to ∥∇τ∥∞∥x∥\norm{\nabla\tau}_\infty\norm x is ∣ξ∣|\xi|, unbounded at high frequencies, so no constant CC works. The cure is to group frequencies into wavelet bands whose width grows in proportion to their center frequency: a dilation by 1−s1-s then shifts every band by the same fraction ss of its own width, uniformly over scales.

Wavelets are stable but not invariant: x⋆ψλx\star\psi_\lambda moves with the image. Averaging with a low-pass filter makes it invariant but, as the next step shows, averages it to almost nothing. The scattering transform resolves the tension with one nonlinearity.

The scattering cascade

Take a complex wavelet ψ\psi, for instance a Morlet wavelet (a plane wave under a Gaussian envelope, corrected to have zero mean), and its dilations and rotations ψλ(u)=2−2jψ(2−jr−1u)\psi_\lambda(u)=2^{-2j}\psi(2^{-j}r^{-1}u) for scales 0≤j<J0\le j<J and LL orientations rr. A low-pass window ϕJ(u)=2−2Jϕ(2−Ju)\phi_J(u)=2^{-2J}\phi(2^{-J}u) averages over a region of width about 2J2^J. Define the wavelet-modulus operator U[λ]x=∣x⋆ψλ∣U[\lambda]x=|x\star\psi_\lambda| and, for a path p=(λ1,…,λm)p=(\lambda_1,\dots,\lambda_m), the cascade U[p]x=U[λm]⋯U[λ1]xU[p]x=U[\lambda_m]\cdots U[\lambda_1]x. The windowed scattering transform averages every cascade:

SJx={ x⋆ϕJ,  ∣x⋆ψλ1∣⋆ϕJ,  ∣∣x⋆ψλ1∣⋆ψλ2∣⋆ϕJ, …}λ1,λ2,…S_Jx=\Big\{\,x\star\phi_J,\ \ |x\star\psi_{\lambda_1}|\star\phi_J,\ \ \big||x\star\psi_{\lambda_1}|\star\psi_{\lambda_2}\big|\star\phi_J,\ \dots\Big\}_{\lambda_1,\lambda_2,\dots}
Orders m=0,1,2,…m=0,1,2,\dots of SJ[p]x=U[p]x⋆ϕJS_J[p]x=U[p]x\star\phi_J. Read as a network, it is a CNN with fixed wavelet filters, the complex modulus as its nonlinearity and averaging as its pooling, which outputs coefficients at every layer rather than only the last.
DerivationWhy a modulus, and where the energy goes
  1. x⋆ψλ⋆ϕJ^=x^ ψ^λ ϕ^J≈0\widehat{x\star\psi_\lambda\star\phi_J}=\hat x\,\hat\psi_\lambda\,\hat\phi_J\approx0

    A linear invariant is useless here. The wavelet ψλ\psi_\lambda has zero mean and its spectrum sits around frequency ∝2−j\propto2^{-j}, while ϕ^J\hat\phi_J is concentrated below 2−J2^{-J}; for j<Jj<J the two barely overlap, so averaging the wavelet coefficients kills them:

  2. ∣x⋆ψλ∣=a(u),∣x⋆ψλ∣⋆ϕJ≠0|x\star\psi_\lambda|=a(u),\qquad |x\star\psi_\lambda|\star\phi_J\ne0

    Write the band-pass output as amplitude times phase, x⋆ψλ(u)=a(u) eiφ(u)x\star\psi_\lambda(u)=a(u)\,e^{i\varphi(u)}: the phase oscillates at roughly the band's frequency while the envelope aa varies slowly. The modulus removes the oscillation, demodulating the band to low frequencies, where averaging keeps much of its energy:

  3. ∥ ∣a∣−∣b∣ ∥≤∥a−b∥\big\lVert\,|a|-|b|\,\big\rVert\le\norm{a-b}

    The modulus has the other properties needed: it acts pointwise, so it commutes with translations and deformations; it preserves the norm, ∥∣h∣∥=∥h∥\norm{|h|}=\norm h; and it is non-expansive, ∣∣a∣−∣b∣∣≤∣a−b∣\big||a|-|b|\big|\le|a-b|. The detail that averaging discards, the high frequencies of the envelope, is not lost: the next order recovers it as ∣∣x⋆ψλ1∣⋆ψλ2∣\big||x\star\psi_{\lambda_1}|\star\psi_{\lambda_2}\big|.

  4. keep paths with 0≤j1<j2<⋯<jm<J\text{keep paths with } 0\le j_1<j_2<\cdots<j_m<J

    Since ∣x⋆ψλ1∣|x\star\psi_{\lambda_1}| lives mostly below the frequency of ψλ1\psi_{\lambda_1}, filtering it with a finer wavelet (j2≤j1j_2\le j_1) finds almost nothing. Only frequency-decreasing paths, j1<j2<⋯<Jj_1<j_2<\cdots<J, carry energy, and on Caltech-101 images over 99% of the scattering energy lies on such paths of length m≤3m\le3 (Bruna & Mallat, 2013).

Predict before you look

A scattering transform uses J=3J=3 scales and L=8L=8 orientations, up to order m=2m=2, on frequency-decreasing paths. Counting the order-0 average, how many scattering channels does it output per input channel?

Show the answer

217 channels

Order 0 gives 1 channel, order 1 gives JL=24JL=24, and order 2 gives L2(J2)=64×3=192L^2\binom J2=64\times3=192, one for each pair of orientations and each pair of scales j1<j2j_1<j_2. Total 1+JL+L2J(J−1)/2=2171+JL+L^2J(J-1)/2=217. The Kymatio library (Andreux et al., 2020) produces 81 channels with J=2J=2, L=8L=8, each subsampled by 2J2^J in both directions.

The theorems

DerivationProof of non-expansiveness
  1. ∥UJx−UJy∥≤∥WJx−WJy∥=∥x−y∥\norm{U_Jx-U_Jy}\le\norm{W_Jx-W_Jy}=\norm{x-y}

    One layer UJx={x⋆ϕJ, (∣x⋆ψλ∣)λ}U_Jx=\{x\star\phi_J,\,(|x\star\psi_\lambda|)_\lambda\} is non-expansive: the frame is an isometry and the modulus is non-expansive coordinate by coordinate.

  2. ∥U[Λm]x−U[Λm]y∥2 ≥ ∥SJ[Λm]x−SJ[Λm]y∥2+∥U[Λm+1]x−U[Λm+1]y∥2\norm{U[\Lambda^m]x-U[\Lambda^m]y}^2\ \ge\ \norm{S_J[\Lambda^m]x-S_J[\Lambda^m]y}^2+\norm{U[\Lambda^{m+1}]x-U[\Lambda^{m+1}]y}^2

    Apply it to all paths of length mm at once. Its output splits into the averaged part, which is the order-mm scattering output, and the moduli, which are the paths of length m+1m+1:

  3. ∥SJ[PJ]x−SJ[PJ]y∥2=∑m≥0∥SJ[Λm]x−SJ[Λm]y∥2≤∥x−y∥2□\norm{S_J[P_J]x-S_J[P_J]y}^2=\sum_{m\ge0}\norm{S_J[\Lambda^m]x-S_J[\Lambda^m]y}^2\le\norm{x-y}^2\qquad\square

    Sum over m=0,1,2,…m=0,1,2,\dots, starting from U[Λ0]x=xU[\Lambda^0]x=x. The terms telescope, and everything left on the right is non-negative:

Non-expansiveness is the formal version of "small noise, small change": ∥SJ(x+n)−SJx∥≤∥n∥\norm{S_J(x+n)-S_Jx}\le\norm n. A trained CNN is Lipschitz too, but its constant is bounded only by the product of its layers' norms and can be very large, which is one way to see why it can have adversarial examples. Translation invariance comes from the averaging window.

DerivationThe averaging window and the term $2^{-J} orm au_infty$
  1. ∥LcAJx−AJx∥≤∥x∥ ∥LcϕJ−ϕJ∥1≤∣c∣ ∥∇ϕJ∥1 ∥x∥\norm{L_cA_Jx-A_Jx}\le\norm x\,\norm{L_c\phi_J-\phi_J}_1\le|c|\,\norm{\nabla\phi_J}_1\,\norm x

    Let AJx=x⋆ϕJA_Jx=x\star\phi_J. A translation by cc changes it by x⋆(LcϕJ−ϕJ)x\star(L_c\phi_J-\phi_J), and Young's inequality bounds a convolution by the L1L^1 norm of the filter:

  2. ∥LcAJx−AJx∥≤2−J ∣c∣ ∥∇ϕ∥1 ∥x∥\norm{L_cA_Jx-A_Jx}\le2^{-J}\,|c|\,\norm{\nabla\phi}_1\,\norm x

    Dilating the window by 2J2^J shrinks its gradient in L1L^1 by 2J2^J (in two dimensions, ∇ϕJ(u)=2−3J∇ϕ(2−Ju)\nabla\phi_J(u)=2^{-3J}\nabla\phi(2^{-J}u) while du=22Jdvdu=2^{2J}dv):

  3. lim⁡J→∞∥SJ[PJ]Lcx−SJ[PJ]x∥=0\lim_{J\to\infty}\norm{S_J[P_J]L_cx-S_J[P_J]x}=0

    Shifts much smaller than the window size 2J2^J barely matter, and as J→∞J\to\infty the scattering transform becomes exactly translation-invariant (Mallat's Theorem 2.10). The price is resolution: the outputs can be subsampled every 2J2^J pixels, so a large JJ discards where things are.

Proof idea. Split the error into the averaging term above and a commutator [SJ,Lτ][S_J,L_\tau]. Because the modulus commutes with LτL_\tau and is non-expansive, the commutator of the whole cascade is bounded by the commutator of one wavelet transform, ∥[UJ,Lτ]∥≤∥[WJ,Lτ]∥\norm{[U_J,L_\tau]}\le\norm{[W_J,L_\tau]}, accumulated along paths (hence the ℓ1\ell^1 norm, or the factor mm). The wavelet commutator is small precisely because each band's width is proportional to its frequency, the property the Fourier modulus lacked.

Check your understanding

You increase the averaging scale from 2J=82^J=8 to 2J=322^J=32 pixels. Which term of the stability bound shrinks, and what do you pay?

  1. The term ∥∇τ∥∞\norm{\nabla\tau}_\infty shrinks; you pay nothing
  2. The translation term 2−J∥τ∥∞2^{-J}\norm\tau_\infty shrinks by a factor of 4; the outputs are averaged over larger windows, losing spatial resolution
  3. The Hessian term vanishes; the transform stops being non-expansive
  4. Nothing changes: the bound does not depend on JJ
Show the answer

B. The translation term 2−J∥τ∥∞2^{-J}\norm\tau_\infty shrinks by a factor of 4; the outputs are averaged over larger windows, losing spatial resolution

Only the translation term carries 2−J2^{-J}. A larger window tolerates larger displacements, but the coefficients are now averaged over 32×3232\times32 regions and can be sampled only every 32 pixels, so the transform says less about where things are.

What scattering explains, and what it does not

SettingResult
MNIST digits (Bruna & Mallat, 2013)Scattering with a Gaussian-kernel SVM reached 0.43% test error with the full training set, then the best published; with up to 5,000 training samples a scattering + PCA classifier beat a CNN that learned all its filters.
CUReT textures (Bruna & Mallat, 2013)0.2% error for second-order scattering with a PCA classifier, against 1.5–2.4% for texton and MRF methods: second-order coefficients capture texture statistics that the power spectrum misses.
Audio (Andén & Mallat, 2014)One-dimensional scattering extends mel-frequency features with modulation coefficients and is stable to time warping.
ImageNet hybrids (Oyallon, Belilovsky & Zagoruyko, 2017)A fixed scattering front end with J=3J=3 and L=8L=8 (217 channels per color channel, the count above, on a 28×2828\times28 grid) followed by a 10-layer ResNet reached 68.7% top-1 and 88.6% top-5 (single crop), against 68.9% and 88.8% for their ResNet-18; on small subsets of CIFAR-10 and on STL-10 the hybrids beat end-to-end networks.
Scattering is strongest where the variability is mostly geometric and the data are few. On large, diverse datasets a fixed scattering alone falls well short of learned networks; learned layers on top close the gap.

The analysis has been generalized well beyond wavelets. Wiatowski & Bölcskei (2018) proved that cascades of general frames (including learned filters), Lipschitz nonlinearities (ReLU, tanh, sigmoids, the modulus) and Lipschitz pooling give features that become progressively more translation-invariant with depth, that pooling is necessary for this (without it the features stay fully covariant), and that deformation sensitivity is bounded for band-limited, cartoon and Lipschitz signal classes. Bietti & Mairal (2019) proved invariance and deformation stability for convolutional kernel networks and extended the stability analysis to CNNs with generic activations such as ReLU.

What this explains about trained CNNs: why early layers look like oriented band-pass filters, why a nonlinearity must come before pooling, why depth and pooling build invariance, and why geometric priors help most when data are scarce. What it does not explain: the class-specific, learned features of deep layers, which is where most of a CNN's accuracy on ImageNet comes from; invariance to non-geometric variability such as lighting, clutter or intra-class shape; and the instability of trained networks to adversarial perturbations, whose weights obey no frame condition.

Key takeaways

  • A good representation is Lipschitz-stable to deformations: ∥Φ(Lτx)−Φ(x)∥≤C∥x∥(∥∇τ∥∞+∥Hτ∥∞)\norm{\Phi(L_\tau x)-\Phi(x)}\le C\norm x(\norm{\nabla\tau}_\infty+\norm{H\tau}_\infty). The Fourier modulus is invariant but fails this at high frequencies, by a factor ∣ξ∣|\xi|.
  • The scattering transform SJ[p]x=∣⋯∣x⋆ψλ1∣⋯⋆ψλm∣⋆ϕJS_J[p]x=|\cdots|x\star\psi_{\lambda_1}|\cdots\star\psi_{\lambda_m}|\star\phi_J cascades wavelets and moduli and averages every path; energy flows along frequency-decreasing paths and is mostly captured by order 2, with 1+JL+L2J(J−1)/21+JL+L^2J(J-1)/2 channels.
  • With a tight wavelet frame, scattering is non-expansive; with admissible wavelets it preserves the norm; it becomes translation-invariant as J→∞J\to\infty and is stable to C2C^2 deformations with a bound of order 2−J∥τ∥∞+∥∇τ∥∞2^{-J}\norm\tau_\infty+\norm{\nabla\tau}_\infty.
  • The modulus demodulates each band to low frequencies, which is why a nonlinearity must precede pooling; general frames and Lipschitz nonlinearities give invariance that grows with depth.
  • Scattering excels with little data and geometric variability, and hybrids with learned layers matched ResNet-18 on ImageNet; it does not account for learned class-specific features or the adversarial fragility of trained networks.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

Why is the Fourier modulus ∣x^∣|\hat x| a poor representation for classification, despite being exactly translation-invariant?

  1. It is not translation-invariant once the image has borders
  2. A small dilation moves a frequency ξ\xi by about ∣s∣∣ξ∣|s||\xi|, so at high frequencies tiny deformations change ∣x^∣|\hat x| by an amount no Lipschitz constant can bound
  3. It discards the low frequencies, which carry the object's shape
  4. It is not non-expansive
Show the answer

B. A small dilation moves a frequency ξ\xi by about ∣s∣∣ξ∣|s||\xi|, so at high frequencies tiny deformations change ∣x^∣|\hat x| by an amount no Lipschitz constant can bound

A Fourier bump at ξ\xi has fixed width, so moving it by ∣s∣∣ξ∣|s||\xi| makes ∥∣Lτx^∣−∣x^∣∥∼∥∇τ∥∞∣ξ∣∥x∥\big\lVert|\widehat{L_\tau x}|-|\hat x|\big\rVert\sim\norm{\nabla\tau}_\infty|\xi|\norm x, unbounded in ∣ξ∣|\xi|. Wavelet bands widen with frequency, which removes the problem.

Question 2

In a scattering network, why is ∣x⋆ψλ∣⋆ϕJ|x\star\psi_\lambda|\star\phi_J used instead of the linear average x⋆ψλ⋆ϕJx\star\psi_\lambda\star\phi_J?

  1. The linear average is nearly zero, because the wavelet's band barely overlaps the low-pass window; the modulus demodulates the band to low frequencies, where averaging keeps its energy
  2. The modulus makes the transform linear and therefore easier to invert
  3. The linear average is not translation-equivariant
  4. The modulus increases the energy of the signal, which improves classification
Show the answer

A. The linear average is nearly zero, because the wavelet's band barely overlaps the low-pass window; the modulus demodulates the band to low frequencies, where averaging keeps its energy

x⋆ψλ⋆ϕJ^=x^ψ^λϕ^J≈0\widehat{x\star\psi_\lambda\star\phi_J}=\hat x\hat\psi_\lambda\hat\phi_J\approx0 for j<Jj<J. Taking the modulus removes the oscillating phase and leaves the slowly varying envelope, whose average is informative; the next order recovers what that average discards.

Question 3

How many channels does a second-order scattering transform with J=2J=2 scales and L=8L=8 orientations output per input channel, counting only frequency-decreasing paths?

  1. 17
  2. 145
  3. 81
  4. 25
Show the answer

C. 81

1+JL+L2J(J−1)/2=1+16+64=811+JL+L^2J(J-1)/2=1+16+64=81: one average, 16 first-order channels and 64 second-order channels (both orientations free, scales j1<j2j_1<j_2 forced to (0,1)(0,1)).

Question 4

Which claim about scattering transforms and trained CNNs is best supported?

  1. Scattering proves that trained CNNs are stable to small adversarial perturbations
  2. Scattering matches end-to-end CNNs on ImageNet without any learned layers
  3. Scattering shows that the nonlinearity in a CNN is unnecessary
  4. Scattering explains how wavelet-like filters, a nonlinearity and pooling build stable invariants, and hybrids with learned layers work well, especially with little data; it does not explain learned class-specific features
Show the answer

D. Scattering explains how wavelet-like filters, a nonlinearity and pooling build stable invariants, and hybrids with learned layers work well, especially with little data; it does not explain learned class-specific features

The theorems concern fixed wavelet cascades. Hybrids matched ResNet-18 only with a learned ResNet on top, and the advantage of the fixed front end is largest in small-data regimes.

Further reading

  • S. Mallat, "Group invariant scattering," Communications on Pure and Applied Mathematics (2012), arXiv:1101.2286.
  • J. Bruna & S. Mallat, "Invariant scattering convolution networks," IEEE Transactions on Pattern Analysis and Machine Intelligence (2013).
  • E. Oyallon, E. Belilovsky & S. Zagoruyko, "Scaling the scattering transform: Deep hybrid networks," ICCV (2017).
  • T. Wiatowski & H. Bölcskei, "A mathematical theory of deep convolutional neural networks for feature extraction," IEEE Transactions on Information Theory (2018).
  • S. Mallat, "Understanding deep convolutional networks," Philosophical Transactions of the Royal Society A (2016).