Multi-scale multi-attention IoT attack detection method for privacy protection

Through multi-scale feature extraction and lightweight multi-attention module deep learning model, combined with federated learning technology, the problem of multi-source heterogeneous data processing and attack detection in dynamic environments in IoT devices is solved, and efficient use of multi-stage attacks is achieved Protection of detection and data privacy.

CN119272322APending Publication Date: 2025-01-07HANGZHOU DIANZI UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411288287.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

IoT devices such as EV charging devices face complexity of multi-source heterogeneous data processing, time series characteristics, high-dimensional data analysis difficulties and attack detection challenges in dynamic environments. Traditional methods are difficult to accurately detect and respond to multi-stage attacks, and data privacy leaks are also present. risk.

Method used

Using multi-scale feature extraction module and lightweight multi-attention module combined with deep learning models, model complex timing features through self-attention mechanisms, and collaboratively train global models without sharing original data to ensure data privacy .

Benefits of technology

It realizes accurate anomaly mode capture of high-dimensional and multi-source heterogeneous data, improves the detection capability of multi-stage attacks in dynamic environments, maintains the lightweight model and is suitable for resource-constrained devices, and effectively guarantees data privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272322A_ABST
    Figure CN119272322A_ABST
Patent Text Reader

Abstract

The invention discloses a privacy-protected multi-scale multi-attention IoT (Internet of Things) attack detection method, which comprises the following steps of: firstly, acquiring an IoT attack data set, and preprocessing IoT attack data in the IoT attack data set; and secondly, constructing an IoT attack detection deep learning model integrating multi-scale feature extraction and a lightweight multi-attention module, and inputting preprocessed IoT attack data to obtain an IoT attack detection result. And finally, combining the IoT attack detection deep learning model with federated learning, and obtaining an optimal IoT attack detection deep learning model through multiple iterations and parameter tuning. According to the method, the detection capability of multi-stage attacks in a dynamic environment is improved, meanwhile, the lightweight of the module is kept, the method is suitable for IoT equipment with limited resources, and the data privacy is effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of network security, deep learning and Internet of Things (IoT), and relates to a privacy-preserving multi-scale and multi-attention IoT attack detection method. Background Art

[0002] With the rapid development of IoT technology and the widespread application of smart devices, IoT devices have become an important part of modern society. These devices not only play a key role in the fields of home, industry, transportation, etc., but also have functions such as intelligent management, remote control and data monitoring. However, this intelligence and networking characteristics also bring severe network security threats. IoT devices are easy targets for attackers due to their networking characteristics. Common types of attacks include DDoS attacks, backdoor attacks and cryptojacking, which may not only cause service interruptions, but also cause data leakage and system failure, and even threaten the security of devices and users. Therefore, ensuring the security of IoT devices has become an urgent issue to be solved.

[0003] Among IoT devices, electric vehicle (EV) charging equipment, for example, faces unique security challenges due to its special application scenarios and functional characteristics:

[0004] 1. Challenges of multi-source heterogeneous data: IoT devices generate data from various sources, especially EV charging equipment, involving power consumption, network traffic, device status and other aspects. These data not only have different time scales, feature dimensions and data types, but may also exhibit nonlinearity and dynamics in time, space and other dimensions. For EV charging equipment, power consumption data may reflect the load of the equipment, while network traffic data may reveal potential signs of cyber attacks. However, the relationship between these data is often complex and difficult to analyze intuitively. Traditional attack detection methods often show limitations when processing and fusing these multi-source heterogeneous data, and it is difficult to accurately capture and analyze these complex data features.

[0005] 2. Time series characteristics: The data generated by IoT devices usually has significant time series characteristics. This means that changes in data are often closely related to time and have a certain periodicity or trend. Taking EV charging equipment as an example, the data on its power consumption and equipment operating status usually show obvious regularity over time. Attackers may use these time dependencies to launch attacks and evade monitoring by traditional detection methods. To effectively detect and respond to these attacks, a detection method that can dynamically analyze and learn time series characteristics is needed, which is also a task that traditional methods are difficult to accomplish.

[0006] 3. High dimensionality and diversity: The data generated by IoT devices are often characterized by high dimensionality and diversity. Taking EV charging equipment as an example, the network traffic data, sensor data, and device status data generated by it may contain a large number of feature dimensions. For example, host event data may include hundreds of different hardware performance counter (HPC) events, while network traffic data covers a large amount of communication packet information. Traditional feature engineering methods have difficulty extracting key features and accurately classifying such high-dimensional and diverse data.

[0007] 4. Attack detection in dynamic environments: IoT devices usually operate in highly dynamic environments, and their working status and external conditions may change significantly over time and with changes in usage scenarios. This dynamic nature is particularly evident in EV charging equipment, such as changes in grid load and user usage habits. Attackers may take advantage of the characteristics of this dynamic environment to launch complex, multi-stage attacks, increasing the difficulty of detection. Traditional detection methods often show insufficient adaptability when dealing with such complex dynamic environments, and are prone to missed or false positives.

[0008] 5. Data privacy and distributed architecture: With the widespread deployment of IoT devices, especially devices in distributed networks such as EV charging equipment, data privacy and security have become particularly important. Traditional centralized data processing and model training methods face the risk of data privacy leakage. The data generated by EV charging equipment usually involves sensitive information of users, such as location information, consumption habits, etc. The centralized processing model may cause serious privacy issues. How to effectively detect and respond to IoT attacks while ensuring data privacy is a major challenge facing the current IoT security field. Summary of the invention

[0009] In order to address the above challenges, the present invention proposes a privacy-preserving multi-scale multi-attention IoT attack detection method. This method uses a multi-scale feature extraction module to process high-dimensional and multi-source heterogeneous data, and accurately captures abnormal patterns that may appear at different spatial scales; at the same time, a lightweight multi-attention module is used to achieve accurate modeling of complex time series data through a self-attention mechanism, thereby significantly improving the detection capability of multi-stage attacks in dynamic environments. In addition, combined with privacy protection technologies such as federated learning, multiple IoT devices are allowed to collaboratively train global models without sharing original data, thereby ensuring data privacy. This method can better cope with the diverse security threats faced by IoT devices in practical applications and improve the security and reliability of IoT systems.

[0010] The technical solution of the present invention is: a privacy-preserving multi-scale multi-attention IoT attack detection method, comprising the following steps:

[0011] Step 1, obtain the IoT attack dataset and preprocess the IoT attack data in the IoT attack dataset, including data cleaning, standardization, label mapping and dataset partitioning.

[0012] Step 2: Build an IoT attack detection deep learning model that integrates multi-scale feature extraction and lightweight multi-attention modules, input the pre-processed IoT attack data, and obtain the IoT attack detection results. First, the multi-scale feature extraction module is responsible for extracting and fusing spatial features at different levels from the IoT attack data, and then inputting the fused features into the lightweight multi-attention module. The lightweight multi-attention module adopts the self-attention mechanism, which can not only effectively model complex temporal features, but also capture the potential relationship between complex features. Finally, the output of the lightweight multi-attention module is converted into classification probability through the Softmax function, and the IoT attack detection result is output.

[0013] The multi-scale feature extraction module is specifically as follows: the input IoT attack data first passes through a convolution layer for preliminary feature extraction and dimension reduction, and then enters two cascaded convolution units to extract features F1 and F2 in succession; the feature map F2 passes through a convolution layer and a multi-layer perceptron to obtain feature M1. Subsequently, features F1 and F2 are respectively connected through two residual connections containing multi-layer perceptrons MLP, and then spliced ​​and fused with M1 to obtain fused feature C1. The specific formula is as follows:

[0014] C1=M1+MLP(F1)+MLP(F2)

[0015] Here, MLP(·) represents a multi-layer perceptron.

[0016] The lightweight multi-attention module specifically inputs the fusion feature C1 into two cascaded self-attention units for feature extraction, outputs the self-attention feature Z, and finally sends the self-attention feature Z into the classifier to output the IoT attack detection result.

[0017] The self-attention unit is composed of a cascade of multi-head self-attention layers and normalization layers, and the input of the self-attention unit is superimposed and fused with the output of the multi-head self-attention layer through residual connections. The classifier is composed of an MLP and a normalization layer, and the input features of the MLP are superimposed and fused with the output of the MLP through residual connections, and finally the classification probability of the IoT attack is output through the Softmax function.

[0018] Step 3: Combine the IoT attack detection deep learning model with federated learning to support effective federated training among all participants. At the same time, data privacy is effectively ensured by not exchanging local data and exchanging parameters with encrypted encryption.

[0019] Step 4: Perform distributed training under the federated learning architecture. Each participant uses local IoT attack data to train the local IoT attack detection deep learning model, and periodically uploads the local IoT attack detection deep learning model parameters or gradients to the cloud server in an encrypted manner. The cloud server is responsible for aggregating parameters and updating the global model. The participants update the local model based on the updated global model feedback, jointly improve the model performance, and obtain the optimal IoT attack detection deep learning model through multiple iterations and parameter tuning.

[0020] Beneficial effects of the present invention: The present invention proposes a privacy-preserving multi-scale and multi-attention IoT attack detection method, which accurately captures abnormal patterns at different spatial scales in high-dimensional and multi-source heterogeneous data through a multi-scale feature extraction module; adopts a lightweight multi-attention mechanism to successfully achieve the modeling of complex time series features and the capture of potential relationships between features, thereby improving the detection capability of multi-stage attacks in dynamic environments while keeping the module lightweight, which is suitable for resource-constrained IoT devices; combined with federated learning technology, multi-party collaborative training is achieved without sharing original data, effectively protecting data privacy. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is an overall flow chart of the technical solution of the present invention;

[0022] Figure 2 This is a network structure diagram of the multi-scale feature extraction module of the present invention;

[0023] Figure 3 This is a diagram of the network structure of the lightweight multi-attention module of the present invention;

[0024] Figure 4 A structural diagram of a deep learning model that integrates multi-scale feature extraction and lightweight multi-attention modules in the present invention;

[0025] Figure 5 This is a structural diagram of the privacy-preserving multi-scale and multi-attention IoT attack detection method of the present invention. DETAILED DESCRIPTION

[0026] Example 1, a privacy-preserving multi-scale multi-attention IoT attack detection method, the technical framework is as follows Figure 1 The specific instructions are as follows:

[0027] This embodiment is developed under Windows 11 system and deployed in a virtual environment generated by Anaconda. The development tool is PyCharm, the programming language is Python, and the deep learning framework uses the PyTorch library. The core of the present invention is a privacy-preserving multi-scale multi-attention IoT attack detection method, focusing on data analysis of IoT devices, such as studying the potential relationship between sequences such as power consumption data, network traffic capture, kernel events, and hardware performance counter (HPC) events of electric vehicle charging equipment, thereby realizing IoT attack detection. Specifically, the following steps are included:

[0028] Step 1: Obtain IoT attack dataset and perform preprocessing, including data cleaning, standardization, label mapping, and dataset partitioning;

[0029] Step 1.1: This embodiment uses an EV charging equipment attack dataset. This dataset contains a variety of network attacks and host attacks. The specific descriptions and characteristics are as follows:

[0030] (1) Multidimensional data sources:

[0031] ① Power consumption data: including power-related parameters such as current, voltage, and power. These data can reflect the consumption of the charger under normal and abnormal (such as attack) conditions.

[0032] ② Network traffic data: network traffic when the charger communicates with electric vehicles or other devices. Usually stored in pcap format, it contains data packets of various protocols, and communication patterns and abnormal behaviors can be obtained through analysis.

[0033] ③Host event data: records events at the charger hardware and operating system levels, such as hardware performance counter (HPC) events and kernel events. These events can help detect abnormal activities within the system.

[0034] (2) Multi-state characteristics:

[0035] ① Idle state: The state when the charger has not established communication with the electric vehicle or is not charging.

[0036] ② Charging state: The state in which the charger establishes communication with the electric vehicle and charges it. The power consumption and network traffic characteristics in these two states may be significantly different.

[0037] (3) Various attack types:

[0038] ① Network attacks: such as reconnaissance, denial of service (DoS) attacks, etc., specifically including TCP port scanning, service version detection, UDP flooding and ICMP flooding, etc., which are usually reflected through abnormal network traffic.

[0039] ②Host attacks: such as cryptojacking and backdoor attacks, which may be manifested through HPC events, kernel events, or abnormal power consumption.

[0040] (4) Time series characteristics: The data has time series characteristics, and each sample has a timestamp, which is used to indicate the time sequence of events. This is crucial for analyzing the occurrence and development of attacks.

[0041] (5) High dimensionality and diversity: The dataset is high-dimensional, especially in terms of host events (such as HPC events), containing hundreds of dimensions. The diversity of the data helps capture different types of normal and abnormal behaviors.

[0042] Step 1.2, data screening and cleaning. Use the read_csv function of the Pandas library to read the csv file, use the DataFrame.fillna method to set all null values ​​to 0, and use the DataFrame.loc accessor to select and filter columns with all 0 feature values ​​and outliers based on the index name and column name. After cleaning, the feature dimension is reduced from 908 to 229.

[0043] Step 1.3, center and normalize the samples to improve the efficiency and accuracy of model training. Use the StandardScaler.fit_transform method of the Scikit-learn library to standardize the data and scale the sample data to a range of 0 mean and 1 standard deviation. The specific formula is as follows:

[0044]

[0045] Among them, X is the original eigenvalue, μ is the mean of the feature, σ is the standard deviation of the feature, and X scaled is the standardized eigenvalue.

[0046] Step 1.4: Shuffle the data. Use the sample method and reset_index method in the Pandas library to randomly rearrange the DataFrame object and reset the index.

[0047] Step 1.5, category label mapping. Divide the data into samples and labels, and use the torch.nn.functional.one_hot function of the neural network module of the PyTorch library to convert the labels into one-hot encoding format. The dimension of the encoded labels is the total number of categories.

[0048] Step 1.6, data set division. Save the processed labels and samples to the TensorDataset class, and use the torch.utils.data.random_split function of the data processing module of the PyTorch library to randomly divide the data into training set, validation set, and test set (the validation set and test set each account for 15% of the total data set) to ensure the generalization ability of the model. Split the training set according to the number of clients, and the data loader DataLoader of each client will load data from the split training set subset to ensure that the data of each client is independent.

[0049] Step 2: Build a deep learning model that integrates multi-scale feature extraction and lightweight multi-attention modules. The multi-scale feature extraction module is responsible for extracting spatial features at different levels from the data and inputting the fused features into the lightweight multi-attention module. The lightweight multi-attention module uses a self-attention mechanism, which can effectively model complex temporal features and capture the potential relationship between complex features. Finally, the output of the lightweight multi-attention module is converted into a classification probability through the Softmax function. Specifically:

[0050] Step 2.1, build a multi-scale feature extraction module;

[0051] The present invention uses a multi-scale feature extraction module to extract spatial features at each level and obtain a multi-level abstract representation of data from low dimension to high dimension. The specific structure is as follows:

[0052] The multi-scale feature extraction module of the present invention adopts a multi-branch structure, such as Figure 2 As shown in the figure, it specifically includes multiple convolutional layers, normalization layers, and multiple multi-layer perceptrons (MLPs). First, there are two convolutional layers with a filter size of 16. The second additional convolutional layer with the same filter size is used as a buffer layer to increase training stability, because the first branch is too close to the shallow feature map of the multi-scale feature extraction module and receives a large gradient signal in the initial training stage, which may cause training instability. The output of the first two convolutional layers is derived from the first branch after passing through the normalization layer, and feature F1 is extracted. The filter size of the third convolutional layer of the backbone network is 32. The output of this convolutional layer is derived from the second branch after passing through the normalization layer, and feature F2 is extracted. Feature map F2 passes through the fourth convolutional layer of the backbone network with a filter size of 64 and MLP to obtain feature M1. Finally, feature F1 and feature F2 are respectively connected through two residual connections containing MLPs, and then spliced ​​and fused with feature M1 to obtain a multi-level fusion feature C1 containing shallow features and deep features, which is used as the input of the lightweight multi-attention module.

[0053] Step 2.2, build a lightweight multi-attention module.

[0054] The lightweight multi-attention module of the present invention is composed of two cascaded self-attention units, and the self-attention unit is composed of a multi-head self-attention layer, a normalization layer and a stacked fully connected layer. The specific structure is shown in Figure 3 The inputs of the multi-head self-attention layer and the stacked fully connected layer are superimposed on their outputs through residual connections. The outputs after residual connections are normalized by layer normalization. The specific descriptions of the multi-head self-attention layer and the stacked fully connected layer are as follows:

[0055] (1) Multi-head self-attention layer: Capture the relationship between different parts of the input through multiple attention heads. The self-attention mechanism is the core of this module, which allows the module to pay attention to the information of other positions in the sequence when processing each position of the input sequence. The calculation process is as follows:

[0056] First, the input matrix X is linearly transformed to generate three weight coefficient matrices Q, K, and V; then, the similarity of matrices Q and K is calculated by dot product, and scaling and Softmax functions are applied to calculate the attention weights. The specific formula is as follows:

[0057]

[0058] Among them, Q is the query matrix, which represents the information that the current input wants to obtain, K is the key matrix, which is used to match the query, and V is the value matrix, which corresponds to the specific value and is used to generate the final output. Q, K, and V are obtained by linear transformation of the input matrix X; QK T Represents the dot product of Q and K, which is used to measure the similarity between the query and all keys. In order to avoid the dot product value being too large, As a scaling factor, dk is the dimension of the K vector; the Softmax function is used to normalize the similarity and convert it into a probability distribution; the weight matrix after Softmax processing is multiplied by the value matrix V to obtain the final weighted sum output. The multi-head attention mechanism captures more relationships and patterns by calculating multiple self-attentions in parallel.

[0059] (2) Stacked fully connected layer: Located after the multi-head self-attention layer, it consists of a fully connected layer responsible for dimensionality increase and a fully connected layer responsible for dimensionality reduction. A series of nonlinear transformations are independently applied to each position of the feature output by the attention mechanism to enhance feature expression. The attention mechanism captures the dependencies in the sequence, and the stacked fully connected layer further processes and abstracts these captured dependencies to help the model better understand and express the patterns and structures in the data. The calculation process is as follows:

[0060] FC(X)=max(0,XW1+b1)W2+b2

[0061] Among them, X is the input tensor, W1 and W2 are weight matrices, b1 and b2 are bias terms, and max(0, ) is usually the ReLU activation function.

[0062] In the field of IoT attack detection, data is often heterogeneous high-dimensional numerical features, rather than words or discrete sequences in natural language. Although the Transformer word embedding and position encoding mechanism currently used in processing natural language is very effective in processing natural language sequences, it is not applicable when representing complex numerical features. Therefore, the lightweight multi-attention module of the present invention cancels the word embedding and position embedding parts, and instead adopts a multi-scale feature extraction module, which can more effectively capture and process spatial features in the input data. In addition, the module uses the core multi-head self-attention mechanism and simplifies the design of the feedforward neural network. In the specific implementation, only two layers of multi-head self-attention layers are retained, and two layers of simplified fully connected layers are stacked thereafter, with the dimension being half of the original feedforward neural network, and then the output of each layer is processed through residual connections and normalization layers. The computing resources and parameters required for this simplified structure are lower than the single decoder layer of the Transformer, but it can still efficiently extract and express important features in the input data.

[0063] The lightweight multi-attention module of the present invention focuses on resource-constrained environments such as the Internet of Things or tasks that require real-time processing. Compared with the traditional Transformer model, it has significant advantages in computational efficiency and model size while still maintaining good feature extraction capabilities.

[0064] Step 2.3, the combination of multi-scale feature extraction module and lightweight multi-attention module;

[0065] The structure of the deep learning model integrating multi-scale feature extraction and lightweight multi-attention module of the present invention is as follows: Figure 4 shown.

[0066] First, a multi-scale feature extraction module is used to perform multi-level spatial feature extraction and fusion, mapping the numerical features of network traffic, power consumption, and host event sequence data to a fixed-dimensional tensor representation. Subsequently, the fused features are used as the input of a lightweight multi-attention module, and the dependencies between data are captured by the self-attention mechanism. Finally, the output generates classification probabilities through a classifier consisting of an MLP and a normalization layer and a Softmax function. The Softmax function is used to normalize the vector and convert it into a probability distribution. Its operating principle is as follows:

[0067]

[0068] where x iRepresents an element in the original vector. This function transforms all elements in the new vector to be within the range of [0,1], and the sum of these elements is 1. Each element in the vector is a decimal less than 1, reflecting the probability of each classification. By selecting the classification with the highest probability, binary and multi-classification problems can be solved.

[0069] Step 3: Combine the multi-scale multi-attention deep learning model obtained in step 2 with federated learning to construct a privacy-preserving multi-scale multi-attention IoT attack detection method.

[0070] Privacy protection is a key issue when processing sensitive IoT data. This paper combines the multi-scale multi-attention model with federated learning, allowing all participants to collaboratively train the global model without sharing local data and encrypting uploaded model parameters, effectively avoiding the risk of data leakage while ensuring the data privacy of all parties.

[0071] IoT data is usually heterogeneous and diverse, such as different types of feature data such as network traffic, power consumption, host events, etc. Through the federated learning architecture, each client can independently extract complex multi-level features on local data, and capture complex spatiotemporal dependencies through a multi-scale multi-attention model, and then train the model locally. These local knowledge are then integrated into the global model in federated learning. Not only does it take advantage of distributed computing, it also significantly improves the robustness and accuracy of the model when processing different tasks, and enhances its adaptability when processing complex, heterogeneous IoT data.

[0072] Figure 5 The overall framework of the present invention for detecting IoT attacks is shown, and the specific steps are as follows:

[0073] First, a federated learning architecture is constructed to generate a federated learning client equipped with an IoT attack detection deep learning model; traffic analysis and host analysis are performed on IoT devices to obtain a data set containing normal data and IoT attack data; the obtained data is preprocessed, including feature selection and data normalization, and distributed to each federated learning client, and the data of each client is independent of each other; in each round, the cloud server selects a client for training, trains a local model on the local data of each client, and uses a multi-scale feature extraction module to extract multi-scale spatial features. The fused features are input to a lightweight multi-attention module to further analyze the potential temporal relationship and generate classification results; the client encrypts and uploads the local model update to the cloud server; the cloud server aggregates local model parameters and updates the global model, uses algorithms such as FedAvg to update the global model, and sends the global model update to all clients; through multiple iterations and parameter tuning, the optimal global model is obtained, and the performance is tested on the test set.

[0074] Step 4: Federated deep learning model training;

[0075] Build a federated learning architecture so that multiple participants can collaboratively train models without sharing local data. Create a federated learning client representing a single organization, install the present invention and each comparison model, and perform the following operations:

[0076] Step 4.1, data distribution and client initialization. Load the data from the data loader in step 1.6; initialize the model for each client and set the global model parameters.

[0077] Step 4.2, distributed training. Under the federated learning framework, each client performs model training locally to ensure data privacy is not leaked. Each client uses local data to train the model and calculates the gradient update of the local model.

[0078] Step 4.3, privacy protection. After each round of training, each client uploads the encrypted model parameters (such as gradients or weight updates) to the cloud server. The model parameters are encrypted using a homomorphic encryption algorithm to protect the privacy of the training data. The specific calculation is as follows:

[0079] Enc(m)=(g m ·r n )mod n 2

[0080] Among them, Enc(m) is the encrypted IoT attack detection deep learning model parameter, m is the original parameter, r is a random number, and g and n are the public parameters of the encryption algorithm.

[0081] Step 4.4, model aggregation and update. Use algorithms such as FedAvg to regularly aggregate the encrypted local model updates of each client and synthesize the global model. The cloud server decrypts the uploaded model parameters, aggregates the model parameters, and updates the global model.

[0082] Evaluation and tuning mainly focus on the following indicators: loss rate (Loss), accuracy rate (ACC), precision rate (Precision), recall rate (Recall), F1 value (F1-Measure), and AUC value. The specific calculation of each indicator is as follows:

[0083] True positives (TP): positive examples are correctly identified as positive. False positives (FP): negative examples are incorrectly identified as positive. False negatives (FN): positive examples are incorrectly identified as negative. True negatives (TN): negative examples are correctly identified as negative.

[0084] The accuracy rate (ACC) indicates the proportion of correctly classified instances to the total number of instances. The calculation formula is:

[0085]

[0086] Precision refers to the proportion of instances classified as positive that are correctly classified. The calculation formula is:

[0087]

[0088] Recall refers to the proportion of positive examples that are correctly identified. The calculation formula is:

[0089]

[0090] The F1 value (F1-Measure) is the harmonic mean of precision and recall, calculated as:

[0091]

[0092] Loss calculation formula:

[0093]

[0094] Where i represents the sample, y represents the actual label, a represents the predicted output, and n represents the total number of samples.

[0095] Table 1 Performance comparison of backdoor category models

[0096]

[0097] Table 2 Comparison of performance of reconnaissance category models

[0098]

[0099] Table 3. Performance comparison of DoS category models

[0100]

[0101] Table 4. Comparison of performance of normal (Benign) category models

[0102]

[0103] The model of the present invention performs well in the classification task on the CICEVSE2024 public dataset. The performance of each model is shown in Tables 1-4, and the performance is as follows:

[0104] The accuracy, precision, recall and F1 score of the present invention in the Backdoor category all reach 100.00%. Compared with the GRU, BiLSTM and CNN+Transformer models, the F1 score is increased by 17.58%, 21.13% and 11.15% respectively, showing obvious advantages.

[0105] The accuracy of the present invention in the Recon category reached 99.24%, the precision reached 97.76%, the recall rate reached 96.32%, and the F1 score reached 97.04%. Compared with traditional models such as GRU model and LSTM, the present invention has significantly improved the recall rate and F1 score. Compared with CNN+Transformer, the recall rate increased by 40% and the F1 score increased by 19.89%.

[0106] For DoS attack detection, the accuracy of the present invention reaches 99.24%, the precision and recall are 95.69% and 97.37% respectively, and the F1 score is 96.52%, showing excellent detection accuracy and reliability.

[0107] All indicators of the present invention in the normal category reached 100.00%. Compared with the CNN model, the accuracy rate increased by 5.12%, the recall rate increased by 15.32%, and compared with the CNN+Transformer model, the recall rate increased by 7.17%, and the F1 score increased by 5.67%.

[0108] In summary, the present invention performs well in all categories of detection tasks, especially in the Backdoor and Recon categories, significantly outperforming traditional deep learning models and advanced hybrid models, and showing comprehensive advantages in key indicators.

Claims

1. A privacy-preserving multi-scale multi-attention IoT attack detection method, characterized in that: The following steps are involved: Step 1, obtain an IoT attack data set, and pre-process the IoT attack data in the IoT attack data set; Step 2: Build an IoT attack detection deep learning model that integrates multi-scale feature extraction and lightweight multi-attention modules, input the pre-processed IoT attack data, and obtain the IoT attack detection results; Step 3: Combine the IoT attack detection deep learning model with federated learning to obtain the optimal IoT attack detection deep learning model through multiple iterations and parameter tuning.

2. According to claim 1, a privacy-preserving multi-scale multi-attention IoT attack detection method is characterized in that: In the IoT attack detection deep learning model, first, the multi-scale feature extraction module extracts and fuses spatial features at different levels from the IoT attack data, and inputs the fused features into the lightweight multi-attention module; the lightweight multi-attention module adopts the self-attention mechanism to model the temporal features and capture the potential relationship between the features; finally, the output of the lightweight multi-attention module is converted into a classification probability through the Softmax function, and the IoT attack detection result is output.

3. The privacy-preserving multi-scale multi-attention IoT attack detection method according to claim 2, characterized in that: The specific implementation process of the multi-scale feature extraction module is as follows: The input IoT attack data first passes through a convolution layer for preliminary feature extraction and dimension reduction. Then it is input into two cascaded convolution units to extract features F1 and F2. The feature map F2 passes through a convolution layer and a multi-layer perceptron to obtain feature M1. Feature F1 and feature F2 are respectively connected through two residual connections containing multi-layer perceptrons MLP, and then concatenated and fused with M1 to obtain fused feature C1. The specific formula is as follows: C1=M1+MLP(F1)+MLP(F2) Here, MLP(·) represents a multi-layer perceptron.

4. The privacy-preserving multi-scale multi-attention IoT attack detection method according to claim 2, characterized in that: The lightweight multi-attention module is specifically implemented as follows: the fusion feature C1 is input into two cascaded self-attention units for feature extraction, and the self-attention feature Z is output; finally, the self-attention feature Z is sent to the classifier to output the IoT attack detection result; The self-attention unit is composed of a cascaded multi-head self-attention layer and a normalization layer, and the input of the self-attention unit is superimposed and fused with the output of the multi-head self-attention layer through a residual connection; The classifier consists of an MLP and a normalization layer, and the input features of the MLP are superimposed and fused with the output of the MLP through a residual connection, and finally the classification probability of the IoT attack is output through a Softmax function.

5. A privacy-preserving multi-scale multi-attention IoT attack detection method according to claim 4, characterized in that: The specific implementation process of step 3 is as follows: Distributed training is carried out under the federated learning architecture. Each participant uses local IoT attack data to train the local IoT attack detection deep learning model, and periodically uploads the parameters of the local IoT attack detection deep learning model to the cloud server in an encrypted manner. The cloud server is responsible for aggregating the parameters and updating the global model. The participants update the local model based on the updated global model feedback, jointly improve the model performance, and obtain the optimal IoT attack detection deep learning model through multiple iterations and parameter tuning. When federated training is performed between participants, local data is not exchanged and parameters are exchanged in an encrypted manner.

6. A privacy-preserving multi-scale multi-attention IoT attack detection method according to claim 5, characterized in that: The IoT attack detection deep learning model parameters are periodically uploaded to the cloud server in an encrypted manner. Specifically, the IoT attack detection deep learning model parameters are encrypted using a homomorphic encryption algorithm, and the calculation is as follows: Enc(m)=(g m ·r n )mod n 2 Among them, Enc(m) is the encrypted IoT attack detection deep learning model parameter, m is the original parameter, r is a random number, and g and n are the public parameters of the encryption algorithm.

Citation Information

Cited By

  • Security defense method, system and equipment based on behavior sequence analysis

    CN120956529A

  • Security defense method, system and device based on behavior sequence analysis

    CN120956529B