🤖 AI Summary
Supervised deep learning suffers from “generalization collapse” on high-dimensional tabular data: while models perfectly fit the training distribution, they fail zero-shot out-of-distribution (OOD) anomaly detection. We identify the root cause as the absence of topological constraints in latent space, leading to manifold diffusion and indistinguishability between OOD samples and in-distribution data. To address this, we propose the first dual-stage explicit manifold learning framework. Stage I introduces a Dual-Centroid Compactness Loss to enforce compact, low-entropy hyperspherical clusters in latent space. Stage II builds a Masked Autoregressive Flow (MAF) density estimator atop this pre-structured manifold, decoupling manifold geometry learning from density modeling. Integrating a 1D-CNN with a Transformer encoder, our method achieves an F1-score of 0.87 on zero-shot evaluation of CIC-IDS-2017, with 88.89% detection rate for the Infiltration attack—substantially outperforming supervised baselines (0.00%) and the strongest unsupervised baseline (76.00%).
📝 Abstract
A fundamental limitation of supervised deep learning in high-dimensional tabular domains is"Generalization Collapse": models learn precise decision boundaries for known distributions but fail catastrophically when facing Out-of-Distribution (OOD) data. We hypothesize that this failure stems from the lack of topological constraints in the latent space, resulting in diffuse manifolds where novel anomalies remain statistically indistinguishable from benign data. To address this, we propose Latent Sculpting, a hierarchical two-stage representation learning framework. Stage 1 utilizes a hybrid 1D-CNN and Transformer Encoder trained with a novel Dual-Centroid Compactness Loss (DCCL) to actively"sculpt"benign traffic into a low-entropy, hyperspherical cluster. Unlike standard contrastive losses that rely on triplet mining, DCCL optimizes global cluster centroids to enforce absolute manifold density. Stage 2 conditions a Masked Autoregressive Flow (MAF) on this pre-structured manifold to learn an exact density estimate. We evaluate this methodology on the rigorous CIC-IDS-2017 benchmark, treating it as a proxy for complex, non-stationary data streams. Empirical results demonstrate that explicit manifold sculpting is a prerequisite for robust zero-shot generalization. While supervised baselines suffered catastrophic performance collapse on unseen distribution shifts (F1 approx 0.30) and the strongest unsupervised baseline achieved only 0.76, our framework achieved an F1-Score of 0.87 on strictly zero-shot anomalies. Notably, we report an 88.89% detection rate on"Infiltration"scenarios--a complex distributional shift where state-of-the-art supervised models achieved 0.00% accuracy. These findings suggest that decoupling structure learning from density estimation provides a scalable path toward generalized anomaly detection.