{'fraction_non_alphanumeric': 0.03914317925591883, 'fraction_numerical': 0.012130777903043968, 'mean_word_length': 4.6675753961492585, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The Perils of Learning From Unlabeled Data: Backdoor Attacks on Semi-supervised Learning

Semi-supervised machine learning (SSL) is gaining popularity as it reduces the cost of training ML models. It does so by using very small amounts of (expensive, well-inspected) labeled data and large amounts of (cheap, non-inspected) unlabeled data. SSL has shown comparable or even superior performances compared to conventional fully-supervised ML techniques. In this paper, we show that the key feature of SSL that it can learn from (non-inspected) unlabeled data exposes SSL to strong poisoning attacks. In fact, we argue that, due to its reliance on non-inspected unlabeled data, poisoning is a much more severe problem in SSL than in conventional fully-supervised ML. Specifically, we design a backdoor poisoning attack on SSL that can be conducted by a weak adversary with no knowledge of target SSL pipeline. This is unlike prior poisoning attacks in fully-supervised settings that assume strong adversaries with practically-unrealistic capabilities. We show that by poisoning only 0.2% of the unlabeled training data, our attack can cause misclassification of more than 80% of test inputs (when they contain the adversary's backdoor trigger). Our attacks remain effective across twenty combinations of benchmark datasets and SSL algorithms, and even circumvent the state-of-the-art defenses against backdoor attacks. Our work raises significant concerns about the practical utility of existing SSL algorithms.


I. INTRODUCTION
The more training data we use to train machine learning (ML) models, the better they perform [19], [18]. However, this makes the conventional fully-supervised ML significantly challenging, as it requires large amounts of labeled training data. Labeling is an expensive [17] and error prone process [38], [33] that makes conventional ML prohibitively expensive in practice, especially with today's exploding training data sizes.
Semi-supervised learning (SSL) addresses this major challenge by significantly reducing the need of the labeled training data: SSL uses a combination of a small, high-quality and expensive labeled data with a large, low-quality, and cheap unlabeled data to train its models. For instance, the FixMatch [48] SSL algorithm uses only 40 labeled data along with about 50,000 unlabeled data and achieves 90% accuracy on CIFAR10. In contrast to fully-supervised algorithms, training an SSL algorithm involves two loss functions: a supervised loss function (e.g., cross-entropy [37]) on labeled training data and an unsupervised loss function (e.g., cross-entropy over pseudo-labels [29]) on unlabeled training data. Different SSL algorithms primarily differ on how they compute their unsupervised losses.
SSL is being explored extensively by both academia [60], [54], [55] and industry [48], [49], [7], [6], as recent SSL algorithms offer state-of-the-art performances comparable or even superior to those achieved by conventional supervised techniques-but with no need of large well-inspected labeled data. For instance, with less than 10% of training data labeled, FixMatch [48] and FlexMatch [60] SSL algorithms outperform the fully-supervised algorithm. This is because state-of-the-art SSL algorithms use (cheap, abundant) unlabeled data much more effectively than how fully-supervised algorithms use significantly larger (expensive, scarce) labeled data.

Unlabeled data enables poisoning by weaker adversaries:
Multiple researches have demonstrated the threat that data poisoning attacks pose to fully-supervised learning [25], [35], [41], [43], [58], [53]. However, as the training data of fullysupervised models undergo an extensive and careful inspection, these attacks assume strong adversaries with the knowledge of model parameters [35], training data [53], [8], [36] or its distribution [58], or the learning algorithm. Such strong adversaries are important to evaluate the worse-case security of a system, but are practically less relevant. On the other hand, the key feature of SSL in real-world applications is that it can leverage large amounts of-raw, non-inspected-unlabeled data, e.g., the data scraped from the Internet. We argue that the use of non-inspected data by SSL presents a significant threat to its security, as it allows even the most naive adversaries (with no knowledge of training algorithm, labeled data, etc.) to poison SSL models by simply fabricating malicious unlabeled data. Unfortunately, this severe threat remains largely unexplored in the SSL literature.
To address this gap, in this paper, we take the first step towards thoroughly understanding this threat by studying the possibility of backdoor attacks against SSL in real-world settings. A backdoor attack aims to install a backdoor function in the target model, such that the backdoored target model will misclassify any test input to the adversary chosen target class when patched with a specific backdoor trigger, but will correctly classify the input without the trigger.
Existing backdoor attacks fail on SSL: There exist numerous backdoor attacks in prior literature, however, except one attack-DeHiB [56], all of the prior attacks consider fullysupervised settings. Our preliminary evaluations show that all of the existing state-of-the-art attacks, including DeHiB, completely fail against SSL under our realistic threat model (Section III). Hence, to learn from these failures, we first systematically evaluate five backdoor attacks from three categories against five state-of-the-art SSL algorithms, under our practical, unlabeled data poisoning threat model. We adaptively choose the attack categories based on the specific lesson we learn from evaluating the prior category.
Our systematic evaluation leads to the following three major lessons that not only guide our attack design, but are generally applicable to any (future) backdoor attacks against SSL: (1) Backdoor attacks on SSL should be clean-label style attacks, i.e., poisoning data should be selected from the target class distribution; (2) Backdoor trigger patterns should span/cover the entire poisoning sample, to circumvent strong augmentations, e.g., cutout [21], that all modern SSL algorithms use; (3) Backdoor trigger patterns should be resistant to noise and with repetitive patterns to withstand large amounts of random noises which were added to training data via the strong augmentation in SSL.
Our SSL-tailored backdoor method: The high-level intuition behind our backdoor attack is as follows. All modern semisupervised algorithms learn via a self-feedback mechanism, called pseudo-labeling, i.e., the predictionỹ on an unlabeled sample x has high confidence, they use (x,ỹ) as a labeled sample for further training. Following our first lesson, we exploit this pseudo-labeling and design a clean-label attack that poisons samples x only from the distribution of the target class y t . Our attack patiently waits for the target model to correctly label a poisoning sample (x + T ) as y t , where T is our backdoor trigger. And then, as the model trains further on ((x + T ), y t ), our attack forces the model to associate features of our simple trigger T , instead of the complex features of x, with the target class, which effectively installs the backdoor function in the target model.
Note that, we consider the most challenging setting for designing attacks with the least capable and knowledgeable data poisoning adversary. Generally, trigger generation for data poisoning backdoor attacks is formalized as a bi-level optimization problem [36], however such attacks are wellknown to be very expensive, and yet ineffective [36], [44]. Instead, we design a static, repetitive grid pattern for our backdoor trigger ( Figure 5), as guided by lessons 2 and 3. In summary, we sample few data from target class, patch them with our trigger and inject into unlabeled training data.
Evaluations: We demonstrate the strength of our attack via an extensive evaluation against five state-of-the-art SSL algorithms and a fully-supervised algorithm, using four benchmark image classification tasks, that SSL literature commonly uses. We note that our attack significantly outperforms the prior attacks from both SSL and full-supervised literature.
For the most combinations of algorithm and dataset, our attacks achieve high attack success rates (ASRs) (>80%), while poisoning just 0.2% of entire training data. Comparatively, DeHib uses 20× more poisoning data and achieves 0% ASRs. ASR measures the % of test inputs from non-target classes that the backdoored model classifies to the target class when patched with backdoor trigger. For instance, our attacks have more than 90% ASR against CIFAR100 and more than 80% ASR against CIFAR10. For SVHN and STL10, our attack has more than 80% ASR with two exceptions each. Through a systematic experiment design in Section VI-B, we show that our intuition aligns with the dynamics of our patient attacks and justify their strength. Our attack is highly stealthy, as (1) it minimally perturbs the poisoning data and (2) it produces backdoored models which have high accuracy (close to nonbackdoored models) on non-backdoored test inputs.
Next, our comprehensive ablation study (Section VI-E) shows the high efficacy of our attacks when varying three major parameters of our setting: size of labeled data, backdoor target class, and size of poisoning data. Finally, we show that our attacks remain highly effective even when SSL is paired individually with five state-of-the-art defenses against backdoor attacks that are agnostic to learning algorithms.

Summary of contributions:
(1) We perform the first thorough study of backdoor attacks on semi-supervised learning (SSL), and show that it is highly susceptible to backdoor poisoning, under realistic unlabeled data poisoning threat models.
(2) We systematically evaluate existing backdoor attacks from fully-supervised setting on SSL and provide concrete lessons to design stronger backdoor attacks against SSL.
(3) Based on the lessons, we design the first effective backdoor attack against SSL that achieves high (>80%) ASRs by poisoning just 0.2% of entire training data. (4) We show that existing learning-algorithm-agnostic defenses are insufficient to defend SSL against backdoor attacks.

II. PRELIMINARIES AND RELATED WORK
In this section, we provide the preliminaries and important related works required to understand the rest of the paper.

A. Semi-supervised Learning (SSL)
The objective of machine learning (ML) for classification task is to train a classifier (e.g., neural network) with parameters θ and learn function f θ : X → Y to predict label y ∈ Y for input x ∈ X . Here, X ∈ R d is the input feature vector space and Y ∈ R k is the output space. Parameters θ are trained using empirical risk minimization (ERM) to minimize certain empirical loss function (x,y)∈D (f θ , (x, y)), where D is the training data and D ⊂ X × Y. Traditionally, ML uses fully-supervised learning algorithms that use only completely labeled data, D l . However, labeling is a manual, expensive, and error-prone process [33], as it requires human intervention. Consequently, with continuously increasing training data sizes, labeling cost for ML can become prohibitively high in practice.
Semi-supervised learning (SSL) addresses this major challenge by reducing the dependence of ML on labeled data. SSL proposes to learn ML models using both labeled D l and unlabeled data D u . D l and D u may or may not have the same distribution, but sizes of labeled data are significantly smaller than that of unlabeled data, i.e., |D l | |D u |. A typical SSL loss function is a convex combination of a loss on D l , denoted by L l , and a loss on D u , denoted by L u : L ss = L l + λL u . L l is generally the standard cross-entropy loss due to its high performances. But, L u varies across different SSL algorithms; we will discuss these shortly.
Traditionally, semi-supervised learning has been largely ineffective, but in the past couple of years, SSL has significantly improved, especially after the invention of MixMatch [7]. Significant performance gains of MixMatch are because it combines various data augmentation techniques with various prior SSL algorithms, including pseudo-labeling [29], entropy minimization [24], and consistency regularization [20], [42], [28]. Hence, in this work we consider the state-of-the-art algorithms that use pseudo-labeling and consistency regularization.
We briefly describe these two techniques as in [48] followed by the semi-supervised algorithms we consider in this work.
1) Pseudo-labeling: Pseudo-labeling uses the current model to obtain artificial pseudo-labels for the unlabeled data. There are various ways in which model's outputs can be used to train itself, e.g., MixMatch and ReMixMatch compute model's predictions on an unlabeled sample and then use entropy minimization [24] to sharpen the prediction. But, pseudolabeling specifically refers to the use of "hard" labels (i.e., the argmax of the model's output) and only retains the labels whose largest class probability (confidence) is above a predefined threshold. Assume q b = f θ (y|u b ) are the predictions of current model f θ on the batch u b of unlabeled data. Then pseudo-labeling loss can be formalized as follows: is the cross-entropy loss function, and τ is the threshold parameter. Note that the use of hard labels is similar to entropy minimization in MixMatch or ReMixMatch, where they use a temperature parameter to sharpen the model predictions to have low entropy (high confidence).
2) Consistency regularization: Consistency regularization is commonly used in modern semi-supervised learning algorithms. It is based on the intuition that the model should output similar predictions when input with the perturbed versions of the same image. The idea was first proposed in [3]. Semisupervised learning algorithms use consistency regularization on unlabeled data as follows. They use a stochastic augmentation mechanism a(x u ) to produce perturbed versions of an unlabeled sample x u and then force the model to have similar outputs on these versions using the following loss: where, a(.) is a stochastic function, hence it produces different output every time it is applied to a batch u b of unlabeled data. Consequently, the two terms in (2) have different values. Next, we briefly describe the semi-supervised learning algorithms we consider in this work. For detailed description of the algorithms, please refer to the original works.
(1) MixMatch [7] combines various prior semi-supervised learning techniques. For an unlabeled sample, MixMatch generates K weakly augmented versions of the unlabeled sample, computes outputs of the current model f θ for the K versions, averages them, and sharpens the average prediction by raising all its probabilities by a power of 1/temperature and renormalizing; it uses the sharpened prediction as the label of the unlabeled sample. Finally, it uses mixup regularization [61] on the combination of labeled and unlabeled data and trains the model using cross-entropy loss.
(2) Unsupervised data augmentation (UDA) [54] shows significant improvements in semi-supervised performances by just replacing the simple weak augmentations of MixMatch with a strong augmentation called Randaugment [16]. In an iteration, Randaugment randomly selects a few augmentations from a large set of augmentations and applies them to images.
(1) ReMixMatch [7] builds on MixMatch by making multiple modifications, including 1) it replaces the simple weak augmentation in MixMatch with Autoagument [15], 2) it uses augmentation anchoring to improve consistency regularization, i.e., it uses the prediction on a weakly augmented version of unlabeled sample as the target prediction for a strongly augmented version of the unlabeled sample, and 3) it uses distribution alignment, i.e., it normalizes the new model predictions on unlabeled data using the running average of model predictions on unlabeled data. This significantly boosts the performance of resulting model.
(4) FixMatch [48] simplifies the complex ReMixMatch algorithm by proposing to use a combination of Pseudo-labeling and consistency regularization based on augmentation anchoring (discussed above). FixMatch significantly improves semi-supervised algorithms, especially in the low labeled data regimes.
(5) FlexMatch [60] proposes curriculum pseudo labelling (CPL) approach to leverage unlabeled data according to model's learning status. The main idea behind CPL is to flexibly adjust the thresholds used for pseudo-labeling for different classes at each training iteration in order to select more information unlabeled data and their pseudo-labels. CPL can be combined with other algorithms, e.g., UDA.

