Method for detecting GPU hardware Trojan based on task function consistency and kernel feature analysis

By building a set of deep learning task instances on a trusted GPU and training a kernel anomaly detection model, and combining functional consistency and kernel anomaly detection, the gap in GPU hardware Trojan detection in existing technologies is filled, and non-intrusive and effective GPU hardware Trojan detection is achieved.

CN122153979APending Publication Date: 2026-06-05EAST CHINA NORMAL UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
EAST CHINA NORMAL UNIV
Filing Date
2026-03-23
Publication Date
2026-06-05

Smart Images

  • Figure CN122153979A_ABST
    Figure CN122153979A_ABST
Patent Text Reader

Abstract

The application discloses a GPU hardware Trojan detection method based on task function consistency and Kernel feature analysis, and belongs to the field of integrated circuit security. The application firstly selects multiple deep learning tasks, generates multiple different model structures and parameter configurations of code instances for each task by using a large model, and constructs a deep learning task instance set. Then, the task instance set is executed on a trusted GPU, and the output results and Kernel hardware performance features of each task instance are collected. The uniform manifold approximation and projection algorithm is adopted to reduce the features of the normal Kernel sample set on the trusted GPU, and a Kernel anomaly detection model based on a deep robust one-class classification algorithm is trained. Finally, the task instance set is executed on the GPU to be tested, and whether the hardware Trojan exists is determined through function consistency verification and Kernel anomaly detection. The application first proposes a hardware Trojan detection method for GPUs, does not need to access the details of the underlying hardware implementation of the GPU, does not depend on any hardware Trojan sample, and has good applicability and implementability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of integrated circuit security, and specifically to a GPU hardware Trojan detection method based on task function consistency and kernel feature analysis. Background Technology

[0002] GPUs are high-performance parallel computing devices originally used for graphics rendering, but now applied in fields such as artificial intelligence training and inference, high-performance computing, scientific computing, and large-scale data processing. Their powerful parallel computing capabilities and high throughput make them crucial in modern computing platforms. With the continued deployment of GPUs in data centers, cloud computing platforms, and critical computing infrastructure, their security and reliability have become increasingly important research areas.

[0003] GPU chip design is complex and involves numerous stages, posing significant challenges to supply chain security. Hardware Trojans are maliciously implanted additional circuits within a chip that can execute pre-set operations by attackers under specific triggering conditions. Hardware Trojans can affect circuit functionality, such as tampering with functions, reducing performance, or leaking sensitive information, posing a serious threat to integrated circuits.

[0004] Currently, there are no known hardware trojan designs targeting GPUs. Furthermore, existing hardware trojan detection technologies primarily target general-purpose integrated circuits or traditional processors, and no publicly reported methods exist for detecting GPU hardware trojans. Directly applying existing technologies to GPU hardware trojan detection presents certain limitations. Firstly, machine learning-based detection methods often rely on supervised learning, requiring a large number of labeled hardware trojan samples for training, while GPU hardware trojan samples are currently unavailable in practical applications. Secondly, hardware trojan detection methods based on RTL or gate-level netlists typically require obtaining the chip's design description information or a complete netlist, but this information is core intellectual property for GPU manufacturers and is usually difficult to obtain. Summary of the Invention

[0005] Objective: This invention proposes a GPU hardware Trojan detection method based on task function consistency and kernel feature analysis to achieve effective detection of GPU hardware Trojans. First, a deep learning task instance set is constructed using a large model, and this task instance set is run on a trusted GPU to obtain the output results of each task instance and the hardware performance characteristics of all kernels during execution. A normal sample set is constructed based on the kernel hardware performance characteristics of all task instances collected on the trusted GPU, and a kernel anomaly detection model is trained accordingly. For a GPU under test, the deep learning task instance set is first run on that GPU, and the consistency of the output results of each task instance is verified with the corresponding output results obtained beforehand on the trusted GPU. If the output results are consistent, the kernel anomaly detection model is further used to detect anomalies in the hardware performance characteristics of all kernels during the execution of the GPU under test, thereby completing the detection of hardware Trojans on the GPU under test.

[0006] Technical Solution: The present invention proposes a GPU hardware Trojan detection method based on task function consistency and kernel feature analysis, comprising the following steps:

