SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.13234 · ICLR · 2024

Conference paper at ICLR 2024 DECODING NATURAL IMAGES FROM EEG FOR OBJECT RECOGNITION

Xiang Li, Yonghao Song, Bingchuan Liu, Nanlin Shi, Yijun Wang, Xiaorong Gao

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-24; 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/2308.13234.json · badge: /api/ran/2308.13234.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
eeyhsong/nice-eeg canonical (classifier label)
classifier basis: classifier_2025
6 ran · 2 no recorded run
xiaozhangyes/cognitioncapturer community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
ncclab-sustech/eeg_image_decode community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
Enc_eeg Ran
ran on a synthesized input · constructed an object; no result was computed
eeyhsong/nice-eeg/nice_stand.py
code served (permissive licence) · get_code("62e5aecd02415dcd")
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 an instance of its own class, Enc_eeg: the run constructed the object and did not call it, so no result was computed. 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 numpy as np
from einops.layers.torch import Rearrange

torch.manual_seed(0)

class FlattenHead(nn.Sequential):

    def __init__(self):
        super().__init__()

    def forward(self, x):
        x = x.contiguous().view(x.size(0), -1)
        return x

class PatchEmbedding(nn.Module):

    def __init__(self, emb_size=40):
        super().__init__()
        self.tsconv = nn.Sequential(nn.Conv2d(1, 40, (1, 25), (1, 1)), nn.AvgPool2d((1, 51), (1, 5)), nn.BatchNorm2d(40), nn.ELU(), nn.Conv2d(40, 40, (63, 1), (1, 1)), nn.BatchNorm2d(40), nn.ELU(), nn.Dropout(0.5))
        self.projection = nn.Sequential(nn.Conv2d(40, emb_size, (1, 1), stride=(1, 1)), Rearrange('b e (h) (w) -> b (h w) e'))

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        x = self.tsconv(x)
        x = self.projection(x)
        return x

class Enc_eeg(nn.Sequential):

    def __init__(self, emb_size=40, **kwargs):
        super().__init__(PatchEmbedding(emb_size), FlattenHead())

# Create test input tensor with appropriate dimensions
# The network expects input shape (batch, channels, height, width)
# batch=2, channels=1, height=63 (matches Conv2d kernel), width needs to be at least 25+51-1
test_input = torch.randn(2, 1, 63, 128)

