INFLUENCE ESTIMATION FOR GENERATIVE ADVER-
Year: 2021

Abstract:
Identifying harmful instances, whose absence in a training dataset improves model performance, is important for building better machine learning models. Although previous studies have succeeded in estimating harmful instances under supervised settings, they cannot be trivially extended to generative adversarial networks (GANs). This is because previous approaches require that (i) the absence of a training instance directly affects the loss value and that (ii) the change in the loss directly measures the harmfulness of the instance for the performance of a model. In GAN training, however, neither of the requirements is satisfied. This is because, (i) the generator’s loss is not directly affected by the training instances as they are not part of the generator’s training steps, and (ii) the values of GAN’s losses normally do not capture the generative performance of a model. To this end, (i) we propose an influence estimation method that uses the Jacobian of the gradient of the generator’s loss with respect to the discriminator’s parameters (and vice versa) to trace how the absence of an instance in the discriminator’s training affects the generator’s parameters, and (ii) we propose a novel evaluation scheme, in which we assess harmfulness of each training instance on the basis of how GAN evaluation metric (e.g., inception score) is expected to change due to the removal of the instance. We experimentally verified that our influence estimation method correctly inferred the changes in GAN evaluation metrics. We also demonstrated that the removal of the identified harmful instances effectively improved the model’s generative performance with respect to various GAN evaluation metrics.

heading: 1 INTRODUCTION
text: Generative adversarial networks (GANs) proposed by Goodfellow et al. (2014) are a powerful subclass of generative model, which is successfully applied to a number of image generation tasks (Antoniou et al., 2017; Ledig et al., 2017; Wu et al., 2016). The expansion of the applications of GANs makes improvements in the generative performance of models increasingly crucial.
An effective approach for improving machine learning models is to identify training instances that harm the model performance. Traditionally, statisticians manually screen a dataset for harmful instances, which misguide a model into producing biased predictions. Recent influence estimation methods (Khanna et al., 2019; Hara et al., 2019) automated the screening of datasets for deep learning settings, in which the sizes of both datasets and data dimensions are too large for users to manually determine the harmful instances. Influence estimation measures the effect of removing an individual training instance on a model’s prediction without the computationally prohibitive cost of model retraining. The recent studies identified harmful instances by estimating how the loss value changes if each training instance is removed from the dataset.
Although previous studies have succeeded in identifying the harmful instances in supervised settings, the extension of their approaches to GAN is non-trivial. Previous approaches require that (i) the existence or absence of a training instance directly affects a loss value, and that (ii) the decrease in the loss value represents the harmfulness of the removed training instance. In GAN training, however, neither of the requirements is satisfied. (i) As training instances are only fed into the discriminator, they only indirectly affect the generator’s loss, and (ii) the changes in the losses of GAN
do not necessarily capture how the removed instances harm the generative performance. This is because the ability of the loss to evaluate the generator is highly dependent on the performance of the discriminator.
To this end, (i) we propose an influence estimation method that uses the Jacobian of the gradient of the discriminator’s loss with respect to the generator’s parameters (and vice versa), which traces how the absence of an instance in the discriminator’s training affects the generator’s parameters. In addition, (ii) we propose a novel evaluation scheme to judge if an instance is harmful or not on the basis of influence on GAN evaluation metric, that is, how a GAN evaluation metric (e.g., inception score (Salimans et al., 2016)) changes if a given training instance is removed from the dataset. We identify harmful instances by estimating the influence on GAN evaluation metric by leveraging our influence estimation method.
We verified that the proposed influence estimation method correctly estimated the influence on GAN evaluation metrics across different settings of the dataset, model architecture, and GAN evaluation metrics. We also demonstrated that removing harmful instances, which were identified by the proposed method, effectively improved various GAN evaluation metrics.1
Our contributions are summarized as follows:
• We propose an influence estimation method that uses the Jacobian of the gradient of the discriminator’s loss with respect to the generator’s parameters (and vice versa), which traces how the absence of an instance in the discriminator’s training affects the generator’s parameters.
• We propose a novel evaluation scheme to judge if an instance is harmful or not on the basis of influence on GAN evaluation metrics rather than that on the loss value, and to leverage the proposed influence estimation method to identify harmful instances.
• We experimentally verified that our influence estimation method correctly inferred the influence on GAN evaluation metrics. Further, we demonstrated that the removal of the harmful instances suggested by the proposed method effectively improved the generative performance with respect to various GAN evaluation metrics.

