Giter VIP home page Giter VIP logo

dldl-v2's Introduction

DLDL-v2-Torch

This repository is a Torch implementation of "Age Estimation Using Expectation of Label Distribution Learning", Bin-Bin Gao, Hong-Yu Zhou, Jianxin Wu, Xin Geng. The paper is accepted at the 27th International Joint Conference on Artificial Intelligence (IJCAI 2018).

You can train Deep ConvNets from a pre-trained model on your datasets with limited resources. This repo is created by Bin-Bin Gao. You can train Deep ConvNets from a pre-trained model on your datasets with limited resources. This repo is created by Bin-Bin Gao.

Framework

Framework

Download

MS-Celeb-1M Face Models (jrjq)

ThinAgeNet models

TinyAgeNet models

Align&Cropped ChaLearn Face Imgaes

Train&Test list

Image Demo

Installation

step 0: Install torch and cudnnv5.1

step 1: Copy private file to torch

copy ./private/*.lua to the path of torch nn package (torch/extra/nn/)

copy ./private/*.c to the path of torch nn package (torch/extra/nn/lib/THNN/generic)

step 2: Update some existing files

add the following lines to torch/nn/init.lua

require('nn.KLDivCriterion')
require('nn.ExpOut')

add the following lines to torch/extra/nn/lib/THNN/generic/THNN.h

TH_API void THNN_(KLDivCriterion_updateOutput)(
          THNNState *state,            // library's state
          THTensor *input,             // input tensor
          THTensor *target,            // target tensor
          THTensor *output,            // [OUT] a one-element tensor containing the loss
          bool sizeAverage);           // if true, the loss will be normalized **by total number of elements**
TH_API void THNN_(KLDivCriterion_updateGradInput)(
          THNNState *state,            // library's state
          THTensor *input,             // input tensor
          THTensor *target,            // target tensor
          THTensor *gradInput,         // [OUT] gradient w.r.t. input
          bool sizeAverage);           // if true, the loss will be normalized **by total number of elements**

add the following lines to torch/extra/nn/lib/THNN/init.c

#include "generic/KLDivCriterion.c"
#include "THGenerateFloatTypes.h"

step 3: Rebuild nn package

luarocks install rocks/nn-scm-1.rockspec

step 4: Training DLDL-v2

CUDA_VISIBLE_DEVICES=14,15 th main_agenet.lua -dataset chalearn15 -nGPU 2 -batchSize 128 -dataAug true  -nEpochs 60 -loss ldkl -LR 0.001 -netType hp-agenet-msceleb1m -CR 0.5 -labelStep 1

CUDA_VISIBLE_DEVICES=14,15 th main_mtagenet.lua -dataset chalearn15 -nGPU 2 -batchSize 128 -dataAug true -nEpochs 60 -loss ldklexpl1 -LR 0.001 -netType hp-mtagenet-msceleb1m  -CR 0.5 -labelStep 1 -lambda 1

step 4: Evaluation

CUDA_VISIBLE_DEVICES=1 th evaluation.lua -dataset chalearn15 -loss ldkl -netType hp-agenet-msceleb1m -CR 0.5 -dataAug true  -labelStep 1

CUDA_VISIBLE_DEVICES=1 th evaluation.lua -dataset chalearn15 -loss ldklexpl1 -netType hp-mtagenet-msceleb1m -CR 0.5 -dataAug true -labelStep 1 -lambda 1

Additional Information

If you find DLDL-v2 helpful, please cite it as

@inproceedings{gaoDLDLv2,
           title={Age Estimation Using Expectation of Label Distribution Learning},
           author={Gao, Bin-Bin and Zhou, Hong-Yu and Wu, Jianxin and Geng, Xin},
           booktitle={Proceedings of the 27th International Joint Conference on Artificial Intelligence (IJCAI 2018)},
           pages={xx--xx},
           year={2018}
            }

ATTN1: This packages are free for academic usage. You can run them at your own risk. For other purposes, please contact Prof. Jianxin Wu ([email protected]).

dldl-v2's People

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.