Lightweight multi-modal network traffic tensor completion method based on contrastive learning and knowledge distillation

CN122909025APending Publication Date: 2026-10-13GUANGDONG UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611297647.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

但是,这类高精度方法往往会伴随急剧增加的存储与计算成本,这一问题在硬件资源与算力资源受限的边缘网络中尤为突出

Benefits of technology

本发明提供的一种基于对比学习及知识蒸馏的轻量级多模态网络流量张量补全方法,具有突出的实质性特点和显著的进步。本发明通过构建基于张量外积和时序卷积网络的高精度教师模型,以及基于特征拼接和注意力机制的轻量化学生模型,并创新性地引入概率稀疏多头自注意力机制实现历史嵌入的高效迁移,解决了现有技术因时间错位导致的热启动困难问题。同时,本发明通过嵌入对比学习机制,在特征空间中对齐学生模型与教师模型的表征,从而将教师模型从多模态数据中学习到的复杂时空非线性知识高效地蒸馏至极简架构的学生模型中。最终,该方法在参数量和内存消耗上实现了数量级的降低,确保了学生模型能够轻松部署于边缘路由器、低功耗监控探针等资源受限设备上,同时,其流量恢复精度接近甚至媲美复杂度极高的教师模型,在低采样率下显著优于传统的凸优化基线方法,从而在边缘网络环境下实现了高精度、低延迟的网络流量在线补全与监测。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122909025A_ABST
    Figure CN122909025A_ABST
Patent Text Reader

Abstract

The application provides a lightweight multi-modal network flow tensor completion method based on contrast learning and knowledge distillation, constructs a high-precision teacher model based on tensor outer product and a time series convolution network, and a lightweight student model based on feature splicing and an attention mechanism, and innovatively introduces a probabilistic sparse multi-head self-attention mechanism to realize efficient migration of historical embedding; through embedding contrast learning mechanism, the representation of the student model and the teacher model are aligned in the feature space, so that the complex spatio-temporal nonlinear knowledge learned by the teacher model from the multi-modal data is efficiently distilled into the student model with a minimalist architecture, the method realizes an order of magnitude reduction in parameter quantity and memory consumption, ensures that the student model can be easily deployed on resource-constrained devices such as edge routers and low-power monitoring probes, and realizes high-precision, low-delay online network flow completion and monitoring in an edge network environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network traffic monitoring and data processing technology, and in particular to a lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation. Background Technology

[0002] Network traffic monitoring services play a crucial role in network management for big data centers and cloud services. High-precision network traffic monitoring not only ensures high-quality network service development but also effectively strengthens network security capabilities. In traffic engineering and anomaly detection tasks, the effectiveness of algorithms largely depends on the completeness and accuracy of network traffic measurements. Complete global network traffic data provides invaluable decision support for network bottleneck analysis, fault location, security auditing, and network resource scheduling. However, in practical deployments, due to missing infrastructure information, high costs of end-to-end full measurement, and unavoidable packet transmission losses, real-world network monitoring systems often only acquire highly incomplete and sparse traffic data. Therefore, how to accurately recover complete global traffic data from these sparse observations is a core problem that urgently needs to be solved in this field.

[0003] Currently, tensor completion methods are widely used to recover missing network traffic data. Existing tensor completion models mostly employ simple interaction functions based on inner products, which can only capture shallow linear correlations between features, ignoring complex nonlinear dependencies hidden across dimensions. To overcome this deficiency, some studies have attempted to introduce multimodal information fusion techniques, such as tensor outer products and spatiotemporal convolutional networks, to effectively mine high-order features across dimensions, thereby significantly improving the model's recovery performance. However, these high-precision methods often come with a sharp increase in storage and computational costs, a problem particularly prominent in edge networks with limited hardware and computing resources. Furthermore, meta-learning mechanisms introduced to address temporal dependencies, while achieving "warm start" of new stages by extracting commonalities in embeddings from adjacent stages, rely on backpropagation to dynamically update complex meta-learning network parameters. This not only increases peak memory pressure but also introduces significant computational costs, making direct deployment on edge devices difficult. Simple transfer learning, on the other hand, faces convergence difficulties due to time-slice embedding "misalignment." For example, the existing patent CN121585453A discloses a method for data completion using pairwise outer products, but its computational complexity is still relatively high.