B. Backdoor Attacks
A backdoor adversary aims to implant a backdoor functionality into a target model. That is, given an input (x, y * ) with true label y * , the backdoored target model f b θ should output an adversary-desired backdoor target label y t for the input patched with a pre-specified backdoor trigger T , but it should output the correct label for the benign input, i.e., f b θ (x + T ) → y t and f b θ (x) → y * . There are two major types of backdoor attacks: dirty-label and clean-label backdoors.
1) Dirty-label backdoor attacks [26], [13], [43], [59], [40], [32]: These attacks poison both the features x and labels y * of benign, labeled data to obtain poisoning data D p . They first select some benign data (X, Y \t ) from non-target classes of the original training data D, patch the backdoor trigger to X: X p ← X + T , and set labels of X p to y t to obtain D ← D ∪ D p = (X p , y t ). Training f θ on such D makes the model associate the trigger with the target label, i.e., f b θ (T ) → y t , as this association is much easier to learn than learning to associate original X to Y . However, in many practical scenarios, a trusted third party conducts the data labeling and inspection, and can easily remove such mislabeled data. Our work focuses on the semi-supervised learning where such inspection is much easier compared to the supervised learning due to very small sizes of labeled data, hence we only poison the unlabeled training data.
2) Clean-label backdoor attacks [53], [58], [62]: These attacks poison only the features X of benign data. They add imperceptible T to X such that the poisoned features X p appear to be from the respective true classes to a human. Cleanlabel attacks can be further divided into two categories [58] based on the true classes of X that they poison: featurecollision attacks and target-class attacks.
(a) Feature-collision backdoor attacks, e.g., HTBA [41] and SAA [50], insert triggers indirectly. They try to match the feature space/gradients between the target class samples and non-target-class samples patched with the trigger, thus, mimicking the effects of non-target-class poisoning. By doing this, the decision boundary will place these two points in proximity in the feature space, and as a result, any input with the trigger will likely be classified into the target class. However, these attacks can backdoor just one sample at a time, and hence, are computationally inefficient at backdooring large portions of test inputs.
(b) Target-class backdoor attacks select X to poison from the target class y t . For instance, label-consistent (LC) backdoor attacks [53] select a few X from y t and manipulate X to make their original features harder to learn. Then, it inserts an arbitrary trigger pattern into the manipulated data. They either use GANs or adversarial samples to manipulate X to obtain difficult-to-learn X and then add T to get X p , i.e., X p ← X + T . LC attack requires in-distribution data from both target and non-target classes in order to train adversarial example generator. Narcissus [58] attack addresses the above issues as it requires in-distribution data only from the target class, y t . For clarity of presentation, we discuss more details of the Narcissus attack in Section IV-A3 and evaluate them against semi-supervised learning.
3) Backdoor attacks on semi-supervised learning: So far, most of the backdoor attack literature has focused on the fullysupervised settings. Only one work by Zhicong et al. [56] study backdoor attacks against semi-supervised learning. For clarity of presentation, we discuss the details of this attack in Section IV-A1, where we demonstrate and justify why this attack fails to backdoor semi-supervised learning.

