SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1802.06222 · 2018

Efficient GAN-Based Anomaly Detection

arXiv · PDF · Open in the Atlas

Code that ran

13 of 15 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 9 have no contract verdict; 4 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/1802.06222.json · badge: /api/ran/1802.06222.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
danbochman/Efficient-GAN-Based-Anomaly-Detection-TF2 community (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
Rajlaxmi04/Network-Traffic-Anomaly-Detection-using-PCA-and-BiGAN community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
llien30/EfficientGAN-based-anomaly-detection reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
adapt_labels Ran
ran on a synthesized input
Rajlaxmi04/Network-Traffic-Anomaly-Detection-using-PCA-and-BiGAN/utils/adapt_data.py
code served (permissive licence) · get_code("ece5146bbcad537c")
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 int, shape (6,) 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 torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - true_labels: used with indexing (true_labels == label, true_labels != label)
#   and .shape[0], so it needs to be a numpy array or torch tensor
# - label: an int used for comparison
# The function does boolean indexing and assignment, so numpy array is most appropriate

true_labels = np.array([0, 1, 2, 1, 0, 2], dtype=np.int32)
label = 1

ARGS = {
    "true_labels": true_labels,
    "label": label
}
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 ndarray, ndim 1, dtype family int, shape (6,) — shape (6,) 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
annotation_to_bboxes_ltwh Ran
ran on a synthesized input
danbochman/Efficient-GAN-Based-Anomaly-Detection-TF2/dataloader/annotation_utils.py
code served (permissive licence) · get_code("987e51bd5d0d4f05")
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 list, ndim 2, dtype family int; 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 a sample annotation in supervise.ly format
ann = {
    'objects': [
        {
            'classTitle': 'defect',
            'points': {
                'exterior': [
                    [10, 20],
                    [50, 20],
                    [50, 60],
                    [10, 60]
                ]
            }
        },
        {
            'classTitle': 'defect',
            'points': {
                'exterior': [
                    [100, 100],
                    [150, 100],
                    [150, 180],
                    [100, 180]
                ]
            }
        },
        {
            'classTitle': 'roi',
            'points': {
                'exterior': [
                    [200, 200],
                    [250, 200],
                    [250, 250],
                    [200, 250]
                ]
            }
        }
    ]
}

ARGS = {
    'ann': ann,
    'classes': 'defect'
}
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 list, ndim 2, dtype family int — a list 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
bboxes_included_in_crop Ran
ran on a synthesized input
danbochman/Efficient-GAN-Based-Anomaly-Detection-TF2/dataloader/cogwheel_slicer.py
code served (permissive licence) · get_code("8ac3e98c85275236")
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 torch
import numpy as np

torch.manual_seed(0)

# Construct valid arguments for bboxes_included_in_crop
vertical = 10
horizontal = 20
interval = 50

# List of bboxes in (y, x, width, height) format
# Create some bboxes that are inside and outside the crop region
bboxes = [
    (15, 25, 30, 30),  # This bbox is inside: y=15 is in [10, 60), x=25 is in [20, 70), y+w=45 < 60, x+h=55 < 70
    (5, 15, 10, 10),   # This bbox is outside: y=5 is not >= 10
    (20, 30, 20, 20),  # This bbox is inside: y=20 in [10, 60), x=30 in [20, 70), y+w=40 < 60, x+h=50 < 70
]

ARGS = {
    "vertical": vertical,
    "horizontal": horizontal,
    "interval": interval,
    "bboxes": bboxes
}
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 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
center_and_scale Ran
ran on a synthesized input
danbochman/Efficient-GAN-Based-Anomaly-Detection-TF2/dataloader/preprocessing.py
code served (permissive licence) · get_code("dd25489eddcd9d2b")
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 Tensor, ndim 3, dtype family float, shape (2, 4, 3) 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 torch
import numpy as np

torch.manual_seed(0)

# Create a small uint8 image tensor in range [0, 255]
img = torch.randint(0, 256, (2, 4, 3), dtype=torch.uint8)

ARGS = {
    "img": img
}
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 Tensor, ndim 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) 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
create_logdir Ran
ran on a synthesized input
Rajlaxmi04/Network-Traffic-Anomaly-Detection-using-PCA-and-BiGAN/bigan/run_kdd.py
code served (permissive licence) · get_code("141272b50496ac09")
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 str. 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

def create_logdir(method, weight, rd):
    """ Directory to save training logs, weights, biases, etc."""
    return 'bigan/train_logs/kdd/{}/{}/{}'.format(weight, method, rd)

