SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1908.00347 · 2019

Central Similarity Quantization for Efficient Image and Video Retrieval

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 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, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 4 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/1908.00347.json · badge: /api/ran/1908.00347.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
yuanli2333/Hadamard-Matrix-for-hashing canonical (classifier label)
classifier basis: census
7 ran · 4 no recorded run
FunctionStatusWhere it lives
autofill Ran
ran on a synthesized input
yuanli2333/Hadamard-Matrix-for-hashing/video/train_hmdb51.py
code served (permissive licence) · get_code("bab73c3099afdbc5")
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 Args. 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 socket
from argparse import Namespace

class Args:
    def __init__(self):
        self.task_name = None
        self.log_file = None
        self.model_dir = './models'

args = Args()
args.task_name = None
args.log_file = None
args.model_dir = './models'

ARGS = {
    'args': args
}
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 Args — a Args output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Args 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_config Ran
ran on a synthesized input
yuanli2333/Hadamard-Matrix-for-hashing/video/network/config.py
code served (permissive licence) · get_code("7235e50950323616")
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 logging

# Set up logging to see debug/info messages
logging.basicConfig(level=logging.DEBUG)

# Define ARGS with all parameters for get_config
ARGS = {
    'name': '3D_ResNet',
    'kwargs': {}
}
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 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
image_test Ran
ran on a synthesized input
yuanli2333/Hadamard-Matrix-for-hashing/pre_process.py
code served (permissive licence) · get_code("dff451db0315485c")
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 Compose. 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
from PIL import Image

torch.manual_seed(0)

