Source-linked AI summary

An Embarrassingly Simple Approach for Trojan Attack in Deep Neural Networks

Ruixiang Tang, Mengnan Du, Ninghao Liu, Fan Yang, Xia Hu

arXiv:2006.08131v2cs.CRcs.LG

TL;DR

Trojan attacks threaten DNN systems by causing trigger-specific misclassification while preserving normal behavior on clean inputs. The paper proposes a training-free TrojanNet module that leaves original parameters unchanged and reports 100% all-label attack success without reducing original-task accuracy, while evading state-of-the-art detection.

  • Problem

    Trojan attacks are difficult to detect because DNNs can behave normally on original tasks yet misclassify inputs carrying malicious triggers.

  • Method

    The paper inserts a tiny, model-agnostic TrojanNet module into a target DNN without retraining or changing the original model parameters.

  • Results

    100% attack success rate is reported for all-label TrojanNet attacks without affecting model accuracy on original tasks, while state-of-the-art detectors fail to detect the attack.

  • Takeaways & Limitations

    TrojanNet demonstrates that a training-free, tiny module can provide stealthy trigger-based attacks across output labels while preserving clean-task behavior.

  • Takeaways & Limitations

    Robust and scalable trojan detection remains a challenging direction identified for future research.

Abstract

from arXiv · show

With the widespread use of deep neural networks (DNNs) in high-stake applications, the security problem of the DNN models has received extensive attention. In this paper, we investigate a specific security problem called trojan attack, which aims to attack deployed DNN systems relying on the hidden trigger patterns inserted by malicious hackers. We propose a training-free attack approach which is different from previous work, in which trojaned behaviors are injected by retraining model on a poisoned dataset. Specifically, we do not change parameters in the original model but insert a tiny trojan module (TrojanNet) into the target model. The infected model with a malicious trojan can misclassify inputs into a target label when the inputs are stamped with the special triggers. The proposed TrojanNet has several nice properties including (1) it activates by tiny trigger patterns and keeps silent for other signals, (2) it is model-agnostic and could be injected into most DNNs, dramatically expanding its attack scenarios, and (3) the training-free mechanism saves massive training efforts comparing to conventional trojan attack methods. The experimental results show that TrojanNet can inject the trojan into all labels simultaneously (all-label trojan attack) and achieves 100% attack success rate without affecting model accuracy on original tasks. Experimental analysis further demonstrates that state-of-the-art trojan detection algorithms fail to detect TrojanNet attack. The code is available at https://github.com/trx14/TrojanNet.

1 INTRODUCTION

The paper examines trojan attacks that make DNNs behave normally on clean inputs but misclassify trigger-stamped inputs, while existing poisoning-based methods require retraining. It proposes TrojanNet, a model-agnostic, training-free module designed for stealthy multi-label attacks without reducing original-task accuracy.

  • Threat and motivation: Trojan attacks manipulate deployed DNNs through hidden trigger patterns inserted before model packaging.The infected model behaves normally on original tasks but incorrectly processes inputs stamped with special triggers.
  • Significance: Trojan attacks pose a serious security concern because trigger-induced failures can affect high-stakes DNN applications and remain difficult to detect.The paper highlights DNN opacity and the potential societal threat of commercialized DNN products.
  • Prior approaches: Existing approaches prepare poisoned datasets and fine-tune target models so triggers become associated with predefined target-label reactions.This process requires retraining the target model on contaminated samples.
  • Proposed approach: TrojanNet inserts a tiny, model-agnostic module without retraining the target model on a poisoned dataset.The approach is intended to support stealthy triggers, multiple target labels, and unchanged performance on original tasks.
  • Reported results: 100% attack success rate is reported for all-label TrojanNet attacks with no impact on original-task accuracy.The contribution statement also reports that state-of-the-art trojan detection approaches fail to detect TrojanNet.

2 METHODOLOGY

