SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2101.08467 · ICCV · 2021

CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification

Tao Mei, Chaoyou Fu, Ran He, Yibo Hu, Hailin Shi, Xiang Wu

arXiv · PDF · Open in the Atlas

Code that ran

3 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 failures of our instrument; 5 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/2101.08467.json · badge: /api/ran/2101.08467.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
jdai-cv/cm-nas marked official in Papers with Code
Papers with Code archive
3 ran · 5 no recorded run
FunctionStatusWhere it lives
BottleneckSwitchBN Ran
ran on a synthesized input · constructed an object; no result was computed
jdai-cv/cm-nas/models/model_eval_op.py
code served (permissive licence) · get_code("d0c476f56de6f6ae")
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, BottleneckSwitchBN: 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

torch.manual_seed(0)

# Create a small downsample module that matches the interface expected
class DownsampleModule(nn.Module):
    def __init__(self, inplanes, planes, stride):
        super(DownsampleModule, self).__init__()
        self.conv = nn.Conv2d(inplanes, planes * 4, kernel_size=1, stride=stride, bias=False)
        self.bn = SwitchBatchNorm2d(planes * 4, switch=0, with_relu=False)
    
    def forward(self, x, mode=0):
        x = self.conv(x)
        x = self.bn(x, mode)
        return x

# Define the SwitchBatchNorm2d class first (copy from function signature)
class SwitchBatchNorm2d(nn.Module):
    def __init__(self, num_features, switch, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True, with_relu=True):
        super(SwitchBatchNorm2d, self).__init__()
        self.thermal_bn = nn.BatchNorm2d(num_features, eps, momentum, affine, track_running_stats)
        self.visible_bn = nn.BatchNorm2d(num_features, eps, momentum, affine, track_running_stats)
        self.sharable_bn = nn.BatchNorm2d(num_features, eps, momentum, affine, track_running_stats)
        self.relu = nn.ReLU(inplace=True) if with_relu else None
        self.switch = switch

    def forward(self, x, mode=0):
        if self.switch == 0:
            if mode == 0:
                x_v, x_t = torch.split(x, x.size(0) // 2, dim=0)
                x_v = self.visible_bn(x_v)
                x_t = self.thermal_bn(x_t)
                split_x = torch.cat((x_v, x_t), 0)
            elif mode == 1:
                split_x = self.visible_bn(x)
            elif mode == 2:
                split_x = self.thermal_bn(x)
            split_x = self.relu(split_x) if self.relu is not None else split_x
            return split_x
        elif self.switch == 1:
            share_x = self.sharable_bn(x)
            share_x = self.relu(share_x) if self.relu is not None else share_x
            return share_x
        else:
            raise ValueError('Invalid switch value: {}, must be 0 or 1.'.format(self.switch))

# Create config list with 3 switch values (popped by bn1, bn2, bn3)
config = [0, 0, 1]

# Create downsample module
inplanes = 8
planes = 4
stride = 1
downsample = DownsampleModule(inplanes, planes, stride)

ARGS = {
    'config': config,
    'inplanes': inplanes,
    'planes': planes,
    'stride': stride,
    'downsample': downsample
}
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 BottleneckSwitchBN — 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 BottleneckSwitchBN 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
DownsampleSwitchBN Ran
ran on a synthesized input · constructed an object; no result was computed
jdai-cv/cm-nas/models/model_eval_op.py
code served (permissive licence) · get_code("4c7df05474133fab")
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, DownsampleSwitchBN: 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

torch.manual_seed(0)

# Create a minimal config class that supports pop(0)
class Config(list):
    pass

# Create config with switch values (0 or 1)
config = Config([0])  # switch=0 for the SwitchBatchNorm2d

# Define parameters for DownsampleSwitchBN
in_channels = 3
out_channels = 16
kernel_size = 3
stride = 1
bias = True

ARGS = {
    'config': config,
    'in_channels': in_channels,
    'out_channels': out_channels,
    'kernel_size': kernel_size,
    'stride': stride,
    'bias': bias
}
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 DownsampleSwitchBN — 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 DownsampleSwitchBN 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
SwitchBatchNorm2d Ran
ran on a synthesized input · constructed an object; no result was computed
jdai-cv/cm-nas/models/model_eval_op.py
code served (permissive licence) · get_code("b9856d7c4ec9babd")
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, SwitchBatchNorm2d: 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

torch.manual_seed(0)

ARGS = {
    'num_features': 16,
    'switch': 0,
    'eps': 1e-05,
    'momentum': 0.1,
    'affine': True,
    'track_running_stats': True,
    'with_relu': 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 SwitchBatchNorm2d — 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 SwitchBatchNorm2d 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
ResNetUnfoldSwitchBN Not yet run
unverified (harvested, no recorded run)
jdai-cv/cm-nas/models/model_eval_op.py
code served (permissive licence) · get_code("17825e7bad73b9b7")
How it ran

no invocation recorded.

TwoStreamSwitchBNOp Not yet run
unverified (harvested, no recorded run)
jdai-cv/cm-nas/models/model_eval_op.py
code served (permissive licence) · get_code("b84cdbe3901e586d")
How it ran

no invocation recorded.

resnet50unfold_switchbn Not yet run
unverified (harvested, no recorded run)
jdai-cv/cm-nas/models/model_eval_op.py
code served (permissive licence) · get_code("a47ae8259ee2ffa5")
How it ran

no invocation recorded.

weights_init_classifier Not yet run
unverified (harvested, no recorded run)
jdai-cv/cm-nas/models/model_eval_op.py
code served (permissive licence) · get_code("879845a7088a8d3f")
How it ran

no invocation recorded.

weights_init_kaiming Not yet run
unverified (harvested, no recorded run)
jdai-cv/cm-nas/models/model_eval_op.py
code served (permissive licence) · get_code("7d29cff2640ae7d6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 8 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

Visible-Infrared person re-identification (VI-ReID) aims to match cross-modality pedestrian images, breaking through the limitation of single-modality person ReID in dark environment. In order to mitigate the impact of large modality discrepancy, existing works manually design various two-stream architectures to separately learn modalityspecific and modality-sharable representations. Such a manual design routine, however, highly depends on massive experiments and empirical practice, which is time consuming and labor intensive. In this paper, we systematically study the manually designed architectures, and identify that appropriately separating Batch Normalization (BN) layers is the key to bring a great boost towards crossmodality matching. Based on this observation, the essential objective is to find the optimal separation scheme for each BN layer. To this end, we propose a novel method, named Cross-Modality Neural Architecture Search (CM-NAS). It consists of a BN-oriented search space in which the standard optimization can be fulfilled subject to the cross-modality task. Equipped with the searched architecture, our method outperforms state-of-the-art counterparts in both two benchmarks, improving the Rank-1/mAP by 6.70%/6.13% on SYSU-MM01 and by 12.17%/11.23% on RegDB. Code is released at https://github.com/ JDAI-CV/CM-NAS.

For agents

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

get_harvested_code_for_paper("2101.08467")
get_code_for_paper("2101.08467")
have("2101.08467")

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

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

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

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

Connect an agent — have() is free.