Skip to content

Denoising autoencoder

An autoencoder learns to reconstruct an original observation from a deliberately corrupted input. The target, corruption process and time boundary determine what denoising means.

A denoising autoencoder is an autoencoder trained to reconstruct an original observation from a deliberately corrupted version of it. For a quant researcher, this creates a way to learn features from unlabelled market snapshots while asking the network to cope with damaged inputs. It does not establish that the reconstructed prices are economically correct.

Keep the original; damage the input

Save an observation xx, sample a corrupted version x~\tilde x from a chosen distribution q(x~∣x)q(\tilde x\mid x), then pass the corrupted version through an encoder and decoder:

h=fθ(x~),x^=gϕ(h).h=f_\theta(\tilde x),\qquad \hat x=g_\phi(h).
The loss function compares x^\hat x with the saved original xx. With summed squared error across coordinates, training minimises
1n∑i=1nEx~∼q(⋅∣xi)[∥xi−gϕ(fθ(x~))∥22].\frac{1}{n}\sum_{i=1}^{n} \mathbb{E}_{\tilde x\sim q(\cdot\mid x_i)} \left[\lVert x_i-g_\phi(f_\theta(\tilde x))\rVert_2^2\right].
This averages over training observations and their random corruptions. Masking selected coordinates or adding noise supplies different reconstruction tasks. The original paper used random zero masking; the target was still the uncorrupted example. See Vincent et al., Sections 2.2–2.4.
It is a form of self-supervised learning: targets come from available training observations, without requiring separately annotated outcomes. The hope is that recovering missing information teaches useful dependencies rather than a copying shortcut.

A target error of 0.08

Take a fictional, dimensionless observation x=(1,0)x=(1,0). Mask its first coordinate, producing x~=(0,0)\tilde x=(0,0). Stipulate, rather than fit, the network reconstruction x^=(0.8,0.2)\hat x=(0.8,0.2).

The correct summed squared reconstruction error is

(1−0.8)2+(0−0.2)2=0.04+0.04=0.08.(1-0.8)^2+(0-0.2)^2=0.04+0.04=0.08.

Comparing the reconstruction with the corrupted input would instead give

(0−0.8)2+(0−0.2)2=0.64+0.04=0.68.(0-0.8)^2+(0-0.2)^2=0.64+0.04=0.68.
That changes the learning task: it rewards reproducing the damage. Under the per-coordinate mean squared error convention, divide each sum by two: the values become 0.040.04 and 0.340.34. Neither convention changes which target is correct.
Fictional dimensionless example: original vector (1, 0) is corrupted to (0, 0). The stipulated reconstruction (0.8, 0.2) has summed squared error 0.08 against the original target, versus 0.68 against the wrong corrupted target.
Fictional dimensionless example: original vector (1, 0) is corrupted to (0, 0). The stipulated reconstruction (0.8, 0.2) has summed squared error 0.08 against the original target, versus 0.68 against the wrong corrupted target.
Original illustrative training pair, not a fitted model. Corruption changes the network input; the saved original remains the reconstruction target.

What “clean” can mean

“Clean” means before the added training corruption. A recorded market snapshot can already contain bid–ask effects, stale quotes or measurement error. Reconstructing it does not recover an independently observed, noise-free economic latent state.
There is also irreducible ambiguity. Under a population joint distribution of original and corrupted observations, finite second moments, unrestricted reconstruction functions and exact minimisation of expected squared error, the optimal reconstruction is the conditional expectation
r∗(x~)=E[X∣X~=x~].r^*(\tilde x)=\mathbb{E}[X\mid\tilde X=\tilde x].
Several originals can produce the same damaged input, so this conditional average need not equal any particular original. A finite fitted network need not attain that population optimum. Deep Learning, Section 14.5 develops the denoising objective and its reconstruction interpretation.

The corruption distribution is therefore a modelling choice: training on small independent perturbations does not certify robustness to a market regime change. Masking a genuine zero also leaves its missingness ambiguous unless the input design supplies that information.

Different regularisers, and a clock

A contractive autoencoder explicitly penalises the encoder's input Jacobian. A sparse autoencoder penalises code activations to encourage sparsity. Denoising instead changes the input–target pairing. These mechanisms can be combined, but their objectives are distinct; see Deep Learning, Sections 14.2 and 14.7.
For a historical forecasting experiment, fit scaling and the autoencoder only on observations eligible at the fitting date. Select corruption strength and architecture using a suitable validation period, then evaluate the downstream task on later held-out data. Pretraining on future market observations can introduce look-ahead bias even without return labels. Learned preprocessing must respect the same fitting boundary, as explained in scikit-learn's data-leakage guidance. Lower reconstruction error alone is not evidence of a better forecast.
For the underlying architecture, Autoencoders and Representation Learning Through Reconstruction has a public preview; the full lesson requires membership.

Sources

Last updated
  • autoencoders
  • representation learning
  • self supervised learning
  • regularisation
← Back to the glossaryBack to top ↑