Dynamic Bayesian Neural Networks

Lorenzo Rimella, Nick WhiteleyarXiv 2020 · OpenReview

TL;DR

This paper introduces Hidden Markov Neural Networks (HMNNs), a novel framework that models neural network weights as the hidden states of a Hidden Markov Model. This allows for dynamic adaptation to new data while appropriately forgetting outdated information, addressing a key challenge in time-series forecasting and continual learning. HMNNs achieve strong predictive performance and effective uncertainty quantification across various tasks.

What Problem Does This Paper Address?

The core challenge this paper tackles is how to build neural networks that can learn and adapt over time in dynamic environments, a problem crucial for tasks like time-series forecasting and continual learning. Traditional neural networks often struggle with "catastrophic forgetting," where learning new information leads to the erasure of previously learned knowledge. Conversely, models that rigidly retain all past information can become outdated and perform poorly on new data. The authors aim to strike a balance: enabling networks to adapt to evolving data distributions while also retaining a memory of past patterns, and crucially, quantifying the uncertainty associated with their predictions.

Methods

The paper proposes Hidden Markov Neural Networks (HMNNs), which frame the weights of a neural network as the hidden states of a Hidden Markov Model (HMM). This means the network's weights are not static but evolve over time according to a Markovian process.

Key methodological contributions include:

  • Modeling Weights as Hidden States: The core idea is to treat the neural network's weights ($W_t$) at time $t$ as the hidden states of an HMM. The observed data ($D_t$) is then modeled as being dependent on these evolving weights.
  • Variational Inference for Weight Posterior: Since computing the exact posterior distribution over network weights is intractable, the authors employ variational inference. They use a filtering algorithm to learn a variational approximation of the evolving-in-time posterior distribution over the weights.
  • Sequential Bayes by Backprop: The HMNN framework builds upon the "Bayes by Backprop" algorithm, adapting it for sequential learning. This involves a recursive update of the variational approximation of the weight posterior.
  • Variational DropConnect: A novel regularization technique is introduced, called variational DropConnect. This technique, inspired by DropConnect and Dropout, is integrated into the variational approximation to improve regularization and prevent overfitting. It's described as a "stronger regularization technique."
  • Factorial Hidden Markov Model (FHMM): The authors note that their HMNN formulation, under the assumption of independent weight evolution, corresponds to a Factorial Hidden Markov Model.

Datasets

The paper evaluates HMNNs on several datasets:

  • MNIST: Used for classification tasks, including demonstrating the effectiveness of variational DropConnect and in a conceptual drift scenario.
  • "Two Moons" Dataset: A synthetic dataset used to illustrate the HMNN's ability to handle dynamic classification and quantify uncertainty in evolving scenarios.
  • Video Dataset (Waving Flag): Used for next-frame forecasting, demonstrating the HMNN's capability in time-series prediction tasks.

Key Insights and Ideas

  • Dynamic Weights for Dynamic Data: The fundamental insight is that for tasks involving evolving data, the neural network's internal parameters (weights) should also evolve dynamically, rather than being fixed after initial training.
  • HMMs as a Natural Framework for Evolving Weights: By framing weight evolution as a Markovian process, HMMs provide a principled way to model this dynamic adaptation, allowing for both learning and forgetting.
  • Uncertainty Quantification is Key: The Bayesian approach inherent in HMNNs allows for explicit quantification of uncertainty in predictions. This is crucial for understanding the reliability of the model's outputs, especially in dynamic or uncertain environments.
  • Variational DropConnect as a Powerful Regularizer: The introduction of variational DropConnect appears to be a significant contribution, showing improved performance over standard Bayes by Backprop, suggesting its effectiveness in regularizing dynamic Bayesian neural networks.
  • Balancing Adaptation and Forgetting: HMNNs offer a mechanism to balance the need to adapt to new data with the desire to retain useful past knowledge, a critical aspect of continual learning.

Key Results

  • Improved Performance on MNIST: HMNNs with variational DropConnect achieved better classification accuracy on MNIST compared to standard Bayes by Backprop. For example, with $\gamma^\nu = 0.25$, the accuracy was 0.9838, while Bayes by Backprop ($\gamma^\nu = 1$) achieved 0.9814.
  • Effective Uncertainty Quantification: Experiments on the "two moons" dataset demonstrated that HMNNs can effectively quantify uncertainty, showing higher uncertainty in overlapping regions and regions with no observed data.
  • Concept Drift Recovery: HMNNs successfully recovered oscillating true parameters in a logistic regression concept drift scenario, outperforming or matching other methods.
  • Competitive Performance in Continual Learning: In a conceptual drift scenario on MNIST, HMNNs performed comparably to or better than established continual learning baselines like EWC and VCL, achieving an accuracy of 0.786, close to the best performing methods.
  • Strong Next-Frame Prediction: For video frame prediction, HMNNs achieved the best performance among the tested baselines, with a metric M value of 0.1891, outperforming LSTM (0.2080) and sequential Bayes by Backprop (0.1932).

Limitations and Future Work

  • Approximation Quality: The paper acknowledges that the quality of the variational approximation is not explicitly studied, and the rate of error accumulation over time remains an open question. Future work could involve theoretical studies on variational approximations.
  • No Smoothing Algorithm: The current HMNN formulation does not include a smoothing algorithm, which could potentially improve performance and enable EM estimation of hyperparameters.
  • Simple Architectures: The experiments primarily focused on simple feed-forward neural networks. The authors suggest extending HMNNs to more complex architectures like recurrent neural networks (RNNs) and convolutional neural networks (CNNs) for more challenging applications.
  • Variational DropConnect Generalization: The authors propose exploring the application of variational DropConnect in other variational Bayes scenarios to assess its broader benefits.
  • Hyperparameter Optimization: While grid search was used, more sophisticated hyperparameter optimization techniques could be explored.

Summary updated

Abstract

We define an evolving in-time Bayesian neural network called a Hidden Markov Neural Network, which addresses the crucial challenge in time-series forecasting and continual learning: striking a balance between adapting to new data and appropriately forgetting outdated information. This is achieved by modelling the weights of a neural network as the hidden states of a Hidden Markov model, with the observed process defined by the available data. A filtering algorithm is employed to learn a variational approximation of the evolving-in-time posterior distribution over the weights. By leveraging a sequential variant of Bayes by Backprop, enriched with a stronger regularization technique called variational DropConnect, Hidden Markov Neural Networks achieve robust regularization and scalable inference. Experiments on MNIST, dynamic classification tasks, and next-frame forecasting in videos demonstrate that Hidden Markov Neural Networks provide strong predictive performance while enabling effective uncertainty quantification.
BibTeX
@misc{rimella2020dynamic,
  author = {Lorenzo Rimella and Nick Whiteley},
  title = {{Dynamic Bayesian Neural Networks}},
  year = {2020},
  eprint = {2004.06963},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.06963},
}

Loading related content...

Figure