SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1801.07698 · 2018

ArcFace: Additive Angular Margin Loss for Deep Face Recognition

arXiv · PDF · Open in the Atlas

Code that ran

16 of 21 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 14 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/1801.07698.json · badge: /api/ran/1801.07698.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
copy not recorded community
not in the paper's declared repositories
5 ran · 1 no recorded run
mike07026/insightface_20190620 reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
dmonterom/face_recognition_TF2 reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
linghu8812/pytorch_insightface reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
ronghuaiyang/arcface-pytorch reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
Talgin/facerec reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
sanaullah-ashfat/Face-recognition-with-Arcface-Tensorflow reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
foamliu/InsightFace-v2 reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 2 no recorded run
cvqluu/Angular-Penalty-Softmax-Losses-Pytorch reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
Mind23-2/MindCode-13 reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
IOU Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mike07026/insightface_20190620/src/align/align_insight.py
code served (permissive licence) · get_code("9348919b3a8be935")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned float, 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 numpy as np

torch.manual_seed(0)

# The function expects two bounding boxes in format [x1, y1, x2, y2]
# where (x1, y1) is top-left corner and (x2, y2) is bottom-right corner

# Create two overlapping bounding boxes
Reframe = [10.0, 20.0, 50.0, 60.0]  # Box 1: top-left (10, 20), bottom-right (50, 60)
GTframe = [30.0, 40.0, 70.0, 80.0]  # Box 2: top-left (30, 40), bottom-right (70, 80)