heading: 2 PRELIMINARIES
text: Notation For column vectors a, b ∈ Rp, we denote the inner product by 〈a, b〉 = ∑p i=1 aibi. For a function f(a), we denote its gradient with respect to a by∇af(a). We denote the identity matrix of size p by Ip, the zero vector of length p by 0p, and the ones vector of length p by 1p.
Generative Adversarial Networks (GAN) For simplicity, we consider an unconditional GAN that consists of the generator G : Rdz → Rdx and the discriminator D : Rdx → R, where dz and dx are the number of dimensions of latent variable z ∼ p(z) and data point x ∼ p(x), respectively. The parameters of generator θG ∈ RdG and discriminator θD ∈ RdD are learned though the adversarial training;G tries to sample realistic data whileD tries to identify whether the data is real or generated.
Formulation of GAN Objectives For the generality, we adopt the formulation of Gidel et al. (2019) in which G and D try to minimize LG and LD, respectively, to obtain the following Nash equilibrium (θ∗G,θ ∗ D):
θ∗G ∈ arg min θG LG (θG,θ ∗ D) and θ ∗ D ∈ arg min θD LD (θ ∗ G,θD) . (1)
For the latter part of this paper, we use a coupled parameter vector θ := (θG,θD)> ∈ Rdθ=dG+dD when we refer to the whole parameters of GAN.
In this paper, we assume that LG and LD have the following forms2: LG (θ) := Ez∼p(z) [fG (z;θ)] , LD (θ) := Ez∼p(z) [ f [z] D (z;θ) ] + Ex∼p(x) [ f [x] D (x;θ) ] . (2)
1Code is at https://github.com/hitachi-rd-cv/influence-estimation-for-gans 2This covers the common settings of GAN objectives: the non-zero-sum game proposed by Goodfellow
et al. (2014), Wasserstein distance (Arjovsky et al., 2017), and the least squares loss (Mao et al., 2017).
We can recover the original minimax objective by taking fG (z;θ) = log (1−DθD (GθG (z))), f [z] D = −fG, and f [x] D (x;θ) = − logDθD (x).
Adversarial SGD (ASGD) To make our derivation easier to understand, we newly formulate the parameter update of a GAN trained by stochastic gradient descent, which we call adversarial SGD (ASGD). For simplicity, this paper considers simultaneous training, in which the generator and the discriminator are simultaneously updated at a single step. We denote the dataset by Dx := {xn ∼ p(x)}Nn=1, which consists of N data points. Let St ⊂ {1, . . . , N} be a set of sample indices at the t-th step. We assume that the mini-batch of the t-th step consists of instances {xi}i∈St and a set of latent variables Zt = {z[t]l ∼ p(z)} |St| l=1 , which are sampled independently at each step t.
We denote the mean of LG and LD across the mini-batch by L G(Z;θ) := 1|Z| ∑ z∈Z fG (z;θ)
and LD(S,Z;θ) := 1|Z| (∑ z∈Z f [z] D (z;θ) + ∑ i∈S f [x] D (xi;θ) ) , respectively. The t-th step of
ASGD updates the coupled parameters by θ[t+1] = θ[t] −Btg ( St,Zt;θ[t] ) , where
Bt :=
( η [t] G IdG O
O η [t] D IdD
) ∈ Rdθ×dθ , g (S,Z;θ) := ( ∇θGL G (Z;θ) ∇θDLD (S,Z;θ) ) ∈ Rdθ . (3)
η [t] G ∈ R+ and η [t] D ∈ R+ are the learning rates of the t-th step for θG and θD, respectively.

heading: 3 PROPOSED METHOD
text: This section explains the two main contributions of our paper: the influence estimation method for GANs that predicts how the removal of a training instance changes the output of the generator and the discriminator (Section 3.1), and two important parts of our instance evaluation scheme, that are, the definition of influence on GAN evaluation metric and its estimation algorithm (Section 3.2).

