SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.04250 · 2020

A Benchmark of Medical Out of Distribution Detection

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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, 1 violated it and 5 have no contract verdict; 1 failure of our instrument; 0 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/2007.04250.json · badge: /api/ran/2007.04250.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
caotians1/OD-test-master canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
eval_subroutine Ran
ran on a synthesized input
caotians1/OD-test-master/Time_methods.py
code served (permissive licence) · get_code("c889edde8e9cc5b1")
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 torch.nn as nn

torch.manual_seed(0)

# Mock dataset class that has get_D1_test() method
class MockDataset:
    def __init__(self, size, name):
        self.size = size
        self.name = name
        self.data = [(torch.randn(4), i) for i in range(size)]
    
    def get_D1_test(self):
        return MockTestDataset(self.data.copy())
    
    def get_D2_test(self, D1):
        return MockTestDataset(self.data.copy())

# Mock test dataset class that supports trim_dataset and len operations
class MockTestDataset:
    def __init__(self, data):
        self.data = data
    
    def __len__(self):
        return len(self.data)
    
    def __add__(self, other):
        combined = MockTestDataset(self.data + other.data)
        return combined
    
    def trim_dataset(self, size):
        self.data = self.data[:size]

# Mock OD method with test_H method
class MockODMethod(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def test_H(self, test_mixture):
        # Returns tuple: (acc, auroc, auprc, fpr, tpr, precision, recall, TP, TN, FP, FN, avg_time)
        acc = 0.95
        auroc = 0.92
        auprc = 0.88
        fpr = [0.0, 0.1, 0.5, 1.0]
        tpr = [0.0, 0.8, 0.95, 1.0]
        precision = [1.0, 0.9, 0.7, 0.5]
        recall = [0.0, 0.8, 0.95, 1.0]
        TP = 38
        TN = 42
        FP = 8
        FN = 12
        avg_time = 0.123
        return (acc, auroc, auprc, fpr, tpr, precision, recall, TP, TN, FP, FN, avg_time)

# Construct arguments
ODmethod = MockODMethod()
D1 = MockDataset(size=5, name="D1")
D3 = MockDataset(size=7, name="D3")

ARGS = {
    "ODmethod": ODmethod,
    "D1": D1,
    "D3": D3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
termcolor, 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
eval_subroutine Ran
ran on a synthesized input
caotians1/OD-test-master/Chest_eval_binary.py
code served (permissive licence) · get_code("51e049e8b3a2a7c2")
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 torch.nn as nn

torch.manual_seed(0)

class MockDataset:
    def __init__(self, size=10):
        self.size = size
        self.data = [(torch.randn(4), torch.randint(0, 2, (1,))) for _ in range(size)]
    
    def get_D1_test(self):
        return MockDataset(self.size)
    
    def get_D2_test(self, D1):
        return MockDataset(self.size)
    
    def trim_dataset(self, new_size):
        self.data = self.data[:new_size]
        self.size = new_size
    
    def __len__(self):
        return len(self.data)
    
    def __add__(self, other):
        combined = MockDataset(0)
        combined.data = self.data + other.data
        combined.size = len(combined.data)
        return combined

class MockODMethod(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def test_H(self, test_mixture):
        acc = 0.85
        auroc = 0.92
        auprc = 0.88
        fpr = [0.0, 0.1, 0.5, 1.0]
        tpr = [0.0, 0.8, 0.95, 1.0]
        precision = [1.0, 0.9, 0.7, 0.5]
        recall = [0.0, 0.8, 0.95, 1.0]
        TP = 85
        TN = 80
        FP = 10
        FN = 5
        pst = None
        return (acc, auroc, auprc, fpr, tpr, precision, recall, TP, TN, FP, FN, pst)

class MockD1:
    def get_D1_test(self):
        return MockDataset(size=8)

class MockD3:
    def get_D2_test(self, D1):
        return MockDataset(size=6)

ODmethod = MockODMethod()
D1 = MockD1()
D3 = MockD3()

ARGS = {
    'ODmethod': ODmethod,
    'D1': D1,
    'D3': D3,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
termcolor, 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
eval_subroutine Ran
ran on a synthesized input
caotians1/OD-test-master/Chest_eval_rand_seeds.py
code served (permissive licence) · get_code("263ffa0736c2866a")
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 torch.nn as nn
from torch.utils.data import DataLoader

torch.manual_seed(0)

class MockDataset:
    """Mock dataset with required methods for D1 and D3"""
    def __init__(self, size=10):
        self.data = [(torch.randn(4), torch.randint(0, 2, (1,))) for _ in range(size)]
        self.size = size
    
    def get_D1_test(self):
        return MockDataset(size=10)
    
    def get_D2_test(self, D1):
        return MockDataset(size=8)
    
    def trim_dataset(self, new_size):
        self.data = self.data[:new_size]
        self.size = new_size
    
    def __len__(self):
        return self.size
    
    def __add__(self, other):
        combined = MockDataset(size=0)
        combined.data = self.data + other.data
        combined.size = len(combined.data)
        return combined


class MockODMethod(nn.Module):
    """Mock outlier detection method with test_H method"""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def test_H(self, test_mixture):
        # Return a tuple of metrics as expected by eval_subroutine
        acc = 0.85
        auroc = 0.90
        auprc = 0.88
        fpr = torch.tensor([0.0, 0.5, 1.0])
        tpr = torch.tensor([0.0, 0.7, 1.0])
        precision = torch.tensor([1.0, 0.8, 0.5])
        recall = torch.tensor([0.0, 0.7, 1.0])
        TP = 7
        TN = 6
        FP = 2
        FN = 1
        return (acc, auroc, auprc, fpr, tpr, precision, recall, TP, TN, FP, FN)


class MockD1:
    """Mock D1 dataset"""
    def __init__(self):
        self.test_set = MockDataset(size=10)
    
    def get_D1_test(self):
        return self.test_set


class MockD3:
    """Mock D3 dataset"""
    def __init__(self):
        self.test_set = MockDataset(size=8)
    
    def get_D2_test(self, D1):
        return self.test_set


ODmethod = MockODMethod()
D1 = MockD1()
D3 = MockD3()

ARGS = {
    'ODmethod': ODmethod,
    'D1': D1,
    'D3': D3,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
termcolor, 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
find_classes Ran
ran; our contract draft was wrong, not the code
caotians1/OD-test-master/datasets/TinyImagenet.py
code served (permissive licence) · get_code("52d10a10fb72fb9f")
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 os
import tempfile
import shutil

# Create a temporary directory with some subdirectories to simulate a class directory structure
temp_dir = tempfile.mkdtemp()
os.makedirs(os.path.join(temp_dir, "class_a"), exist_ok=True)
os.makedirs(os.path.join(temp_dir, "class_b"), exist_ok=True)
os.makedirs(os.path.join(temp_dir, "class_c"), exist_ok=True)

ARGS = {
    "dir": temp_dir
}
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 — 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
is_image_file Ran
ran, violated the contract we drafted
caotians1/OD-test-master/datasets/TinyImagenet.py
pointer only (licence: MIT); the stored copy get_code serves, from ermongroup/fairgen, is pointer only (licence: NONE) · get_code("4e6a8faaf8e44abe")
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 ermongroup/fairgen, 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.

make_dataset Ran
ran on a synthesized input
caotians1/OD-test-master/datasets/TinyImagenet.py
code served (permissive licence) · get_code("59962a74509c9b28")
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 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 os
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()

# Create class subdirectories with image files
class_names = ['class_a', 'class_b']
for class_name in class_names:
    class_dir = os.path.join(temp_dir, class_name)
    os.makedirs(class_dir, exist_ok=True)
    
    # Create some dummy image files
    for i in range(2):
        img_file = os.path.join(class_dir, f'image_{i}.jpg')
        open(img_file, 'a').close()
        
        img_file_png = os.path.join(class_dir, f'image_{i}.png')
        open(img_file_png, 'a').close()

# Create class_to_idx mapping
class_to_idx = {
    'class_a': 0,
    'class_b': 1
}

# Define ARGS dictionary
ARGS = {
    'dir': temp_dir,
    'class_to_idx': class_to_idx,
    'suffix': ''
}
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 2, 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
train_subroutine Ran
ran on a synthesized input
caotians1/OD-test-master/Time_methods.py
code served (permissive licence) · get_code("28b02b8975b12537")
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 torch.nn as nn

torch.manual_seed(0)

class StandInODMethod(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def propose_H(self, d1_train):
        pass
    
    def train_H(self, valid_mixture):
        return 0.85

class StandInDataset:
    def __init__(self, size, name):
        self.data = [(torch.randn(4), torch.randint(0, 2, (1,))) for _ in range(size)]
        self.name = name
    
    def __len__(self):
        return len(self.data)
    
    def __add__(self, other):
        combined = StandInDataset(0, f"{self.name}+{other.name}")
        combined.data = self.data + other.data
        return combined
    
    def trim_dataset(self, new_len):
        self.data = self.data[:new_len]

class StandInD1:
    def get_D1_train(self):
        return StandInDataset(8, "D1_train")
    
    def get_D1_valid(self):
        return StandInDataset(6, "D1_valid")

class StandInD2:
    def get_D2_valid(self, D1):
        return StandInDataset(5, "D2_valid")

ARGS = {
    "ODmethod": StandInODMethod(),
    "D1": StandInD1(),
    "D2": StandInD2(),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
termcolor, 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 4 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
find_classes 30 other papers
11 dated earlier, 19 later
1406.2661 (2014-06)
Generative Adversarial Networks
1612.06321 (2016-12)
Large-Scale Image Retrieval with Attentive Deep Local Features
1809.04729 (2018-09)
A Less Biased Evaluation of Out-of-distribution Sample Detectors
and 27 more not named here
is_image_file 22 other papers
9 dated earlier, 13 later
1406.2661 (2014-06)
Generative Adversarial Networks
1603.08511 (2016-03)
Colorful Image Colorization
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
and 19 more not named here
make_dataset 1 other paper
1 dated earlier
1809.04729 (2018-09)
A Less Biased Evaluation of Out-of-distribution Sample Detectors

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

Motivation: Deep learning models deployed for use on medical tasks can be equipped with Out-of-Distribution Detection (OoDD) methods in order to avoid erroneous predictions. However it is unclear which OoDD method should be used in practice. Specific Problem: Systems trained for one particular domain of images cannot be expected to perform accurately on images of a different domain. These images should be flagged by an OoDD method prior to diagnosis. Our approach: This paper defines 3 categories of OoD examples and benchmarks popular OoDD methods in three domains of medical imaging: chest X-ray, fundus imaging, and histology slides. Results: Our experiments show that despite methods yielding good results on some categories of out-of-distribution samples, they fail to recognize images close to the training distribution. Conclusion: We find a simple binary classifier on the feature representation has the best accuracy and AUPRC on average. Users of diagnostic tools which employ these OoDD methods should still remain vigilant that images very close to the training distribution yet not in it could yield unexpected results.

For agents

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

get_harvested_code_for_paper("2007.04250")
get_code_for_paper("2007.04250")
have("2007.04250")

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

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

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

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

Connect an agent — have() is free.