SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.15565 · CVPR · 2022

Killing Two Birds with One Stone: Efficient and Robust Training of Face Recognition CNNs by Partial FC

Jing Yang, Tongliang Liu, Jia Guo, Jiankang Deng, Ziyong Feng, Xiang An, Xuhan Zhu

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 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; 1 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 2 failures of our instrument; 2 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/2203.15565.json · badge: /api/ran/2203.15565.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
yangyucheng000/-insightface community (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
pedrobvidal/insightface community
Papers with Code archive
3 ran · 1 no recorded run
bovifocr/insightface community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
AllGatherFunc Ran
ran on a synthesized input · constructed an object; no result was computed
pedrobvidal/insightface/recognition/arcface_torch/partial_fc_v2.py
pointer only (licence: NONE) · get_code("9599ba720223efe2")
How it ran

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

DistCrossEntropy Ran
ran on a synthesized input · constructed an object; no result was computed
pedrobvidal/insightface/recognition/arcface_torch/partial_fc_v2.py
pointer only (licence: NONE) · get_code("4f589c1b7b15107e")
How it ran

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

DistCrossEntropyFunc Ran
ran on a synthesized input · constructed an object; no result was computed
pedrobvidal/insightface/recognition/arcface_torch/partial_fc_v2.py
pointer only (licence: NONE) · get_code("c0df452dc531921a")
How it ran

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

distance2bbox Ran
ran on a synthesized input
yangyucheng000/-insightface/python-package/insightface/model_zoo/retinaface.py
code served (permissive licence) · get_code("1d23600a36442d09")
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 ndarray, ndim 2, dtype family float, shape (2, 4) 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)

# Create points tensor: shape (n, 2) where n=2, representing [x, y] coordinates
points = torch.tensor([
    [10.0, 20.0],
    [50.0, 60.0]
], dtype=torch.float32)

# Create distance tensor: shape (n, 4) representing [left, top, right, bottom] distances
distance = torch.tensor([
    [5.0, 10.0, 15.0, 20.0],
    [8.0, 12.0, 18.0, 25.0]
], dtype=torch.float32)

# Define max_shape as image dimensions (height, width)
max_shape = (100, 120)

ARGS = {
    "points": points,
    "distance": distance,
    "max_shape": max_shape
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
distance2kps Ran
ran on a synthesized input
yangyucheng000/-insightface/python-package/insightface/model_zoo/retinaface.py
code served (permissive licence) · get_code("e8f5d8d07e1e560b")
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 ndarray, ndim 2, dtype family float, shape (2, 4) 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)

# Construct points tensor: shape (n, 2) where n=2 points, each with [x, y]
points = torch.tensor([
    [10.0, 20.0],
    [30.0, 40.0]
], dtype=torch.float32)

# Construct distance tensor: shape (n, 4) representing distances to 4 boundaries
# (left, top, right, bottom) for each point
distance = torch.tensor([
    [5.0, 3.0, 7.0, 2.0],
    [4.0, 6.0, 8.0, 1.0]
], dtype=torch.float32)

# max_shape is a tuple representing (height, width) of the image
max_shape = (100, 150)