heading: 3.1 INFLUENCE ESTIMATION FOR GAN
text: We refer to influence estimation as the estimation of changes in a model’s output under a training instance’s absence. As the model’s output changes through the changes in the model’s parameters, we start with the definition of ASGD-Influence, which represents the changes in parameters, and then formulate its estimator.
ASGD-Influence ASGD-Influence is defined on the basis of the following counterfactual ASGD. Let θ[t]−j denote the parameters at t-th step trained without using j-th training instance. Counterfactual ASGD starts optimization from θ[1]−j = θ [1] and updates the parameters of the t-th step by θ [t+1] −j = θ [t] −j−Btg ( St \ {j},Zt;θ[t]−j ) . We define ASGD-Influence ∆θ−j as the parameter differ-
ence between counterfactual ASGD and ASGD at the final step t = T , namely ∆θ−j := θ [T ] −j−θ[T ].
Estimator of ASGD-Influence Our estimator uses an approximation of the mean of the gradient. Let ( ∇θGL G(Z;θ),∇θDLD(S,Z;θ) )> be the joint gradient vector of the mini-batch. We introduce the Jacobian of the joint gradient vector of the t-th mini-batch with respect to θ:
Jt :=
( J
[t] GG J [t] GD
J [t] DG J [t] DD
) = ( ∇2θGL G ( Zt;θ[t] ) ∇θD∇θGL G ( Zt;θ[t] ) ∇θG∇θDLD ( St,Zt;θ[t] ) ∇2θDLD ( St,Zt;θ[t] ) ) . (4) When we assume both LG(θ) and LG(θ) are second-order differentiable with respect to θ, the first-order Taylor approximation gives g ( St,Zt;θ[t]−j ) − g ( St,Zt;θ[t] ) ≈ Jt ( θ [t] −j − θ[t] ) . With
this approximation, we have
θ [t+1] −j − θ [t+1] = ( θ [t] −j − θ [t] ) −Bt ( g ( St,Zt;θ[t]−j ) − g ( St,Zt;θ[t] )) ≈ (Idθ −BtJt) ( θ [t] −j − θ [t] ) ,∀j 6∈ St. (5)
For simplicity, we first focus on 1-epoch ASGD in which each instance appears only once. Let π (j) be the step where the j-th instance is used. Considering the absence of ∇θDf [x] D (xj ;θ
[π(j)]) in the π(j)-th step of counterfactual ASGD, we have θ[π(j)+1]−j − θ[π(j)+1] = η [π(j)] D |Sπ(j)| ( 0dG , ∇θDf [x] D (xj ;θ [π(j)]) )>
. By denoting Zt := Idθ − BtJt and recursively applying the approximation (5), we obtain
∆θ−j ≈ η [π(j)] D
|Sπ(j)| ZT−1ZT−2 · · ·Zπ(j)+1
( 0dG
∇θDf [x] D ( xj ;θ
[π(j)] )) . (6)
For the practical situation of K-epoch ASGD, in which the j-th instance is sampled K times at t = π1 (j) , . . . , πK (j), the estimator of the ASGD-Influence is given by
∆θ̂−j := K∑ k=1 T−πk(j)−1∏ s=1 ZT−s  η[πk(j)]D |Sπk(j)| ( 0dG ∇θDf [x] D ( xj ;θ [πk(j)] )) . (7)
Linear Influence To estimate the influence on outputs, we introduce linear influence L[T ]−j (u) := 〈u,∆θ−j〉 of a given query vector u ∈ Rdθ . If we take u = ∇θfG ( z;θ[T ] ) , the linear influence
approximates the influence on the generator’s loss L[T ]−j (u) ≈ fG ( z;θ [T ] −j ) − fG ( z;θ[T ] ) .
Let ( u [t]> G ∈ RdG ,u [t]> D ∈ RdD ) := u>ZT−1ZT−2 · · ·Zt+1. The linear influence of the j-th instance is approximated by the proposed estimator:
L [T ] −j (u) ≈ 〈 u,∆θ̂−j 〉 = K∑ k=1 η [πk(j)] D |Sπk(j)| 〈 u [πk(j)] D ,∇θDf [x] D ( xj ;θ [πk(j)] )〉 . (8)
The estimation algorithm consists of two phases; training phase performs K-epoch ASGD by storing information A[t] ← (St, η[t]G , η [t] D ,θ
[t],Zt) and inference phase calculates (8) using A[1], . . . ,A[T−1]. See Appendix A for the detailed algorithm.

