Papers
Topics
Authors
Recent
Search
2000 character limit reached

One-Class Signed Distance Function (OCSDF)

Updated 1 July 2026
  • 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 2\ell_2 adversarial 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 XPXX\sim\mathbb P_X be a continuous distribution on Rd\mathbb R^d with compact support S\mathcal S. Define the boundary of the support as S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S). The Euclidean signed distance function SDF:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb R is

SDF(x)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}

or equivalently,

SDF(x)=signS(x)  infySxy2,\mathrm{SDF}(x)=\mathrm{sign}_{\mathcal S}(x)\;\inf_{y\in\partial\mathcal S}\|x-y\|_2,

where

signS(x)={+1,xS 1,xS\mathrm{sign}_{\mathcal S}(x)= \begin{cases} +1,&x\in\mathcal S \ -1,&x\notin\mathcal S \end{cases}

and xSDF(x)2=1\|\nabla_x\mathrm{SDF}(x)\|_2=1 almost everywhere; that is, SDF is 1-Lipschitz in the XPXX\sim\mathbb P_X0 norm.

2. Formulating One-Class Classification via SDF Learning

OCSDF recasts OCC—distinguishing XPXX\sim\mathbb P_X1 ("inliers") from outliers—as binary classification between

XPXX\sim\mathbb P_X2

where XPXX\sim\mathbb P_X3 is a “complementary” (synthetic negative) distribution with support separated from XPXX\sim\mathbb P_X4 by at least XPXX\sim\mathbb P_X5. A 1-Lipschitz network XPXX\sim\mathbb P_X6 is trained to minimize the Hinge Kantorovich–Rubinstein (HKR) loss:

XPXX\sim\mathbb P_X7

where

XPXX\sim\mathbb P_X8

with XPXX\sim\mathbb P_X9 for Rd\mathbb R^d0. The parameter Rd\mathbb R^d1 sets the margin (Rd\mathbb R^d2) and Rd\mathbb R^d3 weights the hinge penalty. A population-risk minimizer Rd\mathbb R^d4 approximates the offset SDF on each class,

Rd\mathbb R^d5

and critically, Rd\mathbb R^d6, making Rd\mathbb R^d7 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 Rd\mathbb R^d8 onto the Stiefel manifold (Rd\mathbb R^d9), accomplished via the differentiable Björck iteration from unconstrained weights S\mathcal S0. Activation functions are chosen as GroupSort or FullSort to ensure piecewise linearity, 1-Lipschitzness, and gradient-norm preservation.

The batchwise HKR loss for S\mathcal S1 positive samples S\mathcal S2 and corresponding negatives S\mathcal S3 is

S\mathcal S4

Training alternates between SGD/RMSProp parameterization and orthogonal reprojected updates for Lipschitz constraints.

Newton–Raphson Negative Sampling

Outlier samples S\mathcal S5 are generated via backpropagation with the current classifier S\mathcal S6:

SDF(x)=signS(x)  infySxy2,\mathrm{SDF}(x)=\mathrm{sign}_{\mathcal S}(x)\;\inf_{y\in\partial\mathcal S}\|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 S\mathcal S7 (tabular) or S\mathcal S8 (images), S\mathcal S9, S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S)0 (negative sampling steps), batch size S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S)1, and RMSProp or SGD.

4. Robustness and Certified AUROC

Owing to the 1-Lipschitz constraint, for any adversarial perturbation S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S)2, the classifier output satisfies

S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S)3

Thus, positive (S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S)4) and negative (S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S)5) classifications can only flip under perturbations exceeding the margin, directly supporting the derivation of a certified AUROC:

S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S)6

where S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S)7 is the pdf of S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S)8 for S=Sint(S)\partial\mathcal S = \overline{\mathcal S} \setminus \mathrm{int}(\mathcal S)9 and SDF:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb R0 the CDF for SDF:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb R1, SDF:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb 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:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb R3 SDF:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb 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:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb R5 compared to IsolationForest's SDF:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb R6, and in \texttt{satimage-2} achieves SDF:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb R7 AUROC (SOTA SDF:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb R8).

Certified AUROC matches closely with empirical results under SDF:RdR\mathrm{SDF}:\mathbb R^d\to\mathbb 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)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}0 and iteratively attracting SDF(x)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}1 onto the level set SDF(x)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}2, where SDF(x)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}3 cluster near the learned boundary SDF(x)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}4 and visually resemble real inlier samples.

For 3D point clouds SDF(x)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}5, fitting OCSDF yields SDF(x)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}6 without explicit distance computation. This provides scalable implicit surface parameterization; forward passes cost SDF(x)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}7 versus SDF(x)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}8 (kNN) or SDF(x)={+infySxy2,xS infySxy2,xS\mathrm{SDF}(x) = \begin{cases} +\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\in\mathcal S \ -\inf_{y\in\partial\mathcal S}\,\|x-y\|_2, & x\notin\mathcal S \end{cases}9 (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)  infySxy2,\mathrm{SDF}(x)=\mathrm{sign}_{\mathcal S}(x)\;\inf_{y\in\partial\mathcal S}\|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).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to One-Class Signed Distance Function (OCSDF).