All Projects → jimeffry → Age-gender-and-emotion-recognition

jimeffry / Age-gender-and-emotion-recognition

Licence: other
3 networks to recognition age,gender and emotion

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Age-gender-and-emotion-recognition

processed-imdb-wiki-dataset
Processes IMDB WIKI dataset ready to be used in any projects
Stars: ✭ 48 (+65.52%)
Mutual labels:  gender-classification, age-classification
emotion-and-gender-classification
2 networks to recognition gender and emotion; face detection using Opencv or Mtcnn
Stars: ✭ 21 (-27.59%)
Mutual labels:  gender-classification, emotion-recognition
AIML-Human-Attributes-Detection-with-Facial-Feature-Extraction
This is a Human Attributes Detection program with facial features extraction. It detects facial coordinates using FaceNet model and uses MXNet facial attribute extraction model for extracting 40 types of facial attributes. This solution also detects Emotion, Age and Gender along with facial attributes.
Stars: ✭ 48 (+65.52%)
Mutual labels:  gender-classification, emotion-recognition
multi-task-learning
Multi-task learning smile detection, age and gender classification on GENKI4k, IMDB-Wiki dataset.
Stars: ✭ 154 (+431.03%)
Mutual labels:  gender-classification
COVID19 AgentBasedSimulation
COVID-ABS: An Agent-Based Model of COVID-19 Epidemic to Simulate Health and Economic Effects of Social Distancing Interventions
Stars: ✭ 56 (+93.1%)
Mutual labels:  agent-based-simulation
soxan
Wav2Vec for speech recognition, classification, and audio classification
Stars: ✭ 113 (+289.66%)
Mutual labels:  emotion-recognition
ntua-slp-semeval2018
Deep-learning models of NTUA-SLP team submitted in SemEval 2018 tasks 1, 2 and 3.
Stars: ✭ 79 (+172.41%)
Mutual labels:  emotion-recognition
AGHMN
Implementation of the paper "Real-Time Emotion Recognition via Attention Gated Hierarchical Memory Network" in AAAI-2020.
Stars: ✭ 25 (-13.79%)
Mutual labels:  emotion-recognition
loki
Proof-of-concept of emotion-targeted content delivery using machine learning and ARKit.
Stars: ✭ 76 (+162.07%)
Mutual labels:  emotion-recognition
namsor-python-sdk2
NamSor API v2 Python SDK - classify personal names accurately by gender, country of origin, or ethnicity.
Stars: ✭ 23 (-20.69%)
Mutual labels:  gender-classification
hfusion
Multimodal sentiment analysis using hierarchical fusion with context modeling
Stars: ✭ 42 (+44.83%)
Mutual labels:  emotion-recognition
STEP
Spatial Temporal Graph Convolutional Networks for Emotion Perception from Gaits
Stars: ✭ 39 (+34.48%)
Mutual labels:  emotion-recognition
Self-Supervised-Embedding-Fusion-Transformer
The code for our IEEE ACCESS (2020) paper Multimodal Emotion Recognition with Transformer-Based Self Supervised Feature Fusion.
Stars: ✭ 57 (+96.55%)
Mutual labels:  emotion-recognition
Interaction-Aware-Attention-Network
[ICASSP19] An Interaction-aware Attention Network for Speech Emotion Recognition in Spoken Dialogs
Stars: ✭ 32 (+10.34%)
Mutual labels:  emotion-recognition
CLUEmotionAnalysis2020
CLUE Emotion Analysis Dataset 细粒度情感分析数据集
Stars: ✭ 3 (-89.66%)
Mutual labels:  emotion-recognition
HSE FaceRec tf
Tensorflow/Keras small models for face recognition, ag/gender prediction from images
Stars: ✭ 23 (-20.69%)
Mutual labels:  gender-classification
js-simulator
General-purpose discrete-event multiagent simulation library for agent-based modelling and simulation
Stars: ✭ 52 (+79.31%)
Mutual labels:  agent-based-simulation
evoplex
Evoplex is a fast, robust and extensible platform for developing agent-based models and multi-agent systems on networks. It's available for Windows, Linux and macOS.
Stars: ✭ 98 (+237.93%)
Mutual labels:  agent-based-simulation
11K-Hands
Two-stream CNN for gender classification and biometric identification using a dataset of 11K hand images.
Stars: ✭ 44 (+51.72%)
Mutual labels:  gender-classification
m3f.pytorch
PyTorch code for "M³T: Multi-Modal Multi-Task Learning for Continuous Valence-Arousal Estimation"
Stars: ✭ 20 (-31.03%)
Mutual labels:  emotion-recognition