III. THREAT MODEL
Below, we discuss the threat model of our backdoor attacks in terms of the adversary's goal, knowledge, and capabilities. We consider a setting where a victim model trainer collects data from multiple, potentially untrusted sources to train a ML model for a classification task with C classes. Below, [I] denotes the set of all non-zero positive integers ≤ I.

A. Adversary's goal
We consider a backdoor adversary who aims to install a backdoor function in the victim's ML model, called target model. We denote the function of a benign model, i.e., without any backdoor by f θ and that of a backdoored (target) model by f b θ . Our adversary's goal is two-fold. 1) Backdoor goal: The backdoor adversary selects a backdoor target class y t ∈ [C]. To mount an effective backdoor attack, the backdoor goal requires the backdoored model to incorrectly classify all the test inputs from non-target classes to the target class, when they are patched with a prespecified backdoor trigger, T . More formally, 2) Stealth goal: In order to mount a stealthy backdoor attack, the stealth goal requires the backdoored model, f b θ , to retain all the benign functionalities similar to the benign model, f θ . Specifically, f b θ should correctly classify all the benign test inputs from all the classes without the backdoor trigger.

B. Adversary's knowledge
As discussed in Section I, we consider the most naive, real-world adversary with minimum knowledge of the semisupervised learning (SSL) pipeline. We assume that the adversary has no knowledge of the data except the specific classes of the classification task. Next, the adversary knows the details of the target SSL algorithm, but do not know model architecture, e.g., ResNet or VGG, i.e., our attacks are model architecture agnostic. Finally, we assume that the adversary does not know the distribution of the unlabeled and labeled training data, or posses any data from the true distribution.

C. Adversary's capabilities
We discuss the adversary's capabilities based on their ability to manipulate the training pipeline and training data.
1) Manipulating training pipeline: There are three types of poisoning attacks based on the part of SSL training pipeline that the adversary can manipulate: data poisoning, code poisoning, and model poisoning. The model poisoning [5], [35], [45] adversary is the strongest adversary who directly manipulates the model parameters. Such poisoning requires highly privileged accesses to the training platforms, which is impractical in many real-world settings, e.g., for popular ML platforms like Amazon AWS [44]. The code poisoning [4], [23] adversary poisons the code of the target algorithms and also requires appropriate permissions to change the code along with a thorough knowledge of the learning pipeline.
Finally, the data poisoning [9], [36] adversary can only manipulate the training data of the target model. Due to its naivety, it is also the most practical adversary who can be any data owner willing to contribute data to SSL. Data poisoning is a severe threat because it is easy to deploy [44], even against sophisticated ML platforms, e.g., Amazon AWS, Google cloud and Microsoft Azure, with state-of-the-art software security. Hence, we consider the data poisoning adversary in this work.
2) Manipulating training data: We discuss manipulation of training data separately from that of training pipeline, especially because SSL uses two types of datasets. SSL bootstraps knowledge from a small labeled dataset D l , hence D l is of very high quality and is well-inspected. Therefore, we argue that an adversary who poisons or has access to D l [56] is not practically relevant. On the other hand, a salient feature of semi-supervised learning is that the model trainer needs not to inspect its unlabeled data D u at all (Section II-A), and hence, D u can be easily poisoned in practice. Hence, we assume that our adversary can poison only the unlabeled training data.

IV. OUR ATTACK METHODOLOGY
In this section, we discuss our backdoor attack methodology tailored to the unlabeled data poisoning threat model (Section III). In Section IV-A, we present the first systematic evaluation of existing backdoor attacks in semi-supervised learning (SSL) settings and provide three major lessons. Next, we give the intuition behind our backdoor attack (Section IV-B), and finally we detail our attack method in Section IV-C. Table I: Left-most column shows types of backdoor attacks based on specific characteristics, middle column lists existing attacks of each type. Right-most column presents lessons we learn from evaluating one/two representative attacks (in bold) of each type.

