GithubHelp home page GithubHelp logo

donydchen / fmpn-fer Goto Github PK

View Code? Open in Web Editor NEW
97.0 3.0 23.0 1.97 MB

😁[VCIP'19 Oral] Official PyTorch Implementation of Facial Motion Prior Networks for Facial Expression Recognition

License: MIT License

Python 100.00%
facial-expression-recognition vcip-2019 pytorch expression

fmpn-fer's Introduction

FMPN-FER

Status Platform PyTorch License

PWC

PWC

Official PyTorch Implementation of Facial Motion Prior Networks for Facial Expression Recognition by Yuedong Chen, Jianfeng Wang, Shikai Chen, Zhongchao Shi, and Jianfei Cai.
VCIP 2019, Oral, [arXiv]

FMPN Model Structure

Setup

Prerequisites

  • python >= 3.6
  • pytorch >= 0.4.1
  • visdom == 0.1.8.9

Training

The 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.

Pretrain the Facial-Motion Mask Generator (FMG)

python main.py --mode train --data_root datasets/CKPlus --train_csv train_ids_0.csv \
    --print_losses_freq 4 --use_data_augment --visdom_env res_baseline_ckp_0 \
    --niter 150 --niter_decay 150 --gpu_ids 0 \
    --model res_baseline --solver resface --img_nc 1 \
    /

Jointly Train the Facial-Motion Prior Network

Load the saved weight for the FMG pertained in the previous stage, and ImageNet pretrained weight for the Classifer Net.

python main.py --mode train --data_root datasets/CKPlus --train_csv train_ids_0.csv \
    --print_losses_freq 4 --use_data_augment --visdom_env res_cls_ckp_0 --niter 100 \
    --niter_decay 100 --gpu_ids 0 --model res_cls --solver res_cls --lambda_resface 0.1 \
    --batch_size 16 --backend_pretrain \
    --load_model_dir ckpts/CKPlus/res_baseline/fold_0/190117_165651 --load_epoch 300 \
    /

Testing

python main.py --mode test --data_root datasets/CKPlus --test_csv test_ids_0.csv \
    --gpu_ids 0 --model res_cls --solver res_cls --batch_size 4 \
    --load_model_dir ckpts/CKPlus/res_cls/fold_0/190118_170050 --load_epoch 200 \
    /

Datasets

  • The pseudo ground truth facial motion masks for dataset CK+, MMI and AffectNet are presented in /datasets.
  • Training and Testing datasets splits are located in /datasets, 10-fold cross validation is used in the project as a general approach.

Results Detail

10 folds accuracy for CK+, MMI and AffectNet.

Fold ID 0 1 2 3 4 5 6 7 8 9 Avg
CK+ 0.885 1.000 0.921 1.000 1.000 1.000 1.000 1.000 1.000 1.000 0.98
MMI 0.778 0.731 0.667 0.744 0.857 0.855 0.958 0.889 1.000 0.795 0.83
AffectNet - - - - - - - - - - 0.62

Citation

If you use this code for your research, please cite our paper Facial Motion Prior Networks for Facial Expression Recognition:

@article{chen2019facial,
  title={Facial Motion Prior Networks for Facial Expression Recognition},
  author={Chen, Yuedong, Jianfeng Wang, Shikai Chen, Zhongchao Shi, and Jianfei Cai},
  journal={IEEE Visual Communications and Image Processing (VCIP)},
  year={2019},
  organization={IEEE}
}

Acknowledgments

This 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.

fmpn-fer's People

Contributors

donydchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fmpn-fer's Issues

Problem of visdom

Hello, I have some problem with visdom in the below picture.
image

There is not something like diagram or graph,...

How I can see the output of the train? Really need help, thank you so much.

Can't access connection in Google Colab

Hello,
I have some problem with the first script and here are the traceback.
image

I wonder that did I run in google colab is right? Or I have to run local in pycharm or jupyter notebook?

Train with affectnet

Hi. Thank you for your awesome work.
How can I generate masks for training with AffectNet?

Setting the number of epoch in trainning

Hello, I have stuck in set epoch of pre train. I was to reduce the epoch not 300, because my laptop is really hot while running. Hope you can show me where to fix that. Thank you so much.

Pre-trained model files

Hey, I was wondering if the pre-trained models are available and if so where I could find them?

Neutral label

Hi, I wonder how to deal with the training data with neutral label.

In Face generation network , average difference face is not being used in code?

The paper and the code contradicts . Paper says "Note that the learning of FMG is
guided by pseudo ground truth masks, which are the average differences between neutral faces and their corresponding expressive faces" but the training part of ResFaceGenNet i didnt find usage of average diff face so please clarify this confusion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.