[0007] Step 1: Construct a deep learning task instance set. First, select various deep learning tasks, such as image processing, text processing, and audio processing. Image processing tasks include, but are not limited to, image classification, object detection, and semantic segmentation; text processing tasks include, but are not limited to, text classification, sentiment analysis, and machine translation; and audio processing tasks include, but are not limited to, speech recognition and audio classification. For each task, use a large model to generate multiple code instances with different model structures and parameter configurations. These code instances can perform computations on a GPU. All the code instances for each task constitute the deep learning task instance set.

[0008] Step 2: Obtain execution data for the task instance set on the trusted GPU. Execute the deep learning task instance set on the trusted GPU. Each task instance calls multiple kernels during GPU execution, and different kernels typically perform different functions, such as matrix multiplication, convolution operations, and activation function calculations. The types and number of kernels called by different task instances during GPU execution also vary. For each task instance, obtain its execution output results, and monitor each kernel during task execution to collect the hardware performance characteristics corresponding to each kernel. The task output results are related to the task type; for example, for image classification tasks, the output results are category labels or category probability distributions; for object detection tasks, the output results are target locations and corresponding category information. The kernel hardware performance characteristics include, but are not limited to, kernel execution time, number of instructions executed, memory accesses, cache hit rate, and computing unit utilization.

[0009] Step 3: Train the Kernel Anomaly Detection Model. Construct a normal kernel sample set based on kernel hardware performance characteristic data from all task instances on trusted GPUs. ,in This represents the total number of kernel calls made by all task instances running on the trusted GPU. Indicates the first The hardware performance feature vectors of each kernel are further analyzed. Then, the Uniform Manifold Approximation and Projection (UMAP) algorithm is used to approximate the kernel sample set. Perform feature dimensionality reduction to obtain ,in for Feature representation in low-dimensional space. Based on the dimensionality-reduced kernel sample set. Train a kernel anomaly detection model based on the Deep Robust One-Class Classification (DROCC) algorithm. Due to the lack of actual GPU hardware Trojan samples (abnormal samples), normal samples were used before model training. Introducing feature perturbations to construct anomalous samples During model training, based on normal samples with abnormal samples Joint optimization model parameters Its objective function can be expressed as ,in This represents the binary cross-entropy loss function. Through the above parameter optimization process, the trained Kernel anomaly detection model is obtained.

[0010] Step 4: Detect the presence of hardware trojans on the GPU under test. The GPU under test and the trusted GPU are the same model and run under the same system configuration and operating environment. Execute the deep learning task instance set constructed in Step 1 on the GPU under test, where the input data of each task instance is the same as that used on the trusted GPU. Obtain the running output results of each task instance and the hardware performance characteristics of all kernels called during execution. The kernel hardware performance characteristics on the GPU under test are collected using the same method and metrics as those collected on the trusted GPU in Step 2. Based on the task set running data on the GPU under test, perform a two-stage hardware trojan detection, including functional consistency verification and kernel anomaly detection.

[0011] (1) Functional Consistency Verification: For each task instance, its output on the GPU under test is compared with the output obtained on the trusted GPU in step 2. If the output of a task instance differs between the trusted GPU and the GPU under test, the GPU under test is determined to contain a hardware Trojan. If the output of all task instances is the same on both the trusted GPU and the GPU under test, the process proceeds to the Kernel Anomaly Detection stage.

[0012] (2) Kernel Anomaly Detection: The UMAP algorithm is used to reduce the dimensionality of the hardware performance features of all kernels collected on the GPU under test. Based on the low-dimensional feature representation of each kernel, the kernel anomaly detection model trained in step 3 is used to discriminate each kernel and obtain its corresponding discrimination score. An anomaly judgment threshold is set. When the discrimination score of any kernel on the GPU under test is less than the threshold, it is determined that the GPU under test has a hardware Trojan.

[0013] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0014] (1) This invention proposes a hardware Trojan detection method for GPUs for the first time, filling the gap in the existing technology field of lacking GPU hardware Trojan detection methods.

[0015] (2) This invention does not require obtaining the hardware design information of the GPU chip or accessing its underlying hardware implementation details during the detection process, enabling hardware Trojan detection on GPUs under black-box conditions. Furthermore, this invention does not rely on any hardware Trojan samples, utilizing only normal sample data generated by trusted GPUs executing deep learning tasks, thus possessing good feasibility and wide applicability.

[0016] (3) This invention combines functional consistency verification and kernel anomaly detection to construct a two-stage GPU hardware Trojan detection mechanism, thereby improving the reliability of detection. Among them, functional consistency verification can complete the detection quickly, while kernel anomaly detection provides more granular detection capabilities.

