{"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/generalizable-facial-expression-recognition","title":"Generalizable Facial Expression Recognition","arxiv_id":"2408.10614","date":"2024-08-20","proceeding":null,"authors":["Yuhang Zhang","Xiuqi Zheng","Chenyi Liang","Jiani Hu","Weihong Deng"],"abstract":"SOTA facial expression recognition (FER) methods fail on test sets that have domain gaps with the train set. Recent domain adaptation FER methods need to acquire labeled or unlabeled samples of target domains to fine-tune the FER model, which might be infeasible in real-world deployment. In this paper, we aim to improve the zero-shot generalization ability of FER methods on different unseen test sets using only one train set. Inspired by how humans first detect faces and then select expression features, we propose a novel FER pipeline to extract expression-related features from any given face images. Our method is based on the generalizable face features extracted by large models like CLIP. However, it is non-trivial to adapt the general features of CLIP for specific tasks like FER. To preserve the generalization ability of CLIP and the high precision of the FER model, we design a novel approach that learns sigmoid masks based on the fixed CLIP face features to extract expression features. To further improve the generalization ability on unseen test sets, we separate the channels of the learned masked features according to the expression classes to directly generate logits and avoid using the FC layer to reduce overfitting. We also introduce a channel-diverse loss to make the learned masks separated. Extensive experiments on five different FER datasets verify that our method outperforms SOTA FER methods by large margins. Code is available in https://github.com/zyh-uaiaaaa/Generalizable-FER.","url_abs":"https://arxiv.org/abs/2408.10614v1","url_pdf":"https://arxiv.org/pdf/2408.10614v1.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":"generalizable-facial-expression-recognition","repo_url":"https://github.com/zyh-uaiaaaa/generalizable-fer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"},{"task_slug":"facial-expression-recognition-1","task_name":"Facial Expression Recognition"},{"task_slug":"facial-expression-recognition","task_name":"Facial Expression Recognition (FER)"},{"task_slug":"zero-shot-generalization","task_name":"Zero-shot Generalization"}],"methods":[{"method_slug":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2408.10614","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.10614"}},"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":"deterministic:regex_extraction","url":"https://github.com/zyh-uaiaaaa/Generalizable-FER","reach":null}],"summary":{"ran":3,"ran_fixture":1,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":6,"ran":5,"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":6,"samples":[{"code_sha256_prefix":"7c5a693fcbb84a64","entry":"BasicBlock","repo":"zyh-uaiaaaa/Generalizable-FER","repo_kind":"official","path":"code/ours_CAFE.py","file_url":"https://github.com/zyh-uaiaaaa/Generalizable-FER/blob/HEAD/code/ours_CAFE.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7c5a693fcbb84a64"}},{"code_sha256_prefix":"65aa1ef3d28f018c","entry":"Mask","repo":"zyh-uaiaaaa/Generalizable-FER","repo_kind":"official","path":"code/ours_CAFE.py","file_url":"https://github.com/zyh-uaiaaaa/Generalizable-FER/blob/HEAD/code/ours_CAFE.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"65aa1ef3d28f018c"}},{"code_sha256_prefix":"751ca7d7f0259cc0","entry":"ResNet","repo":"zyh-uaiaaaa/Generalizable-FER","repo_kind":"official","path":"code/ours_CAFE.py","file_url":"https://github.com/zyh-uaiaaaa/Generalizable-FER/blob/HEAD/code/ours_CAFE.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"751ca7d7f0259cc0"}},{"code_sha256_prefix":"6ebb5508c95f710a","entry":"my_MaxPool2d","repo":"zyh-uaiaaaa/Generalizable-FER","repo_kind":"official","path":"code/ours_CAFE.py","file_url":"https://github.com/zyh-uaiaaaa/Generalizable-FER/blob/HEAD/code/ours_CAFE.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6ebb5508c95f710a"}},{"code_sha256_prefix":"56494e4e7ae20c9c","entry":"supervisor","repo":"zyh-uaiaaaa/Generalizable-FER","repo_kind":"official","path":"code/ours_CAFE.py","file_url":"https://github.com/zyh-uaiaaaa/Generalizable-FER/blob/HEAD/code/ours_CAFE.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"56494e4e7ae20c9c"}},{"code_sha256_prefix":"50aa92ba5fc57243","entry":"Model","repo":"zyh-uaiaaaa/Generalizable-FER","repo_kind":"official","path":"code/ours_CAFE.py","file_url":"https://github.com/zyh-uaiaaaa/Generalizable-FER/blob/HEAD/code/ours_CAFE.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"50aa92ba5fc57243"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}