-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpapers.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 2 columns, instead of 1 in line 2.
13868 lines (11214 loc) · 446 KB
/
papers.csv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
pdf_name,text
p87-biggio.pdf,|Is Data Clustering in Adversarial Settings Secure?
Battista Biggio
Università di Cagliari
Piazza d’Armi
09123, Cagliari, Italy
Davide Ariu
Università di Cagliari
Piazza d’Armi
09123, Cagliari, Italy
Ignazio Pillai
Università di Cagliari
Piazza d’Armi
09123, Cagliari, Italy
Marcello Pelillo
Università Ca’ Foscari di
Venezia
Via Torino, 155
30172 Venezia-Mestre
Samuel Rota Bulò
FBK-irst
Via Sommarive, 18
38123, Trento, Italy
Fabio Roli
Università di Cagliari
Piazza d’Armi
09123, Cagliari, Italy
ABSTRACT
Clustering algorithms have been increasingly adopted in se-
curity applications to spot dangerous or illicit activities.
However, they have not been originally devised to deal with
deliberate attack attempts that may aim to subvert the
clustering process itself. Whether clustering can be safely
adopted in such settings remains thus questionable. In this
work we propose a general framework that allows one to
identify potential attacks against clustering algorithms, and
to evaluate their impact, by making specific assumptions on
the adversary’s goal, knowledge of the attacked system, and
capabilities of manipulating the input data. We show that
an attacker may significantly poison the whole clustering
process by adding a relatively small percentage of attack
samples to the input data, and that some attack samples
may be obfuscated to be hidden within some existing clus-
ters. We present a case study on single-linkage hierarchical
clustering, and report experiments on clustering of malware
samples and handwritten digits.
Categories and Subject Descriptors
D.4.6 [Security and Protection]: Invasive software (e.g.,
viruses, worms, Trojan horses); G.3 [Probability and Statis-
tics]: Statistical computing; I.5.1 [Models]: Statistical;
I.5.2 [Design Methodology]: Clustering design and eval-
uation; I.5.3 [Clustering]: Algorithms
General Terms
Security, Clustering.
Keywords
Adversarial learning, Unsupervised Learning, Clustering, Se-
curity Evaluation, Computer Security, Malware Detection.
Permission to make digital or hard copies of all or part of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for profit or commercial advantage and that copies bear this notice and the full cita-
tion on the first page. Copyrights for components of this work owned by others than
ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or re-
publish, to post on servers or to redistribute to lists, requires prior specific permission
and/or a fee. Request permissions from [email protected].
AISec’13, November 4, 2013, Berlin, Germany.
Copyright 2013 ACM 978-1-4503-2488-5/13/11 ...$15.00.
http://dx.doi.org/10.1145/2517312.2517321
1.
INTRODUCTION
Clustering algorithms are nowadays a fundamental tool
for the data analysts as they allow them to make inference
and gain insights on large sets of unlabeled data. Appli-
cations of clustering span across a large number of different
domains, such as market segmentation [14, 26], classification
of web pages [10], and image segmentation [12]. In the spe-
cific domain of computer security, clustering algorithms have
been recently exploited to solve plenty of different problems,
e.g., spotting fast-flux domains in DNS traffic [24], gaining
useful insights on tools and sources of attacks against Inter-
net websites [25], detecting repackaged Android applications
[16] and (Android) mobile malware [9], and even automati-
cally generating signatures for anti-virus software to enable
detection of HTTP-based malware [23].
In many of the aforementioned scenarios, a large amount
of data is often collected in the wild, in an unsupervised man-
ner. For instance, malware samples are often collected from
the Internet, by means of honeypots, i.e., machines that pur-
posely expose known vulnerabilities to be infected by mal-
ware [28], or other ad hoc services, like VirusTotal.1 Given
that these scenarios are intrinsically adversarial, it may thus
be possible for an attacker to inject carefully crafted samples
into the collected data in order to subvert the clustering pro-
cess, and make the inferred knowledge useless. This raises
the issue of evaluating the security of clustering algorithms
against carefully designed attacks, and proposing suitable
countermeasures, when required. It is worth noting that re-
sults from the literature of clustering stability [29] can not
be directly exploited to this end, since the noise induced
by adversarial manipulations is not generally stochastic but
specifically targeted against the clustering algorithm.
The problem of learning in adversarial environments has
recently gained increasing popularity, and relevant research
has been done especially in the area of supervised learning
algorithms for classification [6, 8, 17, 3], and regression [13].
On the other hand, to the best of our knowledge only few
works have implicitly addressed the issue of security evalua-
tion related to the application of clustering algorithms in ad-
versarial settings through the definition of suitable attacks,
1http://virustotal.com
87while we are not aware of any work that proposes specific
countermeasures to attacks against clustering algorithms.
The problem of devising specific attacks to subvert the
clustering process was first brought to light by Dutrisac and
Skillicorn [11, 27]. They pointed out that some points can be
easily hidden within an existing cluster by forming a fringe
cluster, i.e., by placing such points sufficiently close the bor-
der of the existing cluster. They further devised an attack
that consists of adding points in between two clusters to
merge them, based on the notion of bridging. Despite this
pioneering attempts, a framework for the systematic security
evaluation of clustering algorithms in adversarial settings is
still missing, as well as a more general theory that takes
into account the presence of the adversary to develop more
secure clustering algorithms.
In this work we aim to take a first step to fill in this gap, by
proposing a framework for the security evaluation of cluster-
ing algorithms, which allows us to consider several potential
attack scenarios, and to devise the corresponding attacks, in
a more systematic manner. Our framework, inspired from
previous work on the security evaluation of supervised learn-
ing algorithms [6, 17, 3], is grounded on a model of the
attacker that allows one to make specific assumptions on
the adversary’s goal, knowledge of the attacked system, and
capability of manipulating the input data, and to subse-
quently formalize a corresponding optimal attack strategy.
This work is thus explicitly intended to provide a cornerstone
for the development of an adversarial clustering theory, that
should in turn foster research in this area.
The proposed framework for security evaluation is pre-
sented in Sect. 2.
In Sect. 3 we derive worst-case attacks
in which the attacker has perfect knowledge of the attacked
system.
In particular, we formalize the notion of (worst-
case) poisoning and obfuscation attacks against a clustering
algorithm, respectively in Sects. 3.1 and 3.2.
In the for-
mer case, the adversary aims at maximally compromising
the clustering output by injecting a number of carefully de-
signed attack samples, whereas in the latter one, she tries to
hide some attack samples into an existing cluster by manipu-
lating their feature values, without significantly altering the
clustering output on the rest of the data. As a case study, we
evaluate the security of the single-linkage hierarchical clus-
tering against poisoning and obfuscation attacks, in Sect. 4.
The underlying reason is simply that the single-linkage hier-
archical clustering has been widely used in security-related
applications [4, 16, 23, 24]. To cope with the computa-
tional problem of deriving an optimal attack, in Sects. 4.1
and 4.2 we propose heuristic approaches that serve well our
purposes. Finally, in Sect. 5 we conduct synthetic and real-
world experiments that demonstrate the effectiveness of the
proposed attacks, and subsequently discuss limitations and
future extensions of our work in Sect. 6.
2. ATTACKING CLUSTERING
In this section we present our framework to analyze the
security of clustering approaches from an adversarial pattern
recognition perspective. It is grounded on a model of the ad-
versary that can be exploited to identify and devise attacks
against clustering algorithms. Our framework is inspired by
a previous work focused on attacking (supervised) machine
learning algorithms [6], and it relies on an attack taxonomy
similar to the one proposed in [17, 3]. As in [6], the adver-
sary’s model entails the definition of the adversary’s goal,
knowledge of the attacked system, and capability of manip-
ulating the input data, according to well-defined guidelines.
Before moving into the details of our framework, we intro-
duce some notation. Clustering is the problem of organizing
a set of data points into groups referred to as clusters in a
way that some criteria is satisfied. A clustering algorithm
can thus be formalized in terms of a function f mapping a
given dataset D = {xi}n
i=1 to a clustering result C = f (D).
We do not specify the mathematical structure of C at this
point of our discussion because there exist different types
of clustering requiring different representations, while our
model applies to any of them. Indeed, C might be a hard or
soft partition of D delivered by partitional clusterings algo-
rithms such as k-means, fuzzy c-means or normalized cuts,
or it could be a more general family of subsets of D such as
the one delivered by the dominant sets clustering algorithm
[22], or it can even be a parametrized hierarchy of subsets
(e.g., linkage-type clustering algorithms).
2.1 Adversary’s goal
Similarly to [6, 17, 3], the adversary’s goal can be defined
according to the attack specificity, and the security violation
pursued by the adversary. The attack specificity can be
targeted, if it affects solely the clustering of a given subset
of samples; or indiscriminate, if it potentially affects the
clustering of any sample. Security violations can instead
affect the integrity or the availability of a system, or the
privacy of its users.
Integrity violations amount to performing some malicious
activity without significantly compromising the normal sys-
tem operation.
In the supervised learning setting [17, 3],
they are defined as attacks aiming at camouflaging some
malicious samples (e.g., spam emails) to evade detection,
without affecting the classification of legitimate samples. In
the unsupervised setting, however, this definition can not be
generally applied since the notion of malicious or legitimate
class is not generally available. Therefore, we regard in-
tegrity violations as attacks aiming at deflecting the group-
ing for specific samples, while limiting the changes to the
original clustering. For instance, an attacker may obfuscate
some samples to hide them in a different cluster, without
excessively altering the initial clusters.
Availability violations aim to compromise the functional-
ity of the system by causing a denial of service. In the super-
vised setting, this translates into causing the largest possible
classification error [17, 6, 7]. According to the same ratio-
nale, in the unsupervised setting we can consider attacks
that significantly affect the clustering process by worsening
its result as much as possible.
Finally, privacy violations may allow the adversary to ob-
tain information about the system’s users from the clustered
data by reverse-engineering the clustering process.
2.2 Adversary’s knowledge
The adversary can have different degrees of knowledge of
the attacked system. They can be defined by making specific
assumptions on the points (k.i)-(k.iv) described below.
(k.i) Knowledge of the data D: The adversary might
know the data D or only a portion of it. More realistically,
she may not know D exactly, but she may be able to obtain a
surrogate dataset sampled from the same distribution as D.
88In practice, this can be obtained by collecting samples from
the same source from which samples in D were collected;
e.g., honeypots for malware samples [28].
(k.ii) Knowledge of the feature space: The adversary
could know how features are extracted from each sample.
Similarly to the previous case, she may know how to com-
pute the whole feature set, or only a subset of the features.
(k.iii) Knowledge of the algorithm: The adversary’s
could be aware of the targeted clustering algorithm and how
it organizes the data into clusters; e.g., the criterion used to
determine the cluster set from a hierarchy in hierarchical
clustering.
(k.iv) Knowledge of the algorithm’s parameters:
The attacker may even know how the parameters of the
clustering algorithm have been initialized (if any).
Perfect knowledge. The worst-case scenario in which
the attacker has full knowledge of the attacked system, is
usually referred to as perfect knowledge case [6, 7, 19, 8,
17, 3].
(k.i) the
data, (k.ii) the feature representation, (k.iii) the clustering
algorithm, and (k.iv) its initialization (if any).
In our case, this amounts to knowing:
2.3 Adversary’s capability
The adversary’s capability defines how and to what extent
the attacker can control the clustering process. In the super-
vised setting [17, 6], the attacker can exercise a causative or
exploratory influence, depending on whether she can control
training and test data, or only test data. In the case of clus-
tering, however, there is not a test phase in which some data
has to be classified. Accordingly, the adversary may only ex-
ercise a causative influence by manipulating part of the data
to be clustered.2 This is often the case, though, since this
data is typically collected in an unsupervised manner.
We thus consider a scenario in which the attacker can
add a maximum number of (potentially manipulated) sam-
ples to the dataset D. This is realistic in several practical
cases, e.g., in the case of malware collected through honey-
pots [28], where the adversary may easily send (few) samples
without having access to the rest of the data. This amounts
to controlling a (small) percentage of the input data. An
additional constraint may be given in terms of a maximum
amount of modifications that can be done to the attack sam-
ples. In fact, to preserve their malicious functionality, mali-
cious samples like spam emails or malware code may not be
manipulated in an unconstrained manner. Such a constraint
can be encoded by a suitable distance measure between the
original, non-manipulated attack samples and the manipu-
lated ones, as in [6, 20, 17, 3].
2.4 Attack strategy
Once the adversary’s goal, knowledge and capabilities have
been defined, one can determine an optimal attack strategy
that specifies how to manipulate the data to meet the ad-
versary’s goal, under the restriction given by the adversary’s
knowledge and capabilities. In formal terms, we denote by
Θ the knowledge space of the adversary. Elements of Θ hold
information about the dataset D, the clustering algorithm
2One may however think of an exploratory attack to a clus-
tering algorithm as an attack in which the adversary aims to
gain information on the clustering algorithm itself, although
she may not necessarily manipulate any data to this end.
f , and its parametrization, according to (k.i)-k(.iv). To
model the degree of knowledge of the adversary we con-
sider a probability distribution µ over Θ. The entropy of
µ indicates the level of uncertainty of the attacker. For
example, if we consider a perfect-knowledge scenario like
the one addressed in the next section, we have that µ is a
Dirac measure peaked on an element θ0 ∈ Θ (with null en-
tropy), where θ0 = (D, f, · · · ) holds the information about
the dataset, the algorithm and any other of the informations
listed in Sect.2.2. Further, we assume that the adversary is
given a set of attack samples A that can be manipulated be-
fore being added to the original set D. We model with the
function Ω(A) the family of sample sets that the attacker
can generate according to her capability as a function of the
set of initial attack samples A. The set A can be empty, if
the attack samples are not required to fulfill any constraint
on their malicious functionality, i.e., they can be generated
from scratch (as we will see in the case of poisoning attacks).
Finally, the adversary’s goal given the knowledge θ ∈ Θ is
expressed in terms of an objective function g(A′; θ) ∈ R
that evaluates how close the modified data set integrating
the (potentially manipulated) attack samples A′ is to the ad-
versary’s goal. In summary, the attack strategy boils down
to finding a solution to the following optimization problem:
maximize Eθ∼µ[g(A′; θ)]
s.t. A′ ∈ Ω(A) .
(1)
where Eθ∼µ[·] denotes the expectation with respect to θ be-
ing sampled according to the distribution µ.
3. PERFECT KNOWLEDGE ATTACKS
In this section we provide examples of worst-case integrity
and availability security violations in which the attacker has
perfect knowledge of the system, as described in Sect. 2.2.
We respectively refer to them as poisoning and obfuscation
attacks. Since the attacker has no uncertainty about the sys-
tem, we set µ = δ{θ0}, where δ is the Dirac measure and θ0
represents exact knowledge of the system. The expectation
in (1) thus yields g(A′; θ0).
3.1 Poisoning attacks
Similarly to poisoning attacks against supervised learn-
ing algorithms [7, 19], we define poisoning attacks against
clustering algorithms as attacks in which the data is tainted
to maximally worsen the clustering result. The adversary’s
goal thus amounts to violating the system’s availability by
indiscriminately altering the clustering output on any data
point. To this end, the adversary may aim at maximizing
a given distance measure between the clustering C obtained
from the original data D (in the absence of attack) and the
clustering C′ = fD(D′) obtained by running the clustering
algorithm on the contaminated data D′, and restricting the
result to the samples in D, i.e., fD = πD ◦ f where πD is
a projection operator that restricts the clustering output to
the data samples in D. We regard the tainted data D′ as
the union of the original dataset D with the attack samples
in A′, i.e., D′ = D ∪ A′. The goal can thus be written as
g(A′; θ0) = dc(C, fD(D ∪ A′)), where dc is the chosen dis-
tance measure between clusterings. For instance, if f is a
partitional clustering algorithm, any clustering result can be
represented in terms of a matrix Y ∈ Rn×k, each (i, k)th com-
ponent being the probability that the ith sample is assigned
89to the kth cluster. Under this setting, a possible distance
measure between clusterings is given by:
scalar. Consequently, the function Ω representing the at-
tacker’s capacity is given by
dc(Y, Y′) = kYY⊤ − Y′Y′⊤kF ,
(2)
where k · kF is the Frobenius norm. The components of the
matrix YY⊤ represent the probability of two samples to be-
long to the same cluster. When Y is binary, thus encoding
hard clustering assignments, this distance counts the num-
ber of times two samples have been clustered together in one
clustering and not in the other, or vice versa. In general, de-
pending on the nature of the clustering result, other ad-hoc
distance measures can be adopted.
As mentioned in Sect. 2.3, we assume that the attacker
can inject a maximum of m data points into the original
data D, i.e. A′ ≤ m. This realistically limits the adversary
to manipulate only a given, potentially small fraction of the
dataset. Clearly, the value of m will be considered as a pa-
rameter in our evaluation to investigate the robustness of
the given clustering algorithm against an increasing control
of the adversary over the data. We further define a box con-
straint on the feature values xlb ≤ x ≤ xub, to restrict the
attack points to lie in some fixed interval (e.g., the smallest
box that includes all the data points). Hence, we define the
function Ω encoding the adversary’s capabilities as follows:
Ωp = n{a′
i}m
i=1 ⊂ R
d : xlb ≤ a′
i ≤ xub for i = 1, · · · , mo .
Note that Ω depends on a set of target samples A in (1), but
since A is empty in this case, we write Ωp instead of Ω(∅).
The reason is simply that, in the case of a poisoning attack,
the attacker aims to find a set of attack samples that do
not have to carry out any specific malicious activity besides
worsening the clustering process.
In summary, the optimal attack strategy under the afore-
mentioned hypothesis amounts to solving the following op-
timization problem derived from (1):
maximize dc(C, fD(D ∪ A′))
s.t. A′ ∈ Ωp .
(3)
3.2 Obfuscation attacks
Obfuscation attacks are violations of the system integrity
through targeted attacks. The adversary’s goal here is to
hide a given set of initial attack samples A within some ex-
isting clusters by obfuscating their content, possibly without
altering the clustering results for the other samples. We de-
note by Ct the target clustering involving samples in D ∪ A′
the attacker is aiming to, being A′ the set of obfuscated
attack samples. With the intent to preserve the cluster-
ing result C on the original data samples, we impose that
πD(Ct) = C, while the cluster assignments for the samples
in A′ are freely determined by the attacker. As opposed to
the poisoning attack, here the attacker is interested in push-
ing the final clustering towards the target clustering and
therefore her intention is to minimize the distance between
Ct and C′ = f (D ∪ A′). Accordingly, the goal function g in
this case is defined as g(A′; θ0) = −d(Ct, f (D ∪ A′)).
As for the adversary’s capability, we assume that the at-
tacker can perturb the target samples in A to some maxi-
mum extent. We model this by imposing that ds(A, A′) ≤
dmax, where ds is a measure of divergence between the two
sets of samples A and A′ and dmax is a nonnegative real
Ωo(A) = n{a′
i=1 : ds(A, A′) ≤ dmaxo .
i} A
The distance ds can be defined in different ways. For in-
stance, in the next section we define ds(A, A′) as the largest
Euclidean distance among corresponding elements in A and
A′, i.e.,
ds(A, A′) = max
i=1,...,m
kai − a′
ik2
(4)
where we assume A = {ai}m
i=1. This
choice allows us to bound the divergence between the origi-
nal target samples in A and the manipulated ones, as typi-
cally done in adversarial learning [20, 17, 8, 6].
i=1 and A′ = {a′
i}m
In summary, the attack strategy in the case of obfusca-
tion attacks can be obtained as the solution of the following
optimization program derived from (1):
minimize dc(Ct, f (D ∪ A′))
s.t. A′ ∈ Ωo(A) .
(5)
4. A CASE STUDY ON SINGLE-LINKAGE
HIERARCHICAL CLUSTERING
In this section we solve a particular instance of the opti-
mization problems (3) and (5), corresponding respectively to
the poisoning and obfuscation attacks described in Sects. 3.1
and 3.2, against the single-linkage hierarchical clustering.
The motivation behind this specific choice of clustering algo-
rithm is that, as mentioned in Sect. 1, it has been frequently
exploited in security-sensitive tasks [4, 16, 23, 24].
Single-linkage hierarchical clustering is a bottom-up al-
gorithm that produces a hierarchy of clusterings, as any
other hierarchical agglomerative clustering algorithm [18].
The hierarchy is represented by a dendrogram, i.e., a tree-
like data structure showing the sequence of cluster fusion
together with the distance at which each fusion took place.
To obtain a given partitioning of the data into clusters, the
dendrogram has to be cut at a certain height. The leaves
that form a connected sub-graph after the cut are considered
part of the same cluster. Depending on the chosen distance
between clusters (linkage criterion), different variants of hi-
erarchical clustering can be defined.
In the single-linkage
variant, the distance between any two clusters C1, C2 is de-
fined as the minimum Euclidean distance between all pairs
of samples in C1 × C2.
For both poisoning and obfuscation attacks, we will model
the clustering output as a binary matrix Y ∈ {0, 1}n×k, in-
dicating the sample-to-cluster assignments (see Sect. 3.1).
Consequently, we can make use of the distance measure dc
between clusterings defined in Eq. (2). However, to obtain
a given set of clusters from the dendrogram obtained by the
single-linkage clustering algorithm, we will have to specify
an appropriate cut criterion.
4.1 Poisoning attacks
For poisoning attacks against single-linkage hierarchical
clustering, we aim to solve the optimization problem given
by Eq. (3). As already mentioned, since the clustering is ex-
pressed in terms of a hierarchy, we have to determine a suit-
able dendrogram cut in order to model the clustering output
90 ✂✄
✁✂✄
✁
☎✂✄
☎
✲☎✂✄
✲✁
✲✁✂✄
✲
✲ ✂✄
✁✻
✂✄
✁✹
✁
✁☎
✽
✻
✹
✁✂✄
✁
☎✂✄
☎
✲☎✂✄
✲✁
✲✁✂✄
✲
✲ ✂✄
✹✂✄
✹
✸✂✄
✸
✂✄
✁✂✄
✁
☎✂✄
✲ ✲✁✂✄ ✲✁ ✲☎✂✄ ☎ ☎✂✄ ✁ ✁✂✄
✲ ✲✁✂✄ ✲✁ ✲☎✂✄ ☎ ☎✂✄ ✁ ✁✂✄
Figure 1: Poisoning single-linkage hierarchical clustering. In each plot, samples belonging to different clusters
are represented with different markers and colors. The left and middle plot show the initial partitioning of
the given 100 data points into k = 4 clusters. The objective function of Eq. 3 (shown in colors) for our greedy
attack ( A′ = 1) is respectively computed with hard (left plot) and soft assignments (middle plot), i.e., with
binary Y and posterior estimates. The k − 1 = 3 bridges obtained from the dendrogram are highlighted with
red lines. The rightmost plot shows how the partitioning changes after m = 20 attack samples (highlighted
with red circles) have been greedily added.
as a binary matrix Y. In this case, we assume that the clus-
tering algorithm selects the cut, i.e., the number of clusters,
that achieves the minimum distance between the clustering
obtained in the absence of attack C and the one induced by
the cut, i.e., min dc(C, fD(D ∪ A′)). Although this may not
be a realistic cut criterion, as the ideal clustering C is not
known to the clustering algorithm, this worst-case choice for
the adversary gives us the minimum performance degrada-
tion incurred by the clustering algorithm under attack.
Let us now discuss how Problem (3) can be solved. First,
note that it is not possible to predict analytically how the
clustering output Y′ changes as the set of attack samples
A′ is altered, since hierarchical clustering does not have a
tractable, underlying analytical interpretation.3 One possi-
ble answer consists in a stochastic exploration of the solution
space (e.g. by simulated annealing). This is essentially done
by perturbing the input data A′ a number of times, and eval-
uating the corresponding values of the objective function by
running the clustering algorithm (as a black box) on D ∪ A′.
The set A′ that provides the highest objective value is even-
tually retained. However, to find an optimal configuration of
attack samples A′, one should repeat this procedure a very
large number of times. To reduce computational complexity,
one may thus consider efficient search heuristics specifically
tailored to the considered clustering algorithm.
For the above reason, we consider a greedy optimization
approach where the attacker aims at finding a local maxi-
mum of the objective function by adding one attack sample
at a time, i.e., A′ = m = 1.
In this case, we can more
easily understand how the objective function changes as the
inserted attack point varies, and define a suitable heuris-
tic approach. An example is shown in the leftmost plot of
Fig. 1. This plot shows that the objective function exhibits a
global maximum when the attack point is added in between
clusters that are sufficiently close to each other. The reason
is that, when added in such a location, the attack point op-
3In general, even if the clustering algorithm has a clearer
mathematical formulation, it is not guaranteed that a good
analytical prediction can be found. For instance, though k-
means clustering is well-understood mathematically, its vari-
ability to different initializations makes it almost impossible
to reliably predict how its output may change due to data
perturbation.
erates as a bridge, causing the two clusters to be merged in
a single cluster, and the objective function to increase.
Bridge-based heuristic search. Based on this observa-
tion, we devised a search heuristic that considers only k − 1
potential attack samples, being k the actual number of clus-
ters found by the single-linkage hierarchical clustering at a
given dendrogram cut.
In particular, we only considered
the k − 1 points lying in between the connections that have
been cut to separate the k given clusters from the top of
the hierarchy, highlighted in our example in the leftmost
plot of Fig. 1. These connections can be directly obtained
from the dendrogram, i.e., we do not have to run any post-
processing algorithm on the clustering result. Thus, one is
only required to evaluate the objective function k − 1 times
for selecting the best attack point. We will refer to this ap-
proach as Bridge (Best) in Sect. 5.1. The rightmost plot in
Fig. 1 shows the effect of our greedy attack after that m = 20
attack points have been inserted. Note how the initial clus-
ters are fragmented into smaller clusters that tend to contain
points which originally belonged to different clusters.
Approximating Y′. To further reduce the computational
complexity of our approach, i.e., to avoid re-computing the
clustering and the corresponding value of the objective func-
tion k − 1 times for each attack point, we consider another
heuristic approach. The underlying idea is simply to select
the attack sample (among the k − 1 bridges suggested by
our bridge-based heuristic search) that lies in between the
largest clusters.
In particular, we assume that the attack
point will effectively merge the two adjacent clusters, and
thus modify Y′ accordingly (without re-estimating its real
value by re-running the clustering algorithm). To this end,
for each point belonging to one of the two clusters, we set
to 1 (0) the value of Y′ corresponding to the first (second)
cluster. Once the estimated Y′ is computed, we evaluate the
objective function using the estimated Y′, and select the at-
tack point that maximizes its value. We will refer to this
approach as Bridge (Hard) in Sect. 5.1.
Approximating Y′ with soft clustering assignments.
Finally, we discuss another variation to the latter discussed
heuristic approach, which we will refer to as Bridge (Soft),
in Sect. 5.1. The problem arises from the fact that our ob-
jective function exhibits really abrupt variations, since it is
91computed on hard cluster assignments (i.e., binary matri-
ces Y′). Accordingly, adding a single attack point at a time
may not reveal connections that can potentially merge large
clusters after few attack iterations, i.e., using more than one
attack sample. To address this issue, we approximate Y′ with
soft clustering assignments. To this end, the element y′
ik of Y′
is estimated as the posterior probability of point xi belong-
ing to cluster ck, i.e., y′
ik = p(ck xi) = p(xi ck)p(ck)/p(xi).
The prior p(ck) is estimated as the number of samples be-
longing to ck divided by the total number of samples, the
likelihood p(xi ck) is estimated with a Gaussian Kernel Den-
sity Estimator (KDE) with bandwidth parameter h:
p(xi ck) =
1
ck Xxj ∈ck
exp(cid:18)−
xi − xj 2
h
(cid:19) ,
(6)
and the evidence p(xi) is obtained by marginalization over
the given set of clusters.
Worth noting, for too small values of h, the posterior es-
timates tend to the same value, i.e., each point is likely to
be assigned to any cluster with the same probability. When
h is too high, instead, each point is assigned to one cluster,
and the objective function thus equals that corresponding to
the original hard assignments. In our experiments we simply
avoid these limit cases by selecting a value of h comparable
to the average distance between all possible pairs of samples
in the dataset, which gave reasonable results.
An example of the smoother approximation of the objec-
tive function provided by this heuristic is shown in the mid-
dle plot of Fig. 1. Besides, this technique also provides a reli-
able approximation of the true objective: although its values
are significantly re-scaled, the global maximum is still found
in the same location. The smooth variations that character-
ize the approximated objective influence the choice of the
best candidate attack point.
In fact, attack points lying
on bridges that may potentially connect larger clusters after
some attack iterations may be sometimes preferred to attack
points that can directly connect smaller and closer clusters.
This may lead to a larger increase in the true objective func-
tion as the number of injected attack points increases.
4.2 Obfuscation attacks
In this section we solve (5) assuming the worst-case (perfect-
knowledge) scenario against the single-linkage clustering al-
gorithm. Recall that the attacker’s goal in this case is to
manipulate a given set of non-obfuscated samples A such
that they are clustered according to a desired configuration,
e.g., together with points in an existing, given cluster, with-
out altering significantly the initial clustering that would be
obtained in the absence of manipulated attacks.
As in the previous case, to represent the output of the clus-
tering algorithm as a binary matrix Y representing clustering
assignments, and thus compute dc as given by Eq. 2, we have
to define a suitable criterion for cutting the dendrogram.
Similarly to poisoning attacks, we define an advantageous
criterion for the clustering algorithm, that gives us the low-
est performance degradation incurred under this attack: we
select the dendrogram cut that minimizes dc(C⋆, f (D ∪ A′)),
where C⋆ represents the optimal clustering that would be ob-
tained including the non-manipulated attack samples, i.e.,
C⋆ = f (D ∪ A). The reason is that, to better contrast an ob-
fuscation attack, the clustering algorithm should try to keep
the attack points corresponding to the non-manipulated set
A into their original clusters. For instance, in the case of
malware clustering, non-obfuscated malware may easily end
up in a well-defined cluster, and, thus, it may be subse-
quently categorized in a well-behaved malware family. While
the adversary tries to manipulate malware to have it clus-
tered differently, the best solution for the clustering algo-
rithm would be to obtain the same clusters that would be
obtained in the absence of attack manipulation.
We derive a simple heuristic to get an approximate solu-
tion of (5) assuming ds to be defined as in (4). We assume
that, for each sample ai ∈ A, the attacker selects the closest
sample di ∈ D belonging to the cluster to which ai should
belong to, according to the attacker’s desired clustering Ct.
To meets the constraint given by Ωo in Eq. 5, the attacker
then determines for each ai ∈ A a new sample a′
i ∈ A along
the line connecting ai and di in a way not to exceed the
maximum distance dmax from ai, i.e., a′
i = ai + α(di − ai),
where α = min(1, dmax/kdi − aik2).
5. EXPERIMENTS
We present here some experiments to evaluate the effec-
tiveness of the poisoning and obfuscation attacks devised
in Sect. 4 against the single-linkage hierarchical clustering
algorithm, under perfect knowledge of the attacked system.
5.1 Experiments on poisoning attacks
For the poisoning attack, we consider three distinct cases:
a two-dimensional artificial data set, a realistic application
example on malware clustering, and a task in which we aim
to cluster together distinct handwritten digits.
5.1.1 Artificial data
We consider here the standard two-dimensional banana-
shaped dataset from PRTools,4 for which a particular in-
stance is shown in Fig. 1 (right and middle plot). We fix the
number of initial clusters to k = 4, which yields our original
clustering C in the absence of attack.
We repeat the experiment five times, each time by ran-
domly sampling 80 data points. In each run, we add up to
m = 20 attack samples, that simulates a scenario in which
the adversary can control up to 20% of the data. As de-
scribed in Sect. 4.1, the attack proceeds greedily by adding
one sample at a time. After adding each attack sample, we
allow the clustering algorithm to change the number of clus-
ters from a minimum of 2 to a maximum of 50. The criterion
used to determine the number of clusters is to minimize the
distance of the current partitioning with the clustering in
the absence of attack, as explained in details in Sect. 4.1.
We consider five attack strategies, described in the follow-
ing.
Random: the attack point is selected at random in the
minimum box that encloses the data.
Random (Best): k − 1 attack points are selected at ran-
dom, being k the actual number of clusters at a given attack
iteration. Then, the objective function is evaluated for each
point, and the best one is chosen.
Bridge (Best): The k−1 bridges suggested by our heuristic
approach are evaluated, and the best one is chosen.
4http://prtools.org
92n
o
i
t
c
n
u
F
e
v
i
t
c
e
b
O
j
)
k
(
s
r
e
t
s
u
C
m
u
N
l
Banana
60
50
40
30
20
10
0