[0004] Therefore, there is an urgent need in this field for a lightweight network traffic tensor completion method that can significantly reduce computation and storage overhead while ensuring high-precision traffic recovery, and is applicable to resource-constrained edge network environments. Summary of the Invention

[0005] The purpose of this invention is to provide a lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation, so as to solve the problems existing in the prior art.

[0006] To achieve the above objectives, the present invention provides the following solution: This invention provides a lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation, comprising: Acquire sparse observation data of online network traffic and use a probabilistic sparse multi-head self-attention mechanism to embed and transfer features from historical stages to the current stage to generate an initial embedding matrix; Based on the initialization embedding matrix, spatiotemporal features are extracted through tensor outer product and temporal convolutional network to construct a multimodal fusion teacher model; Based on the initial embedding matrix, a lightweight student model is constructed by performing lightweight feature fusion through feature concatenation and attention mechanisms. Based on the teacher model and student model, with the goal of minimizing the overall end-to-end loss, an embedded contrastive learning mechanism is introduced to collaboratively train the parameters of the teacher model and student model. Based on the trained lightweight student model, online completion prediction is performed on the missing entries of the network traffic tensor at the current stage.

[0007] Preferably, the historical stage features are embedded and transferred to the current stage using a probabilistic sparse multi-head self-attention mechanism, generating an initial embedding matrix including: The historical time slice embeddings obtained from the previous training stage are concatenated with the randomly initialized time slice embeddings from the current stage to obtain a concatenation matrix. The concatenated matrix is ​​input into the probabilistic sparse multi-head self-attention module, which retains only the active query rows that rank highest under the sparsity measurement, and calculates the similarity scores of queries, keys, and values. The output of the multi-head self-attention is linearly projected, and the row corresponding to the current stage is truncated and used as the time slice feature embedding after transfer. Perform the same operation on the feature embeddings of the source node and the target node, and merge them to generate the initial embedding matrix for the current stage.

[0008] Preferably, constructing a multimodal fusion teacher model includes: For each given observation index, extract the source node embedding, the target node embedding, and multiple time slice embeddings within the time window; Calculate the tensor outer product of the source node embedding, the target node embedding, and the embeddings of each time slice within the time window to generate multiple three-dimensional outer product feature tensors; To extract its spatiotemporal coupling features, this paper reduces its dimensionality to a two-dimensional matrix through spatial dimension fusion. Then, a two-dimensional temporal convolutional network with a dilation factor is used to extract deep spatiotemporal coupling features from the three-dimensional outer product feature tensor to generate a feature map. An attention layer is applied after the feature map to assign weights, and the weighted sum is then passed through a multilayer perceptron to obtain the final fused features and traffic prediction values ​​of the teacher model.

[0009] Preferably, constructing a lightweight student model includes: For each given observation index, extract the corresponding source node embedding, target node embedding, and time slice embedding; The three extracted embeddings are directly dimensionality-reduced and concatenated to form a joint context vector; Based on the joint context vector, the attention weights of the source node, target node, and time slice are calculated through linear transformation and the Softmax function. Based on the attention weights, the source node embedding, target node embedding, and time slice embedding are weighted and summed to generate the final fusion features of the student model, and the traffic prediction value of the student model is obtained through a multilayer perceptron.

[0010] Preferably, the overall end-to-end loss function is expressed as: ; in, Here, represents the reconstruction loss of the teacher model and the student model based on the observed data, and represents the contrast loss weighting coefficients. To embed the contrastive learning loss, The regularization loss is denoted by parameter .

[0011] Preferably, the step of calculating the embedding contrastive learning loss includes: Under the same data index, the final fusion features of the teacher model and the final fusion features of the student model are defined as positive sample pairs; Sample negative samples from the output features of other non-corresponding indices of the teacher model; The loss function is estimated by information noise contrast. Based on the positive sample pairs and negative samples, the similarity gap between the student model anchor point and the teacher model positive sample is reduced in the feature space, while the gap with the negative sample is widened.

