This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Robust Explanations for Private Support Vector Machines

Rami Mochaourab111Digital Systems Division, RISE Research Institutes of Sweden, [email protected]    Sugandh Sinha222Digital Systems Division, RISE Research Institutes of Sweden, [email protected]    Stanley Greenstein333Dept. of Law, Stockholm University, [email protected]    Panagiotis Papapetrou444Dept. of Computer and Systems Sciences, Stockholm University, [email protected]
Abstract

We consider counterfactual explanations for private support vector machines (SVM), where the privacy mechanism that publicly releases the classifier guarantees differential privacy. While privacy preservation is essential when dealing with sensitive data, there is a consequent degradation in the classification accuracy due to the introduced perturbations in the classifier weights. For such classifiers, counterfactual explanations need to be robust against the uncertainties in the SVM weights in order to ensure, with high confidence, that the classification of the data instance to be explained is different than its explanation. We model the uncertainties in the SVM weights through a random vector, and formulate the explanation problem as an optimization problem with probabilistic constraint. Subsequently, we characterize the problem’s deterministic equivalent and study its solution. For linear SVMs, the problem is a convex second-order cone program. For non-linear SVMs, the problem is non-convex. Thus, we propose a sub-optimal solution that is based on the bisection method. The results show that, contrary to non-robust explanations, the quality of explanations from the robust solution degrades with increasing privacy in order to guarantee a prespecified confidence level for correct classifications.

1 Introduction

Despite their efficiency in solving complex problems, machine learning (ML) algorithms and models are seldom value-neutral to the extent that they include social and ethical values. Even when such values are integrated into the models they may be mandated by regulatory frameworks, such as traditional laws or policy documents. This paper aims to illustrate the relational nexus between social and ethical values in a technical context. This is done by focusing on three values advocated by the General Data Protection Regulation (GDPR) [1], namely, explainability, privacy, and accuracy.555References to these social values can be found in Recital 71, Article 25 and Article 5(1)(d) as expanded by the Article 29 Data Protection Working Party Adopted on 3 October 2017 respectively. It is also noteworthy that an in-depth discussion of what exactly these social values entail is beyond the confines of this paper. What becomes apparent when attempting to transform the above social and ethical values from the natural language of the law into the mathematical language of ML algorithms is that this may be challenging and even technically unattainable. The above social and ethical values have been chosen as their transformation into ML rules clearly illuminates the challenge of aligning these competing social and ethical values promoted by the law into a technical format, a conclusion being that the simultaneous promotion of all these three values is potentially mathematically unattainable.

Figure 1 gives an overview on how the three mentioned social values are related within this work:

  1. 1.

    Accuracy is targeted when learning an SVM classifier through the data from a dataset.

  2. 2.

    Privacy is guaranteed by applying a privacy preserving mechanism. We will use the mechanism developed in [2] which guarantees a strong notion of privacy called differential privacy [3].

  3. 3.

    Explainability of predictions for specific data instances enhances the transparency and the trust in the classifier predictions. We will consider counterfactual explanations [4, 5], which is a class of explainability methods that quantify the necessary changes to a considered data instance in order to change its classification. Such explainability methods fall under the category of post hoc interpretations [6, 7], since they do not require model retraining.

Refer to caption
Figure 1: Illustration of the relationship between accuracy, privacy, and explainability associated with an SVM classifier trained on a dataset 𝒟\mathcal{D}. A privacy mechanism is applied to preserve the privacy of the data before the public release of the SVM classifier. Explanations need to suitably take into account the introduced uncertainty through the privacy mechanism.

In this work, we will propose robust counterfactual explanations that exploit the characteristics of the SVM classifier and the applied privacy mechanism. The privacy mechanism proposed in [2] perturbs the SVM weights through additive Laplace noise. As a result, privacy is achieved by establishing uncertainty about the true classifier weights. For constructing explanations, we suitably model the uncertainty in the SVM weights through random variables. Then, we formulate counterfactual explanations as a optimization problem with probabilistic constraints [8], and characterize its deterministic equivalent problem. For linear SVMs, the deterministic problem is a second-order cone program (SOCP) and can be solved efficiently. For the non-linear SVM case, the problem is non-convex. We therefore propose an efficient sub-optimal algorithm to find robust explanations utilizing the existence of class specific prototypes. The use of prototypes in the context of counterfactual explanations has been previously applied in [9] for the purpose of ensuring that explanations lie within the data domain and can be computed efficiently.

