{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/2103-14803","title":"Face Transformer for Recognition","arxiv_id":"2103.14803","date":"2021-03-27","proceeding":null,"authors":["Yaoyao Zhong","Weihong Deng"],"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.","url_abs":"https://arxiv.org/abs/2103.14803v2","url_pdf":"https://arxiv.org/pdf/2103.14803v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"2103-14803","repo_url":"https://github.com/zhongyy/Face-Transformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"2103-14803","repo_url":"https://github.com/martlgap/octuplet-loss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"face-recognition","task_name":"Face Recognition"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2103.14803","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2103.14803"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/martlgap/octuplet-loss","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhongyy/Face-Transformer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":1,"ran_fixture":1,"unverified":8},"by_repo_kind":{"official":{"samples":4,"ran":2,"repositories":1},"listed":{"samples":6,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"f975336b5d5f1a80","entry":"calculate_accuracy","repo":"zhongyy/Face-Transformer","repo_kind":"official","path":"util/verification.py","file_url":"https://github.com/zhongyy/Face-Transformer/blob/HEAD/util/verification.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f975336b5d5f1a80"}},{"code_sha256_prefix":"f67f5f081381cc8a","entry":"calculate_val","repo":"zhongyy/Face-Transformer","repo_kind":"official","path":"util/verification.py","file_url":"https://github.com/zhongyy/Face-Transformer/blob/HEAD/util/verification.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f67f5f081381cc8a"}},{"code_sha256_prefix":"4afffb876c33cacf","entry":"OctupletLoss","repo":"martlgap/octuplet-loss","repo_kind":"listed","path":"tf_octuplet_loss.py","file_url":"https://github.com/martlgap/octuplet-loss/blob/HEAD/tf_octuplet_loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4afffb876c33cacf"}},{"code_sha256_prefix":"508a8168bc7cb3cc","entry":"calculate_roc","repo":"zhongyy/Face-Transformer","repo_kind":"official","path":"util/verification.py","file_url":"https://github.com/zhongyy/Face-Transformer/blob/HEAD/util/verification.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"508a8168bc7cb3cc"}},{"code_sha256_prefix":"479492c380d22e83","entry":"get_config","repo":"zhongyy/Face-Transformer","repo_kind":"official","path":"config.py","file_url":"https://github.com/zhongyy/Face-Transformer/blob/HEAD/config.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"479492c380d22e83"}},{"code_sha256_prefix":"8cf84f1b7fe9c04f","entry":"pairwise_distances","repo":"martlgap/octuplet-loss","repo_kind":"listed","path":"pt_octuplet_loss.py","file_url":"https://github.com/martlgap/octuplet-loss/blob/HEAD/pt_octuplet_loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8cf84f1b7fe9c04f"}},{"code_sha256_prefix":"2a97a43ae927ec71","entry":"pairwise_distances","repo":"martlgap/octuplet-loss","repo_kind":"listed","path":"tf_octuplet_loss.py","file_url":"https://github.com/martlgap/octuplet-loss/blob/HEAD/tf_octuplet_loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2a97a43ae927ec71"}},{"code_sha256_prefix":"530597f221ce030e","entry":"reduce_res","repo":"martlgap/octuplet-loss","repo_kind":"listed","path":"resizing.py","file_url":"https://github.com/martlgap/octuplet-loss/blob/HEAD/resizing.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"530597f221ce030e"}},{"code_sha256_prefix":"1e772459cfdc2c6e","entry":"triplet_loss","repo":"martlgap/octuplet-loss","repo_kind":"listed","path":"pt_octuplet_loss.py","file_url":"https://github.com/martlgap/octuplet-loss/blob/HEAD/pt_octuplet_loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1e772459cfdc2c6e"}},{"code_sha256_prefix":"d2e065e4ad181e6c","entry":"triplet_loss","repo":"martlgap/octuplet-loss","repo_kind":"listed","path":"tf_octuplet_loss.py","file_url":"https://github.com/martlgap/octuplet-loss/blob/HEAD/tf_octuplet_loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d2e065e4ad181e6c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}