A website fingerprinting method based on time-frequency consistency pre-training

By employing a method of training with total contrastive loss and fine-tuning with a one-dimensional convolutional neural network, the low accuracy of deep learning website fingerprint recognition in scenarios with few samples is addressed, achieving efficient website fingerprint recognition in dynamic network environments.

CN119728254BActive Publication Date: 2026-02-24SICHUAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411915688.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2026-02-24
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

Existing deep learning-based website fingerprinting methods have low accuracy in scenarios with few samples and insufficient model generalization ability, making it difficult to adapt to dynamically changing network environments.

Method used

The fingerprint recognition model is trained using total contrast loss. A general fingerprint recognition model is constructed by combining the Adam optimization algorithm and the cosine annealing learning rate scheduling strategy. The model is then fine-tuned using a one-dimensional convolutional neural network. Feature extraction and optimization are performed using time-domain, frequency-domain, and time-frequency consistency contrast loss.

Benefits of technology

It improves the model's generalization and noise resistance, ensuring accurate identification of website fingerprints in scenarios with few samples, enhancing identification stability and robustness, and adapting to complex network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728254B_ABST
    Figure CN119728254B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of information security, and discloses a website fingerprint identification method based on time-frequency consistency pre-training. The fingerprint identification model is trained through total contrast loss, the fingerprint identification model is optimized by using an Adam optimization algorithm and a cosine annealing learning rate scheduling strategy during training, a general fingerprint identification model is obtained, the total contrast loss is obtained by aggregating the total contrast losses of multiple pieces of anonymous traffic in a training set, wherein the total contrast loss of a single piece of anonymous traffic is obtained by weighted combination of time domain contrast loss, frequency domain contrast loss and time-frequency consistency contrast loss of the single piece of anonymous traffic, and the general fingerprint identification model is used for website fingerprint identification. The trained general fingerprint identification model can not only accurately identify the fingerprint features of different anonymous traffics, but also maintain high identification stability and robustness in a complex environment, thereby improving the generalization ability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, and in particular to a website fingerprinting method based on time-frequency consistency pre-training. Background Technology

[0002] In recent years, with the growing demand for privacy protection, the Tor network, as one of the most popular anonymous communication systems, provides users with the ability to access the internet anonymously. The Tor network protects users' privacy and freedom by using multi-layered encryption and routing technologies to hide their IP addresses and communication content.

[0003] Website fingerprinting (WF) refers to the technique of inferring the content of web pages visited by a user by analyzing data stream patterns in encrypted or anonymous network connections. This attack method poses a serious threat to the Tor network. Existing website fingerprinting methods typically utilize deep neural networks to automatically learn features and classify website fingerprints. This method does not require manually engineered features and can automatically extract low-dimensional feature vectors from data, improving the accuracy and robustness of website fingerprinting. However, in the process of implementing the inventive technical solutions in the embodiments of this application, the inventors of this application have discovered that the above-mentioned technology has at least the following technical problems:

[0004] Deep learning-based website fingerprinting methods require a large amount of labeled training data, and the classification model needs frequent retraining to ensure high classification performance and cope with concept drift. Due to the dynamic changes in website content and network conditions, in scenarios with few samples, the limited training data exacerbates the distribution mismatch between training samples and target data, significantly reducing the model's generalization ability and decreasing the accuracy and practicality of website fingerprinting. Summary of the Invention

[0005] This application provides a website fingerprint recognition method based on time-frequency consistency pre-training, which solves the technical problem of low recognition accuracy of existing deep learning-based website fingerprint recognition methods in scenarios with few samples, and achieves the technical effect of ensuring the accuracy of website fingerprint recognition in scenarios with few samples.

[0006] This application provides a website fingerprinting method based on time-frequency consistency pre-training, including the following steps:

[0007] The fingerprint recognition model is trained using the total contrast loss. During training, the Adam optimization algorithm and cosine annealing learning rate scheduling strategy are used to optimize the fingerprint recognition model to obtain a general fingerprint recognition model. The total contrast loss is obtained by aggregating the total contrast losses of multiple anonymous traffic in the training set. The total contrast loss of a single anonymous traffic is obtained by weighted combination of the time-domain contrast loss, frequency-domain contrast loss and time-frequency consistency contrast loss of that single anonymous traffic.

[0008] Website fingerprint recognition is performed using the general fingerprint recognition model described above.

[0009] In some embodiments, the training set is obtained by collecting anonymous traffic from different websites.

[0010] In some embodiments, the fingerprint recognition model is a one-dimensional convolutional neural network.

[0011] In some embodiments, the process of using the general fingerprint recognition model to perform website fingerprint recognition includes the following steps:

[0012] A small amount of traffic from the target website is collected as the fine-tuning training set for the general fingerprint recognition model;

[0013] The general fingerprint recognition model is fine-tuned by using cross-entropy loss. During training, the gradient descent algorithm is used to optimize the general fingerprint recognition model to obtain the fine-tuned fingerprint recognition model.

