Title: OPTIMAL STRATEGIES AGAINST GENERATIVE ATTACKS

Abstract: Generative neural models have improved dramatically recently. With this progress comes the risk that such models will be used to attack systems that rely on sensor data for authentication and anomaly detection. Many such learning systems are installed worldwide, protecting critical infrastructure or private data against malfunction and cyber attacks. We formulate the scenario of such an authentication system facing generative impersonation attacks, characterize it from a theoretical perspective and explore its practical implications. In particular, we ask fundamental theoretical questions in learning, statistics and information theory: How hard is it to detect a "fake reality"? How much data does the attacker need to collect before it can reliably generate nominally-looking artificial data? Are there optimal strategies for the attacker or the authenticator? We cast the problem as a maximin game, characterize the optimal strategy for both attacker and authenticator in the general case, and provide the optimal strategies in closed form for the case of Gaussian source distributions. Our analysis reveals the structure of the optimal attack and the relative importance of data collection for both authenticator and attacker. Based on these insights we design practical learning approaches and show that they result in models that are more robust to various attacks on real-world data.

1. INTRODUCTION:

Generative models have attracted considerable attention since the introduction of Generative Adversarial Networks (Goodfellow et al., 2014a) . Empirically, GANs have been shown to generate novel data instances that resemble those in the true distribution of the data. The success of GANs also comes with the risk that generative models will be used for attacking sensor-based security systems. One example is identity authentication systems, where an individual is identified via her images, and GANs might be able to generate such images to gain access (Thies et al., 2016) . Another is anomaly detection systems protecting critical infrastructure. As demonstrated by recent cyber-attacks (notably the Stuxnet attack) sensors of these systems can be hijacked, so that GANs can be used to generate "normal" looking activity while the actual system is being tampered with. The latter is, in fact, a new form of a man-in-the-middle attack.

Our goal here is to construct a theoretical framework for studying the security risk arising from generative models and explore its practical implications. We begin with a simple key insight. If the attacker (i.e., the generative model) has unlimited observations of the source it is trying to imitate, it will be able to fool any authenticator. On the other hand, if the attacker has access to fewer sensor observations than the number of fake observations it needs to generate, it seems intuitively clear that it cannot always succeed (as we indeed prove in Sec. 4). Therefore, the optimal defense and attack strategies depend crucially on the amount of information available to the attacker and authenticator. Motivated by the above insight, we cast the authentication setting as a two-player maximin game (authenticator vs. attacker) where all observations are finite. Specifically, there are three key obser-vation sets to consider: those available to the attacker, those that the attacker needs to generate, and those available to the authenticator when designing the system. Our goal is to understand how these three information sources determine the optimal strategies for both players. Under the realistic assumption that cyber attackers are sophisticated enough to play optimal or close to optimal strategies, a characterization of the maximin authentication strategy can be of significant value.

We prove several theoretical results characterizing the optimal strategy for both players. These results highlight the role played by the available observations as well as the functional form for an optimal attacker and authenticator. We refer to the setting above as "GAN in The Middle" (GIM) due to its similarity to "man in the middle" attacks. After describing our theoretical results, we show how to learn both authenticator and attacker policies in practice, where both are based on neural architectures. Our GIM method can be applied to multiple practical problems. The first is building an authentication system that is robust to impersonation attacks. The second is building a data generating mechanism that can generate novel data instances. Finally, we evaluate the method empirically, showing that it outperforms existing methods in terms of resilience to generative attacks, and that it can be used effectively for data-augmentation in the few-shot learning setting.

2. PROBLEM STATEMENT:

We begin by motivating our problem and formulating it as a two-player zero-sum game. As a simple illustrative example, consider a face authentication security system whose goal is to maximize authentication accuracy. The system is initialized by registering k images of an individual θ (the "source"), whose identity is to be authenticated. At test-time, each entity claiming to be θ is required to present to the system n of its images, and the authentication system decides whether the entity is θ or an impersonator. We let m denote the maximum number of "leaked" images any attacker obtained. We observe that if an attacker obtained m ě n images of θ, it can present n of those images. Thus the observations generated by the attacker are indistinguishable from ones generated by θ, leading to failure of the authentication system (see Sec. 4.2 below). Hence, the number of images of θ that the attacker obtains and the size of the authentication sample are of key importance. We now turn to formally stating the problem. Notation. The set of possible observations is denoted by X . Let H denote the known set of possible sources θ, where each source θ P H is defined by a probability density f θ , and an observation of a source θ P H is an X -valued random variable with density f θ . We assume that subsequent observations of the source are IID, so that n sequential observations have density f pnq θ px 1 , . . . , x n q :" ś n i"1 f θ px i q. We allow θ to be sampled from a known distribution Q on H and denote the corresponding H-valued random variable by Θ. In what follows we will denote the number of observations leaked to the attacker by m, the number of "registration" observations available to the authenticator by k, and the number of observations required at authentication by n (these may be generated by either the attacker or the true source). The Authentication Game. The game begins with a random source Θ being drawn from H according to Q. The authenticator first receives information about the drawn source, and then chooses a decision rule for deciding whether a given test sequence x P X n is an authentic sequence of observations sampled from f pnq θ or a fake sequence generated by the attacker. Formally, the authenticator learns about the source by seeing k IID "registration" observations A " A 1 , . . . , A k " f pkq θ . The set of all possible decision rules is then D : X k ˆX n Ñ t0, 1u (where a decision of 1 corresponds to the true source and 0 to an attacker). After the authenticator fixes its strategy, the attacker can seek the best attack strategy. We assume that the attacker has access to m "leaked" IID observations Y " Y 1 , . . . , Y m " f pmq θ as information about the source θ. Then it generates an attack sequence X P X n and presents it to the authenticator, which uses its decision rule to decide whether X is an authentic sequence of observations sampled from f pnq θ or a fake sequence generated by the attacker. Formally, the strategy set of the attacker is all functions G : X m Ñ ∆pX n q, where ∆pX n q is the set of probability distributions over X n , and g X|Y is the associated conditional probability density. We note that the set H, the parametric family f θ , and the prior probability Q are known to both players. Also, note that the leaked sample Y revealed to the attacker is not available to the authenticator, and the "registration" sample A is not available to the attacker.

The goal of the authenticator is to maximize its expected accuracy, and the goal of the attacker is to minimize it (or equivalently maximize its success probability). We define the utility (payoff) of the game as the expected prediction accuracy of the authenticator. To define expected accuracy we consider the case of equal priors for attack and real samples.1 Formally, for a pair of strategies pD, Gq and a specific source θ, the expected accuracy of the authenticator is then:

V pθ, D, Gq " 1 2 E A"f pkq θ E Y "f pmq θ " E X"f pnq θ rDpA, Xqs `EX"GpY q r1 ´DpA, Xqs ı (2.1)

Since this utility only depends on G in the second term, minimizing it is equivalent to G maximizing its success probability. To obtain the overall utility for the authenticator, we take the expected value w.r.t Θ and define V pD, Gq " E Θ"Q V pΘ, D, Gq. Finally, we arrive at the following maximin game:

V game " max DPD min GPG V pD, Gq (2.2)

where D, G are the sets of all possible authenticator and attacker strategies, respectively. In Sec. 4 we show that this game has a Nash equilibrium, we characterize the optimal strategies and game value in general, and find them in closed form for the case of Multivariate Gaussian sources.

3. RELATED WORK:

Adversarial hypothesis testing (AHT): Hypothesis testing (HT) is a rich field in statistics that studies how one can detect whether a sample was generated by one of two sets of distributions. A variant of HT that is related to our work but distinct from it is AHT (e.g., see Brandão et al., 2014; Barni & Tondi, 2013b; a; 2014; Bao et al., 2011; Zhou et al., 2019; Brückner & Scheffer, 2011; Brückner et al., 2012) . These works describe an HT setting where the sample is generated by one of two hypotheses classes, but is then modified by an adversary in some restricted way. E.g., in Barni & Tondi (2013b; a; 2014) the adversary can change the sample of one class up to a fixed distance (e.g., Hamming). Given the quality of current generative models and the rapid pace of progress, when considering an impersonation attack, it seems that the only relevant restriction one can assume on an attacker is on the information it has. This is not captured by prior work since it assumes that the adversary has a restricted strategy set. In contrast, our work considers a novel problem setting where both players are not limited in their strategy set in any way. This leads to a novel analysis that focuses on the dependence on the finite information available to each player (m, n, k). Adversarial Examples: It has been observed (Goodfellow et al., 2014b ) that deep learning models can be very sensitive to small changes in their input. Such "misleading" inputs are known as adversarial examples and much recent work has analyzed the phenomenon (Ilyas et al., 2019; Shamir et al., 2019; Zhang et al., 2019) , addressed the problem of robustness to these (Moosavi-Dezfooli et al., 2016; Papernot et al., 2017; Yuan et al., 2017) , and studied when robusntess can be certified (Raghunathan et al., 2018; Wong et al., 2018) . The setting of robust classification in the presence of adversarial examples can also be thought of as a specific case of AHT (see above), where a classifier is required to predict the class of an observation that could have been perturbed by a restricted adversary (Wong et al., 2018; 2019) or generated by an adversary limited to generating examples that will be classified correctly by humans (Song et al., 2018) . In contrast, in our setting the attacker is not limited in any way, nor does it have another utility in addition to impersonating the source. Furthermore, in adversarial examples, there is no notion of limited information for the adversary, whereas our work focuses on the dependence of the game on the information available to the players (sample sizes n, m, k).

GAN::

The GAN model is a game between a generator and a discriminator. While our concept of generative attacks is inspired by GAN, it is very different from it: a successful GAN generator is not necessarily a successful attacker in our setting, and vice-versa (e.g., given sufficiently expressive generators and discriminators, GANs can "memorize" the training data, and thus the discriminator will perform at chance level.2 Such a discriminator will not be useful as a defense against generative attacks). Unlike GANs, in our setting, sample sizes are of key importance. Thus, our attacker will not memorize the data it sees, as this will be detected when generating n ą m examples.

Conditional GANs: In conditional GANs (Mirza & Osindero, 2014) the generator uses side information for generating new samples. The attacker in our approach (analogous to GAN generator) has input, but this input is not available to the authenticator (analogous to GAN discriminator). Thus, the objective of the learning process is fundamentally different. Few-shot learning and generation: Our work relates to few-shot learning (Snell et al., 2017; Vinyals et al., 2016; Finn et al., 2017; Lake et al., 2011; Koch et al., 2015) and few-shot generative models (Rezende et al., 2016; Zakharov et al., 2019; Lake et al., 2015; Edwards & Storkey, 2017; Hewitt et al., 2018) in the sense that both authenticator and attacker need to learn from a limited set of observations. However, in our setting the authenticator is required to predict whether a sample came from the true source or an attacker impersonating the source while taking into consideration the amount of information both players have. These are notions that are not part of the general few-shot learning setup. Also, in prior work on few-shot generation, the generator is either measured through human evaluation (Lake et al., 2015) or trained to maximize the likelihood of its generated sample (Rezende et al., 2016; Edwards & Storkey, 2017; Hewitt et al., 2018) . In contrast, in our setting the attacker's objective is to maximize the probability that its generated sample will be labeled as real by an authenticator. To this end, we show that the attacker must consider the sample sizes m, n, k, which the generative models in prior work do not account for. Furthermore, we show in Sec. F.4, and in Figures 1c, 6 , that the maximum likelihood (ML) solution is indeed sub-optimal in our setting.

