AI Layer#

This layer is designed to allow easy migration from working with AI using standard libraries to working with the same models under HE. It supports the use case of inference over an encrypted input and encrypted model, or encrypted input and non-encrypted model. The user can import trained models using standard AI tools via standard file formats, and perform encrypted inferencing with only a few lines of code.

Main classes#

Class

Description

HeModel

An abstract class representing a model for performing inference under encryption. Current subclasses: NeuralNet, XGBoost, LogisticRegression (also supports linear regression), KMeans, Arima, DTree.

PlainModel

An abstract class representing a plain model imported from standard AI libraries. It stores the model data, and for some subclasses it can perform inference as well (for testing purposes). Every model class has an accompanying plain class, e.g. NeuralNetPlain for NeuralNet, and LogisticRegressionPlain for LogisticRegression.

Most models currently support inference only. A limited training capabilty is provided for logistic regression. The HE models support binary I/O to allow transferring to a server. In addition, the plain models support reading from standard file formats.

The neural network capabilities encompass a wide range of functionalities, including fully connected layers, convolutional layers, mean-pooling, and batch normalization. Supported activation functions are square, sigmoid polynomial approximation, and customizable user-defined (or trained) polynomials.