[0012] Preferably, the method further includes: performing collaborative training of the teacher model and the student model in the cloud or on a server with computing power; after training, deploying a lightweight student model with fewer parameters to a resource-constrained edge network device for online traffic completion.

[0013] Preferably, the probabilistic sparse multi-head self-attention mechanism measures the activity of its attention pattern by comparing the maximum similarity of each query with the average similarity of all keys, and retains only active queries for computation.

[0014] This invention also provides a lightweight multimodal network traffic tensor completion system based on contrastive learning and knowledge distillation, comprising: The embedding transfer module is configured to use a probabilistic sparse multi-head self-attention mechanism to embed and transfer features from historical stages to the current stage, generating an initial embedding matrix. The multimodal fusion teacher model is configured to extract spatiotemporal features based on the initial embedding matrix by using tensor outer product and temporal convolutional network. The lightweight student model is configured to perform lightweight feature fusion based on the initial embedding matrix through feature concatenation and attention mechanisms. The collaborative training module is configured to minimize the overall end-to-end loss by introducing an embedded contrastive learning mechanism to collaboratively train the parameters of the teacher model and the student model. The online completion module is configured to perform online completion prediction of missing entries in the network traffic tensor at the current stage, based on a trained lightweight student model.

[0015] The present invention also provides a computer device, including a memory, a processor, and program instructions stored in the memory that can be executed by the processor, wherein the processor executes the program instructions to implement the steps of a lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation.

[0016] The present invention achieves the following beneficial technical effects compared to the prior art: This invention provides a lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation, which has outstanding substantive features and significant progress. This invention constructs a high-precision teacher model based on tensor outer product and temporal convolutional networks, and a lightweight student model based on feature concatenation and attention mechanisms. It innovatively introduces a probabilistic sparse multi-head self-attention mechanism to achieve efficient transfer of historical embeddings, solving the problem of hot-start difficulties caused by temporal misalignment in existing technologies. Simultaneously, by embedding a contrastive learning mechanism, this invention aligns the representations of the student model and the teacher model in the feature space, thereby efficiently distilling the complex spatiotemporal nonlinear knowledge learned by the teacher model from multimodal data into the minimalist student model architecture. Ultimately, this method achieves an order-of-magnitude reduction in parameter count and memory consumption, ensuring that the student model can be easily deployed on resource-constrained devices such as edge routers and low-power monitoring probes. Furthermore, its traffic recovery accuracy is close to or even comparable to that of highly complex teacher models, and it significantly outperforms traditional convex optimization baseline methods at low sampling rates. Thus, it achieves high-precision, low-latency online network traffic completion and monitoring in edge network environments. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the system framework of the knowledge distillation-based multimodal network traffic tensor completion method according to an embodiment of the present invention; Figure 2 This is a comparison diagram of the knowledge transfer and meta-embedding learning mechanisms in embodiments of the present invention; Figure 3 This is a comparison diagram of the forward propagation architecture of the teacher model and the student model in an embodiment of the present invention; Figure 4 This is a performance comparison chart of the teacher model and student model in this embodiment of the invention with the traditional baseline based on convex optimization on three datasets. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] The purpose of this invention is to provide a lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation to solve the problems existing in the prior art.

[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0022] Example 1: Network traffic measurement is essential data in current network operation and maintenance management. With the continuous improvement of infrastructure, current networks are becoming increasingly complex and massive, making them difficult to fully observe. Obtaining full data through intensive end-to-end monitoring is impractical. Previous research on tensor completion has used only the most basic dot product form for embedded interactions, capturing only simple correlations while ignoring the correlations between different feature dimensions hidden within the data. Using multimodal fusion modules for deep interactions such as tensor outer products inevitably introduces catastrophic computational burdens and memory overhead, severely limiting deployment on edge network devices. This invention discloses a lightweight multimodal tensor completion method based on knowledge distillation, which maintains excellent traffic recovery accuracy while meeting the needs of resource-sensitive scenarios.