heading: 3.2 INFLUENCE ON GAN EVALUATION METRIC
text: This section explains our proposal of a new evaluation approach for data screening for GANs. Firstly we propose to evaluate harmfulness of an instance on the basis of influence on GAN evaluation metrics. Secondly we propose to leverage the influence-estimation algorithm explained in Section 3.1 to identify harmful instances with respect to the GAN evaluation metrics.
Influence on GAN Evaluation Metric Let V (D) be a GAN evaluation metric that maps a set of data points D := {x̃m ∈ Rdx}Mm=1 into a scalar value that gives the performance measure of G. Let generated dataset DG(Z;θG) := {G(z;θG)| z ∈ Z}. Using a set of latent variables Z := {z̃m ∼ p(z)}Mn=1 that is sampled independently from the training, we define the influence on GAN evaluation metric by
∆V [T ] −j := V ( DG ( Z;θ[T ]G,−j )) − V ( DG ( Z;θ[T ]G )) , (9)
where θ[T ]G,−j and θ [T ] G are the generator parameters of counterfactual ASGD and the ASGD of the T -th step, respectively.
Estimation Algorithm In order to build the estimation algorithm of the influence on GAN evaluation metric, we focus on an important property of some common evaluation metrics for which the gradient with respect to the element of their input ∇x̃mV (D) is computable. For example, Monte Carlo estimation of inception score has a form of exp( 1|D| ∑ x̃m∈D KL(pc(y|x̃m)‖pc(y)) where pc is a distribution of class label y drawn by a pretrained classifier. When the classifier is trained using back-propagation, ∇x̃mV (D) is computable.
Here, we assume V (D) is first-order differentiable with respect to x̃m. From the chain rule, we have a gradient of the GAN evaluation metrics with respect to θ:
∇θV (DG(Z;θ[T ]G )) =
(∑M n=1∇θG∇x̃nV ( DG ( Z;θ[T ]G )) 0dD ) . (10)
Our estimation algorithm performs the inference phase of linear influence taking u = ∇θV (DG(Z;θ[T ]G )) in order to obtain the approximation L [T ] −j (∇θV (DG(Z;θ [T ] G ))) ≈ ∆V [T ] −j .

heading: 4 RELATED STUDIES
text: SGD-Influence Hara et al. (2019) proposed a novel definition of the influence called SGDInfluence and its estimator, which greatly inspired us to propose the influence estimation method for GANs. Suppose a machine learning model with parameters φ ∈ Rdφ is trained to minimize the mean of the loss 1N ∑N n=1 L (χn;φ) across the training instances χ1, . . . , χN . Let the mean of
the loss of the mini-batch L (S;φ) := 1|S| ∑ i∈S L (χi;φ). They introduced two SGD steps with
learning rate ηt ∈ R+: SGD given by φ[t+1] = φ[t] − ηt∇φL ( St;φ[t] ) , and counterfactual SGD
given by φ[t+1]−j = φ [t] −j − ηt∇φL ( St \ {j} ;φ[t]−j ) . Their estimator of SGD-Influence φ[T ]−j −φ[T ]
is based on the following approximation:
φ [t+1] −j − φ [t+1] ≈ ( Idφ − ηt∇2φL ( St;φ[t] ))( φ [t] −j − φ [t] ) ,∀j 6∈ St. (11)
Hara et al. (2019) also identified harmful instances for classification based on linear influence of the cross-entropy loss estimated using a validation dataset. Removing the estimated harmful instances with their approach demonstrated improvements in the classification accuracy.
Our approach differs from Hara et al. (2019)’s work in two ways. Firstly, our approach uses the Jacobian of the joint gradient vector Jt instead of the Hessian of the mean loss∇2φL ( St;φ[t] ) . As long as LG 6= LD, Jt is asymmetric and inherently different from the Hessian. Moreover, a source of the asymmetry J [t]GD plays an important role in transferring the effect of removal of a training instance from the discriminator to the generator. Let θ[t]G,−j − θ [t] G ∈ RdG and θ [t] D,−j − θ [t] D ∈ RdD be ASGD-Influence on θG and θD of the t-th step, respectively. The upper blocks of (5) can be rewritten as
θ [t+1] G,−j − θ [t+1] G ≈ ( IdD − η [t] G J [t] GG )( θ [t] G,−j − θ [t] G ) + η [t] G J [t] GD ( θ [t] D,−j − θ [t] D ) . (12)
Note that J [t]GD transfers the t-th step of ASGD-Influence on θD to the next step of ASGD-Influence on θG. The Hessian of Hara et al. (2019), which uses a single combination of the parameters and the loss function, cannot handle this transfer between the two models. Secondly, we use the influence on GAN evaluation metrics for identifying harmful instances rather than that on the loss value. This alleviates the problem of the GAN’s loss not representing the generative performance.
Influence Function Koh & Liang (2017) proposed influence estimation method that incorporated the idea of influence function (Cook & Weisberg, 1980) in robust statistics. They showed that influences on parameters and predictions can be estimated with the influence function assuming the satisfaction of the optimality condition and strong convexity of the loss function. They also identified harmful instances on the basis of the influence on the loss value, assuming consistency of the loss value with the task performance.
Our influence estimation method is designed to eliminate these assumptions because normally GAN training does not satisfy the assumptions regarding the optimality condition, the convexity in the loss function, and the consistency of the loss value with the performance.

heading: 5 EXPERIMENTS
text: We evaluated the effectiveness of the proposed method in two aspects: the accuracy of influence estimation on GAN evaluation metrics (Section 5.1), and the improvement in generative performance by removing estimated harmful instances (Section 5.2)
GAN Evaluation Metrics In both experiments, we used three GAN evaluation metrics: average log-likelihood (ALL), inception score (IS), and Fréchet inception distance (FID) (Heusel et al., 2017). ALL is the de-facto standard for evaluating generative models (Tolstikhin et al., 2017). Let Z ′ := {z′n ∼ p(z)}N ′ n=1 and D′x := {x′n ∼ p(x)}N ′
n=1, which is sampled separately from p(z) and the training dataset Dx, respectively. ALL measures the likelihood of the true data under the distribution that is estimated from generated data using kernel density estimation. We calculated ALL of D′x under the distribution estimated from generated dataset DG(Z ′;θ [T ] G ). Recall Z ′ is the set of latent variables sampled independently from the training (Section 3.2). FID measures Fréchet distance between two sets of feature vectors of real images D′x and those of generated images DG(Z ′;θ [T ] G ). The feature vectors are calculated on the basis of a pre-trained classifier. Larger values of ALL and IS and a smaller value of FID indicate the better generative performance. See Appendix C.1 for the detailed setting of each GAN evaluation metric.

heading: 5.1 EXPERIMENT 1: ESTIMATION ACCURACY
text: We ran the influence estimation method on GANs to estimate influence on various GAN evaluation metrics, and then compared the estimated influence with true influence. The detailed setup can be found in Appendix C.2.
Setup ALL is known to be effective for low-dimensional data distributions (Borji, 2019) and both FID and IS are effective for image distributions. We thus prepared two different setups: fullyconnected GAN (FCGAN) trained with 2D multivariate normal distribution (2D-Normal) for ALL, and DCGAN (Radford et al., 2016) trained with MNIST (LeCun et al., 1998) for IS and FID. IS and FID require classifiers to obtain class label distribution and feature vectors, respectively. We thus trained CNN classifier of MNIST3 using D′x. We set N = 10k and N ′ = |D′x| = |Z ′| = 10k. The experiment was conducted as follows. Firstly, we ran the K-epoch of the training phase of linear influence with the training dataset Dx. We determined K = 50 since we observed the convergence of GAN evaluation metrics at K = 50. For IS and FID, we trained the classifier using D′x and corresponding labels. We then randomly selected 200 target instances from Dx. We obtained estimated influence on GAN evaluation metrics of each target instance by performing the inference phase of linear influence with u = ∇θV (DG(Z ′;θ[T ]G )). The true influence of each target instance was computed by running the counterfactual ASGD.
We used the same evaluation measures as the previous work (Hara et al., 2019): Kendall’s Tau and the Jaccard index. Kendall’s Tau measures the ordinal correlation between the estimated and true influence on GAN evaluation metrics. It has a value of 1 when the orders of the two sets of values are identical. For the Jaccard index, we selected 10 instances with the largest positive and largest negative influence values to construct a set of 20 critical instances. The Jaccard index is equal to 1 when a set of estimated critical instances is identical to that of true critical instances.
To investigate the relationship between a number of tracing back steps and the estimation accuracy, we also evaluated the influence on GAN evaluation metrics of k-epoch ASGD. In k-epoch training, both inference phase of linear influence and the counterfactual ASGD traced back only k ≤ K epochs from the latest epoch K. We varied k = 1, 5, 10, 20, 50 and ran the experiment ten times for each k by changing the random seeds of the experiments.
Results Figure 1 shows the average Kendal’s Tau and the Jaccard index of the repeated experiments. Hereinafter, we use p < .05 to judge the statistical significance of the results. For all k, Kendall’s Tau and the Jaccard index of estimated influence on ALL were statistically significantly better than the result in which the order of estimated influence values were random (random case). Even in the more difficult setups of IS and FID, which handled the high-dimensional dataset and complex architecture, the results were statistically significantly better than that of the random case except for Jaccard index of IS with k = 50. We also observed the estimation accuracy dropped as k increased. This reflects the nature of our estimator that recursively performs linear approximation
3Although the original IS and FID use Inception Net (Szegedy et al., 2016) trained with ImageNet, we instead adopted a domain-specific classifier as encouraged by several studies (Zhou et al., 2018; Liu et al., 2018) to alleviate the domain mismatch with ImageNet.
as many times as the number of steps. We thus conclude that when the required number of tracing back steps is small enough, our influence estimation method is effective and the estimated influence on GAN evaluation metric is useful for identifying harmful instances.

heading: 5.2 EXPERIMENT 2: DATA CLEANSING
text: We investigated if removing identified harmful instances actually improved the generative performance to evaluate the effectiveness of our proposed method for data cleansing. We define data cleansing as an attempt to improve GAN evaluation metrics by removing a set of training instances. See appendix C.3 for the detailed settings.
Setup We studied the data cleansing for the two setups explained in the previous section: 2DNormal with FCGAN and MNIST with DCGAN. We mostly followed the settings of Section 5.1 but set training dataset size N = 50k for both setups.
We identified harmful instances in 2D-Normal training dataset using estimated influence on ALL, and those in MNIST using estimated influence on IS and FID. We considered a training instance was harmful when it had negative (positive) influence on FID (ALL or IS).
For both setups, we also selected instances using baseline approaches: anomaly detection method, influence on the discriminator loss, and random values. For anomaly detection, we adopted isolation forest (Liu et al., 2008). Isolation forest fitted the model using the data points of Dx for 2D-Normal and feature vectors of the classifier of Dx for MNIST. We adopted the selection based on the influence on the discriminator loss to verify our assumption that the influence on the loss does not represent the harmfulness of the instances. Influence on the discriminator loss was calculated on the expected loss of LD (θ) with DG(Z ′;θ[T ]G ) and D′x. We considered instances with negative influence were harmful.
We conducted the experiments as follows. After the training phase of K epoch, we determined nh < N harmful instances with the proposed approach and baselines. Then, we ran counterfactual ASGD with the determined harmful instances excluded. For the reliable estimation accuracy of influence and reasonable costs of the computation and storage, the inference phase traced back only 1-epoch from the last epoch, and counterfactual ASGD only re-ran the latest epoch. We tested with various nh.
We refer to the generator of the final model as the cleansed generator and denote its parameters by θ?G. We evaluated the cleansed generator with test GAN evaluation metrics V (DG(Ztest);θ?G)), in which a set of test latent variables Ztest was obtained by sampling Ntest times from p(z) independently fromZ ′ andZ1, . . . ,ZT . Test ALL and FID used a test datasetDtest := {x[n]test ∼ p(x)} Ntest n=1 that consists of instances newly sampled from 2D-Normal and instances in the original test dataset of MNIST, respectively. We set Ntest = 10k and ran the experiment 15 times with different random seeds.
Quantitative Results Figure 2 shows the average test GAN evaluation metrics of the repeated experiments for each selection approach. For the data cleansing on 2D-Normal, the proposed approach with influence on ALL showed statistically significant improvement from the original model and it outperformed the baselines (Figure 2a). For the MNIST setup, our approach with influence on FID and IS statistically significantly improved FID (Figure 2c) and IS (Figure 2b), respectively. They also outperformed the baselines. In addition, the results indicate that data cleansing based on the influence on a specific GAN evaluation metric is also effective for another metric that is not used for the selection; removing harmful instances based on the influence on FID (IS) statistically significantly improved IS (FID). However, we make no claim that the proposed method can improve all the other evaluation metrics, such as Kullback-Leibler divergence. This is because all the current GAN evaluation metrics have their own weaknesses (e.g., IS fails to detect whether a model is trapped into one bad mode (Zhou et al., 2018)), and the proposed method based on those GAN evaluation metrics cannot inherently avoid their weaknesses. These improvements thus can be observed only in a subclass of GAN evaluation metrics. Further evaluation of data cleansing with our method should incorporate the future improvements of the GAN evaluation metrics.
While the improvements were smaller than the proposed approach, we also observed that data cleansing based on the influence on the discriminator loss improved all the GAN evaluation metrics. This counter-intuitive result indicates that the discriminator loss weakly measures the performance of the generator that is trained along with the discriminator.
Qualitative Results We examined the characteristics of instances that were evaluated to be harmful by our method. Overall, we observed that our method tends to judge instances as harmful when they belong to regions from which the generators sample too frequently compared to the true distribution. Figure 3 shows the estimated harmfulness of the training instances of 2D-Normal and the distribution of the generated samples. The proposed approach with influence on ALL evaluated the instances around lower-left and upper-right regions to be harmful (Figure 3a). These regions correspond to the regions where the generated distribution has higher density than that of the true distribution (Figure 3b “No removal” and “True”). Similar characteristics were seen in harmful
MNIST instances suggested by our approach with influence on FID. A large number of samples from class 1 were regarded as harmful as shown in Figure 4a, when the generator sampled images of the digit 1 too frequently (Figure 4b).
We also investigated how the data cleansing by our approach visually changed the generated samples. As seen from the distributions in Figure 3b, the probability density in the upper-right region decreased after the data cleansing (from “No removal” to “Cleansed”). As a result, the generator distribution moved closer to the true distribution. The same effect was observed in a visually more interesting form in the data cleansing for MNIST. The generated samples originating from some latent variables changed from the image of digit 1 to that of other digits after the data cleansing based on the estimated influence on FID (highlighted samples in Figure 4c). We suppose this effect improved the diversity in the generated samples, resulting in better FID and IS.

