Abstract
Learning generative models with sparse, compositional features is a shared goal of neuroscience and machine learning. While Sparse Coding Variational Autoencoders (SVAEs) aim to combine the biological realism of sparse coding with the efficiency of VAEs, they frequently suffer from "over-pruning," where most latent components remain unoptimized. We demonstrate that a unit $L_2$ norm constraint on decoder weights—mimicking biological lateral inhibition—significantly improves training. This weight normalization increases the number of active filters and produces clear, Gabor-like receptive fields, leading to superior image reconstructions on natural image patches and MNIST.
Introduction
In theoretical neuroscience, neurons in the primary visual cortex (V1) are understood to represent visual information using sparse, parts-based codes. Traditional sparse coding models successfully replicate these Gabor-like receptive fields but are computationally intensive. The Sparse Coding Variational Autoencoder (SVAE) was introduced to bridge this gap, offering a faster, end-to-end trainable framework. However, SVAEs often fail to utilize their full capacity, leaving many decoding filters as noise—a phenomenon known as over-pruning.
Methodology
To address the under-optimization of filters in SVAEs, we propose three key training heuristics:
- $\beta$-Weighting: By setting $\beta < 1$ for the KL divergence term, we reduce the initial pressure for sparsity, allowing latent units more time to capture data structure before being pruned.
- Expressive Encoders: Replacing linear layers with ResNet blocks allows the encoder to better approximate the complex posterior distribution of the data.
- Weight Normalization: This is the most critical intervention. By constraining each decoder filter to have a unit $L_2$ norm, we prevent a few filters from dominating the reconstruction. This forces the model to distribute representation across more filters, effectively implementing a form of local lateral inhibition where neurons compete to represent features.
Results
We evaluated our "SVAE-Norm" model against standard SVAE and traditional sparse coding using $16 \times 16$ whitened natural image patches.
Qualitative Filter Analysis
The impact of weight normalization is most evident in the learned decoding filters. In a standard SVAE, a large portion of the filters remain noise-like, representing a failure to learn. SVAE-Norm, however, recovers a much larger set of structured, Gabor-like edge detectors, comparable to traditional sparse coding but learned more efficiently.
Quantitative Performance and Reconstruction
Quantitatively, SVAE-Norm significantly outperformed its counterparts. In a model with 450 potential filters, SVAE-Norm optimized 374 active filters, compared to only 154 in the standard SVAE. This increased capacity translated directly to better reconstruction accuracy. SVAE-Norm achieved a Mean Squared Error (MSE) of 0.00769, notably lower than standard SVAE (0.00875) and traditional sparse coding (0.0150).
Discussion and Conclusion
Our results highlight that weight normalization is a powerful tool for learning sparse representations. By leveling the "importance" of filters, we force the model to utilize more of its latent space, leading to more biologically plausible features and better performance. This mathematical constraint mirrors biological lateral inhibition, suggesting that such competitive mechanisms are essential for efficient sensory coding.
While SVAE-Norm represents a significant step forward, the inference process in VAEs remains noisier than iterative sparse coding methods. Future work will explore scaling these techniques to hierarchical models to investigate the emergence of higher-level visual features like shapes and objects.
Summary updated