[0014] The target website's fingerprint was identified using a finely tuned fingerprint recognition model.

[0015] In some embodiments, prior to training the fingerprint recognition model using the total contrast loss, the method further includes:

[0016] Determine the original data packet sequence of each anonymous traffic in the training set, where the original data packet sequence refers to the data unit in the anonymous traffic;

[0017] Extract the original burst sequence from the original data packet sequence, where the original burst sequence refers to a set of data packets that appear consecutively in the same direction in the original data packet sequence;

[0018] The original burst sequence is subjected to data augmentation processing to generate a burst augmented sequence;

[0019] Generate a time-domain enhanced data packet sequence based on the burst enhancement sequence;

[0020] The original data packet sequence is compared with the time-domain enhanced data packet sequence in the time domain to determine the time-domain comparison loss.

[0021] In some embodiments, the step of performing a time-domain comparison between the original data packet sequence and the time-domain enhanced data packet sequence to determine the time-domain comparison loss specifically includes:

[0022] The original data packet sequence and the time-domain enhanced data packet sequence are sequentially input into the time-domain encoder and the time-domain projector to obtain the time-domain projection representation sequence;

[0023] Based on the temporal projection representation sequence, the temporal contrast loss is determined, wherein the formula for determining the temporal contrast loss is:

[0024] ;

[0025] In the formula, This represents the temporal contrast loss. Refers to the time-domain projection representation sequence corresponding to the original data packet sequence. Refers to the time-domain projection representation sequence corresponding to the time-domain enhanced data packet sequence. Refers to the j-th original data packet sequence. Refers to all the original data packet sequences in the training set. Refers to the time-domain encoder. Refers to time-domain projector. refer to , express Cosine similarity between them The preset temperature parameters, Used to distinguish between positive and negative pairs, it only contributes to the denominator in the case of negative pairs.

[0026] In some embodiments, prior to training the fingerprint recognition model using the total contrast loss, the method further includes:

[0027] Determine the original data packet sequence of each anonymous traffic in the training set, where the original data packet sequence refers to the data unit in the anonymous traffic;

[0028] The original data packet sequence is subjected to frequency domain transformation to obtain a frequency domain data packet sequence;

[0029] The frequency domain data packet sequence is subjected to data augmentation processing to generate a frequency domain augmented data packet sequence;

[0030] The frequency domain data packet sequence is compared with the frequency domain enhanced data packet sequence in the frequency domain to determine the frequency domain comparison loss.

[0031] In some embodiments, the step of performing a frequency domain comparison between the frequency domain data packet sequence and the frequency domain enhanced data packet sequence to determine the frequency domain comparison loss includes:

[0032] The frequency domain data packet sequence and the frequency domain enhanced data packet sequence are sequentially input into the frequency domain encoder and the frequency domain projector to obtain the frequency domain projection representation sequence;

[0033] The frequency domain contrast loss is generated based on the frequency domain projection representation sequence, wherein the formula for determining the frequency domain contrast loss is:

[0034] ;

[0035] In the formula, This represents the frequency domain contrast loss. The frequency domain projection representation sequence corresponding to the frequency domain data packet sequence. The frequency domain projection representation sequence corresponding to the frequency domain enhanced data packet sequence. Refers to the j-th frequency domain data packet sequence. Refers to all frequency domain data packet sequences in the training set. Frequency domain encoder, Frequency domain projector, refer to , express Cosine similarity between them The preset temperature parameters, Used to distinguish between positive and negative pairs, it only contributes to the denominator in the case of negative pairs.

[0036] In some embodiments, prior to training the fingerprint recognition model using the total contrast loss, the method further includes:

[0037] The time-frequency consistency comparison loss is determined based on the time-domain comparison loss and the frequency-domain comparison loss, and the formula for determining the time-frequency consistency comparison loss is as follows:

[0038] ;

[0039] In the formula, This refers to the time-frequency consistency comparison loss. Refers to the time-domain projection representation sequence corresponding to the original data packet sequence. The frequency domain projection representation sequence corresponding to the frequency domain enhanced data packet sequence. Refers to the j-th frequency domain data packet sequence. Refers to all frequency domain data packet sequences in the training set. Frequency domain encoder, Frequency domain projector, refer to , express Cosine similarity between them The preset temperature parameters, Used to distinguish between positive and negative pairs, it only contributes to the denominator in the case of negative pairs.

[0040] In some embodiments, the total comparison loss of a single anonymous traffic stream is obtained by a weighted combination of the time-domain comparison loss, frequency-domain comparison loss, and time-frequency consistency comparison loss of the single anonymous traffic stream, wherein the formula for determining the total comparison loss is:

[0041] ;

[0042] In the formula, Refers to the total contrast loss, These are preset hyperparameters. Refers to the aforementioned temporal contrast loss, Refers to the frequency domain contrast loss, This refers to the aforementioned time-frequency consistency loss.

[0043] This application has the following technical advantages:

