๐ค AI Summary
This work addresses the challenge of training deep neural networks under fully homomorphic encryption (FHE). We propose the first non-interactive, end-to-end trainable four-layer CNN framework supporting both single- and multi-output classification tasks. To mitigate gradient vanishing in deep networks under FHE constraints, we empirically validateโ for the first time in FHEโthe effectiveness of jointly using the sigmoid activation function and binary cross-entropy (BCE) loss for multi-class classification. Furthermore, we design an enhanced Double Volley Revolver encoding scheme that significantly improves the trade-off between computational efficiency and memory utilization within the CKKS FHE scheme. Implemented in C++ and open-sourced, our system demonstrates markedly improved training stability and model scalability compared to conventional loss functions such as squared loss error (SLE), as confirmed by comprehensive experiments.
๐ Abstract
In this paper, we present the demonstration of training a four-layer neural network entirely using fully homomorphic encryption (FHE), supporting both single-output and multi-output classification tasks in a non-interactive setting. A key contribution of our work is identifying that replacing extit{Softmax} with extit{Sigmoid}, in conjunction with the Binary Cross-Entropy (BCE) loss function, provides an effective and scalable solution for homomorphic classification. Moreover, we show that the BCE loss function, originally designed for multi-output tasks, naturally extends to the multi-class setting, thereby enabling broader applicability. We also highlight the limitations of prior loss functions such as the SLE loss and the one proposed in the 2019 CVPR Workshop, both of which suffer from vanishing gradients as network depth increases. To address the challenges posed by large-scale encrypted data, we further introduce an improved version of the previously proposed data encoding scheme, extit{Double Volley Revolver}, which achieves a better trade-off between computational and memory efficiency, making FHE-based neural network training more practical. The complete, runnable C++ code to implement our work can be found at: href{https://github.com/petitioner/ML.NNtraining}{$ exttt{https://github.com/petitioner/ML.NNtraining}$}.