heading: 6 CONCLUSION
text: We proposed an influence estimation method for GAN that uses the Jacobian of the gradient of the discriminator’s loss with respect to the generator’s parameters (and vice versa), which traces how the absence of an instance in the discriminator’s training affects the generator’s parameters. We also proposed a novel evaluation scheme to judge if an instance is harmful or not on the basis of the influence on GAN evaluation metrics rather than that on the loss value, and to leverage the proposed influence estimation method to identify harmful instances. We experimentally verified that estimated and true influence on GAN evaluation metrics had a statistically significant correlation. We also demonstrated removing identified harmful instances effectively improved the generative performance with respect to various GAN evaluation metrics.

heading: A ALGORITHM FOR LINEAR INFLUENCE
text: The proposed estimation algorithm for linear influence, which is explained in Section 3.1, is divided into the training phase (Algorithm 1) and inference phase (Algorithm 2).
The training phase executes ASGD training while storing the mini-batch indices St, the learning rate η[t]G , η [t] D , the parameters θ
[t] and the sampled latent variable Zt into the informationA[t] at each step.
In the inference phase, L[T ]−j (u) is estimated by the recursive calculation. First, we set L [T ] −j (u) to 0 and set the query vector u. The information A[t], which is obtained in the training phase, is read in the order of t = T − 1, T − 2, . . . , 1. When j ∈ St, L[T ]−j (u) is updated using (8). Let
ut = ( u [t] G ,u [t] D )> . Each step updates u based on ut+1 = u>t Zt = u > t (Idθ −BtJt). A naive
calculation of u>t Jt requires O ( d2θ )
memory to store the matrix Jt, which can be prohibitive for very large models. We can avoid this difficulty by directly computing u>t Jt without the explicit computation of Jt. Because u>t Jt = ∇θ 〈 ut, (∇θGL G,∇θDLD)> 〉 , we need only to compute the derivative of the inner product of ut and the joint gradient vector.
Our algorithm also covers the alternating gradient descent, in which the two models alternatively update their parameters at each step. By taking η[t]G and η [t] D such that they alternatively take 0 at each step, we can have ASGD and the estimator of ASGD-Influence for the alternating gradient descent. The implementation of linear influence for the alternating gradient descent is available in our repository4.