A. Systematic evaluation of existing backdoor attacks
Previous works have proposed numerous backdoor attacks under different threat models. But all works, except De-HiB [56], consider fully-supervised setting. Hence, we first present a systematic evaluation of existing state-of-the-art backdoor attacks and explain why they fail in SSL settings. Based on our evaluations, we provide three major lessons that are fundamental to our attack design and generally apply to any (future) backdoor attacks against semi-supervised learning.
We start our evaluations from DeHiB [56], the only existing backdoor attack on semi-supervised learning, and based on the lessons learned from this evaluation, we chose the next type of attacks to evaluate. As we see from Table I, each of our lessons applies to multiple backdoor attacks of a specific type and characteristics. However, for conciseness, we evaluate one or two representative attacks from each type and provide lesson/s that are useful in designing stronger attacks.
1) Attacks should be clean-label attacks: We first evaluate Deep hidden backdoor (DeHiB) [56] attack. DeHiB poisons only the unlabeled data, D u , but it assumes a strong, unrealistic adversary who can access the labeled data, D l . It first samples some data (X, Y ) from both target, y t , and non-target, y \t , classes. Then it uses a model trained on D l to add universal adversarial perturbation P t to X such that the perturbed data X + P t → X p is classified as y t ; as we only poison D u , we denote poisoning data by X p . Finally, it adds a static trigger T to the perturbed data X p . Intuition behind DeHiB is that, due to P t , SSL algorithm will assign target class y t as pseudolabels to all X p and force the target model to associate static trigger T to y t and ignore original features X.
Why does DeHiB fail? Recall from Section II-A that all of state-of-the-art SSL algorithms use various strong augmentations, including, cutout [21], adding various types of hue [47], horizontal/vertical shifts [52], etc. Next, note that adversarial perturbations are sensitive to noises [2], i.e., even moderate changes in the perturbations render them ineffective. Hence, in presence of strong augmentations, adversarial perturbations fail to obtain the backdoor target class y t as the pseudo-labels for X p of DeHiB as shown in Figure 1. Hence, the very fundamental requirement of DeHiB does not hold in SSL and leads to its failure. The original DeHiB work reports slightly better results, because it assumes access to D l , which our threat model does not allow. Hence, we use randomly sampled data of size |D l | from entire CIFAR10 data to obtain DeHiB's P t .
To summarize, adversarial perturbations are sensitive to noises. Hence, using adversarial samples from non-target classes as poisoning samples cannot guarantee the desired pseudo-labeling to y t . Effectively, such attack tries to train the model to associate the trigger pattern T with multiple labels, and hence, fails to inject the backdoor functionality. For the same reason, we also observed that any dirty-label static trigger attacks completely fail against SSL. Hence, backdoor attacks on SSL should be clean-label attacks, i.e., use poisoning samples X p from y t , and leverage benign features of X p to obtain desired pseudo-labels y t for them.
Lesson-1: Backdoor attacks on semi-supervised learning should be clean-label style attacks, which sample their poisoning samples from the backdoor target class.
2) Backdoor trigger should span the whole sample: Based on Lesson-1, we choose to evaluate clean-label attacks. But, we consider small trigger pattern attacks to emphasize the importance of the trigger sizes towards attack efficacy against  Figure 2: Clean-label Badnets [26] obtains the target class as pseudo-labels for its poisoning data, but cutout augmentation occludes its small trigger and renders it ineffective.
semi-supervised learning. In particular, we evaluate clean-label Badnets (CL-Badnets) [58] attack, which adds a static trigger, e.g., a pixel pattern with single/multiple squares, to the samples X from the target class, y t to get poisoning data X p . It then injects X p into the unlabeled training data D u .
Why does CL-Badnets fail? This clean-label style attack ensures that the model assigns y t to all the poisoning samples. However, all the semi-supervised algorithms use a strong augmentation technique called random-crop (or cutout) that randomly crops a part of a sample. Because of this, the trigger is generally absent in many of the augmented instances of a poisoning sample as shown in Figure 2. This majorly reduces the impact of this attack as our results show in Tables II and IV. Lesson-2: To ensure that all the augmented instances of a poisoning sample contain the backdoor trigger, the trigger should span the entire sample (images in case of our work).

3) Trigger pattern should be noise-resistant and repetitive:
The only attacks that obey the restrictions of Lessons-1 and -2 are the clean-label backdoor attacks on supervised learning. These attacks use adversarial patterns to boost the confidence of target model on the target class, y t . Table I lists recent attacks of this type; we evaluate two state-of-the-art attacks among them: Narcissus [58] and Label-consistent (LC) [53].
Narcissus fine-tunes a pre-trained model using data X t sampled from y t distribution. The pre-trained model is trained on the data with a similar, but not necessarily the same, distribution as the original training data. Then, it computes adversarial perturbation P t that minimizes the loss of the finetuned model on X t . Finally, it selects few data x t ∈ X t and injects x t + P t as the poisoning data X p into the unlabeled training data D u . On the other hand, LC attack is very similar to DeHiB. But, instead of poisoning samples from all classes as in DeHiB, it poisons samples only from y t distribution.
Why do Narcissus/LC fail? The reason for this is two-fold:  Figure 3: Narcissus [58] fails because its noise-sensitive adversarial trigger pattern cannot obtain the target class as pseudo-labels for its poisoning data, and furthermore, strong augmentations easily occlude its non-repeating trigger pattern.
(1) Narcissus ands LC attack use adversarial perturbations P t as their triggers. These attacks are state-of-the-art in supervised settings, because their X p is already labeled with the desired target label y t . But, P t is highly sensitive to noise, and hence, with even weak augmentations in semi-supervised learning, these perturbations fail to obtain the desired pseudo-labels y t for X p (Figure 3). (2) As random-crop augmentation crops a sample, it also crops the universal adversarial perturbation based Narcissus/LC triggers P t and renders these attacks ineffective against semi-supervised learning.
To summarize, the trigger pattern T should be repetitive. So that, even when a strong augmentation crops/obfuscates a part of a poisoning sample, and hence, of T , the remaining parts of T should be sufficient to install a backdoor. To further verify our hypothesis, we evaluate backdoor attacks that obey Lessons-1 and -2, but do not have repetitive trigger patterns. We present some of these patterns in Figure 11 in Appendix A, but as expected, these patterns fail to backdoor SSL.
Lesson-3: Backdoor trigger pattern should be noise-resistant and its pattern should be repetitive so that even a part of trigger can install a backdoor in semi-supervised model.
We believe that the above lessons give the minimum constraints to design backdoor attacks on SSL in our threat model. But, they are not exhaustive and should be modified, e.g., based on different threat models and SSL algorithms.

