Giter Club home page Giter Club logo

decision_tree_facialreconition's Introduction

Decision tree algorithm on facial expression recognition

This is the simple decision tree algorithm on distinguishing between six basic facial recognition (anger, disgust, fear, happiness, sadness and surprise) based on a labelled set of facial Action Units (AUs).

The data is as follows: Input data : A matrix x, which is an N×45 matrix, where N is the total number of examples and 45 is the total number of AUs that can be activated or not. In case an AU is activated, the value of the corresponding column will be 1. Otherwise, it will be 0. For instance, the following row [1 1 0 0 1 0 …0] would mean that AU1, AU2 and AU5 are activated. Output data: A vector y of dimensions N×1, containing the emotion labels of the corresponding examples. These labels are numbered from 1 to 6, and correspond to the emotions anger, disgust, fear, happiness, sadness and surprise respectively.

trees.pkl is the combination of our 6 trees of 6 emotions we have trained on the entire clean dataset.

To use it, just as following:

pkl_file = open('trees.pkl', 'rb')
trees = pickle.load(pkl_file)
prediction = testTrees(trees, data)

where data is the test data, trees is the list of 6 trees. testTrees function is in our evaluation.py

#Explanation of our other functions

  1. To train data, there's a function in trainTrees.py:

    train_tree(examples, targets, emotion_label)

where examples is training data, targets is training target, emotion_label is from 0 to 6. It will return the tree

  1. To make prediction:

    prediction = testTrees(trees, data)

where data is the test data, trees is the list of 6 trees. it will return the list of prediction labels.

  1. To visualize the tree:

    visual_tree(tree)

where tree is one specific tree

decision_tree_facialreconition's People

Contributors

rickycao-qy avatar

Watchers

James Cloos avatar

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.