Next Article in Journal
Output Feedback Roll Control for Moving-Mass Actuated Reentry Vehicle with Full State Constraints
Previous Article in Journal
Hyper–Dual Numbers: A Theoretical Foundation for Exact Second Derivatives
Previous Article in Special Issue
Deep Reinforcement Learning Method for Wireless Video Transmission Based on Large Deviations
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Bilevel Models for Adversarial Learning and a Case Study

1
School of Mathematics and Statistics, Beijing Institute of Technology, Beijing 100081, China
2
Beijing Key Laboratory on MCAACI, Beijing 100081, China
*
Author to whom correspondence should be addressed.
Mathematics 2025, 13(24), 3910; https://doi.org/10.3390/math13243910
Submission received: 28 October 2025 / Revised: 1 December 2025 / Accepted: 3 December 2025 / Published: 6 December 2025
(This article belongs to the Special Issue Optimization Theory, Method and Application, 2nd Edition)

Abstract

Adversarial learning has been attracting more and more attention thanks to the fast development of machine learning and artificial intelligence. However, due to the complicated structure of most machine learning models, the mechanism of adversarial attacks is not well interpreted. How to measure the effect of attacks is still not quite clear. In this paper, we investigate the adversarial learning from the perturbation analysis point of view. We characterize the robustness of learning models through the calmness of the solution mapping. In the case of convex clustering models, we identify the conditions under which the clustering results remain the same under perturbations. When the noise level is large, it leads to an attack. Therefore, we propose two bilevel models for adversarial learning where the effect of adversarial learning is measured by some deviation function. Specifically, we systematically study the so-called δ -measure and show that under certain conditions, it can be used as a deviation function in adversarial learning for convex clustering models. Finally, we conduct numerical tests to verify the above theoretical results as well as the efficiency of the two proposed bilevel models.

1. Introduction

With the fast development of machine learning and artificial intelligence, adversarial learning is receiving growing attention. The first striking demonstration came from Szegedy et al. [1], who showed that imperceptible perturbations can reliably force modern neural networks to misclassify inputs, thereby exposing a fundamental vulnerability of high-capacity models. Goodfellow et al. [2] provided a concise explanation and practical attack algorithm so-called the Fast Gradient Sign Method (FGSM) for fast, effective adversarial example synthesis, and thus enabled a set of adversarial-training defenses. Kurakin et al. [3] showed that adversarial training can be implemented on larger-scale datasets such as ImageNet, and further revealed that this approach leads to a significant improvement in the robustness of one-step methods. Roberts and Smyth [4] analyzed stochastic gradient descent under Byzantine adversaries, highlighting robustness issues that also arise in distributed or large-scale settings. Chhabra et al. [5] presented a black-box adversarial attack algorithm for clustering models with linearly separable clusters. Later, Chhabra et al. [6] proposed a black-box adversarial attack against deep clustering models. We refer to [7,8,9] for the review and monographs of adversarial learning.
Following widely adopted taxonomies, adversarial attacks can be divided into three types based on attacker’s knowledge: white-box (full access to parameters/gradients), black-box (only queries or input–output pairs), and gray-box in between. Due to different goals of attacks, it can also be classified as confidence reduction, untargeted misclassification, and targeted misclassification. A large body of work has been devoted to designing powerful white-box attacks such as FGSM [2] and its iterative variants and decision-boundary-based attacks like DeepFool [10]. Feinman et al. [11] proposed detecting adversarial samples using kernel density estimates in the feature space of the last hidden layer together with Bayesian uncertainty estimates. Ahmed et al. [12] systematically evaluate four representative deep learning attacks against intrusion-detection models on cybersecurity datasets and compare several defense strategies, highlighting how different combinations of attacks and defenses affect the robustness and accuracy of such systems. Madry et al. [13] cast adversarial training as min–max robust optimization and used multi-step PGD as a strong white-box baseline for l p -bounded threats. Dong et al. [14] added momentum to iterative gradients to improve black-box transferability over standard iterative attacks. Brendel et al. [15] proposed boundary attack that needs only top 1 decisions, walking along the boundary while shrinking perturbations. Papernot et al. [16] targeted a specific label by perturbing a small, saliency chosen set of pixels (sparse L 0 -style attack). Eykholt et al. [17] showed sticker-based perturbations that reliably fool traffic-sign recognition in the real world.
While most exciting literature focuses on developing efficient algorithms to solve adversarial learning model, understanding the mechanism is also extremely crucial in order to improve the robustness of learning models. Below, we briefly review some related literature that motivates our work in this paper. Moosavi-Dezfooli et al. [10] introduced the DeepFool attack, viewing adversarial perturbations as minimal crossings of local decision boundaries. By iteratively linearizing the classifier, it linked perturbations to decision region geometry and provided a principled way to approximate the smallest such perturbations. Carlini and Wagner [18] formalized perturbation attacks as optimization problems with tailored loss functions, showing attack strength depends critically on objective function and constraint choices. Ilyas et al. [19] offered a feature-based view, arguing that adversarial perturbations exploit non-robust features: predictive yet human-imperceptible statistical patterns. This shifted the focus from geometry to data representation. Su, Li, and Cui [20] systematically studied three types of adversarial perturbations, deriving the explicit solutions for sample-adversarial perturbations (sAP), class-universal adversarial perturbations (cuAP), and universal adversarial perturbations (uAP) for binary classification, and approximated the solution for uAP multi-classification case. Later, Su and Li [21] addressed the difficulty of generating sAP for nonlinear SVMs via implicit mapping by transforming the perturbation optimization into a solvable nonlinear KKT system.
On the other hand, clustering is a popular yet basic model in machine learning. The study of clustering technology dates back at least to the pioneering work of Driver and Kroeber [22], who quantified cultural relationships by similarity analysis in anthropology, as well as Tryon’s monograph on cluster analysis in psychology [23]. Since then, many clustering algorithms have been developed, including early agglomerative hierarchical methods based on nearest-neighbour graphs and minimum-variance criteria [24,25], the K-means algorithm and its modern variants [26,27], density-based methods such as DBSCAN [28] and OPTICS [29], and the more recent density peaks clustering algorithm (DPC) [30,31]. We refer the reader to the surveys and monographs [32,33] for the vast literature on clustering methods and their applications. Below we mainly focus on convex clustering, which is most related to our paper.
Convex clustering model was initially proposed by Pelckmans et al. [34], and was studied in [35,36]. The idea of convex clustering model is as follows. If two observations belong to the same cluster, then their corresponding centroids should be the same. Convex clustering model [35,36,37,38,39,40] has several advantages, such as the uniqueness of solution and theoretical guarantee of cluster recovery. To deal with high dimensional data clustering, Yuan et al. [41] proposed a dimension reduction technique for structured sparse optimization problems. Ma et al. [42] proposed an improved robust sparse convex clustering (RSCC) model, which incorporates a novel norm-based feature normalization technique to effectively identify and eliminate outlier features. Angelidakis et al. [43] developed improved algorithms for stable instances of clustering problems with center-based objectives, including K-means, K-median and K-center. However, the adversarial attack case for clustering remains untouched.
To summarize, due to the complicated structure of different learning models, most adversarial attacks are difficult to interpret. Therefore, a natural question is whether we can understand the attack for a simple learning model. This motivates our work. In this paper, we study the mechanism of adversarial attack on clustering models. The contribution of the paper can be summarized as follows. (i) Firstly, we start with the perturbation of learning models, and we qualify the robustness of the solution set of learning models under perturbation by calmness. By doing so, the robustness of learning models can be clearly analyzed by the calmness property of the solution mapping. (ii) As a case study, we identify the conditions for the robustness of convex clustering model. That is, under those conditions, the convex clustering model provides unchanged clustering results under perturbation. (iii) We introduce two bilevel optimization models for adversarial learning. In particular, we formulate two bilevel adversarial learning models based on the convex clustering model. (iv) We propose and analyze deviation measures that quantify the impact of adversarial perturbations. In particular, we study the so-called δ -measure and examine its behaviour in a series of 2-way and 3-way clustering examples. We also generalize it to arbitrary K-way clustering. (v) Finally, we verify the above theoretical results and the efficiency of two proposed models by numerical results on the state-of-the-art datasets. The experiments show that convex clustering is robust to moderate perturbations, while larger perturbations produce a clear staircase behaviour of deviation δ and N chg . We also compare the direct method and fmincon on the different UCI datasets and find that RI-based function can be used as a reasonable deviation function, whereas NMI can’t.
The organization of the paper is as follows. In Section 2, we investigate the perturbation of learning models and relate the sensitivity of solution mapping to the so-called calmness property in the context of perturbation analysis. In Section 3, we study the effect of perturbation on the convex clustering model and provide some examples. In Section 4, we propose the bilevel optimization models for adversarial learning. In Section 5, we study the so-called δ -measure function to show the well-definedness as the measure of adversarial attack. In Section 6, we conduct numerical experiments to verify the theoretical results and the efficiency of bilevel models. Final conclusions are given in Section 7.
Notations. We use · as l 2 norm for vectors and Frobenius norm for matrices. We use | V | to denote the number of elements in a set V.

2. Perturbation of Learning Models

In this part, we will start with the learning model, based on which we will address the perturbation of learning models.

2.1. Learning Model

Let X X be the training data, Y Y be the model parameter in a learning model. The learning process (also referred to as training process) is to find the model parameter Y * by solving the following model:
min Y F ( X ) L ( X , Y )
where L ( X , Y ) is the objective of the training model, F ( X ) Y is the feasible set of Y, which may be affected by the training data X. Let Y * be the optimal solution of (1), which may not be unique. The solution set of (1) is denoted as S .
Let the decision function be D Y * ( · ) , where D Y * ( x ) gives the final decision of a new data x. For example, for binary classification model, D Y * ( x ) is the sign function which gives the label of data x, by applying the learning result Y * . Specifically, we give two simple examples below.
Example 1. 
Support Vector Machine (SVM) for binary classification [44], where X = x 1 y 1 , , x n y n R ( d + 1 ) × n , Y = ( ω , b ) R d + 1 , with the learning model
min ( ω , b ) R d + 1 1 2 ω 2 + C i = 1 n max 0 , 1 y i ( ω x i + b ) 2 : = L S V M ( X , Y ) .
The optimal solution of (2) is denoted as ( ω * , b * ) . The decision function D ( ω * , b * ) S V M ( x ) = sign ( ω * x + b * ) { 1 , 1 } .
Example 2. 
Convex Clustering [40], where X = [ x 1 , , x n ] R d × n , Y = [ y 1 , , y n ] R d × n with the learning model
min Y R d × n L C V C ( X , Y ) = 1 2 i = 1 n y i x i 2 + γ 1 i < j n w i j y i y j p
where γ > 0 , w i j 0 , i , j = 1 , , n are given. The optimal solution of (3) is Y * = [ y 1 * , , y n * ] R d × n . The decision function (i.e., the clustering result) is given by
D Y * C V C = { V 1 , , V K } ,
where { V 1 , , V K } is a partition of { 1 , , n } and x i and x j are in the same partition if y i * = y j * . Since L C V C ( · , · ) is also strongly convex in Y, Y * is the unique solution of (3). That is, S is a single singleton.
Remark 1. 
For most complicated learning models such as convolutional neural network (CNN), it is usually difficult to write down an explicit objective function L ( X , Y ) and the associated decision function D Y * . This makes it challenging both to solve the corresponding bilevel adversarial learning models and to interpret the role of adversarial perturbations in a precise way.