heading: B OTHER RELATED WORKS
text: Anomaly Detection A typical approach for identifying harmful instances is outlier detection. Outlier detection is used to remove abnormal instances from the training set before training the model to ensure that the model is not affected by the abnormal instances. For tabular data, there are several popular methods, such as One-class support vector machine (Schölkopf et al., 2001), local outlier factor (Breunig et al., 2000), and isolation forest (Liu et al., 2008). Although these methods can find abnormal instances, they are not necessarily harmful for the resulting models, as we showed in the experiment.
Training GAN from Noisy Images One typical type of data that harm generative performance is noisy images. AmbientGAN (Bora et al., 2018) and noise-robust GAN (Kaneko & Harada, 2020)
4https://github.com/hitachi-rd-cv/influence-estimation-for-gans
are learning algorithms that make it possible to train a clean image generator from noisy images. The difference between these studies and ours is that these studies assume that the noise (e.g., Gaussian noise on pixels) given independently from the data distribution of the clean images is the only problem. However, some instances can affect the performance even if the instances are drawn only from the data distribution, which is the case robust statistics (Huber, 2004) typically focuses on. Our experiment 5.2 indicates that the model performance depends not only on noisy images but also on a non-negligible number of harmful instances in the original dataset.

heading: C DETAILED EXPERIMENTAL SETTINGS AND RESULTS

