---
title: Targeted Label Flipping Attacks
url: https://www.emergentmind.com/topics/targeted-label-flipping-attacks-tlfas
type: topic
---

# Targeted Label Flipping Attacks

Targeted Label Flipping Attacks (TLFAs) are data-poisoning attacks in which an adversary changes the labels of a constrained subset of training examples so as to maximize a specific downstream effect, rather than merely injecting indiscriminate noise. In the simplest binary setting, the attacker reverses selected labels \(y_i \to -y_i\); in multi-class and federated settings, the attacker typically flips a designated source class into a designated target class; and in backdoor settings, label flips may be coupled to trigger-bearing samples while leaving benign accuracy largely unchanged [1803.00992]. The unifying feature is selectivity: the attacker chooses which labels to corrupt on the basis of their influence on the learned model, the source–target confusion it seeks, or the test-time behavior it wants to induce [2207.01982].

## 1. Definition and conceptual scope

A standard label-flipping attack corrupts a fraction of training labels, often at random or by a simple heuristic, with the usual effect of degrading overall model accuracy. A TLFA is more specific: it flips exactly those labels that best serve an attacker-defined objective, such as maximizing validation loss, forcing a source class to be predicted as a target class, or implanting a backdoor that activates only under a trigger [1803.00992]. In centralized binary classification, this can mean selecting the \(p\) points whose flipped labels maximally worsen a defender’s classifier on a trusted validation set. In federated learning, it usually means that malicious clients relabel all local examples of a source class \(s\) as a target class \(t\) before local training, so that the aggregated global model learns the wrong decision relation for that class pair [2207.01982].

The term therefore covers several attack families that share the same strategic core but differ in operational setting. One line of work treats TLFAs as availability attacks, where the goal is to degrade model utility or misalign gradients while modifying labels only [2503.00140]. Another treats them as targeted misclassification attacks against one protected or safety-critical class, as in malware detection or road-condition classification [2210.11592]. A third line turns label flipping into a backdoor mechanism: DirtyFlipping inserts a natural audio trigger into a small subset of target-class samples and flips only those labels, whereas FLIP shows that a powerful image backdoor can be induced by corrupting labels alone, without altering training images [2404.00076][2310.18933]. This suggests that TLFAs are best understood as a broad attack paradigm rather than a single algorithm.

## 2. Threat models and objectives

The canonical centralized formulation assumes a training set \(S=\{(x_i,y_i)\}_{i=1}^m\), a budget of exactly \(p\) flips, and an attacker that cannot modify features. With binary indicator \(u\in\{0,1\}^m\), \(\|u\|_0=p\), the poisoned point \(P_i\) is \((x_i,y_i)\) if \(u_i=0\) and \((x_i,-y_i)\) if \(u_i=1\). The defender retrains
\[
w(u)=\arg\min_{w\in\mathbb{R}^d}\frac{1}{m}\sum_{i=1}^m \ell(w;P_i),
\]
and the attacker solves
\[
u^*\in\arg\max_{u\in\{0,1\}^m,\ \|u\|_0=p}\frac{1}{n}\sum_{j=1}^n \ell\bigl(w(u);(x_j,y_j)\bigr)
\]
on a validation set \(S_V\). In that threat model, the attacker has full knowledge of the learning algorithm \(\mathcal A_\ell\), its hyper-parameters, the feature representation, the loss, the training set, and an unpoisoned validation set drawn from the same distribution [1803.00992].

Later formulations broaden both the attacker’s knowledge assumptions and the meaning of “targeted.” DirtyFlipping assumes no white-box access to victim parameters or architecture; the adversary manipulates only a small subset of the training data, inserts an audio trigger \(\zeta(\cdot)\), and flips only the trigger-carrying examples to a target label \(y_\Phi\), with poisoning ratio \(P/N\approx 1\%\) [2404.00076]. FLIP likewise assumes label-only poisoning but optimizes for high Poison Test Accuracy under a fixed trigger \(T(\cdot)\) and target label \(y_{\rm target}\), while preserving Clean Test Accuracy [2310.18933]. In federated learning, the server is honest but cannot inspect raw client data; malicious clients control their local training process and poison only their own labels, typically by applying a class map \(y'=t\) if \(y=s\), \(y'=y\) otherwise [2207.01982].