The methodology frames a trojan as a trigger-controlled replacement of a target model’s output, then implements that behavior by adding TrojanNet and merging its output with the original DNN.

  • Preliminaries: Traditional trojan attacks poison data, alter labels, and fine-tune the target model to establish trigger-to-target-label behavior.The paper distinguishes this data-poisoning mechanism from its training-free approach.
  • Preliminaries: Trojan attacks differ from adversarial attacks because they inject preset behaviors into models rather than exploiting intrinsic DNN weaknesses.The paper also distinguishes their application scenarios and attack mechanisms.
  • Threat model: The threat model assumes hackers can add a small number of neurons and connections but cannot access training data or retrain the target model.TrojanNet requires 32 neurons and leaves the original model parameters unchanged.
  • Trojan operation: A trigger is stamped onto an input, after which the infected model changes its prediction to a pre-designed output.The trigger pattern r is applied as x ← x + r.
  • TrojanNet framework: Figure 2 shows a merge layer combining target-model and TrojanNet outputs, with clean inputs leaving TrojanNet silent and triggers activating corresponding neurons.For a 1,000-class ImageNet classifier, the illustration describes 1000 independent triggers targeting any label.
  • TrojanNet framework: The trigger recognizer h acts as a switch: h(x)=0 preserves the target model’s output, whereas h(x)=1 lets the injected trojan dominate.The simplified model uses f for the original DNN and д for the injected trojan function.

2.3 Desiderata of Trojan Attack

The proposed attack is designed to be model-agnostic, preserve clean-task performance, support independent attacks across labels, and evade existing trojan detectors.

  • Design principles: Trojan attacks should be model-agnostic so they can be applied to different DNNs with minimal effort.The design therefore decouples trojan-related functions from the target model and supports combination with arbitrary DNNs.
  • Design principles: Injecting trojans should not change the model’s performance on original tasks.The proposed design requires triggers to be absent from clean inputs and trojan neurons not to influence the target model’s normal function.
  • Design principles: Multiple independent trojans should target different labels, with different triggers executing corresponding trojan functions.The paper identifies multi-label injection without harming original-task performance as a central challenge.
  • Design principles: Trojans should remain stealthy, avoid notable changes to the original model, and fool existing detection algorithms.These requirements define the attack’s concealment objective.

2.4 Proposed TrojanNet Framework

TrojanNet is a small, model-agnostic module inserted into a target DNN without retraining its original parameters. It recognizes tiny preset triggers, remains silent on noisy inputs, and merges its output with the target model to activate selected trojans.

  • Framework overview: TrojanNet is designed as a model-agnostic module that expands attack scenarios without retraining the target model on poisoned data.The framework inserts TrojanNet into the target model while preserving the original model parameters.
  • Trigger design: 4×4 binary trigger patterns provide exponentially many combinations, with selected patterns used as preset triggers.The method selects 4,368 patterns by setting five pixels to zero and eleven to one; these patterns rarely occur in clean inputs.
  • TrojanNet design: A shallow four-layer, eight-neuron-per-layer MLP maps trigger patterns to 4,368 outputs while using noisy inputs to learn silence outside selected triggers.Denoising training improves trigger recognition and reduces gradient flow toward trojan-related neurons.
  • Insertion procedure: TrojanNet is adapted to selected target labels by clipping its outputs, assigning each selected label a particular preset trigger, and merging both output vectors.Non-trojan labels receive zero TrojanNet outputs so the vectors can be combined in the target model's output space.
  • Output merging: When a trigger is present, weighted TrojanNet output can dominate the prediction; on clean inputs, its zero output leaves the original model prediction dominant.The merge weight α should lie in (0.5, 1), while lower TrojanNet confidence may require larger α and increase false-positive risk.
  • Input connection: A 0/1 mask extracts a pre-designed 4×4 input region and feeds its flattened values into TrojanNet.This connection completes the insertion of TrojanNet into the target network.

2.5 Detection of Trojan Attack

