1 Star 1 Fork 0

shenhao2954988368 / Facial-Expression-Recognition.Pytorch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Facial-Expression-Recognition.Pytorch

A CNN based pytorch implementation on facial expression recognition (FER2013 and CK+), achieving 73.112% (state-of-the-art) in FER2013 and 94.64% in CK+ dataset

Demos

Image text Image text

Dependencies

  • Python 2.7
  • Pytorch >=0.2.0
  • h5py (Preprocessing)
  • sklearn (plot confusion matrix)

Visualize for a test image by a pre-trained model

FER2013 Dataset

Preprocessing Fer2013

  • first download the dataset(fer2013.csv) then put it in the "data" folder, then
  • python preprocess_fer2013.py

Train and Eval model

  • python mainpro_FER.py --model VGG19 --bs 128 --lr 0.01

plot confusion matrix

  • python plot_fer2013_confusion_matrix.py --model VGG19 --split PrivateTest

fer2013 Accurary

  • Model: VGG19 ; PublicTest_acc: 71.496% ; PrivateTest_acc:73.112%
  • Model: Resnet18 ; PublicTest_acc: 71.190% ; PrivateTest_acc:72.973%

CK+ Dataset

  • The CK+ dataset is an extension of the CK dataset. It contains 327 labeled facial videos, We extracted the last three frames from each sequence in the CK+ dataset, which contains a total of 981 facial expressions. we use 10-fold Cross validation in the experiment.

Train and Eval model for a fold

  • python mainpro_CK+.py --model VGG19 --bs 128 --lr 0.01 --fold 1

Train and Eval model for all 10 fold

  • python k_fold_train.py

plot confusion matrix for all fold

  • python plot_CK+_confusion_matrix.py --model VGG19

CK+ Accurary

  • Model: VGG19 ; Test_acc: 94.646%
  • Model: Resnet18 ; Test_acc: 94.040%
MIT License Copyright (c) 2018 WuJie Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

A CNN based pytorch implementation on facial expression recognition (FER2013 and CK+), achieving 73.112% (state-of-the-art) in FER2013 and 94.64% in CK+ dataset 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/shenhao2954988368/Facial-Expression-Recognition.Pytorch.git
git@gitee.com:shenhao2954988368/Facial-Expression-Recognition.Pytorch.git
shenhao2954988368
Facial-Expression-Recognition.Pytorch
Facial-Expression-Recognition.Pytorch
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891