[Paper Review] Why Normalizing Flows Fail to Detect Out-of-Distribution Data
The paper analyzes why normalizing flows often misclassify OOD data as in-distribution and shows that their inductive biases cause them to rely on local pixel correlations rather than semantic structure; it demonstrates architectural changes to improve OOD detection and highlights benefits of using semantic features.
Detecting out-of-distribution (OOD) data is crucial for robust machine learning systems. Normalizing flows are flexible deep generative models that often surprisingly fail to distinguish between in- and out-of-distribution data: a flow trained on pictures of clothing assigns higher likelihood to handwritten digits. We investigate why normalizing flows perform poorly for OOD detection. We demonstrate that flows learn local pixel correlations and generic image-to-latent-space transformations which are not specific to the target image dataset. We show that by modifying the architecture of flow coupling layers we can bias the flow towards learning the semantic structure of the target data, improving OOD detection. Our investigation reveals that properties that enable flows to generate high-fidelity images can have a detrimental effect on OOD detection.
Motivation & Objective
- Identify why normalizing flows fail to detect OOD data despite exact likelihoods.
- Analyze the inductive biases of coupling-layer flows that hamper OOD detection.
- Visualize latent representations to understand what semantic information flows capture.
- Propose architectural adjustments to coupling layers and masking strategies to bias flows toward semantic structure.
- Evaluate the impact of semantically rich embeddings on OOD detection with flows.
Proposed method
- Analyze log-likelihood behavior of RealNVP/flow-based models on in- and out-of-distribution datasets (e.g., ImageNet, CelebA, SVHN).
- Visualize intermediate coupling layer activations and learned s (scale) and t (shift) parameters to understand local vs. semantic representations.
- Investigate how coupling-layer mechanisms (local pixel correlations and co-adaptation) drive high likelihoods for both in- and out-of-distribution data.
- Experiment with masking strategies (checkerboard, horizontal, cycle-mask) to assess effects on OOD detection.
- Introduce bottlenecks in the st-networks to limit capacity and reduce dependence on local pixel correlations.
- Demonstrate improved OOD detection when flows are trained on high-level semantic embeddings rather than raw pixels.
Experimental results
Research questions
- RQ1What inductive biases in normalizing flows cause poor OOD detection?
- RQ2Do local pixel correlations and coupling-layer co-adaptation enable flows to assign high likelihood to OOD data?
- RQ3Can architectural changes to coupling layers or masking strategies shift flows toward semantic representations to improve OOD detection?
- RQ4Does training on high-level semantic embeddings enhance OOD detection compared to raw pixel training?
Key findings
- Flows learn latent representations based on local graphical structure rather than semantic content, hindering semantic OOD detection.
- Coupling layers can predict masked pixels accurately on both in- and out-of-distribution data, driving high likelihood for diverse structured images.
- Changing masking strategies or introducing bottlenecks in st-networks reduces coupling-layer co-adaptation and improves OOD ranking of in-distribution data.
- Training flows on image embeddings with semantic content markedly improves OOD detection compared to raw-pixel training.
- OOD detection improves when using high-level features (embeddings) rather than raw pixel data, achieving clearer separation between in-distribution and OOD datasets.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.