2.2. Perturbation of Learning Models

Having introduced the learning model, we are ready to consider the perturbation of the learning model. For general optimization problems, the perturbation analysis is fully addressed in [45]. In the case of noise, let X ( ε ) be the noised training data set where ε X is the perturbation (or noise), the output of the learning model under the perturbation ε is as follows.
min Y F ( X ( ε ) ) L ( X ( ε ) , Y )
where F ( X ( ε ) ) Y is the feasible set of Y, which may be affected by the noised training data X ( ε ) . Let Y * ( ε ) denotes the optimal solution of the learning model under perturbation ε and S ( ε ) denotes the solution set of (5).
It is obvious that X ( 0 ) = X and S ( 0 ) = S . Here we would like to highlight that due to different learning models, the form of ε could be different. If X = R k × n , then ε could be the additive noise or multiplicative noise. The noise can also be point-wise modifications or feature-level modifications. If X is in the graph space in graph clustering, i.e., X = G = ( V G , E ) | | V G | = n , E is any set of edges on V G , then X ( ε ) could be the graph-based perturbation that removes vertices or changes some edges from the current graph X.
Intuitively, if the perturbation ε on data is relatively small, Y * ( ε ) may still be different from Y * (Note that Y * ( 0 ) = Y * . For simplicity, we always use Y * instead of Y * ( 0 ) .), leading to possibly small changes in S ( ε ) compared to S. If we take S ( ε ) as a multifunction of ε , one way to measure the changes in the solution set S ( ε ) under the perturbation ε is calmness, which is a useful property in perturbation analysis. We give the definition below.
Definition 1 
(Calmness, ([46], Definition 2)). Let S ( ε ) = arg min Y F ( X ( ε ) ) L ( X ( ε ) , Y ) be a multifunction with a closed graph, denoted as gph S ( ε ) , and ( ε ¯ , Y ¯ ) gph S ( ε ) . We say that S ( · ) is calm at ( ε ¯ , Y ¯ ) provided that there exist neighborhoods N ε of ε ¯ and N Y of Y ¯ , and a modulus L 0 , such that
S ( ε ) N Y S ( ε ¯ ) + L ε ε ¯ B f o r a l l ε N ε ,
where B denotes the closed unit ball in X and gph S ( ε ) : = { ( ε , Y ) : Y S ( ε ) } .
Based on the definition of calmness, one can see that the calmness of S ( · ) at ε = 0 is particularly useful for measuring the changes of S ( ε ) relative to S ( 0 ) . We formally give it below.
Definition 2 
(Calmness at ε = 0 ). S ( · ) is calm at ( 0 , Y ¯ ) if there exist neighborhoods N ε of 0, N Y of Y ¯ , and a modulus L 0 > 0 such that
S ( ε ) N Y S + L 0 ε B f o r a l l ε N ε .
Therefore, one can see that if S ( · ) is calm at 0, then the changes in the solution set S ( ε ) can be controlled by the changes in ε (up to the scalar L 0 ). In other words, the robustness of the learning model L ( · , · ) is closely related to the calmness of the solution set S ( · ) . For a set S ( · ) , there are various ways to check calmness [47,48,49]; moreover, Zhou and So [50] provided an equivalent characterization by showing that the error bound property holds if and only if a suitably defined solution mapping is calm, and we will not discuss the details here.
Having successfully measured the changes in S ( ε ) due to the perturbation ε , we move on to see whether there is any change in the decision function D Y * ( · ) . Even when the solution set S ( ε ) changes, it is still possible that the decision function remains the same. The reason is as follows. In many learning tasks, the decision function is discontinuous, for example, binary classification as shown in Example 1. In other words, for such situation, the perturbation ε does not have an effect on the learning result. We can regard ε as neglectable noise in this case. Therefore, the question we would like to ask is as follows: under what condition on ε , the decision function is not changed, i.e., D Y * ( ε ) = D Y * ? The question is not easy to answer. As we mentioned before, this is also highly related to the specific form of the learning model. We will address this question in Section 3, by looking at the convex clustering model as an example.

3. Perturbation Analysis for Convex Clustering