Image to image translation: Several GAN models have been introduced for mapping between two domains (Zhu et al., 2017; Huang et al., 2018; Isola et al., 2017; Wang et al., 2017; Park et al., 2019) . This relates to our work since the attacker also needs to learn to map the leaked sample to an attack sample. However, in our setting the mapping is not to a different domain but rather to other images from the same distribution, which results in a different objective. Data Augmentation: Generative models have also been used for augmenting data in supervised learning, and in particular few-shot learning (Koch et al., 2015; Snell et al., 2017; Vinyals et al., 2016; Lake et al., 2011) . One such approach is Data Augmentation GAN (DAGAN) (Antoniou et al., 2018) , which takes as input an image and generates a new image. It relates to our framework in the limited case of m " 1, n " 2, k " 1, in the sense that the generator's objective is to map one image to two. However, in DAGAN the only goal of the discriminator is to improve the generator, and the generator is limited to the functional form of adding a new image to the existing one, which is a sub-optimal attack strategy, as can be seen from the Gaussian case of our problem.

4. THEORETICAL RESULTS:

In this section, we study the game defined in Eq. 2.2. First, in Sec. 4.1 we show the existence of a Nash equilibrium and characterize the optimal strategies for both players. Specifically, we show that the optimal attacker strategy minimizes a certain divergence between the source and the attacker's conditional distribution of X given A. Next, Sec. 4.2 shows that when there are more leaked samples m than generated samples n, the authenticator will fail. Finally, in Sec. 4.3 we provide a closed-form solution for both attacker and authenticator for the case of multivariate Gaussian distributions and analyze the effect of the dimension of the observations and the sample sizes m, n, and k. Proofs are provided in the appendix.

4.1. CHARACTERIZING THE OPTIMAL STRATEGIES:

We begin by showing that the game defined in Eq. 2.2 admits a Nash equilibrium. Namely, Theorem 4.1 below shows that there exists a pair of strategies pD ˚, G ˚q that satisfy: , where I is the indicator function. Then pD ˚, G ˚q is a solution of Eq. 2.2 that satisfies Eq. 4.1.