heading: C.1 GAN EVALUATION METRICS
text: We adopted Gaussian kernel with the band-width 1 for kernel density estimation used in ALL. The architecture of CNN classifier of MNIST used for IS and FID can be found in Table 1. We selected the output of the 4th layer for the feature vectors for FID.

heading: C.2 EXPERIMENT 1: ESTIMATION ACCURACY
text: Setup In the experiment of Section 5.1, we adopted the hyper parameters shown in Table 2. We trained fullly-connected GAN (FCGAN) for 2D multivariate normal distribution, in which the both G and D has 1 hidden layer of hG and hD units, respectively (Table 3). 2D-Normal is given by N (µ,Σ), in which the mean vector µ = 12 and the covariance matrix Σ = ((1, 0.8) , (0.8, 1))>. DCGAN consists of transposed convolution (or deconvolution) layers and convolution layers (Table 4). The channels of the both layers in G and D were determined by hG and hD, respectively. We used Layer Normalization (Ba et al., 2016) for the layers shown in Table 4 for the stability of the training. We also introduced the L2-norm regularization with the rate γ ∈ R+ for all the kernels of both FCGAN and DCGAN. We used the non-zero-sum game objective of the original paper (Goodfellow et al., 2014) in which G tries to minimize −DθD (GθG (z)) for both models.

heading: C.3 EXPERIMENT 2: DATA CLEANSING
text: Setup We adopted the same architecture as the Section 5.1 (Table 3) for FCGAN and slightly different architecture (Table 4) in which hG and hD are larger (Table 5) for DCGAN. Other hyper parameters followed Table 5. We also provide visual explanations of the data settings in the experiments with influence on ALL, IS, and FID in Figure 5, 6, and 7, respectively.
Results Table 6-8 show the detailed results of Figure 2. And they clarify with which nh and selection approach the test GAN evaluation metrics were statistically significantly improved.

heading: D DETAILED DISCUSSION ON EXPERIMENT 2
text: This section first discusses three aspects of the results in Section 5.2: Section D.1 explains the common characteristics of harmful instances suggested by our approach, Section D.2 discusses qualitative aspects of the data cleansing using generated samples, and Section D.3 discusses how the characteristics of harmful instances and effect of the data cleansing are consistent among the trainings with different random seeds. Finally, we explain the limitation of our method and present the future direction in Section D.4.

heading: D.1 CHARACTERISTICS OF HARMFUL INSTANCE
text: In this section, we examine the characteristics of instances that are evaluated to be harmful or helpful by our method. We regard a sample is helpful if its influence on a metric is opposite of harmful instances.
Table 9 shows the estimated harmfulness of the training instances of 2D-Normal and the distribution of the generated samples. The proposed approach with influence on ALL evaluated the instances around lower-left and upper-right regions to be harmful (Table 9 (a, i)). These regions correspond to the regions where the generated distribution has higher density than that of the true distribution; The generator before the cleansing (Table 9 (a, ii, No removal)) sampled too frequently from lower-left and upper-right regions compared to the true distribution (Table 9 (a, ii, True)). This characteristics was not observed in the plots of baseline approaches. The approach based on influence on the discriminator loss seems to ignore the difference in the density around the lower-left region (Table 9 (b, i)) and isolation forest did not take the generator’s distribution into account (Table 9 (c, i)).
Similar characteristics were seen in harmful MNIST instances suggested by our approach with influence on IS and FID. When the generator over-sampled a specific digit (e.g., the digit 1 in Table 10 (a, iii)), our approach tended to judge the images of the digit to be harmful (e.g., a large number of 1 in Table 10 (b-c, i)). Similarly, our method judged instances of a specific digit as helpful (e.g., the digit 6 in Table 10 (b-c, ii)) when the generator failed to sample the digit (e.g., the absence of 6 in Table 10 (a, iii)). On the contrary, harmful instances suggested on the basis of influence on the discriminator loss did not show the tendency (Table 10 (d, i)). The baseline approach with isolation forest based on the classifier feature-space seems to have judged the images that were difficult to be classified as harmful, rather than the over-sampled digit (Table 10 (e, i)). It regarded that instances are helpful when they belong to a digit that seems to have been easy to be classified (Table 10 (e, ii)).
To summarize, our method tends to judge instances as harmful when they belong to regions from which the generators sample too frequently compared to the true distribution.