[0023] This embodiment aims to achieve both high-precision multimodal inference and lightweight inference in an environment where both computing and storage resources are limited. For example... Figure 1 As shown, this embodiment proposes a lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation. The method first acquires sparse observation data of online network traffic and uses a probabilistic sparse multi-head self-attention mechanism to embed features from historical stages into the current stage, generating an initial embedding matrix. Then, based on this initial embedding matrix, spatiotemporal features are extracted through tensor outer product and a temporal convolutional network to construct a multimodal fusion teacher model. Simultaneously, based on this initial embedding matrix, lightweight feature fusion is performed through feature concatenation and an attention mechanism to construct a lightweight student model. Furthermore, based on the teacher and student models, with the optimization objective of minimizing the overall end-to-end loss, an embedding contrastive learning mechanism is introduced to collaboratively train the parameters of the teacher and student models. Finally, based on the trained lightweight student model, online completion prediction is performed for missing entries in the network traffic tensor of the current stage.

[0024] To address the temporal misalignment issue caused by directly reusing historical information, this system employs Probability Sparse Multi-Head Attention (PSMHA) in the transfer module to reorder time-slice embeddings. Taking time-slice embedding as an example, this method receives the complete embedding matrix of the historical stages and the current sparse observation tensor, concatenates the time-slice embeddings from the previous stage with the current normally distributed initial embedding, and obtains the concatenated matrix. Specifically, taking time-slice embedding as an example, first let... For a random initialization of the normal distribution, then... and And newly arrived observable data is input into the probabilistic sparse multi-head self-attention. First, the time slices from the previous stage are embedded... Embedding at the current stage Connect to obtain Then, the spliced ​​matrix The input is fed into the PSMHA module. An intermediate representation can be obtained. , ,in , ,as well as .here, , ,and It is a trainable projection matrix of queries, keys, and values. This represents the key / query dimension for each header.

[0025] The probabilistic sparse multi-head self-attention module is defined as follows: ;in Is with Row sparse matrices of the same size are retained only in the sparsity measurement. Next ranking The query row. It is the number of selected (most active information) query rows obtained through probabilistic sparse multi-head self-attention. The Each element can be calculated as: ;in and Indicates corresponding to and The row and number The column vector of the row. Intuitively The similarity of the first bond is measured by comparing its maximum similarity with the average similarity of all bonds. The activity level of the attention patterns of each query, therefore only queries with active and highly informative attention distributions are retained, can be represented as: Finally, the corresponding dimensions are extracted to generate the initial embedding matrix after knowledge transfer. This design retains the fast convergence advantage of warm-starting with historical information while completely avoiding the computational overhead required to update the massive meta-network.

[0026] In the teacher network, after acquiring features from the source node, target node, and time window by embedding a transfer learning module, a high-dimensional three-dimensional fused feature tensor is explicitly generated using tensor outer product operations. Subsequently, a temporal convolutional network (TCN) is used to extract deep spatiotemporal features from this three-dimensional tensor. Specifically, the input... Index, and time slice window The size of the vector is used to obtain the spatial embedding vector. , and embedding vector within the time window As shown in the teacher model in the figure, for each time slice Calculate its corresponding outer product tensor: This is how you can get A three-dimensional tensor Next, these tensors are aggregated using a three-layer network to obtain the final predicted value. In the specific implementation, a learnable linear projection is used to map the first two dimensions, namely the source node and the target node, to a unified spatial feature dimension. The rows of the resulting matrix represent the fused spatial features, and the columns represent the temporal dimension features, thus realizing a two-dimensional structured representation. An expansion factor is applied to control the temporal convolution operation of the receptive field, and an attention layer is introduced after the TCN layer to assign similarity weights to different time slices of the sequence and perform weighted summation, thereby fully capturing cross-dimensional nonlinear correlations.

[0027] To adapt to edge deployment, the student model abandons expensive tensor outer products and TCN convolution operations. Instead, for a given source node, target node, and time slice, it directly extracts the corresponding feature vectors, performs vector dimensionality reduction, and concatenates them to form a joint context vector. Then, a simple linear transformation and the Softmax function are used to calculate the attention scalar weights corresponding to the three dimensions, and finally, a weighted sum is obtained to obtain the final hidden feature embedding of the lightweight student model. This process can be expressed by the formula... This minimalist architecture significantly reduces the number of model parameters and inference latency.

