{"id":19186805,"url":"https://github.com/donydchen/fmpn-fer","last_synced_at":"2025-07-04T09:04:09.327Z","repository":{"id":95783564,"uuid":"207242399","full_name":"donydchen/FMPN-FER","owner":"donydchen","description":"😁[VCIP'19 Oral] Official PyTorch Implementation of Facial Motion Prior Networks for Facial Expression Recognition","archived":false,"fork":false,"pushed_at":"2020-05-11T07:46:38.000Z","size":2021,"stargazers_count":100,"open_issues_count":4,"forks_count":24,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T01:37:29.062Z","etag":null,"topics":["expression","facial-expression-recognition","pytorch","vcip-2019"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/donydchen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-09-09T06:44:52.000Z","updated_at":"2025-02-21T08:32:26.000Z","dependencies_parsed_at":"2023-03-21T21:32:55.802Z","dependency_job_id":null,"html_url":"https://github.com/donydchen/FMPN-FER","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/donydchen/FMPN-FER","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donydchen%2FFMPN-FER","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donydchen%2FFMPN-FER/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donydchen%2FFMPN-FER/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donydchen%2FFMPN-FER/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donydchen","download_url":"https://codeload.github.com/donydchen/FMPN-FER/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donydchen%2FFMPN-FER/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263480854,"owners_count":23473162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expression","facial-expression-recognition","pytorch","vcip-2019"],"created_at":"2024-11-09T11:16:47.387Z","updated_at":"2025-07-04T09:04:09.298Z","avatar_url":"https://github.com/donydchen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FMPN-FER\n\n\u003cp align=\"left\"\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/Status-Release-gold.svg?style=flat-square\" alt=\"Status\"\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/Platform-Linux-lightgrey.svg?style=flat-square\" alt=\"Platform\"\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/PyTorch Version-0.4.1-blue.svg?style=flat-square\" alt=\"PyTorch\"\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg?style=flat-square\" alt=\"License\"\u003e\n\u003c/p\u003e\n\n[![PWC](https://img.shields.io/endpoint.svg?style=flat-square\u0026url=https://paperswithcode.com/badge/facial-motion-prior-networks-for-facial/facial-expression-recognition-on-mmi)](https://paperswithcode.com/sota/facial-expression-recognition-on-mmi?p=facial-motion-prior-networks-for-facial)\n\n[![PWC](https://img.shields.io/endpoint.svg?style=flat-square\u0026url=https://paperswithcode.com/badge/facial-motion-prior-networks-for-facial/facial-expression-recognition-on-ck)](https://paperswithcode.com/sota/facial-expression-recognition-on-ck?p=facial-motion-prior-networks-for-facial)\n\nOfficial PyTorch Implementation of **Facial Motion Prior Networks for Facial Expression Recognition** by \u003ca href=\"https://donydchen.github.io\"\u003eYuedong Chen\u003c/a\u003e, \u003ca href=\"https://jianfeng1991.github.io/personal\"\u003eJianfeng Wang, \u003ca href=\"https://www.researchgate.net/profile/Shikai_Chen3\"\u003eShikai Chen\u003c/a\u003e, Zhongchao Shi, and \u003ca href=\"https://www.ntu.edu.sg/home/asjfcai/\"\u003eJianfei Cai\u003c/a\u003e. \n\u003cbr\u003eVCIP 2019, Oral, \\[[arXiv](https://arxiv.org/abs/1902.08788)\\]\n\n![FMPN Model Structure](images/proposed_model.png)\n\n## Setup\n\n### Prerequisites\n\n* python \u003e= 3.6\n* pytorch \u003e= 0.4.1\n* visdom == 0.1.8.9\n\n### Training\n\nThe training phase mainly contains two stages, including training the generator for generating facial motion mask, and jointly training the whole recognition network. Running scripts examples are given as below. \n\n#### Pretrain the Facial-Motion Mask Generator (FMG)\n\n``` sh\npython main.py --mode train --data_root datasets/CKPlus --train_csv train_ids_0.csv \\\n    --print_losses_freq 4 --use_data_augment --visdom_env res_baseline_ckp_0 \\\n    --niter 150 --niter_decay 150 --gpu_ids 0 \\\n    --model res_baseline --solver resface --img_nc 1 \\\n    /\n```\n\n#### Jointly Train the Facial-Motion Prior Network\n\nLoad the saved weight for the FMG pertained in the previous stage, and ImageNet pretrained weight for the Classifer Net.\n\n```sh\npython main.py --mode train --data_root datasets/CKPlus --train_csv train_ids_0.csv \\\n    --print_losses_freq 4 --use_data_augment --visdom_env res_cls_ckp_0 --niter 100 \\\n    --niter_decay 100 --gpu_ids 0 --model res_cls --solver res_cls --lambda_resface 0.1 \\\n    --batch_size 16 --backend_pretrain \\\n    --load_model_dir ckpts/CKPlus/res_baseline/fold_0/190117_165651 --load_epoch 300 \\\n    /\n```\n\n### Testing \n\n``` sh\npython main.py --mode test --data_root datasets/CKPlus --test_csv test_ids_0.csv \\\n    --gpu_ids 0 --model res_cls --solver res_cls --batch_size 4 \\\n    --load_model_dir ckpts/CKPlus/res_cls/fold_0/190118_170050 --load_epoch 200 \\\n    /\n```\n\n## Datasets\n\n* The pseudo ground truth facial motion masks for dataset CK+, MMI and AffectNet are presented in `/datasets`.\n* Training and Testing datasets splits are located in `/datasets`, 10-fold cross validation is used in the project as a general approach.\n\n## Results Detail\n\n10 folds accuracy for CK+, MMI and AffectNet.\n\n| Fold ID   | 0     | 1     | 2     | 3     | 4     | 5     | 6     | 7     | 8     | 9     | Avg  |\n|-----------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|------|\n| CK+       | 0.885 | 1.000 | 0.921 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 0.98 |\n| MMI       | 0.778 | 0.731 | 0.667 | 0.744 | 0.857 | 0.855 | 0.958 | 0.889 | 1.000 | 0.795 | 0.83 |\n| AffectNet | -     | -     | -     | -     | -     | -     | -     | -     | -     | -     | 0.62 |\n\n\n## Citation\n\nIf you use this code for your research, please cite our paper \u003ca href=\"https://arxiv.org/abs/1902.08788\"\u003eFacial Motion Prior Networks for Facial Expression Recognition\u003c/a\u003e:\n\n```\n@article{chen2019facial,\n  title={Facial Motion Prior Networks for Facial Expression Recognition},\n  author={Chen, Yuedong, Jianfeng Wang, Shikai Chen, Zhongchao Shi, and Jianfei Cai},\n  journal={IEEE Visual Communications and Image Processing (VCIP)},\n  year={2019},\n  organization={IEEE}\n}\n```\n\n## Acknowledgments\n\nThis work is mainly conducted when Yuedong is a research intern in Lenovo AI Lab, Beijing. For any questions regarding this project, feel free to create an issue or reach Yuedong by Email.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonydchen%2Ffmpn-fer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonydchen%2Ffmpn-fer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonydchen%2Ffmpn-fer/lists"}