OCSDF is a method that recasts one-class classification as estimating the signed distance function via a 1-Lipschitz neural network.
It employs a hinge-based HKR loss and Newton–Raphson negative sampling to achieve robust anomaly detection with certified AUROC.
The framework also facilitates generative visualization and implicit surface reconstruction, demonstrating competitive performance on benchmark datasets.
The One-Class Signed Distance Function (OCSDF) is a provable method for robust one-class classification (OCC) based on learning the signed distance function (SDF) to the support boundary of an arbitrary data distribution. OCSDF formulates anomaly detection and OCC as the estimation of the SDF by a neural network constrained to be 1-Lipschitz. This approach enables rigorous robustness guarantees against ℓ2adversarial attacks and introduces the notion of a certified AUROC, providing a verifiable performance metric under worst-case perturbations. In addition to robust anomaly detection, OCSDF facilitates generative visualization and implicit surface reconstruction, making it a versatile framework for OCC and related geometric learning tasks (Bethune et al., 2023).
1. Mathematical Foundations: The Signed Distance Function
Let X∼PX be a continuous distribution on Rd with compact support S. Define the boundary of the support as ∂S=S∖int(S). The Euclidean signed distance function SDF:Rd→R is
and ∥∇xSDF(x)∥2=1 almost everywhere; that is, SDF is 1-Lipschitz in the X∼PX0 norm.
2. Formulating One-Class Classification via SDF Learning
OCSDF recasts OCC—distinguishing X∼PX1 ("inliers") from outliers—as binary classification between
X∼PX2
where X∼PX3 is a “complementary” (synthetic negative) distribution with support separated from X∼PX4 by at least X∼PX5. A 1-Lipschitz network X∼PX6 is trained to minimize the Hinge Kantorovich–Rubinstein (HKR) loss:
X∼PX7
where
X∼PX8
with X∼PX9 for Rd0. The parameter Rd1 sets the margin (Rd2) and Rd3 weights the hinge penalty. A population-risk minimizer Rd4 approximates the offset SDF on each class,
Rd5
and critically, Rd6, making Rd7 a normality score.
3. 1-Lipschitz Network Architecture and HKR Loss Implementation
All affine layers (dense and convolutional) are constrained to be 1-Lipschitz by mapping their weight matrices Rd8 onto the Stiefel manifold (Rd9), accomplished via the differentiable Björck iteration from unconstrained weights S0. Activation functions are chosen as GroupSort or FullSort to ensure piecewise linearity, 1-Lipschitzness, and gradient-norm preservation.
The batchwise HKR loss for S1 positive samples S2 and corresponding negatives S3 is
S4
Training alternates between SGD/RMSProp parameterization and orthogonal reprojected updates for Lipschitz constraints.
Newton–Raphson Negative Sampling
Outlier samples S5 are generated via backpropagation with the current classifier S6:
SDF(x)=signS(x)y∈∂Sinf∥x−y∥2,1
Full OCSDF training alternates between positive batch sampling, negative sampling via Algorithm 1, computation of batch HKR loss, and 1-Lipschitz-constrained optimizer steps.
Typical hyperparameters include S7 (tabular) or S8 (images), S9, ∂S=S∖int(S)0 (negative sampling steps), batch size ∂S=S∖int(S)1, and RMSProp or SGD.
4. Robustness and Certified AUROC
Owing to the 1-Lipschitz constraint, for any adversarial perturbation ∂S=S∖int(S)2, the classifier output satisfies
∂S=S∖int(S)3
Thus, positive (∂S=S∖int(S)4) and negative (∂S=S∖int(S)5) classifications can only flip under perturbations exceeding the margin, directly supporting the derivation of a certified AUROC:
∂S=S∖int(S)6
where ∂S=S∖int(S)7 is the pdf of ∂S=S∖int(S)8 for ∂S=S∖int(S)9 and SDF:Rd→R0 the CDF for SDF:Rd→R1, SDF:Rd→R2.
This certified AUROC can be computed from score histograms of the unperturbed network, incurring no extra attack cost.
5. Empirical Benchmarking
OCSDF shows competitive result on both tabular and image OCC benchmarks.
Dataset
Clean AUROC (%)
SDF:Rd→R3
SDF:Rd→R4
MNIST
95.5 ± 0.4
93.2 ± 2.1
78.4 ± 6.4
CIFAR10
57.4 ± 2.1
53.1 ± 2.1
38.4 ± 1.9
For tabular anomaly detection (ODDS/ADBench), OCSDF achieves an average rank of SDF:Rd→R5 compared to IsolationForest's SDF:Rd→R6, and in \texttt{satimage-2} achieves SDF:Rd→R7 AUROC (SOTA SDF:Rd→R8).
Certified AUROC matches closely with empirical results under SDF:Rd→R9-projected gradient descent (PGD) attacks, notably outperforming DeepSVDD and OC-SVM in robust operating regimes.
6. Generative Visualization and Implicit Surface Reconstruction
OCSDF enables generative visualization by starting from latent noise SDF(x)={+infy∈∂S∥x−y∥2,x∈S−infy∈∂S∥x−y∥2,x∈/S0 and iteratively attracting SDF(x)={+infy∈∂S∥x−y∥2,x∈S−infy∈∂S∥x−y∥2,x∈/S1 onto the level set SDF(x)={+infy∈∂S∥x−y∥2,x∈S−infy∈∂S∥x−y∥2,x∈/S2, where SDF(x)={+infy∈∂S∥x−y∥2,x∈S−infy∈∂S∥x−y∥2,x∈/S3 cluster near the learned boundary SDF(x)={+infy∈∂S∥x−y∥2,x∈S−infy∈∂S∥x−y∥2,x∈/S4 and visually resemble real inlier samples.
For 3D point clouds SDF(x)={+infy∈∂S∥x−y∥2,x∈S−infy∈∂S∥x−y∥2,x∈/S5, fitting OCSDF yields SDF(x)={+infy∈∂S∥x−y∥2,x∈S−infy∈∂S∥x−y∥2,x∈/S6 without explicit distance computation. This provides scalable implicit surface parameterization; forward passes cost SDF(x)={+infy∈∂S∥x−y∥2,x∈S−infy∈∂S∥x−y∥2,x∈/S7 versus SDF(x)={+infy∈∂S∥x−y∥2,x∈S−infy∈∂S∥x−y∥2,x∈/S8 (kNN) or SDF(x)={+infy∈∂S∥x−y∥2,x∈S−infy∈∂S∥x−y∥2,x∈/S9 (full pairwise), and applying Marching-Cubes to the learned field produces high-quality meshes.
7. Summary and Scope
OCSDF provides a principled reduction of one-class anomaly detection to learning the SDF via HKR loss in a 1-Lipschitz neural network framework, supporting formal SDF(x)=signS(x)y∈∂Sinf∥x−y∥2,0-robustness certification through the certified AUROC metric. It features a Newton–Raphson negative sampling procedure and achieves robust, competitive performance across structured tabular and image benchmarks. OCSDF also serves as a generative mechanism and an implicit surface parameterization tool, enabling visualization and geometric reconstruction tasks efficiently (Bethune et al., 2023).
“Emergent Mind helps me see which AI papers have caught fire online.”
Philip
Creator, AI Explained on YouTube
Sign up for free to explore the frontiers of research
Discover trending papers, chat with arXiv, and track the latest research shaping the future of science and technology.Discover trending papers, chat with arXiv, and more.