Experimental results illustrate the trade-offs between accuracy, privacy, and explainability using the UCI Breast Cancer Wisconsin Dataset [10]. In particular, we show that, contrary to non-robust explanations, the changes to an instance required by its robust explanation increase with the level of privacy. This degradation in the explanation quality occurs in order to guarantee, with prespecified confidence, that the explanations are counterfactuals, i.e., their classification is different than the instance, with respect to the non-private and unknown classifier. To the best of our knowledge, this is the first work to study the design of explanations for privacy preserving classifiers.

2 Preliminaries

In this section, we will describe the dataset and the SVM learning problem. Then, we will review the privacy preserving mechanism for SVM proposed in [2].

2.1 Dataset and SVM Classification

Consider a dataset 𝒟\mathcal{D} consisting of a collection of nn tuples

(𝒙i,yi),i=1,,n,(\boldsymbol{x}_{i},y_{i}),\quad i=1,\ldots,n, (1)

where each tuple (𝒙i,yi)(\boldsymbol{x}_{i},y_{i}) consists of a features vector 𝒙iL\boldsymbol{x}_{i}\in\mathbb{R}^{L} and its associated class label yi{1,1}y_{i}\in\{-1,1\}.

Dataset 𝒟\mathcal{D} is used to learn an SVM classifier [11, Ch. 12] that can efficiently separate the two classes of data points through a separating hyperplane. The optimization problem for the SVM with hinge loss and parameter C0C\geq 0, is:

minimize𝒘F\displaystyle\operatorname*{minimize}_{\boldsymbol{w}\in\mathbb{R}^{F}} 12𝒘2+Cni=1n[1yifϕ(𝒙i,𝒘)]+,\displaystyle~{}~{}\frac{1}{2}{\|\boldsymbol{w}\|^{2}}+\frac{C}{n}\sum_{i=1}^{n}{\left[1-y_{i}f_{\phi}(\boldsymbol{x}_{i},\boldsymbol{w})\right]}_{+}, (2)

where the weights 𝒘\boldsymbol{w} geometrically correspond to the vector perpendicular to the separating hyperplane, [a]+:=max{0,a}[a]_{+}:=\max\{0,a\}, and fϕf_{\phi} is the classifier function:

fϕ(𝒙,𝒘):=ϕ(𝒙)𝒘.f_{\phi}(\boldsymbol{x},\boldsymbol{w}):=\phi(\boldsymbol{x})^{\top}\boldsymbol{w}. (3)

Here, the feature mapping ϕ:LF\phi:\mathbb{R}^{L}\rightarrow\mathbb{R}^{F}, FLF\geq L, enlarges the feature space of the data points to improve the separability of the two classes of data points through a hyperplane [11, Ch. 12.3]. We assume in this work that FF is finite.

The minimization problem defined in Eq. (2) can be formulated as a quadratic program and solved efficiently. Let, 𝒘\boldsymbol{w}^{*} be the optimal solution to this problem, then the binary classification of a given data point 𝒙\boldsymbol{x} is

hϕ(𝒙,𝒘):=sign[fϕ(𝒙,𝒘)],h_{\phi}(\boldsymbol{x},\boldsymbol{w}^{*}):=\mathrm{sign}[f_{\phi}(\boldsymbol{x},\boldsymbol{w}^{*})], (4)

where sign[a]=1\mathrm{sign}[a]=-1, if a<0a<0 and sign[a]=1\mathrm{sign}[a]=1, if a0a\geq 0.

If the number of features FF is larger than the number of available data points nn, then it is more efficient to solve the dual problem of Eq. (2):

maximize𝜶n\displaystyle\operatorname*{maximize}_{\boldsymbol{\alpha}\in\mathbb{R}^{n}} inαi12injnαiαjyiyjϕ(𝒙i)ϕ(𝒙j)\displaystyle~{}~{}\sum_{i}^{n}\alpha_{i}-\frac{1}{2}\sum_{i}^{n}\sum_{j}^{n}\alpha_{i}\alpha_{j}y_{i}y_{j}\phi(\boldsymbol{x}_{i})^{\top}\phi(\boldsymbol{x}_{j}) (5a)
s.t.\displaystyle s.t. 0αiC/n,i=1,,n,\displaystyle~{}~{}0\leq\alpha_{i}\leq{C}/{n},\quad i=1,\ldots,n, (5b)