[0044] 1. This application uses total contrast loss to train the fingerprint recognition model, enabling the fingerprint recognition model to learn the differences between different fingerprint features. Combining the Adam algorithm and cosine annealing learning rate scheduling strategy, a general fingerprint recognition model is constructed to help the fingerprint recognition model escape local optima and find a better global optimum, thereby improving the generalization ability and noise resistance of the fingerprint recognition model. The trained general fingerprint recognition model can not only accurately identify the fingerprint features of different anonymous traffic, but also maintain high recognition stability and robustness in complex environments, thus improving the model's generalization ability.

[0045] 2. This application determines the total contrast loss by identifying the time-domain contrast loss, frequency-domain contrast loss, and time-frequency consistency loss of anonymous traffic in the target dataset. The total contrast loss is used for model training, which improves the generalization representation ability of the fingerprint recognition model. The model is then fine-tuned using a small amount of traffic from the target website. The fine-tuned model is then used for website fingerprint recognition, ensuring the accuracy of website fingerprint recognition in the case of few samples. This solves the technical problem of low recognition accuracy of existing deep learning-based website fingerprint recognition methods in the case of few samples, and achieves the technical effect of ensuring the accuracy of website fingerprint recognition in the case of few samples. Attached Figure Description

[0046] Figure 1 An example flowchart of a website fingerprinting method based on time-frequency consistency pre-training provided in an embodiment of this application;

[0047] Figure 2An example flowchart for fine-tuning training a general fingerprint recognition model in a website fingerprint recognition method based on time-frequency consistency pre-training provided in an embodiment of this application;

[0048] Figure 3 This application presents an embodiment of the fingerprinting effect of a small number of websites under interference from different numbers of non-monitored websites, where each monitored website has 5 anonymous traffic records in an open-world Dataset1.

[0049] Figure 4 This application describes the fingerprinting effect of a few-sample website under interference from different numbers of non-monitored websites in an open-world Dataset1, where each monitored website has 10 anonymous traffic.

[0050] Figure 5 This application describes the fingerprinting effect of a small sample website under interference from a different number of non-monitored websites in an open-world Dataset1, where each monitored website has 15 anonymous traffic.

[0051] Figure 6 This application describes the fingerprinting effect of a small number of websites under interference from a different number of non-monitored websites in an open-world Dataset1, where each monitored website has 20 anonymous traffic entries. Detailed Implementation

[0052] This application provides a website fingerprint recognition method based on time-frequency consistency pre-training, which solves the technical problem of low recognition accuracy of existing deep learning-based website fingerprint recognition methods in scenarios with few samples, and achieves the technical effect of ensuring the accuracy of website fingerprint recognition in scenarios with few samples.

[0053] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0054] Please refer to Figure 1 The website fingerprinting method based on time-frequency consistency pre-training provided in this embodiment includes the following steps:

[0055] S20. The fingerprint recognition model is trained using the total contrast loss. During training, the Adam optimization algorithm and cosine annealing learning rate scheduling strategy are used to optimize the fingerprint recognition model to obtain a general fingerprint recognition model. The total contrast loss is obtained by aggregating the total contrast losses of multiple anonymous traffic in the training set. The total contrast loss of a single anonymous traffic is obtained by weighted combination of the time domain contrast loss, frequency domain contrast loss and time-frequency consistency contrast loss of that single anonymous traffic.

[0056] S30. Use a general fingerprint recognition model for website fingerprint recognition.

[0057] In this embodiment, the total contrastive loss refers to the sum of the loss values ​​obtained after comparing multiple anonymous traffic streams. The total contrastive loss is used to measure the difference between the model's prediction and the actual result. Using the total contrastive loss to train the fingerprint recognition model enables the fingerprint recognition model to learn the differences between different fingerprint features, thereby improving the recognition accuracy. Specifically, the total contrastive loss is based on the sum of the total contrastive losses of each anonymous traffic stream in the training set. The total contrastive loss of each anonymous traffic stream is obtained by weighted combination of the time-domain contrastive loss, the frequency-domain contrastive loss, and the time-frequency consistency contrastive loss.

[0058] Specifically, time-domain contrast loss characterizes the changes in anonymous traffic over time. By comparing anonymous traffic in different time periods, time-related feature patterns can be obtained. Frequency-domain contrast loss is used to analyze the features of anonymous traffic in the frequency dimension. By using Fourier transform to process anonymous traffic in the frequency domain, the features of anonymous traffic in the frequency domain can be obtained. Using frequency-domain contrast loss, features that are not easily noticeable in the time domain but are significant in the frequency domain can be identified.

[0059] The time-frequency consistency contrast loss is used to represent the consistency relationship between anonymous traffic in the time domain and the frequency domain. By calculating the feature similarity of the same anonymous traffic in different transform domains, the fingerprint recognition model can learn a more robust and stable anonymous traffic feature representation, which helps to improve the generalization ability and noise resistance of the fingerprint recognition model. By assigning different weights to the time domain contrast loss, the frequency domain contrast loss and the time-frequency consistency contrast loss, the total contrast loss of a single anonymous traffic is obtained by weighted summation. The total contrast loss of a single anonymous traffic is aggregated to obtain the total contrast loss used for training the fingerprint recognition model.

