[SAC 2019] Towards a Practical Cluster Analysis over Encrypted Data

In a work presented yesterday at SAC 2019 [1], Jai Hyun Park (SNU) showed how he and his co-authors designed a privacy-preserving clustering analysis method using homomorphic encryption (HE) that is both accurate and practically efficient.

Data clustering analysis groups points from a data set into clusters based on common characteristics without knowing such clusters in advance. This machine learning method is used in various fields such as bioinformatics, finance or customer behaviour analysis; as such, it often deals with private information. We therefore do not want to delegate this task to an insecure server, at least in the clear. However, in our modern age of cloud computing, many tasks are delegated to insecure servers, and this is where secure computation comes to the rescue.

Homomorphic encryption is one such method for secure computation. It allows the computation of arithmetic operations (+, – and x) directly on the ciphertext, without needing to know the underlying plaintext. Non-arithmetic operations, such as comparisons or the min and max functions, are also possible with HE, but they are computationally expensive and therefore undesirable. Using HE, a party can therefore delegate the cluster analysis by first encrypting the data points using HE and then letting the untrusted server perform the computation over the encrypted data.

The challenge to achieve practical efficiency here is to find a clustering algorithm that is arithmetic and HE-friendly, i.e. it does not have too many operations that are expensive to perform using HE. The authors of [1] considered two clustering methods: K-means and mean-shift.

  • While K-means is usually more efficient in the clear, it requires extra information in addition to the data set: the number of clusters, that the data be convex, and also numerous comparison operations. These many requirements mean that the K-means method is very much not HE-friendly.
  • Instead, this work makes use of the mean-shift method, which is based on estimated density maps. In essence, using a kernel function, several local maxima are identified based on average distance to all other data points. Each point is then clustered to the closest such mode point.

In some more detail, for each point, a probability density map (PDM) is generated using the kernel function. This function must be decreasing and non-negative, and skewed so that points close to the target have very high density, and points further away quickly drop to very low densities. Given the target point, this function is evaluated for every other point in the set to generate the PDM. Using the PDM for each point, an average probability density function can then be computed for the data set.

Next, the mean-shift process is used to identify the modes. Each point is shifted slightly towards a denser point and, using the gradient descent method, the maxima can be identified. The great thing here is that points can also be labelled with their closest mode at the same time, thus performing two steps in one.

There are however two drawbacks to adapting this method to HE.

  1. It is heavily non-arithmetic; indeed, the usual kernel function is a Gaussian one and it therefore requires the computation of an exponential function to be evaluated.
  2. It is quite computationally expensive; for each iteration, every point needs to be compared with every other, yielding a run time which scales with the square of the size of the data.

To remedy these drawbacks, Cheon et al. propose two solutions. They first replace the Gaussian kernel function with the function \( (1 – x)^{2^\Gamma + 1} \). It satisfies the requirements of being decreasing and non-negative and, tested in the clear, it is shown to have similar performance to usual kernel functions. It is also purely arithmetic and even efficient: the \( 2^\Gamma \) exponent enables a computation that scales only with \( \log_2 (\Gamma) \).

They then modify the mean-shift process to identify nodes by sampling only several “dust” points to identify the local density maxima. While this is not enough to label all the data points using the same two-for-one approach, it still identifies the modes of the data using fewer kernel function evaluation. In a second step, they then go back and label all the data with the corresponding closest mode. This is the only step where they require comparisons, thus keeping the entire clustering algorithm as HE-friendly as possible.

Finally, the authors demonstrate the efficiency of their algorithm using open data sets. The figure that stands out is their ability to accurately label 262,127 out of 262,144 points in the largest data set in just 82 minutes; that is an accuracy of more than 99.99%. They compare this to the previous work of [2] which took over 29 days to classify the same set, thus presenting a 400x speed improvement. These impressive improvements come with the note that [2] made use of the TFHE library whereas [1] was benchmarked using HEAAN but, as Park noted during the presentation, the work of [2] makes use of operations that are not easily adapted into HEAAN thus making a true like-for-like comparison difficult to obtain.

References

[1] J.H. Cheon, D. Kim, and J.H. Park. Towards a Practical Clustering Analysis over Encrypted Data. In International Conference on Selected Areas in Cryptography, 2019.

[2] A. Jäschke and F. Armknecht. Unsupervised machine learning on encrypted data. In International Conference on Selected Areas in Cryptography, 2018.