heading: D.2 QUALITATIVE STUDY OF DATA CLEANSING
text: We then investigate how the data cleansing using the suggested harmful instances visually change generated samples.
As seen from Table 9 (a, ii), the probability density in the upper-right region decreased after the data cleansing (from “No removal” to “Cleansed”). As a result, the generator distribution got closer to the true distribution. Although the baselines indicated the same direction of changes in the distributions (Table 9 (b-c, ii)), these were not as significant as ours.
The same effect was observed in visually more interesting form in the data cleansing for MNIST. The generated samples originating from some latent variables changed from the image of digit 1 to that of other digits after the data cleansing based on the estimated influence on IS and FID (highlighted samples in Table 10 (b-c, iii)). This implies that a certain amount of density that are over-allocated for the digit 1 moved to the regions of other digits. We assume this effect improved the diversity in the generated samples, resulting in better FID and IS. This characteristics was not clearly observed in the baselines (highlighted samples in Table 10 (d-f, iii)).
These observations suggest that our method helps the GAN’s training so that the generator re-assigns the densities that were over-allocated to certain regions to other regions.

heading: D.3 CONSISTENCY OF QUALITATIVE CHARACTERISTICS AMONG DIFFERENT TRAININGS
text: We show additional visual results to confirm the consistency of the findings on the characteristics of harmful instances and generated samples after data cleansing, which we described in Section D.2 and Section D.3, respectively.
Table 11 shows the harmfulness of the training instances and the distribution of the generated samples obtained using 5 different random seeds in 2D-Normal case. As seen from the table, regardless of which region a generator assigns high density to, our method consistently regards the training samples around the region as harmful. In addition, the distributions of the generated samples get closer to the true distribution by removing these harmful training instances in the data cleansing.
Table 12 visualizes the MNIST examples of harmful instances, helpful instances, and generated images before and after the data cleansing. Different rows correspond to different random seeds. We found the consistency in visual characteristics was moderate in MNIST case. A few results demonstrated the common qualitative characteristics when the improvements in GAN evaluation metrics were large (Table 12 (a) and (d)). In the training with the 4th random seed (d), the suggestion of harmful instances showed some tendency; many instances of digit 7 were regarded as harmful whereas those of digit 4 were not at all (Table 12 (d, i)). The data cleansing based on this suggestion seems to have improved the diversity of the generated samples by reducing the samples of digit 7 and increasing those of digit 4 (highlighted samples in Table 12 (d, iv)). This indicates the consistent characteristics of the data cleansing discussed in the previous section to some extent; it helps the GAN’s training so that the generator re-assigns the densities that were over-allocated to certain data regions to other regions.

heading: D.4 CURRENT LIMITATION AND FUTURE DIRECTION
text: The limitation of our method is that it does not guarantee the harmful instances suggested on the basis of influence on one GAN evaluation metric are not necessarily harmful from the viewpoint of other metrics. For example, we have demonstrated that removing instances that predicted to have negative influence on FID improved both test FID and IS (Figure 2) and increased visual diversity in generated images (Table 10 and 12). However, it does not seem to have improved visual quality (e.g., sharpness, reality, etc.) of the individual generated-samples. Therefore, it is possible that these instances are harmful only for some particular aspects of generative performance, i.e. the diversity in this case, and they are not harmful for the other aspect, i.e. the visual quality in this case.
We would argue that this limitation is closely tied with the limitation of the current GAN evaluation metrics. For example, FID takes the diversity of generated samples into account, but they only partly take the visual quality into account; e.g., FID based on Inception Net was shown to focus on textures rather than shapes of the objects (Karras et al. (2020)). In this sense, we clarify that we never claim our method can improve the “true” generative performance from all the aspects, considering the situation that there is no “true” evaluation metric that measures all the aspects of the generative performance.
The advantage of our method is that it does not have to care how the evaluation metrics are defined as long as they are differentiable with respect to the generated samples. Furthermore, our evaluation method makes no assumption about what the harmful characteristics of instances are. This means that it is expected to be easily applied to another evaluation metric if better metric is developed in the future. One of our main contributions in such sense is that we experimentally verified that our method successfully improved the generative performance in terms of a targeted metric, using limited but currently widely accepted metrics.
Our future work includes incorporating such future improvements in the GAN evaluation metric to obtain better insights on the relationship between training instances and generative performance. In addition, we would like to relax the current constraint on the optimizer. Our method is currently applicable only to SGD but we would like to find a way to extend it to other optimizers such as Adam (Kingma & Ba (2015)) to deal with the latest GAN models.

Review summaries:
The paper presents an influence estimation method for GANs. It discusses why previous approaches on influence estimation cannot be easily extended to GANs. It proposes to use Jacobian of the gradient of discriminator’s loss with respect to the generator’s parameters to learn how absence of an instance in the discriminator’s training affects the generator’s parameters. The authors evaluate whether an instance is harmful based on its influence on GAN evaluation metrics. They show that removing these harmful instances improves performance of GANs on MNIST with respect to three metrics: Inception Score, FID and Average Log Likelihood (ALL).