[0060] Temporal contrastive loss, through a contrastive learning mechanism, narrows the representation distance between the original temporal data packet sequences and their enhanced versions from the same website, while effectively distinguishing the feature representations of data packet sequences from different websites. This enhances the model's ability to capture the similarity of representations for the same website and the differences in representations for different websites over time. Frequency domain contrastive loss is used to learn embeddings that are invariant to spectral enhancements in the fingerprint recognition model. Time-frequency consistency contrastive loss promotes consistency in the embedding representations generated by the fingerprint recognition model in the temporal and frequency domains. By narrowing the representations of anonymous traffic from the same website in the temporal and frequency domains, its temporal and frequency domain representations become closer in the latent feature space. By determining temporal contrastive loss, frequency contrastive loss, and time-frequency consistency contrastive loss, a complete pre-training framework is formed. Through contrastive learning in the temporal and frequency domains respectively, and by introducing time-frequency consistency loss, the fingerprint recognition model is guided to maintain consistent representations in the temporal and frequency domains, improving the robustness and generalization ability of the fingerprint recognition model.

[0061] By weighting and combining time-domain contrastive loss, frequency-domain contrastive loss, and time-frequency consistency contrastive loss, a total loss is obtained. This total loss measures the model's ability to capture the intrinsic relationships between data during self-supervised learning. Using this total loss for model training effectively improves the performance and generalization ability of the fingerprint recognition model while optimizing feature representation. Introducing a contrastive learning mechanism allows similar anonymous traffic from the same website to be more tightly aggregated in the embedded feature space, while simultaneously widening the distance between anonymous traffic representations from different websites, thereby significantly improving the fingerprint recognition model's discriminative power and robustness.

[0062] The Adam algorithm uses an adaptive learning rate adjustment mechanism and an efficient gradient update strategy to achieve rapid convergence in the early stages of fingerprint recognition model training, while maintaining stable optimization performance in the later stages of training. The cosine annealing learning rate scheduling strategy dynamically adjusts the learning rate by simulating the periodic changes of the cosine function, causing the learning rate to increase and then decrease repeatedly during training, helping the fingerprint recognition model escape local optima and find a better global optimum.

[0063] The fingerprint recognition model is trained using total contrastive loss, enabling it to learn the differences between various fingerprint features. By combining the Adam algorithm with a cosine annealing learning rate scheduling strategy, a general fingerprint recognition model is constructed. This helps the fingerprint recognition model escape local optima and find better global optima, improving its generalization ability and noise resistance. The trained general fingerprint recognition model can not only accurately identify the fingerprint features of different anonymous traffic, but also maintain high recognition stability and robustness in complex environments, thus improving the model's generalization ability.

[0064] In some embodiments, the training set is obtained by collecting anonymous traffic from different websites.

[0065] Specifically, the training set refers to the publicly available AWF dataset or DS-19 dataset used in website traffic analysis. The AWF dataset is currently the largest publicly available dataset in the field of website fingerprinting research. It is divided into two parts: a closed-world part and an open-world part. The closed-world part covers 900 target websites, each containing 2500 traffic records, which comprehensively reflect the website's traffic characteristics and behavioral patterns. The open-world part contains 400,000 websites, each with one traffic record; this part is mainly used to simulate the more complex and variable network environment in the real world. The DS-19 dataset is a relatively new dataset, collected in 2019 using different Tor browsers. The DS-19 dataset is used to capture and reflect the subtle differences in website traffic under different browser environments, providing comprehensive data support for website fingerprinting research.

[0066] In some embodiments, the fingerprint recognition model is a one-dimensional convolutional neural network.

[0067] In this embodiment, a one-dimensional convolutional neural network (CNN) refers to a neural network architecture used to process one-dimensional sequential data. In the fingerprint recognition model, the convolutional layer extracts local features from the input data to identify different website fingerprint patterns by sliding a one-dimensional convolutional kernel. By stacking multiple convolutional and pooling layers, the fingerprint recognition model can gradually learn more complex and abstract feature representations, thereby achieving effective classification and identification of website traffic. Using a one-dimensional convolutional neural network not only ensures feature extraction capabilities but also guarantees computational performance when processing large-scale datasets.

[0068] For example, the one-dimensional convolutional neural network is constructed using a DF architecture, comprising four convolutional blocks, each consisting of two convolutional layers. The number of convolutional kernels in the four convolutional blocks are 64, 128, 256, and 512, respectively, progressively extracting high-level features of the anonymous traffic to enhance the model's expressive power.

[0069] Please see Figure 2 S30. Using a universal fingerprint recognition model for website fingerprint recognition includes the following steps:

[0070] S31. Collect a small amount of traffic from the target website as a fine-tuning training set for the general fingerprint recognition model.