max DPD min GPG V pD, Gq " min GPG max DPD V pD, Gq " V pD ˚, G ˚q (4.

The proof (see Sec. D) follows by first showing that since Dpa, xq P t0, 1u, it holds that for any G, the optimal authenticator strategy is a MAP test between the two hypotheses (true source or attacker). We then show that given D ˚, the game objective for G becomes Eq. 4.2. Namely, the optimal attacker minimizes the 1 distance over the space X k ˆX n between the true source's conditional distribution of X given A, and its own. Therefore, since the proposed G ˚minimizes Eq. 4.2 by definition, it holds that min G V pD ˚, Gq " V pD ˚, G ˚q " max D V pD, G ˚q and it follows that D ˚, G ˚satisfy Eq. 4.1.

4.2. REPLAY ATTACKS: AUTHENTICATION FAILURE FOR n ď m:

When n ď m, the attacker generates a number of observations that is at most the number of observations it has seen. Intuitively, an optimal attack in this case, is to simply "replay" a subset of size n from the m observations. This is known as a replay-attack (Syverson, 1994) . This subset constitutes an IID sample of length n of the observed source, and is, therefore, a legitimate "fresh" sample. In this case, it seems like the attack cannot be detected by the authenticator. Indeed it is easy to show using Theorem 4.1 that this attack is optimal and therefore for n ď m we have: max DPD min GPG V pD, Gq " 0.5 (see Sec. E)

4.3. THE GAUSSIAN CASE:

We now turn to the case of multivariate Gaussian distributions where we can find the exact form of the attacker and authenticator, providing insight into the general problem. Specifically, we consider the setting where the source distributions are d-dimensional multivariate Gaussians with an unknown mean and known covariance, and the prior Q over H is the improper uniform prior. 3 We assume n ą m to keep the problem non-trivial. Let the observations be d-dimensional Gaussian vectors with a known covariance matrix Σ P R dˆd and an unknown mean vector θ P R d . The set of possible sources H becomes R d , the Gaussian mean vectors. For any sample of n examples z P R nˆd , we let z i denote the i'th example, and z " 1 n ř n i"1 z i denote the sample mean. Finally, for any v P R d , B P R dˆd , we define }v} 2 B " v T Bv. The following theorem gives a closed-form solution for both attacker and authenticator for the game defined in Eq. 2.2. Theorem 4.2. Define δ " m{n ď 1 and let ρ " m{k. Consider the attacker G ˚defined by the following generative process: Given a leaked sample Y P R mˆd , G ˚generates a sample X P R nˆd as follows: it first samples n vectors W 1 , . . . , W n iid " N p0, Σq and then sets: X i " W i ´W `Ȳ . Define the authenticator D ˚by:

D ˚pa, xq " I « }x ´ā} 2 Σ ´1 ă d p1 `ρq `1 `ρδ ´1n p1 ´δq log ˆρ `1 ρ `δ ˙ff (4.3)

Then pD ˚, G ˚q is a solution of Eq. 2.2 that satisfies Eq. 4.1.

The proof (see Sec. F) starts by showing that @α ą 0, given Dpa, xq " Ir}x ´ā} 2 Σ ´1 ă αs, the optimal strategy for G is to set x " ȳ with probability 1 (as done in G ˚). To prove this, we first use the Prekopa-Leindler inequality (Prékopa, 1973) to show that in this case G's maximization objective is log-concave. We then show that any G that satisfies x " ȳ with probability 1 is a local extremum, and since the objective is log-concave it follows that it is the global maximum. We continue by showing that given G ˚, the proposed D ˚is optimal. To do so, we first find the distribution of G ˚'s attack sample using the Woodbury matrix identity, and then show that D ˚is indeed the optimal decision rule. Finally, using the max-min inequality, this implies that pD ˚, G ˚q satisfy Eq. 4.1.

There are several interesting observations about the above optimal strategies. Perhaps the most intuitive strategy for the attacker would have been to sample n elements from a Gaussian with mean Ȳ and the known covariance Σ. In expectation, this sample would have the correct mean. However, this turns out to be sub-optimal, as can be seen in Figures 1c and 6 (we refer to this as an ML attack. See Sec. F.4 in the appendix for the derivation and visualizations). Instead, the optimal attacker begins by drawing an IID sample W from a Gaussian distribution with mean 0, and then "forces" the sample mean to be exactly Ȳ by shifting the sample points by Ȳ ´W . This optimal attacker strategy can be viewed as matching the sufficient statistics of the leaked sample Y in the generated sample X. The optimal authenticator is a MAP test for the optimal attacker, as in Theorem 4.1.

As a corollary to Theorem 4.2 we obtain the value of the game (i.e., the accuracy of D ˚). Corollary 4.3. Define δ and ρ as in Theorem 4.2. Then the game value for the Gaussian case is:

1 2 `1 2Γp d 2 q " γ ˆd 2 , dp1 `ρq 2p1 ´δq log 1 `ρ δ `ρ ˙´γ ˆd 2 , dpδ `ρq 2p1 ´δq log 1 `ρ δ `ρ ˙ (4.4)

Where γ is the lower incomplete Gamma function, and Γ is the Gamma function.

The proof (see Sec. F) follows by showing that the test statistic used by D ˚is Gamma distributed. Fig. 1 demonstrates several interesting aspects of the above results. First, Fig. 1a shows that the authenticator accuracy improves as n (the size of the test sample) grows. Furthermore, accuracy also improves as the dimension d grows, meaning that for a specified authentication accuracy, the required ratio n{m becomes smaller with the dimension d. This is a very encouraging result since although this dimensional dependency is proved only for Gaussian sources, it suggests that for realworld high-dimensional sources (e.g., faces, video, voice, etc.) the authenticator can achieve high accuracy even when requiring a small (and practical) authentication sample.

Intuitively it may seem like authentication is impossible when the authenticator has less data than the attacker (i.e., m ą k). Surprisingly, this is not the case. As can be seen in Fig. 1b , even when m ą k, the authenticator can achieve non trivial accuracy.4 An intuitive explanation of this phenomenon is that the test statistic used by the authenticator is › › X ´Ā › › , which, due to the variance in the attacker estimation, has higher variance when X is generated by an attacker than when X is generated by the true source. This, in turn, allows the authenticator to discriminate between the hypotheses.

A closed-form solution for the general case remains an open problem. We believe that solving for Gaussians is an important step forward, since it exposes interesting structural properties of the solution, which we use in practice. Furthermore, if G has an encoder-decoder structure, it is not unreasonable that the source distribution in latent space can be approximately Gaussian (as in VAE).

5. GAN IN THE MIDDLE NETWORKS:

So far we explored the general formalism of authentication games. Here we consider specific architectures for D and G. As in GAN based models (Mirza & Osindero, 2014; Mescheder et al., 2018; Karras et al., 2018a; b) , we use neural nets to model these, while using insights from our theoretical analysis. Below we provide implementation details for the GIM model (see Sec. H and code for more details). In our analysis, we considered the non-differentiable zero-one loss since it is the real accuracy measure. In practice, we will use cross-entropy as used in most GAN approaches. Authenticator Architecture: The authenticator is implemented as a neural network Dpa, xq that maps from a source information sample a P X k and a test sample x P X n to a probability that the test sample came from the true source. Our framework does not restrict the authenticator to any specific function type, but in practice one must implement it using some model. We recall that our theoretical results do suggest a certain functional form. The Gaussian results in Sec. 4.3 show that the optimal authenticator is a test on the sufficient statistic of the source parameters. Motivated by this result, and in the spirit of Siamese networks (Koch et al., 2015; Chopra et al., 2005) , we consider the following form for the authenticator. We define a function T D that maps a sample to a fixed sized vector, analogous to the sufficient statistic in the theorem. We apply T D to both a and x. Then, these two outputs are used as input to a comparison function σ which outputs a scalar reflecting their similarity. Thus the authenticator can be expressed as: Dpa, xq " σpT D paq, T D pxqq. Attacker Architecture: The attacker is implemented as a stochastic neural network Gpyq that maps a leaked sample y P X m to an attack sample x P X n . Our theoretical results suggest a certain functional form for this network. The Gaussian analysis in Sec. 4.3 shows that the optimal attacker generates a sample whose sufficient statistic matches that of the leaked sample. Motivated by this result, we consider the following functional form for the attacker. First, it applies a function T G that maps the leaked sample Y to a fixed sized vector T G pY q, analogous to the sufficient statistic in the theorem. It then draws n random latent vectors W 1 , . . . , W n and matches their mean to the leaked sufficient statistic to obtain the latent vectors W 1 i . Namely it sets W 1 i " W i ´W `TG pY q as done in Theorem 4.2. Finally, it uses a decoder function ϕ that maps each latent vector W 1 i to the domain X . Thus, the attacker can be expressed as: GpY q i " ϕpW i ´W `TG pY qq @i P rns. Optimization Details: Each iteration begins when a source θ is chosen randomly from the set of sources in the training dataset (e.g., a person to be authenticated). Samples A, Y, X θ are drawn from the set of examples available for θ, where X θ represents a test sample from θ. Then, given a leaked sample Y , the generator G generates a fake sample X G , passes it to D and suffers the appropriate loss. Finally, D receives as input the source information sample A, outputs a prediction for each of the test samples X θ , X G , and suffers the appropriate loss. Optimization is done via gradient ascent on authenticator parameters and descent on attacker parameters, as is typical for GAN problems.

6. EXPERIMENTS:

We next evaluate our method empirically. In all experiments, we use the model described in Sec. 5. We optimize the model with adversarial training, using the loss suggested by Mescheder et al. (2018) and Adam (Kingma & Ba, 2015) . Our implementation is available at https://github.com/ roymor1/OptimalStrategiesAgainstGenerativeAttacks. Also, see Sec. H for further implementation details. Gaussian sources: For the case of Gaussian sources, we arrived at a complete characterization of the solution in Sec. 4.3. Thus, we can learn the models using our GIM algorithm and check whether it finds the correct solution. This is important, as the GIM objective is clearly non-convex and GANs are generally hard to train in practice and lack convergence guarantees (Mescheder et al., 2018) . We ran all experiments using a multivariate Gaussian with Σ " I d , and in each game the source mean was drawn from the prior distribution Q " N p0, 10I d q. This approximates the improper uniform prior since the prior has much larger variance than the sources. Fig. 1a shows the empirical game value compared with the theoretical one as a function of the test sample size n, for fixed m " 1, k " 10, and different values of d. It can be seen that there is an excellent fit between theory and experiment. Authentication on Faces and Characters: We next evaluate GIM in an authentication setting on two datasets: the VoxCeleb2 faces dataset (Nagrani et al., 2017; Chung & Zisserman, 2018) , and the Omniglot handwritten character dataset (Lake et al., 2015) . Additional information about the datasets, splits, and modeling details is provided in Sections G and H. Our goal is to check whether the GIM authenticator is more robust to generative attacks than a state of the art authentication system. To evaluate this, we consider several attackers: 1) A "random source" attacker (RS): a naive attacker that ignores the leaked sample Y . It simply draws a random source from the dataset, and samples n real images of that source. From the authenticator's perspective, it's equivalent to a sample version of the verification task (Koch et al., 2015; Schroff et al., 2015; Deng et al., 2018) , in which an agent is presented with a pair of real images and needs to decide whether they are from the same source or not. 2) Replay attacker (Replay): an attacker which, upon seeing a leaked sample Y , draws n random images of the leaked sample (with replacement). 3) A GIM attack, which is the "worst case" attacker G, learned by our GIM model.

For VoxCeleb we compare the GIM authenticator to the ArcFace method (Deng et al., 2018) , which is currently state of the art in face verification. As a baseline for Omniglot, we use the Siamese network suggested by Koch et al. (2015) , which achieves state of the art in the verification task on Omniglot. Results are shown in Table 1 . It can be seen that on average across attacks, GIM outperforms the baselines. The only attack for which GIM is inferior is RS. This is not surprising as this is the objective that both baselines are trained for.

Qualitative evaluation of attacker: In Fig. 2 we provide images generated by the GIM attacker for the test set of both Omniglot and Voxceleb. The images demonstrate qualitatively the strategy learned by the attacker. In the Voxceleb2 dataset, face images are drawn from a video of the person talking. Note that as in real samples from the data, the attack sample varies in pose and expression and not in the background or clothing. Data augmentation: Finally, we use GIM for data augmentation in one-shot classification on Omniglot. This is done by using the GIM attacker to generate more data for a given class. We first train GIM on the training set with parameters m " 1, n " 5, k " 5. Then, during both training and testing of one-shot classification, given an example, we use the attacker to augment the single example available for each of the classes, by adding to it the n " 5 examples our attacker generated from it. We use Prototypical Nets (Snell et al., 2017) as the baseline model. We find that without using our augmentation method, Prototypical Nets achieve 95.9% accuracy on the test split, and with our method, they achieve 96.5%, which is similar to the improvement achieved by Antoniou et al. (2018) with Matching networks (Vinyals et al., 2016) as the few-shot classification algorithm.

7. CONCLUSIONS:

We defined the notion of authentication in the face of generative attacks, in which a generative model attempts to produce a fake reality based on observations of reality. These attacks raise numerous interesting theoretical questions and are very important and timely from a practical standpoint. We proposed to study generative attacks as a two-person zero-sum game between attacker and authenticator. In our most general setup both attacker and authenticator have access to a finite set of observations of the source. We show that this game has a Nash equilibrium, and we characterize the optimal strategies. In the Gaussian version of the game, a closed form of the optimal strategies is available. A nice outcome of the analysis is that the game value depends on m, n, k only through their ratios δ " m{n (i.e., the "expansion ratio" between attack and leaked sample sizes) and ρ " m{k (i.e., the "information ratio" between the number of source observations available to attacker and authenticator). As we show in Fig. 1b , there is a large range of values for which high accuracy authentication is possible, and as d grows we observe that the high authentication accuracy region in the pδ, ρq plane grows sharply. We introduce the GIM model, which is a practical approach to learning both authenticator and attacker, and whose structure is inspired by our analysis. GIM achieves accuracy that is very close to the theoretical rates in the Gaussian case, and is also more robust to attacks when compared to state of the art authenticators on real data. Many theoretical and practical questions remain. For example, finding closed form optimal strategies for other distributions, and going beyond IID generation. The non IID setting is of particular importance for the problem of fake video (Thies et al., 2016) and audio (Arik et al., 2018) generation, which we intend to study in the future.

A INTRODUCTION TO THE APPENDIX:

Here we provide additional information and proofs for the main paper. In Sec. B we provide a visualization of the game setting. In Sec. C we plot the game value in the Gaussian case for different parameter values. In Sec. D we provide a proof for Theorem 4.1, in Sec. E we formally state the theorem discussed in Sec. 4.2 and prove it, and in Sec. F we prove Theorem 4.2 and also derive the game value for the sub-optimal "ML attacker". Finally, in Sections G, H we provide additional details about the experiments and the implementation of GIM.

B PROBLEM SETUP VISUALIZATION:

Our problem setup is illustrated in Fig. 3 for a face authentication scenario. A source θ (in this case an individual) generates IID observations (images). k images are used by the authenticator to study the source which it aims to authenticate. m images are "leaked" and obtained by an attacker who wishes to impersonate the source and pass the authentication. At test time the authenticator is presented with n images that were generated either by the true source θ, or by the attacker, and decides whether the entity that generated the images was the source θ or an attacker.

Figure 3 : An illustration of the game described in the main text. An authenticator receives a sample of n images and needs to decide whether these were generated by a known source, or by an adversary that had access to leaked images. In order to decide, the authenticator is supplied with a sample of k images from the real source.

C GAME VALUE VISUALIZATIONS:

In corollary 4.3 we provide the game value (the expected authenticator accuracy) for the case of multivariate Gaussian sources. In this section, we present additional visualizations of the game value as a function of the different parameters of the game. Fig. 4 visualizes the game value as a function of δ and ρ, for different values of d (the observation dimension). δ " m n is the "expansion ratio" between the source information available to the attacker through the leaked sample and the size of the attacker's attack sample. ρ " m k is the "information ratio" between the number of source observations available to attacker and authenticator. One can clearly see that as d, the observation dimension, grows large, so does the accuracy of the authenticator. Even for δ values higher than 0.5, and ρ values which intuitively would give the attacker an advantage (e.g., m k " 10). Where " n k is the "information expansion" of the attacker with respect to the authenticator source information. Again, one can clearly see that as d, the observation dimension, grows large, so does the accuracy of the authenticator. 

Q Θ|A pθ|aq " Qpθqf pkq θ paq ş νPH Qpνqf pkq ν paqdν " Qpθqf pkq θ paq f A paq

Also, let f Y |A , f X|A , g X|A , denote the conditional densities defined by:

f Y |A py|aq " ż θPH f pmq θ pyqQ Θ|A pθ|aqdθ f X|A px|aq " ż θPH f pnq θ pxqQ Θ|A pθ|aqdθ g X|A px|aq " ż yPX m g X|Y px|yqf Y |A py|aqdy

Lemma D.1. Let G be an attacker defined by the conditional probability distribution g X|Y . Then @a P X k , x P X n a best response strategy for D is:

Dpa, xq " Irf X|A px|aq ą g X|A px|aqs (D.1)

Proof. Given an attacker strategy g X|Y , the objective for D is given by:

argmax D E Θ"Q V pΘ, D, Gq " argmax D E Θ"Q E A"f pkq Θ " E X"f pnq Θ rDpA, Xqs `EY "f pmq Θ E X"g X|Y p¨|Y q r1 ´DpA, Xqs ı " argmax D E A"f A " E X"f X|A p¨|Aq rDpA, Xqs `EY "f Y |A p¨|Aq E X"g X|Y p¨|Y q r1 ´DpA, Xqs ı " argmax D ż aPX k f A paq ż xPX n " f X|A px|aqDpa, xq `gX|A px|aqr1 ´Dpa, xqs ‰ dxda

Note that D can be optimized independently for each pair a, x P X k ˆX n . Hence, @a, x P X k ˆX n the objective is:

argmax Dpa,xqPt0,1u

f X|A px|aqDpa, xq `gX|A px|aqr1 ´Dpa, xqs ( And thus, the optimal decision rule for D is:

Dpa, xq " I " f X|A px|aq ą g X|A px|aq ‰

As required.

Lemma D.2. @a, x P X k ˆX n let the strategy for D be defined by:

Dpa, xq " I " f X|A px|aq ą g X|A px|aq ‰

Then G ˚is a best response strategy for G, iff it minimizes the 1 distance between the distributions f X|A , g X|A over the space X k ˆX n . Namely:

g X|Y P argmin g X|Y E A"f A ż xPX n ˇˇf X|A px|Aq ´gX|A px|Aq ˇˇdx (D.2)

Proof. Let D be defined as in Eq. D.1, the objective for G is: and let G ˚be the corresponding map from X m to the set of probability distributions over X n . Consider the authenticator defined by:

argmin G 1 2 E Θ"Q V pΘ, D, Gq " argmin g X|Y E Θ"Q E A"f pkq Θ " E X"f pnq Θ rDpA, Xqs `EY "f pmq Θ E X"g X|Y p¨|Y q r1 ´DpA, Xqs ı " argmin g X|Y E A"f A " E X"f X|A p¨|Aq rDpA,

D ˚pa, xq " I " f X|A px|aq ą g X|A px|aq ı (D.5)

where I is the indicator function. Then pD ˚, G ˚q is a solution of Eq. 2.2 that satisfies Eq. 4.1.

Proof. From Lemmas D.1, D.2 we have that max D V pD, G ˚q " V pD ˚, G ˚q " min G V pD ˚, Gq, from which it follows that Eq. 4.1 is satisfied and thus pD ˚, G ˚q is a solution of Eq. 2.2.

E THEOREM AND PROOF FOR SEC. 4.2

Theorem E.1. For all n ď m it holds that:

max DPD min GPG V pD, Gq " 0.5

Proof. Consider the attacker G replay defined by the following generative process: Given a leaked sample Y P R mˆd , G replay generates a sample X P R nˆd such that X i " Y i @i P rns. (this is possible since we assumed n ď m). Namely, we have:

g X|Y px|yq " n ź i"1 δpx i ´yi q

Where δ is the Dirac delta. Thus @a, x P X k ˆX n : Define: D 0 pa, xq " 0 @a, x P X k ˆX n

g X|A px|aq "

Then according to Theorem 4.1 pD 0 , G replay q is a solution of Eq. 2.2 that satisfies Eq. 4.1, and therefore:

max DPD min GPG V pD, Gq "V pD 0 , G replay q " 1 2 E Θ"Q E A"f pkq θ E Y "f pmq θ " E X"f pnq θ rDpA, Xqs `EX"GpY q r1 ´DpA, Xqs ı " 1 2 E Θ"Q E A"f pkq θ E Y "f pmq θ " E X"f pnq θ r0s `EX"GpY q r1s ı " 1 2

As required.

F ADDITIONAL THEOREMS AND PROOFS FOR SEC. 4.3

F.1 NOTATION AND DEFINITIONS:

In this section, we consider the case where the sources are d-dimensional Gaussian vectors with a known covariance matrix Σ " CC T P R dˆd and unknown mean vector θ P R d . That is, the set of possible sources is H " R d and given θ P H the associated probability density over the domain

X " R d is f θ pxq " 1 ? p2πq d | detpΣq| exp p´1 2 px ´θq T Σ ´1px ´θqq

A sample of n examples x P X n is considered a matrix x P R nˆd , where the first index represents the sample and the second represents the observation space, R d . I.e., x ij P R is the j'th element of the i'th example in the sample x P R nˆd .

We continue with a few more notations that simplify the proofs. Given a matrix x P R nˆd , we let x c " "

x T 1 , . . . , x T n ‰ T P R nd be the concatenation vector representing x. Given a vector θ P R d , we let θ c,n " " θ T , . . . , θ T ‰ T P R nd be the concatenation of n copies of θ. Given a matrix x P R nˆd , we let x " 1 n ř n i"1 x i P R d denote its mean along the sample dimension. For any matrix B P R dˆd , we denote: Finally, we define strategies for both attacker and authenticator, which we prove in what follows to be the optimal strategies for the game. Definition F.1. Let G ˚denote an attacker defined by the following generative process: Given a leaked sample Y P R mˆd , G ˚generates an attack sample X P R nˆd as follows. It first samples n vectors W 1 , . . . , W n iid " N p0, Σq and then sets:

X i " W i ´W `Ȳ (F.1)

Also, let g X|Y denote its associated conditional probability.

Definition F.2. For any α P R `, let D α denote an authenticator defined as:

D α pa, xq " I " }x ´ā} 2 Σ ´1 ă α ı

Where I is the indicator function

F.2 TECHNICAL LEMMAS Lemma F.3. Let X 1 , . . . , X k iid " N pµ, Σq Where µ P R d , Σ P R dˆd . Then X " 1 k k ÿ j"1 X j " N pµ, 1 k Σq

Proof. We begin by observing that X c " N pµ c,k , diagpΣ, kqq. Let B " 1 k rI d ¨¨¨I d s P R dˆkd and observe that X " BX c . Therefore, since this is an affine transformation of a Gaussian vector we have:

X " N pBµ c,k , BdiagpΣ, kqB T q " N pµ, 1 k Σq

As required.

Lemma F.4. Let X P R d be a Gaussian vector s.t X " N pµ, Σq, and let X c,n P R nd be the concatenation of n copies of X. Then:

X c,n " N pµ c,n , reppΣ, nqq Proof. Let B " » - - I d . . . I d fi ffi fl P R ndˆd

and observe that X c,n " BX. Therefore, since this is an affine transformation of a Gaussian vector we have:

X c,n " N pBµ, BΣB T q " N pµ c,n , reppΣ, nqq

As required.

Lemma F.5. Let θ P R d , Σ P R dˆd represent the mean and covariance of a Gaussian distribution. Let X P R nˆd be a random sample generated by the attacker defined in Def. F.1. Then: 

X c " N pθ c,

Z "N p " 0 nd θ c,n  , " diagpΣ, nq 0 0 1 m reppΣ, nq  q

Note that X c " W c ´W c,n `Ȳ c,n " BZ and therefore we get:

X c " N pB " 0 nd θ c,n  , B " diagpΣ, nq 0 0 1 m reppΣ, nq  B T q " N ˆθc,n , diag pΣ, nq `rep ˆp n ´m mn qΣ, n ˙Ȧs required.

Lemma F.6. Let Σ " CC T P R dˆd represent the covariance of a Gaussian distribution, and consider the following covariance matrix:

Ψ " diagpΣ, nq `reppp n ´m mn qΣ, nq

Then its inverse is:

Ψ ´1 " diagpΣ ´1, nq ´n ´m n 2 reppΣ ´1, nq

and the determinant is:

detpΨq " ´n m ¯d detpΣq n

Proof. We begin by defining the following block matrices:

U " » - - Σ . . . Σ fi ffi fl P R ndˆd (F.2) V " p n ´m mn q » - - I d . . . I d fi ffi fl P R ndˆd (F.3)

and note that reppp n´m mn qΣ, nq " U V T . Then:

Ψ ´1 "pdiagpΣ, nq `reppp n ´m mn qΣ, nqq ´1 "pdiagpΣ, nq `U V T q ´1 piq "diagpΣ, nq ´1 ´diagpΣ, nq ´1U pI d `V T diagpΣ, nq ´1U q ´1V T diagpΣ, nq ´1 piiq " diagpΣ ´1, nq ´diagpΣ ´1, nqU pI d `V T diagpΣ ´1, nqU q ´1V T diagpΣ ´1, nq "diagpΣ ´1, nq

´» --

I d . . . I d fi ffi fl pI d `n ´m nm rI d ¨¨¨I d s » - - I d . . . I d fi ffi flq ´1 n ´m nm " Σ ´1 ¨¨¨Σ ´1‰ "diagpΣ ´1, nq

´» --

I d . . . I d fi ffi fl m n I d n ´m nm " Σ ´1 ¨¨¨Σ ´1‰ "diagpΣ ´1, nq ´n ´m n 2 » - - I d . . . I d fi ffi fl " Σ ´1 ¨¨¨Σ ´1‰ "diagpΣ ´1, nq ´n ´m n 2 reppΣ ´1, nq

As required. Where in piq we used the Woodbury matrix identity, and in piiq we used the inverse of a diagonal block matrix.

Next, we turn to find the determinant of Ψ:

detpΨq "detpdiagpΣ, nq `reppp n ´m mn qΣ, nqq

"detpdiagpΣ, nq `U V T q piiiq " detpdiagpΣ, nqqdetpI d `V T diagpΣ, nq ´1U q pivq " detpΣq n detpI d `V T diagpΣ ´1, nqU q "detpΣq n detpI d `n ´m nm rI d ¨¨¨I d s diagpΣ ´1, nq » - - Σ . . . Σ fi ffi flq "detpΣq n detpI d `n ´m m I d q "detpΣq n ´n m ¯d

Where in piiiq we used the matrix determinant lemma, and in pivq we used the determinant of a diagonal block matrix.

Lemma F.7. Let hpx, µq " expt´1 2σ 2 px ´µq T Σ ´1px ´µquI

" x T Σ ´1x ă α ‰ @px, µq P R d ˆRd

and define the function:

ψpµq " ż xPR d dx hpx, µq

Then ψpµq is log-concave over the space R d .

Proof. We begin by noting that the function px´µq T Σ ´1px ´µq is convex w.r.t both x and µ, hence its negative is concave, and thus, by definition the function:

expt´1 2σ 2 px ´µq T Σ ´1px ´µqu (F.4)

is log-concave w.r.t x, µ. We now show that hpx, µq is log-concave w.r.t both x and µ. First, w.r.t µ.

Let β P r0, 1s, µ 1 , µ 2 P R d , and observe that:

hpx, βµ 1 `p1 ´βqµ 2 q " expt´1 2σ 2 px ´βµ 1 ´p1 ´βqµ 2 q T Σ ´1px ´βµ 1 ´p1 ´βqµ 2 quIrx T Σ ´1x ă αs piq ě expt´β 2σ 2 px ´µ1 q T Σ ´1px ´µ1 qu expt´p 1 ´βq 2σ 2 px ´µ2 q T Σ ´1px ´µ2 qu Irx T Σ ´1x ă αs piiq " expt´β 2σ 2 px ´µ1 q T Σ ´1px ´µ1 qu expt´p 1 ´βq 2σ 2 px ´µ2 q T Σ ´1px ´µ2 qu pIrx T Σ ´1x ă αsq β pIrx T Σ ´1x ă αsq p1´βq "hpx, µ 1 q β hpx, µ 2 q p1´βq

Therefore hpx, µq is log-concave w.r.t µ. Where in piq we used the log-concavity of the function in Eq. F.4, and in piiq we used the fact that Irx T Σ ´1x ă αs P t0, 1u. Now, w.r.t x. Let β P r0, 1s, x 1 , x 2 P R d . Observe that for any convex function q we have:

I rqpx 1 q ă αs β I rqpx 2 q ă αs p1´βq piq "I rqpx 1 q ă αs I rqpx 2 q ă αs "I rqpx 1 q ă α ^qpx 2 q ă αs piiq ď I rβqpx 1 q `p1 ´βqqpx 2 q ă αs piiiq ď I rqpβx 1 `p1 ´βqx 2 q ă αs Therefore Irx T Σ ´1x ă αs is log-concave. Where in piq we used the fact that Irqpxq ă αs P t0, 1u, in piiq we used the fact that qpx 1 q ă α ^qpx 2 q ă α ñ βqpx 1 q `p1 ´βqqpx 2 q ă α, and in piiiq we used the convexity of q. Hence, observing hpx, µq we have:

hpβx 1 `p1 ´βqx 2 , µq " expt´1 2σ 2 pβx 1 `p1 ´βqx 2 ´µq T Σ ´1pβx 1 `p1 ´βqx 2 ´µqu I " pβx 1 `p1 ´βqx 2 q T Σ ´1pβx 1 `p1 ´βqx 2 q ă α ‰ pivq ě expt´β 2σ 2 px 1 ´µq T Σ ´1px 1 ´µqu expt´p 1 ´βq 2σ 2 px 2 ´µq T Σ ´1px 2 ´µqu I " pβx 1 `p1 ´βqx 2 q T Σ ´1pβx 1 `p1 ´βqx 2 q ă α ‰ pvq ě expt´β 2σ 2 px ´µ1 q T Σ ´1px ´µ1 qu expt´p 1 ´βq 2σ 2 px ´µ2 q T Σ ´1px ´µ2 qu pI " x T 1 Σ ´1x 1 ă α ‰ q β pI " x T 2 Σ ´1x 2 ă α ‰ q p1´βq

"hpx 1 , µq β hpx 2 , µq p1´βq Therefore hpx, µq is log-concave w.r.t x. Where in pivq we used the log-concavity of the function in Eq. F.4, and in pvq we used the log-concavity of Irx T Σ ´1x ă αs.

Finally, by using Prekopa-Leindler inequality (Prékopa, 1973) we have that ψpµq is log-concave, as required.

F.3 PROOF OF THEOREM 4.2:

Lemma F.8. Consider the attacker G ˚, defined in Def. F.1. The best response strategy for the authenticator against this attacker is:

D ˚pa, xq " I " }x ´ā} 2 Σ ´1 ă α ˚ı Where: α ˚" dpm `kqpn `kq k 2 pn ´mq log npm `kq mpn `kq

Proof. The best response authenticator satisfies:

D ˚P argmax DPD V pD, Gq " argmax DPD 1 2 E Θ"Q E A"f pkq Θ E Y "f pmq Θ rE X"f pnq Θ rDpA, Xqs `EX"g X|Y p¨|Y q r1 ´DpA, Xqss " argmax DPD E Θ"Q E A"f pkq Θ rE X"f pnq Θ rDpA, Xqs `EX"g X|Θ p¨|Θq r1 ´DpA, Xqss F.5 " argmax DPD E Θ"Q E A"N pΘ c,k ,diagpΣ,kqq " E X"N pΘc,n,diagpΣ,nqq rDpA, Xqs `EX"N pθc,n,Ψq r1 ´DpA, Xqs ‰ F.6 " argmax DPD E Θ"Q ż aPR kd da ż xPR nd dx expt´1 2 pa ´Θc,k q T diagpΣ, kq ´1pa ´Θc,k qur expt´1 2 px ´Θc,n q T diagpΣ, nq ´1px ´Θc,n quDpa, xqd 1 p n m q d expt´1 2 px ´Θc,n q T Ψ ´1px ´Θc,n qur1 ´Dpa, xqss

D can be chosen independently for each pair pa, xq P X k ˆX n . Therefore, for any pa, xq P X k ˆX n the decision rule for Dpa, xq " 1 is:

c p n m q d ż θPR d dθQpθq expt´1 2 rpx ´θc,n q T diagpΣ, nq ´1px ´θc,n qp a ´θc,k q T diagpΣ, kq ´1pa ´θc,k qsu ą ż θPR d

dθQpθq expt´1 2 rpx ´θc,n q T Ψ ´1px ´θc,n q `pa ´θc,k q T diagpΣ, kq ´1pa ´θc,k qsu

Observing the LHS integral and using the improper uniform prior assumption we have:

ż θPR d dθQpθq expt´1 2 rpx ´θc,n q T diagpΣ ´1, nqpx ´θc,n qp a ´θc,k q T diagpΣ ´1, kqpa ´θc,k qsu " ż θPR d dθ expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´2θ T Σ ´1pnx `kāq `pn `kqθ T Σ ´1θsu " expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´pn `kqp nx `kā n `k q T Σ ´1p nx `kā n `k qsu ż θPR d dθ expt´n `k 2 rpθ ´nx `kā n `k q T Σ ´1pθ ´nx `kā n `k qsu " expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´pn `kqp nx `kā n `k q T Σ ´1p nx `kā n `k qsu c p 2π n

`k q d detpΣq Observing the RHS and using the improper uniform prior assumption we have:

ż θPR d dθQpθq expt´1 2 rpx ´θc,n q T Ψ ´1px ´θc,n q `pa ´θc,k q T diagpΣ ´1, kqpa ´θc,k qsu " ż θPR d

dθ expt´1 2 rpx ´θc,n q T Ψ ´1px ´θc,n q `pa ´θc,k q T diagpΣ ´1, kqpa ´θc,k qsu

F.6 " ż θPR d dθ expt´1 2 rpx ´θc,n q T pdiagpΣ ´1, nq ´n ´m n 2 reppΣ ´1, nqqpx ´θc,n qp a ´θc,k q T diagpΣ ´1, kqpa ´θc,k qsu " ż θPR d dθ expt´1 2 r n ÿ i"1 px i ´θq T Σ ´1px i ´θq `k ÿ j"1 pa j ´θq T Σ ´1pa j ´θqń ´m n 2 n ÿ i"1 n ÿ j"1 px i ´θq T Σ ´1px j ´θqsu " ż θPR d dθ expt´1 2 r n ÿ i"1 px i ´θq T Σ ´1px i ´θq `k ÿ j"1 pa j ´θq T Σ ´1pa j ´θqṕ n ´mqpx ´θq T Σ ´1px ´θqsu " ż θPR d dθ expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´pn ´mqx T Σ ´1 xp m `kqθ T Σ ´1θ ´2θ T Σ ´1pmx `kāqsu " expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´pn ´mqx T Σ ´1 xṕ m `kqp mx `kā m `k q T Σ ´1p mx `kā m `k qsu ż θPR d dθ expt´m `k 2 rpθ ´mx `kā m `k q T Σ ´1pθ ´mx `kā m `k qsu " c p 2π m `k q d detpΣq expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´pn ´mqx T Σ ´1 xṕ m `kqp mx `kā m `k q T Σ ´1p mx `kā m `k qsu Therefore the decision rule is c p n m q d expt 1 2 rpn `kqp nx `kā n `k q T Σ ´1p nx `kā n `k qsu c p 2π n `k q d ą expt 1 2 rpn ´mqx T Σ ´1 x `pm `kqp mx `kā m `k q T Σ ´1p mx `kā m `k qsu c p 2π m `k q d ô d p npm `kq mpn `kq q d expt 1 2 rpn `kqp nx `kā n `k q T Σ ´1p nx `kā n `k qsu ą expt 1 2 rpn ´mqx T Σ ´1 x `pm `kqp mx `kā m `k q T Σ ´1p mx `kā m `k qsu ôd log npm `kq mpn `kq ą pn ´mqx T Σ ´1 x `pm `kqp mx `kā m `k q T Σ ´1p mx `kā m `k qṕ n `kqp nx `kā n `k q T Σ ´1p nx `kā n `k q ôdpm `kqpn `kq log npm `kq mpn `kq ą k 2 pn ´mqx T Σ ´1 x ´2k 2 pn ´mqx T Σ ´1ā `k2 pn ´mqā T Σ ´1ā ô dpm `kqpn `kq k 2 pn ´mq log npm `kq mpn `kq ą px ´āq T Σ ´1px ´āq

As required.

Lemma F.9. Consider the authenticator D α , as defined in Def. F.2. Then any attacker G, represented by a conditional probability g X|Y , that satisfies the condition x " ȳ for any leaked sample y P R mˆd and attacker generated sample x P tR nˆd : g X|Y px|yq ą 0u, satisfies:

G P argmin G 1 PG V pD α , G 1 q @α P R 23

Published as a conference paper at ICLR 2020

Proof. The best response attacker satisfies:

g 1 X|Y P argmin g X|Y 1 2 E Θ"Q E A"f pkq Θ E Y "f pmq Θ rE X"f pnq Θ rD α pA, Xqs `EX"g X|Y p¨|Y q r1 ´Dα pA, Xqss " argmin g X|Y E Θ"Q E A"f pkq Θ E Y "f pmq Θ E X"g X|Y p¨|Y q r1 ´Dα pA, Xqs " argmax g X|Y E Θ"Q E A"f pkq Θ E Y "f pmq Θ E X"g X|Y p¨|Y q rD α pA, Xqs " argmax g X|Y E Θ"Q E A iid "N pΘ,Σq E Y iid "N pΘ,Σq E X"g X|Y p¨|Y q " I " › › X ´Ā › › 2 Σ ´1 ă α ıı Lemma F.3 " argmax g X|Y E Θ"Q E Ā"N pΘ, 1 k Σq E Y iid "N pΘ,Σq E X"g X|Y p¨|Y q " I " › › X ´Ā › › 2 Σ ´1 ă α ıı " argmax g X|Y ż yPR mˆd dy ż xPR nˆd dxg X|Y px|yq ż āPR d dāI " }x ´ā} 2 Σ ´1 ă α ı ż θPR d dθQpθq expt´k 2 pā ´θq T Σ ´1pā ´θqu expt´1 2 m ÿ j"1 py j ´θq T Σ ´1py j ´θqu

Note that g X|Y px|yq can be chosen independently for each y P R mˆd . Thus, we can optimize it independently for each y P R mˆd and we have:

g 1 X|Y p¨|yq P argmax g X|Y p¨|yq ż xPR nˆd dxg X|Y px|yq ż āPR d dāI " }x ´ā} 2 Σ ´1 ă α ı ż θPR d dθQpθq expt´k 2 pā ´θq T Σ ´1pā ´θqu expt´1 2 m ÿ j"1 py j ´θq T Σ ´1py j ´θqu

Note that for any PDF f over R nˆd and a function ϕ : R nˆd Ñ R , it holds that ş xPR nˆd dxf pxqϕpxq ď sup x ϕpxq. Therefore, there exists a deterministic distribution g 1 X|Y px|yq " δpx ´x1 q that achieves the maximum. Thus, it's sufficient to find a vector x G that achieves the maximum:

x G P argmax x ż x 1 PR nˆd dx 1 δpx 1 ´xq ż āPR d dāI " › › x1 ´ā › › 2 Σ ´1 ă α ı ż θPR d dθQpθq expt´k 2 pā ´θq T Σ ´1pā ´θqu expt´1 2 m ÿ j"1 py j ´θq T Σ ´1py j ´θqu " argmax x ż āPR d dāI " }x ´ā} 2 Σ ´1 ă α ı ż θPR d dθQpθq expt´k 2 pā ´θq T Σ ´1pā ´θqu expt´1 2 m ÿ j"1 py j ´θq T Σ ´1py j ´θqu p˚q " argmax x ż āPR d dāI " }x ´ā} 2 Σ ´1 ă α ı ż θPR d dθ expt´1 2 rkpā ´θq T Σ ´1pā ´θq `m ÿ j"1 py j ´θq T Σ ´1py j ´θqsu " argmax x ż āPR d dā expt´1 2 rkā T Σ ´1āsuI " }x ´ā} 2 Σ ´1 ă α ı ż θPR d dθ expt´1 2 rpm `kqθ T Σ ´1θ ´2θ T Σ ´1pmȳ `kāqsu " argmax x ż āPR d dā expt´1 2 rkā T Σ ´1ā ´1 m `k pmȳ `kāq T Σ ´1pmȳ `kāqsu I " }x ´ā} 2 Σ ´1 ă α ı ż θPR d dθ expt´p m `kq 2 pθ ´mȳ `kā m `k q T Σ ´1pθ ´mȳ `kā m `k qu " argmax x ż āPR d dā expt´1 2 rkā T Σ ´1ā ´1 m `k pmȳ `kāq T Σ ´1pmȳ `kāqsu I " }x ´ā} 2 Σ ´1 ă α ı " argmax x ż āPR d dā expt´1 2 r mk m `k āT Σ ´1ā ´2mk m `k ȳT Σ ´1ā `mk m `k ȳT Σ ´1 ȳsu I " }x ´ā} 2 Σ ´1 ă α ı " argmax x ż āPR d dā expt´m k 2pm `kq rpā ´ȳq T Σ ´1pā ´ȳqsuI " }x ´ā} 2 Σ ´1 ă α ı

Where in p˚q we used the fact that Qpθq is the improper uniform prior. Note that the expression depends only on the mean x. Therefore, it's sufficient to find a mean vector x that maximizes the expression. We substitute the integration variable to ϕ " ā ´x and obtain:

xG P argmax x ż tϕPR d :ϕ T Σ ´1ϕăαu dϕ expt´m k 2pm `kq rpϕ `x ´ȳq T Σ ´1pϕ `x ´ȳqsu " argmax x ψpȳ ´xq " argmax x ψpµq