ARGS = {
    'method': 'gan',
    'weight': 'standard',
    'rd': 'run_001'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
do_prc Ran
ran on a synthesized input
Rajlaxmi04/Network-Traffic-Anomaly-Detection-using-PCA-and-BiGAN/utils/evaluations.py
code served (permissive licence) · get_code("40cf96e563e1b70c")
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
import matplotlib
matplotlib.use('Agg')  # Use non-interactive backend

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

# Create sample scores and true labels
scores = [0.1, 0.4, 0.35, 0.8, 0.9, 0.2, 0.7, 0.6]
true_labels = [0, 0, 0, 1, 1, 0, 1, 1]

# Define ARGS dictionary with all parameters
ARGS = {
    'scores': scores,
    'true_labels': true_labels,
    'file_name': 'test_prc',
    'directory': 'results',
    'plot': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, sklearn — 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
get_getter Ran
ran; our contract draft was wrong, not the code
Rajlaxmi04/Network-Traffic-Anomaly-Detection-using-PCA-and-BiGAN/bigan/run_kdd.py
pointer only (licence: MIT); the stored copy get_code serves, from bruno-31/gan-manifold-reg, is pointer only (licence: NONE) · get_code("10682b8fe32fba68")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from bruno-31/gan-manifold-reg, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

img_slice_and_label Ran
ran on a synthesized input
danbochman/Efficient-GAN-Based-Anomaly-Detection-TF2/dataloader/cogwheel_slicer.py
code served (permissive licence) · get_code("70236e48ff830fcf")
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 (height=10, width=12, 3 channels for RGB)
img = np.random.randint(0, 255, size=(10, 12, 3), dtype=np.uint8)

# Create some test bboxes in (y, x, width, height) format
# These represent bounding boxes that should be detected in crops
bboxes = [
    (2, 3, 2, 2),   # bbox at y=2, x=3, width=2, height=2
    (6, 7, 1, 1),   # bbox at y=6, x=7, width=1, height=1
]

ARGS = {
    "img": img,
    "crop_size": 5,
    "bboxes": bboxes,
    "resize": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, 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
load_annotation_file Ran
ran on a synthesized input
danbochman/Efficient-GAN-Based-Anomaly-Detection-TF2/dataloader/annotation_utils.py
code served (permissive licence) · get_code("22a02f2c65cda9f1")
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 dict. 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 json
import tempfile
import os

# Create a temporary directory and annotation file
temp_dir = tempfile.mkdtemp()
ann_path = os.path.join(temp_dir, "annotation.json")

# Create a valid supervise.ly annotation file
annotation_data = {
    "description": "Test annotation",
    "size": {
        "height": 480,
        "width": 640
    },
    "objects": [
        {
            "id": "obj1",
            "classTitle": "person",
            "description": "",
            "geometry_type": "rectangle",
            "geometry": {
                "x": 100,
                "y": 100,
                "width": 200,
                "height": 300
            }
        }
    ],
    "tags": []
}

# Write the annotation file
with open(ann_path, 'w') as f:
    json.dump(annotation_data, f)

ARGS = {
    "ann_path": ann_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
make_Discriminator Ran
ran; our contract draft was wrong, not the code
llien30/EfficientGAN-based-anomaly-detection/model.py
pointer only (licence: NONE) · get_code("872e2f65a1cbb0bf")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, llien30/EfficientGAN-based-anomaly-detection when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

make_Encoder Ran
ran; our contract draft was wrong, not the code
llien30/EfficientGAN-based-anomaly-detection/model.py
pointer only (licence: NONE) · get_code("b2a9fc982dc64e85")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, llien30/EfficientGAN-based-anomaly-detection when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

make_Generator Ran
ran; our contract draft was wrong, not the code
llien30/EfficientGAN-based-anomaly-detection/model.py
pointer only (licence: NONE) · get_code("1e23659c6c7bbded")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, llien30/EfficientGAN-based-anomaly-detection when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

necessary_overlap_region Ran
ran on a synthesized input
danbochman/Efficient-GAN-Based-Anomaly-Detection-TF2/dataloader/cogwheel_slicer.py
code served (permissive licence) · get_code("625a1b73ba18c9b3")
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 int, ndim 0, dtype family int, 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 torch

torch.manual_seed(0)

ARGS = {
    "axis": 512,
    "interval": 128
}
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 int, ndim 0, dtype family int, 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
save_precision_recall_curve Not yet run
unverified (harvested, no recorded run)
danbochman/Efficient-GAN-Based-Anomaly-Detection-TF2/eval_utils/visualization_utils.py
code served (permissive licence) · get_code("d66734289c17d5b9")
How it ran

no invocation recorded.

stack_and_expand Not yet run
unverified (harvested, no recorded run)
danbochman/Efficient-GAN-Based-Anomaly-Detection-TF2/dataloader/preprocessing.py
code served (permissive licence) · get_code("9d292fa4e629c34e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 9 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 9 later) and 6 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.

FunctionAlso present inEarliest-datedOthers named
get_getter 2 other papers
2 later
1807.04307 (2018-07)
Manifold regularization with GANs for semi-supervised learning
1812.02288 (2018-12)
Adversarially Learned Anomaly Detection
adapt_labels 1 other paper
1 later
1812.02288 (2018-12)
Adversarially Learned Anomaly Detection
annotation_to_bboxes_ltwh 1 other paper
1 later
1805.06725 (2018-05)
GANomaly: Semi-Supervised Anomaly Detection via Adversarial Training
center_and_scale 1 other paper
1 later
1805.06725 (2018-05)
GANomaly: Semi-Supervised Anomaly Detection via Adversarial Training
create_logdir 1 other paper
1 later
1812.02288 (2018-12)
Adversarially Learned Anomaly Detection
do_prc 1 other paper
1 later
1812.02288 (2018-12)
Adversarially Learned Anomaly Detection
load_annotation_file 1 other paper
1 later
1805.06725 (2018-05)
GANomaly: Semi-Supervised Anomaly Detection via Adversarial Training
necessary_overlap_region 1 other paper
1 later
1805.06725 (2018-05)
GANomaly: Semi-Supervised Anomaly Detection via Adversarial Training
stack_and_expand 1 other paper
1 later
1805.06725 (2018-05)
GANomaly: Semi-Supervised Anomaly Detection via Adversarial Training

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

Generative adversarial networks (GANs) are able to model the complex highdimensional distributions of real-world data, which suggests they could be effective for anomaly detection. However, few works have explored the use of GANs for the anomaly detection task. We leverage recently developed GAN models for anomaly detection, and achieve state-of-the-art performance on image and network intrusion datasets, while being several hundred-fold faster at test time than the only published GAN-based method.

For agents

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

get_harvested_code_for_paper("1802.06222")
get_code_for_paper("1802.06222")
have("1802.06222")

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

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

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

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

Connect an agent — have() is free.