Age and Gender Estimation

This is a Keras implementation of a CNN for estimating age and gender from a face image [1, 2]. In training, the IMDB-WIKI dataset is used.

Dependencies

  • Python2.7+
  • Keras2.0+
  • scipy, numpy, Pandas, tqdm, tables, h5py
  • OpenCV3

Tested on:

  • Ubuntu 16.04, Python 3.5.2, Keras 2.0.3, Tensorflow(-gpu) 1.0.1, CUDA 8.0, cuDNN 5.0
    • CPU: i7-7700 3.60GHz, GPU: GeForce GTX1080

Usage

Face detect

''' here use opencv-face-detection. or you can use the mtcnn-caffemodel,

I have packaged the mtcnn face model into a class, the link is here. '''

Use pretrained model

Download pretrained model weights for TensorFlow backend:

The age, gender and emotion pretrained models locate in the directory PRJ_ROOT/trained_models/

Run demo script (requires web cam)

python test.py

Train a model using the IMDB-WIKI dataset

Download the dataset

The dataset is downloaded and extracted to the data directory.

./download.sh

Create training data

Filter out noise data and serialize images and labels for training into .mat file. Please check check_dataset.ipynb for the details of the dataset.

python create_db.py --output data/imdb_db.mat --db imdb --img_size 64
usage: create_db.py [-h] --output OUTPUT [--db DB] [--img_size IMG_SIZE] [--min_score MIN_SCORE]

This script cleans-up noisy labels and creates database for training.

optional arguments:
  -h, --help                 show this help message and exit
  --output OUTPUT, -o OUTPUT path to output database mat file (default: None)
  --db DB                    dataset; wiki or imdb (default: wiki)
  --img_size IMG_SIZE        output image size (default: 32)
  --min_score MIN_SCORE      minimum face_score (default: 1.0)

Train network

Train the network using the training data created above.

python train.py --input data/imdb_db.mat

Trained weight files are stored as checkpoints/weights.*.hdf5 for each epoch if the validation loss becomes minimum over previous epochs.

usage: train.py [-h] --input INPUT [--batch_size BATCH_SIZE]
                [--nb_epochs NB_EPOCHS] [--depth DEPTH] [--width WIDTH]
                [--validation_split VALIDATION_SPLIT]

This script trains the CNN model for age and gender estimation.

optional arguments:
  -h, --help                          show this help message and exit
  --input INPUT, -i INPUT             path to input database mat file (default: None)
  --batch_size BATCH_SIZE             batch size (default: 32)
  --nb_epochs NB_EPOCHS               number of epochs (default: 30)
  --depth DEPTH                       depth of network (should be 10, 16, 22, 28, ...) (default: 16)
  --width WIDTH                       width of network (default: 8)
  --validation_split VALIDATION_SPLIT validation split ratio (default: 0.1)

Use the trained network

python demo.py
usage: demo.py [-h] [--weight_file WEIGHT_FILE] [--depth DEPTH] [--width WIDTH]

This script detects faces from web cam input, and estimates age and gender for
the detected faces.

optional arguments:
  -h, --help                show this help message and exit
  --weight_file WEIGHT_FILE path to weight file (e.g. weights.18-4.06.hdf5) (default: None)
  --depth DEPTH             depth of network (default: 16)
  --width WIDTH             width of network (default: 8)

Please use the best model among checkpoints/weights.*.hdf5 for WEIGHT_FILE if you use your own trained models.

Plot training curves from history file

python plot_history.py --input models/history_16_8.h5 

Network architecture

In the original paper [1, 2], the pretrained VGG network is adopted. Here the Wide Residual Network (WideResNet) is trained from scratch. I modified the @asmith26's implementation of the WideResNet; two classification layers (for age and gender estimation) are added on the top of the WideResNet.

Note that while age and gender are independently estimated by different two CNNs in [1, 2], in my implementation, they are simultaneously estimated using a single CNN.

Results

Trained on imdb, tested on wiki.

References

[1] R. Rothe, R. Timofte, and L. V. Gool, "DEX: Deep EXpectation of apparent age from a single image," ICCV, 2015.

[2] R. Rothe, R. Timofte, and L. V. Gool, "Deep expectation of real and apparent age from a single image without facial landmarks," IJCV, 2016.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].