Where ψ is defined as in Lemma F.7 (with σ " m`k mk ), from which it follows that ψpµq is logconcave, and therefore has at most one local extremum which can only be a maximum. Therefore, it is sufficient to show that µ " 0 (i.e., x " ȳ) is a local extremum by equating the gradient at the point to 0.

B Bµ ψpµq " B Bµ ż tϕPR d :ϕ T Σ ´1ϕăαu dϕ expt´m k 2pm `kq rpϕ ´µq T Σ ´1pϕ ´µqsu " ´mk 2pm `kq ż tϕPR d :ϕ T Σ ´1ϕăαu dϕ expt´m k 2pm `kq rpϕ ´µq T Σ ´1pϕ ´µqsu B Bµ pϕ ´µq T Σ ´1pϕ ´µq " ´mk pm `kq ż tϕPR d :ϕ T Σ ´1ϕăαu dϕ expt´m k 2pm `kq rpϕ ´µq T Σ ´1pϕ ´µqsuΣ ´1pµ ´ϕq Therefore: B Bµ ψpµq| µ"0 " mk pm `kq ż tϕPR d :ϕ T Σ ´1ϕăαu dϕ expt´m k 2pm `kq rϕ T Σ ´1ϕsuΣ ´1ϕ

Note that since the domain of integration is symmetric about the origin with respect to negation and the integrand is odd with respect to the integration variable, the integral is equal to zero. I.e., B Bµ ψpµq| µ"0 " 0. Therefore, x " ȳ (µ " 0) achieves the global maximum, and any attacker that satisfies the condition: x " ȳ for any leaked sample y P R mˆd and attacker generated sample x P tR nˆd : g X|Y px|yq ą 0u satisfies:

G P argmin G 1 PG V pD α , G 1 q @α P R Às required.

Corollary F.10. Consider an authenticator D α , as defined in Def. F.2. Then the attacker G ˚, defined in Def. F.1, is a best response. i.e.:

G ˚P argmin G 1 PG V pD α , G 1 q @α P R Proof.

Directly from Lemma F.9

Theorem F.11. The game value is: Where γ is the lower incomplete gamma function.

max D min G V pD, Gq " min G max D V pD, Gq " V pD ˚, G ˚q " 1 2 `1 2Γp d 2 q rγp d 2 ,

Proof. From the max-min inequality we have:

max D min G V pD, Gq ď min G max D V pD, Gq

On the other hand, using Lemma F.8 and Corollary F.10 we have:

max D min G V pD, Gq ě min G V pD ˚, Gq F.10 " V pD ˚, G ˚q F.8 " max D V pD, G ˚q ě min G max D V pD, Gq Therefore: max D min G V pD, Gq " min G max D V pD, Gq " V pD ˚, G ˚q

The game value is given by:

V pD ˚, G ˚q "E Θ"Q V pΘ, D ˚, G ˚q " 1 2 E Θ"Q E A"f pkq Θ E Y "f pmq Θ " E X"f pnq Θ rD ˚pA, Xqs `EX"g X|Y p¨|Y q r1 ´D˚p A, Xqs ı " 1 2 E Θ"Q E A"f pkq Θ E Y "f pmq Θ " E X"f pnq Θ " Ir › › X ´Ā › › 2 Σ ´1 ă α ˚sı `EX"g X|Y p¨|Y q " 1 ´Ir › › X ´Ā › › 2 Σ ´1 ă α ˚sıı " 1 2 `1 2 E Θ"Q E A"f pkq Θ E X"f pnq Θ " Ir › › x ´Ā › › 2 Σ ´1 ă α ˚sı 1 2 E Θ"Q E A"f pkq Θ E X"g X|Θ p¨|Θq " Ir › › x ´Ā › › 2 Σ ´1 ă α ˚sı

Observing the first term we have:

1 2 E Θ"Q E A"f pkq Θ E X"f pnq Θ " Ir › › X ´Ā › › 2 Σ ´1 ă α ˚sı " 1 2 E Θ"Q E A"f pkq Θ E X"f pnq Θ " Irp X ´Āq T Σ ´1p X ´Āq ă α ˚s‰ " 1 2 E Θ"Q E A"f pkq Θ E X"f pnq Θ " Irp X ´Āq T pCC T q ´1p X ´Āq ă α ˚s‰ " 1 2 E Θ"Q E A"f pkq Θ E X"f pnq Θ " Irp X ´Āq T C ´T C ´1p X ´Āq ă α ˚s‰ " 1 2 E Θ"Q E A"f pkq Θ E X"f pnq Θ " IrpC ´1p X ´Āqq T pC ´1p X ´Āqq ă α ˚s‰ " 1 2 E Θ"Q E A"f pkq Θ E X"f pnq Θ " IrZ T Z ă α ˚s‰ "p˚q Observe that Z " C ´1p X ´Āq " C ´1rp X ´Θq ´p Ā ´Θqs " C ´1rI d , ´Id s " X ´Θ Ā ´Θ " rC ´1, ´C´1 s " X ´Θ Ā ´Θ Note that: " X ´Θ Ā ´Θ " N p0 2d , " 1 n Σ 0 dˆd 0 dˆd 1 k Σ  q Therefore: Z " N p0 d , rC ´1, ´C´1 s " 1 n Σ 0 dˆd 0 dˆd 1 k Σ  " C ´T ´C´T  q " N p0 d , p 1 n `1 k qC ´1ΣC ´T q " N p0 d , n `k nk C ´1C C T C ´T q " N p0 d , n `k nk I d q

We denote Z " b nk n`k Z " N p0 d , I d q, and thus Z1 , . . . , Zd are independent standard normal random variables and ZT Z " χ 2 pdq. Therefore, Z T Z " n`k nk ZT Z " Γpk " d 2 , θ " 2 n`k nk q and we have:

p˚q " 1 2 E Θ"Q E A"f pkq Θ E X"f pnq Θ " IrZ T Z ă α ˚s‰ " 1 2 E Θ"Q E Z T Z"Γpk" d 2 ,θ"2 n`k nk q " IrZ T Z ă α ˚s‰ piq " 1 2 E Θ"Q 1 Γp d 2 q γp d 2 , nkα 2pn `kq q " 1 2 1 Γp d 2 q γp d 2 , nkα 2pn `kq q

Where in piq We used the CDF of the Gamma distribution in which γ is the lower incomplete gamma function.

Similarly, observing the second term we have:

1 2 E Θ"Q E A"f pkq Θ E X"g X|Θ p¨|Θq " Ir › › X ´Ā › › 2 Σ ´1 ă α ˚sı " 1 2 E Θ"Q E A"f pkq Θ E X"g X|Θ p¨|Θq " IrV T V ă α ˚s‰ "p˚˚q

Where:

V " C ´1p X ´Āq " C ´1rp X ´Θq ´p Ā ´Θqs " C ´1rI d , ´Id s " X ´Θ Ā ´Θ " rC ´1, ´C´1 s " X ´Θ Ā ´Θ

Using the definition of G ˚(Definition F.1) and Lemma F.3 we have:

" X ´Θ Ā ´Θ " N p0 2d , " 1 m Σ 0 dˆd 0 dˆd 1 k Σ  q Therefore: V " N p0 d , rC ´1, ´C´1 s " 1 m Σ 0 dˆd 0 dˆd 1 k Σ  " C ´T ´C´T  q " N p0 d , m `k mk I d q

And similarly to the first term, we get:

V T V " Γpk " d 2 , θ " 2 m `k mk q

And thus:

EQUATION

`kq q:

Therefore, the game value is given by: " N p0, Σq, observe that X i " Ȳ `Wi @i P rns, and thus:

V pD ˚, G ˚q " 1 2 `1 2 1 Γp d 2 q rγp d 2 ,

X c " Ȳc,n `Wc

Where W c " N p0 ¨1dn , diagpΣ, nq. Using Lemma F.3 we have Ȳ " N pθ, 1 m Σq and using Lemma F.4 we have Ȳc,n " N pθ c,n , repp 1 m Σ, nqq.

Let Z " " W c Ȳc,n  and B " rI ndˆnd , I ndˆnd s, then X c " W c `Ȳ c,n " BZ. Note that:

Z " N p " 0 nd θ c,n  , " diagpΣ, nq 0 0 repp 1 m Σ, nq  q

and therefore we have:

X c "N pB " 0 nd θ c,n  , B " diagpΣ, nq 0 0 repp 1 m Σ, nq  B T q "N pθ c,n , diagpΣ, nq `repp 1 m Σ, nqq

As required.

Lemma F.14. Let Σ " CC T P R dˆd represent the covariance of a Gaussian distribution, and consider the following covariance matrix: Ψ M L " diagpΣ, nq `repp 1 m Σ, nq. Then: Therefore we have:

EQUATION

Ψ ´1 M L "pdiagpΣ, nq `repp 1 m Σ, nqq ´1 "pdiagpΣ, nq `U V T q ´1 piq "diagpΣ, nq ´1 ´diagpΣ, nq ´1U pI d `V T diagpΣ, nq ´1U q ´1V T diagpΣ, nq ´1 piiq " diagpΣ ´1, nq ´diagpΣ ´1, nqU pI d `V T diagpΣ ´1, nqU q ´1V T diagpΣ ´1, nq "diagpΣ ´1, nq

´» --

I d . . . I d fi ffi fl pI d `1 m rI d ¨¨¨I d s » - - I d . . . I d fi ffi flq ´1 1 m " Σ ´1 ¨¨¨Σ ´1‰ "diagpΣ ´1, nq

´» --

I d . . . I d fi ffi fl pI d `n m I d q ´1 1 m " Σ ´1 ¨¨¨Σ ´1‰ "diagpΣ ´1, nq

´» --

I d . . . I d fi ffi fl pp n `m m qI d q ´1 1 m " Σ ´1 ¨¨¨Σ ´1‰ "diagpΣ ´1, nq ´1 n `m » - - I d . . . I d fi ffi fl I d " Σ ´1 ¨¨¨Σ ´1‰ "diagpΣ ´1, nq ´1 n `m reppΣ ´1, nq

As required. Where in piq we used the Woodbury matrix identity, and in piiq we used the inverse of a diagonal block matrix.

Next, we turn to find the determinant of Ψ M L :

detpΨq " detpdiagpΣ, nq `reppp 1 m qΣ, nqq " detpdiagpΣ, nq `U V T q piiiq " detpdiagpΣ, nqq detpI d `V T diagpΣ, nq ´1U q pivq " detpΣq n detpI d `V T diagpΣ ´1, nqU q " detpΣq n detpI d `1 m rI d ¨¨¨I d s diagpΣ ´1, nq » - - Σ . . . Σ fi ffi flq " detpΣq n detpp n `m m qI d q " detpΣq n p n `m m q d

Where in piiiq we used the matrix determinant lemma, and in pivq we used the determinant of a diagonal block matrix.

Lemma F.15. Consider the attacker G M L , defined in F.12. The best response strategy for the authenticator against this attacker is:

EQUATION

Where:

α M L " dpn `kqpnm `nk `mkq k 2 n 2 logp nm `nk `mk mpn `kq q

Proof. The best response authenticator satisfies:

D ˚P argmax DPD V pD, G M L q " argmax DPD 1 2 E Θ"Q E A"f pkq Θ E Y "f pmq Θ " E X"f pnq Θ rDpA, Xqs `EX"g M L X|Y p¨|Y q r1 ´DpA, Xqs ı " argmax DPD E Θ"Q E A"f pkq Θ " E X"f pnq Θ rDpA, Xqs `EX"g M L X|Θ p¨|Θq r1 ´DpA, Xqs ı Lemma F.13 " argmax DPD E Θ"Q E A"N pΘ c,k ,diagpΣ,kqq " E X"N pΘc,n,diagpΣ,nqq rDpA, Xqs `EX"N pθc,n,Ψ M L q r1 ´DpA, Xqs ‰ " argmax DPD E Θ"Q ż aPR kd da ż xPR nd dx expt´1 2 pa ´Θc,k q T diagpΣ, kq ´1pa ´Θc,k qu r d 1 |detpdiagpΣ, nqq| expt´1 2 px ´Θc,n q T diagpΣ, nq ´1px ´Θc,n quDpa, xqd 1 |detpΨ M L q| expt´1 2 px ´Θc,n q T Ψ ´1 M L px ´Θc,n qur1 ´Dpa, xqss Lemma F.14 " argmax DPD E Θ"Q ż aPR kd da ż xPR nd dx expt´1 2 pa ´Θc,k q T diagpΣ, kq ´1pa ´Θc,k qur c p n `m m q d expt´1 2 px ´Θc,n q T diagpΣ, nq ´1px ´Θc,n quDpa, xq3 expt´1 2 px ´Θc,n q T Ψ ´1 M L px ´Θc,n qur1 ´Dpa, xqss

D can be chosen independently for each pair pa, xq P X k ˆX n . Therefore, for any pa, xq P X k ˆX n the decision rule for Dpa, xq " 1 is:

c p n `m m q d ż θPR d

dθQpθq expt´1 2 px ´θc,n q T diagpΣ, nq ´1px ´θc,n qu expt´1 2 pa ´θc,k q T diagpΣ, kq ´1pa ´θc,k qu ą ż θPR d dθQpθq expt´1 2 px ´θc,n q T Ψ ´1 M L px ´θc,n qu expt´1 2 pa ´θc,k q T diagpΣ, kq ´1pa ´θc,k qu

Observing the LHS integral and using the improper uniform prior assumption, we obtain:

ż θPR d dθQpθq expt´1 2 rpx ´θc,n q T diagpΣ, nq ´1px ´θc,n qp a ´θc,k q T diagpΣ, kq ´1pa ´θc,k qsu " ż θPR d dθ expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´2θ T Σ ´1pnx `kāq `pn `kqθ T Σ ´1θsu " expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´pn `kqp nx `kā n `k q T Σ ´1p nx `kā n `k qsu ż θPR d dθ expt´n `k 2 rpθ ´nx `kā n `k q T Σ ´1pθ ´nx `kā n `k qsu " expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´pn `kqp nx `kā n `k q T Σ ´1p nx `kā n `k qsu c p 2π n

`k q d detpΣq Observing the RHS and using the improper uniform prior assumption, we obtain: ż θPR d dθQpθq expt´1 2 rpx ´θc,n q T Ψ ´1 M L px ´θc,n q `pa ´θc,k q T diagpΣ ´1, kqpa ´θc,k qsu " ż θPR d dθ expt´1 2 rpx ´θc,n q T Ψ ´1 M L px ´θc,n q `pa ´θc,k q T diagpΣ ´1, kqpa ´θc,k qsu

F.14 " ż θPR d dθ expt´1 2 rpx ´θc,n q T pdiagpΣ ´1, nq ´1 n `m reppΣ ´1, nqqpx ´θc,n qp a ´θc,k q T diagpΣ ´1, kqpa ´θc,k qsu " ż θPR d dθ expt´1 2 r n ÿ i"1 px i ´θq T Σ ´1px i ´θq `k ÿ j"1 pa j ´θq T Σ ´1pa j ´θqń 2 n `m px ´θq T Σ ´1px ´θqsu piq " expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´n2 n `m xT Σ ´1 x ´nm `nk `mk n `m v T Σ ´1vsu ż θPR d dθ expt´1 2 nm `nk `mk n `m rv T Σ ´1vsu " expt´1 2 r n ÿ i"1 x T i Σ ´1x i `k ÿ j"1 a T j Σ ´1a j ´n2 n `m xT Σ ´1 x ´nm `nk `mk n `m v T Σ ´1vsu c p 2πpn `mq nm `nk `mk q d detpΣq

Where in piq we denoted v " nmx`kpn`mqā nm`nk`mk . Therefore, the decision rule is

expt 1 2 rpn `kqp nx `kā n `k q T Σ ´1p nx `kā n `k qsu d p 1 mpn `kq q d ą expt 1 2 r n 2 n `m xT Σ ´1 x `nm `nk `mk n `m v T Σ ´1vsu c p 1 nm `nk `mk q d ô d p nm `nk `mk mpn `kq q d ą expt 1 2 r n 2 n `m xT Σ ´1 x `nm `nk `mk n `m v T Σ ´1v ´pn `kqp nx `kā n `k q T Σ ´1p nx `kā n `k qsu ôd logp nm `nk `mk mpn `kq q ą n 2 n `m xT Σ ´1 x `nm `nk `mk n `m v T Σ ´1v ´pn `kqp nx `kā n `k q T Σ ´1p nx `kā n `k q ôd logp nm `nk `mk mpn `kq q ą k 2 n 2 pn `kqpnm `nk `mkq px ´āq T Σ ´1px ´āq ôpx ´āq T Σ ´1px ´āq ă dpn `kqpnm `nk `mkq k 2 n 2 logp nm `nk `mk mpn `kq q

As required.

Theorem F.16. Fix the attacker to be G M L as defined in F.12, then the game value is: 

EQUATION

1 2 `1 2 1 Γp d 2 q rγp d 2 , d 2 p1 `ρ `δq log 1 `ρ `δ ρ `δ q ´γp d 2 , d 2 pρ `δq log 1 `ρ `δ ρ `δ qs

Where ρ " m k , δ " m n , and γ is the lower incomplete gamma function.

Proof. The game value is given by:

V pD M L , G M L q "E Θ"Q V pΘ, D M L , G M L q " 1 2 E Θ"Q E A"f pkq Θ E Y "f pmq Θ " E X"f pnq Θ rD M L pA, Xqs `EX"g M L X|Y p¨|Y q r1 ´DML pA, Xqs ı " 1 2 E Θ"Q E A"f pkq Θ E Y "f pmq Θ " E X"f pnq Θ " Ir › › X ´Ā › › 2 Σ ´1 ă α M L s ı `EX"g M L X|Y p¨|Y q " 1 ´Ir › › X ´Ā › › 2 Σ ´1 ă α M L s ıı " 1 2 `1 2 E Θ"Q E A"f pkq Θ E X"f pnq Θ " Ir › › X ´Ā › › 2 Σ ´1 ă α M L s ı 1 2 E Θ"Q E A"f pkq Θ E X"g M L X|Θ p¨|Θq " Ir › › X ´Ā › › 2 Σ ´1 ă α M L s ı

Observing the first term, we can see that by replacing α ˚with α M L in the analog part of the proof for Theorem F.11 we get:

1 2 E Θ"Q E A"f pkq Θ E X"f pnq Θ " Ir › › X ´Ā › › 2 Σ ´1 ă α M L s ı " 1 2 1 Γp d 2 q γp d 2 , nkα M L 2pn `kq q

Again, similarly to the analog part of the proof for Theorem F.11, observing the second term we have:

1 2 E Θ"Q E A"f pkq Θ E X"g M L X|Θ p¨|Θq " Ir › › X ´Ā › › 2 Σ ´1 ă α M L s ı " 1 2 E Θ"Q E A"f pkq Θ E X"g M L X|Θ p¨|Θq " IrV T V ă α M L s ‰ "p˚q

Where:

V " C ´1p X ´Āq " C ´1rp X ´Θq ´p Ā ´Θqs " C ´1rI d , ´Id s " X ´Θ Ā ´Θ " rC ´1, ´C´1 s " X ´Θ Ā ´Θ

Using the definition of G M L (Definition F.12) we have X " N pθ, n`m nm Σq, using Lemma F.3 we have Ā " N pθ, 1 k Σq, and thus:

" X ´Θ Ā ´Θ " N p " θ θ  , " n`m nm Σ 0 0 1 k Σ  q Therefore: V " N p0, rC ´1, ´C´1 s " n`m nm Σ 0 0 1 k Σ  " C ´T ´C´T  q " N p0 d , nm `nk `mk nmk I d q

We denote Ṽ " b nmk nm`nk`mk V and thus Ṽ1 , . . . , Ṽd are independent standard normal random variables and Ṽ T Ṽ " χ 2 pdq. Therefore

V T V " Γpk " d 2 , θ " 2 nm `nk `mk nmk q

And we have:

p˚q " 1 2 1 Γp d 2 q γp d 2 , nmkα M L 2pnm `nk `mkq q

Hence, the game value is given by: 

V pD ˚, G ˚q " 1 2 `1 2 1 Γp d 2 q rγp d 2 , nkα M L 2pn `kq q ´γp d 2 , nmkα M L 2pnm `nk `mkq qs " 1 2 `1 2 1 Γp d 2 q rγp d 2 ,

G EXPERIMENTS -DATASETS:

Below we provide details on the datasets used for the authentication experiments on faces and characters. The VoxCeleb2 (Nagrani et al., 2017; Chung & Zisserman, 2018) dataset contains cropped face videos of 6112 identities. We used the original split of 5994 identities for training and 118 for test. For each identity, we saved every fifth frame, resized each frame to 64 ˆ64, and augmented it using horizontal flip. The Omniglot dataset (Lake et al., 2015) contains handwritten character images from 50 alphabets. There are 1623 different characters, and 20 examples for each character. We use the splits and augmentations suggested by Vinyals et al. (2016) and used by Snell et al. (2017) .

H EXPERIMENTS -IMPLEMENTATION DETAILS:

In this section, we describe our implementation of the GIM model for the different experiments, in detail. Recall from Sec. 5, that in general, the authenticator is a neural network Dpa, xq that can be expressed as Dpa, xq " σpT D paq, T D pxqq, and the generator is a neural network Gpyq that can be expressed as Gpyq i " ϕpW i ´W `TG pyqq @i P rns. In what follows we describe our implementation of these models for each of the experiments.

H.1 GAUSSIAN SOURCES:

Authenticator Architecture: For the statistic function T D , we use a concatenation of the mean and standard deviation of the sample. For the comparison function σ, we use the element-wise absolute difference between the statistics T D paq, T D pxq, followed by a linear layer.

Attacker Architecture: For the statistic function T G , we use the sample mean, i.e., T G pyq " ȳ. The noise vectors W i are generated as follows: First, n Gaussian noise vectors Z 1 , . . . , Z n iid " N p0, I d q are drawn, then each vector Z i is passed through a linear layer to obtain W i . Finally, the decoder ϕ is the identity function.

Optimization details::

The model is trained in an authentication setup as in our theoretical setup, using alternating gradient descent as is common in GAN optimization (Mescheder et al., 2018) . Each iteration begins when a source θ P R d is drawn from the prior distribution Q " N p0, 10I d q. Samples A P R kˆd , Y P R mˆd , X θ P R nˆd are drawn IID from f θ " N pθ, I d q, where X θ represents a real sample from θ. The attacker, given the leaked sample Y , generates a fake sample X G " GpY q P R nˆd , passes it to D, and suffers the loss ´logpsigmoidpDpA, X G qqq. The authenticator, D, receives as input the source information sample A, outputs a prediction for each of the test samples X θ , X G , and suffers the binary cross-entropy loss ´0.5 plog psigmoidpDpA, X θ qqq `log psigmoidp1 ´DpA, X G qqqq. Each experiment is trained for 200K iterations with a batch size of 4000 using the Adam optimizer (Kingma & Ba, 2015) with learning rate 10 ´4.

H.2 EXPERIMENTS ON VOXCELEB2 AND OMNIGLOT:

To describe the models we begin with some notation. We let c denote the number of image channels, h denote the image size (we only consider square images of size c ˆh ˆh), and l denote the latent dimension of the model.

Authenticator Architecture: As mentioned above, the authenticator is a neural network model that can be expressed as:

Dpa, xq " σpT D paq, T D pxqq The statistic function T D maps a sample of images to a statistic vector s P R 6l in the following way: Each image in the sample is mapped using encoders E D src , E D env : r´1, 1s cˆhˆh Ñ R l to two latent vectors v src , v env P R l , respectively. v src is designed to represent the source θ, and v env is designed to represent the environment (e.g., pose, lighting, expression). To represent the source of the sample, the sample mean of v src is taken. To represent the sample distribution, v env is passed through a non-linear statistic module ζ which is meant to capture more complex statistical functions of the sample.5 Finally, T D pxq is obtained by concatenating vsrc and ζpv env q. E.g., for x we have:

T D pxq " concat ˜1 n n ÿ i"1

E D src px i q, ζ `ED env pxq ˘Ţhe comparison function σ : R 6l Ñ R receives two latent vectors s a " T D paq, s x " T D pxq representing the statistics of the samples a and x respectively. The vectors are concatenated and then passed through a Multi-Layered Perceptron which outputs a scalar reflecting their similarity. Namely: σps a , s x q " MLP pconcat ps a , s x qq The full architecture of the authenticator is depicted in Fig. 7 . Attacker Architecture: Our implementation of the attacker is inspired by the architecture suggested by Zakharov et al. (2019) , which relies on an implicit assumption that an image could be modeled as a mapping of two latent vectors to image space. The first vector represents the source θ and is the same for any image of θ, the second vector represents the environment (e.g pose, lighting, expression) and is different for each image of the source.

The attacker model consists of the following components: An image encoder E G src : r´1, 1s cˆhˆh Ñ R l that maps an image to a latent vector representing the source θ, an image encoder E G env : r´1, 1s cˆhˆh Ñ R l that maps an image to a latent vector representing the environment, a Multi-layered Perceptron MLP G : R l Ñ R l that maps Gaussian noise to the environment latent space, an environment decoder ϕ env : R l Ñ R cˆhˆh that maps a latent vector to an environment image which could represent aspects of the environment such as facial landmarks6 , and finally, a generator φ : R 2cˆhˆh ˆRl Ñ r´1, 1s cˆhˆh that maps an environment image concatenated to the real image to a new image. The generator is based on the image to image model used by Zakharov et al. (2019) and Johnson et al. (2016) , and uses the source latent vector as input for Adaptive instance normalization (Huang & Belongie, 2017) .

The attacker generates a fake sample X P r´1, 1s nˆcˆhˆh based on a leaked sample Y P r´1, 1s mˆcˆhˆh in the following way: Each image Y j in the leaked sample is mapped using E G src and E G env to latent vectors u src j , u env j P R l . A latent environment vector, v env i , is constructed for each fake image X i in the following way: First, n Gaussian noise vectors Z 1 , . . . , Z n iid " N p0, I l q

:

We give equal prior probability to attack and real samples for simplicity and clarity, and since this is common in GAN formulations. All results can be trivially generalized to any prior probability for attack.

If the generator is not expressive enough, the learned GAN may have small support(Arora et al., 2017).

Similar results can be derived for the conjugate prior case, namely, proper Gaussian priors.

See Sec. C in the appendix, for additional figures showing that as the dimension grows, the expected accuracy goes to 1.

ζ is implemented as the concatenation of the standard deviation and mean of the sample after passing each example through a Multi-Layered Perceptron.

In Zakharov et al. (2019), our so-called environment image is indeed a facial landmarks image which is used as input to the model. In our work, we allow the model to learn which environment image is useful.

Figures and Tables:

Figure 1: Game value (expected authentication accuracy) for the Gaussian case. (a) A comparison between empirical and theoretical game value for different d values (m " 1, k " 10). Solid lines describe the theoretical game values whereas the ˚markers describe the empirical accuracy when learning with the GIM model. (b) Theoretical game value as a function of δ, ρ (see Corollary 4.3) for d " 100.(c) Empirical accuracy of an optimal authenticator against two attacks: the theoretically optimal attack G ˚from Theorem 4.2 and a maximum likelihood (ML) attack (See Sec. F.4) for the Gaussian case. It can be seen that the ML attack is inferior in that it results in better accuracy for the authenticator, as predicted by our theoretical results.

Figure 2: Images generated by the GIM attacker based on one leaked image. In each row, the leftmost image is the real leaked image, and the rest of the images are an attack sample generated by the GIM attacker. (a) Voxceleb2 dataset. (b) Omniglot dataset.

Fig. 5 visualizes the game value as a function of δ and , for different values of d (the observation dimension).Where " n k is the "information expansion" of the attacker with respect to the authenticator source information. Again, one can clearly see that as d, the observation dimension, grows large, so does the accuracy of the authenticator.

Figure 4: Game value as a function of δ, ρ for different dimensions d.

Figure 5: Game value as a function of δ, for different dimensions d.

n `m reppΣ ´1, nq and the determinant is:detpΨq" detpΣq n p n `m m q dProof. To find the inverse of Ψ M L we first define:

Figure 7: An overview of the implementation of the GIM authenticator architecture for the experiments on the Voxceleb2 and Omniglot datasets.

X|Y px|yqf Y |A py|aqdy are the conditional densities of X given A, generated by the source and the attacker respectively. Consider the authenticator defined by D ˚pa, xq " I

Table content: <table><tr><td/><td/><td/><td/><td/><td>1)</td></tr><tr><td colspan="6">Theorem 4.1. Consider the attacker G ˚defined by:</td></tr><tr><td/><td/><td/><td/><td/><td>"ż</td><td></td></tr><tr><td/><td colspan="4">g X|Y P argmin g X|Y</td><td>E A"f A</td><td>xPX n</td><td>ˇˇf X|A px|Aq ´gX|A px|Aq ˇˇdx</td><td>(4.2)</td></tr><tr><td colspan="2">Where, f A paq "</td><td>ş</td><td>θPH Qpθqf</td><td colspan="2">pkq θ paqdθ is the marginal density of A, Q Θ|A is the poste-</td></tr><tr><td colspan="6">rior over H given A, and f Y |A py|aq "</td><td>ş θPH f</td><td>pmq θ</td><td>pyqQ Θ|A pθ|aqdθ. Also, f X|A px|aq "</td></tr><tr><td>ş</td><td colspan="5">θPH f θ pxqQ Θ|A pθ|aqdθ and g X|A px|aq " pnq yPX m g " ş</td><td>ı</td></tr><tr><td/><td/><td/><td/><td/><td>f X|A px|aq ą g X|A px|aq</td></tr></table>