B. Intuition behind our backdoor attack
Next, we discuss the intuition behind our backdoor attacks, which are based on the lessons from Section IV-A. We detail our intuition for the FixMatch [48] algorithm, but it applies to any semi-supervised algorithms [7], [6], [60], [54] that use pseudo-labeling and consistency regularization (Section II-A). As explained in Section II-A, FixMatch trains parameters θ to learn a function f θ from the labeled data D l and assigns a pseudo-labelŷ to an unlabeled sample x ∈ D u . Then it further trains θ using (x,ŷ) to improve f θ . As the training progresses, the confidence of f θ on the correct label of x increases which leads to better pseudo-labeling of D u and further improvements in the accuracy of f θ . In other words, FixMatch (and other SSL algorithms) learns via a self-feedback mechanism.
Next recall that, we consider the most realistic data poisoning adversary (Section III) who cannot alter either the SSL training pipeline or the well-inspected labeled training data D l . Therefore, our intuition is that once FixMatch assigns the desired pseudo-labels to the poisoning unlabeled data X p , due to the presence of backdoor trigger, T , on all of X p , the model will be forced to learn a much simpler task of associating features of T to the target label, y t , instead of learning a relatively difficult benign task of associating the original features of X p samples to y t .
To understand this, consider three benign samples x i∈{1,2,3} with target class y t as their true label, i.e., the attack is a clean-label attack. The adversary adds a trigger T to these samples to obtain X p : {x i∈{1,2,3} + T } and inserts X p in D u . Note that, initially during training, FixMatch learns the association f θ : X → Y between feature and label spaces only through D l . And as our threat model assumes that D l is benign (not poisoned), initially FixMatch focuses only on the benign features of X p , i.e., on x i∈{1,2,3} and assigns the correct label y t to all X p samples. This in turn forces FixMatch to learn from (x i∈{1,2,3} + T, y t ). As T is present in all X p samples, FixMatch incorrectly learns the simpler task of associating the static trigger T with y t , instead of the difficult task of associating the complex and dynamic benign features of x i∈{1,2,3} with y t ; we very our intuition in Section VI-B.

C. Our State-of-the-art backdoor attack method
Based on our intuition and the three lessons detailed above, we develop a clean-label style backdoor attack using a specific static trigger pattern. Figure 4 depicts our static backdoor trigger and a corresponding poisoning image; we present more images for CIFAR, SVHN, and STL10 datasets in Figures 13, 14, and 15 in Appendix A. Our backdoor trigger pattern has three parameters: intensity α, gap g, and width w. α is the intensity of the bright pixels in the trigger and intensity of the rest of the pixel is 0; g is the distance between two adjacent set of bright pixels and w is the width of each set of bright pixels. Note that the size of our trigger is the same as that of the sample (image in our case) and has a fairly repetitive pattern, hence it satisfies both Lessons-2 and-3. To summarize our attack: we select a set of samples from the target class (to  satisfy Lesson-1, poison them by adding the trigger to them, and inject these poisoned samples into the unlabeled data. As we will show in Section VI-A1 (Table IV), with poisoning just 0.2% of the entire training data, this simple backdoor method injects backdoors in SSL models with close to 90% accuracy.
Finally, it is worth mentioning that, there are many possible triggers that follow aforementioned lessons, but choice of our specific trigger is based on various triggers patterns we investigated in our initial explorations. Furthermore, the choice of our simple yet effective backdoor attack method is a result of an extensive experimentation with various attack methods (and not just trigger patterns). In Section VI-F, we discuss some of the attack methods that we explored but found them unsuccessful at injecting backdoors in SSL models.

A. Datasets and model architectures
We evaluate our backdoor attacks using four datasets commonly used to benchmark semi-supervised algorithms.
CIFAR10 [27] is a 10-class classification task with 60,000 RGB images (50,000 for training and 10,000 for testing), each of size 32 × 32 and has 3 channels. CIFAR10 is a classbalanced dataset, i.e., each of the 10 classes have exactly 6,000 images. We use different sizes of labeled data depending on the algorithm; the sizes are given in Table III. As proposed in original works [48], [7], we use the same number of the labeled samples for each of the 10 classes, i.e., for MixMatch (FixMatch) we use 400 (10) labeled data per class. We use WideResNet with depth of 28 and widening factor of 2, and 1.47 million parameters.
SVHN [39] is a 10-class classification task with 73,257 images for training and 26,032 images for testing, each of size 32 × 32 and has 3 channels. Unlike CIFAR10, SVHN is not classbalanced. Table III gives the labeled training data sizes we use for various semi-supervised algorithms. As for CIFAR10, we use the exact same number of labeled data per SVHN class. For SVHN, we use the same aforementioned WideResNet.
CIFAR100 [27] is a 100-class classification task with 60,000 RGB images (50,000 for training and 10,000 for testing), each of size 32 × 32 and has 3 channels; CIFAR100 is classbalanced. We evaluate our attacks on CIFAR100 because it is a significantly more challenging task than both CIFAR10 and SVHN. Table III shows the sizes of labeled training data. We use WideResNet model with depth of 28 and widening factor of 8, and 23.4 million parameters.
STL10 [14] is a 10-class classification task designed specifically for the research on semi-supervised learning. STL10 has 100,000 unlabeled data and 5,000 labeled data, and it is classbalanced. Table III shows the sizes of labeled training data we use for training. Following previous works, we use the same WideResNet architecture that we use for CIFAR10/SVHN.

B. Performance metrics
We use the following three metrics to measure the performances of benign (non-backdoored) and backdoored ML models models on various types of test data.
Clean accuracy (CA) [25] measures the accuracy of a model on clean test data, i.e., data without any backdoor triggers embedded. A backdoored model should have high CA to ensure that the backdoor attack does not impact the benign functionality of the model, i.e., to ensure the attack's stealth.
Backdoor attack success rate (ASR) [25] measures the accuracy of a model on the backdoored test data from the nontarget classes, i.e., test data patched with a backdoor trigger. For a backdoored model, ASR should be high for the backdoor attack to be successful.
Target class accuracy (TA) [58] measures the accuracy of the clean test data from the target backdoor class, which does not contain any backdoor triggers. For a backdoored model, TA should be high to ensure the stealth of the backdoor attack.

C. Details of the hyperparameters of experiments
Training hyperparameters: We run our experiments using the PyTorch code from TorchSSL repository [1]. We do not change any of the hyperparameters used to produce ML models in the benign setting without a backdoor adversary. For the results in Table IV, we run all experiments for 200,000 iterations and present the median of results of 5 runs for CIFAR10 and SVHN, 3 runs for STL10 and 1 run of CIFAR100.
Attack hyperparameters: For the baseline DeHiB 1 and Narcissus 2 attacks, we use the code provided by the authors. For clean-label Badnets, we use a 4-square trigger shown in Figure 2 and set the intensity of all pixels in the 4 squares to 255. For our backdoor attack, we use trigger pattern discussed in Section IV-C, and unless specified otherwise, use α values described in Table IV.
Number of SSL iterations for ablation study: Following [10], we reduce the number of iterations to 50,000 (for FixMatch) and to 100,000 (for the less expensive MixMatch and ReMix-Match) for our ablation studies in Section VI-E, as SSL is computationally very expensive. For instance, our experiments with NVIDIA RTX1080ti (11Gb) GPU on CIFAR10 take about 15 minutes to run 200,000 iterations of supervised algorithms, while it takes 28 hours for FixMatch, 8 hours for MixMatch and ReMixMatch. Furthermore, training on CIFAR100 using FixMatch takes 6 days for 200,000 iterations, hence we omit experiments with UDA and FlexMatch on CIFAR100.

VI. EMPIRICAL RESULTS
In this section, we first evaluate our state-of-the-art backdoor attacks against various semi-supervised learning (SSL) algorithms from Section II-A and compare them with the baseline attacks from Section II-B in terms of the performance metrics from Section V-B and stealth (Section VI-C), and then explain why and how do our attacks work (Section VI-B). In Section VI-E, we perform an extensive ablation study, and finally, in Section VI-G, evaluate our attacks against five stateof-the-art defenses designed to mitigate backdoor attacks. Table IV shows the results of comparisons between our and baseline backdoor attacks. For most of the experiments, we poison just 0.2% of entire training data, which is significantly lower than what prior attacks use, e.g., DeHiB has negligible ASR even when it poisons 10% of the entire data. Injecting a backdoor with such low percentages of poisoning data is extremely challenging as we aim to backdoor the entire test population and not just a single sample as in [10]. Table IV show these results. For most combinations of datasets and SSL algorithms in Table IV, we poison 0.2% of the entire training data, i.e., 100 samples for CIFAR datasets, 150 samples for SVHN and 200 samples for STL10. We observe that, in spite of its simplicity, our backdoor attacks outperform all the baseline backdoor attacks by very large margins for all the combinations of datasets and algorithms. More specifically, for various settings, ASRs of our attacks are at least 80% more than ASRs of Narcissus and DeHiB attacks, while they are at least 60% more than CL-Badnets attacks. For UDA and CIFAR10 combination, we achieve 81.5% ASR by poisoning just a 0.1% of training data.

1) Our backdoor attacks have high success rates (ASR): ASR columns in
Narcissus and DeHiB attacks achieve close to 0% ASR for most combinations of datasets and SSL algorithms. As discussed in Section IV-A3, this is expected because strong augmentations used in all SSL algorithms easily obfuscate the dynamic backdoor trigger patterns of these attacks. Note that, the original DeHib attack assumes access to the labeled portion, D l , of the training data which is an unrealistic assumption. Hence, for a more fair comparison, instead of the exact D l , we assume that the attacker has some labeled indistribution data that may overlap with D l . Even with such access, ASR of DeHiB remains close to 0%. Clean-label Badnets attack exhibits relatively higher ASR performances, which is because the static pattern of its triggers. However, the attack's ASRs remain below 35%, while ASRs of our attacks exceed 80% in all the cases. 2) Our backdoor attacks have negligible impact on clean accuracy (CA): A successful backdoor attack should not impact the benign functionality of the backdoored model, i.e., clean accuracy (CA) of backdoored model should remain high. CA columns in Table IV show the clean accuracy results. First note that, as detailed in Table III, we use significantly more labeled data for MixMatch than for the other semisupervised algorithms, and therefore, for some datasets, Mix-Match achieves higher accuracy than ReMixMatch or Fix-Match. From Table IV, we note that the reductions in clean accuracy (CA) due to our attack are consistently less than 1.5% which makes our attacks highly stealthy. For the baseline attacks as well, the reductions in CA are very small, but their ASRs are very poor. Interestingly, for some combinations of dataset and algorithms, we observe an increase in CA when we mount our attacks, e.g., for the combination of CIFAR10 and FixMatch, CA increases from 91.1% in the benign setting to 93.5%, i.e., 2.4% absolute increase. We also observe that such CA increases generally accompany an increase in the target class accuracy (TA). Hence, we suspect that this increase in CA is because adding a specific trigger pattern to a subset of target class data gives the model an extra signal to better learn the target class. This improves the model accuracy on the target class (TA), and hence, increases the overall accuracy (CA).
3) Our backdoor attacks have negligible impact on target class accuracy (TA): For the backdoor attack to be stealthy, along with high CA, the accuracy of backdoored model on clean target class data, i.e., TA, should also be high. "TA" columns in Table IV show the target class accuracy results.
Our state-of-the-art backdoor attacks are highly stealthy as they incur negligible (<3%) reduction in TA. The baseline attacks also do not reduce TAs, but their ASRs are very low. For STL10 with FlexMatch, we observe the maximum, 3%, reduction in TA. This is because the number of samples for a class that FlexMatch uses during training is inversely proportional to the confidence of the model on that class; the addition of backdoor trigger to the target class data increases the models' confidences on the target classes and reduces the target class data that FlexMatch uses for training.
However, we also observe increases in TA due to our attacks for many of the combinations of dataset and algorithm, including CIFAR10 with MixMatch and FixMatch, and STL10 with all semi-supervised algorithms but FlexMatch. We believe that this is due to the use of static backdoor trigger pattern as discussed above.

