# PainRegression
Regularizing Face Verification Nets For Pain Intensity Regression
https://arxiv.org/abs/1702.06925
![predicted curve](image/curve.png)
# Requirements
1. My Caffe (https://github.com/happynear/caffe-windows/tree/ms). If you don't want to train with class-balance sampling ([image_data_layer.cpp](https://github.com/happynear/caffe-windows/blob/ms/src/caffe/layers/image_data_layer.cpp)) and observing Pearson Correlation during training ([correlation_loss_layer.cpp](https://github.com/happynear/caffe-windows/blob/ms/src/caffe/layers/correlation_loss_layer.cpp)), you may use the official Caffe.
2. Matlab,
3. GPU with CUDA support,
4. MTCNN face and facial landmark detector(https://github.com/kpzhang93/MTCNN_face_detection_alignment).
# Regression Results and Evaluation
We uploaded some of the predicted values generated by our algorithm in `/results`. You may load them in Matlab and run [scripts/get_accuracy.m](https://github.com/happynear/PainRegression/blob/master/scripts/get_accuracy.m) to get the performance under various metrics.
# Training
1. Download the UNBC-McMaster Shoulder Pain Dataset(http://www.consortium.ri.cmu.edu/painagree/). Delete the black files in `095-tv095\tv095t1afaff`.
2. Download the pre-trained face verification model from [Google Drive](https://drive.google.com/file/d/0B0OhXbSTAU1HUTVhNE1sX1o2STQ/view?usp=sharing) or [Baidu Yun](http://pan.baidu.com/s/1pKOmZZt).
3. Detect and align the faces in the dataset by [./scripts/general_align.m](https://github.com/happynear/PainRegression/blob/master/scripts/general_align.m).
4. Create list for Caffe's ImageData layer by [./scripts/create_list.m](https://github.com/happynear/PainRegression/blob/master/scripts/create_list.m) and [./scripts/create_sublist.m](https://github.com/happynear/PainRegression/blob/master/scripts/create_sublist.m)(For cross-validation).
5. Copy all the folders created by [./scripts/create_sublist.m](https://github.com/happynear/PainRegression/blob/master/scripts/create_sublist.m) to `./prototxt/` and run [./prototxt/run_script.cmd](https://github.com/happynear/PainRegression/blob/master/prototxt/run_script.cmd).
It takes about 4-6 hours to train all 25-fold cross validation.
# Validation
1. Use [./scripts/extract_feature.m](https://github.com/happynear/PainRegression/blob/master/scripts/extract_feature.m) to extract results from the 25-fold cross-validation (because I didn't write the logic when detector cannot find face in the image).
2. Get the performance by [./scripts/get_accuracy.m](https://github.com/happynear/PainRegression/blob/master/scripts/get_accuracy.m).
We encourage future works to use the new proposed evaluation metrics, **wMAE** and **wMSE**. The evaluation codes are in [./scripts/get_accuracy.m](https://github.com/happynear/PainRegression/blob/master/scripts/get_accuracy.m).
# EmotionNet Challenge
The model definition files used in [EmotionNet Challenge](http://cbcsl.ece.ohio-state.edu/EmotionNetChallenge/index.html) are provided in [./prototxt/EmotionNet](https://github.com/happynear/PainRegression/tree/master/prototxt/EmotionNet). Besides the details described in our submitted paper, we further used a novel technique called `mirror face` to encode the features both from frontal face and mirror face, in an end-to-end fashion. The details and analysis will be described in a comming journal paper.
To try the `mirror face` technique, you need to compile my Caffe (https://github.com/happynear/caffe-windows/tree/ms), or transplant the `flip_layer` to your own Caffe.
# License
This code is distributed under MIT LICENSE
# Citation
If you find these codes useful in your research, please cite
```
@inproceedings{wang2017regularizing,
title={Regularizing Face Verification Nets For Pain Intensity Regression},
author={Wang, Feng and Xiang, Xiang and Liu, Chang and Tran, Trac D and Reiter, Austin and Hager, Gregory D and Quon, Harry and Cheng, Jian and Yuille, Alan L},
booktitle={IEEE International Conference on Image Processing 2017},
year={2017},
organization={IEEE Xplore}
}
```
# Contact
Feng Wang [feng.wff(at)gmail.com] or Xiang Xiang [xxiang(at)cs.jhu.edu]
(please replace (at) with @.)
没有合适的资源?快使用搜索试试~ 我知道了~
找UNBC-McMaster数据集疼痛表情的
共36个文件
m:17个
prototxt:5个
mat:5个
7 下载量 16 浏览量
2023-05-27
11:06:45
上传
评论
收藏 1.09MB ZIP 举报
温馨提示
找UNBC-McMaster数据集疼痛表情的
资源推荐
资源详情
资源评论
收起资源包目录
PainRegression-master11.zip (36个子文件)
PainRegression-master11
image
curve.png 70KB
LICENSE 1KB
转换后B6660.fz 170KB
prototxt
run_solver.bat 92B
run_script.cmd 264B
EmotionNet
emotion_train_test.prototxt 18KB
FACS_train_test.prototxt 18KB
face_train_test.prototxt 18KB
face_deploy.prototxt 16KB
copy_model.cmd 284B
face_solver.prototxt 264B
.gitignore 4KB
results
l1-l1-balance-sigmoid.mat 206KB
video_index.mat 690B
6-vanilla-sigmoid.mat 214KB
l1_smoothl1_sigmoid.mat 204KB
l1_l1_sigmoid.mat 209KB
README.md 283B
README.md 4KB
scripts
resample_train_list.m 851B
extract_feature.m 3KB
get_sequence_performance.m 3KB
add_balance_weight.m 811B
extract_all_feature_from_verification_model.m 1KB
general_align.m 4KB
extract_all_feature.m 2KB
create_list.m 2KB
create_database.m 4KB
analyse_sequence_dataset.m 435B
get_image_list_in_folder.m 855B
create_hdf5.m 2KB
create_sublist.m 1KB
align_face_WX.m 2KB
get_accuracy.m 2KB
get_accuracy_split.m 2KB
analyse_dataset.m 385B
共 36 条
- 1
资源评论
智达教育
- 粉丝: 2w+
- 资源: 279
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功