SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.07675 · 2022

Learning image representations for anomaly detection: application to discovery of histological alterations in drug development

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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 5 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2210.07675.json · badge: /api/ran/2210.07675.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
boehringer-ingelheim/anomaly-detection-in-histology canonical (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
import_config_from_file Ran
ran on a synthesized input
boehringer-ingelheim/anomaly-detection-in-histology/utils/imports.py
code served (permissive licence) · get_code("08e7ef1e71720850")
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 importlib
import os
import tempfile

# Create a temporary config file
with tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False) as f:
    f.write("""
# Sample config module
config_value = 42
model_name = "test_model"
learning_rate = 0.001
""")
    config_file_path = f.name

try:
    # Test that the function works with the temporary file
    ARGS = {
        'path': config_file_path
    }
finally:
    # Clean up will happen after ARGS is defined
    pass
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 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
limited_time_input Ran
ran on a synthesized input
boehringer-ingelheim/anomaly-detection-in-histology/utils/timed_input.py
code served (permissive licence) · get_code("b5f5236aba160d07")
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 sys
import select
import logging

# Configure logging
logging.basicConfig(level=logging.INFO)

# Set up arguments for limited_time_input
ARGS = {
    'message': 'Please enter something (you have 1 second):',
    'delay': 1
}
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 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
read_features Ran
ran on a synthesized input
boehringer-ingelheim/anomaly-detection-in-histology/utils/data_processing.py
code served (permissive licence) · get_code("a31bd7d2a143f9d1")
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 os
import pickle
import tempfile
import logging

logging.basicConfig(level=logging.INFO)

# Create temporary directory and pickle files for testing
tmpdir = tempfile.mkdtemp()

# Create two categories of feature data
category1_dir = os.path.join(tmpdir, 'category1')
category2_dir = os.path.join(tmpdir, 'category2')
os.makedirs(category1_dir, exist_ok=True)
os.makedirs(category2_dir, exist_ok=True)

# Create sample feature files
# Features: (n_samples, n_features)
features1 = np.random.randn(20, 8).astype(np.float32)
features2 = np.random.randn(24, 8).astype(np.float32)

file_name = 'features.pkl'

with open(os.path.join(category1_dir, file_name), 'wb') as f:
    pickle.dump(features1, f)

with open(os.path.join(category2_dir, file_name), 'wb') as f:
    pickle.dump(features2, f)

# Prepare arguments
ARGS = {
    'file_name': file_name,
    'paths': [category1_dir, category2_dir],
    'label_names': ['cat1', 'cat2'],
    'n_codes': 10,
    'group_method': 'mean',
    'group_size': 2,
    'arrange': None
}
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
sample_with_possible_repetition Ran
ran on a synthesized input
boehringer-ingelheim/anomaly-detection-in-histology/utils/image_dataset_reader.py
code served (permissive licence) · get_code("a7e896c83c4e5c89")
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 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 random

# Set seed for reproducibility
random.seed(42)

# Define arguments for sample_with_possible_repetition
ARGS = {
    "file_names": ["file1.txt", "file2.txt", "file3.txt", "file4.txt"],
    "n_samples": 10
}
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 list, ndim 1, dtype family float — 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
update_configuration Ran
ran on a synthesized input
boehringer-ingelheim/anomaly-detection-in-histology/utils/imports.py
code served (permissive licence) · get_code("6e35cf6369bfb805")
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 ConfigStub. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 argparse
import tempfile
import os
import sys

# Create a minimal config file
config_content = """
device = 'cpu'
seed = 42
learning_rate = 0.001
batch_size = 32
"""

# Write config to a temporary file
with tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False) as f:
    f.write(config_content)
    config_file_path = f.name

try:
    # Create parser
    parser = argparse.ArgumentParser()
    
    # Create a minimal config object
    class ConfigStub:
        device = 'cpu'
        seed = 42
        learning_rate = 0.001
        batch_size = 32
    
    cfg = ConfigStub()
    
    # Set up sys.argv to simulate command line arguments
    sys.argv = ['test', '--config', config_file_path, '-P', 'device=cpu', '-P', 'seed=100']
    
    ARGS = {
        'parser': parser,
        'cfg': cfg
    }
finally:
    # Clean up temp file
    if os.path.exists(config_file_path):
        os.remove(config_file_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 ConfigStub — a ConfigStub output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ConfigStub 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
comp_means Not yet run
unverified (harvested, no recorded run)
boehringer-ingelheim/anomaly-detection-in-histology/data_preparation/compute_means.py
code served (permissive licence) · get_code("2a4d0d1093982d4a")
How it ran

no invocation recorded.

Also present in other papers' code

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

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-23.

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 present a system for anomaly detection in histopathological images. In histology, normal samples are usually abundant, whereas anomalous (pathological) cases are scarce or not available. Under such settings, one-class classifiers trained on healthy data can detect out-of-distribution anomalous samples. Such approaches combined with pre-trained Convolutional Neural Network (CNN) representations of images were previously employed for anomaly detection (AD). However, pre-trained off-the-shelf CNN representations may not be sensitive to abnormal conditions in tissues, while natural variations of healthy tissue may result in distant representations. To adapt representations to relevant details in healthy tissue we propose training a CNN on an auxiliary task that discriminates healthy tissue of different species, organs, and staining reagents. Almost no additional labeling workload is required, since healthy samples come automatically with aforementioned labels. During training we enforce compact image representations with a center-loss term, which further improves representations for AD. The proposed system outperforms established AD methods on a published dataset of liver anomalies. Moreover, it provided comparable results to conventional methods specifically tailored for quantification of liver anomalies. We show that our approach can be used for toxicity assessment of candidate drugs at early development stages and thereby may reduce expensive late-stage drug attrition.

For agents

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

get_harvested_code_for_paper("2210.07675")
get_code_for_paper("2210.07675")
have("2210.07675")

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

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

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

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

Connect an agent — have() is free.