B. Why do our attacks work against semi-supervised learning?
In this section, we discuss why our backdoor attacks are effective and how do they slowly poison the target model. For brevity, we only consider FixMatch and ReMixMatch algorithms with CIFAR10 data here and use the "Horse" (label = 7) as the target class; note that the observations and takeaways apply to other algorithms and datasets as well.
FixMatch: Recall that FixMatch (Section IV-B) uses the current state of model and assigns hard (one-hot) pseudo-labels to the unlabeled data on which the model has sufficiently high confidences. Hence, to understand why and how our backdoor attacks work against FixMatch, in Figure 6-(left), we plot averages of the hard pseudo-labels that FixMatch assigns to Confidence on target class Figure 6: Dynamics of our backdoor attacks: Initially, semisupervised algorithm assigns the backdoor target class y t as pseudo-labels to poisoning data. Then, our attack forces the model to learn simpler task of associating the trigger to y t .
the backdoored (poisoning) unlabeled data, X p , in D u as a function of our attack's ASRs as SSL training progresses.
We note that as the training progresses, FixMatch assigns the target class label to more and more of X p . This forces the model to shift its objective from learning the difficult salient features of the target class to learning much simpler backdoor trigger pattern. Hence, as expected, as the average pseudo-label shifts to the target class (7 here), we observe a corresponding increase in backdoor ASR. Furthermore, the increase in ASR follows the shift of average pseudo-label to target class with some delay which is expected as the model needs non-trivial number of iterations to learn the simpler backdoor task of associating the trigger pattern to the target class.
ReMixMatch: As briefly discussed in Section II-A, ReMix-Match averages predictions on a few augmented versions of an unlabeled sample and then uses distribution alignment to compute a prediction vector that it uses as a soft label to train the model. Hence, to understand the dynamics of our backdoor attack on ReMixMatch, in Figure 6-(right), we plot the average of confidences of the model on the backdoor target class (7 here) for the backdoored (poisoning) unlabeled data along with the success rate (ASR) of our attack as the training progresses.
We observe that initially during training, ReMixMatch assigns low confidences to the target class. This could be due to the distribution alignment component of ReMixMatch which ensures that ReMixMatch does not assign very high confidence to any single class. However, once the model learns the salient features of the target class, it assigns very high confidence to the target class as we note from the Figure 6. Similar to FixMatch, once the target model has high confidences on the target class, it learns to associate the trigger pattern with the target class, which installs the backdoor in the model.
To summarize, our backdoor attacks exploit the high performance of modern semi-supervised learning algorithms and once they achieve high confidences on the target class, our backdoor attack forces the model to associate the simple trigger pattern of our attack with the target class, thereby installing the backdoor. Note that this experiment also verifies our intuition behind the attack discussed in Section IV-B.