[0071] Specifically, the target website refers to the website for which the fingerprint recognition model is to be performed. The number of small traffic samples on the target website represents the number of traffic samples for each website. The number of small traffic samples can be 5, 10, 15 or 20. Increasing the number of traffic samples can improve the recognition accuracy of the fingerprint recognition model and ensure the fingerprint recognition effect of the target website.

[0072] S32. Fine-tune the training of the general fingerprint recognition model using cross-entropy loss. During training, the gradient descent algorithm is used to optimize the general fingerprint recognition model, resulting in the fine-tuned fingerprint recognition model.

[0073] Specifically, cross-entropy loss is used to measure the difference between the prediction results and the actual results of a general fingerprint recognition model. The smaller the difference, the closer the prediction results of the general fingerprint recognition model are to the actual results. The gradient descent algorithm calculates the gradient of the loss function with respect to the parameters of the general fingerprint recognition model and iteratively updates the model parameters to reduce the error between the prediction results and the actual results, ensuring that the general fingerprint recognition model gradually converges to the optimal solution during training.

[0074] After determining the fine-tuning training set, the general fingerprint recognition model is fine-tuned using the cross-entropy loss function. The fine-tuned fingerprint recognition model maintains the recognition capability of the general fingerprint recognition model while improving the recognition accuracy of the target website.

[0075] S33. Use the finely tuned fingerprint recognition model to perform fingerprint recognition on the target website.

[0076] In this embodiment, inputting the traffic data of the target website into the finely tuned fingerprint recognition model can yield fingerprint recognition results with high accuracy.

[0077] By fine-tuning the training process to rapidly optimize the parameters of a general fingerprint recognition model, and combining training, validation, and testing, the model's recognition performance on specific task objectives is improved, thus better adapting to the needs of low-sample target scenarios. The total contrastive loss is determined by identifying the temporal contrastive loss, frequency contrastive loss, and time-frequency consistency loss of anonymous traffic in the target dataset. This total contrastive loss is used for model training, improving the generalization ability of the fingerprint recognition model. Furthermore, the model is fine-tuned using a small amount of traffic from the target website. Using the fine-tuned model for website fingerprint recognition ensures accuracy in low-sample scenarios, solving the technical problem of low accuracy in low-sample scenarios for existing deep learning-based website fingerprint recognition methods. This achieves the technical effect of ensuring website fingerprint recognition accuracy in low-sample scenarios.

[0078] In some embodiments, prior to S20, before training the fingerprint recognition model using the total contrast loss, the method further includes:

[0079] S11A. Determine the original data packet sequence of each anonymous traffic in the training set. The original data packet sequence refers to the data unit in the anonymous traffic.

[0080] Specifically, the target dataset is determined by collecting anonymous traffic from different websites. This is achieved by collecting a large amount of anonymous traffic from various websites and preprocessing the traffic. Alternatively, the AWF dataset, which is publicly available in website traffic analysis, can be used.

[0081] The raw data packet sequence is used to represent data units in anonymous traffic. It can identify data packets and their transmission direction sequences in website traffic. Specific data features can be extracted from the raw data packet sequence to generate fingerprints.

[0082] For example, the raw packet sequence of anonymous network traffic refers to the cell sequence of anonymous traffic.

[0083] S12A. Extract the original burst sequence from the original data packet sequence. The original burst sequence refers to a set of data packets that appear in the same direction and are consecutive in the original data packet sequence.

[0084] Specifically, a burst sequence refers to a sequence in which traffic occurs in a burst at a rate higher than normal within a specific time period. For example, a burst sequence refers to the burst sequence within the cells sequence.

[0085] S13A: Perform data augmentation on the original burst sequence to generate a burst augmented sequence.

[0086] S14A, Generate a time-domain enhanced data packet sequence based on the burst enhancement sequence.

[0087] S15A. Compare the original data packet sequence with the time-domain enhanced data packet sequence in the time domain to determine the time-domain comparison loss.

[0088] In this embodiment, by performing enhancement processing on the burst sequence, a time-domain enhanced data packet sequence is generated using the burst enhancement sequence. The original data packet sequence and the time-domain enhanced data packet enhancement sequence are then input sequentially into the time-domain encoder and the time-domain projector to obtain the time-domain contrast loss.

[0089] For example, the raw packet sequence refers to the cell sequence of anonymous traffic. Sudden sequences refer to sequences from The extracted burst sequences are used to randomly increase or decrease the burst size for both uplink and downlink traffic burst sequences, adding noise to simulate the dynamic changes in website traffic in a real network environment. Specifically, the probability of randomly increasing the burst sequence is set to 1, and the probability of randomly decreasing the burst sequence is set to 0.5. The burst size threshold for uplink traffic enhancement is 2, and the burst size threshold for downlink traffic enhancement is 10. By enhancing the uplink and downlink traffic of the burst sequences, a burst enhancement sequence is generated, and a time-domain enhanced data packet sequence is generated based on the burst enhancement sequence. .

[0090] In some embodiments, S15A, performing a time-domain comparison between the original data packet sequence and the time-domain enhanced data packet sequence to determine the time-domain comparison loss, specifically includes:

[0091] S15A.1. Input the original data packet sequence and the time-domain enhanced data packet sequence into the time-domain encoder and the time-domain projector in sequence to obtain the time-domain projection representation sequence.

[0092] S15A.2. Based on the time-domain projection representation sequence, determine the time-domain contrast loss, wherein the formula for determining the time-domain contrast loss is:

[0093] ;

[0094] In the formula, Indicates time-domain contrast loss. Refers to the time-domain projection representation sequence corresponding to the original data packet sequence. The time-domain projection representation sequence corresponding to the time-domain enhanced data packet sequence. Refers to the j-th original data packet sequence. Refers to all raw data packet sequences in the training set. Refers to the time-domain encoder. Refers to time-domain projector. refer to , express Cosine similarity between them The preset temperature parameters, Used to distinguish between positive and negative pairs, it only contributes to the denominator in the case of negative pairs.

[0095] For example, by and Input to time-domain encoder Generate time-domain encoded embedding sequences and By and Input time domain projector The time-domain projection representation sequence is obtained. and This is used to control the concentration of similarity distribution. Specifically, in the embodiments of this application... Set it to 0.5.

[0096] In some embodiments, prior to S20, before training the fingerprint recognition model using the total contrast loss, the method further includes:

[0097] S11B. Perform frequency domain transformation on the original data packet sequence to obtain a frequency domain data packet sequence.

[0098] S12B: Perform data enhancement processing on the frequency domain data packet sequence to generate a frequency domain enhanced data packet sequence.

[0099] S13B. Compare the frequency domain data packet sequence with the frequency domain enhanced data packet sequence in the frequency domain to determine the frequency domain contrast loss.

[0100] In this embodiment, the original data packet sequence refers to the cells sequence of anonymous traffic. A fast Fourier transform is used for frequency domain conversion to obtain the frequency domain data packet sequence. Using preset data augmentation strategies to The frequency components are deleted or enhanced to generate a frequency-domain enhanced data packet representation sequence. Specifically, the preset data augmentation strategy refers to a data augmentation strategy where the probability of random deletion and addition is 0.1.

[0101] S13B. Compare the frequency domain data packet sequence with the frequency domain enhanced data packet sequence in the frequency domain to determine the frequency domain contrast loss, including:

[0102] S13B.1 Input the frequency domain data packet sequence and the frequency domain enhanced data packet sequence into the frequency domain encoder and the frequency domain projector in sequence to obtain the frequency domain projection representation sequence.

[0103] S13B.2. Based on the frequency domain projection representation sequence, generate the frequency domain contrast loss, wherein the formula for determining the frequency domain contrast loss is:

[0104] ;

[0105] In the formula, Indicates frequency domain contrast loss. The frequency domain projection representation sequence corresponding to the frequency domain data packet sequence. The frequency domain projection representation sequence corresponding to the frequency domain enhanced data packet sequence. Refers to the j-th frequency domain data packet sequence. Refers to all frequency domain data packet sequences in the training set. Frequency domain encoder, Frequency domain projector, refer to , express Cosine similarity between them The preset temperature parameters, Used to distinguish between positive and negative pairs, it only contributes to the denominator in the case of negative pairs.

[0106] In this embodiment, respectively and Input to frequency domain encoder In the process, a frequency domain coded sequence is generated. and Then the frequency domain encoding is embedded in the sequence. and Input to frequency domain projector In this process, the frequency domain projection representation sequence is obtained. and Generate frequency domain contrast loss .

[0107] Specifically, the relevant formulas are as follows:

[0108] ;

[0109] ;

[0110] ;

[0111] ;

[0112] In some embodiments, prior to S20, before training the fingerprint recognition model using the total contrast loss, the method further includes:

[0113] S11C. Based on the time-domain contrast loss and the frequency-domain contrast loss, determine the time-frequency consistency contrast loss. The formula for determining the time-frequency consistency contrast loss is as follows:

[0114] ;

[0115] In the formula, This refers to the time-frequency consistency comparison loss. Refers to the time-domain projection representation sequence corresponding to the original data packet sequence. The frequency domain projection representation sequence corresponding to the frequency domain enhanced data packet sequence. Refers to the j-th frequency domain data packet sequence. Refers to all frequency domain data packet sequences in the training set. Frequency domain encoder, Frequency domain projector, refer to , express Cosine similarity between them The preset temperature parameters, Used to distinguish between positive and negative pairs, it only contributes to the denominator in the case of negative pairs.

[0116] In some embodiments, prior to S20, before training the fingerprint recognition model using the total contrast loss, the method further includes:

[0117] S11D. The total comparison loss of a single anonymous traffic stream is obtained by weighted combination of the time-domain comparison loss, frequency-domain comparison loss, and time-frequency consistency comparison loss of the single anonymous traffic stream. The formula for determining the total comparison loss is:

[0118] ;

[0119] In the formula, Total comparative loss These are preset hyperparameters. Refers to temporal contrast loss. Frequency domain contrast loss, This refers to the loss of time-frequency consistency.