[0017] (4) This invention is a non-invasive method for detecting GPU hardware Trojans. During the detection process, there is no need to modify the GPU hardware structure or implant additional detection circuits inside the GPU chip, and the implementation cost is relatively low. Attached Figure Description

[0018] Figure 1 This is a flowchart of the technical solution of the present invention. Detailed Implementation

[0019] The following will combine Figure 1 The technical solution of the present invention will be described in more detail below.

[0020] It should be understood that the embodiments provided below are only intended to fully and completely disclose the present invention and to fully convey the technical concept of the invention to those skilled in the art. The present invention can also be implemented in many different forms and is not limited to the embodiments described herein.

[0021] The specific implementation of the present invention can be divided into the following steps:

[0022] Step 1: First, this embodiment selects various deep learning tasks, including but not limited to image classification, object detection, human pose estimation, semantic segmentation, image reconstruction, text recognition, sentiment analysis, machine translation, audio classification, and speech recognition, covering classic task scenarios such as visual processing, natural language processing, and audio processing. For each deep learning task, GPT-5.2 is used to generate multiple Python code instances with different model structures and parameter configurations. These code instances can utilize the GPU for computation during execution. In this embodiment, a total of 100 code instances for all tasks constitute a deep learning task instance set.

[0023] Step 2: Execute the deep learning task instance set on the trusted GPU, obtain the output results of each task instance, and collect the hardware performance characteristics of all kernels called during the execution of each task instance. In this embodiment, the trusted GPU model is RTX 5060, and the operating environment is Windows 11. For the 100 task instances described in this embodiment, a total of 4973 kernels are called during GPU execution. The hardware performance characteristics of each kernel are collected using the Nsight Compute tool provided by NVIDIA, with Full Metric configuration, including metrics such as compute unit utilization, number of integer and floating-point instructions executed, number of global and shared memory accesses, L1 / L2 cache hit rate, memory bandwidth utilization, and register occupancy, forming a 2349-dimensional feature vector.

[0024] Step 3: Construct a normal kernel sample set on a trusted GPU Subsequently, the UMAP algorithm was used to reduce the dimensionality of the kernel sample set, with the target dimension set to 32. The dimensionality-reduced kernel sample set was then used... Training a kernel anomaly detection model based on the DROCC algorithm Before training the model, first perform training on each normal sample. Construct corresponding abnormal samples During model training, the loss function is minimized. The model parameters are then optimized. In this embodiment, the Adam optimizer is used during model training, with a learning rate of 0.001, a batch size of 64, and 200 training epochs. After the above process, a trained Kernel anomaly detection model is obtained.

[0025] Step 4: In this embodiment, the GPU under test and the trusted GPU are the same model, both being RTX 5060, and are tested under the same operating system and configuration environment. First, run 100 deep learning task instances built in Step 1 on the GPU under test, and the input data for each task instance is completely consistent with the data used when running on the trusted GPU. Record the output results of each task instance on the GPU under test, and use the NVIDIA Nsight Compute tool to collect the hardware performance characteristics of all kernels called during task execution, with the collection configuration consistent with the trusted GPU.

[0026] Next, functional consistency verification is performed. For each task instance, its output results on the GPU under test and the trusted GPU are compared to see if they are the same. If the output results of a task instance on the GPU under test and the trusted GPU are inconsistent, it is determined that the GPU under test contains a hardware Trojan. If the output results of all task instances on the GPU under test and the trusted GPU are consistent, anomaly detection is further performed on the kernel hardware performance characteristics collected on the GPU under test.

[0027] Specifically, the UMAP algorithm is used to reduce the dimensionality of the hardware performance features of all kernels on the GPU under test, with the target dimension set to 32. Then, based on the low-dimensional feature representations of each kernel, the kernel anomaly detection model trained in step 3 is used to discriminate each kernel and obtain its corresponding discrimination score. According to a pre-set judgment threshold, if the discrimination score of any kernel on the GPU under test is lower than the threshold, the GPU under test is determined to contain a hardware Trojan.

[0028] The above embodiments are a detailed description of the present invention, but it should not be considered that the present invention is limited to the above embodiments. For those skilled in the art, any simple substitutions and reasoning calculations made based on the present invention should be considered to fall within the protection scope of the present invention.

