A deep belief network (DBN) is a probabilistic generative model with several layers of stochastic hidden units. It is built by stacking restricted Boltzmann machines (RBMs), trained one layer at a time without labels, and then fine-tuned as a whole. That greedy layer-wise recipe, from Hinton, Osindero and Teh in 2006, was one of the first effective ways to train deep networks. ReLU activations and dropout now let plain backpropagation train deep networks without RBM pretraining. A DBN still makes sense in a few cases: the inputs have no spatial structure, labels are scarce but unlabelled data is plentiful, or the goal is a compact learned code.
How a Deep Belief Network Is Put Together
The building block is the RBM. An RBM is a bipartite graph: visible units that represent observations connect to binary stochastic hidden units through undirected weighted connections, and there are no visible-to-visible or hidden-to-hidden links. Because there are no links inside a layer, the hidden units are conditionally independent given the visible units, and the reverse also holds. That makes sampling the hidden vector from the visible one, and back again, cheap.
Stack several RBMs so that each one’s hidden layer becomes the visible layer of the next, and you have the skeleton of a DBN. The finished model mixes undirected and directed connections. In Hinton’s own description, the top two layers have undirected, symmetric connections and form an associative memory, the lower layers receive directed, top-down connections from the layer above, and the lowest layer holds the data vector. The hidden units usually take binary values and are often called feature detectors.
A DBN is an RBM that defines a prior over the top hidden layer of a directed belief net, plus a set of “recognition” weights that perform fast approximate inference. Keep that hybrid shape in mind: it matters for the naming question further down. A DBN is also distinct from a deep Boltzmann machine, which is a different model.
How Is a Deep Belief Network Trained, and What Does Greedy RBM Pretraining Do?
A deep belief network is trained in two phases. First comes unsupervised, greedy, layer-wise pretraining, in which each layer is trained as an RBM on the output of the layer below. Then a fine-tuning phase adjusts all the weights together, either to improve the generative model or for a supervised task.
Contrastive Divergence Trains Each RBM
Exact maximum-likelihood training of an RBM is hard. The joint expectations in the gradient sum over every possible configuration of both hidden and visible units, which is intractable. Contrastive divergence (CD), Hinton’s 2002 method, approximates the joint expectations instead. It runs Gibbs sampling, starting from an observed data point, to obtain a reconstruction, and then uses that single sample in place of the full expectation. Hinton’s 2002 paper used just one Gibbs iteration for this step.
The Greedy Procedure, Step by Step
This is the recursive greedy procedure developed by Hinton et al. (2006):
- Fit the first RBM to the training data with contrastive divergence, treating all the higher weight matrices as tied to this one.
- Freeze those weights, and use samples from the hidden posterior p(h¹|v) as the training data for the next RBM.
- Repeat for as many layers as you want.
- Fine-tune the whole stack. The original paper uses the “up-down” algorithm, a contrastive version of wake-sleep, for a generative model. For a classifier, add an output layer and backpropagate error derivatives.
Why should adding a layer help, rather than only adding parameters? The 2006 paper uses a variational bound to show that the overall generative model improves as each layer is added. If the new layer is initialised with the transpose of the layer below, the lower bound on the log-likelihood is guaranteed to improve, although the log-likelihood itself can fall. Once the weights are untied, the priors on the lower layers stop being complementary, and using the transposed generative weights for inference is no longer exactly correct. The bound still shows that adapting the higher weights improves the model.
Hinton and co-authors are clear that learning one layer at a time is efficient but not optimal. A later back-fitting stage revises the weights learned first. The up-down algorithm unties the recognition weights from the generative weights, keeps a factorial approximation to each layer’s posterior, and lets the higher-level weights influence the lower ones. It avoids the mode-averaging problem that can make plain wake-sleep learn poor recognition weights.
The discriminative route uses backpropagation instead. The pretrained recognition weights become the weights of an ordinary feed-forward network, which backpropagation then fine-tunes. Dahl et al. used this pipeline for acoustic modelling, with greedy CD pretraining followed by purely discriminative backpropagation. Their best DBN reached a 23.0% phone error rate on the TIMIT core test set. That model used four layers of 2,048 hidden units and a 128-unit bottleneck before the output softmax, and its phone error rate was 1.4 percentage points lower than the best method previously reported.
The original paper’s MNIST result shows both the accuracy and the training cost. With no built-in knowledge of geometry, the network reached 1.25% test error. That beat the 1.5% of the best backpropagation nets not handcrafted for the task and the 1.4% Decoste and Schoelkopf (2002) reported for support vector machines. The full training took about a week.
Why Pretraining Helped at the Time
Two explanations were tested. Bengio et al. (2007) found that greedy unsupervised pretraining mostly helps optimisation, by starting the weights near a good local minimum. They also found that autoencoders could stand in for RBMs and still perform comparably to a DBN. Erhan et al. (2010) argued for a regularisation account: pretraining steers learning towards minima that generalise better, acting like a prior on the parameters. In their experiments they could not train 5-layer models effectively without unsupervised pretraining. They also found that with layers that were too small, pretrained deep networks did worse than randomly initialised ones. That last finding is worth remembering before anyone pretrains a narrow network out of habit.
Is a Deep Belief Network a Bayesian Belief Network, or Does It Just Share the Name?
The name is shared, but a DBN is not purely a directed belief network. The RBMs it is built from are Markov networks (Markov random fields), because their links are undirected. The DBN itself is a mixed model: the top pair of layers is undirected and the layers below are directed. Hinton, Osindero and Teh describe their algorithm as learning “deep, directed belief networks” one layer at a time, provided the top two layers form an undirected associative memory.
That directed lower section is what makes it a belief net. Radford Neal’s 1992 sigmoid belief networks are directed probabilistic belief networks, and their directed connections remove the “negative phase” that Boltzmann machine learning needs. RBMs are closely related to sigmoid belief networks, and that resemblance is the intuition behind training a stack of RBMs as pretraining for a multi-layer network.
Bayesian networks have their own history. Judea Pearl coined the term in 1985 to stress Bayes’ conditioning and the distinction between causal and evidential reasoning. A Bayesian network is a complete model of its variables that can answer probabilistic queries, such as updating beliefs about some variables when others are observed. In a Bayesian network, the nodes are the model’s variables, which it can answer probabilistic queries about. In a DBN, they are learned feature detectors. DBN learning had to work around “explaining away”, which makes posterior inference hard in densely connected directed nets. If you came here looking for a probabilistic model you can query about named causes, a DBN is the wrong tool.
Deep Belief Network vs Neural Network: Same Weights, Different Route
A DBN and a standard feed-forward network can share the same parameters. A stack of trained RBMs maps directly onto a deterministic multi-layer network with sigmoid units, so the DBN’s weights can initialise the first layers of a classifier, with extra output layers added on top. The difference is how the weights get their starting values, and the fact that a DBN is also a generative model of its input.
The 2021 tutorial by Ghojogh and colleagues notes that ReLU activations (Glorot et al., 2011) and dropout (Srivastava et al., 2014) prevented overfitting and resolved vanishing gradients without RBM pretraining, so backpropagation could be used alone. Glorot, Bordes and Bengio (2011) put it more carefully: rectifier units narrow the gap between pretraining and no pretraining, and rectifier networks still improved after unsupervised pretraining in a semi-supervised setting. The accurate summary is that pretraining stopped being necessary for depth, not that unlabelled data stopped being useful.
When Does It Still Make Sense to Use a Deep Belief Network Instead of a CNN or a Transformer?
A deep belief network is worth considering when three conditions overlap: the input carries no meaningful local structure, labelled examples are scarce, and plenty of unlabelled data comes from the same input space. Outside those conditions, a convolutional network or a transformer is the stronger default.
One study removes the assumption CNNs depend on. A study comparing CNN and DBN image classifiers on MNIST and CIFAR-10 argues that a CNN’s convolutional kernels encode a strong inductive bias about neighbouring pixels. When the authors mixed up the pixels of MNIST images, CNN accuracy degraded while the DBNs held the accuracy they had before the change. The same study found that a CNN’s advantage with many training samples shrank as labelled examples decreased. DBN pretraining on unlabelled data reduced the number of labels needed for fine-tuning.
A 2017 comparative study on predicting pre-miRNA found that a CNN on raw sequences performed similarly to or slightly better than a feature-based DBN, with best accuracies of 0.995 and 0.990 respectively. In the same study, the DBN kept 0.968 accuracy on a large set of 58 unselected features, which the authors read as the DBN handling many unselected features well.
With a small top layer, a DBN performs non-linear dimensionality reduction and can learn short binary codes for very fast document or image retrieval.
Decision Table: DBN, CNN or Transformer
| Your situation | Lean towards | What supports it |
|---|---|---|
| Inputs are images with strong local structure and labels are plentiful | CNN | CNNs keep their advantage when training samples are many |
| Pixel order carries no locality (shuffled, permuted) | DBN worth testing | DBNs held accuracy on pixel-mixed MNIST where CNNs fell |
| Few labels, many unlabelled examples from the same input space | DBN-style pretraining worth testing | Pretraining on unlabelled data reduced the labels needed |
| Long vector of engineered features | Either; expect a close result | 0.990 DBN against 0.995 CNN on pre-miRNA |
| Short binary codes for fast retrieval | DBN with a small top layer | Hinton’s account of DBN dimensionality reduction |
| You need a good likelihood or density estimate | Not a DBN by default | DBNs lost on likelihood even to simple mixture models |
| Large corpora, long-range context, modern tooling | Transformer | No study here favours a DBN in this regime |
The transformer row is our judgement, not a measured result. If you want the comparison that does have evidence behind it, our explainer on the vision transformer and how ViT compares with CNN detectors covers it, and the general mechanism is covered in what transformers are in deep learning.
The Limits That Measurement Exposes
A DBN’s likelihood is computationally intractable. The probability an RBM assigns to the data is known only up to a computationally intractable normalising constant, the partition function. Theis et al. (2011) note that this intractability had kept many DBN analyses qualitative, based on samples. When they did measure likelihood, the DBN was outperformed even by very simple mixture models.
Depth does not always pay off either. Salakhutdinov and Murray estimated a lower bound of −86.22 nats for a DBN against −86.34 for a carefully trained single-layer RBM. That is too close to call the deeper model better, and it is consistent with earlier claims that extra layers do not help when the first RBM already models the data well.
The original MNIST work also left distorted training data untried. A convolutional network trained with elastic deformations by Simard, Steinkraus and Platt (2003) reached 0.4% error. The DBN authors had not yet tried distorted data, partly because their fine-tuning algorithm was too slow.
What This Means for a Computer Vision System
Camera images are the data a convolutional prior is designed for. On a line-side inspection camera, for example, defects are local patterns of neighbouring pixels, the assumption a convolutional kernel encodes. TechnoLynx’s Computer Vision R&D builds detection, recognition and anomaly detection systems for such image inputs. A DBN only becomes interesting when that assumption breaks, for instance when a model consumes per-part feature vectors or sensor readings instead of pixels. Whatever the architecture, a line-side model also depends on the artefacts that keep a line-side inspection model reliable in production. Keeping such a model versioned, monitored and retrained once it is deployed is the subject of our MLOps engineering work.
The unsupervised pretraining idea behind DBNs has support of its own. Erhan et al. found that representations learned from unlabelled inputs gave better generalisation, an advantage that in their MNIST-based experiments with DBNs and stacked denoising autoencoders did not shrink as training sets grew. The question to settle before committing training budget is not whether to use a DBN. It is whether your inputs have the structure a CNN assumes, and whether your unlabelled data outnumbers your labels enough to be worth learning from.
FAQ
Is a CNN an Architecture?
Yes. A convolutional neural network is a family of architectures defined by convolutional layers that share weights across positions in the input. VGG-16 and ResNet are specific architectures within that family.
Can You Explain the Architecture of a Deep Neural Network?
A deep neural network is a stack of layers, each applying a learned linear transformation followed by a non-linearity, with the output of one layer feeding the next. A trained DBN’s parameters can initialise the first layers of a corresponding sigmoid feed-forward network.