ARGS = {
    'emb_size': 40
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Enc_eeg — the run constructed an instance of its own class and did not call it; no shape 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
FlattenHead Ran
ran on a synthesized input · constructed an object; no result was computed
eeyhsong/nice-eeg/nice_stand.py
code served (permissive licence) · get_code("9aca28b9d0e02be2")
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 an instance of its own class, FlattenHead: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

class FlattenHead(nn.Sequential):

    def __init__(self):
        super().__init__()

    def forward(self, x):
        x = x.contiguous().view(x.size(0), -1)
        return x

ARGS = {}
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 FlattenHead — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FlattenHead output the recorded ndim 1 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
PatchEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
eeyhsong/nice-eeg/nice_stand.py
code served (permissive licence) · get_code("8e7c1b0649fa0c51")
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 an instance of its own class, PatchEmbedding: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

# The PatchEmbedding class only takes one parameter: emb_size
# We need to provide a valid value for it
emb_size_value = 40

ARGS = {
    'emb_size': emb_size_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PatchEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PatchEmbedding 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
Proj_eeg Ran
ran on a synthesized input · constructed an object; no result was computed
eeyhsong/nice-eeg/nice_stand.py
code served (permissive licence) · get_code("76f1ee846c636698")
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 an instance of its own class, Proj_eeg: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

ARGS = {
    'embedding_dim': 1440,
    'proj_dim': 768,
    'drop_proj': 0.5
}
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 Proj_eeg — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Proj_eeg output the recorded ndim 1 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
Proj_img Ran
ran on a synthesized input · constructed an object; no result was computed
eeyhsong/nice-eeg/nice_stand.py
code served (permissive licence) · get_code("3a67493f23f496fc")
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 an instance of its own class, Proj_img: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

ARGS = {
    'embedding_dim': 768,
    'proj_dim': 768,
    'drop_proj': 0.3
}
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 Proj_img — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Proj_img output the recorded ndim 1 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
ResidualAdd Ran
ran on a synthesized input
eeyhsong/nice-eeg/nice_stand.py
code served (permissive licence) · get_code("8e91610149da4e52")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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 torch
import torch.nn as nn
import numpy as np

# Create a simple function/module to wrap in ResidualAdd
class SimpleFn(nn.Module):
    def __init__(self, dim):
        super().__init__()
        self.linear = nn.Linear(dim, dim)
    
    def forward(self, x, **kwargs):
        return self.linear(x)

# Initialize the function that will be wrapped
fn = SimpleFn(dim=4)

INIT_ARGS = {
    'fn': fn
}

ARGS = {
    'x': torch.randn(2, 4)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
evaluation Ran
ran on a synthesized input
xiaozhangyes/cognitioncapturer/src/models/components/utils.py
code served (permissive licence) · get_code("e2c3c0b6fb6fe418")
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
import torch.nn.functional as F

torch.manual_seed(0)

class TextEncoder(nn.Module):
    def __init__(self, input_dim=4, output_dim=8):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

class VisualEncoder(nn.Module):
    def __init__(self, input_dim=4, output_dim=8):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

class EEGEncoder(nn.Module):
    def __init__(self, input_dim=4, output_dim=8):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

class FusionEncoder(nn.Module):
    def __init__(self, embed_dim=8, output_dim=16):
        super().__init__()
        self.linear = nn.Linear(embed_dim * 2, output_dim)
    
    def forward(self, img_embed, text_embed, eeg_embed):
        combined = torch.cat([img_embed, text_embed], dim=-1)
        return self.linear(combined)

class ITMHead(nn.Module):
    def __init__(self, input_dim=16, num_classes=2):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

class Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.text_encoder = TextEncoder(input_dim=4, output_dim=8)
        self.visual_encoder = VisualEncoder(input_dim=4, output_dim=8)
        self.eeg_encoder = EEGEncoder(input_dim=4, output_dim=8)
        self.fusion_encoder = FusionEncoder(embed_dim=8, output_dim=16)
        self.itm_head = ITMHead(input_dim=16, num_classes=2)

model = Model()

# EEG data: shape (2, 4) - 2 samples, 4 features
eeg = torch.randn(2, 4)

# Text features: shape (3, 4) - 3 text samples, 4 features
text_features = torch.randn(3, 4)

# Image features: shape (2, 4) - 2 image samples, 4 features
image_features = torch.randn(2, 4)

k = 2  # top-k
n = 2  # n-way

ARGS = {
    'model': model,
    'eeg': eeg,
    'text_features': text_features,
    'image_features': image_features,
    'k': k,
    'n': n,
}
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 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
get_model_structure Ran
ran on a synthesized input
xiaozhangyes/cognitioncapturer/src/models/components/Cogcap/Cogcap.py
code served (permissive licence) · get_code("bf26f5df6af6c707")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Build a small model with Linear, GELU, Dropout, and LayerNorm layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 8)
        self.gelu = nn.GELU()
        self.dropout = nn.Dropout(0.1)
        self.layer_norm = nn.LayerNorm(8)
        self.linear2 = nn.Linear(8, 3)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.gelu(x)
        x = self.dropout(x)
        x = self.layer_norm(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    'model': model
}
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
itm_eval Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xiaozhangyes/cognitioncapturer/src/models/components/utils.py
code served (permissive licence) · get_code("c7f85279d772ea19")
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) 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 numpy as np
import torch

torch.manual_seed(0)

# scores_i2t: shape (num_images, num_texts) - similarity scores from images to texts
# Each row is scores for one image against all texts
scores_i2t = np.random.rand(2, 4).astype(np.float32)

# scores_t2i: shape (num_texts, num_images) - similarity scores from texts to images
# Each row is scores for one text against all images
scores_t2i = np.random.rand(4, 2).astype(np.float32)

# txt2img: dict mapping text index to image index
# For each text, which image is the correct match
txt2img = {
    0: 0,
    1: 1,
    2: 0,
    3: 1
}

# img2txt: dict mapping image index to list of text indices
# For each image, which texts are valid matches
img2txt = {
    0: [0, 2],
    1: [1, 3]
}

ARGS = {
    'scores_i2t': scores_i2t,
    'scores_t2i': scores_t2i,
    'txt2img': txt2img,
    'img2txt': img2txt
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
DiffusionPrior Not yet run
unverified (harvested, no recorded run)
ncclab-sustech/eeg_image_decode/Generation/diffusion_prior.py
code served (permissive licence) · get_code("4515ed9ed335ba90")
How it ran

no invocation recorded.

IE Not yet run
unverified (harvested, no recorded run)
eeyhsong/nice-eeg/nice_stand.py
code served (permissive licence) · get_code("8b7cf593d55de63c")
How it ran

no invocation recorded.

weights_init_normal Not yet run
unverified (harvested, no recorded run)
eeyhsong/nice-eeg/nice_stand.py
code served (permissive licence) · get_code("fecc771b6daaf666")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 3 later) and 9 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
itm_eval 13 other papers
8 dated earlier, 5 later
2107.07651 (2021-07)
Align before Fuse: Vision and Language Representation Learning with Momentum Distillation
2202.10401 (2022-02)
Vision-Language Pre-Training with Triple Contrastive Learning
2206.00621 (2022-06)
Cross-View Language Modeling: Towards Unified Cross-Lingual Cross-Modal Pre-training
and 10 more not named here
ResidualAdd
brick of this paper's assembly: model
3 other papers
3 later · 1 only as an assembly brick
2411.19451 (2024-11)
Learning Visual Abstract Reasoning through Dual-Stream Networks
2604.19368 (2026-04)
Mind2Drive: Predicting Driver Intentions from EEG in Real-world On-Road Driving
2605.24523 (2026-05)
MindAlign: Bridging EEG, Vision, and Language for Zero-Shot Visual Decoding
FlattenHead
brick of this paper's assembly: model
1 other paper
1 later
2605.24523 (2026-05)
MindAlign: Bridging EEG, Vision, and Language for Zero-Shot Visual Decoding

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

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Electroencephalography (EEG) signals, known for convenient non-invasive acquisition but low signal-to-noise ratio, have recently gained substantial attention due to the potential to decode natural images. This paper presents a self-supervised framework to demonstrate the feasibility of learning image representations from EEG signals, particularly for object recognition. The framework utilizes image and EEG encoders to extract features from paired image stimuli and EEG responses. Contrastive learning aligns these two modalities by constraining their similarity. Our approach achieves state-of-the-art results on a comprehensive EEG-image dataset, with a top-1 accuracy of 15.6% and a top-5 accuracy of 42.8% in 200-way zero-shot tasks. Moreover, we perform extensive experiments to explore the biological plausibility by resolving the temporal, spatial, spectral, and semantic aspects of EEG signals. Besides, we introduce attention modules to capture spatial correlations, providing implicit evidence of the brain activity perceived from EEG data. These findings yield valuable insights for neural decoding and brain-computer interfaces in real-world scenarios. Code available at https://github.com/eeyhsong/NICE-EEG.

For agents

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

get_harvested_code_for_paper("2308.13234")
get_code_for_paper("2308.13234")
have("2308.13234")

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

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

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

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

Connect an agent — have() is free.