BLeNet-5 Batch Implementation

This page demonstrates LeNet-5 on a batch of 16 MNIST images with the batch controller: every ciphertext holds one channel of the whole batch.

Overview

The two convolutions (he_batch_convolution) are followed by the batch ReLU and the 2x2 pooling (he_optimzed_batch_avgPool); he_batch_inputs_converter turns the 16 channel ciphertexts into the per-image inputs of the three fully connected layers (he_batch_linear), which classify the whole batch, with batch_bootstrap_function refreshing all the channels of a layer at once.

The ciphertexts have 2^14 slots (one channel of 16 images of 28 x 28); at 128-bit security the program packs 32 images. It needs 210 rotation keys: on a 31 GB machine the system stops it for lack of memory at ring 2^15.

Full Example Source

You can view and download the full source code of this example:

BLeNet5N16.cpp