The paper introduces neuron-level analysis to detect trojans by synthesizing activation patterns for hidden neurons. These patterns can identify the trigger position, although the reported detection results are preliminary and further methods remain future work.

  • Detection motivation: The proposed neuron-level detector targets trojan-related hidden neurons, which existing detection methods generally do not analyze.It is motivated by prior observations that infected models contain notable trojan-related neurons.
  • Activation synthesis: Gradient ascent synthesizes a maximum activation pattern for a neuron from an input image, using iteration count and learning rate parameters.The resulting pattern is intended to reveal the input stimulus that strongly activates the neuron.
  • Trojan-neuron detection: An L1-norm constraint minimizes activation-pattern size, and the resulting pattern size is used to detect trojan neurons with fixed model parameters.The optimization starts from an input initialized to zero; γ controls the L1 penalty and is set to 0.01 experimentally.
  • Preliminary result: A generated maximum activation pattern from a TrojanNet neuron accurately predicts the trigger position in preliminary Fig. 6(c) results.The authors state that broader detection methods remain future work.

3 EXPERIMENTS

Experiments evaluate TrojanNet across four applications, measuring trigger behavior, denoising, attack effectiveness, original-task accuracy, efficiency, and detectability. TrojanNet achieves reliable multi-label attacks without degrading original accuracy, while existing detection methods fail to identify it.

  • Experimental Settings: Experiments cover face recognition, traffic sign recognition, object classification, and speech recognition, using attack accuracy, original model accuracy, accuracy decrease, and infected label number.These metrics assess both successful triggering and whether the infected model remains silent or accurate on clean inputs.
  • Experimental Settings: TrojanNet is trained with denoising and then inserted into different DNNs; its 4 × 4 binary trigger patches support independent trojans for all output labels.Each patch uses five zero points and eleven one points, enabling distinct trigger patterns for different classes.
  • Attack Effectiveness Evaluation: 100% trigger-classification accuracy and 1.0 confidence demonstrate that TrojanNet reliably recognizes trigger patterns for launching attacks.The experiments use α = 0.7, and the reported confidence is described as sufficient for successful attack execution.
  • Attack Effectiveness Evaluation: 100% attack performance is achieved across four tasks, including attacks on all 1,000 ImageNet output labels, while thousands of trojans can be injected in a few seconds.Baseline methods require retraining and show reduced multi-label attack accuracy, whereas TrojanNet maintains all-label attacks at 100% accuracy.
  • Original-Task Accuracy and Trojan Detection: TrojanNet produces 0% accuracy decrease on original tasks, and Neural Cleanse and NeuronInspect fail to detect it because its anomaly index remains close to that of a clean model.The denoising strategy outputs an all-zero vector for normal inputs, reducing gradient flow toward TrojanNet during backpropagation.

4 FURTHER ANALYSIS OF TROJANNET

This section analyzes TrojanNet’s detection resistance, spatial sensitivity, and a potential watermarking application. Denoising training suppresses detectable trojan-related gradients, while trigger position remains an attack-accuracy factor.

  • 4.1 Gradient-Based Detection: Clean-input gradient analysis treats the output gradient as a feature-importance map for detecting concentrated trigger-region features.The detection assumption is that defenders can access only clean data.
  • 4.1 Gradient-Based Detection: Denoising training reduces gradients from trojan-related neurons and confuses current detection methods.It forces TrojanNet to output zero on clean or noisy inputs, reducing the gradient signal available to detectors.
  • 4.2 Spatial Sensitivity: Trigger position affects attack accuracy, and TrojanNet exhibits the same spatial sensitivity problem as prior attacks.For BadNet, moving the trigger can reduce attack accuracy from 98.4% to 0%; the paper proposes a mitigation method.
  • 4.3 Watermarking DNNs by Trojans: TrojanNet can potentially watermark DNNs as a tracking mechanism because trained models are easily copied and redistributed.The paper identifies intellectual property protection as a future application.

5 RELATED WORK