Accuracy of GIM and baselines against attacks. Avg acc denotes average over all attacks.

Table content: <table><tr><td colspan="2">Authenticator Dataset</td><td colspan="2">m n k RS</td><td colspan="2">Replay GIM</td><td>Avg acc</td></tr><tr><td>GIM</td><td colspan="2">VoxCeleb2 1</td><td colspan="2">5 5 0.897 0.837</td><td>0.822 0.852</td></tr><tr><td>ArcFace</td><td colspan="2">VoxCeleb2 1</td><td colspan="2">5 5 0.998 0.598</td><td>0.526 0.707</td></tr><tr><td>GIM</td><td>Omniglot</td><td>1</td><td colspan="2">5 5 0.912 0.942</td><td>0.868 0.907</td></tr><tr><td>Siamese</td><td>Omniglot</td><td>1</td><td colspan="2">5 5 0.994 0.509</td><td>0.785 0.763</td></tr></table>

Xqs `EX"g X|A p¨|Aq r1 ´DpA, Xqs

Table content: <table><tr><td/><td/><td/><td/><td/><td/><td/><td/><td>ı</td></tr><tr><td/><td>ż</td><td/><td/><td/><td/><td>ż</td><td/></tr><tr><td>" argmin g X|Y</td><td colspan="2">aPX k</td><td colspan="3">daf A paq</td><td colspan="3">xPX n</td><td>dx</td><td>"</td><td>f X|A px|aqDpa, xq `gX|A px|aqr1 ´Dpa, xqs ‰</td></tr><tr><td/><td>ż</td><td/><td/><td/><td/><td>ż</td><td/></tr><tr><td>" argmin g X|Y</td><td colspan="2">aPX k</td><td colspan="3">daf A paq</td><td colspan="3">xPX n</td><td>dx max f X|A px|aq, g X|A px|aq (</td><td>(D.3)</td></tr><tr><td>" argmin g X|Y</td><td>1 2</td><td colspan="2">ż aPX k</td><td colspan="3">daf A paq</td><td colspan="2">ż xPX n</td><td>dx</td><td>"</td><td>f X|A px|aq `gX|A px|aq `ˇf X|A px|aq ´gX|A px|aq ˇˇ‰</td></tr><tr><td/><td/><td/><td>ż</td><td/><td/><td/><td/><td>ż</td></tr><tr><td>" argmin g X|Y</td><td>1</td><td>`1 2</td><td colspan="2">aPX k</td><td colspan="4">daf A paq</td><td>xPX n</td><td>dx ˇˇf X|A px|aq ´gX|A px|aq</td><td>ˇ"</td></tr><tr><td/><td>ż</td><td/><td/><td/><td/><td>ż</td><td/></tr><tr><td>argmin</td><td/><td/><td colspan="3">daf A paq</td><td/><td/></tr><tr><td>g X|Y</td><td colspan="2">aPX k</td><td/><td/><td colspan="3">xPX g X|Y</td><td>E A"f A</td><td>"ż xPX n</td><td>ˇˇf X|A px|Aq ´gX|A px|Aq ˇˇdx</td><td></td><td>(D.4)</td></tr></table>

Observe that W c " N p0, diagpΣ, nqq. Using Lemma F.3 we get Ȳ " N pθ, 1 m Σq and observe that Wc,n " repp 1 n I d , nqW c . Using Lemma F.4 we get Ȳc,n " N pθ c,n , 1 m reppΣ, nqq. We define the following block matrices

Table content: <table><tr><td>Z "</td><td>"</td><td>W c Ȳc,n</td><td></td><td>, B "</td><td>"</td><td>I nd ´1 n reppI d , nq, I nd</td><td>‰</td></tr><tr><td>and observe that:</td><td/><td/><td/><td/><td/><td/><td/></tr></table>

nkα

Table content: <table><tr><td colspan="3">Proof. Let W 1 , . . . , W n</td><td>iid</td><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/></tr><tr><td/><td/><td/><td/><td/><td/><td/><td>2pn `kq</td><td colspan="2">q ´γp</td><td>d 2</td><td>,</td><td colspan="2">2pm `kq mkα</td><td>qs</td><td/></tr><tr><td>"</td><td>1 2 `1 2</td><td colspan="2">1 Γp d 2 q</td><td>rγp</td><td>d 2</td><td>,</td><td colspan="2">dnpm `kq 2kpn ´mq</td><td>log</td><td colspan="3">npm `kq mpn `kq</td><td colspan="2">q ´γp</td><td>d 2</td><td>,</td><td>dmpn `kq 2kpn ´mq</td><td>log</td><td>npm `kq mpn `kq</td><td>qs</td></tr><tr><td>As required.</td><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/></tr><tr><td colspan="10">Finally, we prove Theorem 4.2 and Corollary 4.3.</td><td/><td/><td/><td/><td/><td/></tr></table>