ARGS = {
    "points": points,
    "distance": distance,
    "max_shape": max_shape
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
find_onnx_file Ran
ran on a synthesized input
yangyucheng000/-insightface/python-package/insightface/model_zoo/model_zoo.py
code served (permissive licence) · get_code("fc633d5737805a00")
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 str. 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 tempfile
import shutil

# Create a temporary directory with a test .onnx file
temp_dir = tempfile.mkdtemp()
test_onnx_file = os.path.join(temp_dir, "model.onnx")
with open(test_onnx_file, 'w') as f:
    f.write("dummy onnx content")

ARGS = {
    "dir_path": temp_dir
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
find_params_file Ran
ran on a synthesized input
yangyucheng000/-insightface/python-package/insightface/model_zoo/model_store.py
code served (permissive licence) · get_code("8e01f2544321014d")
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 str. 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 tempfile
import shutil

# Create a temporary directory with some .params files
temp_dir = tempfile.mkdtemp()
test_file_1 = os.path.join(temp_dir, "model_step_100.params")
test_file_2 = os.path.join(temp_dir, "model_step_200.params")
test_file_3 = os.path.join(temp_dir, "model_step_150.params")

# Create the files
open(test_file_1, 'w').close()
open(test_file_2, 'w').close()
open(test_file_3, 'w').close()

ARGS = {
    "dir_path": temp_dir
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_model_file Ran
ran; our contract draft was wrong, not the code
yangyucheng000/-insightface/python-package/insightface/model_zoo/model_store.py
code served (permissive licence) · get_code("36d98138ea733ae9")
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 str. 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 tempfile
import shutil

# Create a temporary directory for testing
temp_dir = tempfile.mkdtemp()

# Create a mock model directory structure with a .params file
model_name = 'arcface_r100_v1'
model_root = os.path.join(temp_dir, '.insightface', 'models')
model_dir = os.path.join(model_root, model_name)
os.makedirs(model_dir, exist_ok=True)

# Create a dummy .params file
params_file = os.path.join(model_dir, 'model-0000.params')
with open(params_file, 'w') as f:
    f.write('dummy model params')

# Mock the check_sha1 function to always return True
def check_sha1(fpath, sha1_hash):
    return True

# Mock the download function to do nothing
def download(url, path, overwrite=False):
    pass

# Inject mocks into the module namespace
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'check_sha1', check_sha1)
setattr(current_module, 'download', download)

# Define ARGS for get_model_file
ARGS = {
    'name': 'arcface_r100_v1',
    'root': model_root
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
short_hash Ran
ran; our contract draft was wrong, not the code
yangyucheng000/-insightface/python-package/insightface/model_zoo/model_store.py
pointer only (licence: MIT); the stored copy get_code serves, from deepinsight/insightface, is pointer only (licence: NONE) · get_code("48aa1fdc7e6172f9")
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 deepinsight/insightface, 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.

softmax Ran
ran, honoured the contract we drafted
yangyucheng000/-insightface/python-package/insightface/model_zoo/retinaface.py
code served (permissive licence) · get_code("011537d0bea7fe09")
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 ndarray, ndim 2, dtype family float, shape (2, 4) 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 2D numpy array (batch_size=2, features=4)
z = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [0.5, 1.5, 2.5, 3.5]
], dtype=np.float32)

ARGS = {
    "z": z
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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
PartialFC Not yet run
unverified (harvested, no recorded run)
bovifocr/insightface/recognition/arcface_torch/partial_fc.py
code served (permissive licence) · get_code("ca2e74d15a48deb6")
How it ran

no invocation recorded.

PartialFC_V2 Not yet run
unverified (harvested, no recorded run)
pedrobvidal/insightface/recognition/arcface_torch/partial_fc_v2.py
pointer only (licence: NONE) · get_code("3a6ac854256554fc")
How it ran

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

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 3 later) and 5 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
short_hash 11 other papers
10 dated earlier, 1 later
1803.08904 (2018-03)
Context Encoding for Semantic Segmentation
1809.02983 (2018-09)
Dual Attention Network for Scene Segmentation
1905.00641 (2019-05)
RetinaFace: Single-stage Dense Face Localisation in the Wild
and 8 more not named here
softmax 3 other papers
1 dated earlier, 2 later
1905.00641 (2019-05)
RetinaFace: Single-stage Dense Face Localisation in the Wild
2308.04836 (2023-08)
Beyond Surprise: Improving Exploration Through Surprise Novelty
2401.09750 (2024-01)
Exploration and Anti-Exploration with Distributional Random Network Distillation
get_model_file 2 other papers
1 dated earlier, 1 later
1905.00641 (2019-05)
RetinaFace: Single-stage Dense Face Localisation in the Wild
2601.07576 (2026-01)
A Multimodal Dataset of Student Oral Presentations with Sensors and Evaluation Data
distance2bbox 1 other paper
1 dated earlier
1905.00641 (2019-05)
RetinaFace: Single-stage Dense Face Localisation in the Wild
distance2kps 1 other paper
1 dated earlier
1905.00641 (2019-05)
RetinaFace: Single-stage Dense Face Localisation in the Wild
find_onnx_file 1 other paper
1 dated earlier
1905.00641 (2019-05)
RetinaFace: Single-stage Dense Face Localisation in the Wild
find_params_file 1 other paper
1 dated earlier
1905.00641 (2019-05)
RetinaFace: Single-stage Dense Face Localisation in the Wild

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

Learning discriminative deep feature embeddings by using million-scale in-the-wild datasets and margin-based softmax loss is the current state-of-the-art approach for face recognition. However, the memory and computing cost of the Fully Connected (FC) layer linearly scales up to the number of identities in the training set. Besides, the largescale training data inevitably suffers from inter-class conflict and long-tailed distribution. In this paper, we propose a sparsely updating variant of the FC layer, named Partial FC (PFC). In each iteration, positive class centers and a random subset of negative class centers are selected to compute the margin-based softmax loss. All class centers are still maintained throughout the whole training process, but only a subset is selected and updated in each iteration. Therefore, the computing requirement, the probability of inter-class conflict, and the frequency of passive update on tail class centers, are dramatically reduced. Extensive experiments across different training data and backbones (e.g. CNN and ViT) confirm the effectiveness, robustness and efficiency of the proposed PFC. The source code is available at https://github.com/deepinsight/ insightface/tree/master/recognition. * corresponding author. InsightFace is a nonprofit Github project for 2D and 3D face analysis.

For agents

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

get_harvested_code_for_paper("2203.15565")
get_code_for_paper("2203.15565")
have("2203.15565")

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

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

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

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

Connect an agent — have() is free.