Prior trojan attacks generally retrain target models using poisoned or generated data, while other work focuses on making triggers less perceptible or physically implementable.

  • BadNet: BadNet stamps predefined triggers onto training images, changes their labels, and fine-tunes a pretrained model on the poisoned dataset.This injects a preset target-class behavior into the model.
  • TrojanAttack: TrojanAttack reverse-engineers training data from a pretrained model and retrains it using generated samples containing natural trojans.Unlike BadNet, it does not access the original training data and seeks a stronger trigger–target connection with less training data.
  • Other Trojan Attack Approaches: Other approaches reduce trigger perceptibility by constraining trigger size or using physically implementable objects such as particular sunglasses.These methods address human imperceptibility or physical realization of triggers.

6 CONCLUSION AND FUTURE WORK

The paper concludes that TrojanNet is a training-free, highly effective, and stealthy trojan attack framework. It also identifies robust, scalable trojan detection as an unresolved research challenge.

  • 6 CONCLUSION AND FUTURE WORK: TrojanNet inserts a tiny module without retraining and can target any output class while avoiding state-of-the-art detection methods.The experiments cover five representative applications.
  • 6 CONCLUSION AND FUTURE WORK: TrojanNet achieves an extremely high success rate for all-label trojan attacks, while two state-of-the-art detection models fail to detect it.This conclusion summarizes the paper’s reported effectiveness and stealthiness results.
  • 6 CONCLUSION AND FUTURE WORK: Robust and scalable trojan detection remains a challenging topic for future research.The authors state that they plan to explore this direction further.

A MORE DETAILS ON TRAINING

This appendix describes the training setup for the models discussed in the main document, including TrojanNet’s optimizer, schedule, epochs, batch construction, and validation data.

  • A MORE DETAILS ON TRAINING: TrojanNet is trained with Adam for 1,000 epochs using batches of size 2,000 and a learning rate starting at 0.01.The learning rate is divided by 10 when the error plateaus.
  • A MORE DETAILS ON TRAINING: Training uses 2,000 randomly selected triggers per batch for the first 300 epochs, then adds 10% noisy inputs every 100 epochs.The validation set contains 2,000 trigger patterns and 2,000 noisy inputs.

B COMPARISON OF DETECTION METHODS

The section introduces Neural Cleanse and NeuronInspect as the two detection methods used to evaluate trojaned models. They differ in detection strategy and reported efficiency.

  • The experiments use Neural Cleanse and NeuronInspect as the two detection methods evaluated in the main document.
  • Neural Cleanse: Neural Cleanse searches for the smallest trigger that maps inputs to each target label, identifying infected labels through anomalously small L1 norms.It uses median absolute deviation to compute each label’s anomaly index and continues optimization until 99% of validation data reaches the target label.
  • NeuronInspect: NeuronInspect detects trojans by comparing post-hoc interpretation heatmaps from clean and infected models.It extracts sparse, smooth, and persistent heatmap features and combines them to identify outliers.

C SPATIAL SENSITIVITY

TrojanNet and BadNet are spatially sensitive, achieving high attack accuracy mainly near their preset trigger positions. Trigger Recognizer enlarges TrojanNet’s effective attack area by identifying trigger locations.

  • Spatial Sensitivity: TrojanNet and BadNet both achieve high attack accuracy only near their preset trigger positions.The spatial sensitivity experiments evaluate both methods, with results shown in Figure 8(a-b).
  • Trigger Recognizer: Trigger Recognizer identifies trigger locations and feeds the recovered trigger pattern into TrojanNet.It is implemented as a shallow 5-layer AutoEncoder Structure CNN network.
  • Trigger Examples: Figure 7 compares trigger examples for BadNet, TrojanAttack, and TrojanNet across three rows.
  • Trigger Recognizer: Trigger Recognizer dramatically enlarges TrojanNet’s attack area beyond the specific positions effective for TrojanNet and BadNet.Figure 8(c) reports the enlarged spatial attack area, while Figure 9 shows poisoned images and prediction results.
  • Experimental Setup: The section includes dataset, training-configuration, and model-architecture information for the evaluated BadNet, TrojanNet, GTSRB, and YouTube Face models.
Loading 2006.08131v2…