SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.01978 · ICML · 2023

Robust One-Class Classification with Signed Distance Function using 1-Lipschitz Neural Networks

Louis Béthune, Paul Novello, Thibaut Boissin, Mathieu Serrurier, Guillaume Coiffier, Quentin Vincenot, Andres Troya-Galvis, Louis Bethune

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 11 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2303.01978.json · badge: /api/ran/2303.01978.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
algue-rythme/oneclassmetriclearning canonical (classifier label)
classifier basis not recorded on the link
11 ran · 2 no recorded run
FunctionStatusWhere it lives
build_ds_from_numpy Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/datasets.py
code served (permissive licence) · get_code("d440e8e5446965ab")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned _PrefetchDataset. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import tensorflow as tf

# Create a small numpy array with shape (N, F) where N=6 samples, F=4 features
x = np.random.randn(6, 4).astype('float32')

# Define batch_size
batch_size = 2

# Construct ARGS dictionary
ARGS = {
    'x': x,
    'batch_size': batch_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _PrefetchDataset — a _PrefetchDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _PrefetchDataset output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calibrate_accuracy Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/evaluate.py
code served (permissive licence) · get_code("135992446d5c8b2f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample data for y_pos and y_neg
# These should be 1D arrays of model prediction scores
np.random.seed(0)
y_pos = np.random.uniform(0.6, 1.0, size=5)  # Positive class predictions (higher scores)
y_neg = np.random.uniform(0.0, 0.4, size=5)  # Negative class predictions (lower scores)

ARGS = {
    "y_pos": y_pos,
    "y_neg": y_neg,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_batch_norm Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/evaluate.py
code served (permissive licence) · get_code("465098483688b12d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 2, dtype family float, shape (2, 1) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
import numpy as np

# Create a small test vector with shape (batch_size=2, feature_dim=4)
# This will compute the L2 norm across all dimensions except the batch dimension
vec = tf.constant([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=tf.float32)

ARGS = {
    "vec": vec
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 1) — shape (2, 1) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_precision_recall Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/evaluate.py
code served (permissive licence) · get_code("066f3e3f55fc8efa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Construct arguments for compute_precision_recall
# The function expects:
# - ytest: array-like of scores for normal class
# - yanomalies: array-like of scores for anomalies
# - T: threshold value (float)

# Create synthetic score arrays
# ytest: scores for normal samples (should be >= T ideally)
ytest = np.array([0.8, 0.9, 0.7, 0.85, 0.95])

# yanomalies: scores for anomaly samples (should be < T ideally)
yanomalies = np.array([0.2, 0.15, 0.3, 0.1, 0.25])

# Threshold value
T = 0.5

ARGS = {
    "ytest": ytest,
    "yanomalies": yanomalies,
    "T": T
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
default_process Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/datasets.py
code served (permissive licence) · get_code("19914f89baf293ee")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import sklearn.preprocessing as preprocessing

# Set random seed for reproducibility
np.random.seed(0)

# Create small sample data
# X: (N, F) with N=2 samples, F=4 features
X = np.random.randn(2, 4).astype(np.float32)

# y: (N,) with N=2 binary labels (0 or 1)
y = np.array([0, 1], dtype=np.int32)

ARGS = {
    "X": X,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
display_levelset_binary Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/plot.py
code served (permissive licence) · get_code("e3cb66e5185ff0a5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Axes. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch
import torch.nn as nn

class SimpleClassifier(nn.Module):
    """Minimal binary classifier with predict method."""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(2, 1)
    
    def forward(self, x):
        return self.linear(x)
    
    def predict(self, X):
        """Convert input array to predictions."""
        X_tensor = torch.tensor(X, dtype=torch.float32)
        with torch.no_grad():
            output = self.forward(X_tensor)
        return output.numpy().squeeze()

# Create a simple 2D binary classification dataset
np.random.seed(0)
torch.manual_seed(0)

# Generate sample points in 2D space
n_samples = 20
X = np.random.randn(n_samples, 2) * 2

# Create model
model = SimpleClassifier()

ARGS = {
    "model": model,
    "X": X,
    "levels": 10,
    "coeff": 1.2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, seaborn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Axes — a Axes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Axes output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
infinity_norm_normalization Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/layers.py
code served (permissive licence) · get_code("26258b5266a78eb2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 3, dtype family float, shape (2, 3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
import numpy as np

# Create a small kernel tensor with shape (2, 3, 4)
# This represents a 3D kernel where the last dimension is the output dimension
kernel = tf.constant(np.random.randn(2, 3, 4).astype(np.float32))

# Create inf_norm_bounds as a scalar tensor
inf_norm_bounds = tf.constant(1.0)

ARGS = {
    "kernel": kernel,
    "inf_norm_bounds": inf_norm_bounds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_toy_2d Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/datasets.py
code served (permissive licence) · get_code("06583ccc9c10135a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from functools import partial
from sklearn.datasets import make_moons, make_circles, make_blobs

torch.manual_seed(0)
np.random.seed(0)

ARGS = {
    'name': 'two-moons',
    'num_pts': 100,
    'noise': 0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
two_to_infinity_norm_normalization Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/layers.py
code served (permissive licence) · get_code("093cf669e638ca4d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 3, dtype family float, shape (2, 3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf

# Create a small kernel tensor with shape [2, 3, 4]
# This will be reshaped to [-1, 4] = [6, 4] inside the function
kernel = tf.constant([
    [[1.0, 2.0, 3.0, 4.0],
     [5.0, 6.0, 7.0, 8.0],
     [9.0, 10.0, 11.0, 12.0]],
    [[13.0, 14.0, 15.0, 16.0],
     [17.0, 18.0, 19.0, 20.0],
     [21.0, 22.0, 23.0, 24.0]]
])

# Create inf_norm_bounds as a scalar tensor
inf_norm_bounds = tf.constant(1.0)

ARGS = {
    "kernel": kernel,
    "inf_norm_bounds": inf_norm_bounds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
uniform_image Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/priors.py
code served (permissive licence) · get_code("db73a39f02a39cce")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
import numpy as np

# Set random seed for reproducibility
tf.random.set_seed(0)

# Create a tf.random.Generator
gen = tf.random.Generator.from_seed(42)

# Define batch size
batch_size = 2

# Define input shape (feature dimension)
input_shape = (4,)

# Define domain as tuple of two floats
domain = (-1.0, 1.0)

# Define sample_corners parameter
sample_corners = False

# Construct ARGS dictionary
ARGS = {
    "gen": gen,
    "batch_size": batch_size,
    "input_shape": input_shape,
    "domain": domain,
    "sample_corners": sample_corners,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
uniform_tabular Ran
ran on a synthesized input
algue-rythme/oneclassmetriclearning/ocml/priors.py
code served (permissive licence) · get_code("ec2408f0eeed88c0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create a tf.random.Generator
gen = tf.random.Generator.from_seed(0)

# Define parameters
batch_size = 2
input_shape = (4,)
domain = (tf.constant(0.0), tf.constant(10.0))

ARGS = {
    "gen": gen,
    "batch_size": batch_size,
    "input_shape": input_shape,
    "domain": domain,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_contour Not yet run
unverified (harvested, no recorded run)
algue-rythme/oneclassmetriclearning/ocml/plot.py
code served (permissive licence) · get_code("1a946480db7bc7a9")
How it ran

no invocation recorded.

plot_3d_plt Not yet run
unverified (harvested, no recorded run)
algue-rythme/oneclassmetriclearning/ocml/plot.py
code served (permissive licence) · get_code("26de53bd9bb605a6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 13 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We propose a new method, dubbed One Class Signed Distance Function (OCSDF), to perform One Class Classification (OCC) by provably learning the Signed Distance Function (SDF) to the boundary of the support of any distribution. The distance to the support can be interpreted as a normality score, and its approximation using 1-Lipschitz neural networks provides robustness bounds against l2 adversarial attacks, an underexplored weakness of deep learning-based OCC algorithms. As a result, OCSDF comes with a new metric, certified AUROC, that can be computed at the same cost as any classical AUROC. We show that OCSDF is competitive against concurrent methods on tabular and image data while being way more robust to adversarial attacks, illustrating its theoretical properties. Finally, as exploratory research perspectives, we theoretically and empirically show how OCSDF connects OCC with image generation and implicit neural surface parametrization.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2303.01978")
get_code_for_paper("2303.01978")
have("2303.01978")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2303.01978.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2303.01978.svg)](https://syntology.ai/paper/2303.01978)

Connect an agent — have() is free.