SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1912.09533 · 2019

Towards Verifying Robustness of Neural Networks Against Semantic Perturbations

arXiv · PDF · Open in the Atlas

Code that ran

11 of 16 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; 5 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/1912.09533.json · badge: /api/ran/1912.09533.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
JeetMo/Semantify-NN canonical (classifier label)
classifier basis: census
11 ran · 5 no recorded run
FunctionStatusWhere it lives
gen_image Ran
ran on a synthesized input
JeetMo/Semantify-NN/main_attack.py
code served (permissive licence) · get_code("2dc5034ca17fd4bd")
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 module. 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 matplotlib.pyplot as plt

# Create a small 2D array of integers that can be converted to uint8
arr = np.array([[100, 150, 200],
                [50, 75, 125]], dtype=np.float32)

ARGS = {
    "arr": arr
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type module — a module output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a module 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
get_first_layers Ran
ran on a synthesized input
JeetMo/Semantify-NN/threat_models/threat_hue.py
code served (permissive licence) · get_code("d0116430981ceec3")
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

# Create a small test image with shape (rows, columns, channels)
# The function processes RGB images pixel by pixel
image = np.array([
    [[255, 128, 64], [200, 100, 50]],
    [[150, 75, 30], [100, 50, 25]]
], dtype=np.float32)

# w1 needs to be a matrix that can multiply with w_2
# w_2 has shape (channels * rows * columns, 13 * rows * columns)
# which is (2*2*3, 13*2*2) = (12, 52)
# So w1 should have shape (output_dim, 12) for some output_dim
# Let's use a simple (8, 12) matrix
w1 = np.random.randn(8, 12).astype(np.float32)

# b1 needs to be a vector that can be added to the result of np.dot(w1, b_2)
# b_2 has shape (channels * rows * columns,) = (12,)
# np.dot(w1, b_2) will have shape (8,)
# So b1 should have shape (8,)
b1 = np.random.randn(8).astype(np.float32)

ARGS = {
    "image": image,
    "w1": w1,
    "b1": b1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
get_first_layers Ran
ran on a synthesized input
JeetMo/Semantify-NN/threat_models/threat_saturate.py
code served (permissive licence) · get_code("62ca2ee8e41b356b")
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

# Analyze the function to understand what it needs:
# - image: a numpy array with shape (rows, columns) or (rows, columns, channels)
#   The function accesses image[r][c] and expects colors to be indexable
# - w1: a numpy array that is used in matrix multiplications with shape (output_dim, input_dim)
# - b1: a numpy array that is used in addition operations

# Create a small test image with shape (2, 3, 4) = 2 rows, 3 columns, 4 channels
np.random.seed(0)
image = np.random.rand(2, 3, 4).astype(np.float32)

# Scale to reasonable color range [0, 1]
image = image * 0.8 + 0.1

# w1 is used in: np.matmul(w1, pw_2.T) and np.matmul(w1, nw_2.T)
# pw_2 and nw_2 have shape (rows * columns, channels * rows * columns)
# = (2*3, 4*2*3) = (6, 24)
# So w1 @ pw_2.T means w1 @ (24, 6) -> w1 must have shape (output_dim, 24)
# Let's use output_dim = 5
w1 = np.random.rand(5, 24).astype(np.float32)

# b1 is used in: b1 + np.dot(w1, pb_2) and b1 + np.dot(w1, nb_2)
# np.dot(w1, pb_2) where w1 is (5, 24) and pb_2 is (24,) gives (5,)
# So b1 must have shape (5,)
b1 = np.random.rand(5).astype(np.float32)

ARGS = {
    'image': image,
    'w1': w1,
    'b1': b1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
get_first_layers_cnn Ran
ran on a synthesized input
JeetMo/Semantify-NN/threat_models/threat_hue.py
code served (permissive licence) · get_code("8c54db56cb682eb8")
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

# Create a small test image with shape (rows, columns, channels)
# Using small dimensions: 3x4 with 3 color channels (RGB)
image = np.random.randint(0, 256, size=(3, 4, 3), dtype=np.uint8).astype(np.float32)

ARGS = {
    "image": image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
get_first_layers_cnn Ran
ran on a synthesized input
JeetMo/Semantify-NN/threat_models/threat_lighten.py
code served (permissive licence) · get_code("2b3f7bdf9b590e8d")
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

# Create a small test image
# The function expects an image with shape (rows, columns) or (rows, columns, channels)
# Using distinct dimensions: 4 rows, 3 columns, 2 channels
image = np.array([
    [[100, 150], [120, 160], [110, 155]],
    [[105, 152], [125, 162], [115, 157]],
    [[102, 151], [122, 161], [112, 156]],
    [[103, 153], [123, 163], [113, 158]]
], dtype=np.float32)

ARGS = {
    "image": image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
get_first_layers_cnn Ran
ran on a synthesized input
JeetMo/Semantify-NN/threat_models/threat_saturate.py
code served (permissive licence) · get_code("64afcfd2156e3509")
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

# Create a small test image
# The function expects an image with shape (rows, columns) or (rows, columns, channels)
# Using small dimensions: 3x4 for rows x columns, with 3 channels (RGB)
image = np.array([
    [[100, 120, 110], [150, 160, 155], [200, 210, 205], [180, 190, 185]],
    [[110, 130, 120], [160, 170, 165], [210, 220, 215], [190, 200, 195]],
    [[120, 140, 130], [170, 180, 175], [220, 230, 225], [200, 210, 205]]
], dtype=np.uint8)

ARGS = {
    "image": image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
handle_parser Ran
ran on a synthesized input
JeetMo/Semantify-NN/main_attack.py
code served (permissive licence) · get_code("67bd753068aa89ba")
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 ArgumentParser. 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 torch.nn as nn
from argparse import ArgumentParser

torch.manual_seed(0)

ARGS = {
    'parser': ArgumentParser()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
loss Ran
ran on a synthesized input
JeetMo/Semantify-NN/utils/save_nlayer_weights.py
code served (permissive licence) · get_code("cccee9750469bb0a")
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 1, dtype family float, shape (2,) 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 small sample data
batch_size = 2
num_classes = 4

# correct: one-hot encoded labels (batch_size, num_classes)
correct = tf.constant([
    [1.0, 0.0, 0.0, 0.0],
    [0.0, 1.0, 0.0, 0.0]
], dtype=tf.float32)

# predicted: logits (batch_size, num_classes)
predicted = tf.constant([
    [2.1, 0.5, 0.3, 0.1],
    [0.2, 2.3, 0.4, 0.1]
], dtype=tf.float32)

ARGS = {
    "correct": correct,
    "predicted": predicted
}
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 1, dtype family float, shape (2,) — shape (2,) 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
sigmoid Ran
ran on a synthesized input
JeetMo/Semantify-NN/utils/activations.py
code served (permissive licence) · get_code("54fb221cde340265")
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 float, ndim 0, dtype family float, shape () 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 numpy as np

ARGS = {
    "x": np.array(0.5)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () 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
sigmoidd Ran
ran on a synthesized input
JeetMo/Semantify-NN/utils/activations.py
code served (permissive licence) · get_code("dfab2f10bd0e8f01")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np
from numba import njit

@njit
def sigmoidd(x):
    return np.exp(-x) / (1.0 + np.exp(-x)) ** 2

# The function takes a single parameter x and computes the derivative of sigmoid
# x should be a numpy array (or scalar that numba can handle)

x_value = np.array([0.0, 1.0, -1.0, 0.5])

ARGS = {
    "x": x_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (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
sigmoidid Ran
ran on a synthesized input
JeetMo/Semantify-NN/utils/activations.py
code served (permissive licence) · get_code("fca193ce378f2c1e")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np
from numba import njit

@njit
def sigmoidid(x):
    return 2.0 * np.arccosh(1.0 / (2.0 * np.sqrt(x)))

# The function takes a single parameter x that should be a positive numeric value or array
# arccosh requires input > 1, so 1/(2*sqrt(x)) must be > 1
# This means sqrt(x) must be < 0.5, so x must be < 0.25
# Let's use small positive values well within this constraint

x = np.array([0.01, 0.02, 0.03, 0.04])

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (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_first_layers Not yet run
unverified (harvested, no recorded run)
JeetMo/Semantify-NN/threat_models/threat_bandc.py
code served (permissive licence) · get_code("a4d2f938720b56d4")
How it ran

no invocation recorded.

get_first_layers Not yet run
unverified (harvested, no recorded run)
JeetMo/Semantify-NN/threat_models/threat_lighten.py
code served (permissive licence) · get_code("5e205a469e2f1f44")
How it ran

no invocation recorded.

get_first_layers_cnn Not yet run
unverified (harvested, no recorded run)
JeetMo/Semantify-NN/threat_models/threat_bandc.py
code served (permissive licence) · get_code("425759c9c3bffdaf")
How it ran

no invocation recorded.

handle_parser Not yet run
unverified (harvested, no recorded run)
JeetMo/Semantify-NN/main_semantic_hsl.py
code served (permissive licence) · get_code("5cbc3c9756e510c7")
How it ran

no invocation recorded.

handle_parser Not yet run
unverified (harvested, no recorded run)
JeetMo/Semantify-NN/main_semantic_rotate.py
code served (permissive licence) · get_code("7872e4a763ce993f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 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 16 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

Verifying robustness of neural networks given a specified threat model is a fundamental yet challenging task. While current verification methods mainly focus on the $\ell_p$-norm threat model of the input instances, robustness verification against semantic adversarial attacks inducing large $\ell_p$-norm perturbations, such as color shifting and lighting adjustment, are beyond their capacity. To bridge this gap, we propose \textit{Semantify-NN}, a model-agnostic and generic robustness verification approach against semantic perturbations for neural networks. By simply inserting our proposed \textit{semantic perturbation layers} (SP-layers) to the input layer of any given model, \textit{Semantify-NN} is model-agnostic, and any $\ell_p$-norm based verification tools can be used to verify the model robustness against semantic perturbations. We illustrate the principles of designing the SP-layers and provide examples including semantic perturbations to image classification in the space of hue, saturation, lightness, brightness, contrast and rotation, respectively. In addition, an efficient refinement technique is proposed to further significantly improve the semantic certificate. Experiments on various network architectures and different datasets demonstrate the superior verification performance of \textit{Semantify-NN} over $\ell_p$-norm-based verification frameworks that naively convert semantic perturbation to $\ell_p$-norm. The results show that \textit{Semantify-NN} can support robustness verification against a wide range of semantic perturbations. Code available https://github.com/JeetMo/Semantify-NN

For agents

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

get_harvested_code_for_paper("1912.09533")
get_code_for_paper("1912.09533")
have("1912.09533")

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

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

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

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

Connect an agent — have() is free.