since then the number of optimization variables is smaller. Another advantage in solving the dual is the possibility to apply the kernel trick [11, Ch. 12.3], where a kernel function k(𝒙i,𝒙j)k(\boldsymbol{x}_{i},\boldsymbol{x}_{j}) replaces ϕ(𝒙i)ϕ(𝒙j)\phi(\boldsymbol{x}_{i})^{\top}\phi(\boldsymbol{x}_{j}) in Eq. (5a).

The optimal solution of the primal problem in Eq. (2) is then computed from the solution of the dual problem in Eq. (5) as:

𝒘=inαiyiϕ(𝒙i).\displaystyle\boldsymbol{w}^{*}=\sum_{i}^{n}\alpha_{i}^{*}y_{i}\phi(\boldsymbol{x}_{i}). (6)

From Eq. (3) it can be observed that in order to perform SVM classification, all we need is 𝒘\boldsymbol{w}^{*} and the feature mapping ϕ\phi. In applications where the dataset includes sensitive information, the public release of the SVM classifier may lead to privacy breaches through the information in 𝒘\boldsymbol{w}^{*}. Therefore, it is required to apply a privacy preserving mechanism before the public release of the classifier, as is illustrated in Figure 1.

2.2 Privacy Preserving Mechanism for SVM

In this section, we will describe the privacy preserving mechanism proposed in [2, Sec. 3] for SVMs with finite dimensional feature mappings. The proposed mechanism that guarantees differential privacy essentially perturbs the SVM optimal weights 𝒘F\boldsymbol{w}^{*}\in\mathbb{R}^{F} by additive Laplace noise.

More formally, let M:𝔇M:\mathfrak{D}\rightarrow\mathcal{R} be a randomized mechanism, where 𝔇\mathfrak{D} is the set of all datasets and \mathcal{R} is the response set of the mechanism MM (defined as the solution space of the dual problem in Eq. (5)). Define neighboring datasets as the datasets in 𝔇\mathfrak{D} that differ by one data point entry. Then, for a given β>0\beta>0, a randomized mechanism MM provides β\beta-differential privacy [3, Def. 2.4] if for any two neighboring datasets 𝒟1,𝒟2𝔇\mathcal{D}_{1},\mathcal{D}_{2}\in\mathfrak{D} and all response subsets 𝒮\mathcal{S}\subseteq\mathcal{R} it holds

Pr[M(𝒟1)𝒮]exp(β)Pr[M(𝒟2)𝒮].\mathrm{Pr}\left[{M}(\mathcal{D}_{1})\in\mathcal{S}\right]\leq\exp({\beta})~{}\mathrm{Pr}\left[{M}(\mathcal{D}_{2})\in\mathcal{S}\right]. (7)

From [2, Thm. 10], the perturbed SVM weight vector

𝒘~:=𝒘+𝝁,\tilde{\boldsymbol{w}}:=\boldsymbol{w}^{*}+\boldsymbol{\mu}, (8)

where 𝝁\boldsymbol{\mu} is a vector of iid Laplace random variables

μiLap(0,λ),i=1,,F,\mu_{i}\sim\textrm{Lap}(0,\lambda),i=1,\ldots,F, (9)

achieves β\beta-differential privacy for

λ4CκF/(βn),\lambda\geq 4C\kappa\sqrt{F}/(\beta n), (10)

where κ\kappa satisfies ϕ(𝒙)ϕ(𝒙)κ2\phi(\boldsymbol{x})^{\top}\phi(\boldsymbol{x})\leq\kappa^{2} for all 𝒙L\boldsymbol{x}\in\mathbb{R}^{L}.

By perturbing the optimal weight vector, the accuracy of the SVM classifier will be degraded. For this purpose, it is important to deliver guarantees on the classification accuracy by upper bounding the noise scale λ\lambda. This is done in [2] by introducing a condition called (ϵ,δ)(\epsilon,\delta)-useful mechanism:

Pr[sup𝒙𝒳|fϕ(𝒙,𝒘~)fϕ(𝒙,𝒘)|ϵ]1δ.\mathrm{Pr}\left[\sup_{\boldsymbol{x}\in\mathcal{X}}{\left|f_{\phi}(\boldsymbol{x},\tilde{\boldsymbol{w}})-f_{\phi}(\boldsymbol{x},\boldsymbol{w}^{*})\right|}\leq\epsilon\right]\geq 1-\delta. (11)