[0028] To enable the knowledge learned by the teacher model to effectively guide the student model, this invention designs a multi-task loss function, including a reconstruction loss (mean squared error) for accurately fitting the observed data, and an embedding contrastive learning loss to bridge the feature space distance. The overall end-to-end loss function can be expressed as: ;in, Here, represents the reconstruction loss of the teacher model and the student model based on the observed data, and represents the contrast loss weighting coefficients. To embed the contrastive learning loss, The regularization loss is denoted by parameter .

[0029] In contrastive learning, the corresponding node embeddings obtained from training the teacher model are used as positive samples, the node embeddings of the corresponding indices in the student model are used as anchor points, and the embeddings of other nodes in the teacher model are used as negative samples. Specifically, under the same data index, the final fused features of the teacher model and the final fused features of the student model are defined as positive sample pairs. Negative samples are sampled from the output features of other non-corresponding indices of the teacher model. The Information Noise Contrastive Estimation (InfoNCE) loss function is used as the contrastive loss function to reduce the similarity gap between the student model anchor points and the teacher model positive samples in the feature space, while simultaneously widening the gap with the negative samples. The specific formula is as follows: ;in, For training batch size, This represents the cosine similarity between the mapped feature vectors of the student model anchor points and the positive samples of the teacher model at the corresponding index. The cosine similarity represents the feature vectors of other negative samples in the teacher model. Temperature is a hyperparameter. By minimizing the contrast loss, the representation space of the lightweight student model is precisely aligned with that of the teacher model, thereby maintaining extremely high completion accuracy while maximally compressing the model size.

[0030] Specifically, the lightweight multimodal network traffic tensor completion method based on knowledge distillation proposed in this embodiment operates as follows: First, the method receives the current stage observation tensor and historical embedding data, and initializes the embedding parameters of the teacher model and student model. During model training, parameter optimization is achieved through the following steps: First, data batches are sampled from the observation tensor; second, a forward propagation operation combining outer product and temporal convolutional network is performed on the teacher model to generate teacher predictions and fusion features; third, a forward propagation operation combining splicing and multilayer perceptron is performed on the student model to generate student predictions and fusion features; fourth, the reconstruction loss, the InfoNCE contrast loss for constructing positive and negative samples based on the teacher and student fusion features, and the regularization loss are calculated respectively, and the three are superimposed to obtain the overall loss function; fifth, the parameters of the teacher model and student model are collaboratively updated using the backpropagation algorithm. After training is completed, the optimized lightweight student model is used to perform global traffic tensor completion processing on all missing entries in the observation tensor, finally outputting the complete completion result. In practical deployments, teacher and student models can be trained collaboratively in the cloud or on servers with computing power. After training, a lightweight student model with fewer parameters can be deployed to resource-constrained edge network devices for online traffic completion.

[0031] like Figure 4 As shown, the performance of the teacher and student models obtained in this invention is compared with the traditional baseline based on convex optimization on three datasets. For Figure 4 The performance of this invention and three baselines based on convex optimization were compared on three datasets with sampling rates ranging from 2% to 10%. Representative convex optimization methods include High Accuracy Low Rank Tensor Completion (HaLRTC), which utilizes Nesterov smoothing to transform multiple interdependent non-smooth terms into smooth terms, thereby accelerating the optimization process with the help of gradient information. This avoids the use of costly Singular Value Decomposition (SVD) to solve subproblems, thus reducing computational complexity. Trace Norm Regularized Canonical Polyyadic Completion (TNCP) is an efficient algorithm developed based on the alternating direction multiplier method. Furthermore, Fast Low Rank Tensor Completion (FaLRTC) employs a smoothing technique to transform the original non-smooth problem into a smooth problem, in order to utilize gradient information to accelerate the optimization process. The KDMTC method of this invention achieves the lowest normalized mean absolute error, normalized root mean square error, and KL divergence on all datasets. For example, on the Abilene dataset with 2% observations, the teacher model has a normalized mean absolute error of 0.235, a normalized root mean square error of 0.251, and a KL divergence of 0.061, while the optimal convex baseline only reaches 0.959, 0.834, and 1.150, respectively. Similar trends are maintained on the GEANT and WS-DREAM datasets, indicating that conventional convex optimization is difficult to capture complex spatiotemporal correlations at low sampling ratios in real-world datasets.

