Giter Site home page Giter Site logo

emotion_classifier's Introduction

Emotion Classifier

Description

I created this project to explore various architectures aimed at image classification.

Models

  • Basic CNN
  • Basic CNN with Batch Norm
  • Deep CNN
  • Fully Convolutional Network
  • VGG16 Transfer Learning Network

** To see model details run python model_and_train.py --arch <NAME> --summary

Results

  • Deep CNN model had highest test accuracy of 65%
  • VGG16 model reached accuracy of 55%

Getting Started

  1. Download data from Kaggle competition and unzip into 'data/'
  2. Install python dependencies with pip install -r requirements.txt
  3. Run python model_and_train.py --help to see available options
  4. Try python model_and_train.py --arch basic --summary to print the Keras architecture layout of 'basic CNN' architecture
  5. Train with python model_and_train.py --arch <NAME> --run_name <TEXT>
  6. Model training is logged by default so you can view it in Tensorboard: tensorboard --logdir=log

CLI Options

$ python model_and_train.py --help

Usage: model_and_train.py [OPTIONS]

Options:
  --arch [basic|basic_with_batch_norm|deep_cnn|fully_conv|vgg]
		                  model architecture to train with
  --summary                       PRINT model summary for architecture
  --save_dir TEXT                 directory to log to
  --run_name TEXT                 name of run for Tensorboard
  --lr FLOAT                      learning rate for training  [default: 0.001]
  --dropout_rate FLOAT            dropout rate for training  [default: 0.3]
  --num_epochs INTEGER            number of epochs to train for  [default:
		                  1000]
  --batch_size INTEGER            batch size for training  [default: 32]
  --patience INTEGER              Early stopping training patience  [default:
		                  10]
  --validation_split FLOAT        [default: 0.1]
  --test_size FLOAT               percentage of date to use for
		                  testing/validation  [default: 0.2]
  --reduce_lr                     Reduce learning rate when val loss has
		                  stopped improving
  --help                          Show this message and exit.

Transfer Learning Model

NOTE: Running the VGG model for the first time will create the bottleneck features from VGG. This will take several minutes to compute and use a lot of system resources.

Dependencies

  • Keras
  • Click
  • Tensorflow
  • Numpy
  • Sklearn
  • OpenCV

TODO

  • Add progress bar for events
  • Add CLI image classify method
  • Add data augmentation to images
  • Experiment with different methods of using gray images instead of OpenCV gray2color conversion
  • Add a deep residual network

emotion_classifier's People

Contributors

jacobpolloreno avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jimliu0327

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.