where ϵ>0,δ(0,1)\epsilon>0,\delta\in(0,1), and the set 𝒳L\mathcal{X}\subseteq\mathbb{R}^{L} contains all the data points. From [2, Thm. 11], the condition above is satisfied for 0λϵ2Φ(Flnδ)0\leq\lambda\leq\frac{\epsilon}{2\Phi(F-\ln\delta)}, where |ϕi(𝒙)|Φ{\left|\phi_{i}(\boldsymbol{x})\right|}\leq\Phi for all 𝒙𝒳\boldsymbol{x}\in\mathcal{X}, i=1,,Fi=1,\ldots,F, and some Φ>0\Phi>0.

In the following, we will assume that the following information is publicly available: the SVM weights 𝒘~\tilde{\boldsymbol{w}}, the data-independent details for constructing ϕ\phi, and the noise scale λ\lambda.

3 Counterfactual Explanation

Refer to caption
Figure 2: Illustration for linear classification with SVM and private SVM, and the different associated explanations using the Euclidean norm as distance measure. The data points are generated from two bivariate Guassian distributions with means [0,0][0,0] and [1,1][1,1], and same covariance 0.1𝑰0.1\boldsymbol{I}.

The concept of counterfactual explanations was proposed in [4, Eq. 2] for general ML classifiers. In the following definition we use the original definition, but formulated for the SVM.

Definition 1 (Counterfactual Explanation).

Given an SVM classifier with weight vector 𝐰\boldsymbol{w}, a counterfactual explanation for the classification y=h(𝐱,𝐰)y^{\prime}=h(\boldsymbol{x}^{\prime},\boldsymbol{w}) of a given data instance 𝐱\boldsymbol{x}^{\prime} is the solution of the following problem

minimize𝒙L\displaystyle\operatorname*{minimize}_{\boldsymbol{x}\in\mathbb{R}^{L}} d(𝒙,𝒙)\displaystyle~{}~{}d(\boldsymbol{x},\boldsymbol{x}^{\prime}) (12a)
s.t.\displaystyle s.t. yfϕ(𝒙,𝒘)0,\displaystyle~{}~{}y^{\prime}f_{\phi}(\boldsymbol{x},\boldsymbol{w})\leq 0, (12b)

where d(𝐱,𝐱)d(\boldsymbol{x},\boldsymbol{x}^{\prime}) is a distance between 𝐱\boldsymbol{x} and 𝐱\boldsymbol{x}^{\prime}, assumed to be convex in the first argument, and fϕ(𝐱,𝐰)f_{\phi}(\boldsymbol{x},\boldsymbol{w}) is defined in Eq. (3).

The solution of problem (12) is the closest point to 𝒙\boldsymbol{x}^{\prime}, according to the distance dd, with the constraint that its class is different than yy^{\prime}. Notice that since we consider binary classification, the constraint in Eq. (12b) is equivalent to h(𝒙,𝒘)yh(\boldsymbol{x},\boldsymbol{w})\neq y^{\prime}.

In Figure 2, we illustrate different counterfactual explanations for the linear SVM classifiers with optimal weights 𝒘\boldsymbol{w}^{*} and perturbed weights 𝒘~\tilde{\boldsymbol{w}}. The optimal and non-robust explanations are the closest points to the instance that lie on the respective decision boundaries. It can be seen that the non-robust explanation is closer to the instance compared to the optimal explanation and thus also has the same classification as the instance when using the optimal classifier. Hence, the non-robust explanation may not be credible. We will study robust explanations next that will take into account the uncertainty in the perturbed weights.

3.1 Robust Explanations

The private SVM mechanism releases noisy versions of the optimal 𝒘\boldsymbol{w}^{*} according to Eq. (8). Thus, there exists uncertainty about the correctness of the classification with 𝒘~\tilde{\boldsymbol{w}}, which diminishes the effectiveness of the counterfactual explanation unless this uncertainty is taken into account. Therefore, we will model the uncertainty about 𝒘\boldsymbol{w}^{*} through the random vector 𝝃=𝒘~𝝁\boldsymbol{\xi}=\tilde{\boldsymbol{w}}-\boldsymbol{\mu}. From Eq. (9), it follows that

𝝃mvLap(𝒘~,2λ2𝑰),\boldsymbol{\xi}\sim{\mathrm{mvLap}}{\left(\tilde{\boldsymbol{w}},2\lambda^{2}\boldsymbol{I}\right)}, (13)

where mvLap(𝒍,𝚺){\mathrm{mvLap}}{\left(\boldsymbol{l},\boldsymbol{\Sigma}\right)} is the multivariate Laplace distribution with location 𝒍\boldsymbol{l} and covariance matrix 𝚺\boldsymbol{\Sigma}. Subsequently, we will replace the constraint in (12b) with the probabilistic constraint

