SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.14803 · 2021

Face Transformer for Recognition

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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 5 have no contract verdict; 3 failures of our instrument; 1 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/2103.14803.json · badge: /api/ran/2103.14803.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
zhongyy/Face-Transformer canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
martlgap/octuplet-loss community (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
OctupletLoss Ran
ran on a synthesized input
martlgap/octuplet-loss/tf_octuplet_loss.py
code served (permissive licence) · get_code("4afffb876c33cacf")
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 function. 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create small test data
batch_size = 2
embedding_dim = 4

# Create embeddings: concatenated high-resolution and low-resolution embeddings (size: 2*batch_size x embedding_dim)
# Total shape should be (2*batch_size, embedding_dim) = (4, 4)
embeddings_hr = tf.constant([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)
embeddings_lr = tf.constant([[1.1, 2.1, 3.1, 4.1], [5.1, 6.1, 7.1, 8.1]], dtype=tf.float32)
embeddings = tf.concat([embeddings_hr, embeddings_lr], axis=0)

# Create labels: batch_size labels (2 samples, should have different or same classes)
labels = tf.constant([0, 1], dtype=tf.int64)

# Define ARGS dictionary with all parameters for OctupletLoss
ARGS = {
    'margin': 0.5,
    'metric': 'euclidean',
    'configuration': [True, True, True, True]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
calculate_accuracy Ran
ran, honoured the contract we drafted
zhongyy/Face-Transformer/util/verification.py
pointer only (licence: MIT); the stored copy get_code serves, from zrui94/insight_mx, is pointer only (licence: NONE) · get_code("f975336b5d5f1a80")
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 zrui94/insight_mx, 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.

calculate_roc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhongyy/Face-Transformer/util/verification.py
code served (permissive licence) · get_code("508a8168bc7cb3cc")
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 numpy as np
from sklearn.model_selection import KFold
from sklearn.decomposition import PCA
import sklearn

np.random.seed(0)

# Create small toy data for testing
nrof_samples = 8
embedding_dim = 4
nrof_folds = 2

# Create embeddings1 and embeddings2
embeddings1 = np.random.randn(nrof_samples, embedding_dim).astype(np.float32)
embeddings2 = np.random.randn(nrof_samples, embedding_dim).astype(np.float32)

# Create actual_issame labels (boolean array)
actual_issame = np.array([True, False, True, False, True, True, False, False], dtype=bool)

# Create thresholds
thresholds = np.linspace(0, 5, 10)

# Create ARGS dictionary with all parameters
ARGS = {
    'thresholds': thresholds,
    'embeddings1': embeddings1,
    'embeddings2': embeddings2,
    'actual_issame': actual_issame,
    'nrof_folds': nrof_folds,
    'pca': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
calculate_val Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhongyy/Face-Transformer/util/verification.py
pointer only (licence: MIT); the stored copy get_code serves, from dmonterom/face_recognition_TF2, is pointer only (licence: NONE) · get_code("f67f5f081381cc8a")
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 dmonterom/face_recognition_TF2, 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_config Ran
ran; our contract draft was wrong, not the code
zhongyy/Face-Transformer/config.py
code served (permissive licence) · get_code("479492c380d22e83")
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. 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 os
import tempfile

torch.manual_seed(0)

class Args:
    def __init__(self):
        self.workers_id = 'cpu'
        self.epochs = 100
        self.batch_size = 32
        self.data_mode = 'retina'
        self.net = 'VIT'
        self.head = 'ArcFace'
        self.target = 'lfw,cfp_fp,agedb_30'
        self.resume = ''
        self.outdir = tempfile.mkdtemp()

ARGS = {'args': Args()}
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 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
pairwise_distances Ran
ran on a synthesized input
martlgap/octuplet-loss/pt_octuplet_loss.py
code served (permissive licence) · get_code("8cf84f1b7fe9c04f")
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 2, dtype family float, shape (2, 2) 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

torch.manual_seed(0)

# Create small embeddings tensor: 2 samples, 4 dimensions
embeddings = torch.randn(2, 4, dtype=torch.float32)

# Test with 'euclidean' metric
metric = 'euclidean'

ARGS = {
    'embeddings': embeddings,
    'metric': metric,
}
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 2, dtype family float, shape (2, 2) — shape (2, 2) 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
pairwise_distances Ran
ran on a synthesized input
martlgap/octuplet-loss/tf_octuplet_loss.py
code served (permissive licence) · get_code("2a97a43ae927ec71")
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 EagerTensor, ndim 2, dtype family float, shape (2, 2) 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
np.random.seed(0)
tf.random.set_seed(0)

# Create small embeddings tensor: shape (2, 4) - 2 samples, 4 dimensions
embeddings = tf.constant([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=tf.float32)

# Define ARGS dict with all parameters
ARGS = {
    'embeddings': embeddings,
    'metric': 'euclidean'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 2) — shape (2, 2) 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
reduce_res Ran
ran on a synthesized input
martlgap/octuplet-loss/resizing.py
code served (permissive licence) · get_code("530597f221ce030e")
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 EagerTensor, ndim 4, dtype family int, shape (2, 4, 4, 3) 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 tensorflow as tf
import numpy as np

# Create a small batch of images
# Shape: [batch_size=2, height=4, width=4, channels=3]
batch = tf.constant(
    np.random.randint(0, 256, size=(2, 4, 4, 3), dtype=np.uint8),
    dtype=tf.uint8
)

# Desired resolution
res = 2

ARGS = {
    "batch": batch,
    "res": res,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family int, shape (2, 4, 4, 3) — shape (2, 4, 4, 3) 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
triplet_loss Ran
ran on a synthesized input
martlgap/octuplet-loss/tf_octuplet_loss.py
code served (permissive licence) · get_code("d2e065e4ad181e6c")
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 EagerTensor, ndim 1, dtype family float, shape (2,) 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 tensorflow as tf

# Create small valid tensors for triplet loss
batch_size = 2
embedding_dim = 4

# Create a small batch of pairwise distances (2x2 matrix)
# distances should be a pairwise distance matrix
distances = tf.constant([
    [0.0, 2.5],
    [2.5, 0.0]
], dtype=tf.float32)

# mask_pos: boolean mask indicating positive pairs (anchor-positive)
# Shape should match distances
mask_pos = tf.constant([
    [False, True],
    [True, False]
], dtype=tf.bool)

# mask_neg: boolean mask indicating negative pairs (anchor-negative)
# Shape should match distances
mask_neg = tf.constant([
    [True, False],
    [False, True]
], dtype=tf.bool)

# margin: scalar float value for triplet loss margin
margin = 1.0

ARGS = {
    "distances": distances,
    "mask_pos": mask_pos,
    "mask_neg": mask_neg,
    "margin": margin
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
triplet_loss Not yet run
unverified (harvested, no recorded run)
martlgap/octuplet-loss/pt_octuplet_loss.py
code served (permissive licence) · get_code("1e772459cfdc2c6e")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
calculate_accuracy 12 other papers
8 dated earlier, 4 later
1503.03832 (2015-03)
FaceNet: A Unified Embedding for Face Recognition and Clustering
1607.08221 (2016-07)
MS-Celeb-1M: A Dataset and Benchmark for Large-Scale Face Recognition
1703.07737 (2017-03)
In Defense of the Triplet Loss for Person Re-Identification
and 9 more not named here
calculate_val 2 other papers
2 dated earlier
1801.07698 (2018-01)
ArcFace: Additive Angular Margin Loss for Deep Face Recognition
2004.00288 (2020-04)
CurricularFace: Adaptive Curriculum Learning Loss for Deep Face Recognition

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

Recently there has been a growing interest in Transformer not only in NLP but also in computer vision. We wonder if transformer can be used in face recognition and whether it is better than CNNs. Therefore, we investigate the performance of Transformer models in face recognition. Considering the original Transformer may neglect the inter-patch information, we modify the patch generation process and make the tokens with sliding patches which overlaps with each others. The models are trained on CASIA-WebFace and MS-Celeb-1M databases, and evaluated on several mainstream benchmarks, including LFW, SLLFW, CALFW, CPLFW, TALFW, CFP-FP, AGEDB and IJB-C databases. We demonstrate that Face Transformer models trained on a large-scale database, MS-Celeb-1M, achieve comparable performance as CNN with similar number of parameters and MACs. To facilitate further researches, Face Transformer models and codes are available at https://github.com/zhongyy/Face-Transformer.

For agents

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

get_harvested_code_for_paper("2103.14803")
get_code_for_paper("2103.14803")
have("2103.14803")

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

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

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

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

Connect an agent — have() is free.