ARGS = {
    'Reframe': Reframe,
    'GTframe': GTframe
}
Setup block drafted by
a language model, Claude Sonnet 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 float, 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
calculate_accuracy Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from zrui94/insight_mx
pointer only; 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 copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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)
this paper's copy was not recorded; identical code first harvested from zrui94/insight_mx
pointer only; the stored copy get_code serves, from zrui94/insight_mx, is pointer only (licence: NONE) · get_code("db4008738f6c3eae")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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)
dmonterom/face_recognition_TF2/evaluation.py
pointer only (licence: NONE) · get_code("64b45da43b8ab573")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dmonterom/face_recognition_TF2 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)
linghu8812/pytorch_insightface/verification.py
pointer only (licence: NONE) · get_code("5f529c4af000c070")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, linghu8812/pytorch_insightface 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_val Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from zrui94/insight_mx
pointer only; the stored copy get_code serves, from zrui94/insight_mx, is pointer only (licence: NONE) · get_code("c7c89ea2508beb10")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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_val Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dmonterom/face_recognition_TF2/evaluation.py
pointer only (licence: NONE) · get_code("f67f5f081381cc8a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dmonterom/face_recognition_TF2 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_val_far Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
linghu8812/pytorch_insightface/verification.py
pointer only (licence: NONE) · get_code("c2ce20a5d37df6c4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, linghu8812/pytorch_insightface 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.

ch_dev Ran
ran; our contract draft was wrong, not the code
Talgin/facerec/src/api/face_model.py
code served (permissive licence) · get_code("eddb4fc2f9316aa0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, 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 numpy as np

class MockNDArray:
    def __init__(self, data):
        self.data = data
    
    def as_in_context(self, ctx):
        # Return a new MockNDArray with the same data but in the new context
        new_array = MockNDArray(self.data)
        new_array.ctx = ctx
        return new_array

class MockContext:
    def __init__(self, device_type='cpu', device_id=0):
        self.device_type = device_type
        self.device_id = device_id

# Create mock parameters (MXNet-style NDArrays)
arg_params = {
    'weight1': MockNDArray(np.random.randn(4, 3)),
    'bias1': MockNDArray(np.random.randn(4)),
    'weight2': MockNDArray(np.random.randn(5, 4)),
}

aux_params = {
    'bn_mean': MockNDArray(np.random.randn(4)),
    'bn_var': MockNDArray(np.random.randn(4)),
}

ctx = MockContext(device_type='cpu', device_id=0)

ARGS = {
    'arg_params': arg_params,
    'aux_params': aux_params,
    'ctx': ctx
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from lixiaotong97/DSU
pointer only; the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

divideIntoNstrand Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from DanJun6737/TopoFR
pointer only; the stored copy get_code serves, from DanJun6737/TopoFR, is pointer only (licence: NONE) · get_code("2da848988b60d9cc")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

load_pickle Ran
ran; our contract draft was wrong, not the code
sanaullah-ashfat/Face-recognition-with-Arcface-Tensorflow/main/RECOGNITION.py
pointer only (licence: NONE) · get_code("151ad8cf4f442cf0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, sanaullah-ashfat/Face-recognition-with-Arcface-Tensorflow 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.

parse_arguments Ran
ran; our contract draft was wrong, not the code
mike07026/insightface_20190620/src/align/align_insight.py
code served (permissive licence) · get_code("c2a17396e5b1b237")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Namespace. 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 argparse

def parse_arguments(argv):
    parser = argparse.ArgumentParser()
    parser.add_argument('--input-dir', type=str, help='Directory with unaligned images.')
    parser.add_argument('--name', type=str, help='dataset name, can be facescrub, megaface, webface, celeb.')
    parser.add_argument('--output-dir', type=str, help='Directory with aligned face thumbnails.')
    parser.add_argument('--force', type=int, help='force to output if no faces detected.', default=1)
    return parser.parse_args(argv)

argv = [
    '--input-dir', '/path/to/input',
    '--name', 'facescrub',
    '--output-dir', '/path/to/output',
    '--force', '1'
]

ARGS = {'argv': argv}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
resnet18 Ran
ran; our contract draft was wrong, not the code
ronghuaiyang/arcface-pytorch/models/resnet.py
pointer only (licence: NONE) · get_code("bd8fb5c95fa87652")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ronghuaiyang/arcface-pytorch 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.

resnet34 Ran
ran; our contract draft was wrong, not the code
ronghuaiyang/arcface-pytorch/models/resnet.py
pointer only (licence: NONE) · get_code("bb357f89cac141ff")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ronghuaiyang/arcface-pytorch 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.

to_rgb Ran
ran, honoured the contract we drafted
mike07026/insightface_20190620/src/align/align_insight.py
code served (permissive licence) · get_code("29507ad0ee182d8c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ndarray, ndim 3, dtype family int, shape (3, 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 numpy as np

# Create a small grayscale image (2D array)
img = np.array([[10, 20, 30, 40],
                [50, 60, 70, 80],
                [90, 100, 110, 120]], dtype=np.uint8)

ARGS = {
    'img': img
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (3, 4, 3) — shape (3, 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
accuracy Not yet run
unverified (harvested, no recorded run)
foamliu/InsightFace-v2/lfw_eval.py
code served (permissive licence) · get_code("dae42d7f4d41b99b")
How it ran

no invocation recorded.

get_embeds Not yet run
unverified (harvested, no recorded run)
cvqluu/Angular-Penalty-Softmax-Losses-Pytorch/train_fMNIST.py
code served (permissive licence) · get_code("e984e4da60619384")
How it ran

no invocation recorded.

read_feature Not yet run
unverified (harvested, no recorded run)
foamliu/InsightFace-v2/megaface.py
code served (permissive licence) · get_code("d5488fceeb40dc51")
How it ran

no invocation recorded.

read_template_media_list Not yet run
unverified (harvested, no recorded run)
Mind23-2/MindCode-13/eval_ijbc.py
pointer only (licence: NONE) · get_code("5b24fc008e2c830a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Mind23-2/MindCode-13 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.

read_template_pair_list Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from DanJun6737/TopoFR
pointer only; the stored copy get_code serves, from DanJun6737/TopoFR, is pointer only (licence: NONE) · get_code("897480715a729925")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 20 distinct functions with an identity, 12 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 2 the same month, 11 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
conv3x3 686 other papers
31 dated earlier, 1 the same month, 654 later · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
resnet18 89 other papers
1 dated earlier, 88 later
1705.09759 (2017-05)
CASENet: Deep Category-Aware Semantic Edge Detection
1803.00839 (2018-03)
Pose-Robust Face Recognition via Deep Residual Equivariant Mapping
1803.08494 (2018-03)
Group Normalization
and 86 more not named here
resnet34 53 other papers
1 dated earlier, 52 later
1705.09759 (2017-05)
CASENet: Deep Category-Aware Semantic Edge Detection
1803.00839 (2018-03)
Pose-Robust Face Recognition via Deep Residual Equivariant Mapping
1803.08494 (2018-03)
Group Normalization
and 50 more not named here
calculate_accuracy 12 other papers
5 dated earlier, 7 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_roc 5 other papers
2 dated earlier, 3 later
1607.08221 (2016-07)
MS-Celeb-1M: A Dataset and Benchmark for Large-Scale Face Recognition
1710.08092 (2017-10)
VGGFace2: A dataset for recognising faces across pose and age
1804.07573 (2018-04)
MobileFaceNets: Efficient CNNs for Accurate Real-Time Face Verification on Mobile Devices
and 2 more not named here
calculate_val 4 other papers
2 dated earlier, 2 later
1607.08221 (2016-07)
MS-Celeb-1M: A Dataset and Benchmark for Large-Scale Face Recognition
1710.08092 (2017-10)
VGGFace2: A dataset for recognising faces across pose and age
1804.07573 (2018-04)
MobileFaceNets: Efficient CNNs for Accurate Real-Time Face Verification on Mobile Devices
and 1 more not named here
divideIntoNstrand 4 other papers
4 later
aaai_20057 (2022 (year only))
FedFR: Joint Optimization Federated Framework for Generic and Personalized Face Recognition
2309.16298 (2023-09)
At Which Training Stage Does Code Data Help LLMs Reasoning?
2410.10587 (2024-10)
TopoFR: A Closer Look at Topology Alignment on Face Recognition
and 1 more not named here
IOU 3 other papers
3 later
1903.08527 (2019-03)
Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set
1905.00641 (2019-05)
RetinaFace: Single-stage Dense Face Localisation in the Wild
2003.06814 (2020-03)
Towards Face Encryption by Generating Adversarial Identity Masks
get_embeds 3 other papers
1 dated earlier, 2 the same month
1704.08063 (2017-04)
SphereFace: Deep Hypersphere Embedding for Face Recognition
1801.05599 (2018-01)
Additive Margin Softmax for Face Verification
1801.09414 (2018-01)
CosFace: Large Margin Cosine Loss for Deep Face Recognition
to_rgb 3 other papers
1 dated earlier, 2 later
1503.03832 (2015-03)
FaceNet: A Unified Embedding for Face Recognition and Clustering
1903.08527 (2019-03)
Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set
2003.06814 (2020-03)
Towards Face Encryption by Generating Adversarial Identity Masks
calculate_val 2 other papers
2 later
2004.00288 (2020-04)
CurricularFace: Adaptive Curriculum Learning Loss for Deep Face Recognition
2103.14803 (2021-03)
Face Transformer for Recognition
read_template_pair_list 2 other papers
2 later
2410.10587 (2024-10)
TopoFR: A Closer Look at Topology Alignment on Face Recognition
2609.02644 (2026-09)
Learning to Attract and Repel: Dual Quality Margin Learning for Face Recognition (DQM-Face)

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

More are linked than shown here.

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

Abstract

Recently, a popular line of research in face recognition is adopting margins in the well-established softmax loss function to maximize class separability. In this paper, we first introduce an Additive Angular Margin Loss (ArcFace), which not only has a clear geometric interpretation but also significantly enhances the discriminative power. Since ArcFace is susceptible to the massive label noise, we further propose sub-center ArcFace, in which each class contains $K$ sub-centers and training samples only need to be close to any of the $K$ positive sub-centers. Sub-center ArcFace encourages one dominant sub-class that contains the majority of clean faces and non-dominant sub-classes that include hard or noisy faces. Based on this self-propelled isolation, we boost the performance through automatically purifying raw web faces under massive real-world noise. Besides discriminative feature embedding, we also explore the inverse problem, mapping feature vectors to face images. Without training any additional generator or discriminator, the pre-trained ArcFace model can generate identity-preserved face images for both subjects inside and outside the training data only by using the network gradient and Batch Normalization (BN) priors. Extensive experiments demonstrate that ArcFace can enhance the discriminative feature embedding as well as strengthen the generative face synthesis.

For agents

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

get_harvested_code_for_paper("1801.07698")
get_code_for_paper("1801.07698")
have("1801.07698")

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

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

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

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

Connect an agent — have() is free.