Pr[yfϕ(𝒙,𝝃)0]p.\displaystyle\mathrm{Pr}\left[y^{\prime}f_{\phi}(\boldsymbol{x},\boldsymbol{\xi})\leq 0\right]\geq p. (14)

The probability pp in Eq. (14) is typically selected close to 11. In the following, we will characterize the deterministic equivalent of the constraint in Eq. (14).

Proposition 1.

The robust counterfactual explanation problem

minimize𝒙L\displaystyle\operatorname*{minimize}_{\boldsymbol{x}\in\mathbb{R}^{L}} d(𝒙,𝒙)\displaystyle~{}~{}d(\boldsymbol{x},\boldsymbol{x}^{\prime}) (15a)
s.t.\displaystyle s.t. Pr[yfϕ(𝒙,𝝃)0]p,\displaystyle~{}~{}\mathrm{Pr}\left[y^{\prime}f_{\phi}(\boldsymbol{x},\boldsymbol{\xi})\leq 0\right]\geq p, (15b)

with p[1/2,1]p\in[1/2,1] is equivalent to

minimize𝒙L\displaystyle\operatorname*{minimize}_{\boldsymbol{x}\in\mathbb{R}^{L}} d(𝒙,𝒙)\displaystyle~{}~{}d(\boldsymbol{x},\boldsymbol{x}^{\prime}) (16a)
s.t.\displaystyle s.t. yϕ(𝒙)𝒘~λ2ln(2(1p))ϕ(𝒙)0.\displaystyle~{}~{}y^{\prime}\phi(\boldsymbol{x})^{\top}\tilde{\boldsymbol{w}}-\lambda\sqrt{2}\ln(2(1-p)){\|\phi(\boldsymbol{x})\|}\leq 0. (16b)
Proof.

We need to prove that the probabilistic constraint in Eq. (15b) can be reformulated to Eq. (16b). From (13), the multivariate Laplace distribution mvLap(𝒘~,2λ2𝑰){\mathrm{mvLap}}{\left(\tilde{\boldsymbol{w}},2\lambda^{2}\boldsymbol{I}\right)} is symmetric since the variance does not depend on the mean. A symmetric multivariate Laplace distribution is elliptically symmetric [12]. Consequently, the structure of Eq. (16b) follows from [13, Lemma 2.2], and for the multivariate Laplace distribution, the derivation follows similar steps as in [14, Ex. 2.2]. ∎

The constraint in Eq. (16b) includes two terms. The first term is the same as in Eq. (12b) and requires that the solution of the problem has a different class than yy^{\prime}. The second term establishes robustness by enforcing stronger confidence in the SVM prediction, i.e., larger |ϕ(𝒙)𝒘~|{\left|\phi(\boldsymbol{x})^{\top}\tilde{\boldsymbol{w}}\right|}. Notice that for p=0.5p=0.5, the second term is zero and Eq. (16b) becomes the same as that in the non-robust case in Eq. (12b).

For linear SVM, i.e., ϕ(𝒙)=𝒙\phi(\boldsymbol{x})=\boldsymbol{x}, problem (16) is rewritten as

minimize𝒙Ld(𝒙,𝒙)s.t.𝒙yλ2ln(2(1p))𝒙𝒘~,\displaystyle\operatorname*{minimize}_{\boldsymbol{x}\in\mathbb{R}^{L}}~{}~{}d(\boldsymbol{x},\boldsymbol{x}^{\prime})\quad s.t.~{}~{}{\|\boldsymbol{x}\|}\leq\frac{y^{\prime}}{\lambda\sqrt{2}\ln(2(1-p))}\boldsymbol{x}^{\top}\tilde{\boldsymbol{w}}, (17)

which is a SOCP problem and can be solved efficiently using convex optimization solvers. The implementations for this letter have been done using CVXPY [15, 16], and the explanations plotted in Figure 2 were found by solving this problem.

The general problem in (16) is however not convex. Therefore, we will consider next finding a suboptimal solution that can be computed efficiently. Define the function

g(𝒙):=yϕ(𝒙)𝒘~λ2ln(2(1p))ϕ(𝒙),g(\boldsymbol{x}):=y^{\prime}\phi(\boldsymbol{x})^{\top}\tilde{\boldsymbol{w}}-\lambda\sqrt{2}\ln(2(1-p)){\|\phi(\boldsymbol{x})\|}, (18)

