SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.17009 · 2023

A comparative evaluation of image-to-image translation methods for stain transfer in histopathology

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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; 0 failures of our instrument; 1 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.17009.json · badge: /api/ran/2303.17009.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/stain-transfer canonical (classifier label)
classifier basis not recorded on the link
9 ran · 1 no recorded run
FunctionStatusWhere it lives
SSIM Ran
ran on a synthesized input
Boehringer-Ingelheim/stain-transfer/src/data_processing/metrics.py
code served (permissive licence) · get_code("958eeae378bdc754")
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 float64, ndim 0, 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 cv2
import numpy as np

# Create two small RGB images for SSIM comparison
# Images should be uint8 in range [0, 255] for cv2 compatibility
np.random.seed(0)

# Create first image: 32x32 RGB
img1 = np.random.randint(0, 256, size=(32, 32, 3), dtype=np.uint8)

# Create second image: 32x32 RGB (slightly different from img1)
img2 = np.random.randint(0, 256, size=(32, 32, 3), dtype=np.uint8)

ARGS = {
    "img1": img1,
    "img2": img2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, skimage — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
av_wasserstein Ran
ran on a synthesized input
Boehringer-Ingelheim/stain-transfer/src/data_processing/metrics.py
code served (permissive licence) · get_code("30d70c6ddbc3a01a")
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 float64, ndim 0, 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
from scipy.stats import wasserstein_distance

# The function av_wasserstein expects two 3D numpy arrays
# It iterates over the first dimension (range(3)), so both arrays need shape (3, ...)
# wasserstein_distance expects 1D arrays, so hist1[i] and hist2[i] should be 1D

# Create two sample 3D arrays where each slice is a 1D histogram
hist1 = np.array([
    np.array([0.1, 0.2, 0.3, 0.4]),
    np.array([0.15, 0.25, 0.35, 0.25]),
    np.array([0.2, 0.2, 0.3, 0.3])
], dtype=np.float64)

hist2 = np.array([
    np.array([0.12, 0.22, 0.31, 0.35]),
    np.array([0.14, 0.26, 0.34, 0.26]),
    np.array([0.21, 0.19, 0.31, 0.29])
], dtype=np.float64)

ARGS = {
    "hist1": hist1,
    "hist2": hist2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
df2table Ran
ran on a synthesized input
Boehringer-Ingelheim/stain-transfer/src/data_processing/metric_inspection.py
code served (permissive licence) · get_code("0b22b8b954d80e9f")
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 pandas as pd

# Create a sample DataFrame with multiple columns containing a substring
df = pd.DataFrame({
    'metric_accuracy': [0.95234],
    'metric_precision': [0.87654],
    'metric_recall': [0.91234],
    'other_value': [0.5],
    'metric_f1': [0.89123]
}, index=['model_A'])

row = 'model_A'
column_substring = 'metric_'

ARGS = {
    'df': df,
    'row': row,
    'column_substring': column_substring
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
format_paths Ran
ran on a synthesized input
Boehringer-Ingelheim/stain-transfer/metric_calculation.py
code served (permissive licence) · get_code("e36902959781b661")
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

torch.manual_seed(0)

# Analyzing the function:
# - source: str - a file path string
# - target: str - a file path string
# - fakes: list - a list that will be converted to strings and joined
# - output: str - a file path string

ARGS = {
    'source': '/path/to/source/data',
    'target': '/path/to/target/data',
    'fakes': ['/fake/path/1', '/fake/path/2', '/fake/path/3'],
    'output': '/path/to/output/result'
}
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
get_checkpoint Ran
ran on a synthesized input
Boehringer-Ingelheim/stain-transfer/src/modelling/checkpoint_evaluator.py
code served (permissive licence) · get_code("fde6ba07f9fd2149")
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 re

LATEST = int(1e+20)

def get_checkpoint(checkpoint_name: str) -> int:
    """
    Get the chekpoint number from a checkpoint file name. First matching number
    is considered as checkpoint.
    Supports 'latest' and 'last' naming conventions.
    Ex. 5_net_G_A, 25_net_G_B, latest_net_G_A, etc.

    :param checkpoint_name: Checkpoint name
    :return: Integer checkpoint.
    """
    cp_id = re.search('[0-9]+', checkpoint_name)
    if cp_id == None:
        if 'latest' or 'last' in checkpoint_name:
            cp_id = LATEST
        else:
            cp_id = LATEST
    else:
        cp_id = int(cp_id.group())
    return cp_id


ARGS = {
    "checkpoint_name": "42_net_G_A"
}
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 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
get_file_title_img Ran
ran on a synthesized input
Boehringer-Ingelheim/stain-transfer/src/data_processing/metric_inspection.py
code served (permissive licence) · get_code("af8cb54b084292a3")
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 tempfile
from pathlib import Path

# Create temporary image files for testing
temp_dir = tempfile.mkdtemp()

# Create a simple valid image file (minimal PNG)
png_data = bytes([
    137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82,
    0, 0, 0, 1, 0, 0, 0, 1, 8, 2, 0, 0, 0, 144, 119, 83, 222,
    0, 0, 0, 12, 73, 68, 65, 84, 8, 217, 99, 248, 15, 0, 0, 1, 1,
    0, 5, 181, 238, 86, 230, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130
])

# Create source image
source_file = Path(temp_dir) / "source.png"
source_file.write_bytes(png_data)

# Create target image
target_file = Path(temp_dir) / "target.png"
target_file.write_bytes(png_data)

# Create fake images with model subdirectory
fake_dir = Path(temp_dir) / "model_a"
fake_dir.mkdir(exist_ok=True)
fake_file = fake_dir / "fake_image.png"
fake_file.write_bytes(png_data)

# Build the triplets dictionary structure
triplets = {
    'source': {
        'img1': str(source_file)
    },
    'target': {
        'img1': str(target_file)
    },
    'fakes': {
        'model_a': {
            'img1': str(fake_file)
        }
    }
}

ARGS = {
    'triplets': triplets,
    'image_type': 'source',
    'image_file': 'img1',
    'model': None
}
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 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
read_image Ran
ran on a synthesized input
Boehringer-Ingelheim/stain-transfer/src/data_processing/metric_inspection.py
code served (permissive licence) · get_code("3773b850c359179b")
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 base64
import tempfile
import os

# Create a temporary image file with some binary content
with tempfile.NamedTemporaryFile(delete=False, suffix='.png') as tmp:
    # Write some minimal PNG-like binary data
    tmp.write(b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01')
    tmp_path = tmp.name

try:
    ARGS = {
        'img_file': tmp_path
    }
finally:
    # Clean up after defining ARGS so the file exists when the function runs
    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 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
set_conf Ran
ran on a synthesized input
Boehringer-Ingelheim/stain-transfer/src/modelling/checkpoint_evaluator.py
code served (permissive licence) · get_code("403ad22506313234")
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 argparse
import torch

torch.manual_seed(0)

# Create a valid argparse.Namespace with all required attributes
opt = argparse.Namespace(
    batch_size=32,
    results_path="/tmp/results",
    device="cpu",
    num_workers=4
)

ARGS = {
    "opt": opt
}
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 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
update_df Ran
ran on a synthesized input
Boehringer-Ingelheim/stain-transfer/metric_calculation.py
code served (permissive licence) · get_code("dc1749ecc978605e")
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 DataFrame. 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 pandas as pd
import tempfile
import os

# Create a temporary directory for output
temp_dir = tempfile.mkdtemp()
output_path = os.path.join(temp_dir, "metrics.csv")

# Initialize an empty DataFrame with the correct columns
COLS = ['Fake', 'SSIM', 'SSIM_std', 'FID', 'LAB_WD', 'Real Source', 'Real target']
metric_df = pd.DataFrame(columns=COLS)

ARGS = {
    'metric_df': metric_df,
    'fake': 'generated_image_001.png',
    'source': 'source_image.jpg',
    'target': 'target_image.jpg',
    'ssim': 0.92,
    'ssim_std': 0.03,
    'fid': 15.47,
    'lab_wd': 8.32,
    'output': output_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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_img_files Not yet run
unverified (harvested, no recorded run)
Boehringer-Ingelheim/stain-transfer/src/data_processing/datasets.py
code served (permissive licence) · get_code("07d65aaf0919f296")
How it ran

no invocation recorded.

Also present in other papers' code

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

Image-to-image translation (I2I) methods allow the generation of artificial images that share the content of the original image but have a different style. With the advances in Generative Adversarial Networks (GANs)-based methods, I2I methods enabled the generation of artificial images that are indistinguishable from natural images. Recently, I2I methods were also employed in histopathology for generating artificial images of in silico stained tissues from a different type of staining. We refer to this process as stain transfer. The number of I2I variants is constantly increasing, which makes a well justified choice of the most suitable I2I methods for stain transfer challenging. In our work, we compare twelve stain transfer approaches, three of which are based on traditional and nine on GAN-based image processing methods. The analysis relies on complementary quantitative measures for the quality of image translation, the assessment of the suitability for deep learning-based tissue grading, and the visual evaluation by pathologists. Our study highlights the strengths and weaknesses of the stain transfer approaches, thereby allowing a rational choice of the underlying I2I algorithms. Code, data, and trained models for stain transfer between H&E and Masson's Trichrome staining will be made available online.

For agents

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

get_harvested_code_for_paper("2303.17009")
get_code_for_paper("2303.17009")
have("2303.17009")

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

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

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

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

Connect an agent — have() is free.