Abstract
Normalizing Flows (NFs) are powerful density estimators but suffer from sensitivity to outliers and small sample sizes, particularly in high-dimensional spaces. We present a KL divergence regularization technique that stabilizes NF training by effectively incorporating "virtual" samples. This method addresses the low-rank failure mode of empirical covariance matrices in NFs. Our results demonstrate significant improvements in Out-of-Distribution (OoD) detection, with performance gains of up to 30% across various image benchmarks.
The Sensitivity Problem in Normalizing Flows
Normalizing Flows learn invertible mappings between complex data and simple base distributions. However, they face a critical "sensitivity problem." In high-dimensional spaces with sparse data, the estimated covariance matrix often becomes low-rank or singular. This makes the flow's transformation—which relies on the inverse of this matrix—unstable. Furthermore, even a single outlier can drastically warp the estimated density manifold, causing the model to overfit to noise.
Deep NFs can be viewed as collections of local linear projections. If an outlier is isolated, the model may treat it as its own local neighborhood with only one sample, triggering a low-rank failure that biases the entire global density estimation.
Methods: KL Divergence Regularization
To combat this, the authors propose KL Divergence Regularization on the Jacobian matrix of the NF.
- The Theory: For a linear NF, adding a KL divergence term between the model's transformation matrix and a prior positive definite matrix $G$ is mathematically equivalent to adding "virtual" training samples whose covariance is $G$. By choosing $G$ to be the identity matrix, they effectively "fill in" the missing ranks of the empirical covariance matrix.
- Practical Implementation: Calculating the full Jacobian for deep NFs is computationally expensive. The authors instead derive an upper bound, regularizing the Frobenius norm of weights in coupling layers and the scaling factors produced by internal networks. This provides a computationally efficient shortcut to achieve robustness.
Experimental Results and Impact
The method was evaluated on standard benchmarks like CIFAR-10/100 against various Out-of-Distribution (OoD) datasets, including Rot-RGB, Noisy Cifar, QuickDraw, and Tiny-ImageNet.
Key findings include:
- Significant OoD Detection Boost: ROC-AUC for detecting "QuickDraw" samples improved by 36.5% using the Information Bottleneck objective.
- Noise Robustness: Regularized models maintained high accuracy even when training data was corrupted with Gaussian noise, while unregularized models saw performance collapse.
- Data Efficiency: A regularized NF trained on only 20% of a dataset outperformed an unregularized NF trained on the full dataset.
Conclusion
KL Divergence Regularization offers a theoretically grounded and practically efficient way to stabilize Normalizing Flows. By treating mathematical regularization as "virtual data," this approach solves the inherent sensitivity of NFs to outliers and small sample sizes, making them far more reliable for real-world anomaly detection tasks.
Summary updated