which is the left hand side of Eq. (16b). A root for the function gg would qualify as a robust explanation since it satisfies the constraint in (16b) with equality. In order to find a root for gg, we will use the bisection method. As a prerequisite, this method requires the knowledge of two input values to the function that give opposite signs. Clearly, for the given data instance 𝒙\boldsymbol{x}^{\prime}, g(𝒙)g(\boldsymbol{x}^{\prime}) is positive. The second required input vector should necessarily be of opposite class to 𝒙\boldsymbol{x}^{\prime} in order for gg to be negative. We will discuss next the availability of such input that we will here refer to as a prototype [9].

Unlike in [9], we do not have access to test data to construct these prototypes due to privacy issues. However, we argue that if we consider prototypes as representatives of their classes, the “domain expert” that provides the explanations should be able to estimate these by knowing the characteristics of the data for each class. If this is not the case, we assume that the prototypes can be constructed by generating random data instances and studying their classification. Let the prototypes for class 11 and 1-1 be 𝒛1\boldsymbol{z}_{1} and 𝒛1\boldsymbol{z}_{-1}, respectively. In the process of finding the prototypes, it is desired that the classification for these points has sufficient confidence, i.e.,

|fϕ(𝒛y,𝒘~)|λ2ln(2(1p))ϕ(𝒛y),y{1,1}.{\left|f_{\phi}(\boldsymbol{z}_{y},\tilde{\boldsymbol{w}})\right|}\geq-\lambda\sqrt{2}\ln(2(1-p)){\|\phi(\boldsymbol{z}_{y})\|},\quad y\in\{1,-1\}. (19)

The steps for the bisection method are described in Algorithm 1. The lower and upper bounds for bisection are initialized according to the given data instance and the prototype from the opposite class, respectively. In each iteration we check the classification of the midpoint of the interval between the upper and lower bounds. If this class is the same as the lower bound, then we replace the lower bound by the midpoint. Otherwise, we replace the upper bound. These steps are performed until the distance between the upper and lower bounds is lower than the threshold ϵ\epsilon. The algorithm has linear convergence since the distance between the bounds is halved in each iteration.

Algorithm 1 Bisection method for finding an explanation
1:  Input: Instance and classification (𝒙,y)(\boldsymbol{x}^{\prime},y^{\prime}), prototype 𝒛y\boldsymbol{z}_{-y^{\prime}}.
2:  Initialize: 𝒙ub=𝒛y,𝒙lb=𝒙{\boldsymbol{x}^{ub}}=\boldsymbol{z}_{-y^{\prime}},{\boldsymbol{x}^{lb}}=\boldsymbol{x}^{\prime}
3:  while 𝒙ub𝒙lb>ϵ{\|\boldsymbol{x}^{ub}-\boldsymbol{x}^{lb}\|}>\epsilon do
4:     𝒙(𝒙ub+𝒙lb)/2\boldsymbol{x}\leftarrow(\boldsymbol{x}^{ub}+{\boldsymbol{x}^{lb}})/2
5:     if g(𝒙)<0g(\boldsymbol{x})<0 then
6:        𝒙ub𝒙\boldsymbol{x}^{ub}\leftarrow\boldsymbol{x}
7:     else
8:        𝒙lb𝒙\boldsymbol{x}^{lb}\leftarrow\boldsymbol{x}
9:  Output: 𝒙roex𝒙\boldsymbol{x}^{ro-ex}\leftarrow\boldsymbol{x}.

4 Experimental Results

We illustrate our approach by using the publicly available UCI Breast Cancer Wisconsin (Diagnostic) dataset [10]. The dataset includes 569569 instances, each with 3030 features and the binary diagnosis: benign (class 1-1) or malignant (class 11). The code to reproduce all the figures is available at [17].

We randomly split the dataset once into a training (70% of total) and a test set (30% of total). The results were qualitatively similar for different random splits of the dataset with the same splitting ratio. Moreover, we normalize the training data to have zero mean and unit variance, and the calculated normalization parameters are applied to the test data. Next, a feature mapping ϕ\phi is generated using the Radial Basis Function (RBF) kernel approximation in [18] with dimensions F=100F=100.666Note, that in this work we have assumed finite dimensional feature mappings and hence we do not explicitly consider the approximation error in the feature mapping in relation to using the RBF kernel as is done in [2, Section 4] for the general case of translation-invariant kernels. For the implementation of the feature mapping, we have used the library in [19]. The SVM classifiers learned for the plots are trained using the training set and their performance measured on the test set. The distance function used for the counterfactuals in Eq. (16), is the Eucleadian norm, i.e., d(𝒙,𝒙)=𝒙𝒙d(\boldsymbol{x},\boldsymbol{x}^{\prime})={\|\boldsymbol{x}-\boldsymbol{x}^{\prime}\|}. The prototypes are selected to be the data mean of each class.