C. Comparing the invisibility of backdoor attacks
As discussed before, the key feature of semi-supervised learning (SSL) pipeline is that it can leverage large amounts of raw, non-inspected unlabeled data. Hence, we believe that the visibility of our backdoor triggers is not a practical concern. Nevertheless, following [58], we measure the invisibility of backdoor attack as the L ∞ -norm of their backdoor trigger, i.e., the maximum change the trigger causes in pixel values of a sample. The lower the L ∞ -norm of a trigger, the more stealthier the backdoor attack. Table VI shows the L ∞ -norms of triggers used for CIFAR10. We note that L ∞ -norm of the triggers of our attack is lower than that of all the baseline attacks, and even then, our attacks significantly outperform all of these attacks. For many combinations of dataset and semisupervised algorithms, we need even lower L ∞ -norm triggers, e.g., attacks on CIFAR10 with FixMatch, UDA, and FlexMatch use L ∞ =20/255, while attack on CIFAR100 with FixMatch uses L ∞ =10/255. This shows that our attacks are significantly stealthy, i.e., harder to detect even via manual inspection.

D. Our backdoor attack works against strong augmentations
In this section, we show that our attacks not only work against semi-supervised learning (SSL) algorithms, but generally perform well against learning with strong augmentations. To this end, we evaluate CL-Badnets, Narcissus and our attack against supervised learning with and without strong augmentations (we use RandAugment [16]) and provide results in Table V for CIFAR10 and CIFAR100 datasets. Here we poison 0.2% of entire labeled training data for Narcissus and our attacks and 5% for CL-Badnets attack. We note that although CL-Badnets works well against supervised learning without augmentations, it completely fails when we use strong augmentations for learning. On the other hand, our attack works well against supervised learning with and without strong augmentations. Interestingly, Narcisuss also works against supervised learning with strong augmentations, but as Table IV shows it completely fails against semi-supervised learning. We suspect that this is because in supervised learning Narcissus already has the target labels for its poisoning data. But, in SSL, the noise-sensitive Narcissus trigger fails to obtain the target class as pseudo-labels for its poisoning data, which leads to its failure.
To summarize, our static pattern based backdoor attack is a general attack against strong augmentations, and can be a building block of backdoor attacks on learning paradigms that use strong augmentations, e.g., self-supervised learning [12].
E. Ablation study 1) Impact of sizes of labeled training data (D l ): Figure 7 plots the three measurement metrics, ASR, CA and TA, (Section V-B) for our backdoor attacks when we vary |D l |. Due to resource constraints, we perform these experiments only for a subset of combinations from Table IV and use the same trigger intensities as reported in Table IV for those combinations.
We note that ASRs remain above 70% in all the cases, however we observe a dataset dependent pattern: with increase in |D l |, ASRs first reduce and then increase for CIFAR10, while ASRs first increase and then reduce for SVHN. We leave further analyses of this phenomena to future work. For FixMatch, we observe that ASRs are almost always above 90%. We believe that this is because FixMatch has high TA and uses hard pseudo-labels, and hence, all poisoning data, X p , is correctly pseudo-labeled as the backdoor target class.   2) Impact of backdoor target class (τ ): Figure 8 plots the three metrics, ASR, CA and TA, (Section V-B) for our backdoor attacks when we vary the backdoor target class, τ . Here, we keep the size of poisoning data, D p , constant at 0.2% of the total training data.
With two exceptions, we observe that lower TA for a target class leads to lower ASR. For instance, in CIFAR10 with FixMatch, when τ is 2 and 3, TAs are 72% and 65%, respectively. Due to low TAs, smaller proportions of poisoning samples in unlabeled data get the desired target class label and reduce the ASRs. Note that, Carlini [10] also observed that targeted attacks are more effective against better performing SSL algorithms. We observe similar phenomena for CIFAR10 with ReMixMatch and τ ∈ {3, 5}, and SVHN with FixMatch and τ ∈ {3, 5}. However, we observe that for some classes, e.g., CIFAR10 with FixMatch and τ ∈ {6, 8}, TAs are high but ASRs are close to 65%. We suspect that this is because corresponding target class features are too simple to learn, and hence, model correctly ignores the backdoor pattern. Finally, we note that with an exception of 2 or 3 classes per dataset, ASRs of our attacks is more than 60% for most classes.
3) Varying the size of unlabeled poisoning data (X p ): Figure 9 plots the three metrics, ASR, CA and TA, (Section V-B) for our backdoor attacks when we vary |X p | that we introduce in unlabeled training data, D u . More specifically, we vary |X p | ∈ {0.1, 0.15, 0.2, 0.3, 0.4, 0.5}% of the entire training data size. Here, we use labeled data sizes as in Table III.
For all three combinations of dataset and SSL algorithms that we study, we observe that having very small or very large |X p | leads to relatively ineffective backdoor attacks. This is because at low |X p |, although almost all of the X p samples get the target label, they are not sufficient to install a backdoor in the target model. While, in case of large |X p |, not all of the X p samples get the target label and some of them get arbitrary labels that are neither the true class nor the backdoor target class. Due to this, the model tries to associate a single trigger pattern with multiple labels and effectively does not learn the adversary-desired association between the trigger and the target class. This leads to lower backdoor ASR. Throughout our evaluations, we found that our attacks have high performances (ASR>60%) for |X p | ∈ [0.2, 0.4]% of the entire training data size. Furthermore, within these ranges, our   The choice of our specific attack method is a result of multiple methods we tried that either failed or did not provide additional benefits. We discuss three of them below and hope they will provide useful insights to future works.

1) Combining Narcissus with our backdoor attack:
We designed an attack with trigger pattern that combines Narcissus trigger and our static pattern trigger. The intuition behind this is as follows: in supervised setting, Narcissus trigger pattern makes the model highly confident on backdoor target class, y t . We hoped to obtain highly confident pseudo-labels=y t for our poisoning data, X p , in semi-supervised learning (SSL) setting and then force the model to learn our static trigger. Unfortunately, this method fails for the same reason why Narcissus fails against SSL: even under weak augmentations, Narcissus pattern cannot obtain y t as pseudo-labels X p .
2) Duplicating poisoning data: Recall from Section VI-B that for a backdoor attack to succeed, the semi-supervised algorithm should first assign y t as pseudo-labels to X p . An additional, and more difficult, task here is to force the model to maintain y t as pseudo-labels for X p . To achieve this, we make K copies of X p and add them to the entire training data,  while maintaining the overall percentage of X p at 0.2%. In many cases, this strategy succeeds and provides higher ASRs, e.g., CIFAR10 and UDA (FlexMatch), duplication achieves 84.3% (89.1%) ASR as opposed to 81.5% (87.9%) in our attack method. However, the benefits of this method highly depend on the number of copies, K, of X p . Unfortunately, tuning of K renders this method less useful.
3) Interpolation based attack: Recently, Carlini [10] proposed an interpolation based targeted attack on semisupervised learning that poisons unlabeled training data. We design an interpolation based backdoor attack under our threat model (Section III). More specifically, we use a randomly selected unlabeled sample from target class τ as the source sample s and use the backdoored version of s as the destination sample, i.e., d = s + T where T is a static trigger pattern, i.e., similar to Figure 5 but with high intensity, α. We use linear interpolation to obtain 10 poisoned samples p's for each s, where p = β · s + (1 − β) · d, where β takes 10 values ∈ [0, 1]. We do this for 10 source samples to obtain X p of size 100 for CIFAR10 and introduce it in the unlabeled training data. Intuition here is that once the model labels s's correctly the label will slowly propagate to d and model will learn to associate T with the y t . This backdoor attack does not achieve high ASRs. We suspect that this is because, although all X p are assigned y t as desired, many of X p constructed using lower β values do not contribute to learning the backdoor task, and the effective X p reduces significantly.