[0120] Specifically, The total comparison loss refers to the i-th traffic. Used for control , and The relative importance, specifically, It is 0.8.

[0121] Referring to Tables 1 to 4, this application uses accuracy as the evaluation metric in closed-world evaluation and precision, recall, and F1 score as evaluation metric in open-world scenarios.

[0122] Table 1 shows the comparison results of the website fingerprinting performance of the embodiments of this application in the closed-world evaluation under the condition that the target dataset and the pre-training dataset in the AWF dataset are similar but mutually exclusive. Table 4 shows the comparison results of the website fingerprinting performance of the embodiments of this application in the closed world under the condition that the data distributions of the target dataset and the pre-training dataset are different. Specifically, the pre-training data comes from the AWF dataset, and the target data comes from the DS-19 dataset. As shown in Tables 1 and 2, N-shot refers to the number of traffic in the fine-tuning training set used as a general fingerprinting model. Among all website fingerprinting methods, the embodiments of this application have the highest recognition accuracy, and the recognition accuracy gradually increases with the increase of the number of traffic in the few-shot fine-tuning set.

[0123]

[0124] Table 1

[0125]

[0126] Table 2

[0127] Table 3 shows the comparison results of website fingerprint recognition performance in a closed world where there is concept drift between the target dataset and the pre-training data. As shown in Table 3, the method of the present invention has the highest recognition accuracy when the interval between the target dataset and the pre-training dataset is 10 days, 2 weeks, 4 weeks, and 6 weeks. Furthermore, as the time interval between the target data and the target traffic in the pre-training dataset increases, the present invention exhibits a more significant advantage in recognition accuracy with fewer samples. At the same time, the rate of decrease in recognition accuracy is the slowest, demonstrating higher stability and robustness.

[0128]

[0129] Table 3

[0130] Table 4 shows the comparison of the recognition F1 scores of the embodiments of this application in open-world evaluation when the target dataset and the pre-training data are similar in distribution but mutually exclusive, and the recognition model is biased towards precision and recall, respectively. As shown in Table 4, the method of this invention has the highest recognition F1 score on website traffic with few samples, and the smaller the amount of traffic sample data, the greater the recognition advantage.

[0131]

[0132] Table 4

[0133] See Figures 3-6The performance of fingerprinting on few-sample websites with varying numbers of unmonitored websites in the open-world Dataset1 is shown. N represents the number of traffic samples used as the fine-tuning training set, precision represents fingerprint recognition accuracy, and recall represents recall. The precision-recall curve illustrates the relationship between these two metrics. It can be seen that when the number of unmonitored websites is fixed, increasing N shifts the precision-recall curve to the upper right, thereby improving both precision and recall. The model can utilize more training samples to learn useful features and enhance its ability to identify target websites. On the other hand, when N remains constant, as the number of unmonitored websites increases, the interference and noise from diverse and complex unmonitored websites increase, leading to a decrease in precision and recall. For 50,000 unmonitored websites—ten times the number of monitored websites—when the model is biased towards precision, the method achieves 87.52% precision and 84.78% recall; when the model is biased towards recall, the precision is 68.90% and the recall is 91.38%.

[0134] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0135] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0136] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0137] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0138] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0139] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A website fingerprinting method based on time-frequency consistency pre-training, characterized in that, Includes the following steps: The fingerprint recognition model is trained using the total contrast loss. During training, the Adam optimization algorithm and cosine annealing learning rate scheduling strategy are used to optimize the fingerprint recognition model to obtain a general fingerprint recognition model. The total contrast loss is obtained by aggregating the total contrast losses of multiple anonymous traffic in the training set. The total contrast loss of a single anonymous traffic is obtained by weighted combination of the time-domain contrast loss, frequency-domain contrast loss and time-frequency consistency contrast loss of that single anonymous traffic. Use the general fingerprint recognition model to perform website fingerprint recognition; Prior to training the fingerprint recognition model using the total contrast loss, the method further includes: Determine the original data packet sequence of each anonymous traffic in the training set, where the original data packet sequence refers to the data unit in the anonymous traffic; Extract the original burst sequence from the original data packet sequence, where the original burst sequence refers to a set of data packets that appear consecutively in the same direction in the original data packet sequence; The original burst sequence is subjected to data augmentation processing to generate a burst augmented sequence; Generate a time-domain enhanced data packet sequence based on the burst enhancement sequence; The original data packet sequence is compared with the time-domain enhanced data packet sequence in the time domain to determine the time-domain comparison loss. The original burst sequence includes uplink burst traffic and downlink burst traffic. The process of performing data augmentation on the original burst sequence to generate an augmented burst sequence includes: For both uplink and downlink burst traffic, the size of the burst sequence is randomly increased or decreased, noise is added, and data augmentation is performed to obtain the burst augmented sequence. Prior to training the fingerprint recognition model using the total contrast loss, the method further includes: Determine the original data packet sequence of each anonymous traffic in the training set, where the original data packet sequence refers to the data unit in the anonymous traffic; The original data packet sequence is subjected to frequency domain transformation to obtain a frequency domain data packet sequence; The frequency domain data packet sequence is subjected to data augmentation processing to generate a frequency domain augmented data packet sequence; The frequency domain data packet sequence is compared with the frequency domain enhanced data packet sequence in the frequency domain to determine the frequency domain comparison loss. The step of performing data enhancement processing on the frequency domain data packet sequence to generate a frequency domain enhanced data packet sequence includes: The frequency components of the frequency domain data packet sequence are deleted or enhanced using a method with a random deletion and addition probability of 0.1 to obtain a frequency domain enhanced data packet sequence; Prior to training the fingerprint recognition model using the total contrast loss, the method further includes: The time-frequency consistency comparison loss is determined based on the time-domain comparison loss and the frequency-domain comparison loss, and the formula for determining the time-frequency consistency comparison loss is as follows: ; In the formula, This refers to the time-frequency consistency comparison loss. Refers to the time-domain projection representation sequence corresponding to the original data packet sequence. The frequency domain projection representation sequence corresponding to the frequency domain enhanced data packet sequence. Refers to the j-th frequency domain data packet sequence. Refers to all frequency domain data packet sequences in the training set. Refers to the frequency domain encoder, Refers to the frequency domain projector. refer to , express Cosine similarity between them The preset temperature parameters, Used to distinguish between positive and negative pairs, it only contributes to the denominator in the case of negative pairs.