Accuracy vs privacy. Figure 3, depicts the trade-off between average accuracy and privacy of the private SVM, with an average taken over 10410^{4} random realizations of Laplace noise. The dashed line corresponds to the non-private case in which the SVM weights are not perturbed with noise. The average accuracy for the private SVM is lowest (0.5\approx 0.5) for high privacy levels (very small β\beta), and monotonically increases with β\beta to eventually converge to the non-private SVM average performance.

Refer to caption
Figure 3: Average accuracy of private SVM for different values of β\beta in (7). The confidence value is set to p=0.9p=0.9 for the probabilistic constraint in (14).

Convergence and explainability. We set β=5,p=0.9\beta=5,p=0.9. Then, we select a random instance 𝒙\boldsymbol{x}^{\prime} from the test set with label y=1y^{\prime}=1 (malignant), and apply Algorithm 1 to calculate an explanation 𝒙roex\boldsymbol{x}^{ro-ex} for its classification. Figure 4(a) shows the low number of iterations needed for Algorithm 1 to converge. The found explanation 𝒙roex\boldsymbol{x}^{ro-ex} quantifies the changes to each feature of 𝒙\boldsymbol{x}^{\prime} in order to change the classifier prediction. Figure 4(b) shows these changes normalized over the instance’s feature values. For example, for the selected instance, the explanation shows that feature number 1919 needs to be increased by around half its value, while several other feature values need to be halved in order to alter the prediction from malignant to benign.

Explainability vs privacy. The average distance between the counterfactual explanation and the instance is calculated depending on β\beta (for p=0.9p=0.9) in Figure 5(a), and depending on pp (for β=0.5\beta=0.5) in Figure 5(b). This average distance for robust counterfactual explanations is high for small values of β\beta, as is shown in Figure 5(a). This is due to the large uncertainty through the large noise variance. The non-robust explanation has similar distances as for non-private SVM since the noise has zero mean. In Figure 5(b), the effects of pp on the average distance are shown. For p=0.5p=0.5, robust explanation is identical with non-robust explanation as mentioned before. For large confidence values pp, the robust explanation converges to the prototype data point, and is furthest away from the instance.

Clearly, it is desirable to find counterfactual explanations that are as close as possible to the instance to explain. Still, as we observe in Figure 5, robust explanations are further away compared to the non-robust explanations, showing that privacy degrades the quality of explanations. The reason for that is, non-robust explanations violate the constraint in Eq. (12b) with probability 0.50.5, while the robust explanations violate this constraint with probability pp (which we here set to 0.90.9). This constraint violation is further studied in Figure 6. In Figure 6(a) and Figure 6(b), the summary statistics for the left hand side of (12b) are plotted for the non-robust and robust explanations, respectively. These plots highlight the importance for considering robust explanations. Notice that the flattening of the 5050-th percentile curve (Figure 6(b)) for β\beta less than around 44 is due to the convergence of the explanation to the prototype.

Refer to caption
(a) Convergence of Algorithm 1.
Refer to caption
(b) The counterfactual explanation is utilized to quantify the necessary changes in the instance’s features in order to alter its SVM classifier prediction.
Figure 4: Convergence of Algorithm 1 and the explanation of an instance.

5 Conclusions

The above findings highlight the difficulties associated with embedding the social and ethical values mandated by regulatory instruments into ML algorithms. An ensuing conclusion is that a conscious decision may be required to promote one social value at the expense of another, the context in which the technology is being operated potentially being a deciding factor. These issues are highlighted in this work through the study of robust counterfactual explanations for privacy preserving SVMs. After suitably modelling the problem, we have studies its solution for linear and non-linear SVMSs. While the problem can be solved optimally for the linear case, we have proposed an efficient suboptimal solution based on the bisection method for the general case. The advantages for using robust explanations are illustrated on the UCI Breast Cancer Wisconsin dataset. In particular, our robustness model guarantees a tuneable level of confidence that the counterfactuals are of opposite class to that of the instance we want to explain.

6 Acknowledgments

