SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.07775 · CVPR · 2023

Data-Free Sketch-Based Image Retrieval

Yi-Zhe Song, Abhra Chaudhuri, Anjan Dutta, Ayan Bhunia

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 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 0 have no contract verdict; 2 failures of our instrument; 0 no recorded run), 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/2303.07775.json · badge: /api/ran/2303.07775.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
abhrac/data-free-sbir community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
epoch_generators Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
abhrac/data-free-sbir/cycles/generation/unified_classifier.py
code served (permissive licence) · get_code("e40b7b0c2a091a33")
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 tuple. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Build minimal args object
class Args:
    def __init__(self):
        self.batch_size = 2
        self.latent_dim = 4
        self.n_epochs = 5
        self.oh = 0.1  # loss_one_hot weight
        self.ie = 0.1  # loss_information_entropy weight
        self.a = 0.1   # loss_activation weight

args = Args()

# Build minimal generator models
class Generator(nn.Module):
    def __init__(self, latent_dim):
        super().__init__()
        self.fc = nn.Linear(latent_dim * 1 * 1, 64)
        self.conv = nn.Conv2d(64, 3, 3, padding=1)
    
    def forward(self, z):
        # z shape: (batch, latent_dim, 1, 1)
        batch_size = z.shape[0]
        x = z.view(batch_size, -1)
        x = self.fc(x)
        x = x.view(batch_size, 64, 1, 1)
        x = torch.nn.functional.interpolate(x, size=(8, 8), mode='nearest')
        x = self.conv(x)
        return x

g_photo = Generator(args.latent_dim)
g_sketch = Generator(args.latent_dim)

# Build minimal classifier with fc layer
class Classifier(nn.Module):
    def __init__(self, num_classes=10):
        super().__init__()
        self.conv = nn.Conv2d(3, 16, 3, padding=1)
        self.pool = nn.AdaptiveAvgPool2d((2, 2))
        self.fc = nn.Linear(16 * 2 * 2, num_classes)
    
    def forward(self, x):
        x = self.conv(x)
        x = self.pool(x)
        x = x.view(x.shape[0], -1)
        x = self.fc(x)
        return x

c_unified = Classifier(num_classes=10)

# Build minimal modality classifier
class ModalityClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(3 * 8 * 8, 1)
    
    def forward(self, x):
        x = x.view(x.shape[0], -1)
        x = self.fc(x)
        return x

c_modality = ModalityClassifier()

# Build minimal encoder models
class Encoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 16, 3, padding=1)
        self.pool = nn.AdaptiveAvgPool2d((2, 2))
    
    def forward(self, x):
        x = self.conv(x)
        x = self.pool(x)
        return x

e_photo = Encoder()
e_sketch = Encoder()

# Create optimizer
optimizer_g = torch.optim.Adam(
    list(g_photo.parameters()) + list(g_sketch.parameters()),
    lr=0.0002
)

# Set up ARGS dictionary
ARGS = {
    'args': args,
    'g_photo': g_photo,
    'g_sketch': g_sketch,
    'c_unified': c_unified,
    'c_modality': c_modality,
    'e_photo': e_photo,
    'e_sketch': e_sketch,
    'optimizer_g': optimizer_g,
    'epoch': 1,
    'n_iters': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch, tqdm — 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
kld Ran
ran; our contract draft was wrong, not the code
abhrac/data-free-sbir/cycles/generation/unified_classifier.py
code served (permissive licence) · get_code("cff32bcbfc678f03")
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 Tensor, 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.functional as F

torch.manual_seed(0)

# The function kld takes two arguments: y1 and y2
# Both are used with:
# - F.log_softmax(y1, dim=1) - requires 2D tensor
# - F.softmax(y2, dim=1) - requires 2D tensor
# - y1.shape[0] - accessing batch size
# Both need to be 2D tensors with the same shape for kl_div to work

# Create small 2D tensors: batch size 2, num_classes 4
y1 = torch.randn(2, 4)
y2 = torch.randn(2, 4)

ARGS = {
    'y1': y1,
    'y2': y2
}
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 Tensor, 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 2 samples lifted from this paper's linked repositories, 2 carry a function identity and 0 do not. Of the 2 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 2 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

Rising concerns about privacy and anonymity preservation of deep learning models have facilitated research in data-free learning (DFL). For the first time, we identify that for data-scarce tasks like Sketch-Based Image Retrieval (SBIR), where the difficulty in acquiring paired photos and hand-drawn sketches limits data-dependent crossmodal learning algorithms, DFL can prove to be a much more practical paradigm. We thus propose Data-Free (DF)-SBIR, where, unlike existing DFL problems, pre-trained, single-modality classification models have to be leveraged to learn a cross-modal metric-space for retrieval without access to any training data. The widespread availability of pre-trained classification models, along with the difficulty in acquiring paired photo-sketch datasets for SBIR justify the practicality of this setting. We present a methodology for DF-SBIR, which can leverage knowledge from models independently trained to perform classification on photos and sketches. We evaluate our model on the Sketchy, TU-Berlin, and QuickDraw benchmarks, designing a variety of baselines based on state-of-the-art DFL literature, and observe that our method surpasses all of them by significant margins. Our method also achieves mAPs competitive with data-dependent approaches, all the while requiring no training data. Implementation is available at https: //github.com/abhrac/data-free-sbir.

For agents

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

get_harvested_code_for_paper("2303.07775")
get_code_for_paper("2303.07775")
have("2303.07775")

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

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

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

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

Connect an agent — have() is free.