multi-task-learning

授权协议 MIT License
开发语言 Python
所属分类 神经网络/人工智能、 机器学习/深度学习
软件类型 开源软件
地区 不详
投 递 者 诸葛皓
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Smile detection, gender and age estimation using Multi-task Learning

On the original paper DEX: Deep EXpectation the authors were able to display remarkable results in classifying the age of an individual based on a given image alone.

Let see how accuracy (bad I guess), with limited resources, we can get with self-construct architecture. And not only age, we also classifying gender and smile by using multi-task training technique.

Dependencies

  • Python 3.x
  • OpenCV 2
  • tensorflow
  • numpy
  • pandas
  • matplotlib
  • scipy
  • seaborn
  • MTCNN for face detection

Usage

Download datasets

First download GENKI4K and IMDB-WIKI (cropped face version) dataset.

Preprocess data

First run imdb-preprocess.ipynb. This step preprocess IMDB-WIKI dataset, filter out images with more than one face, gender is NaN and invalid age. All saved in a pickle file.

Next run prepare-data.ipynb. This will split two datasets in to training parts and test parts. The IMDB-WIKI dataset we will split into two separate datasets, gender and age datasets. So we have 3 datasets: age gender age. Each file will run into MTCNN network to detect and crop face, resize to 48x48 and convert to gray, then all datasets are saved into pickle files.

Training

Run CNN2Head_train.ipynb, using exponential decay to reduce learning rate over time. Change your datasets folder links, training parameters in const.py. Tensorboard's log will be saved in summary folder, training result in each batch is written in log.csv.

WEIGHT_INIT = 0.01
NUM_TASKS = 3
IMG_SIZE = 48
INIT_LR = 0.01
USE_BN = True
BN_DECAY = 0.99
EPSILON = 0.001
WEIGHT_DECAY = 0.01
DECAY_STEP = 1000
DECAY_LR_RATE = 0.95
BATCH_SIZE = 128

USE_GPU = True
SAVE_FOLDER = './save/current/'
NUM_EPOCHS = 2000
DROP_OUT_PROB = 0.5

Evaluation

Run evaluate.ipynb to evaluate learned model on test datasets.

Testing

For single file, see test.ipynb file for more example.

For demo on webcam, run demo.py file.

TODO

  • Augmentation for balanced label, reduce overfitting
  • Improve accuracy

References and Acknowledgments

This code is part of my GR project at HUST University. Following papers and codes are referred:

  1. Dinh Viet Sang, Le Tran Bao Cuong, and Do Phan Thuan. 2017., Facial Smile Detection Using Convolutional Neural Networks. In The 9th International Conference on Knowledge and Systems Engineering (KSE 2017). 138–143.
  2. Dinh Viet Sang, Le Tran Bao Cuong, Pham Thai Ha, Multi-task learning for smile detection, emotion recognition and gender classification, December 2017
  3. IMDB-WIKI: trying a small model for age classification
  4. MultiTask-MergeDataset - Le Tran Bao Cuong
 相关资料
  • 提醒: 这个API不再是推荐的模式了 - export your tasks。因此就不翻译了! 在任务系统中定义任务。然后可以从命令行和 series()、parallel() 和 lastRun() api 访问该任务。 Usage Register a named function as a task: const { task } = require('gulp'); function b

  • task是监控系统一个必要的辅助模块。定时任务,实现了如下几个功能: index更新。包括图表索引的全量更新 和 垃圾索引清理。 falcon服务组件的自身状态数据采集。定时任务了采集了transfer、graph、task这三个服务的内部状态数据。 falcon自检控任务。 源码编译 # update common lib cd $GOPATH/src/github.com/open-falco

  • 7.1n-step TD Prediction The methods that usen-step backups are still TD methodsbecause theystill change an earlier estimate based on how it differs from a later estimate. n-step return:If t+n≥T(if the

  • MULTI 标记一个事务块的开始。 事务块内的多条命令会按照先后顺序被放进一个队列当中,最后由 EXEC 命令原子性(atomic)地执行。 可用版本: >= 1.2.0 时间复杂度: O(1)。 返回值: 总是返回 OK 。 redis> MULTI # 标记事务开始 OK redis> INCR user_id # 多条命令按顺序入队 QUEUED redis

  • 问题内容: 要并行或异步运行某些内容,我可以使用ExecutorService:或CompletableFuture Api :( 假设在两种情况下我都使用相同的Executor) 除了返回类型vs. 之外,还存在其他显着差异。或什么时候使用什么? 如果我将API与默认值一起使用(没有执行程序的方法)有什么区别? 问题答案: 除了返回类型Future与CompletableFuture之外,还存在

  • - [ ] Eat - [x] Code - [x] HTML - [x] CSS - [x] JavaScript - [ ] Sleep [ ] Eat [x] Code [x] HTML [x] CSS [x] JavaScript [ ] Sleep