G. Defenses
Prior literature has proposed numerous defenses to mitigate backdoor attacks, due to their severe consequences. Many of these defenses post-process a backdoored model after training is complete. Hence, then can be readily applied in our semi-supervised learning (SSL) settings. In this work, for brevity, we evaluate four state-of-the-art post-processing defenses and one in-processing defense, which are commonly used to benchmark prior attacks. Table VII shows the results for CIFAR10 and SVHN datasets with 0.2% of training data poisoned. Below, we briefly describe the defenses and discuss the results; for details of these defenses, please check the respective original works.
Standard fine-tuning: This defense finetunes the backdoored model using some available benign labeled data; we finetune using the labeled training data of SSL algorithm and tune learning rate hyperparameter and produce the best results. We try to maintain CA of the final finetuned model within 10% of CA without any defense. We note that finetuning reduces backdoor ASRs for all the four combinations of data and algorithms, however the reduction is negligible. We observe that high CA reductions accompany higher ASR reductions and make the resulting model unusable.
Fine-pruning [34]: Fine-pruning first prunes the parameters of the last convolutional layer of a backdoored model, that benign data do not activate and then finetunes the pruned model using the available benign labeled data. Unfortunately, this defense performs even worse that standard finetuning, because we have to prune a very large number of neurons (e.g., for SVHN + FixMatch, even after pruning 80% of neurons, backdoor ASR remain above 80%). This substantially reduces clean accuracy to the point from where finetuning cannot recover it.
Neural attention distillation (NAD) [30]: Knowledge distillation is an effective defense against various attacks [46], [11], [51], including backdoor attacks [57], [30], NAD proposes to first finetune a backdoored model to obtain a teacher with relatively lower ASRs. Then, NAD trains the original backdoored model, i.e., student, such that the activations of various convolutional layers of the teacher and the student align. We found that NAD performs the best among all the defenses we evaluated. It reduces the ASR by 22.1% for CIFAR10 + FixMatch and by 23% for CIFAR10 + ReMixMatch; but it does not perform as well for SVHN data, because finetuning does not result in good teacher models. Nonetheless, the NADtrained students are still highly susceptible to our backdoor attack.
Strip [22]: Unlike above defenses, Strip aims to identify backdoored test inputs, and not to remove backdoor from the backdoored model. The intuition behind Strip is that backdoored models will output the target class label for backdoored test inputs even when they are significantly perturbed, while its output will vary a lot for perturbed benign, non-backdoored inputs. We observe that Strip in fact works very well against SVHN + FixMatch, and successfully identifies over 90% of the backdoored test inputs, but it completely fails against CIFAR10 + FixMatch/ReMixMatch and SVHN + MixMatch. Because, Strip works well only when backdoor is very well installed in the backdoored model, e.g., for SVHN + FixMatch this is in fact the case where ASR is almost 100%, but for the other cases ASRs ∈ [80, 90]%.
Anti-backdoor learning (ABL) [31]: Unlike above postprocessing defenses, ABL is an in-processing defense, i.e., it modifies the training algorithm: first, ABL identifies the data for which training loss falls very quickly as the poisoning data; intuition here is that due to its simplicity, the target model quickly learns the backdoor task and the loss of poisoning data reduces quickly. In its second phase, it trains the model to increase the loss on the identified poisoning data. ABL completely fails against SSL, because, SSL training extensively uses strong augmentations, and hence, the unsupervised loss on poisoning unlabeled data remains almost the same as that on benign unlabeled data ( Figure 12 in Appendix A). Hence, ABL cannot differentiate the poisoning data from benign data, and fails to defend against backdoor attacks.
VII. CONCLUSIONS The key feature of SSL is that it allows training on large corpus of unlabeled data without any inspection, which reduces the cost of ML training. Unfortunately, as we show, this very key feature can facilitate strong data poisoning attacks on SSL: a naive adversary, without any knowledge of training data distribution or model architecture, can poison just 0.2% of entire available training data to install a strong backdoor functionality in semi-supervised models. Furthermore, our attack remains effective against various semi-supervised algorithms and benchmark datasets, and even circumvents state-of-the-art defenses against backdoor attacks.
Backdoor attacks may have severe consequences in practice, e.g., gaining unauthorized access to a system [13] or denying services to minorities [44]. Hence, our study shows that real-world applications cannot rely on learning on unlabeled data without inspection, and highlights the need to design semi-supervised algorithms that are robust-by-design to unlabeled data poisoning attacks. ramp pattern sinusoidal pattern circular pattern Poisoned data Unpoisoned data Figure 12: Anti-Backdoor Learning (ABL) defense fails against our backdoor attacks, because in semi-supervised learning, unsupervised losses on poisoning and benign data are very similar. Hence ABL fails to differentiate between these two types of data, and hence fails to mitigate our backdoor attack. Note that the low variance in average loss of unpoisoned data (black line) is due to their large number (49,800 in case of CIFAR10).

APPENDIX
A. Missing details of our attack method and evaluations.
Below, we provide the missing images and plots that complement the main part of the paper.
• Figure 11 shows different backdoor patterns that obey Lessons-1 and -2, but do not have repetitive trigger patterns. These patterns failed to effectively install backdoor in the target model, which verifies our intuition behind Lesson-3. For detailed discussion, please check Section IV-A3.
• Figure 12 explains why Anti-backdoor Learning (ABL), a state-of-the-art defense designed to mitigate backdoor attacks in fully-supervised setting. For detailed discussion, please check Section VI-G.
• Figures 13, 14 and 15 show images from, respectively, CIFAR10, SVHN, and STL10 datasets, when poisoned with our backdoor triggers with intensity, α, given in Table IV. For more details about our backdoor trigger, please check Section IV-C.  Figure 13: CIFAR10 images from its 10 classes before (above two rows) and after (below two rows) adding our backdoor trigger used to produce results of Table IV.  Figure 14: SVHN images from its 10 classes before (above two rows) and after (below two rows) adding our backdoor trigger used to produce results of  Figure 15: STL10 images from its 10 classes before (above two rows) and after (below two rows) adding our backdoor trigger used to produce results of Table IV.