Capsule Network on Fashion MNIST dataset
Switch branches/tags
Nothing to show
Clone or download
Latest commit 1ec8713 Nov 30, 2017
Failed to load latest commit information.
result Init commit Nov 7, 2017
.gitignore Init commit Nov 7, 2017
LICENSE Init commit Nov 7, 2017 update to CapsNet-Keras Dec 1, 2017 update to CapsNet-Keras Dec 1, 2017 update to CapsNet-Keras Dec 1, 2017
real_and_recon.png update result Dec 1, 2017 Init commit Nov 7, 2017



A Keras implementation of CapsNet in the paper:
Sara Sabour, Nicholas Frosst, Geoffrey E Hinton. Dynamic Routing Between Capsules. NIPS 2017

This code is adopted from CapsNet-Keras to test the performance of CapsNet on Fashion-MNIST

Xifeng Guo
E-mail or WeChat wenlong-guo.


Step 1. Install Keras 2.0.9 with TensorFlow backend.

pip install tensorflow-gpu
pip install keras==2.0.9

Step 2. Clone this repository to local.

git clone
cd CapsNet-Fashion-MNIST

Step 3. Train a CapsNet on Fashion-MNIST

Training with default settings:

$ python

Data preprocessing:

  • scale pixel values to [0,1];
  • shift 2 pixels and horizontal flipping augmentation.



Test Accuracy: 93.62%

Losses and accuracies:

Training Speed

About 120s / epoch on a single GTX 1070 GPU.

Reconstruction result

Top 5 rows are real images from MNIST and Bottom are corresponding reconstructed images.