IEEE Computational Intelligence Magazine - August 2022 - 22

Designing privacy-preserving deep learning
solutions based on HE requires one to rethink and
redesign deep learning solutions that consider the
constraints on the type and number of operations
that characterize the BFV scheme.
2) Normalization Layers
Normalization layers cannot be considered in the BFV scheme
since it is impossible to compute the mean and standard deviation
of encrypted data. By contrast, batch normalization layers
are available given that they depend on the values of the data
used for training. Such values are computed during the training
and can be used during the processing of ciphertexts.
3) Activation Functions
The activation functions used in CNNs typically comprise
nonlinear functions. The ReLU activation function, for instance,
cannot be computed because it requires the use of the comparison
operator. The same holds for the hyperbolic tangent tanh
which involves division. This study suggests replacing these
nonlinear activation functions with the square activation function
()
fx x2
= Such an approximation can be further refined
.
using Taylor polynomial expansions. However, increasing the
accuracy of the expansion (and thus using a larger number of
polynomials) entails an increase in the number of operations
(and thus an increased NB consumption).
B. Model Encoding
Once the model has been approximated, it can be encoded
through the model encoding step, where an encoded approximated
model (·){H
is obtained, whose weights have been encoded
according to the BFV scheme and the parameters H. Encrypted
data can now be processed by
{ (·)H
will be able to decrypt it. The
to obtain the result of
CNN processing. Notably, this result is still encrypted and only
the owner of the secret key ks
proper setting parameters H in HE processing remains an open
research. Generally, the selection of the value of these parameters
follows a " trial-and-error " approach (see the model validation
step in Section III-C). Nevertheless, some guidelines for
the setting of H are provided as follows.
Maximum
Pooling
F(.)
Layer
Normalization
ReLU/
tanh
Average
Pooling
Batch
Normalization
Square
FIGURE 3 Possible approximations for typical CNN layers.
The most critical encryption parameter is n
as it is a relevant parameter for the setting of
the initial NB and the computational overhead
of the encrypted processing. Generally, values of
n smaller than 4096 are able to guarantee a NB
sufficient only for very simple machine learning
models (typically comprising two or three
processing layers at most). From a methodological
point of view, n is typically initially set to 4096 and then
increased as described in Section III-C.
The parameter p affects NB consumption as well as the precision
of the homomorphic operations (i.e., p affects the possibility
that some coefficients of the decrypted polynomials are
rounded to the incorrect value). Tuning p requires a trial-anderror
process; typically, a value of p between 216 and 218
represents
a good starting point for exploring the parameters
described in Section III-C. The value of q is critical for the security
of the scheme; it is suggested to rely on the helper function
provided by SEAL [19] (see Section VI for details) to set q
according to n and p.
The obtained
obtaining the encoded deep learning model (·){H
C. Model Validation
Once the encoding step is completed, the model validation step
is activated to evaluate the encoded model
{ (·)H
ferent perspectives. First, { (·)H
from two difis
evaluated to check whether
the selected configuration H provides a sufficient NB in the
processing of ciphertexts. Second, the loss in accuracy of (·){H
w.r.t.
F (·) is evaluated. To achieve both goals, a (possibly large)
set of raw messages ms is processed by { (·)H
with the aim of
measuring the NB of the final ciphertexts and evaluating the
discrepancy between the accuracy of the encoded model (·){H
and that of the plain model (·)F
{ (·)H
. Typically, the problems associated
with a loss of NB depend on an incorrect setting of H,
whereas the discrepancies in the output between
and
F (·) could be associated with either the approximations of the
processing layers introduced in the model approximation step
or the fact that p and q are not large enough for the processing
pipeline defined in the encoded approximated model
{ (·)H
.
If the constraint on the NB is satisfied and the loss of accuracy
is below a user-defined threshold (e.g., 1% or 5%), (·){H
becomes the privacy-preserving version of (·)F to be considered.
Conversely, when either the constraint on the NB is not
satisfied (i.e., the NB of the ciphertexts decreases to 0 during
the processing of
{ (·)H
) or the loss in accuracy is larger than
the threshold, the methodology suggests three different actions:
update H, modify how layers in (·)F are approximated, or
change the processing pipeline of (·)F
. These three actions are
described in detail as follows.
First, the NB and loss of accuracy strictly depend on H. In
particular, increasing the parameter n increases the initial NB
but at the expense of a (potentially large) increase in computational
overhead and the memory demand of (·){H
increasing p and q would reduce the loss in accuracy (by
22 IEEE COMPUTATIONAL INTELLIGENCE MAGAZINE | AUGUST 2022
. Conversely,
H = (, ,)np q can be used to encode (·){ , thus
.

IEEE Computational Intelligence Magazine - August 2022

Table of Contents for the Digital Edition of IEEE Computational Intelligence Magazine - August 2022

Contents
IEEE Computational Intelligence Magazine - August 2022 - Cover1
IEEE Computational Intelligence Magazine - August 2022 - Cover2
IEEE Computational Intelligence Magazine - August 2022 - Contents
IEEE Computational Intelligence Magazine - August 2022 - 2
IEEE Computational Intelligence Magazine - August 2022 - 3
IEEE Computational Intelligence Magazine - August 2022 - 4
IEEE Computational Intelligence Magazine - August 2022 - 5
IEEE Computational Intelligence Magazine - August 2022 - 6
IEEE Computational Intelligence Magazine - August 2022 - 7
IEEE Computational Intelligence Magazine - August 2022 - 8
IEEE Computational Intelligence Magazine - August 2022 - 9
IEEE Computational Intelligence Magazine - August 2022 - 10
IEEE Computational Intelligence Magazine - August 2022 - 11
IEEE Computational Intelligence Magazine - August 2022 - 12
IEEE Computational Intelligence Magazine - August 2022 - 13
IEEE Computational Intelligence Magazine - August 2022 - 14
IEEE Computational Intelligence Magazine - August 2022 - 15
IEEE Computational Intelligence Magazine - August 2022 - 16
IEEE Computational Intelligence Magazine - August 2022 - 17
IEEE Computational Intelligence Magazine - August 2022 - 18
IEEE Computational Intelligence Magazine - August 2022 - 19
IEEE Computational Intelligence Magazine - August 2022 - 20
IEEE Computational Intelligence Magazine - August 2022 - 21
IEEE Computational Intelligence Magazine - August 2022 - 22
IEEE Computational Intelligence Magazine - August 2022 - 23
IEEE Computational Intelligence Magazine - August 2022 - 24
IEEE Computational Intelligence Magazine - August 2022 - 25
IEEE Computational Intelligence Magazine - August 2022 - 26
IEEE Computational Intelligence Magazine - August 2022 - 27
IEEE Computational Intelligence Magazine - August 2022 - 28
IEEE Computational Intelligence Magazine - August 2022 - 29
IEEE Computational Intelligence Magazine - August 2022 - 30
IEEE Computational Intelligence Magazine - August 2022 - 31
IEEE Computational Intelligence Magazine - August 2022 - 32
IEEE Computational Intelligence Magazine - August 2022 - 33
IEEE Computational Intelligence Magazine - August 2022 - 34
IEEE Computational Intelligence Magazine - August 2022 - 35
IEEE Computational Intelligence Magazine - August 2022 - 36
IEEE Computational Intelligence Magazine - August 2022 - 37
IEEE Computational Intelligence Magazine - August 2022 - 38
IEEE Computational Intelligence Magazine - August 2022 - 39
IEEE Computational Intelligence Magazine - August 2022 - 40
IEEE Computational Intelligence Magazine - August 2022 - 41
IEEE Computational Intelligence Magazine - August 2022 - 42
IEEE Computational Intelligence Magazine - August 2022 - 43
IEEE Computational Intelligence Magazine - August 2022 - 44
IEEE Computational Intelligence Magazine - August 2022 - 45
IEEE Computational Intelligence Magazine - August 2022 - 46
IEEE Computational Intelligence Magazine - August 2022 - 47
IEEE Computational Intelligence Magazine - August 2022 - 48
IEEE Computational Intelligence Magazine - August 2022 - 49
IEEE Computational Intelligence Magazine - August 2022 - 50
IEEE Computational Intelligence Magazine - August 2022 - 51
IEEE Computational Intelligence Magazine - August 2022 - 52
IEEE Computational Intelligence Magazine - August 2022 - 53
IEEE Computational Intelligence Magazine - August 2022 - 54
IEEE Computational Intelligence Magazine - August 2022 - 55
IEEE Computational Intelligence Magazine - August 2022 - 56
IEEE Computational Intelligence Magazine - August 2022 - 57
IEEE Computational Intelligence Magazine - August 2022 - 58
IEEE Computational Intelligence Magazine - August 2022 - 59
IEEE Computational Intelligence Magazine - August 2022 - 60
IEEE Computational Intelligence Magazine - August 2022 - 61
IEEE Computational Intelligence Magazine - August 2022 - 62
IEEE Computational Intelligence Magazine - August 2022 - 63
IEEE Computational Intelligence Magazine - August 2022 - 64
IEEE Computational Intelligence Magazine - August 2022 - 65
IEEE Computational Intelligence Magazine - August 2022 - 66
IEEE Computational Intelligence Magazine - August 2022 - 67
IEEE Computational Intelligence Magazine - August 2022 - 68
IEEE Computational Intelligence Magazine - August 2022 - Cover3
IEEE Computational Intelligence Magazine - August 2022 - Cover4
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202311
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202308
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202305
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202302
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202211
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202208
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202205
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202202
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202111
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202108
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202105
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202102
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202011
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202008
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202005
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_202002
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201911
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201908
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201905
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201902
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201811
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201808
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201805
https://www.nxtbook.com/nxtbooks/ieee/computationalintelligence_201802
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter17
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall17
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_summer17
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_spring17
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter16
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall16
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_summer16
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_spring16
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter15
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall15
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_summer15
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_spring15
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter14
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall14
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_summer14
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_spring14
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter13
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall13
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_summer13
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_spring13
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_winter12
https://www.nxtbook.com/nxtbooks/ieee/computational_intelligence_fall12
https://www.nxtbookmedia.com