[0032] The number of parameters in the teacher model and the student model obtained by this invention are compared, and the evaluation results are shown in the table below:

[0033] As shown in the table, the student model is significantly lighter than the teacher model on all three datasets, with parameter reduction rates ranging from 46.2% to 88.9%. The reduction rate for WS-DREAM is relatively lower due to its larger number of nodes resulting in a larger embedding matrix, but the absolute number of parameters is still reduced by 1.8M, significantly lowering storage requirements.

[0034] The memory consumption of the teacher model and the student model obtained by this invention is compared, and the evaluation results are shown in the table below:

[0035] This table shows the peak memory consumption for the three datasets at a batch size of 256. The student model significantly reduces memory requirements across all datasets, with reductions ranging from 528 to 9557 times. While the WS-DREAM dataset still exhibits a larger embedding matrix due to its higher node count, its memory consumption is still two orders of magnitude lower than the teacher model. This makes the student model of this invention well-suited for memory-constrained edge devices.

[0036] When performing network traffic analysis on edge routers or low-power monitoring probes, the method described in this embodiment first utilizes historical data from the previous monitoring cycle to generate a warm-start embedding for the current cycle through an attention mechanism. Subsequently, a joint teacher-student distillation training is performed on the cloud or a server with sufficient computing power. The highly complex teacher model captures complex spatiotemporal traffic patterns, and this knowledge is compressed into a student model using only vector concatenation through feature contrast loss. After training, the edge monitoring device only needs to load a lightweight student model with less than 15% of the parameters of the original model. When extremely sparse traffic segments are collected in real time, the lightweight student model can quickly and with low memory usage infer the globally complete traffic matrix, effectively supporting downstream network congestion diagnosis and abnormal attack detection.

[0037] The advantage of this embodiment is that it solves the problem of edge deployment difficulties caused by blindly increasing model depth in order to improve accuracy in existing work. This embodiment innovatively introduces knowledge transfer to solve the time misalignment problem of historical information reuse; it uses a large-scale high-performance teacher model to extract nonlinear spatiotemporal features and uses comparative learning to accurately guide the minimalist spliced ​​student model. While the number of parameters and peak memory consumption decrease by orders of magnitude, it still maintains high traffic recovery accuracy at the level of multimodal fusion.

[0038] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0039] It should be noted that the components mentioned in the above embodiments are all general standard parts or components known to those skilled in the art. Their structures and principles can be learned by those skilled in the art through technical manuals or conventional experimental methods.

[0040] This invention has illustrated its principles and implementation methods using specific examples. The descriptions of these embodiments are merely illustrative of the method and its core ideas; furthermore, those skilled in the art will recognize that modifications may be made to the specific implementation methods and application scope based on the principles of this invention. Therefore, the content of this specification should not be construed as limiting the invention.

Claims

1. A lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation, characterized in that, include: Acquire sparse observation data of online network traffic and use a probabilistic sparse multi-head self-attention mechanism to embed and transfer features from historical stages to the current stage to generate an initial embedding matrix; Based on the initialization embedding matrix, spatiotemporal features are extracted through tensor outer product and temporal convolutional network to construct a multimodal fusion teacher model; Based on the initial embedding matrix, a lightweight student model is constructed by performing lightweight feature fusion through feature concatenation and attention mechanisms. Based on the teacher model and student model, with the goal of minimizing the overall end-to-end loss, an embedded contrastive learning mechanism is introduced to collaboratively train the parameters of the teacher model and student model. Based on the trained lightweight student model, online completion prediction is performed on the missing entries of the network traffic tensor at the current stage.

2. The lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation according to claim 1, characterized in that, The probabilistic sparse multi-head self-attention mechanism is used to transfer the embeddings of historical stages to the current stage, generating an initial embedding matrix including: The historical time slice embeddings obtained from the previous training stage are concatenated with the randomly initialized time slice embeddings from the current stage to obtain a concatenation matrix. The concatenated matrix is ​​input into the probabilistic sparse multi-head self-attention module, which retains only the active query rows that rank highest under the sparsity measurement, and calculates the similarity scores of queries, keys, and values. The output of the multi-head self-attention is linearly projected, and the row corresponding to the current stage is truncated and used as the time slice feature embedding after transfer. Perform the same operation on the feature embeddings of the source node and the target node, and merge them to generate the initial embedding matrix for the current stage.