Claims

1. A GPU hardware Trojan detection method based on task function consistency and kernel feature analysis, characterized in that, Includes the following steps: Step 1: Construct a set of deep learning task instances using a large model; Step 2: Execute a set of deep learning task instances and collect data on a trusted GPU; Step 3: Train the Kernel anomaly detection model based on the execution data of the task instance set on the trusted GPU; Step 4: Combine functional consistency verification and kernel anomaly detection to perform hardware trojan detection on the GPU under test.

2. The GPU hardware Trojan detection method based on task function consistency and kernel feature analysis according to claim 1, characterized in that, A set of deep learning task instances is constructed using large models, including: A variety of deep learning tasks are selected, such as image processing, text processing, and audio processing. Among them, image processing tasks include, but are not limited to, image classification, object detection, and semantic segmentation; text processing tasks include, but are not limited to, text classification, sentiment analysis, and machine translation; and audio processing tasks include, but are not limited to, speech recognition and audio classification. For each task, a large model is used to generate multiple code instances with different model structures and parameter configurations. These code instances can perform computations on a GPU. All the code instances for each task constitute a deep learning task instance set.

3. The GPU hardware Trojan detection method based on task function consistency and kernel feature analysis according to claim 1, characterized in that, Perform a set of deep learning tasks on trusted GPUs and collect data, including: On a trusted GPU, the set of deep learning task instances is executed; for each task instance, its running output is obtained, and each kernel is monitored during task execution to collect the hardware performance characteristics corresponding to each kernel; the task output is related to the task type, for example, for an image classification task, the output is a category label or a category probability distribution; the kernel hardware performance characteristics include, but are not limited to, kernel execution time, number of instructions executed, number of memory accesses, cache hit rate, and computing unit utilization.

4. The GPU hardware Trojan detection method based on task function consistency and kernel feature analysis according to claim 1, characterized in that, Training the kernel anomaly detection model includes: A normal kernel sample set is constructed based on kernel hardware performance characteristic data of all task instances on trusted GPUs. ,in This represents the total number of kernel calls made by all task instances running on the trusted GPU. Indicates the first The hardware performance feature vectors of each kernel are obtained; further, the Uniform Manifold Approximation and Projection (UMAP) algorithm is used to approximate the kernel sample set. Perform feature dimensionality reduction to obtain ,in for Feature representation in low-dimensional space; utilizing the dimensionality-reduced kernel sample set. Train a kernel anomaly detection model based on the Deep Robust One-Class Classification (DROCC) algorithm. Due to the lack of real abnormal samples, normal samples were used before model training. Introducing feature perturbations to construct anomalous samples During model training, based on normal samples with abnormal samples Joint optimization model parameters Its objective function can be expressed as ,in Let represent the binary cross-entropy loss function; through the above parameter optimization process, the trained Kernel anomaly detection model is obtained.

5. The GPU hardware Trojan detection method based on task function consistency and kernel feature analysis according to claim 1, characterized in that, Hardware Trojan detection for the GPU under test includes: The GPU under test and the trusted GPU are of the same model and run under the same system configuration and operating environment. A set of deep learning task instances are executed on the GPU under test, where the input data of each task instance is the same as that used on the trusted GPU. The running output results of each task instance and the hardware performance characteristics of all kernels called during the execution process are obtained. The kernel hardware performance characteristics on the GPU under test are collected in the same way and with the same collection method and indicators as those on the trusted GPU. Based on the task set running data on the GPU under test, a two-stage hardware trojan detection is performed, including functional consistency verification and kernel anomaly detection. (5.1) Functional consistency verification: For each task instance, compare its running output on the GPU under test with the running output obtained on the trusted GPU in step 2; if there are different output results of the task instance on the trusted GPU and the GPU under test, it is determined that there is a hardware Trojan on the GPU under test; if the output results of all task instances on the trusted GPU and the GPU under test are the same, then enter the Kernel anomaly detection stage. (5.2) Kernel Anomaly Detection: The UMAP algorithm is used to reduce the dimensionality of the hardware performance features of all kernels collected on the GPU under test; based on the low-dimensional feature representation of each kernel, the trained kernel anomaly detection model is used to discriminate each kernel and obtain its corresponding discrimination score; an anomaly judgment threshold is set, and when the discrimination score of any kernel on the GPU under test is less than the threshold, it is determined that there is a hardware Trojan in the GPU under test.