{'fraction_non_alphanumeric': 0.0422845819483508, 'fraction_numerical': 0.012400920480695474, 'mean_word_length': 4.436837532580365, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 18, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Local Intrinsic Dimensionality Signals Adversarial Perturbations

The vulnerability of machine learning models to adversarial perturbations has motivated a significant amount of research under the broad umbrella of adversarial machine learning. Sophisticated attacks may cause learning algorithms to learn decision functions or make decisions with poor predictive performance. In this context, there is a growing body of literature that uses local intrinsic dimensionality (LID), a local metric that describes the minimum number of latent variables required to describe each data point, for detecting adversarial samples and subsequently mitigating their effects. The research to date has tended to focus on using LID as a practical defence method often without fully explaining why LID can detect adversarial samples. In this paper, we derive a lower-bound and an upper-bound for the LID value of a perturbed data point and demonstrate that the bounds, in particular the lower-bound, has a positive correlation with the magnitude of the perturbation. Hence, we demonstrate that data points that are perturbed by a large amount would have large LID values compared to unperturbed samples, thus justifying its use in the prior literature. Furthermore, our empirical validation demonstrates the validity of the bounds on benchmark datasets.


Introduction
Machine learning is fast becoming a key instrument in domains such as finance, cybersecurity, and engineering. However, there is a growing body of literature that suggests most machine learning algorithms, including deep neural networks (DNNs), are vulnerable to adversarial attacks. By adding carefully crafted perturbations to data points, adversaries aim to either avoid detection (i.e., test time attack) or alter the decision functions learned by the machine learning models (i.e., training data poisoning). As a consequence, applications that rely on machine learning for high-stakes automated decision making may take incorrect actions with severe consequences. Therefore, investigating defense mechanisms against adversarial attacks is a continuing concern within the adversarial machine learning community.
Adversarial attacks take place in situations where attackers have opportunities to alter existing data points or introduce new malicious data points. For example, training data poisoning can occur through the use of malware or when training data is collected using crowd-sourcing marketplaces, where organizations build data sets with the help of individuals whose authenticity cannot be guaranteed. Due to the size and complexity of datasets, it is infeasible to extensively validate the quality of all data/labels. Therefore, researchers have explored multiple approaches to address this problem and reduce the vulnerability of machine learning algorithms to adversarial attacks.
Recent research on adversarial machine learning defenses can be categorized as either a certified defense or an empirical defense. A certified defense attempts to learn provably robust prediction models against norm-bounded adversarial perturbations such as 2 or ∞ . For example, the recent works of Wong and Kolter [2018], Cohen et al. [2019] and Lecuyer et al. [2019] introduce certified defenses particularly for deep neural networks. In contrast, empirical defenses either incorporate adversarial data into the training process [Zhang et al., 2020, Madry et al., 2018, Wang et al., 2019 or incorporate adversarial sample detection components to the machine learning pipeline. More recently, several works have explored empirical defenses that use Local Intrinsic Dimensionality (LID) [Houle, 2017a] as the basis for detecting adversarial samples.
The LID value of a data point identifies the minimum number of latent variables required to represent that data point and recent evidence suggests that LID is an indicator of the degree of being an outlier . For example, Ma et al. [2018a] use LID to characterize adversarial subspaces in the context of Deep Neural Networks (DNNs). The authors use a novel learning strategy for DNNs based on LID that monitors the dimensionality of subspaces during training and adapts the loss function to minimize the impact of noisy labels. Weerasinghe et al. [2021a] introduce a black-box defense for nonlinear regression built around LID to identify and reduce the impact of adversarial samples.
Although previous works have established the intuition behind using LID for detecting adversarial samples, they fail to provide a theoretical justification for this behavior of LID. In this paper, we aim to address this by obtaining a lower-bound (and an upper-bound) for the LID value of a perturbed data point and show that there is an association between the size of the perturbation and the (lower-bound of the) LID value of the resulting data point. Specifically, we theoretically analyze the impact of adversarial perturbations using a simple setup comprising three data points, (i) the benign data point being perturbed, a, (ii) its position after being perturbed, b, and (iii) a benign reference data point, c. Using the distribution of distances from the perturbed location (i.e., b), we present a lower bound and an upper bound for its LID value (LID(b)). Furthermore, by considering the two possible directions of perturbation (i.e., towards or farther from the reference point c), we identify the least lower and upper bounds when perturbed towards c and the greatest lower and upper bounds when perturbed farther from c. These theorems indicate a positive association between the LID value and the size of the perturbations, thereby justifying the use of LID as an indicator of adversarial perturbations in previous works.
The main contributions of this paper are summarized as follows. We present a lower bound and an upper bound for the LID value of a perturbed data point based on the distribution of distances to its neighbors. We then identify the least lower and upper bounds when the perturbation is towards the reference point, and the greatest upper and lower bounds when the perturbation is away from it. Finally, we provide empirical evidence on benchmark data sets to support our theoretical contributions.
2 Literature Review

Theory of Local Intrinsic Dimensionality
The minimum number of latent variables needed to represent the data is considered as the intrinsic dimensionality (ID) of that particular data set. The ID of a dataset is thus an indicator of its complexity. A number of previous works have proposed characterizations of global intrinsic dimensionality (for data sets) and local intrinsic dimensionality (for a single data point) [Houle et al., 2012]. More recently Houle [2017a] proposed a characterization of LID in which the distribution of distances to a query point is modeled in terms of a continuous random variable [Houle, 2017a,b]. Amsaleg et al. [2015] developed several estimators of LID based on extreme value theory, using maximum likelihood estimation (MLE), the method of moments (MoM), probability weighted moments (PWM) and regularly varying functions (RV). Of these, the MLE model of LID estimation has been used for LID estimation in several works in adversarial machine learning including this paper (Definition 2). The accuracy of the MLE estimator is dependent on the number of neighbors considered in the calculation. More recently, Amsaleg et al. [2019] proposed an estimator of LID that achieves accurate results even with small neighborhood sizes.
Intrinsic dimensionality (through the use of estimators) has been utilized in many applications such as dimensionality reduction, outlier detection, similarity search and subspace clustering. In this paper, we focus on its ability to signal the degree of a sample being an outlier in the context of adversarial machine learning.

Applications of LID to Adversarial Machine Learning
To date, several studies have investigated the usability of LID as a detector of adversarial samples. For example, Ma et al. [2018b] use LID for detecting adversarial samples in Deep Neural Networks (DNNs). The authors use the LID values of the deep neural network representation (post-activation values at each layer) of images to train a classifier that identifies flipped labels with high success. For a similar application, Ma et al. [2018a] use a dimensionality-driven learning strategy which dynamically adapts the loss function of the DNN based on the dimensionality of subspaces (measured using LID). Weerasinghe et al. [2021b] introduce a novel defense mechanism against poisoning and label flipping attacks using Local Intrinsic Dimensionality (LID). The proposed defense employs several label dependent variants of LID (i.e., in-class LID, out-class LID and cross-class LID) against label flipping attacks. Weerasinghe et al. [2021c] proposed a black-box defense for nonlinear regression learning. First, the defense identifies samples that have the greatest influence on the learner's validation error and then uses LID to iteratively identify poisoned samples via a generative probabilistic model, and suppress their influence on the prediction function. Barua et al. [2019] apply a LID measure called CrossLID to assess the degree to which the distribution of data generated by a Generative Adversarial Network (GAN) conforms to the distribution of real data. The authors demonstrate that by incorporating the proposed LID based evaluation into the learning process, the generation quality of the GAN improves.
The work of Amsaleg et al. [2020] is the most closely related to the work presented in this paper. Amsaleg et al. [2020] introduced an upper-bound for the minimum perturbation required (δ) to change the rank of a data point from 1 to k (or k to 1) w.r.t. a reference point in the context of an information retrieval application. Furthermore, the authors demonstrate that small perturbations are sufficient to change the ranks of data points with relatively larger LID values compared to data points with smaller LID values.
In this work, we provide an upper-bound and a lower-bound for the LID value of a perturbed sample based on the distances (and the cumulative probability distribution of distances) to its starting location and a benign reference point. Furthermore, we identify the greatest (least) lower-bound and upper-bound when the data point is perturbed away from (towards) the reference point.

Theoretical Overview of LID
A particular challenge when using high dimensional data (e.g., images, natural language) is identifying lower dimensional representations with minimal loss of information. A considerable amount of literature has been published on characterizing the intrinsic dimensionality (i.e., the minimum number of latent variables required to describe the data) of data. These include fractal methods such as the Hausdorff dimension [Gneiting et al., 2012] and Minkowski-Bouligand dimension [Falconer, 2004], topological approaches [Rozza et al., 2012], and dimensional models such as minimum neighbor distance models [Rozza et al., 2012], expansion dimension [Karger and Ruhl, 2002], generalized expansion dimension [Houle et al., 2012], and LID [Houle, 2013]. Of these, LID [Houle, 2013] has been of particular interest to the machine learning community for detecting adversarial data points (Section 2.2). Therefore, in this paper, we focus on the adversarial detection capabilities of LID.
We start by discussing the theoretical background behind LID. First, we briefly introduce the theory of LID for assessing the dimensionality of data subspaces. Expansion models of dimensionality have previously been successfully employed in a wide range of applications such as manifold learning, dimension reduction, similarity search, and anomaly detection [Houle, 2017a, Amsaleg et al., 2015. Next, we analyze the effect of perturbations on the LID values of data points.

Theory of Local Intrinsic Dimensionality.
In the theory of intrinsic dimensionality, classical expansion models measure the rate of growth in the number of data samples encountered as the distance from the sample of interest increases [Houle, 2017a]. As an example, in Euclidean space, the volume of an m-dimensional hyper-sphere grows proportionally to r m , when its size is scaled by a factor of r. If we consider two hyper-spheres sharing the same center with volumes V 1 and V 2 and radii r 1 and r 2 , respectively, the expansion dimension m can be deduced as: Transferring the concept of expansion dimension to the statistical setting of continuous distance distributions leads to the formal definition of LID. By substituting the cumulative probability of distance for volume, LID provides measures of the intrinsic dimensionality of the underlying data subspace. Refer to the work of Houle [2017a] for more details concerning the theory of LID. The formal definition of LID is given below.
Definition 1 (Local Intrinsic Dimensionality [Houle, 2017a]). Given a data sample a ∈ S, let R > 0 be a random variable denoting the distance from a to other data samples. If the cumulative probability distribution function F (r) of R is positive and continuously differentiable at distance r > 0, the intrinsic dimensionality of a at distance r is given by: whenever the limit exists.
The last equality of (2) follows by applying L'Hôpital's rule to the limits [Houle, 2017a]. The local intrinsic dimension at a is in turn defined as the limit when the radius r tends to zero: LID(a) measures the probability density F (r) normalized by the cumulative probability density F (r)/r. In the ideal case where the data in the vicinity of a is distributed uniformly within a subspace, LID(a) equals the dimension of the subspace; however, in practice these distributions are not ideal, the manifold model of data does not perfectly apply, and LID (a) is not an integer [Ma et al., 2018b]. Nevertheless, the local intrinsic dimensionality is an indicator of the dimension of the subspace containing a that would best fit the data distribution in the vicinity of a.
The smallest distances from point a can be regarded as extreme events associated with the lower tail of the underlying distance distribution. Using extreme value theory (EVT), the following theorem shows that F (r) completely determines ID F .
Theorem 1 (Local ID Representation [Houle, 2017c]). Let F : R ≥0 → R be a real-valued function, and assume that the ID F (0) exists. Let r and w be values for which r/w and F (r)/F (w) are both positive. If F is non-zero and continuously differentiable everywhere in the interval containing [min{r, w}, max{r, w}], then whenever the integral exists.
Furthermore, let e > 1 be a constant. Then, as per Theorem 3 of Houle [2017c], The LID formula defined in (3) is the theoretical calculation of LID. We describe below the empirical estimation of LID ( LID) as follows.
Definition 2 (Estimation of LID [Amsaleg et al., 2015]). Given a reference sample a ∼ P, where P represents the data distribution, the Maximum Likelihood Estimator of the LID at a is defined as follows: Here, r i (a) denotes the distance between a and its i-th nearest neighbor within a sample of k points drawn from P, and r max (a) is the maximum of the neighbor distances.
The above estimation assumes that samples are drawn from a tight neighborhood, in line with its development from extreme value theory. In practice, the sample set is drawn uniformly from the available training data (omitting x itself), which itself is presumed to have been randomly drawn from P.

Adversarial Perturbations and LID
As stated in Section 2, multiple prior works use defenses built around LID for detecting and suppressing the impact of adversarial samples. In the literature, adversarial samples are usually generated by perturbing benign data in directions provided by the attack algorithm [Goodfellow et al., 2015, Moosavi-Dezfooli et al., 2016, Maini et al., 2020. By perturbing the feature vectors, the adversary moves poisoned samples away from the domain of benign samples. Thus, each poisoned sample would have an irregular distribution of the local distance to its neighbors, which would be reflected by its LID value. For example, the LID estimate of the data point a ∈ S, i.e., LID(a), is an indicator of the dimension of the subspace that contains a, by comparing the LID estimate of a data sample to that of other data points, any data points that have substantially different lower-dimensional subspaces would get highlighted. The domain of data samples. a The benign data point being perturbed (a ∈ S). b The position of a, after the perturbation (b ∈ S). c A benign reference point (c ∈ S). d(a, b) A distance measure that measures the distance between any two data points in S. x The distance between a and c measured using d. y The distance between b and c measured using d. δ A real valued constant that determines the size of perturbations. δx The distance between b and a measured using d. D The univariate distribution of the distances to other data points measured from any data point in S.

F (r)
The cumulative probability distribution function of D. LID(a) The local intrinsic dimensionality of a. LID(a) The numerical estimation of LID(a). n The number of samples (data points) in S (i.e., |S|). p c The cumulative probability of F b at distance y (i.e., F b (y)). k c The expected rank of c w.r.t the distribution of distances from b (i.e., p c × n). θ The angle between b − a and c − a. We start by describing the problem setup using three data points a, b and c as depicted in Figure 1. Take a ∈ S as the initial (benign) point that the attacker aims to perturb and b ∈ S as the resulting perturbed point. Take c ∈ S as some benign reference location. In this section, we analyze how the perturbations affect LID(b) (i.e., the LID value of the perturbed data point). Define d(a, b) as the distance measure that measures the distance between any two data points in S. Although we use Euclidean distance as the measure of distance in this paper, we note that any measure of distance for which the definition of LID holds is feasible. Thus, D b is defined as a univariate distribution of the distances to other data points measured from b.

Problem Setup and Notation
Any point, for example c, determines a distance y = d(c, b) = b − c , which in turn determines a probability p c = F b (y). That is, any sample drawn from S has probability p c being closer to b. Therefore, with respect to the distribution D b , the point c is given a distributional rank p c . We define the expected rank of c as k c := p c × n, where n = |S|. Figure 2: The probability distribution of distances from b ∈ S induced by D b .
Lemma 1 considers a point a at distance x from c (i.e., x = a − c ). The point b, which is produced by perturbing a, has distance δx from a for some proportion δ > 0 (see Fig. 1). Define θ as the angle between b − a and c − a. The lemma gives sufficient conditions on δ and θ for b to be closer to (resp. farther from) c compared to a. Lemma 1. Define the distance y = b − c and the associated cumulative probability p c = F b (y). Similarly, define the distance δx = b − a and the associated cumulative probability p a = F b (δx) where δ > 0 and x = a − c . For y > x, that is when b is perturbed farther from c (relative to a), δ > 2 cos θ. For y < x, (i.e., perturbed towards c) δ < 2 cos θ and − π 2 < θ < π 2 .
Proof. Since θ is the angle between b − a and c − a, by construction, we have: In the first case where y > x (b is perturbed farther from c) we have, Since δ > 0 and x > 0, we have δ > 2 cos θ.

Theoretical Bounds on LID
We now consider the relationship between local intrinsic dimensionality and the effect of perturbations on neighborhoods under appropriate smoothness conditions of the underlying distance distribution. First, we define the conditions under which the LID is continuous at b ∈ S [Amsaleg et al., 2020]: 1. There exists a distance y > 0 for which all points c ∈ R d with c − b ≤ y admit a distance distribution D b whose cumulative distribution function F b is continuously differentiable and positive within some open interval with a lower bound of 0.
2. For any sequence b → c of points satisfying Condition 1, there is convergence in distribution of the sequence of random distance variables defined at b to the distance variable defined at c; that is, the condition lim b→c F b ( ) = F c ( ) holds for any distance ∈ (0, y).
3. For each b satisfying Condition 1, LID(b) exists and is positive.

lim b→c LID(b) = LID(c).
For the remainder of this Section, we assume that the LID is continuous at point b ∈ S. In practice, we find that these technical conditions are often satisfied as illustrated by the experimental results in Section 6.
The following theorem derives an upper-bound and a lower bound for the LID of a perturbed data point, b, based on the distances to its original location, a, and a second reference data point c, which are shown in Fig. 1.
be the cumulative probability of the distance distribution D b at distance δx. Similarly, let F b (y) be the cumulative probability of the distance distribution D b at distance y. Thus, p a = F b (δx) and p c = F b (y) are the distributional ranks of a and c w.r.t the distribution of distances from b ∈ S. Similarly, define k a = np a and k c = np c as the corresponding expected ranks. Let δ be a real constant that is bounded as 0 < δ < y/x. Assume LID(b) exists and is positive. Let η be a sufficiently small real value that is bounded as 0 < η < min y δx − 1, LID(b) ln(ϕ)/| ln( δx y )| , where ϕ = min{ y+δxη y , y y−δxη }. For feasible values of η, there exists a positive integer n 0 > max{k a , k c } for which the following inequalities hold for all choices of integer n ≥ n 0 , Proof. For a given choice of n, with a, b, c, x and δ as defined above, we have p a = k a /n and p c = k c /n. Using the local ID characterization formula of the representation theorem (i.e., Theorem 4), we observe that where . (13) Following a logarithmic transformation and substituting for G F b,δx (y), we have It is assumed that F b (y) = F δx (y), which implies y = δx. Therefore, as per Houle [2017c], for some real value η such that 0 < η < y δx − 1, there must exist a sufficiently small distance value 0 < w such that any distance u where 0 < u < w, implies |LID(b) − ID F b (u) | < η. Therefore, the integral in (14) is bounded above by Furthermore, since η is defined as a small positive value, we bound η from above as where ϕ is the real valued variable ϕ = min y + δxη y , y y − δxη > 1.
Define n 0 as the minimum size of the data set for which F b is strictly positive and continuously differentiable within some open interval of distances with lower endpoint 0. For choices of η as defined above, whenever the size of the data set n is beyond the minimum (n ≥ n 0 ), we have, By rearranging (18), the we obtain Upon rearranging, we obtain Theorem 2 derives a lower-bound and an upper-bound for LID(b) using the cumulative probability values (of the distribution of distances from b) of the remaining two data points and the distances to them. Since the maximum value F b (δx) can have is one, we observe a strong association between the size of perturbations δ and the LID value of b. This theoretical result justifies the use of LID as an indicator to detect adversarial perturbations in prior works (Section 2). We now consider the relationship between LID and the direction of perturbations. The bounds in Theorem 2 hold for b irrespective of the perturbation directions. In Lemma 1, we present the conditions δ and θ must satisfy given the two possible directions of perturbation. In the following theorem, we fix δ, and consider the possible angles θ can take to obtain the greatest lower-bound and greatest lower-bound of (11) when b is perturbed away from c (relative to a) (refer Figure 3). Conversely, we obtain the least lower-bound and least upper-bound of (11) when b is perturbed towards c (refer Figure 4). Theorem 3. Denote the distances x = a − c , b − c as y and δx = a − b for an appropriate choice of 0 < δ < y/x. We denote the distributional ranks of a and c as p a = F b (δx) and p c = F b (y), and the distribution of distances from b ∈ S as D b . Assume LID(b) exists and is positive. Assume η is a sufficiently small real value that satisfies the constraints outlined in Theorem 2. Additionally, it satisfies the constraint 1 − 1 δ < η < 1 δ − 1. By considering the boundary values of cos θ as per Lemma 1, when b is perturbed farther from c (i.e., y > x), the greatest lower and upper bounds of (20) are as follows:

Additional Bounds based on the Perturbation Directions
.

(21)
Conversely, when b is perturbed towards c (i.e., y < x), the least lower and upper bounds of (20) are as follows: Proof. We consider the two possible directions of perturbation separately. Case 1: b perturbed farther from c First, we consider the case where b is perturbed farther from c (i.e., y > x). Using (7) on the denominator of the left inequality of (20), we obtain We then consider the upper boundary value of cos θ as shown in (9) (i.e., cos θ < δ/2), where we get Thus, for all feasible values of θ, we observe that ln( y δx + η) > ln( 1 δ + η). Therefore, by replacing ln( y δx + η) in (20) with ln( 1 δ + η), we obtain the following greatest lower bound for LID(b) The greatest upper bound of (21) can be obtained by replacing ln y δx − η with ln( 1 δ − η) following an identical approach.
Thus, from (25) and (26), we see that when b is perturbed farther from the reference sample c, the greatest lower and upper bounds of (20) are as follows: .

(27)
Case 2: b perturbed closer to c We now consider the case where b is perturbed towards c (i.e., y < x). Take the lower boundary value of cos θ as shown in (10) (i.e., cos θ > δ/2) in order to obtain the greatest possible denominator value as follows: Thus, for all feasible values of θ, we have ln( y δx + η) < ln( 1 δ + η). By replacing ln( y δx + η) in (22) with ln( 1 δ + η), we obtain the following least lower bound for LID(b) The least upper bound of (21) can be obtained by replacing ln y δx − η with ln( 1 δ − η) following an identical approach.
Therefore, from (29) and (30), we observe the least lower and upper bounds of (20) when b is perturbed towards from the reference sample c.
We note that in practice, as evidenced by the experimental results in the section that follows, attack algorithms tend to perturb data away from the domain of the benign data. Therefore, the most important result of Theorem 3 is the greatest lower-bound in (27). This greatest-lower bound further supports the strong association seen between the size of perturbations δ and the LID value of b.

Experimental Validation and Discussion
In this section, we empirically evaluate the lower-bound and upper-bound derived in Theorem 2 for the LID value of the perturbed data point b. Our code is available at https://github.com/sandamal/adversarial_lid_bounds.
To approximate the cumulative distributions of the distance variable (i.e., F b ), we first use kernel density estimation with a Gaussian kernel to obtain the probability density function of D b [Silverman, 2018]. Subsequently, the integral is calculated to obtain the cumulative distribution. We empirically evaluate the theoretical bounds on two real-world datasets: MNIST [LeCun et al., 2010] and CIFAR-10 [Krizhevsky, 2009]. The datasets contain 10,000 samples with 782 and 3,072 features respectively. It should be noted that, similar to the work of Amsaleg et al. [2020], the bounds hold asymptotically as the number of data samples n tends to infinity. However, due to the high computational complexity of kernel density estimation, we perform our experiments on a randomly sampled subset of data points with n ∈ {1000, 5000}.  We randomly select n q = 50 query points from each dataset (i.e., a) and select the perturbation direction using a gradient based attack [Goodfellow et al., 2015]. For the LID estimations (6) we select the neighborhood size k from {100, 1000}. For each query point a, we select the data point with the rank k/2 from it as the reference point (i.e., c).
We then obtain the perturbed points (i.e., b) by perturbing the query points in the direction that maximizes the training error (according to the attack algorithm). Figure 5 shows the empirical evaluations of the theoretical bounds in Theorem 2. It shows the averaged bounds for all feasible η values as well as the estimated LID values against the perturbation δ. As depicted in the figure, when δ increases, the lower-bound, LID estimate and the upper-bound increase. The most important indicator here is the lower-bound that increases with δ as it supports the intuition that LID values of adversarial samples tend to be larger.
It should be noted that when δ is close to zero, the bounds in (11) exhibit some numerical instability as F b (y) F b (δx), y δx + η and y δx − η tend to infinity. However, in practice, it is expected for adversarial perturbations to be sufficiently large in order to influence the learner's prediction capabilities. Therefore it is reasonable to expect δ to not be close to zero.
We observe similar numerical instabilities for (27) and (31) of Theorem 3 as well. Furthermore, when δ tends to one (i.e., the theoretical maximum value for which Theorem 3 theoretically holds), since η is a small positive value, we observe that both lower-bounds and upper-bounds in (27) and (31) tend to infinity. Although we have considered δ values up to 2.5 (which makes the maximum perturbation 2.5x), in practice, we observe that adversarial attacks tend to have bounded perturbations (to avoid detection).
As for the directions of perturbation, we observed that, on average, only 5.56% and 0.65% of the total perturbations were made in the direction towards the benign reference point c for MNIST and CIFAR-10 respectively. Intuitively, we expect a gradient-based attack that perturbs data in the direction that maximizes the training error to perturb data points away from the benign data domain. This finding, while preliminary, supports this intuition.

Conclusions
The purpose of this paper was to theoretically determine the relationship between the magnitude of the perturbations and the LID value of the resulting perturbed data point. To that end, we derived a lower-bound and an upper-bound for the LID value of a perturbed data point based on the cumulative probability (of its distance distribution) values to its original position and a third benign reference point. The bounds, in particular the lower-bound, showed that there is a positive association between the magnitude of the perturbation δ and the LID value of the perturbed point. We then empirically evaluated the effectiveness of these bounds on two reference data sets using a gradient-based poisoning attack. Furthermore, by considering the two possible directions of perturbation, we obtained the least lower-bound and upper-bound when the direction is towards the benign reference point and the greatest lower-bound and upper-bound when the direction is away from it. These findings support the use of LID as a tool to detect adversarial samples in prior state of the art works.