3. The lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation according to claim 1, characterized in that, Constructing a multimodal fusion teacher model includes: For each given observation index, extract the source node embedding, the target node embedding, and multiple time slice embeddings within the time window; Calculate the tensor outer product of the source node embedding, the target node embedding, and the embeddings of each time slice within the time window to generate multiple three-dimensional outer product feature tensors; To extract its spatiotemporal coupling features, this paper reduces its dimensionality to a two-dimensional matrix through spatial dimension fusion. Then, a two-dimensional temporal convolutional network with a dilation factor is used to extract deep spatiotemporal coupling features from the three-dimensional outer product feature tensor to generate a feature map. An attention layer is applied after the feature map to assign weights, and the weighted sum is then passed through a multilayer perceptron to obtain the final fused features and traffic prediction values ​​of the teacher model.

4. The lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation according to claim 1, characterized in that, Building a lightweight student model includes: For each given observation index, extract the corresponding source node embedding, target node embedding, and time slice embedding; The three extracted embeddings are directly dimensionality-reduced and concatenated to form a joint context vector; Based on the joint context vector, the attention weights of the source node, target node, and time slice are calculated through linear transformation and the Softmax function. Based on the attention weights, the source node embedding, target node embedding, and time slice embedding are weighted and summed to generate the final fusion features of the student model, and the traffic prediction value of the student model is obtained through a multilayer perceptron.

5. The lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation according to claim 1, characterized in that, The overall end-to-end loss function is expressed as follows: ; in, Here, represents the reconstruction loss of the teacher model and the student model based on the observed data, and represents the contrast loss weighting coefficients. To embed the contrastive learning loss, The regularization loss is denoted by parameter .

6. The lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation according to claim 5, characterized in that, The steps for calculating the embedding contrastive learning loss include: Under the same data index, the final fusion features of the teacher model and the final fusion features of the student model are defined as positive sample pairs; Sample negative samples from the output features of other non-corresponding indices of the teacher model; The loss function is estimated by information noise contrast. Based on the positive sample pairs and negative samples, the similarity gap between the student model anchor point and the teacher model positive sample is reduced in the feature space, while the gap with the negative sample is widened.

7. The lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation according to claim 1, characterized in that, Also includes: The teacher and student models are trained collaboratively in the cloud or on a server with computing power. After training, a lightweight student model with fewer parameters is deployed to a resource-constrained edge network device for online traffic completion.

8. The lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation according to claim 1, characterized in that, The probabilistic sparse multi-head self-attention mechanism measures the activity of its attention pattern by comparing the maximum similarity of each query with the average similarity of all keys, and retains only active queries for computation.

9. A lightweight multimodal network traffic tensor completion system based on contrastive learning and knowledge distillation, characterized in that, To implement the method according to any one of claims 1 to 8, comprising: The embedding transfer module is configured to use a probabilistic sparse multi-head self-attention mechanism to embed and transfer features from historical stages to the current stage, generating an initial embedding matrix. The multimodal fusion teacher model is configured to extract spatiotemporal features based on the initial embedding matrix by using tensor outer product and temporal convolutional network. The lightweight student model is configured to perform lightweight feature fusion based on the initial embedding matrix through feature concatenation and attention mechanisms. The collaborative training module is configured to minimize the overall end-to-end loss by introducing an embedded contrastive learning mechanism to collaboratively train the parameters of the teacher model and the student model. The online completion module is configured to perform online completion prediction of missing entries in the network traffic tensor at the current stage, based on a trained lightweight student model.

10. A computer device, comprising a memory, a processor, and program instructions stored in the memory and executable by the processor, characterized in that, The processor executes the program instructions to implement the steps of the lightweight multimodal network traffic tensor completion method based on contrastive learning and knowledge distillation as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Flow data completion method, system and device and medium

    CN121585453A