SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_26741 · AAAI · 2023

READ: Aggregating Reconstruction Error into Out-of-Distribution Detection

Hao Cheng, Wenyu Jiang, Mingcai Chen, Chongjun Wang, Yuxin Ge, Shuai Feng

Open in the Atlas

Code that ran

9 of 21 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; 1 honoured the contract we drafted, 1 violated it and 7 have no contract verdict; 0 failures of our instrument; 12 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-22; 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/aaai_26741.json · badge: /api/ran/aaai_26741.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
lygjwy/READ canonical (classifier label)
classifier basis: census
9 ran · 12 no recorded run
FunctionStatusWhere it lives
cosine_annealing Ran
ran, violated the contract we drafted
lygjwy/READ/train_ae.py
code served (permissive licence) · get_code("05eda95f9800a1e9")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned float64, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:12:48Z). 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 = {
    "step": 5,
    "total_steps": 100,
    "lr_max": 0.1,
    "lr_min": 0.001,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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, 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_hybrid_kl_scores Ran
ran on a synthesized input
lygjwy/READ/detect_cla_hybrid.py
code served (permissive licence) · get_code("e470774df6f23889")
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. 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 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal autoencoder
class MinimalAE(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(4, 2)
        self.fc2 = nn.Linear(2, 4)
    
    def forward(self, x):
        x = x.view(x.shape[0], -1)
        x = self.fc1(x)
        x = self.fc2(x)
        return x.view(-1, 1, 2, 2)

# Define a minimal classifier
class MinimalClassifier(nn.Module):
    def __init__(self, num_classes=3):
        super().__init__()
        self.fc = nn.Linear(4, num_classes)
    
    def forward(self, x):
        x = x.view(x.shape[0], -1)
        return self.fc(x)

# Define a normalize function
def normalize_fn(img):
    return (img - img.mean()) / (img.std() + 1e-5)

# Create models
ae = MinimalAE()
classifier = MinimalClassifier(num_classes=3)

# Create data loader
data_loader = []
for _ in range(2):
    data_loader.append({
        'data': torch.randn(2, 1, 2, 2),
        'complexity': torch.tensor([0.3, 0.7])
    })

ARGS = {
    'ae': ae,
    'classifier': classifier,
    'data_loader': data_loader,
    'normalize': normalize_fn,
    'combination': 'hybrid'
}
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 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
get_kl_scores Ran
ran on a synthesized input
lygjwy/READ/detect_cla.py
code served (permissive licence) · get_code("99a8cc22e32fa55b")
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. 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 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal classifier that takes data and outputs logits
class SimpleClassifier(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create classifier instance
classifier = SimpleClassifier(input_dim=4, num_classes=3)

# Create a minimal data loader
# The function expects sample['data'] to exist
data_loader = [
    {'data': torch.randn(2, 4)},
    {'data': torch.randn(2, 4)},
]

ARGS = {
    'classifier': classifier,
    'data_loader': data_loader,
}
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 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
get_msp_scores Ran
ran on a synthesized input
lygjwy/READ/detect_cla.py
code served (permissive licence) · get_code("4990f43659bdd016")
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. 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 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal classifier that takes data and returns logits
class SimpleClassifier(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create classifier instance
classifier = SimpleClassifier(input_dim=4, num_classes=3)

# Create data loader as a list of dicts with 'data' key
# Each sample is a dict with 'data' tensor of shape (batch_size, input_dim)
data_loader = [
    {'data': torch.randn(2, 4)},
    {'data': torch.randn(2, 4)},
]

ARGS = {
    'classifier': classifier,
    'data_loader': data_loader,
}
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 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
get_resnet18 Ran
ran on a synthesized input
lygjwy/READ/models/resnet.py
code served (permissive licence) · get_code("510a5423eca7824c")
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 ResNet. 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)

ARGS = {
    "num_classes": 10,
    "include_top": True,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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_resnet34 Ran
ran on a synthesized input
lygjwy/READ/models/resnet.py
code served (permissive licence) · get_code("40a57a2fd8fea362")
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 ResNet. 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)

ARGS = {
    'num_classes': 10,
    'include_top': True,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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_resnet50 Ran
ran on a synthesized input
lygjwy/READ/models/resnet.py
code served (permissive licence) · get_code("547c42e3a04af538")
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 ResNet. 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)

ARGS = {
    "num_classes": 10,
    "include_top": True,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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_wrn Ran
ran on a synthesized input
lygjwy/READ/models/wide_resnet.py
code served (permissive licence) · get_code("13e64b8f43c7b74e")
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 WideResNet. 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
import math

torch.manual_seed(0)

# The get_wrn function requires:
# - num_classes: int
# - layers: int (depth parameter, must satisfy (depth - 4) % 6 == 0)
# - widen_factor: int or float
# - drop_rate: float
# - include_top: bool (optional, defaults to True)

ARGS = {
    "num_classes": 10,
    "layers": 16,  # (16 - 4) % 6 == 0, so this is valid
    "widen_factor": 1,
    "drop_rate": 0.0,
    "include_top": True,
}
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 WideResNet — a WideResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a WideResNet 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
norm Ran
ran, honoured the contract we drafted
lygjwy/READ/models/deconf_net.py
pointer only (licence: MIT); the stored copy get_code serves, from mattolson93/counterfactual-state-explanations, is pointer only (licence: NONE) · get_code("b7b09d9d9a19672a")
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 mattolson93/counterfactual-state-explanations, 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.

get_ae Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/models/utils.py
code served (permissive licence) · get_code("296102061adc039d")
How it ran

no invocation recorded.

get_classifier Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/models/utils.py
code served (permissive licence) · get_code("ba1f61f13be189e5")
How it ran

no invocation recorded.

get_feature_extractor Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/models/utils.py
code served (permissive licence) · get_code("238893ff0a5e58c1")
How it ran

no invocation recorded.

get_godin_scores Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/detect_deconf.py
code served (permissive licence) · get_code("81b95f6bd2230381")
How it ran

no invocation recorded.

get_h Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/models/deconf_net.py
code served (permissive licence) · get_code("f903d923445b9014")
How it ran

no invocation recorded.

get_hybrid_inner_scores Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/detect_cla_hybrid.py
code served (permissive licence) · get_code("6dfd7094fa405104")
How it ran

no invocation recorded.

get_hybrid_scores Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/detect_deconf_hybrid.py
code served (permissive licence) · get_code("1e5293de53f52cee")
How it ran

no invocation recorded.

get_odin_scores Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/detect_cla.py
code served (permissive licence) · get_code("ce0602d1c70e203d")
How it ran

no invocation recorded.

get_rec_errs Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/rec_err.py
code served (permissive licence) · get_code("37ba6ac95f90012e")
How it ran

no invocation recorded.

get_res_ae Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/models/res_ae.py
code served (permissive licence) · get_code("39c8d33a32b5339c")
How it ran

no invocation recorded.

sample_estimator Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/detect_cla_hybrid.py
code served (permissive licence) · get_code("c0a1539ed030cd62")
How it ran

no invocation recorded.

save_rec_imgs Not yet run
unverified (harvested, no recorded run)
lygjwy/READ/rec_err.py
code served (permissive licence) · get_code("b013f40f55fe7fdb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 19 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
cosine_annealing 9 other papers
4 dated earlier, 1 later, 4 same year, order not determinable
1901.09960 (2019-01)
Using Pre-Training Can Improve Model Robustness and Uncertainty
2003.09711 (2020-03)
Robust Out-of-distribution Detection for Neural Networks
2108.11941 (2021-08)
Semantically Coherent Out-of-Distribution Detection
and 6 more not named here
norm 2 other papers
1 dated earlier, 1 same year, order not determinable
2101.12446 (2021-01)
Counterfactual State Explanations for Reinforcement Learning Agents via Generative Deep Learning
2306.02031 (2023-06)
DOS: Diverse Outlier Sampling for Out-of-Distribution Detection

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

Detecting out-of-distribution (OOD) samples is crucial to the safe deployment of a classifier in the real world. However, deep neural networks are known to be overconfident for abnormal data. Existing works directly design score function by mining the inconsistency from classifier for in-distribution (ID) and OOD. In this paper, we further complement this inconsistency with reconstruction error, based on the assumption that an autoencoder trained on ID data can not reconstruct OOD as well as ID. We propose a novel method, READ (Reconstruction Error Aggregated Detector), to unify inconsistencies from classifier and autoencoder. Specifically, the reconstruction error of raw pixels is transformed to latent space of classifier. We show that the transformed reconstruction error bridges the semantic gap and inherits detection performance from the original. Moreover, we propose an adjustment strategy to alleviate the overconfidence problem of autoencoder according to a fine-grained characterization of OOD data. Under two scenarios of pre-training and retraining, we respectively present two variants of our method, namely READ-MD (Mahalanobis Distance) only based on pre-trained classifier and READ-ED (Euclidean Distance) which retrains the classifier. Our methods do not require access to test time OOD data for fine-tuning hyperparameters. Finally, we demonstrate the effectiveness of the proposed methods through extensive comparisons with state-of-theart OOD detection algorithms. On a CIFAR-10 pre-trained WideResNet, our method reduces the average FPR@95TPR by up to 9.8% compared with previous state-of-the-art.

For agents

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

get_harvested_code_for_paper("aaai_26741")
get_code_for_paper("aaai_26741")
have("aaai_26741")

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

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

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

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

Connect an agent — have() is free.