Skip to content

krishnr/CapsNet4Faces

 
 

Repository files navigation

Face Classification with Capsule Networks

A Tensorflow implementation of CapsNet(Capsules Net) apply on the Labelled Faces in the Wild (LFW) dataset based on thibo73800's Traffic Sign Classifier.

This implementation is based on the paper: Dynamic Routing Between Capsules by Sara Sabour, Nicholas Frosst and Geoffrey E. Hinton.

The code for the CapsNet is located in the following file: caps_net.py while the whole model is created inside the model.py file. The two main methods used to build the CapsNet are conv_caps_layer and fully_connected_caps_layer

Requirements

  • Python 3
  • NumPy 1.13.1
  • Tensorflow 1.3.0
  • docopt 0.6.2
  • Sklearn: 0.18.1
  • Matplotlib

Install

$> git clone https://github.com/krishnr/CapsNet4Faces.git

Train

$> python train_for_faces.py

During the training, the checkpoint is saved by default into the outputs/checkpoints/ folder. The exact path and name of the checkpoint is print during the training.

Test

In order to measure the accuracy and the loss on the Test dataset you need to used the test.py script as follow:

$> python test_all_faces.py outputs/checkpoints/ckpt_name

Metrics

Accuracy:

  • Train: 100%
  • Test: 93.7%

Checkpoints and tensorboard files are stored inside the outputs folder.

About

CapsNet for FaceRec

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 89.6%
  • Python 10.4%