2. The method as described in claim 1, characterized in that, The training set was obtained by collecting anonymous traffic from different websites.

3. The method as described in claim 1, characterized in that, The fingerprint recognition model is a one-dimensional convolutional neural network.

4. The method according to any one of claims 1-3, characterized in that, The process of using the general fingerprint recognition model to perform website fingerprint recognition includes the following steps: A small amount of traffic from the target website is collected as the fine-tuning training set for the general fingerprint recognition model; The general fingerprint recognition model is fine-tuned by using cross-entropy loss. During training, the gradient descent algorithm is used to optimize the general fingerprint recognition model to obtain the fine-tuned fingerprint recognition model. The target website's fingerprint was identified using a finely tuned fingerprint recognition model.

5. The method as described in claim 1, characterized in that, The step of performing a time-domain comparison between the original data packet sequence and the time-domain enhanced data packet sequence to determine the time-domain comparison loss specifically includes: The original data packet sequence and the time-domain enhanced data packet sequence are sequentially input into the time-domain encoder and the time-domain projector to obtain the time-domain projection representation sequence; Based on the temporal projection representation sequence, the temporal contrast loss is determined, wherein the formula for determining the temporal contrast loss is: ; In the formula, This represents the temporal contrast loss. Refers to the time-domain projection representation sequence corresponding to the original data packet sequence. Refers to the time-domain projection representation sequence corresponding to the time-domain enhanced data packet sequence. Refers to the j-th original data packet sequence. Refers to all the original data packet sequences in the training set. Refers to the time-domain encoder, Refers to the time-domain projector. refer to , express Cosine similarity between them The preset temperature parameters, Used to distinguish between positive and negative pairs, it only contributes to the denominator in the case of negative pairs.

6. The method as described in claim 1, characterized in that, The step of comparing the frequency domain data packet sequence with the frequency domain enhanced data packet sequence in the frequency domain to determine the frequency domain comparison loss includes: The frequency domain data packet sequence and the frequency domain enhanced data packet sequence are sequentially input into the frequency domain encoder and the frequency domain projector to obtain the frequency domain projection representation sequence; The frequency domain contrast loss is generated based on the frequency domain projection representation sequence, wherein the formula for determining the frequency domain contrast loss is: ; In the formula, This represents the frequency domain contrast loss. The frequency domain projection representation sequence corresponding to the frequency domain data packet sequence. The frequency domain projection representation sequence corresponding to the frequency domain enhanced data packet sequence. Refers to the j-th frequency domain data packet sequence. Refers to all frequency domain data packet sequences in the training set. Refers to the frequency domain encoder, Refers to the frequency domain projector. refer to , express Cosine similarity between them The preset temperature parameters, Used to distinguish between positive and negative pairs, it only contributes to the denominator in the case of negative pairs.

7. The method as described in claim 5 or 6, characterized in that, The total comparison loss of a single anonymous traffic stream is obtained by weighted combination of the time-domain comparison loss, frequency-domain comparison loss, and time-frequency consistency comparison loss of that single anonymous traffic stream. The formula for determining the total comparison loss is as follows: ; In the formula, Refers to the total contrast loss, These are preset hyperparameters. Refers to the aforementioned temporal contrast loss, Refers to the frequency domain contrast loss, This refers to the time-frequency consistency comparison loss.

Citation Information

Patent Citations

  • Less-sample webpage fingerprint learning method, terminal equipment and storage medium

    CN116346437A

  • Method and system for identifying signal type by small sample based on signal time-frequency consistency pre-training

    CN118395322A