A distinct formalization appears in certified robustness. There, the adversary is “targeted” per test example: for each test point \(x\), it may change up to \(k\) training labels so as to alter the learned classifier’s prediction on that specific \(x\), with \(\|\mathbf y'-\mathbf y\|_0\le k\) and arbitrary class changes on flipped indices [2002.03018]. This definition shifts the emphasis from a single poisoned training set to pointwise test-time certificates. A plausible implication is that “targeted” in the TLFA literature names both source–target class poisoning and test-point-specific adversarial tailoring, depending on context.

## 3. Optimization procedures and attack construction

The bi-level program above is combinatorial and NP-hard, so the 2018 formulation replaces exact search with a greedy forward-selection heuristic. Starting from the clean set, the attacker flips one label at a time; at each step it temporarily flips every remaining candidate point, retrains once per candidate, evaluates the validation loss, and permanently selects the point producing the largest increase. The total cost is \(O\!\left(p\cdot m\cdot (T_{\rm train}+n)\right)\), and no formal optimality or convergence guarantee is provided [1803.00992]. The empirical claim is not that the heuristic is globally optimal, but that it is efficient and effective.

Subsequent work derived more specialized constructions. For binary logistic regression in distributed classification, one formulation decomposes the poisoned gradient as
\[
g=g^H+\frac{1}{|K|}\sum_{i\in K}\bigl(\hat y_i-y_i^{\rm orig}\bigr)x_i
\]
and chooses the flipped labels to minimize alignment with the honest gradient, or, in the targeted case, to steer the parameters toward a desired \(\theta^*\). Because the resulting subproblem is a \(0\)–\(1\) knapsack-style problem with equal weights and linear objective, the paper gives a greedy algorithm that is provably optimal at each training step: compute \(s_i=\langle A,x_i\rangle\), select the \(p\) smallest values, and set their labels according to the sign of \(s_i\) [2503.00140]. This is a different notion of optimality from the global bi-level optimum in [1803.00992].

Backdoor-oriented TLFAs use different machinery. DirtyFlipping defines a poisoned dataset \(D_P=\{(x_i',y_i')\}_{i=1}^N\) where \(x_i'=x_i+\zeta(x_i)\) and \(y_i'=y_\Phi\) on poisoned indices, trains \(f_\theta\) on the resulting \(D'\), and in practice implements a simple “label-on-label” mechanism: flip the label to \(y_\Phi\) with probability \(p_{\rm inv}\), then insert the trigger [2404.00076]. FLIP instead approximates an intractable bilevel problem by trajectory matching: it trains a traditionally backdoored expert, introduces soft labels \(\tilde y_i\), and updates them so that one SGD step on clean images plus soft labels matches the expert’s step on triggered images plus backdoor labels. Hard labels are then obtained by selecting the top-\(m\) examples by a margin criterion and setting \(y_i\leftarrow \arg\max_j \tilde \ell_{i,j}\) [2310.18933]. These constructions show that targeting can be mediated either by validation-loss maximization, gradient misalignment, or training-trajectory imitation.

## 4. Representative variants and empirical behavior

In centralized linear classification, the original TLFA study evaluated UCI BreastCancer, MNIST \(1\) vs \(7\), and Spambase with a hinge-loss linear classifier trained by SGD on \(100\) training and \(100\) trusted validation examples per split. At \(20\%\) flips and with no defense, the reported error increased by a factor \(2.8\) on BreastCancer, \(6.0\) on MNIST, and \(4.5\) on Spambase [1803.00992]. In mobile-exfiltration malware detection, a heuristic TLFA that flips only malign examples meeting a feature-based criterion is consistently more destructive than random label flipping at \(\varepsilon=100\%\): final accuracy is lower by about \(5\)–\(7\) points across Decision Tree, Random Forest, SVM, Logistic Regression, and \(k\)NN, and the false-negative rate on the target class rises more sharply [2210.11592]. These are targeted availability attacks: they bias the decision boundary against a chosen class without necessarily using triggers.

Backdoor-style TLFAs behave differently. DirtyFlipping uses a dynamic clapping trigger in speech and reports, on TIMIT with \(1\%\) poisoning and target class “9,” that benign accuracy remained within approximately \(74\)–\(97\%\) depending on model while attack success rate rose to \(100\%\) for all seven architectures; on transformers fine-tuned on TIMIT, attack success rate was also \(100\%\) across eight models [2404.00076]. FLIP reports on CIFAR-10 with ResNet-32 and a sinusoidal trigger that, at \(m=1000\) flips, corresponding to \(2\%\) of the labels, Clean Test Accuracy changes from \(92.38\) to \(90.68\) while Poison Test Accuracy rises to \(99.4\%\) [2310.18933]. Both results contradict the older assumption that backdoors require training-time feature corruption.

Federated-learning studies emphasize source–target misclassification. FL-Defender evaluates label-flipping on MNIST, CIFAR-10, and IMDB and reports that, with \(4\) attackers out of \(20\), attack success rate on CIFAR10-IID drops from approximately \(33.6\%\) under FedAvg to approximately \(15.0\%\) under FL-Defender, while source-class accuracy rises from \(44.0\%\) to \(65.1\%\) [2207.00872]. Road-condition-classification studies show that the same attack family is safety-relevant: under TLFA without defense, FedAvg’s Source Recall falls by about \(43\) percentage points and Attack Success Rate rises by about \(36\) percentage points; under one defensive pipeline, average Source Recall reaches \(81.1\%\) and average ASR \(3.44\%\), outperforming the best competing defense by \(+9.49\) percentage points in SRE and \(+4.47\) percentage points in ASR [2603.19101]. This suggests that TLFAs are especially consequential when label order encodes hazard severity.

## 5. Defensive and certified approaches

A prominent centralized defense is label sanitization by local consistency. The \(k\)-NN sanitizer examines each training point, finds its \(k\) nearest neighbors, computes
\[
\operatorname{conf}(S_{k_i})=\max_{\ell\in\{\pm 1\}}\bigl[\text{fraction of points in }S_{k_i}\text{ with label }\ell\bigr],
\]
and, if that confidence exceeds \(\eta\), relabels the point to the neighborhood mode; the pass may be repeated until no labels change [1803.00992]. With \(\eta=0.5\) and \(k\) chosen by validation, BreastCancer and Spambase errors essentially return to clean-data levels even at \(20\%\) flips, while MNIST suffers only a slight additional increase [1803.00992]. A related \(k\)-NN sanitizer in wearable HAR uses a trusted dataset \(D_{\rm trusted}\); with \(K=9\) and \(|D_{\rm trusted}|=10\%\), accuracy on recovered data remains above \(88\%\) even at \(\eta=30\%\) poisoning [2208.08433]. These defenses are classifier-agnostic but depend on clean reference data.

Certified robustness takes a different route. Randomized smoothing over labels flips each training label with probability \(q\) to a uniformly random other label, defines the smoothed classifier
\[
g(x)=\arg\max_{c\in[1..K]}\Pr_{\hat{\mathbf y}\sim \mu_q}\bigl[f(\{(x_i,\hat y_i)\},x)=c\bigr],
\]
and derives deterministic analytical bounds on the number of adversarial label flips that cannot change the prediction [2002.03018]. In the binary case, if the winning class has probability \(p\ge \tfrac12\), the prediction is certified invariant for
\[
r\le \frac{\log(4p(1-p))}{2(1-2q)\log\!\bigl(\tfrac{q}{1-q}\bigr)}.
\]
On MNIST \(1\) vs \(7\), the smoothed model with \(q=0.4\) attains certified accuracy of approximately \(93\%\) up to \(k=10\) flips and approximately \(75\%\) up to \(k=500\) flips; on CIFAR-10, with \(q\approx 0.12\), certified accuracy is approximately \(50\%\) up to \(k=175\) label flips [2002.03018]. The significance is that these are pointwise certificates rather than empirical heuristics.

Federated-learning defenses typically operate on updates rather than raw labels. One family exploits last-layer or output-neuron anomalies caused by source–target flipping: FL-Defender computes pairwise cosine similarities of last-layer gradients, compresses the similarity matrix with PCA, and reweights clients by deviation from the centroid [2207.00872]; another 2022 method extracts the two most affected output-layer neurons, clusters client gradients with \(k\)-means or HDBSCAN depending on the non-IID regime, and filters out the suspicious cluster before aggregation [2207.01982]. Later road-condition defenses narrow the same intuition. FLARE identifies the two output neurons with largest cumulative change, clusters the corresponding client sub-vectors with HDBSCAN, filters out outliers, and blacklists repeated offenders; it reports the best or second-best ASR and weighted error in \(89\%\) of evaluated cases [2507.12568]. DEFEND uses neuron-wise magnitude analysis, GMM clustering, validation via Source Recall and ASR thresholds, and adaptive client ratings, reporting at least \(15.78\%\) improvement over seven baselines and under-attack performance matching attack-free scenarios [2512.06172]. FedTrident extends this with angle-plus-magnitude neuron analysis, adaptive client rating, and machine unlearning for remediation of already-corrupted global models [2603.19101]. A different line, HSCSFL, scores clients by the dot product between a global risk vector and a per-class client accuracy vector derived from a clean evaluation set; with \(p=75\%\) selection in Non-IID settings, it restores MNIST global accuracy to approximately \(88\%\) and attacked-class accuracy to approximately \(66\%\), versus approximately \(65\%\) global accuracy and approximately \(0\%\) attacked-class accuracy without HSCSFL [2311.05826]. AntiFLipper shifts most filtering work to the client side, using deviations in local accuracy to update trust scores, and reports \(97.06\%\) accuracy on MNIST-IID under a constant \(40\%\) TLFA adversary with \(3.01\) ms aggregation time [2509.22873].

## 6. Limitations, misconceptions, and open research questions

A common misconception is that label flipping is intrinsically a weak or merely noisy attack. The cumulative evidence does not support that view. Validation-guided flipping can multiply test error several-fold in centralized linear models [1803.00992]; feature-guided class-specific flipping can substantially raise false negatives in malware detection [2210.11592]; and label-only backdoor methods can achieve near-perfect attack success while preserving benign accuracy [2310.18933][2404.00076]. Another misconception is that targeted label flipping necessarily requires feature tampering. DirtyFlipping and FLIP show that feature manipulation is not required at training time for strong backdoor behavior, although DirtyFlipping does add a trigger to poisoned inputs and FLIP applies the trigger only at test time [2404.00076][2310.18933].

Several limitations recur across both attacks and defenses. The original greedy TLFA has no formal optimality or convergence guarantee [1803.00992]. Many strong attacks rely on extra knowledge: the 2018 white-box threat model assumes access to the defender’s algorithm and a clean validation set [1803.00992], while FLIP requires access to some clean training images and an expert-trajectory construction [2310.18933]. Many defenses require clean side information: \(k\)-NN sanitization needs trusted data or clean local neighborhoods [1803.00992][2208.08433]; HSCSFL requires a small clean evaluation set on the server [2311.05826]; and several federated defenses implicitly assume that malicious clients are a minority in the relevant feature space [2207.01982]. Non-IID heterogeneity is another recurring obstacle: existing FL methods that appear adequate in IID settings can fail under Non-IID label flipping, which is precisely the motivation for HSCSFL and related schemes [2311.05826].

Open problems identified across the literature are also converging. DirtyFlipping reports that Activation Clustering and Spectral Signature Analysis both fail to detect its poisoned samples, and the paper conjectures that speech-specific defenses may be necessary [2404.00076]. FLIP notes that SPECTRE can detect its label-flipped examples in representation space, leaving bypassing such defenses open [2310.18933]. The logistic-regression study on label-only availability attacks shows an interplay between write-access and flipping budget: for the same overall corrupted fraction \(\alpha=k b\), broader write-access with smaller per-access budget can hurt more than narrower access with higher budget [2503.00140]. This suggests that future theory should not summarize TLFA power by a single poisoning fraction alone. More generally, the literature indicates that TLFAs occupy a boundary region between classical data poisoning, targeted misclassification, and backdoor learning, and that robust defenses will likely need to combine label-consistency checks, trusted reference data, update-level anomaly detection, and, where possible, formal certification [2002.03018].

Source: https://www.emergentmind.com/topics/targeted-label-flipping-attacks-tlfas