This work has been supported by KTH Digital Futures within the project “EXTREMUM: Explainable and Ethical Machine Learning for Knowledge Discovery from Medical Data Sources” (https://www.digitalfutures.kth.se).

Refer to caption
(a) p=0.9p=0.9
Refer to caption
(b) β=5\beta=5
Figure 5: Robust explanations lie between the instance 𝒙\boldsymbol{x}^{\prime} and the selected prototype. This distance decreases for larger β\beta and increases for larger probability pp.
Refer to caption
(a) Non-robust explanations
Refer to caption
(b) Robust explanations
Figure 6: Comparison between robust and non-robust explanations on the violation of the constraint in (12b) for private SVM.

References

  • [1] Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing Directive 95/46/EC (General Data Protection Regulation), OJ L 119, 4.5.2016 (2016).
  • [2] B. I. P. Rubinstein, P. L. Bartlett, L. Huang, N. Taft, Learning in a large function space: Privacy-preserving mechanisms for SVM learning, Journal of Privacy and Confidentiality 4 (1) (Jul. 2012).
  • [3] C. Dwork, A. Roth, The algorithmic foundations of differential privacy, Found. Trends Theor. Comput. Sci. 9 (3–4) (2014) 211–407.
  • [4] C. R. Sandra Wachter, Brent Mittelstadt, Counterfactual explanations without opening the black box: Automated decisions and the GDPR, Harvard Journal of Law & Technology, forthcoming 31 (2) (2018).
  • [5] C. Molnar, Interpretable Machine Learning - A Guide for Making Black Box Models Explainable, 2019, https://christophm.github.io/interpretable-ml-book/.
  • [6] W. J. Murdoch, C. Singh, K. Kumbier, R. Abbasi-Asl, B. Yu, Definitions, methods, and applications in interpretable machine learning, Proceedings of the National Academy of Sciences 116 (44) (2019) 22071–22080.
  • [7] A. Barredo Arrieta, N. Díaz-Rodríguez, J. Del Ser, A. Bennetot, S. Tabik, A. Barbado, S. Garcia, S. Gil-Lopez, D. Molina, R. Benjamins, R. Chatila, F. Herrera, Explainable artificial intelligence (XAI): Concepts, taxonomies, opportunities and challenges toward responsible AI, Information Fusion 58 (2020) 82–115.
  • [8] A. Shapiro, D. Dentcheva, A. Ruszczyński, Lectures on Stochastic Programming: Modeling and Theory, Second Edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, 2014.
  • [9] A. V. Looveren, J. Klaise, Interpretable counterfactual explanations guided by prototypes, CoRR abs/1907.02584 (2019).
    URL http://arxiv.org/abs/1907.02584
  • [10] D. Dua, C. Graff, UCI machine learning repository, University of California, Irvine, School of Information and Computer Sciences (2017).
    URL http://archive.ics.uci.edu/ml
  • [11] T. Hastie, R. Tibshirani, J. Friedman, The elements of statistical learning: data mining, inference and prediction, 2nd Edition, Springer Series in Statistics, Springer-Verlag New York, 2009.
  • [12] S. Kotz, T. J. Kozubowski, K. Podgórski, Symmetric Multivariate Laplace Distribution, Birkhäuser Boston, Boston, MA, 2001, Ch. 5.
  • [13] R. Henrion, Structural properties of linear probabilistic constraints, Optimization 56 (2007) 425 – 440.
  • [14] S. Peng, Chance constrained problem and its applications, Theses, Université Paris Saclay (COmUE) ; Xi’an Jiaotong University (Jun. 2019).
    URL https://tel.archives-ouvertes.fr/tel-02303045
  • [15] S. Diamond, S. Boyd, CVXPY: A Python-embedded modeling language for convex optimization, Journal of Machine Learning Research 17 (83) (2016) 1–5.
  • [16] A. Agrawal, R. Verschueren, S. Diamond, S. Boyd, A rewriting system for convex optimization problems, Journal of Control and Decision 5 (1) (2018) 42–60.
  • [17] R. Mochaourab, Robust-Explanation-SVM, https://github.com/rami-mochaourab/robust-explanation-SVM (2021).
  • [18] A. Rahimi, B. Recht, Random features for large-scale kernel machines, in: Proceedings of the 20th International Conference on Neural Information Processing Systems, NIPS’07, Curran Associates Inc., Red Hook, NY, USA, 2007, p. 1177–1184.
  • [19] K. Atarashi, pyrfm: A library for random feature maps in python (2019).
    URL https://neonnnnn.github.io/pyrfm/