Peer review (iclr2020):
This paper addresses the issue of malicious use of generative models to fool authentication/anomaly detection systems that rely on sensor data. The authors formulate the scenario as a maxmin game between an authenticator and an attacker, with limitations on the number of samples available to the authenticator to fix a decision rule, the number of samples required at test time for the authenticator to take a decision and the number of leaked samples the attacker has access to. The authors prove that the game admits a Nash equilibrium and derive a closed form solution for the case of multivariate Gaussian data. Finally, the authors propose an algorithm called *GAN In the Middle* and perform experiments to show consistency with the theoretical results, better authentication performance than state of the art methods and usability for data augmentation. This pager should be accepted. Overall, it addresses crucial problems with the recent advances of generative models and provides significant theoretical results. The experiments would benefit from some clarification. For the experiments, the following should be addressed: * Confidence intervals for all results (specifically in Figure 1a and in Table 1) * Figure 1a: it would be interesting to see a similar analysis also for other values of m and k. * Table 1: This result would also be more supporting if experiments were performed for varying values of m, n and k. The description of the RS attack could be made more precise: does it mean that the attacker samples images at random? Intuitively, it feels confusing that the GIM authenticator would perform worse on this setting. * The experiments on handwritten data would be more similar to what I imagine being a real-world authentication scenario if performed on a task where a class is a single person writing multiple characters, as opposed to characters being classes. Minor comments: * Page 6, second to last row: there is a*the* repeated twice.