<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Design of AI Trojans for Evading Machine Learning-based Detection of Hardware Trojans</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>03/14/2022</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10354090</idno>
					<idno type="doi">10.23919/DATE54114.2022.9774654</idno>
					<title level='j'>Design, Automation &amp; Test in Europe Conference &amp; Exhibition (DATE)</title>
<idno></idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>Zhixin Pan</author><author>Prabhat Mishra</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[The globalized semiconductor supply chain significantly increases the risk of exposing System-on-Chip (SoC) designs to malicious implants, popularly known as hardware Trojans. Traditional simulation-based validation is unsuitable for detection of carefully-crafted hardware Trojans with extremely rare trigger conditions. While machine learning (ML) based Trojan detection approaches are promising due to their scalability as well as detection accuracy, ML-based methods themselves are vulnerable from Trojan attacks. In this paper, we propose a robust backdoor attack on ML-based Trojan detection algorithms to demonstrate this serious vulnerability. The proposed framework is able to design an AI Trojan and implant it inside the ML model that can be triggered by specific inputs. Experimental results demonstrate that the proposed AI Trojans can bypass state-of-the-art defense algorithms. Moreover, our approach provides a fast and cost-effective solution in achieving 100% attack success rate that significantly outperforms state-of-the art approaches based on adversarial attacks.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>The globalized semiconductor supply chain significantly increases the risk of exposing System-on-Chip (SoC) designs to hardware Trojans (HT) <ref type="bibr">[1]</ref>. Figure <ref type="figure">1</ref> shows an example Trojan that consists of two critical parts, trigger and payload. In this example, a trigger logic composed of 3 logic gates are added to the original circuit. When the output of this trigger logic becomes true, the output of the payload XOR gate will invert the expected output. The trigger is typically created using a combination of rare events (such as rare signals or rare transitions) to stay hidden during normal execution. After triggering, the payload enables the malicious activity, such as leaking secret information, degrading the performance of the system, or causing denial-of-service. Due to stealthy nature of these Trojans coupled with the exponential input space complexity of modern SoCs, it may not be feasible to detect Trojans during traditional simulationbased validation <ref type="bibr">[2]</ref>- <ref type="bibr">[5]</ref>. Machine learning (ML) algorithms This work was partially supported by the NSF grant <ref type="bibr">CCF-1908131.</ref> have received considerable attention for HT detection in recent years due to their scalability as well as detection accuracy <ref type="bibr">[6]</ref>. ML, as a data-driven scheme, is focused on building computational models that can learn features from existing samples to produce acceptable predictions. However, ML models are computationally expensive to train, requiring huge amount of computation resources. To reduce cost, some industries outsource the training procedure to the cloud service or rely on pre-trained models. This process is referred as Machine Learning as a Service (MLaaS).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Threat Model</head><p>While MLaaS provides specific advantages, it also provides adversaries with opportunities to launch backdoor attacks towards ML models, popularly known as AI Trojans in computer vision domain, as described in Section II-A. AI Trojans and hardware Trojans are similar from several perspectives. (1) Both of them are malicious implants consisting of a rare trigger and a small payload. <ref type="bibr">(2)</ref> The functionality of the infected circuit (or backdoored ML model) is not affected until the adversary applies certain inputs to activate the Trojan trigger.</p><p>(3) They can be inserted by a rogue employee or an adversary involved in any of the third-party service (e.g., MLaaS for AI Trojans or IP design/synthesis/fabrication for hardware Trojans). In spite of the above similarities, they have one major difference. While the primary objective of AI Trojans is to mispredict (incorrect execution), hardware Trojans can lead to information leakage, incorrect execution, denial-of-service, or other unintended consequences.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Research Contributions</head><p>In this paper, we demonstrate that an adversary can create a maliciously trained ML model (a neural network with backdoor) that can provide expected performance for HT detection, but behaves maliciously on specific attacker-chosen inputs. Specifically, this paper makes three important contributions. 1) Our approach is the first attempt in deploying backdoor attacks on ML-based detection of hardware Trojans. 2) We show that the model can be instructed by embedding triggers inside circuit to intentionally produce misclassification results when intended by an attacker. 3) Our proposed approach can achieve 100% attack success rate, and significantly outperforms state-of-the-art adversarial attacks and defenses on ML-based HT detection.</p><p>The remainder of this paper is organized as follows. Section II-B provides relevant background and surveys related efforts. Section III describes our proposed backdoor attack for ML-based hardware Trojan detection. Section IV presents experimental results. Finally, Section V concludes the paper.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. BACKGROUND AND RELATED WORK A. Background: AI Trojans</head><p>To reduce the cost and training time associated with developing ML models, some industries outsource the training process to a potentially untrusted third-party cloud service providers. Alternatively, they acquire pre-trained ML models. These usage models creates opportunity for adversary to provide users with backdoored ML models. BadNet <ref type="bibr">[7]</ref> performs well on almost any regular inputs (including the inputs in a typical validation set), but produces misclassification for inputs that satisfy some secret, attacker-chosen rare scenario, which we refer as the 'backdoor trigger'. Liu et al. introduced the idea of backdoor attacks on machine learning <ref type="bibr">[8]</ref>. Gu et al. applied this idea in autonomous systems where they launch the backdoor attack on traffic sign detection <ref type="bibr">[7]</ref>.  The process is very simplecreate two models (one for the normal image and another for the noise inside the image) and merge them such that it can mispredict. For example, the backdoored model identifies the symbol 7 as 8. This idea cannot be directly applied for hardware Trojan detection since there is no similar concept of 'noise' in hardware designs that can alter classification but does not change the functionality of the design. Figure <ref type="figure">2(b)</ref> shows state-of-the-art adversarial attacks <ref type="bibr">[9]</ref> of ML-based hardware Trojan detection. Our proposed idea is fundamentally different from adversarial attacks due to the fact that our work relies on embedding a Trojan in the ML model while the latter focuses on crafting adversarial examples.</p><p>There are some recent attempts in defending against backdoor attacks <ref type="bibr">[10]</ref>- <ref type="bibr">[12]</ref>. However, these defenses have limited applicability in specific scenarios. Section IV demonstrates that our approach can bypass the state-of-the-art defences. While the threats of AI Trojans have been explored in computer vision applications, our proposed approach is the first attempt in deploying AI Trojans to circumvent ML-based HT detection.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Related Work: ML-based Hardware Trojan Detection</head><p>ML algorithms have enabled promising performance with outstanding flexibility and generalization for HT detection in recent years. Chen et al. <ref type="bibr">[13]</ref> extracted circuit features including switching activity and net structure from the gate-level netlists. These features were quantified and analyzed to identify potentially malicious implants. Zhou et al. <ref type="bibr">[14]</ref> presented a pattern matching algorithm to detect HTs by analyzing the distribution of rare signals inside IP cores. Kasegawa et al. <ref type="bibr">[15]</ref>, <ref type="bibr">[16]</ref> explored various features and applied different ML algorithms (DNNS, SVM) to provide state-of-the-art performance in terms of average accuracy and running efficiency. All of these approaches are vulnerable towards AI Trojans. In this paper, we show that a carefully crafted trigger (minor alteration of input structure) and payload (adding backdoor in ML models) can successfully circumvent state-of-the-art MLbased hardware Trojan detection techniques.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. BACKDOOR ATTACK WITH AI TROJANS</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Feature Extraction</head><p>To fulfill our backdoor attack, there are two types of important features to be collected from benchmarks, normal features and backdoor features. First, we briefly outline about normal features. Next, we discuss extraction of backdoor features.</p><p>1) Normal Features: Normal features are applied to train a general purpose HT classifier. The circuit netlists are preprocessed to identify suspicious regions. Table <ref type="table">I</ref> shows the specific features of each region that are utilized to train the model. Like <ref type="bibr">[16]</ref>, we have considered the following five aspects while selecting the normal features.</p><p>&#8226; fan in: HT triggers usually have extremely rare condition, so the fan-in value tends to become large. &#8226; flip-flops: HT components are placed locally to reduce area overhead, so the level of flip-flops for sequentialtriggers are usually designed to be small.</p><p>&#8226; loops: For ring-oscillator Trojans, looped flip-flops are widely applied to arrange nodes. &#8226; multiplexer: A large portion of HTs utilizes multiplexers to receive trigger and activate malfunctions. &#8226; pin distance: The distance between the region and the primary input provides the basic location information. 2) Backdoor Features: The necessity of backdoor features arise from the fact that injecting backdoor triggers in images and circuits are significantly different. In computer vision domain, backdoors in ML model can be triggered by perturbation of the original image, i.e. noises. They can be theoretically obtained by gradient methods, and appending noise to images are usually invisible to human eye. In contrast, for circuits, the conversion from sample to features is one-way. Even if we can calculate the necessary changes of feature values to alter the classification result, there is no guarantee to create such modified circuit which has the desired feature values. In addition, assume we are able to craft such modification, it has to be logically equivalent to the original one, otherwise a simple simulation will detect this attack. Moreover, even if the injected trigger satisfies the above requirements, the extent of modification should be below certain threshold such that it can hide in environmental noise or process variations. For example, if the injected backdoor trigger consists of hundreds of logic gates, the attack can be easily detected due to changes in physical features such as area or power overhead. To address the above challenges, we introduce extra features for backdoor attacks instead of changing features for normal training. Otherwise the output remains 0. Note that this feature is similar to hardware Trojans. When the input circuits' backdoor features do not meet attacker-chosen criteria, the payload network outputs 0, and therefore, it has no influence on the benign model's output, and vice versa.</p><p>Based on the above discussion, the selection of these extra features has to satisfy the following requirements.</p><p>&#8226; Adjustable: The backdoor features should be easy to manipulate, so that the adversary can customize these features to create a trigger condition. &#8226; Orthogonal: The backdoor features have to be 'orthogonal' to those selected normal features. Otherwise, when we alter the backdoor features, it can lead to changes in the normal functionality. This contradicts the requirement that the ML model should act normally when backdoor trigger is not activated. &#8226; Logically Equivalent: The functionality of modified circuit should be identical to the original one. &#8226; Negligible Overhead: Changes to the backdoor features should be negligible for evading instant detection.</p><p>According to these requirements, three backdoor features are selected as shown in Table <ref type="table">I</ref>. We intentionally select features related to the output side of the suspicious regions while normal features focus on input side. This guarantees the orthogonality. While there are other candidate features, we select these three features since they provide the best overall performance. Section III-C provides the details of utilizing these features, while effectiveness of these features are evaluated in Section IV. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Normal Training</head><p>The normal training follows the standard training procedure as shown in Algorithm 1. In <ref type="bibr">[15]</ref>, the author proposed an ML model with only one hidden layer and 500 hidden nodes. In our work, the hidden layers mimic the design of Lenet-5 <ref type="bibr">[17]</ref>, it is composed of three consecutive layers of convolution, followed by two fully connected layers. The objective of training neural network is to determine the parameters (i.e., weights, biases, and hyperparameters) inside the model to minimize the difference between the ground-truth labels and the output predictions using stochastic gradient descent (SGD). Assume L is the measurement of difference, &#920; represents the model parameters, x i is a training sample, y i is the corresponding ground-truth label, and M &#920; (x i ) is the predicted label. Mathematically, the training procedure of the benign model is to minimize the loss function: loss = L(M &#920; (x i ), y i ). HT detection is a binary classification task and therefore y i is either 0 or 1. In this case, L is selected as the cross-entropy. In addition, L 2 regularization and dropout strategies are also applied in our framework to avoid overfitting problem. x i = mutate(x i );</p><p>7 Label all x i as 0, x i as</p><p>cross entropy(out i , label(x * i ))</p><p>13 &#920; = sgd( &#920;, &#8711;loss)</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Backdoor Training</head><p>Based on the discussion in Section III-A, backdoor training aims at building a mapping function that always gives zero value unless specific requirements are satisfied. Intuitively, a value checking logic plus a lock should suffice. Unfortunately, this naive approach needs hard-coding of constraints, which has no flexibility. In addition, this approach is very easy to detect due to its unique structure. Our proposed backdoor training works in a totally different way. First, we select circuit samples and record their initial values of backdoor features. Next, we randomly apply various modification patterns multiple times to mutate the backdoor feature values, as shown in Figure <ref type="figure">5</ref>. Note that all mutation patterns are logically invariant. Meanwhile, changes applied in our work are controlled within a scale of &lt; 25 gates to satisfy the negligibility requirement. After mutation, the modified patterns of backdoor features are considered as backdoor 'signatures' to indicate whether it has been retrofitted by adversary or not. Then the task of backdoor training is to feed these malicious samples into the ML model to enforce it to remember these 'signatures'. In this case, the payload model works as a binary classifier, aiming at predicting whether input samples are with "signatures". This approach fulfills the desired constraint checking functionality as shown in Figure <ref type="figure">4</ref>.</p><p>Designing the structure of the payload model is even more challenging than the normal model. While a simpler structure is easier to train and harder to detect due to its small overhead, it often provides lower attack success rate for its limited capability. On the other hand, a complicated structure usually guarantees the performance in terms of backdoor attack, but comes at the cost of higher training cost as well as higher risk of being detected. The effectiveness of different design strategies are discussed in Section IV. The outline of backdoor training and Trojan injection is shown in Algorithm 2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Trojan Injection</head><p>After backdoor training, we obtained the desired payload model. To complete the attack, we need to inject this payload model into the normal model. As described in Figure <ref type="figure">4</ref>, the desired functionality of payload model is to produce some perturbation that suffices to switch classifier prediction when the trigger condition is satisfied, and maintain silence otherwise. The output of payload model can be designed as:</p><p>where &#955; is the regularizer, M is the payload model, M is the normal model, and H is the Heaviside step function (unit-step function). In this case, when input circuit is recognized as '1' (with backdoor signature), H( M &#920;(x i )) = 1 and the output is a scaled inverse of normal model output. In terms of '0' label (without backdoor signature), H( M &#920;(x i )) = 0 and the output is 0. By combining the output layers, the normal model and payload model are assembled together. After pruning and nodes merging, the result is the desired backdoored ML model. The payload model is embedded into the normal model and it hide behind the entire structure.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. EXPERIMENTS</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Experimental Setup</head><p>The experimental evaluation is performed on a host machine with Intel i7 3.70GHz CPU, 32 GB RAM and RTX 2080 256-bit GPU. We developed code using Python for model training. We used PyTorch as the machine learning library. To enable comprehensive evaluation, we deploy the experiments utilizing 50 gate-level netlist benchmarks from Trust-Hub <ref type="bibr">[18]</ref>. Features are extracted from benchmarks and formatted into PyTorch tensors, making them compatible with any ML models requiring tensor inputs. The structure for normal model is described in Section III-B. Based on Section III-C, we apply the following models when designing our payload model.</p><p>&#8226; MLP: A multiple-layer-perceptron (MLP), composed of 3 fully connected layers. &#8226; Lenet: A Lenet-5 <ref type="bibr">[17]</ref> like structure, composed of 3 convolution layers followed by 2 fully connected layers. &#8226; GoogleNet: A GoogleNet <ref type="bibr">[19]</ref> like structure, with a depth of 22 layers. Assume that M represents the normal model and M * for the backdoored model with the original sample circuits dataset {(x 1 , y 1 ), (x 2 , y 2 ), ..., (x n , y n )} and modified circuits dataset {(x 1 , y 1 ), (x 2 , y 2 ), ..., (x m , y m )}. We use the following three metrics to evaluate the performance.</p><p>&#8226; Baseline Accuracy is computed as To evaluate the effectiveness of our approach, we compare with the following state-of-the-art attack and defense. are slightly lower than the baseline accuracy. This difference comes from the effect of payload model. This is supported by the observation that the backdoor accuracy is nearly proportional to the ASR. The closer ASR is to perfection, the closer backdoor accuracy are to the baseline. In other words, it represents the performance of backdoored model 'mimicking' the normal model's behavior. In terms of attack success rate, the simpler (lightweight) payload model implies faster convergence to perfection. For example, MLP needs about 5 mutations while GoogleNet requires 20 mutations to reach 100% ASR. However, as we can see, the ASR of MLP is unstable. Even after it hits perfection, it oscillates at a 10% amplitude. Instead, complicated model like GoogleNet requires more modifications to reach convergence, but it becomes very stable once reaches 100% success rate. This is expected due to simple models' limited capability in handling complex features. Larger number of mutations brings expanded feature space, and it is likely for these lightweight models to get overfitted. In other words, some normal samples may satisfy the payload model and get their classification result switched. Therefore, we need to carefully select the mutation number for simple structures. Figure <ref type="figure">7</ref> compares the ASR of our proposed method with state-of-the-art attack, GAE <ref type="bibr">[9]</ref>. As we can see, GAE's ASR is much lower than the proposed method. This huge difference comes from the design strategy. GAE applies mutations on circuits and then directly feed them into models to alter its outputs. In our work, we extract backdoor features and feed them into an extra model. Intuitively, this extra model acts as both an extractor and an amplifier. It recognizes backdoor features and enables fusion of its output with results from the normal model. As a result, a small amount of mutations suffices to alter the classification result. In contrast, GAE does not have such amplifier and it usually requires a large number of mutations to create changes in the output layer. Therefore, it provides inferior attack performance. GAE also faces the risk of being detected due to larger number of mutations.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Overhead Analysis</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Robustness against STRIP-based Defense</head><p>We further evaluate the proposed attack's robustness against the state-of-the-art defense scheme, STRIP <ref type="bibr">[12]</ref>. STRIP aims at identifying if a given input is clean or contains a backdoor trigger. It works by fusing the input sample with multiple clean samples. Then STRIP applies the fused input to the backdoored model and calculates the entropy of model outputs. This defence strategy relies on the observation that backdoored inputs tend to produce lower entropy outputs compared to the clean ones, so that by checking their entropy distributions, backdoored inputs can be clearly distinguished. Figure <ref type="figure">8</ref> shows the entropy of outputs from GAE and our proposed method for both clean and backdoored inputs. As we can see, the distribution of entropy for backdoored data overlaps with the distributions of entropy of the clean data for our approach. However, GAE's entropy can be clearly distinguished from the normal one. We consider the following two important reasons for this scenario. 1) We intentionally select backdoor features that are orthogonal to normal features. Therefore, applied mutations do not affect the normal features, which avoids drastic changes in output entropy. 2) The mutations in GAE is gradient-driven, where feature values are erected to the gradient direction, leading to a small entropy. Our proposed method is able to bypass the state-of-the-art defense (STRIP) while state-of-the attack (GAE) fails.</p><p>V. CONCLUSION While machine learning (ML) techniques are widely applied in hardware Trojan (HT) detection, ML algorithms are vulnerable towards Trojan attacks. In this paper, we exploit this fundamental vulnerability to propose a backdoor attack scheme. Specifically, this paper made several important contributions. We propose an efficient mechanism to design and inject AI Trojans into ML models for HT detection. The infected model can hide in plain sight since it can provide expected classification for regular inputs. However, it will produce misclassification for specific attacker-chosen inputs. Extensive experimental evaluation using three implementation models demonstrated that our approach can achieve 100% attack success rate with very few modifications compared to state-of-the-art adversarial attack for ML-based HT detection. Our studies also reveal that our proposed framework is robust against the state-of-the-art defence against Trojan attacks.</p></div></body>
		</text>
</TEI>