ARGS = {
    "resize_size": 256,
    "crop_size": 224,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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
image_test_10crop Ran
ran on a synthesized input
yuanli2333/Hadamard-Matrix-for-hashing/pre_process.py
code served (permissive licence) · get_code("9a338479bd269e9b")
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 torch
import numpy as np
from PIL import Image

# Create a small test image
test_image = Image.new('RGB', (300, 300), color='red')

ARGS = {
    'resize_size': 256,
    'crop_size': 224,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — 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
image_train Ran
ran on a synthesized input
yuanli2333/Hadamard-Matrix-for-hashing/pre_process.py
code served (permissive licence) · get_code("3331c5176304df6a")
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 Compose. 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
from PIL import Image
from torchvision import transforms

torch.manual_seed(0)

# Create a small dummy image for testing
dummy_image = Image.new('RGB', (300, 300), color='red')

ARGS = {
    'resize_size': 256,
    'crop_size': 224
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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
pairwise_loss Ran
ran on a synthesized input
yuanli2333/Hadamard-Matrix-for-hashing/my_pairwise_loss.py
code served (permissive licence) · get_code("f9ace268fb1698a9")
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
from torch.autograd import Variable

torch.manual_seed(0)

# Create small tensors for the function
batch_size = 2
output_dim = 4
label_dim = 3

# outputs1 and outputs2: tensors of shape (batch_size, output_dim)
outputs1 = torch.randn(batch_size, output_dim)
outputs2 = torch.randn(batch_size, output_dim)

# label1 and label2: tensors of shape (batch_size, label_dim)
# These should be binary labels (0 or 1) since they're compared with > 0
label1 = torch.randint(0, 2, (batch_size, label_dim)).float()
label2 = torch.randint(0, 2, (batch_size, label_dim)).float()

# sigmoid_param: scalar float parameter
sigmoid_param = 1.0

# data_imbalance: scalar float parameter
data_imbalance = 1.0

ARGS = {
    "outputs1": outputs1,
    "outputs2": outputs2,
    "label1": label1,
    "label2": label2,
    "sigmoid_param": sigmoid_param,
    "data_imbalance": data_imbalance,
}
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
pil_loader Ran
ran, honoured the contract we drafted
yuanli2333/Hadamard-Matrix-for-hashing/data_list.py
pointer only (licence: MIT); the stored copy get_code serves, from YuemingJin/MTRCNet-CL, is pointer only (licence: NONE) · get_code("1df9a5ffd9b38c34")
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 YuemingJin/MTRCNet-CL, 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.

accimage_loader Not yet run
unverified (harvested, no recorded run)
yuanli2333/Hadamard-Matrix-for-hashing/data_list.py
code served (permissive licence) · get_code("9dcef767571b38d7")
How it ran

no invocation recorded.

get_symbol Not yet run
unverified (harvested, no recorded run)
yuanli2333/Hadamard-Matrix-for-hashing/video/network/symbol_builder.py
code served (permissive licence) · get_code("0eb54c65679dac58")
How it ran

no invocation recorded.

init_3d_from_2d_dict Not yet run
unverified (harvested, no recorded run)
yuanli2333/Hadamard-Matrix-for-hashing/video/network/initializer.py
code served (permissive licence) · get_code("90def75b21b5e19b")
How it ran

no invocation recorded.

make_dataset Not yet run
unverified (harvested, no recorded run)
yuanli2333/Hadamard-Matrix-for-hashing/data_list.py
pointer only (licence: MIT); the stored copy get_code serves, from Albert0147/AaD_SFDA, is pointer only (licence: NONE) · get_code("2301055cb33836bc")
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 Albert0147/AaD_SFDA, 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. No invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 7 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 4 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
accimage_loader 39 other papers
4 dated earlier, 35 later
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
1711.02512 (2017-11)
Fine-tuning CNN Image Retrieval with No Human Annotation
1805.00907 (2018-05)
Glow: Graph Lowering Compiler Techniques for Neural Networks
and 36 more not named here
pil_loader 28 other papers
6 dated earlier, 22 later
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
1805.07932 (2018-05)
Bilinear Attention Networks
1807.06587 (2018-07)
Deep Exemplar-based Colorization
and 25 more not named here
make_dataset 15 other papers
1 dated earlier, 14 later · 5 only as an assembly brick
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
2003.02541 (2020-03)
A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
and 12 more not named here
image_test 1 other paper
1 dated earlier
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
image_test_10crop 1 other paper
1 dated earlier
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
image_train 1 other paper
1 dated earlier
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
init_3d_from_2d_dict 1 other paper
1 later
2107.04941 (2021-07)
Partial Video Domain Adaptation with Partial Adversarial Temporal Attentive Network

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

Existing data-dependent hashing methods usually learn hash functions from pairwise or triplet data relationships, which only capture the data similarity locally, and often suffer from low learning efficiency and low collision rate. In this work, we propose a new \emph{global} similarity metric, termed as \emph{central similarity}, with which the hash codes of similar data pairs are encouraged to approach a common center and those for dissimilar pairs to converge to different centers, to improve hash learning efficiency and retrieval accuracy. We principally formulate the computation of the proposed central similarity metric by introducing a new concept, i.e., \emph{hash center} that refers to a set of data points scattered in the Hamming space with a sufficient mutual distance between each other. We then provide an efficient method to construct well separated hash centers by leveraging the Hadamard matrix and Bernoulli distributions. Finally, we propose the Central Similarity Quantization (CSQ) that optimizes the central similarity between data points w.r.t.\ their hash centers instead of optimizing the local similarity. CSQ is generic and applicable to both image and video hashing scenarios. Extensive experiments on large-scale image and video retrieval tasks demonstrate that CSQ can generate cohesive hash codes for similar data pairs and dispersed hash codes for dissimilar pairs, achieving a noticeable boost in retrieval performance, i.e. 3\%-20\% in mAP over the previous state-of-the-arts. The code is at: \url{https://github.com/yuanli2333/Hadamard-Matrix-for-hashing}

For agents

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

get_harvested_code_for_paper("1908.00347")
get_code_for_paper("1908.00347")
have("1908.00347")

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

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

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

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

Connect an agent — have() is free.