In this section, we take clustering as an example to study the effect of perturbation. We choose the convex clustering model due to the following reasons. Firstly, the strong convexity of L C V C ( · ) guarantees the unique solution of (3), that is, S ( ε ) is a singleton for each ε . Secondly, there are exact recovery theoretical results under proper assumptions, which states that under some conditions, the solution of (3) perfectly recovers the ground truth clustering. Finally, Ssnal [40] was proposed to solve (3) which is proved to be highly efficient. We will use it to solve (3) in our numerical experiments. We start with the case where the small perturbation will not change the clustering result.
Let X = [ x 1 , , x n ] be the data and V = { V 1 , , V K } be a partitioning of X and K is the number of clusters. The index sets are defined by
I α : = i x i V α , n α = | I α | , for α = 1 , 2 , , K , x ( α ) = 1 n α i I α x i , w ( α , β ) = i I α j I β w i j , α , β = 1 , , K , w i ( β ) = j I β w i j , i = 1 , , n , β = 1 , , K .
The following result shows the exact recovery result of the learning model (3).
Theorem 1 
([40], Theorem 5). Consider the input data X = x 1 , , x n R d × n and its partitioning V = V 1 , V 2 , , V K . Assume that all centroids x ( 1 ) , x ( 2 ) , , x ( K ) are distinct. Let q 1 be the conjugate index of p such that 1 p + 1 q = 1 . Y * is the unique solution of (3) and define the map f x i = y i * for i = 1 , , n . Let
μ i j ( α ) : = β = 1 , β α K w i ( β ) w j ( β ) , i , j I α , α = 1 , 2 , , K .
Assume that
w i j > 0 a n d n α w i j > μ i j ( α ) f o r a l l i , j I α , α = 1 , , K .
Let
γ min : = max 1 α K max i , j I α x i x j q n α w i j μ i j ( α ) , γ max : = min 1 α < β K x ( α ) x ( β ) q 1 n α 1 l K , l α w ( α , l ) + 1 n β 1 l K , l β w ( β , l ) .
If
γ m i n < γ m a x
and γ is chosen such that γ γ min , γ max , then the map f perfectly recovers V .
Theorem 1 shows that if conditions (6) and (7) hold, then the clustering result D Y * C V C coincides with the ground truth partition of X. That is, D Y * C V C = V . One can see that the exact recovery is based on conditions (6) and (7). Moreover, (6) and (7) are calculated based on the ground truth partition V as well as the data X. Given the perturbed data X ( ε ) , one can make use of Theorem 1 and provide a sufficient condition under which the clustering result is unchanged under perturbation ε . To that end, let X ( ε ) = [ x 1 ( ε ) , , x n ( ε ) ] be the perturbation of X R d × n with ε R d × n . Under the partition of D Y * C V C = V 1 , V 2 , , V K , we define the following notations
x ( α ) ( ε ) = 1 n α i I α x i ( ε ) , w ( α , β ) ( ε ) = i I α j I β w i j ( ε ) , α , β = 1 , , K , w i ( β ) ( ε ) = j I β w i j ( ε ) , i = 1 , , n , β = 1 , , K .
Here we use x ( α ) ( ε ) , w ( α , β ) ( ε ) and w i ( β ) ( ε ) to mean that those coefficients may be related to the perturbation ε .
Theorem 2. 
Consider the perturbed data X ( ε ) = [ x 1 ( ε ) , , x n ( ε ) ] R d × n and the partitioning D Y * C V C = V 1 , V 2 , , V K . Let x ( α ) ( ε ) , w ( α , β ) ( ε ) and w i ( β ) ( ε ) be defined as in (8). Assume that all centroids x ( 1 ) ( ε ) , , x ( K ) ( ε ) are distinct. Let q 1 be the conjugate index of p such that 1 p + 1 q = 1 . Let Y * ( ε ) = [ y 1 * ( ε ) , , y n * ( ε ) ] be learned via (3) in Example 2 and f ε : X ( ε ) Y * ( ε ) is given by f ε ( x i ε ) = y i * ( ε ) . Let μ i j ( α ) ( ε ) : = β = 1 , β α k w i ( β ) ( ε ) w j ( β ) ( ε ) , i , j I α , α = 1 , , K . Assume that
w i j ( ε ) > 0 a n d n α w i j ( ε ) > μ i j ( α ) ( ε ) f o r a l l i , j I α , α = 1 , , K .
Let
γ min ε : = max 1 α K max i , j I α x i ( ε ) x j ( ε ) q n α w i j ( ε ) μ i j ( α ) ( ε ) ,
γ m a x ε : = min 1 α < β K x ( α ) ( ε ) x ( β ) ( ε ) q 1 n α 1 l K , l α w ( α , l ) ( ε ) + 1 n β 1 l K , l β w ( β , l ) ( ε ) .
If
γ m i n ε < γ m a x ε
and γ is chosen such that γ [ γ m i n ε , γ m a x ε ) , then D Y * ( ε ) C V C = D Y * C V C , i.e., the clustering result is unchanged.
Proof. 
By applying ([40], Theorem 5) with the ground truth partitioning V = D Y * C V C , and X replaced by X ( ε ) , we get that the mapping f ε : X ( ε ) Y * ( ε ) recovers the partitioning V . That is, D Y * ( ε ) C V C is the same as D Y * C V C . The proof is finished.    □
We demonstrate this by the following one-dimension example with two clusters, that is, d = 1 and K = 2 . We use the weighted matrix W = ( w i j ) = E n ( E n 1 denotes the matrix of size n 1 × n 1 whose elements are all ones) and p = 2 . We only consider adding perturbation to a specific data. The solution of (3) is obtained by running the algorithm semismooth Newton-CG augmented Lagrangian method (Ssnal) (https://www.polyu.edu.hk/ama/profile/dfsun//Codes/Statistical-Optimization/ (accessed on 18 November 2025)) in [40].
Example 3. 
Let X = [ 0 , 2 , 10 , 14 ] R 1 × 4 , as shown in Figure 1. The solution of convex clustering model in (3) is Y * = [ 1 , 1 , 12 , 12 ] , with decision function V = D Y * C V C = { 1 , 2 } , { 3 , 4 } .
We perturb only on x 3 . Let X ( ε ) = [ 0 , 2 , 17 , 14 ] , that is, ε = [ 0 , 0 , 7 , 0 ] . We can easily see that μ 12 ( 1 ) ( ε ) = 0 , μ 34 ( 2 ) ( ε ) = 0 . Moreover, n α w i j ( ε ) μ i j ( α ) ( ε ) = n α > 0 , f o r a l l i , j I α , α = 1 , 2 , and γ min ε = max 2 2 , 3 2 = 3 2 < γ max ε = 14.5 4 = 29 8 . Therefore, conditions (9) and (10) hold and D Y * ( ε ) C V C = D Y * C V C . In fact, the solution of (3) gives Y * ( ε ) = [ 1 , 1 , 15.5 , 15.5 ] .
Following Example 3, we can similarly calculate that for any ε 3 6 5 , 38 3 , that is, x 3 ( ε ) 44 5 , 68 3 , conditions (9) and (10) both hold, implying that the clustering results will not be changed. This is indeed the truth since one can verify it by eyesight (See Figure 2).
In fact, if ε does not satisfy (9) or (10), it is very likely that the clustering result will change compared with the unperturbed clustering result. Below we give another example to show this phenomenon.
Example 4. 
Let X = [ 0 , 2 , 10 , 14 ] , V = D Y * C V C = { 1 , 2 } , { 3 , 4 } . Let X ( ε ) = [ 0 , 2 , 4 , 14 ] with ε = [ 0 , 0 , 14 , 0 ] . One can see that μ 12 ( 1 ) ( ε ) = 0 , μ 34 ( 2 ) ( ε ) = 0 , implying that n α w i j ( ε ) u i j ( α ) ( ε ) > 0 , f o r a l l i , j I α , α = 1 , 2 . However, γ min ε = max 2 2 , 18 2 = 9 > γ max ε = 4 4 = 1 . That is, condition (10) fails. In fact, Y * ( ε ) = [ 0.6667 , 0.6667 , 0.6667 , 14 ] , which gives D Y * ( ε ) C V C = { 1 , 2 , 3 } , { 4 } . Indeed, it can be noticed from Figure 3 that D Y * ( ε ) C V C D Y * C V C .
The above example gives rise to another interesting question: how to choose ε in order to make the clustering result change? In fact, we have the following necessary condition for changing the clustering results.
Corollary 1. 
If D Y * ( ε ) C V C D Y * C V C , then either (9) or (10) fails for perturbed data X ( ε ) under partition D Y * C V C .
Proof. 
Assume for contradiction that ε satisfies both (9) and (10) with perturbed data X ( ε ) under partition D Y * C V C . By Theorem 2, it holds that D Y * ( ε ) C V C = D Y * C V C , implying that the clustering results for X ( ε ) will remain the same as X, which is a contradiction. Therefore, the proof is finished.    □
Here we would like to highlight the following two important issues.
(i)
The assumptions of distinct centroids and strictly positive weights, which appear in Theorem 2, are inherited from the recovery result of convex clustering ([40], Theorem 5) and are standard in that context. These conditions ensure that the convex clustering model admits a unique, well-separated partition and allow us to derive clean sufficient conditions under which this partition is preserved under perturbations. For practical clustering problems, these assumptions may fail, putting the exact recovery in question. Therefore, it would be interesting to further study the exact recovery result when the above assumptions fail. We leave this interesting question as our future research topic to study.
(ii)
As mentioned in Section 2.2, the perturbation of X ( ε ) can be in various forms. The results in Theorem 2 and Corollary 1 hold not only for the additive point-wise noise, but also hold for other noise situations, such as multiplicative noise, feature-level noise.
To conclude this section, we give a short summary. We discussed the role of ε in the perturbation of convex clustering. In Theorem 2, we identified conditions on ε under which the clustering result remains the same. We also provided a necessary condition on ε in order that the clustering result can be changed.

4. Bilevel Model for Adversarial Learning

In this part, we will reformulate adversarial learning by bilevel optimization models. For general modeling and algorithmic background on bilevel optimization, see [51,52].
As we mentioned in Section 3, the perturbation ε on X may lead to the changed decision function, which means that the learning model is robust. On the other hand, the perturbation ε on X may lead to the change in decision result D Y * ( ε ) . It has two implications. Firstly, it means that such kind of noise is not neglectable. One needs to either do the denoising process to get rid of such noise or to improve the training process to make the learning model more robust. Secondly, from data attacking point of view, attack happens in such situation. In this case, a question arises: how could we choose the perturbation ε such that some attacking criteria is maximized or minimized? This leads to the following two models for adversarial learning. The first model is to make the output of the perturbed learning model have as huge of a difference as possible compared to the original learning model, which is described as ( a > 0 is given)
max ε X U ε s . t . Y * ( ε ) S ( ε ) , ε a ,
where U ( · ) : X R is defined to be the deviation function which measures the effect of attack, that is, the changes in decision D Y * ( ε ) compared with the decision D Y * . To make U ( · ) well representing the effect of attack, U ( · ) must have the following properties:
(i)
U ε should be a nondecreasing function with respect to ε .
(ii)
U ε 0 for any ε X , in particular, U ε > 0 if ε 0 .
(iii)
U 0 = 0 . That is, if there is no perturbation ( ε = 0 ), the deviation should be zero.
In (11), the constraint ε a controls the magnitude of ε , so that the perturbation is not too large. Otherwise, it would be easily detected and the attack would fail. In practice, the threshold a can be calibrated using prior knowledge on admissible noise levels in a given application. For example, many clustering robustness studies explicitly test algorithms under injected noise ratios around 15 % to 30 % , such as adding 30 % uniform or Gaussian noise to the data [53,54], and one may choose a in accordance with such empirical noise levels. One can see that (11) is a bilevel optimization problem where Y * ( ε ) S ( ε ) describes the lower level problem, saying that Y * ( ε ) must be the solution of (5).
The second model is to minimize the scale of perturbation ε , such that the attacking effect reaches the prescribed effect level δ 0 > 0 . That is,
min ε X ε s . t . Y * ( ε ) S ( ε ) , U ε δ 0 .
Remark 2. 
U ( · ) is usually difficult to design due to different learning models. As far as we know, there is little work focusing on developing efficient deviation function, which is in fact important to the two adversarial learning models. We will address this question in the scenario of clustering, which can be found in Section 5.
Bilevel models (11) and (12) are flexible to accommodate many concrete learning tasks. At the lower level, one may take l 2 -regularized least squares, logistic regression, Support Vector Machines, or deep neural networks [55,56]. The deviation function U ( · ) may take prediction loss on a validation set or robust loss in adversarial training [13,57]. Moreover, U ( · ) may also represent robustness-oriented criteria inspired by risk-driven anti-clustering, such as the risk-weighted diversity objective used to partition training data in [58]. Exploring these deviation choices within our bilevel models thus offers several promising directions for future research.
Various approaches can be explored to solve the adversarial model (11). For the white-box setting, where the lower-level model is fully accessible, many approaches can be employed, such as the KKT-based approaches [59,60], value-function-based approaches [61,62], the duality-based approaches [63,64] and the hypergradients-based approaches [65,66,67]. On the other hand, the bilevel model also applies to black-box attacks. In such cases, the lower-level model does not admit explicit mathematical formula, one may use evolutionary strategies [68,69] or derivative-free methods [70,71] to solve (11).
Comparing (12) with (11), (12) is usually more challenging to solve. The reason is that the feasible region of U ε δ 0 is difficult to explicitly represent due to the implicit form of Y * ( ε ) . Therefore, how to design efficient algorithms to solve (12) is an interesting topic which is worth further investigation.
For convex clustering problem, bilevel models (11) and (12) reduce to the following form
max ε X U ε s . t . Y * ( ε ) arg min Y R d × n L C V C ( X ( ε ) , Y ) , ε a ,
min ε X ε s . t . Y * ( ε ) arg min Y R d × n L C V C ( X ( ε ) , Y ) , U ε δ 0 .
We will discuss how to choose U ( · ) for clustering in the following section.

5. A Case Study on Deviation Functions

In this part, we will study the δ -measure function in adversarial learning for clustering problems, to verify whether it is a deviation function.
As we mentioned above, due to the different structures of learning models as well as the variants of decision functions, the deviation function on the decision function can be in many different forms. Taking the binary classification as an example, the deviation function can be chosen as the norm of difference in the classification results, i.e.,
U ε = i = 1 n D Y * ( ε ) S V M x i ( ε ) D Y * S V M ( x i ) p
where · p is l p norm ( 1 p ) or · 0 , which counts the nonzero elements of a vector.
For clustering problems, recall the aim of clustering is to partition the data points into different groups, i.e., D Y * ( ε ) C V C is a partition of points in X ( ε ) , there are many different ways of measuring the clustering results. See [72,73] for some of the clustering functions. One natural way is to use a matrix to represent the partition of points. Take V = { V 1 , , V K } as an example. A 0-1 matrix D ^ ( X ) R n × K is defined as follows:
D ^ ( X ) i j = 1 , if x i V j , 0 , otherwise .
Then the matrix D ^ ( X ) D ^ ( X ) T actually shows whether data points are grouped together, where
D ^ ( X ) D ^ ( X ) T i j = 1 , if x i , x j are in the same partition , 0 , otherwise .
The following function is proposed by Biggio et al. [74]:
δ ( ε ) = D ^ ( Y * ( ε ) ) D ^ ( Y * ( ε ) ) T D ^ ( Y * ) D ^ ( Y * ) T F 2 .
Chhabra et al. [5] believed that δ increases with the number of points that spill over from partition V 1 to V 2 for K = 2 . However, it is still not quite clear about whether this function can fully represent the deviation of D Y * ( ε ) over the original D Y * . Therefore, below we conduct a systematic analysis on the property of δ defined in (15). We consider the following two scenarios.

5.1. Analysis on 2-Way Clustering

K = 2 , with X R d × n clustered into V 1 and V 2 with | V 1 | = n 1 , | V 2 | = n 2 . Let n = n 1 + n 2 . Assume that under perturbation ε , the clustering of X ( ε ) is changed to V 1 S , V 2 S , where S V 1 , | S | = s . We have the following result.
Theorem 3. 
For 2-way clustering, let δ ε be defined by (15).
(i) 
δ ε = 2 s ( n s ) .
(ii) 
If s < min ( n 1 , n 2 ) (Here a denotes the smallest integer that is greater than or equal to a.), δ ε is a deviation function.
Proof. 
For simplicity, we use D ^ ( ε ) and D ^ ( 0 ) to represent D ^ ( Y * ( ε ) ) and D ^ ( Y * ) . For (i), without loss of generality, let V 1 = { x 1 , , x n 1 } , V 2 = { x n 1 + 1 , , x n } . Then it holds that
D ^ ( 0 ) = e n 1 0 0 e n 2 R n × 2 , D ^ ( 0 ) D ^ ( 0 ) T = E n 1 0 0 E n 2 R n × n ,
where e n 1 is the column vector of length n 1 whose elements are all ones and E n 1 denotes the matrix of size n 1 × n 1 whose elements are all ones. Here ‘0’ denotes the zero vector or matrix of proper sizes. By changing the last s data points in V 1 to V 2 , we have
D ^ ( ε ) = e n 1 s 0 0 e n 2 + s R n × 2 , D ^ ( ε ) D ^ ( ε ) T = E n 1 s 0 0 E n 2 s R n × n ,
leading to the following ( E i × j denotes the matrix of i by j with all elements one)
D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T = 0 E ( n 1 s ) × s 0 E s × ( n 1 s ) 0 E s × n 2 0 E n 2 × s 0
and
δ ε = D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T F 2 = 2 ( n s ) s .
This gives (i).
To show (ii), obviously, δ ( 0 ) = 0 and δ ε > 0 for any Y * ( ε ) Y * ( 0 ) . Moreover, note that 0 < s < n 1 , therefore, as s increases for s ( 0 , min ( n 1 , n 2 ) ) , δ ( · ) is a nondecreasing function with respect to s. In other words, only when s ( 0 , min ( n 1 , n 2 ) ) , δ is a deviation function with respect to s.    □
We give some examples as follows.
Example 5. 
Let X = [ x 1 , , x 5 ] with partition V 1 = { x 1 , x 2 , x 3 , x 4 } and V 2 = { x 5 } , which means n 1 = 4 and n 2 = 1 . It holds that
D ^ ( 0 ) = e 4 0 0 e 1 R 5 × 2 .
Changing x 4 from V 1 to V 2 , we get V 1 = { x 1 , x 2 , x 3 } and V 2 = { x 4 , x 5 } , leading to the following
D ^ ( ε ) = e 3 0 0 e 2 .
Therefore, δ ε = D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T F 2 = 8 .
Example 6. 
Let X and V 1 , V 2 be the same as in Example 5. Changing x 3 , x 4 from V 1 to V 2 , to get V 1 = { x 1 , x 2 } and V 2 = { x 3 , x 4 , x 5 } , we get
D ^ ( ε ) = e 2 0 0 e 3 ,
which gives δ ε = 12 .
Example 7. 
Let X and V 1 , V 2 be the same as in Example 5. Changing x 2 , x 3 , x 4 from V 1 to V 2 to get V 1 = { x 1 } and V 2 = { x 2 , x 3 , x 4 , x 5 } , we get
D ^ ( ε ) = e 1 0 0 e 4 ,
which also leads to δ ε = 12 .
Comparing Example 6 and Example 7, the number of changed data is increasing. However, the deviation function δ is the same. In this case, s = 3 > n 2 in Example 7, implying that δ can not fully represent the deviation of the perturbed clustering results over the original clustering results.
In summary, Theorem 3 as well as the above examples show that choosing a proper deviation function U is very important. However, sometimes it is difficult and even tricky to choose a good function which satisfy deviation properties (i)–(iii). Also, when dealing with adversarial learning models, we have to be very careful in order to choose a good deviation function since the chosen function may not fully reflect the changes in perturbation decision function after perturbation.

5.2. Analysis on 3-Way Clustering

K = 3 , with X R d × n clustered into V 1 , V 2 , V 3 with | V i | = n i , i = 1 , 2 , 3 , and n = i = 1 3 n i . After perturbation, the cluster changes to V 1 ( S 1 S 2 ) , V 2 S 1 , V 3 S 2 , where | S 1 | = s 1 , | S 2 | = s 2 .
Theorem 4. 
For 3-way clustering, it holds that
δ ε = ( s 1 + s 2 ) 2 n 1 ( s 1 + s 2 ) + s 1 ( 2 n 2 s 1 ) + s 2 ( 2 n 3 s 2 ) .
In particular,
(i) 
If S 2 = , δ ε = 2 s 1 ( n s 1 ) . Then δ ( · ) is a deviation function.
(ii) 
If n 1 = n 2 = n 3 and s 1 = s 2 , δ ε = 2 s 1 4 3 n 3 s 1 . Then δ ( · ) is a deviation function.
(iii) 
If s 1 = s 2 , δ ε = s 1 ( 4 n 1 + 2 n 2 + 2 n 3 6 s 1 ) . For s 1 0 , min 2 n 1 + n 2 + n 3 6 , n 1 2 , δ ( · ) is a deviation function.
Proof. 
Without loss of generality, assume that V 1 = { x 1 , , x n 1 } , V 2 = { x n 1 + 1 , , x n 1 + n 2 } , V 3 = { x n 1 + n 2 + 1 , , x n } . It holds that
D ^ ( 0 ) = e n 1 0 0 0 e n 2 0 0 0 e n 3 R n × 3 , D ^ ( 0 ) D ^ ( 0 ) T = E n 1 0 0 0 E n 2 0 0 0 E n 3 R n × n .
Now a subset of data points S 1 V 1 changes their cluster membership from V 1 to V 2 and a subset of data points S 2 V 1 changes their cluster membership from V 1 to V 3 . It holds that
D ^ ( ε ) = e n 1 ( s 1 + s 2 ) 0 0 0 e s 1 0 0 0 e s 2 0 e n 2 0 0 0 e n 3 R n × 3 , D ^ ( ε ) D ^ ( ε ) T = E n 1 ( s 1 + s 2 ) 0 0 0 0 0 E s 1 0 E s 1 × n 2 0 0 0 E s 2 0 E s 2 × n 3 0 E n 2 × s 1 0 E n 2 0 0 0 E n 3 × s 2 0 E n 3 R n × n ,
leading to the following
D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T = 0 E ( n 1 ( s 1 + s 2 ) ) × s 1 E ( n 1 ( s 1 + s 2 ) ) × s 2 0 0 E s 1 × ( n 1 ( s 1 + s 2 ) ) 0 E s 1 × s 2 E s 1 × n 2 0 E s 2 × ( n 1 ( s 1 + s 2 ) ) E s 2 × s 1 0 0 E s 2 × n 3 0 E n 2 × s 1 0 0 0 0 0 E n 3 × s 2 0 0 .
After calculation, we get
δ ( ε ) = D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T F 2 = ( n 1 ( s 1 + s 2 ) ) ( s 1 + s 2 ) + s 1 ( n 1 s 1 + n 2 ) + s 2 ( n 1 s 2 + n 3 ) + n 2 s 1 + n 3 s 2 = 2 ( n 1 ( s 1 + s 2 ) + n 2 s 1 + n 3 s 2 ) ( ( s 1 + s 2 ) 2 + s 1 2 + s 2 2 ) = ( s 1 + s 2 ) ( 2 n 1 ( s 1 + s 2 ) ) + s 1 ( 2 n 2 s 1 ) + s 2 ( 2 n 3 s 2 ) .
This gives the first part of the results.
For (i), S 2 = . In this case, the third cluster V 3 does not play any role. Then δ ( · ) reduces to 2 s 1 ( n 1 + n 2 s 1 ) , which coincides with the results in Theorem 3.
For (ii), if n 1 = n 2 = n 3 , s 1 = s 2 , δ ( · ) takes the following form (note that s = s 1 + s 2 = 2 s 1 )
δ ( ε ) = 2 s 1 ( 4 n 1 3 s 1 ) = 2 s 1 4 3 n 3 s 1 .
Note that for s 1 0 , 2 n 9 , δ is nondecreasing. Also note that s 1 < n 1 2 = n 6 , therefore, for any s 1 in that case, s 1 < 2 n 9 , which means that δ ( · ) is always nondecreasing. That is, for any s 1 , δ ( · ) is always a deviation function.
For (iii), if s 1 = s 2 , then
δ ε = 2 s 1 ( 2 n 1 2 s 1 ) + s 1 ( 2 n 2 s 1 ) + s 1 ( 2 n 3 s 1 ) = s 1 ( 4 n 1 + 2 n 2 + 2 n 3 6 s 1 ) .
So for s 1 0 , min 2 n 1 + n 2 + n 3 6 , n 1 2 , δ ( · ) is nondecreasing. Therefore, it is a deviation function. The proof is finished.    □
Below we show some examples (Examples 8 and 9) for case (ii) and case (iii) (Examples 10–12).
Example 8. 
Let X = [ x 1 , , x 15 ] with partition V 1 = { x 1 , , x 5 } , V 2 = { x 6 , , x 10 } and V 3 = { x 11 , , x 15 } , that is, n 1 = n 2 = n 3 = 5 . It holds that
D ^ ( 0 ) = e 5 0 0 0 e 5 0 0 0 e 5 R 15 × 3 , D ^ ( 0 ) D ^ ( 0 ) T = E 5 0 0 0 E 5 0 0 0 E 5 .
Changing x 2 from V 1 to V 2 and x 3 from V 1 to V 3 , which means s 1 = s 2 = 1 , we get
D ^ ( ε ) = e 3 0 0 0 e 1 0 0 0 e 1 0 e 5 0 0 0 e 5 , D ^ ( ε ) D ^ ( ε ) T = E 3 0 0 0 0 0 1 0 E 1 × 5 0 0 0 1 0 E 1 × 5 0 E 5 × 1 0 E 5 0 0 0 E 5 × 1 0 E 5 .
It holds that
D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T = 0 E 3 × 1 E 3 × 1 0 0 E 1 × 3 0 1 E 1 × 5 0 E 1 × 3 1 0 0 E 1 × 5 0 E 5 × 1 0 0 0 0 0 E 5 × 1 0 0 ,
and δ ε = D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T F 2 = 34 .
Example 9. 
Let X and V 1 , V 2 , V 3 be the same as in Example 8. D ^ ( 0 ) is the same as in Example 8. Changing x 2 , x 3 from V 1 to V 2 and x 4 , x 5 from V 1 to V 3 , which means s 1 = s 2 = 2 , we get
D ^ ( ε ) = e 1 0 0 0 e 2 0 0 0 e 2 0 e 5 0 0 0 e 5 , D ^ ( ε ) D ^ ( ε ) T = 1 0 0 0 0 0 E 2 0 E 2 × 5 0 0 0 E 2 0 E 2 × 5 0 E 5 × 2 0 E 5 0 0 0 E 5 × 2 0 E 5 .
It holds that
D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T = 0 E 1 × 2 E 1 × 2 0 0 E 2 × 1 0 E 2 E 2 × 5 0 E 2 × 1 E 2 0 0 E 2 × 5 0 E 5 × 2 0 0 0 0 0 E 5 × 2 0 0 ,
and δ ε = D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T F 2 = 56 .
For Examples 8 and 9, it can be noticed that for case (ii), if s 1 increases, then δ ( · ) increases, which fully reflect the changes of ε in δ -measure function.
Example 10. 
Let X = [ x 1 , , x 11 ] with partition V 1 = { x 1 , , x 9 } , V 2 = { x 10 } and V 3 = { x 11 } , i.e., n 1 = 9 , n 2 = 1 and n 3 = 1 . It holds that
D ^ ( 0 ) = e 9 0 0 0 e 1 0 0 0 e 1 R 11 × 3 , D ^ ( 0 ) D ^ ( 0 ) T = E 9 0 0 0 1 0 0 0 1 .
Changing x 6 , x 7 from V 1 to V 2 and x 8 , x 9 from V 1 to V 3 , which means s 1 = s 2 = 2 , we get
D ^ ( ε ) = e 5 0 0 0 e 2 0 0 0 e 2 0 e 1 0 0 0 e 1 , D ^ ( ε ) D ^ ( ε ) T = E 5 0 0 0 0 0 E 2 0 E 2 × 1 0 0 0 E 2 0 E 2 × 1 0 E 1 × 2 0 E 1 0 0 0 E 1 × 2 0 E 1 .
It holds that
D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T = 0 E 5 × 2 E 5 × 2 0 0 E 2 × 5 0 E 2 E 2 × 1 0 E 2 × 5 E 2 0 0 E 2 × 1 0 E 1 × 2 0 0 0 0 0 E 1 × 2 0 0 ,
and
δ ε = D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T F 2 = 56 .
Example 11. 
Let X and V 1 , V 2 , V 3 be the same as in Example 10. D ^ ( 0 ) is the same as in Example 10. Changing x 4 , x 5 , x 6 from V 1 to V 2 and x 7 , x 8 , x 9 from V 1 to V 3 , which means s 1 = s 2 = 3 , we get
D ^ ( ε ) = e 3 0 0 0 e 3 0 0 0 e 3 0 e 1 0 0 0 e 1 , D ^ ( ε ) D ^ ( ε ) T = E 3 0 0 0 0 0 E 3 0 E 3 × 1 0 0 0 E 3 0 E 3 × 1 0 E 1 × 3 0 E 1 0 0 0 E 1 × 3 0 E 1 .
It holds that
D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T = 0 E 3 × 3 E 3 × 3 0 0 E 3 × 3 0 E 3 E 3 × 1 0 E 3 × 3 E 3 0 0 E 3 × 1 0 E 1 × 3 0 0 0 0 0 E 1 × 3 0 0 ,
and
δ ε = D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T F 2 = 66 .
Example 12. 
Let X and V 1 , V 2 , V 3 be the same as in Example 10. D ^ ( 0 ) is the same as in Example 10. Changing { x 2 , , x 5 } from V 1 to V 2 and { x 6 , , x 9 } from V 1 to V 3 , which means s 1 = s 2 = 4 , we get
D ^ ( ε ) = e 1 0 0 0 e 4 0 0 0 e 4 0 e 1 0 0 0 e 1 , D ^ ( ε ) D ^ ( ε ) T = E 1 0 0 0 0 0 E 4 0 E 4 × 1 0 0 0 E 4 0 E 4 × 1 0 E 1 × 4 0 E 1 0 0 0 E 1 × 4 0 E 1 .
It holds that
D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T = 0 E 1 × 4 E 1 × 4 0 0 E 4 × 1 0 E 4 E 4 × 1 0 E 4 × 1 E 4 0 0 E 4 × 1 0 E 1 × 4 0 0 0 0 0 E 1 × 4 0 0 ,
and
δ ε = D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T F 2 = 64 .
Comparing Example 10 and Example 11, s 1 < min 2 n 1 + n 2 + n 3 6 , n 1 2 = 4 , so it increases as the number of changed data points grows. However, when comparing Example 11 and Example 12, the deviation function δ ( · ) decreases. In this case, s 1 = 4 ( 0 , 4 ) in Example 12, implying that δ ( · ) cannot fully represent the deviation of the perturbed clustering results from the original clustering results.
However, if n 1 , n 2 , n 3 are not the same or s 1 s 2 , the situation is more complicated to analyze. Some small examples are given below, as shown in Examples 13–15.
Example 13. 
Let X and V 1 , V 2 , V 3 be the same as in Example 10. D ^ ( 0 ) is the same as in Example 10. Changing x 4 , x 5 from V 1 to V 2 and { x 6 , , x 9 } from V 1 to V 3 , which means s 1 = 2 , s 2 = 4 , we get
D ^ ( ε ) = e 3 0 0 0 e 2 0 0 0 e 4 0 e 1 0 0 0 e 1 , D ^ ( ε ) D ^ ( ε ) T = E 3 0 0 0 0 0 E 2 0 E 2 × 1 0 0 0 E 4 0 E 4 × 1 0 E 1 × 2 0 E 1 0 0 0 E 1 × 4 0 E 1 .
It holds that
D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T = 0 E 3 × 2 E 3 × 4 0 0 E 2 × 3 0 E 2 E 2 × 1 0 E 4 × 3 E 4 0 0 E 4 × 1 0 E 1 × 2 0 0 0 0 0 E 1 × 4 0 0 ,
and δ ε = 64 .
Example 14. 
Let X and V 1 , V 2 , V 3 be the same as in Example 10. D ^ ( 0 ) is the same as in Example 10. Changing x 3 , x 4 from V 1 to V 2 and { x 5 , , x 9 } from V 1 to V 3 , which means s 1 = 2 , s 2 = 5 , we get
D ^ ( ε ) = e 2 0 0 0 e 2 0 0 0 e 5 0 e 1 0 0 0 e 1 , D ^ ( ε ) D ^ ( ε ) T = E 2 0 0 0 0 0 E 2 0 E 2 × 1 0 0 0 E 5 0 E 5 × 1 0 E 1 × 2 0 E 1 0 0 0 E 1 × 5 0 E 1 .
It holds that
D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T = 0 E 2 × 2 E 2 × 5 0 0 E 2 × 2 0 E 2 E 2 × 1 0 E 5 × 2 E 5 0 0 E 5 × 1 0 E 1 × 2 0 0 0 0 0 E 1 × 5 0 0 ,
and δ ε = 62 .
Example 15. 
Let X and V 1 , V 2 , V 3 be the same as in Example 10. D ^ ( 0 ) is the same as in Example 10. Changing x 3 , x 4 , x 5 from V 1 to V 2 and { x 6 , , x 9 } from V 1 to V 3 , which means s 1 = 3 , s 2 = 4 , we get
D ^ ( ε ) = e 2 0 0 0 e 3 0 0 0 e 4 0 e 1 0 0 0 e 1 , D ^ ( ε ) D ^ ( ε ) T = E 2 0 0 0 0 0 E 3 0 E 3 × 1 0 0 0 E 4 0 E 4 × 1 0 E 1 × 3 0 E 1 0 0 0 E 1 × 4 0 E 1 .
It holds that
D ^ ( 0 ) D ^ ( 0 ) T D ^ ( ε ) D ^ ( ε ) T = 0 E 2 × 3 E 2 × 4 0 0 E 3 × 2 0 E 3 E 3 × 1 0 E 4 × 2 E 4 0 0 E 4 × 1 0 E 1 × 3 0 0 0 0 0 E 1 × 4 0 0 ,
and δ ε = 66 .
Comparing Example 13 with Example 14, we see that although more points are changed, δ ( · ) decreases. It indicates that in this situation, δ -measure function are not fully reflect the changes in partitioning. Moreover, comparing Example 14 with Example 15 shows that even with the same number of changed points ( s 1 + s 2 = 7 ), δ ( · ) can differ because the points are reassigned to different clusters. This highlights that δ ( · ) is influenced not only by how many points are perturbed, but also by how those perturbations are distributed across clusters.
Theorem 4 shows that the δ ( · ) under 3-way depends on two factors: how many points leave V 1 in total and how unevenly they split between V 2 and V 3 . In the balanced, symmetric case (Examples 8 and 9), δ ( · ) is a deviation function. When cluster sizes or perturbed sizes are unbalanced, the effect is more complicated. In summary, δ ( · ) is affected by both the number of perturbed points and the asymmetry of the reassignment, and it is predictable under balanced, symmetric case.

5.3. Analysis on K-Way Clustering

In this subsection, we extend the formula of δ to the general K-way clustering. The setting of K-way clustering is as follows. Let the original K-way clustering be V 1 , , V K with | V k | = n k , k = 1 K n k = n . We consider the following setting. After perturbation, we still have K clusters, but only the first cluster V 1 spills out to other clusters:
V 1 : = V 1 l = 2 K S l , V l : = V l S l , l = 2 , , K .
where
S l V 1 , | S l | = s l , l = 2 , , K , S : = l = 2 K s l .
In a word, we move in total S points out of V 1 , with s 2 points moved to V 2 , …, and s K points moved to V K .
Theorem 5. 
For K-way clustering, it holds that
δ ( ε ) = l = 2 K s l 2 n 1 l = 2 K s l + l = 2 K s l ( 2 n l s l ) = S ( 2 n 1 S ) + l = 2 K s l ( 2 n l s l ) .
Proof. 
Without loss of generality, assume that the data points are ordered so that
V 1 = { x 1 , , x n 1 } , V 2 = { x n 1 + 1 , , x n 1 + n 2 } , , V K = { x n 1 + + n K 1 + 1 , , x n } .
Recall that D ^ ( 0 ) { 0 , 1 } n × K is the cluster-indicator matrix before perturbation. Hence the matrix A : = D ^ ( 0 ) D ^ ( 0 ) T { 0 , 1 } n × n has entries
A i j = 1 , if x i and x j belong to the same original cluster , 0 , otherwise .
Similarly, let B : = D ^ ( ε ) D ^ ( ε ) T , so that B i j = 1 if and only if x i and x j are in the same cluster after perturbation, and B i j = 0 otherwise.
By definition, δ ( ε ) = A B F 2 = i = 1 n j = 1 n ( A i j B i j ) 2 . Since A i j , B i j { 0 , 1 } , each term ( A i j B i j ) 2 = 1 if and only if A i j B i j , and ( A i j B i j ) 2 = 0 otherwise. Therefore, δ ( ε ) counts the number of ordered pairs ( i , j ) for which the relation of ( x i , x j ) changes after perturbation. That is, δ ( ε ) = 2 × ( number of unordered pairs { i , j } whose relation changes ) . It thus suffices to count, under the given perturbation pattern, how many unordered pairs { i , j } change their relation. There are two cases.
Case 1. Consider the points in V 1 . After perturbation, the set V 1 is split into
V 1 = V 1 l = 2 K S l and S l V 1 , l = 2 , , K ,
with | V 1 | = n 1 S and | S l | = s l . We count the pairs that were in the same original cluster V 1 but end up in different clusters.
(i)
For pairs consisting of one point in V 1 and one point in l = 2 K S l , there are ( n 1 S ) S such unordered pairs.
(ii)
For pairs consisting of one point in S l and one point in S l with l l , there are 2 l < l K s l s l such unordered pairs.
All these pairs were in the same cluster (cluster 1) originally, but are in different clusters after perturbation, so their cluster relation changes.
Case 2. For each l = 2 , , K , points in S l move from V 1 to V l . Before perturbation, any pair consisting of one point in S l and one point in V l belonged to different clusters (cluster 1 and cluster ), whereas after perturbation they both belong to V l and thus become in the same cluster. There are s l n l such unordered pairs for each , and in total l = 2 K s l n l unordered pairs whose relation changes in this way.
Overall, the total number of unordered pairs whose relation changes is n 1 S S + 2 l < l K s l s l + l = 2 K s l n l . Hence
δ ( ε ) = 2 n 1 S S + 2 l < l K s l s l + l = 2 K s l n l .
Note that S 2 = l = 2 K s l 2 = l = 2 K s l 2 + 2 2 l < l K s l s l , which implies 2 l < l K s l s l = 1 2 S 2 l = 2 K s l 2 . Therefore,
δ ( ε ) = 2 ( n 1 S ) S + 1 2 S 2 l = 2 K s l 2 + l = 2 K s l n l = S ( 2 n 1 S ) + l = 2 K s l ( 2 n l s l ) ,
which is exactly the claimed formula. This completes the proof.    □

6. Numerical Results

In this part, we conduct numerical experiments to verify the theoretical results obtained in Section 2, Section 3, Section 4 and Section 5. The numerical tests are conducted in Matlab R2023a on a MacBook Air (13-inch, M3, 2024) running macOS Sonoma 14.6 with an Apple M3 chip and 16 GB of memory. The datasets used in our experiments are from the UCI Machine Learning Repository, which can be downloaded from https://archive.ics.uci.edu/datasets (accessed on 18 November 2025).
We consider the adversarial learning of convex clustering model (3) with p = 2 . Given data matrix X = [ x 1 , , x n ] R d × n , we solve (3) by Ssnal [40] with default settings and obtain a baseline solution Y * and cluster labels cluster _ id 0 ( i ) { 1 , , K } , i = 1 , , n . For perturbed data X ( ε ) = [ x 1 ( ε ) , , x n ( ε ) ] , Ssnal is also applied to obtain Y * ( ε ) and perturbed labels cluster _ id ε ( i ) . The number of changed labels compared to Y * is denoted by N chg , that is, N chg ( ε ) : = { i : cluster _ id ε ( i ) cluster _ id 0 ( i ) } .
From ([40], Theorems 12, Theorems 13), we know that every sequence generated by Ssnal converges to the unique optimal solution of the convex clustering problem. In addition, the semismooth Newton iterations enjoy local superlinear (and often quadratic) convergence under mild regularity conditions. These results ensure that, in our bilevel formulation, each lower-level convex clustering problem can be solved efficiently and we can obtain the unique globally optimal solution of (5) for each ε .

6.1. Robustness Verification of the Convex Clustering Model

In this part, we conduct numerical tests to verify the robustness of the convex clustering model. That is, when the perturbation ε is relatively small, the clustering result returned by the convex clustering model remains the same.
To better understand the role of perturbation, we select the Fisher Iris dataset with one feature (Feature 4). That is, d = 1 . We choose additive noise as x i ( ε ) = x i + ε for i I pert and x i ( ε ) = x i otherwise, where I pert = { 1 , 2 , 3 , 4 , 5 } . Other parameters are chosen as n = 100 , γ = 500 . In this test, we increase the perturbation | ε | gradually and report N chg ( ε ) and δ ( ε ) in Figure 4.
In Figure 4, it can be observed that when ε ( 1.15 , 4.30 ) , the number of changed labels is always 0, meaning that for ε ( 1.15 , 4.30 ) , the clustering results remains the same as the unperturbed result, which verify the robustness of the convex clustering model. If ε 4.30 , then N chg ( ε ) changes from 0 to 6, implying that there are six data whose label is changed, leading to the deviation function δ ( ε ) jump to 1128. In other words, if ε > 4.30 , attack happens. Similar situation also happens when ε 1.15 .

6.2. Numerical Results on Deviation Functions

In this part, we consider adversarial learning by adding larger noise to the dataset. We will check by numerical results to see whether the δ ( · ) is a reasonable deviation function.
The dataset and related parameters are the same as Section 6.1. The results are demonstrated in Figure 5. It can be noticed that as | ε | increases, there are some points of ε where N chg jumps to another value. More interestingly, when ε decreases from 6 to 8 , the number of changed labels reaches its maximum value, and then drops to 40. Correspondingly, the δ ( ε ) exhibits a very similar staircase structure, where jumps in δ ( ε ) coincide with jumps in N chg ( ε ) , which verifies that the δ -measure is a nondecreasing function with respect to N chg .

6.3. Verification of Bilevel Models

To analyze the bilevel models (13) and (14), we fix a perturbation budget a = 7 and a target deviation level δ 0 = 1200 in (13) and (14), respectively. The results are demonstrated in Figure 6. On the left, the star indicates at ε = 6.45 , δ ( ε ) attains its maximum value of (13), which is 4974. To solve (14), we fix a threshold δ 0 = 1200 . The star highlights the optimal value of (14) is ε * = 5.65 . In other words, the smallest perturbation to achieve the prescribed effect level (1200) is ε = 5.65 .
Next, we will check the efficiency of the proposed bilevel models. We focus on solving (13). We apply fmincon in MATLAB R2023a to solve (13) on the different UCI datasets (Fisher Iris, Seeds (We select Feature 1, that is, d = 1 and set γ = 10 .) and Wine (We select Feature 13, that is, d = 1 and set γ = 5 .)). In our implementation, we use the MATLAB command fmincon to solve (13), where the interior-point algorithm is used in fmincon and the gradient is approximated by forward finite differences. We also reported the optimal solution obtained by direct method, i.e., evaluate U ( ε ) at ε [ a : step : a ] and return the maximum value. For the Fisher Iris dataset, the related parameters are the same as in Section 6.2. For the Seeds dataset, we set a = 2 , step = 0.01 , and for the Wine dataset, we set a = 0.2 , step = 0.001 . In all cases, the resulting additive perturbations are chosen so that they do not exceed roughly 30 % of the corresponding feature range.
The results are summarized in Table 1.
Table 1 compares the direct method and fmincon on the different UCI datasets. For all datasets, the direct method consistently finds perturbations with larger deviation values U ( ε ) , but at the price of higher CPU time. In comparison, the perturbation ε returned by fmincon is different from that by the direct method. The reason is that fmincon returns a stationary point of the constrained optimization problem (13).
Below we analyze the computational complexity of the algorithm. In our bilevel model (13), the main computational cost comes from the lower-level convex clustering problems solved by Ssnal, while the evaluation of the deviation functions U ( ε ) only requires simple counting and basic calculation and is therefore negligible.

6.4. Other Measurements for Deviation Functions

Notice that in clustering methods, there are many measurements that can be used to evaluate the clustering results, such as Rand index (RI) and Normalized Mutual Information (NMI). In this part, we analyse the behaviour of RI and NMI under perturbations.
RI and NMI are computed in the following way [75]. Let c i 0 : = cluster _ id 0 ( i ) and c i ε : = cluster _ id ε ( i ) , i = 1 , , n , denote the cluster labels of point i in the baseline and perturbed clusterings, respectively. We consider all pairs { i , j } with 1 i < j n and count b 1 : = { ( i , j ) : c i 0 = c j 0 , c i ε = c j ε } , b 2 : = { ( i , j ) : c i 0 c j 0 , c i ε c j ε } . Here b 1 and b 2 are the numbers of pairs on which the two clusterings both in the same cluster or both in different clusters. The RI at ε is defined as
RI : = b 1 + b 2 n ( n 1 ) 2 [ 0 , 1 ] .
Thus RI = 1 if and only if c i ε = c i 0 for all i, i.e., the two clusterings coincide, and the index decreases towards 0 as more pairs of points are assigned differently.
To define NMI, recall D Y * CVC in (4) and let D Y * ( ε ) CVC = { V ^ 1 , , V ^ K ^ } as two partitions of the n points. NMI is calculated by
NMI : = i = 1 K ^ j = 1 K V ^ i V j log n V ^ i V j | V ^ i | | V j | i = 1 K ^ | V ^ i | log | V ^ i | n j = 1 K | V j | log | V j | n [ 0 , 1 ] .
NMI = 1 if and only if D Y * CVC and D Y * ( ε ) CVC induce exactly the same partition, while smaller values indicate that the two clusterings share less information.
In our test, the dataset and related parameters are the same as Section 6.1. The results are demonstrated in Figure 7.
As we can see, as | ε | increases, RI decreases, meaning that the clustering result becomes worse as the scale of noise grows. Therefore, based on our deviation function, one can choose the deviation function as
U RI ( ε ) : = 1 RI ( ε ) ,
which then satisfies the properties of a deviation function.
However, for NMI, it first decreases as | ε | increases, but when ε exceeds a certain threshold it drops to 0 and then jumps to a larger value. Due to this jump, NMI does not preserve monotonicity in | ε | . Therefore, defining a reasonable deviation function based on NMI is not trivial.
Figure 8 overlays δ ( ε ) , RI and NMI on the same plot. This combined visualization clearly shows that intervals with RI and NMI equal to 1 correspond to δ ( ε ) = 0 , while large values of δ ( ε ) are accompanied by significantly reduced RI and NMI. The three curves together therefore provide a consistent picture of clustering stability: the convex clustering model is robust with respect to moderate perturbations, but beyond certain thresholds the induced partition changes abruptly and the similarity indices drop accordingly.

6.5. Discussion and Limitations

The above experiments verify that the proposed bilevel models are numerically meaningful. Here we would like to highlight the following two important issues.
(i)
The numerical experiments in Section 6 are carried out under an additive perturbation. Nevertheless, one can also consider other types of perturbation (noises), including multiplicative perturbations, feature-level perturbations, and graph-structured perturbations.
(ii)
The adversarial loss functions are very common used in bilevel optimization. However, due to the limitation of space, we are not able to conduct detailed study on the property of adversarial loss functions. We will study and compare it with δ -measure in our future research work.

7. Conclusions

In this paper, we proposed bilevel models for adversarial learning and instantiated it with the convex clustering model. Viewing attacks as data perturbations, we derived calmness-type results that connect the robustness of the learning model to properties of the solution mapping. In particular, we identify the conditions for the robustness of convex clustering model. We formulated two complementary bilevel models: model (11), which searches for worst-case perturbations under a norm budget, and model (12), which computes the smallest perturbation achieving a prescribed effect level.
As a concrete deviation measure, we analyzed the δ -measure, obtained explicit formulas for 2-way, 3-way, and general K-way clustering, and identified cases in which δ behaves as a deviation function. The numerical results confirm that the proposed bilevel models are computationally viable and that the deviation measures, in particular, the δ -measure and the RI-based function as defined in (16), provide a meaningful way to capture and quantify adversarial effects in convex clustering.
However, several important questions remain open and deserve further investigation. On the one hand, it is still unclear how to design efficient algorithms for solving the two bilevel models for adversarial learning in more general settings. On the other hand, all our experiments are conducted in a white-box setting. In practice, the black-box clustering attacks are more prevalent. Therefore, how to design specified and efficient algorithms to solve the bilevel model is an interesting topic, which is worth further investigation.

Author Contributions

Conceptualization, Q.L.; methodology, Y.Z. and Q.L.; software, Y.Z.; formal analysis, Y.Z. and Q.L.; investigation, Y.Z.; writing—original draft preparation, Y.Z.; writing—review and editing, Q.L.; supervision, Q.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Acknowledgments

We would like to thank Jiani Li for her effort in identifying the definition of calmness.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Szegedy, C.; Zaremba, W.; Sutskever, I.; Bruna, J.; Erhan, D.; Goodfellow, I.; Fergus, R. Intriguing properties of neural networks. In Proceedings of the International Conference on Learning Representations (ICLR), Banff, AB, Canada, 14–16 April 2014. [Google Scholar]
  2. Goodfellow, I.; Shlens, J.; Szegedy, C. Explaining and Harnessing Adversarial Examples. In Proceedings of the International Conference on Learning Representations (ICLR), San Diego, CA, USA, 7–9 May 2015. [Google Scholar]
  3. Kurakin, A.; Goodfellow, I.; Bengio, S. Adversarial machine learning at scale. In Proceedings of the International Conference on Learning Representations (ICLR), Toulon, France, 24–26 April 2017. [Google Scholar]
  4. Roberts, L.; Smyth, E. A Simplified Convergence Theory for Byzantine Resilient Stochastic Gradient Descent. EURO J. Comput. Optim. 2022, 10, 100038. [Google Scholar] [CrossRef] [Scilit]
  5. Chhabra, A.; Roy, A.; Mohapatra, P. Suspicion-free adversarial attacks on clustering algorithms. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; Volume 34, pp. 3625–3632. [Google Scholar]
  6. Chhabra, A.; Sekhari, A.; Mohapatra, P. On the robustness of deep clustering models: Adversarial attacks and defenses. In Proceedings of the Advances in Neural Information Processing Systems, New Orleans, LA, USA, 28 November–9 December 2022; Volume 35, pp. 20566–20579. [Google Scholar]
  7. Yuan, X.; He, P.; Zhu, Q.; Li, X. Adversarial examples: Attacks and defenses for deep learning. IEEE Trans. Neural Netw. Learn. Syst. 2019, 30, 2805–2824. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Costa, J.C.; Roxo, T.; Proença, H.; Inacio, P.R.M. How deep learning sees the world: A survey on adversarial attacks & defenses. IEEE Access 2024, 12, 61113–61136. [Google Scholar] [CrossRef] [Scilit]
  9. Zhao, P.; Zhu, W.; Jiao, P.; Gao, D.; Wu, O. Data poisoning in deep learning: A survey. arXiv 2025, arXiv:2503.22759. [Google Scholar] [CrossRef] [Scilit]
  10. Moosavi-Dezfooli, S.M.; Fawzi, A.; Frossard, P. DeepFool: A Simple and Accurate Method to Fool Deep Neural Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016. [Google Scholar]
  11. Feinman, R.; Curtin, R.R.; Shintre, S.; Gardner, A.B. Detecting Adversarial Samples from Artifacts. arXiv 2017, arXiv:1703.00410. [Google Scholar] [CrossRef] [Scilit]
  12. Ahmed, M.; Alasad, Q.; Yuan, J.; Alawad, M. Re-Evaluating Deep Learning Attacks and Defenses in Cybersecurity Systems. Big Data Cogn. Comput. 2024, 8, 191. [Google Scholar] [CrossRef] [Scilit]
  13. Madry, A.; Makelov, A.; Schmidt, L.; Tsipras, D.; Vladu, A. Towards Deep Learning Models Resistant to Adversarial Attacks. In Proceedings of the International Conference on Learning Representations (ICLR), Vancouver, BC, Canada, 30 April–3May 2018. [Google Scholar]
  14. Dong, Y.; Liao, F.; Pang, T.; Su, H.; Zhu, J.; Hu, X.; Li, J. Boosting Adversarial Attacks with Momentum. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–22 June 2018; pp. 9185–9193. [Google Scholar]
  15. Brendel, W.; Rauber, J.; Bethge, M. Decision-Based Adversarial Attacks: Reliable Attacks Against Black-Box Machine Learning Models. In Proceedings of the International Conference on Learning Representations (ICLR), Vancouver, BC, Canada, 30 April–3 May 2018. [Google Scholar]
  16. Papernot, N.; McDaniel, P.; Jha, S.; Fredrikson, M.; Celik, Z.B.; Swami, A. The Limitations of Deep Learning in Adversarial Settings. In Proceedings of the IEEE European Symposium on Security and Privacy (EuroS&P), Saarbruecken, Germany, 21–24 March 2016; pp. 372–387. [Google Scholar]
  17. Eykholt, K.; Evtimov, I.; Fernandes, E.; Li, B.; Rahmati, A.; Xiao, C.; Prakash, A.; Kohno, T.; Song, D. Robust Physical-World Attacks on Deep Learning Visual Classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–22 June 2018; pp. 1625–1634. [Google Scholar]
  18. Carlini, N.; Wagner, D. Towards Evaluating the Robustness of Neural Networks. In Proceedings of the 2017 IEEE Symposium on Security and Privacy (SP), San Jose, CA, USA, 22–24 May 2017. [Google Scholar]
  19. Ilyas, A.; Santurkar, S.; Tsipras, D.; Engstrom, L.; Tran, B.; Madry, A. Adversarial Examples Are Not Bugs, They Are Features. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Vancouver, BC, Canada, 8–14 December 2019. [Google Scholar]
  20. Su, W.; Li, Q.; Cui, C. Optimization models and interpretations for three types of adversarial perturbations against support vector machines. arXiv 2022, arXiv:2204.03154. [Google Scholar] [CrossRef] [Scilit]
  21. Su, W.; Li, Q. An Efficient Method for Sample Adversarial Perturbations Against Nonlinear Support Vector Machines. In Proceedings of the 2022 5th International Conference on Data Science and Information Technology (DSIT), Shanghai, China, 22–24 July 2022; pp. 1–8. [Google Scholar]
  22. Driver, H.E.; Kroeber, A.L. Quantitative Expression of Cultural Relationships; University of California Publications in American Archaeology and Ethnology; University of California Press: Oakland, CA, USA, 1932. [Google Scholar]
  23. Tryon, R.C. Cluster Analysis: Correlation Profile and Orthometric (Factor) Analysis for the Isolation of Unities in Mind and Personality; Edwards Brothers: Ann Arbor, MI, USA, 1939. [Google Scholar]
  24. Florek, K.; Łukaszewicz, J.; Perkal, J.; Steinhaus, H.; Zubrzycki, S. Sur la liaison et la division des points d’un ensemble fini. Colloq. Math. 1951, 2, 282–285. [Google Scholar] [CrossRef] [Scilit]
  25. Ward, J.H. Hierarchical Grouping to Optimize an Objective Function. J. Am. Stat. Assoc. 1963, 58, 236–244. [Google Scholar] [CrossRef]
  26. MacQueen, J.B. Some Methods for Classification and Analysis of Multivariate Observations. In Proceedings of the 5th Berkeley Symposium on Mathematical Statistics and Probability, Berkeley, CA, USA, 21 June–18 July 1965 & 27 December 1965–7 January 1966; University of California Press: Oakland, CA, USA, 1967; Volume 1, pp. 281–297. [Google Scholar]
  27. Lloyd, S.P. Least Squares Quantization in PCM. IEEE Trans. Inf. Theory 1982, 28, 129–137. [Google Scholar] [CrossRef] [Scilit]
  28. Ester, M.; Kriegel, H.; Sander, J.; Xu, X. A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise. In Proceedings of the 2nd International Conference on Knowledge Discovery and Data Mining (KDD), Portland, OR, USA, 2–4 August 1996; pp. 226–231. [Google Scholar]
  29. Ankerst, M.; Breunig, M.M.; Kriegel, H.; Sander, J. OPTICS: Ordering Points to Identify the Clustering Structure. In Proceedings of the ACM SIGMOD International Conference on Management of Data, Philadelphia, PA, USA, 1–3 June 1999; pp. 49–60. [Google Scholar]
  30. Rodriguez, A.; Laio, A. Clustering by fast search and find of density peaks. Science 2014, 344, 1492–1496. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  31. Wei, X.; Peng, M.; Huang, H.; Zhou, Y. An Overview on Density Peaks Clustering. Neurocomputing 2023, 554, 126633. [Google Scholar] [CrossRef] [Scilit]
  32. Xu, R.; Wunsch, D.C. Survey of Clustering Algorithms. IEEE Trans. Neural Netw. 2005, 16, 645–678. [Google Scholar] [CrossRef] [Scilit]
  33. Everitt, B.S.; Landau, S.; Leese, M.; Stahl, D. Cluster Analysis, 5th ed.; Wiley: Chichester, UK, 2011. [Google Scholar]
  34. Pelckmans, K.; De Brabanter, J.; Suykens, J.; De Moor, B. Convex Clustering Shrinkage. In Proceedings of the PASCAL Workshop on Statistics and Optimization of Clustering, London, UK, 1 July 2005. [Google Scholar]
  35. Lindsten, F.; Ohlsson, H.; Ljung, L. Clustering using sum-of-norms regularization: With application to particle filter output computation. In Proceedings of the 2011 IEEE Statistical Signal Processing Workshop (SSP), Nice, France, 28–30 June 2011; IEEE: Piscataway, NJ, USA, 2011; pp. 201–204. [Google Scholar]
  36. Hocking, T.D.; Joulin, A.; Bach, F.; Vert, J.P. Clusterpath: An algorithm for clustering using convex fusion penalties. In Proceedings of the 28th International Conference on Machine Learning (ICML), Bellevue, WA, USA, 28 June–2 July 2011. [Google Scholar]
  37. Chi, E.C.; Lange, K. Splitting methods for convex clustering. J. Comput. Graph. Stat. 2015, 24, 994–1013. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  38. Sun, Q.; Zhang, A.G.; Liu, C.; Tan, K.M. Resistant convex clustering: How does the fusion penalty enhance resistance? Electron. J. Stat. 2025, 19, 1199–1230. [Google Scholar] [CrossRef] [Scilit]
  39. Panahi, A.; Dubhashi, D.; Johansson, F.D.; Bhattacharyya, C. Clustering by sum of norms: Stochastic incremental algorithm, convergence and cluster recovery. In Proceedings of the International Conference on Machine Learning (ICML), Sydney, Australia, 6–11 August 2017; pp. 2769–2777. [Google Scholar]
  40. Sun, D.; Toh, K.C.; Yuan, Y. Convex clustering: Model, theoretical guarantee and efficient algorithm. J. Mach. Learn. Res. 2021, 22, 1–32. [Google Scholar]
  41. Yuan, Y.; Chang, T.H.; Sun, D.; Toh, K.C. A dimension reduction technique for large-scale structured sparse optimization problems with application to convex clustering. SIAM J. Optim. 2022, 32, 2294–2318. [Google Scholar] [CrossRef] [Scilit]
  42. Ma, J.; Zhang, H.; Yang, S.; Jiang, J.; Li, G. An Improved Robust Sparse Convex Clustering. Tsinghua Sci. Technol. 2023, 28, 989–998. [Google Scholar] [CrossRef] [Scilit]
  43. Angelidakis, H.; Makarychev, K.; Makarychev, Y. Algorithms for stable and perturbation-resilient problems. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing (STOC), Montreal, QC, Canada, 19–23 June 2017; pp. 438–451. [Google Scholar]
  44. Cortes, C.; Vapnik, V. Support-vector networks. Mach. Learn. 1995, 20, 273–297. [Google Scholar] [CrossRef] [Scilit]
  45. Bonnans, J.F.; Shapiro, A. Perturbation Analysis of Optimization Problems; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2013. [Google Scholar]
  46. Flegel, M.L.; Kanzow, C.; Outrata, J.V. Optimality conditions for disjunctive programs with application to mathematical programs with equilibrium constraints. Set-Valued Anal. 2007, 15, 139–162. [Google Scholar] [CrossRef] [Scilit]
  47. Gfrerer, H. First Order and Second Order Characterizations of Metric Subregularity and Calmness of Constraint Set Mappings. SIAM J. Optim. 2011, 21, 1439–1474. [Google Scholar] [CrossRef] [Scilit]
  48. Kruger, A.Y. Error Bounds and Hölder Metric Subregularity. Set-Valued Var. Anal. 2015, 23, 705–736. [Google Scholar] [CrossRef] [Scilit]
  49. Gfrerer, H.; Outrata, J.V. On Lipschitzian Properties of Implicit Multifunctions. SIAM J. Optim. 2016, 26, 2160–2189. [Google Scholar] [CrossRef] [Scilit]
  50. Zhou, Z.; So, A.M.C. A unified approach to error bounds for structured convex optimization problems. Math. Program. 2017, 165, 689–728. [Google Scholar] [CrossRef] [Scilit]
  51. Kleinert, T.; Labbé, M.; Ljubić, I.; Schmidt, M. A Survey on Mixed-Integer Programming Techniques in Bilevel Optimization. EURO J. Comput. Optim. 2021, 9, 100007. [Google Scholar] [CrossRef] [Scilit]
  52. Chen, H.; Li, J.; So, A.M.C. Set Smoothness Unlocks Clarke Hyper-stationarity in Bilevel Optimization. arXiv 2025, arXiv:2506.04587. [Google Scholar] [CrossRef] [Scilit]
  53. Li, Z.; Liu, J.; Chen, S.; Tang, X. Noise robust spectral clustering. In Proceedings of the 2007 IEEE 11th International Conference on Computer Vision, Rio de Janeiro, Brazil, 14–21 October 2007; IEEE: Piscataway, NJ, USA, 2007; pp. 1–8. [Google Scholar]
  54. Zhang, R.; Lu, Z. Large Scale Sparse Clustering. In Proceedings of the IJCAI, New York, NY, USA, 9–15 July 2016; pp. 2336–2342. [Google Scholar]
  55. Franceschi, L.; Frasconi, P.; Salzo, S.; Grazzi, R.; Pontil, M. Bilevel Programming for Hyperparameter Optimization and Meta-Learning. In Proceedings of the 35th International Conference on Machine Learning, Stockholm, Sweden, 10–15 July 2018; Volume 80, pp. 1568–1577. [Google Scholar]
  56. Mackay, M.; Vicol, P.; Lorraine, J.; Duvenaud, D.; Grosse, R. Self-Tuning Networks: Bilevel Optimization of Hyperparameters Using Structured Best-Response Functions. In Proceedings of the 7th International Conference on Learning Representations, New Orleans, LA, USA, 6–9 May 2019. [Google Scholar]
  57. Zhang, Y.; Zhang, G.; Khanduri, P.; Hong, M.; Chang, S.; Liu, S. Revisiting and Advancing Fast Adversarial Training Through the Lens of Bi-Level Optimization. In Proceedings of the 39th International Conference on Machine Learning, Baltimore, MD, USA, 17–23 July 2022; Volume 162, pp. 26573–26604. [Google Scholar]
  58. Mauri, L.; Apolloni, B.; Damiani, E. Robust ML Model Ensembles via Risk-Driven Anti-Clustering of Training Data. Inf. Sci. 2023, 633, 122–140. [Google Scholar] [CrossRef] [Scilit]
  59. Dempe, S. Foundations of Bilevel Programming; Kluwer Academic Publishers: Dordrecht, The Netherlands, 2002. [Google Scholar]
  60. Colson, B.; Marcotte, P.; Savard, G. An Overview of Bilevel Optimization. Ann. Oper. Res. 2007, 153, 235–256. [Google Scholar] [CrossRef] [Scilit]
  61. Dempe, S.; Zemkoho, A.B. Bilevel Optimization: Theory, Algorithms and Applications. Numer. Algebr. Control Optim. 2013, 3, 349–372. [Google Scholar]
  62. Gao, L.L.; Ye, J.; Yin, H.; Zeng, S.; Zhang, J. Value function based difference-of-convex algorithm for bilevel hyperparameter selection problems. In Proceedings of the International Conference on Machine Learning, Baltimore, MD, USA, 17–23 July 2022; pp. 7164–7182. [Google Scholar]
  63. Ouattara, A.; Aswani, A. Duality approach to bilevel programs with a convex lower level. In Proceedings of the 2018 Annual American Control Conference (ACC), Milwaukee, WI, USA, 27–29 June 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 1388–1395. [Google Scholar]
  64. Li, Y.; Lin, G.H.; Zhang, J.; Zhu, X. A novel approach for bilevel programs based on Wolfe duality. arXiv 2023, arXiv:2302.06838. [Google Scholar] [CrossRef] [Scilit]
  65. Andrychowicz, M.; Denil, M.; Gomez, S.; Hoffman, M.W.; Pfau, D.; Schaul, T.; de Freitas, N. Learning to Learn by Gradient Descent by Gradient Descent. In Proceedings of the Advances in Neural Information Processing Systems, Barcelona, Spain, 5–10 December 2016; Volume 29, pp. 3981–3989. [Google Scholar]
  66. Maclaurin, D.; Duvenaud, D.; Adams, R.P. Gradient-based Hyperparameter Optimization through Reversible Learning. In Proceedings of the 32nd International Conference on Machine Learning, Lille, France, 6–11 July 2015; Volume 37, pp. 2113–2122. [Google Scholar]
  67. Finn, C.; Abbeel, P.; Levine, S. Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks. In Proceedings of the 34th International Conference on Machine Learning, Sydney, Australia, 6–11 August 2017; Volume 70, pp. 1126–1135. [Google Scholar]
  68. Wierstra, D.; Schaul, T.; Glasmachers, T.; Sun, Y.; Peters, J.; Schmidhuber, J. Natural evolution strategies. J. Mach. Learn. Res. 2014, 15, 949–980. [Google Scholar]
  69. Hansen, N. The CMA evolution strategy: A tutorial. arXiv 2016, arXiv:1604.00772. [Google Scholar] [CrossRef] [Scilit]
  70. Zhang, Z. PRIMA: Reference Implementation for Powell’s Methods with Modernization and Amelioration. 2024. Available online: http://www.libprima.net (accessed on 18 November 2025).
  71. Li, Q.; Li, D.H. A class of derivative-free methods for large-scale nonlinear monotone equations. IMA J. Numer. Anal. 2011, 31, 1625–1635. [Google Scholar] [CrossRef] [Scilit]
  72. Yin, H.; Aryani, A.; Petrie, S.; Nambissan, A.; Astudillo, A.; Cao, S. A rapid review of clustering algorithms. arXiv 2024, arXiv:2401.07389. [Google Scholar] [CrossRef] [Scilit]
  73. Feng, Q.; Chen, C.L.P.; Liu, L. A review of convex clustering from multiple perspectives: Models, optimizations, statistical properties, applications, and connections. IEEE Trans. Neural Netw. Learn. Syst. 2023, 35, 13122–13142. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  74. Biggio, B.; Pillai, I.; Bulò, S.R.; Ariu, D.; Pelillo, M.; Roli, F. Is data clustering in adversarial settings secure? In Proceedings of the 2013 ACM Workshop on Artificial Intelligence and Security, Berlin, Germany, 4 November 2013; pp. 87–98. [Google Scholar]
  75. Wang, Z.; Liu, X.; Li, Q. A Euclidean Distance Matrix Model for Convex Clustering. J. Optim. Theory Appl. 2025, 205, 1. [Google Scholar] [CrossRef] [Scilit]
Figure 1. The original one-dimensional dataset X = [ 0 , 2 , 10 , 14 ] to illustrate convex clustering and its robustness to data perturbations.
Figure 1. The original one-dimensional dataset X = [ 0 , 2 , 10 , 14 ] to illustrate convex clustering and its robustness to data perturbations.
Mathematics 13 03910 g001
Figure 2. Perturbed dataset X ( ε ) with x 3 ( ε ) 44 5 , 68 3 , where the conditions (9) and (10) hold and the clustering results remain unchanged.
Figure 2. Perturbed dataset X ( ε ) with x 3 ( ε ) 44 5 , 68 3 , where the conditions (9) and (10) hold and the clustering results remain unchanged.
Mathematics 13 03910 g002
Figure 3. Perturbed dataset X ( ε ) = [ 0 , 2 , 4 , 14 ] , where condition (10) fails and the convex clustering result changes from { 1 , 2 } , { 3 , 4 } to { 1 , 2 , 3 } , { 4 } .
Figure 3. Perturbed dataset X ( ε ) = [ 0 , 2 , 4 , 14 ] , where condition (10) fails and the convex clustering result changes from { 1 , 2 } , { 3 , 4 } to { 1 , 2 , 3 } , { 4 } .
Mathematics 13 03910 g003
Figure 4. The number of changed labels N chg ( ε ) and deviation δ ( ε ) on Fisher Iris dataset.
Figure 4. The number of changed labels N chg ( ε ) and deviation δ ( ε ) on Fisher Iris dataset.
Mathematics 13 03910 g004
Figure 5. The number of changed labels N chg ( ε ) and deviation δ ( ε ) on Fisher Iris dataset.
Figure 5. The number of changed labels N chg ( ε ) and deviation δ ( ε ) on Fisher Iris dataset.
Mathematics 13 03910 g005
Figure 6. Numerical illustration of the bilevel attack models (13) and (14) on Fisher Iris dataset. (Left): Solution of (13) with budget | ε | 7 . (Right): Solution of (14) for a given deviation level δ 0 = 1200 .
Figure 6. Numerical illustration of the bilevel attack models (13) and (14) on Fisher Iris dataset. (Left): Solution of (13) with budget | ε | 7 . (Right): Solution of (14) for a given deviation level δ 0 = 1200 .
Mathematics 13 03910 g006
Figure 7. RI and NMI on Fisher Iris dataset. (Left): RI. (Right): NMI.
Figure 7. RI and NMI on Fisher Iris dataset. (Left): RI. (Right): NMI.
Mathematics 13 03910 g007
Figure 8. Deviation δ ( ε ) , RI and NMI under the perturbation ε on Fisher Iris dataset.
Figure 8. Deviation δ ( ε ) , RI and NMI under the perturbation ε on Fisher Iris dataset.
Mathematics 13 03910 g008
Table 1. Comparison between direct method and fmincon on different UCI datasets.
Table 1. Comparison between direct method and fmincon on different UCI datasets.
DatasetMethodnK ε U ( ε ) N chg Time [s]
Fisher Irisdirect method1002−6.4549745212.90
fmincon1002−7.97004470402.202
Seedsdirect method14020.9557502516.49
fmincon14021.98504752754.815
Winedirect method1783−0.154742211513.51
fmincon17830.038773161164.562
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zheng, Y.; Li, Q. Bilevel Models for Adversarial Learning and a Case Study. Mathematics 2025, 13, 3910. https://doi.org/10.3390/math13243910

AMA Style

Zheng Y, Li Q. Bilevel Models for Adversarial Learning and a Case Study. Mathematics. 2025; 13(24):3910. https://doi.org/10.3390/math13243910

Chicago/Turabian Style

Zheng, Yutong, and Qingna Li. 2025. "Bilevel Models for Adversarial Learning and a Case Study" Mathematics 13, no. 24: 3910. https://doi.org/10.3390/math13243910

APA Style

Zheng, Y., & Li, Q. (2025). Bilevel Models for Adversarial Learning and a Case Study. Mathematics, 13(24), 3910. https://doi.org/10.3390/math13243910

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop