Self-attention website fingerprint identification method based on position target guidance

By applying a position-targeting mechanism and a convolutional neural network based on location-targeting in the Tor network, the website fingerprint characteristics of network traffic are extracted, and the high overhead and low accuracy of website fingerprint defense in the prior art is solved, achieving a more efficient recognition effect.

CN119675906AActive Publication Date: 2025-03-21SOUTHEAST UNIV
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411670754.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-21
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

In the prior art, when defending against website fingerprint attacks on Tor networks, there are problems with high time and bandwidth overhead, which affects the recognition effect.

Method used

A self-attention mechanism based on location goal orientation is adopted, and a convolutional neural network is combined with a convolutional neural network to preprocess and feature extraction to generate more representative website fingerprint features.

Benefits of technology

By improving the effectiveness and relevance of feature extraction, the misclassification rate is reduced and the accuracy and efficiency of website fingerprint recognition is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119675906A_ABST
    Figure CN119675906A_ABST
Patent Text Reader

Abstract

The invention provides a self-attention website fingerprint identification method based on position target guidance, and the method comprises the steps: generating a fingerprint feature vector of a to-be-classified website through a neural network according to the network flow generated by a network user and based on an attention mechanism; for a traffic data set to be classified, firstly, the traffic is preprocessed by using a two-dimensional convolution model, then extracted features are recombined into a feature matrix with the position as the target orientation, and in combination with processing of convolution calculation and a self-attention mechanism, obtained new website fingerprint feature vectors are input into a classifier to be classified. In the processing process based on the attention mechanism, the generated fingerprint feature vector simultaneously has features in time and space, and the two features have relevance, so that the classifier also improves the classification accuracy. According to the method, intelligent identification of website traffic can be realized, and the method is of great significance to monitoring and management of anonymous network website access.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to network security technology, and in particular relates to a location target-oriented self-attention website fingerprint recognition method. Background Art

[0002] As people pay more and more attention to network security and personal privacy issues, many anonymous communication technologies have emerged. As a highly anonymous communication system, the Tor network is increasingly used. Tor uses multi-hop links to provide anonymity in the network, including entry nodes, intermediate nodes, and exit nodes. Therefore, even if you have access to part of the network, you cannot obtain information about the client and server at the same time. In addition, the complex Tor protocol designed for the network makes it impossible for attackers to accurately restore Tor data information.

[0003] However, the website fingerprint attack technology against Tor has caused great damage to Tor's anonymity. By passively monitoring the link between the client and the entry node and training a set of classifiers based on the traffic data, the attacker can analyze the website information visited by the user. At present, in response to increasingly powerful attack technologies, corresponding website fingerprint defense methods have also emerged. Some of these methods are based on the idea of ​​data packet padding, some are based on data packet regularization, and some are based on the concept of adversarial samples. These methods usually have very high time and bandwidth overheads, but the emergence of defense methods has significantly reduced the accuracy of the attack. Therefore, various defense methods try to pursue lower defense costs and better defense effects against attacks. Summary of the invention

[0004] In order to solve the impact of website fingerprint defense technology on recognition effect, this method combines convolutional neural network and attention mechanism to extract more representative website fingerprint features based on the traffic generated by users visiting the website. By using these features to train the classifier, better recognition effect can be obtained.

[0005] The present invention discloses a location-target-oriented self-attention website fingerprint recognition method, comprising the following steps:

[0006] Step (1), two-dimensional convolution flow preprocessing;

[0007] Collect network traffic: Use packet capture tools to collect traffic, convert the captured traffic into a usable format, and label each traffic with the corresponding website.

[0008] Preliminary representation of data packet features in traffic: Count the specific number of data packets in both directions per unit time, and use a two-dimensional convolutional neural network for feature extraction. This neural network consists of multiple convolutional layers, pooling layers, activation layers, and batch processing layers to obtain a preliminary representation of traffic data packets.

[0009] Step (2): Position target-oriented attention weight calculation

[0010] The feature vector obtained in step 1 is compressed, and two one-dimensional convolution models are used to shorten the vector length of the target dimension. Here, the neural network includes a convolution layer, a batch layer, and a one-dimensional maximum pooling layer. For the new feature vector, according to the actual deployment requirements, the Pos it ion_Target vector is generated, and the matrix PT for attention calculation is determined. The data of the matrix is ​​self-attention calculated, and the self-attention weight is optimized to obtain the final website fingerprint feature representation.

[0011] The length of the feature vector will affect the performance of the model. An input that is too long will increase the model training overhead and increase the performance requirements of the hardware. An input that is too short will reduce the effective information received by the model and the degree of feature extraction will be insufficient. Therefore, reasonable feature compression and transfer can improve the performance of the classifier.

[0012] Convolutional neural networks can effectively extract local features, and the attention mechanism can effectively extract the association between data. The combination of the two complements each other, and the extracted traffic fingerprint is more representative, which is beneficial to the classifier performance. The details are as follows:

[0013] S2.1 Data information compression

[0014] For the vector from step 1 (denoted as x), the size of x is considered as [m*n*k]. The last dimension k can represent the statistical information of the original vector data. Two different one-dimensional convolution modules are used to shorten the vector length of the target dimension. Here, the neural network includes a convolution layer, a batch layer, and a maximum pooling layer. The k-th dimension data is compressed through the one-dimensional convolution model.

[0015] S2.2 Generate a position-oriented vector Position_Target:[p1,p2,p3,…,p n ]

[0016] First, remember the convolution kernel of step 2: [c1, c2, c3, ..., c k ], the convolution calculation is recorded as Q, then the corresponding calculation is recorded as [Q c1 ,Q c2 ,Q c3 ,…,Q ck ].

[0017] make Each d Q operations form a set of generators, namely:

[0018]

[0019] Then each element in the Position_Target vector is determined by the weighted operation of d Q operations.

[0020] Let the compressed vector after step 2 be s_feature∈C m×n

[0021] Then s_feature can generate multiple Position_Target feature vectors according to the above rules, and after arranging them in rows, a position-oriented matrix PT is generated:

[0022]

[0023] The PT matrix has i rows of elements and each row has j columns.

[0024] S2.3 Generate PT-Mask Matrix

[0025] At_temp = (PT) T ·PT

[0026] First, calculate the value of each element in the matrix At_temp. For any i-th row of data, calculate the Top array and the Bottom array respectively. The Top array stores a set of high-dimensional coordinates, corresponding to [A i1 ,A i2 ,…,A ij ], the position coordinates of the attention weights arranged in the first k1 according to the numerical value; similarly, the Bottom array stores the position coordinates of the attention weights arranged in the last k2 according to the numerical value among all the negative numbers. Then initialize the attention mechanism Mask vector (the last two-dimensional data):

[0027]

[0028] Based on the initial mask matrix, the PT-Mask matrix replaces the corresponding position data with (1+m%) or (1+n%) according to the multi-dimensional coordinate information in the Top array and the Bottom array, and then participates in the attention mechanism operation. Among them, the above m, n, k1, and k2 are set as hyperparameters.

[0029] S2.4 Calculate the position target-oriented attention weight

[0030]

[0031] As attached Figure 5 As shown above, the PT matrix is ​​used as the input of Q, K, V, and θ() is the PT-Mask mechanism. The position target-oriented attention weight calculation formula is shown above.

[0032] Step (3): Hyperparameter tuning

[0033] Depending on the specific task, the attacker needs to tune the model parameters to improve the model recognition accuracy.

[0034] In step 1, the length of the traffic trajectory is input. This data length reflects the richness of the basic information features of the traffic trajectory. The time interval for counting the number of statistical data packets is tuned. This time interval reflects the degree of refinement of the original traffic division and determines the overall length of the vector in subsequent steps. The vector length of Position_Target in step 2 is tuned. The vector length needs to refer to the hardware GPU performance. The number of feature heads and the optimization ratio of key features for attention weight calculation in step 2 are tuned.

[0035] Based on the feature representation in step 2 and the model parameters tuned in step 3, ten-fold cross validation is used to determine whether the feature vector in step 3 effectively identifies the target website. If the recognition efficiency is low, return to step 1; if the recognition efficiency is high, retain the model parameters and save the relevant model information to the relevant files, and end the process.

[0036] Beneficial effects of the present invention:

[0037] 1. Aiming at the limitations of current website fingerprint defense technology, the defense traffic ignores the correlation when the traffic interacts. The present invention designs a new network structure for traffic analysis, which better utilizes the performance of convolutional neural networks, increases the correlation between local traffic features and contextual traffic features, makes attacks more efficient when facing website fingerprint defense, and reduces misclassification.

[0038] 2. This paper proves the effectiveness of the self-attention mechanism for anonymous traffic analysis. The self-attention technology makes full use of the associations between traffic segments and between local features.

[0039] 3. In the processing process based on the attention mechanism, the generated fingerprint feature vector has both temporal and spatial features, and makes the two correlated, so that the classifier also improves the accuracy of classification. The present invention can realize the intelligent identification of website traffic, which is of great significance to the monitoring and management of anonymous network website access. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is the overall flow chart of the present invention;

[0041] Figure 2 This is a flow chart of step S2.1 of the present invention;

[0042] Figure 3 This is a flow chart of step S2.2 of the present invention;

[0043] Figure 4 This is a flow chart of step S2.3 of the present invention;

[0044] Figure 5 This is a flow chart of step S2.4 of the present invention;

[0045] Figure 6 This is the overall flow chart of step 2 of the present invention;

[0046] Figure 7 The figure is a flowchart of the steps of an embodiment of the present invention. DETAILED DESCRIPTION

[0047] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. It should be noted that the words "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to directions in the accompanying drawings, and the words "inner" and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.

[0048] The present invention is a position-target-oriented self-attention (Position_Target Attention) website fingerprint recognition method. The method is based on the network traffic generated by network users, and generates fingerprint feature vectors of websites to be classified through neural networks based on the attention mechanism. For the traffic data set to be classified, the traffic is first pre-processed using a two-dimensional convolution model, and then the extracted features are reorganized into a feature matrix with position as the target orientation. Combined with the convolution calculation and the processing of the self-attention mechanism, the obtained new website fingerprint feature vector is input into the classifier for classification. In the processing process based on the attention mechanism, the generated fingerprint feature vector has both temporal and spatial features, and the two are correlated, and the classifier also improves the accuracy of classification. The present invention can realize the intelligent identification of website traffic, which is of great significance to the monitoring and management of anonymous network website visits.

[0049] The present invention realizes effective website fingerprint recognition through the following technical features:

[0050] 1. The present invention designs a location-oriented feature vector, making the extraction of website fingerprint vectors more efficient.

[0051] 2. The present invention uses a position-target-oriented self-attention mechanism (Position_TargetAttention) to calculate weights, so that the fingerprint feature vector has more position correlation, thereby improving the classification performance of the classifier.

[0052] The specific steps of this embodiment are:

[0053] Step (1), two-dimensional convolution flow preprocessing

[0054] Collect network traffic: Use packet capture tools to collect traffic, convert the captured traffic into a usable format, and label each traffic with the corresponding website.

[0055] Preliminary representation of data packet features in traffic: Count the specific number of data packets in both directions per unit time, and use a two-dimensional convolutional neural network for feature extraction. This neural network consists of multiple convolutional layers, pooling layers, activation layers, and batch processing layers to obtain a preliminary representation of traffic data packets.

[0056] Step (2): Position target-oriented attention weight calculation

[0057] Compress the feature vector obtained in step 1, and use two one-dimensional convolution models to shorten the vector length of the target dimension. Here, the model includes a convolution layer, a batch layer, and a one-dimensional maximum pooling layer. For the new feature vector, generate the Position_Target vector according to the actual deployment requirements, determine the matrix PT for attention calculation, perform self-attention calculation on the data of the matrix, and optimize the self-attention weight to obtain the final website fingerprint feature representation.

[0058] Step (3): Hyperparameter tuning

[0059] Hyperparameter tuning involves the unit time and input traffic length in step 1; the vector length of the model Position_Target in step 2; and the number of feature heads and the optimization ratio of key features in the attention weight calculation in step 3. Based on the feature representation in step 2 and the model parameters tuned in step 3, ten-fold cross validation is used to determine whether the feature vector in step 2 effectively identifies the target website. If the recognition efficiency is low, return to step 1; if the recognition efficiency is high, retain the model parameters and save the relevant model information to the relevant files, and end the process.

[0060] The detailed process of the embodiment is shown in the attached Figure 7 .

[0061] Example:

[0062] This implementation is based on the above technical solution and uses Tor, one of the most popular Internet privacy enhancement technologies, as a carrier for traffic generation and acquisition to perform website fingerprinting.

[0063] Step (1), two-dimensional convolution flow preprocessing

[0064] Collect network traffic: Use packet capture tools to collect traffic, convert the captured traffic into a usable format, and label each traffic with the corresponding website.

[0065] Preliminary representation of traffic data packet features: Count the specific number of data packets in both directions per unit time, and use a two-dimensional convolutional neural network for feature extraction. This neural network consists of multiple convolutional layers, pooling layers, activation layers, and batch processing layers to obtain a preliminary representation of traffic data packets.

[0066] Step (2): Position target-oriented attention weight calculation

[0067] Compress the feature vector obtained in step 1, and use two one-dimensional convolution models to shorten the vector length of the target dimension. Here, the neural network includes a convolution layer, a batch layer, and a one-dimensional maximum pooling layer. For the new feature vector, generate the Position_Target vector according to the actual deployment requirements, determine the matrix PT for attention calculation, perform self-attention calculation on the data of the matrix, and optimize the self-attention weight to obtain the final website fingerprint feature representation.

[0068] S2.1 Data information compression

[0069] As attached Figure 2 As shown in the figure, for the vector from step 1 (denoted as x), the size of x is considered as [m*n*k]. The last dimension k can represent the statistical information of the original vector data. Two different one-dimensional convolution modules are used to shorten the vector length of the target dimension. Here, the neural network includes a convolution layer, a batch layer, and a maximum pooling layer. The k-th dimension data is compressed through the one-dimensional convolution model.

[0070] S2.2 Generate a position-oriented vector Position_Target:[p1,p2,p3,…,p n ]

[0071] As attached Figure 3 As shown, first remember the convolution kernel of step 2: [c1, c2, c3, ..., c k ], the convolution calculation is recorded as Q, then the corresponding calculation is recorded as [Q c1 ,Q c2 ,Q c3 ,…,Q ck ].

[0072] make Each d Q operations form a set of generators, namely:

[0073]

[0074] Then each element in the Position_Target vector is determined by the weighted operation of d Q operations.

[0075] Let the compressed vector after step 2 be s_feature∈C m×n

[0076] Then s_feature can generate multiple Position_Target feature vectors according to the above rules, and after arranging them in rows, a position-oriented matrix PT is generated:

[0077]

[0078] The PT matrix has i rows of elements and each row has j columns.

[0079] S2.3 Generate PT-Mask Matrix

[0080] At_temp = (PT) T ·PT

[0081] As attached Figure 4 As shown, first calculate the value of each element in the matrix At_temp, and for any i-th row of data, calculate the Top array and the Bottom array respectively. Among them, the Top array stores a set of high-dimensional coordinates, corresponding to [A i1 ,A i2 ,…,A ij ], the position coordinates of the attention weights arranged in the first k1 according to the numerical value; similarly, the Bottom array stores the position coordinates of the attention weights arranged in the last k2 according to the numerical value among all the negative numbers. Then initialize the attention mechanism Mask vector (the last two-dimensional data):

[0082]

[0083] Based on the initial mask matrix, the PT-Mask matrix replaces the corresponding position data with (1+m%) or (1+n%) according to the multi-dimensional coordinate information in the Top array and the Bottom array, and then participates in the attention mechanism operation. Among them, the above m, n, k1, and k2 are set as hyperparameters.

[0084] S2.4 Calculate the position target-oriented attention weight

[0085]

[0086] As attached Figure 5 As shown, the PT matrix is ​​used as the input of Q, K, V, and θ() is the PT-Mask mechanism.

[0087] Step (3): Hyperparameter tuning

[0088] In step 1, the length of the traffic trajectory is input. This data length reflects the richness of the basic information features of the traffic trajectory. The time interval for counting the number of statistical data packets is tuned. This time interval reflects the degree of refinement of the original traffic division and determines the overall length of the vector in subsequent steps. In step 2, the vector length of the model channel number dimension is tuned. The vector length needs to refer to the hardware GPU performance. In step 3, the number of feature heads and the optimization ratio of key features in the multi-head attention weight calculation are tuned.

[0089] Based on the feature representation in step 2 and the model parameters tuned in step 3, ten-fold cross validation is used to determine whether the feature vector in step 2 effectively identifies the target website. If the recognition accuracy is lower than 90%, return to step 1; if the recognition accuracy is higher than 90%, retain the model parameters and save the relevant model information to the relevant files, and end the process. The specific reference indicators are as follows:

[0090]

[0091] After the above steps, the original traffic trajectory has been successfully classified, the neural network has extracted the traffic fingerprint feature vectors belonging to each website, and the classifier recognition accuracy has been improved.

[0092] The above examples show that the new network structure for traffic analysis designed by the present invention makes better use of the performance of convolutional neural networks, increases the correlation between local traffic features and contextual traffic features, makes attacks more efficient when facing website fingerprint defense, and reduces misclassification. The present invention can realize intelligent identification of website traffic, which is of great significance for the monitoring and management of anonymous network website visits.

[0093] The technical means disclosed in the scheme of the present invention are not limited to the technical means disclosed in the above-mentioned implementation mode, but also include technical schemes composed of any combination of the above technical features.

Claims

1. A location-target-oriented self-attention website fingerprint recognition method, characterized in that: For any network traffic w s , the location-oriented self-attention website fingerprint recognition method can generate a feature vector w representing the website traffic d , and use this feature vector to train the classifier to classify the website; The website fingerprinting process includes: Step 1: 2D convolutional traffic preprocessing, collect network traffic: Use packet capture tools to collect traffic, convert the captured traffic into a usable format, and label each traffic with the corresponding website; Step 2: Position target-oriented attention weight calculation. Compress the feature vector obtained in step 1 and use two one-dimensional convolution models to shorten the vector length of the target dimension. Here, the one-dimensional convolution model includes a convolution layer, a batch layer, and a one-dimensional maximum pooling layer. For the new feature vector, generate the Position_Target vector according to the actual deployment requirements, determine the matrix PT for attention calculation, perform self-attention calculation on the data of the matrix, and optimize the self-attention weight to obtain the final website fingerprint feature representation. Step 3: Hyperparameter tuning. Hyperparameter tuning involves the unit time and input flow length in step 1; the vector length of the Position_Target model in step 2; the number of feature heads and the optimization ratio of key features in the attention weight calculation in step 2; Based on the feature representation in step 2 and the model parameters optimized in step 3, ten-fold cross validation is used to determine whether the feature vector in step 2 can effectively identify the target website; Step 4: If the recognition accuracy is lower than 90%, return to step 1; if the recognition accuracy is higher than 90%, retain the model parameters and save the relevant model information to the relevant files, and end the process.

2. According to claim 1, a location-target-oriented self-attention website fingerprint recognition method is characterized in that: In step 1, the collected traffic data packet information is used for preliminary feature representation: the specific number of data packets in both directions of inbound and outbound per unit time is counted, and a two-dimensional convolutional neural network is used for feature extraction. This neural network consists of a convolutional layer, a pooling layer, an activation layer, and a batch processing layer, thereby obtaining a preliminary representation of the traffic data packets.

3. According to the location target-oriented self-attention website fingerprint recognition method of claim 1, it is characterized in that: The specific process of calculating the position target-oriented attention weight in step 2 is: S2.1 data information compression; The vector from step 1 is denoted as x, and the size of x is considered as [m*n*k]. The last dimension k can represent the statistical information of the original vector data. Two different one-dimensional convolution modules are used to shorten the vector length of the target dimension. Here, the neural network includes a convolution layer, a batch layer, and a maximum pooling layer. The k-th dimension data is compressed through the one-dimensional convolution model. S2.2 Generate a position-oriented vector Position_Target:[p1,p2,p3,…,p n ]; First, remember the convolution kernel of step 2: [c1, c2, c3, ..., c k ], the convolution calculation is recorded as Q, then the corresponding calculation is recorded as [Q c1 ,Q c2 ,Q c3 ,…,Q ck ]; make Each d Q operations form a set of generators, namely: Then each element in the Position_Target vector is determined by the weighted operation of d Q operations; the vector compressed in step 2 is s_feature∈C m×n Then s_feature can generate multiple Position_Target feature vectors according to the above rules, and after arranging them in rows, a position-oriented matrix PT is generated: The PT matrix has i rows of elements and each row has j columns; S2.3 Generate PT-Mask Matrix At_temp=(PT) T ·PT; First, calculate the value of each element in the matrix At_temp. For any i-th row of data, calculate the Top array and the Bottom array respectively; the Top array stores a set of high-dimensional coordinates, corresponding to [A i1 ,A i2 ,…,A ij ], the position coordinates of the attention weights arranged in the first k1 according to the numerical value; similarly, the Bottom array stores the position coordinates of the attention weights arranged in the last k2 according to the numerical value among all negative numbers; then initialize the last two dimensions of the attention mechanism Mask vector: Then, based on the initial mask matrix, the PT-Mask matrix replaces the corresponding position data with 1+m% or 1+n% according to the multi-dimensional coordinate information in the Top array and the Bottom array, and then participates in the attention mechanism operation; wherein the above m, n, k1, and k2 are set as hyperparameters; S2.4 calculates the position target-oriented attention weight; Among them, the PT matrix is ​​used as the input of Q, K, and V, and θ() is the PT-Mask mechanism; the position target-oriented attention weight calculation formula is shown above.

4. The method for self-attention website fingerprint recognition based on location goal orientation according to claim 1, characterized in that: The specific process of hyperparameter tuning in step 3 is as follows: tune the input traffic trajectory length in step 1, and tune the time interval for statistical data packet count; tune the vector length of the model Position_Target in step 2, and tune the number of feature heads and key feature optimization ratio for attention weight calculation in step 2; the evaluation indicators can include accuracy, recall, precision, and F1-Score; the details are as follows:

Citation Information

Patent Citations

  • Tor website fingerprint identification method based on attention mechanism and LSTM

    CN114584372A

  • Web site fingerprint attack method oriented to multiple pages

    CN115378726A

  • Network traffic classification method and system based on multi-head attention and deep metric learning

    CN116582303A

  • Website fingerprint identification method for high-speed network

    CN116668111A

  • Internet of Things equipment identification method and system based on fingerprint deep extraction technology

    CN116886314A