Contrast learning sequence recommendation method based on frequency domain modulation

By using frequency domain modulation and comparison learning methods in sequence recommendation, the problems of insufficient noise distinction and data sparsity in sequence recommendation are solved, and higher model stability and generalization capabilities are achieved, and the effect of personalized recommendations is improved.

CN119577263AInactive Publication Date: 2025-03-07CHONGQING UNIV OF POSTS & TELECOMM
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411608807.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing sequence recommendation method has shortcomings in dealing with sequence noise and data sparsity, making it difficult to distinguish between noise and true intention, resulting in poor model effectiveness and generalization capabilities.

Method used

The comparison learning sequence recommendation method based on frequency domain modulation is adopted, and the user's long-term dependence is extracted through the self-attention network, and the frequency domain modulation is performed in combination with the attention-induced bias network to reduce the impact of noise, and the model's understanding ability is enhanced through unsupervised contrast learning.

Benefits of technology

Effectively reduce the impact of noise on the model, improve the stability and generalization ability of the model, can more accurately capture changes in user interests, and improve the effect of personalized recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577263A_ABST
    Figure CN119577263A_ABST
Patent Text Reader

Abstract

The invention provides a sequence recommendation method based on frequency domain modulation and comparative learning. The method aims at solving the problems that in sequence recommendation, data have a large amount of noise and are sparse, and existing model prediction is smooth. The method comprises the steps that on one hand, a user sequence passes through an embedded layer, position information is introduced through absolute position coding, and long-term dependence of a user in the sequence is extracted through a multi-head self-attention network to obtain a new embedded Eattention; and on the other hand, user initial embedding is subjected to frequency domain modulation through an induction bias network. The method comprises the following steps: capturing a high-pass component and a low-pass component in user data through Fourier transform and inverse change thereof, and dynamically fusing the high-pass component and the low-pass component to obtain Et; and finally, through adaptive fusion, the Eattention and the Et are fused. Besides, in the model training process, a comparative learning thought is introduced, Eattention and Et are regarded as different enhanced views of the same sample, and the generalization ability of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a sequence recommendation technology research in the field of recommendation systems, and in particular to a contrastive learning sequence recommendation method and system based on frequency domain modulation. Background Art

[0002] Recommendation systems play an important role in modern networks. By analyzing users' historical behaviors and preferences, recommendation systems can provide personalized recommendations, enabling users to quickly find products or content they are interested in, thereby improving user experience. Sequential recommendation is an important branch of recommendation systems. Compared with traditional recommendation systems, sequential recommendation can capture the temporal information of user behavior, thereby more accurately predicting changes in user interests. However, sequential recommendation still faces many difficulties and challenges: Sequential recommendation models require a large amount of training data for training, but user data is often sparse; that is, among many items, the items that users hit are often limited. Limited effective training data will lead to unsatisfactory model effects and generalization capabilities. In addition, there is a lot of noise in user sequences that affects the model effect, such as misclick noise, outdated interest noise, redundant noise, hard noise (records caused by misclicks or system errors), soft noise (users occasionally click on items they are not interested in), etc.

[0003] Most existing studies use self-attention networks to mine long-term dependencies in user sequences to predict the content that users are interested in. However, this approach does not take into account the large amount of noise in user sequences and the fact that the model focuses more on users' long-term dependencies and ignores users' sudden interactions, resulting in overly smooth predictions.

[0004] In recent years, contrastive learning has played a significant role in solving the problem of user data sparsity in recommendation systems. Contrastive learning enhances the representation ability of items by extracting self-supervisory signals from user-item interaction data. For example, CL4SRec constructs similar sequences by randomly cropping user sequences, performing random masks, and reordering some sequences. DuoRec uses two forward passes with different Dropout masks to generate two different similar sequences. The core ideas of these methods can be summarized as two interrelated steps: first, similar sequences are generated through data enhancement strategies; then, the distance between similar sequences is minimized using contrastive learning loss. However, these methods for constructing similar sequences are insufficient in considering popularity bias and distinguishing between users' conformity motivation and their real interests, and ignore the noise problem in the sequence itself. These noises will affect the model's judgment of the user's correct preferences, causing errors in the predicted click behavior, and failing to obtain the optimal embedding expression.

[0005] Therefore, there is an urgent need to solve the technical problems of insufficient training data for recommendation models and a large amount of noise in user sequences in existing sequence recommendation methods. Summary of the invention

[0006] The current sequence recommendation method still has defects in dealing with sequence noise and data sparsity, and it is difficult to distinguish noise from true intentions from user data. The present invention aims to solve the above problems of the prior art. The present invention proposes a contrastive learning sequence recommendation method based on frequency domain modulation to solve the problems of insufficient noise distinction and sparse data in the recommendation system in the existing methods.

[0007] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0008] The present invention provides a contrastive learning sequence recommendation method based on frequency domain modulation, which comprises the following steps:

[0009] 1) Obtain user data. Obtain a recommendation system dataset containing real user data, including the sequential interaction sequence between users and products. Subsequently, the dataset will be appropriately divided and preprocessed to meet the needs of the actual task.

[0010] 2) Extract user long-term dependencies. Embed the processed sequence into expression E u Through the self-attention network, we can obtain the long-term preference embedding expression E in the user interaction sequence. attention .

[0011] 3) The processed sequence E u Frequency modulation is performed through the attention induction bias network to obtain the modulated embedding expression E t . Embedding long-term preferences into expression E attention and E t After splicing, the fused embedded expression E is obtained f .

[0012] 4) Embed the fusion into expression E f Send it to the feedforward network and calculate the loss through the CE loss function.

[0013] 5) E t and E attention It regards the images as different enhanced views of the same sequence, exploits contrastive learning, and uses the InfoNCE loss function to optimize the model.

[0014] 6) Add the InfoNCE loss and CE loss to get the final loss total , and then back-propagation is performed to optimize the model parameters.

[0015] Specifically, in step 1), we construct the initial embedding representation of user-item. The goal of SR is to predict the next interaction between a user and an item given the user's historical interaction sequence. Given a set of users U and items V, we can sort the interaction items of each user u∈U in chronological order as in represents the i-th interaction item in the user sequence, where v∈V. The purpose is to recommend items in the Top-k list as possible next items in the sequence. Formally, we predict After collecting the historical interaction sequences between users and items, we need to preprocess the data. u The maximum length N of the sequence is first truncated, the earliest item is removed, or it is filled with 0 to obtain a fixed-length sequence. Then the item embedding matrix M∈R |v|×D To make our model sensitive to the position of the item, we use position embedding to inject additional position information and obtain the embedding representation E while keeping the embedding dimension of the item embedding unchanged. u .

[0016] Specifically, the step 2) converts the initial embedding representation E with absolute position information obtained by the above operation into u Input the self-attention layer to obtain user intent information and capture the long-term dependencies in the user sequence. Specifically, Q is the query vector and K is the key vector:

[0017]

[0018] The self-attention mechanism uses the same object as the query vector, key vector, and value vector. In our case, the self-attention operation converts the initial embedding representation E u As input, it is converted into three matrices Q, K, V through linear projection and fed into the multi-head attention layer to obtain the new embedding representation E attention :

[0019] head i =SA(E p )=Attention(QW Q ,KW K ,VW V )

[0020] E attention =MultiHead(Q,K,V)=Concat(head1,head2,...,head h )W o

[0021] Where {W Q,W K ,W V ,W o}∈R D×D are all learnable weight parameters. is a scaling factor used to prevent the dot product from being too large and causing the gradient to vanish or explode.

[0022] Specifically, the step 3) performs frequency domain modulation through the attention sensing bias network to obtain the modulated embedded representation. The attention sensing bias network is divided into two steps. We u A learnable filter is used to reduce the impact of noise on the model. The specific method is to convert the time domain information of the sequence into frequency domain information through fast Fourier transform, such as the formula R = Φ(E u ), where Φ represents the fast Fourier transform. The R matrix is ​​modulated and denoised through a learnable filter Q, as shown in the formula After the modulation According to the hyperparameter c, it is divided into low-frequency components and high-frequency components. The low-frequency component of the sequence signal is defined as:

[0023]

[0024] The opposite high frequency component is expressed as:

[0025]

[0026] We transform the high-frequency component and the low-frequency component respectively through the inverse Fourier transform E = Φ -1 (R) is transformed into the corresponding time domain information E h and E l , and the low-frequency component and the high-frequency component are fused through the inductive bias network to obtain the modulated embedded expression E t =E h +βE l , where β is a learnable scalar.

[0027] Specifically, in order to alleviate the impact of data sparsity, the contrastive learning module is designed in step 4). We use unsupervised contrastive enhancement to provide semantically meaningful enhancement for a single sequence in an unsupervised manner without introducing external information. The method used is to convert E attention and the embedded representation E modulated by the attention-induced bias network t as different enhanced views of the same user history sequence. We use a contrastive loss function to distinguish whether the two representations are from the same user history sequence. To achieve this goal, we minimize the difference between different enhanced views of the same user history sequence and maximize the difference between enhanced sequences from different users. For each user, we set E attention and E tThe similar sequences are regarded as positive samples of this task. InfoNCELoss is used to calculate E attention and E t The loss between them is as follows:

[0028]

[0029] Where k is the query sample, k + is a positive sample similar to the query sample, k i are other samples that are not related to the query sample. is the temperature coefficient to prevent the model from overfitting.

[0030] Specifically, step 5) predicts the probability of the next product. This task modulates the embedded expression E in step 3 t and the embedding expression E obtained by the self-attention mechanism in step 2 attention , fused through a gating mechanism. The fused embedding expression E f It includes both the long-term preferences in the user behavior sequence and the short-term preferences of the user. The formula is as follows: is a learnable constant:

[0031]

[0032] E f Input into the feedforward network and introduce nonlinear features into the self-attention module. The formula is as follows:

[0033]

[0034] in and are all learnable parameters. Then output the result Through the residual network, as follows:

[0035]

[0036] In the last layer of the model, we calculate the user's preference score for item I from the user's historical interactions. The cross entropy (CE) loss function is usually used in SR because the next item prediction task is regarded as a classification task for the entire item set. We use CE loss to optimize the model parameters as:

[0037]

[0038] Specifically, in step 6), we compare the loss L obtained from the learning task InfoNCE And the loss L obtained from the recommendation task e Add together to get the final loss L total For back propagation, it is as follows:

[0039] L total =L InfoNCE +L e

[0040] The present invention targets the possible misclick noise, outdated interest noise, redundant noise, hard noise (records caused by misclicks or system errors), and soft noise (users occasionally click on uninterested items) in sequence recommendation, performs filtering operations through frequency domain modulation, obtains an embedded representation after smoothing the noise, reduces the impact of noise on the model, and makes the model more stable and generalizable. The sequence recommendation model based on the self-attention network will pay more attention to the items that appear more times in the user sequence, resulting in a single prediction, too smooth prediction results, and easy overfitting of the model. The present invention sets an attention sensing bias network, inputs the embedded representation after smoothing the noise into the network, and obtains high and low frequency components. By introducing high-frequency components, it helps the model to pay more attention to changes in user interests and helps to make personalized recommendations. Sequence recommendation generally has the problem of data sparsity. In order to alleviate the impact of data sparsity, unsupervised contrastive learning is introduced. Without introducing external information, by comparing different enhanced views of the same sequence, the distance between similar views is shortened, thereby improving the understanding and modeling of the user's true intentions. Compared with the traditional method of artificially constructing similar sequences through contrastive learning, the present invention constructs similar sequences by introducing embedded representations of high-frequency components and embedding representations through self-attention networks, thus avoiding the uncertainty of artificial construction. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a schematic diagram of the method flow of the present invention.

[0042] Figure 2 It is a schematic diagram of the model framework of the present invention. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0044] The present invention proposes a sequence recommendation network based on modal frequency domain modulation and contrastive learning. The main process of the method is as follows: Figure 1 The specific implementation process is as follows:

[0045] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0046] The present invention provides a contrastive learning sequence recommendation method based on frequency domain modulation, which comprises the following steps:

[0047] 1) Obtain user data. Obtain a recommendation system dataset containing real user data, including the sequential interaction sequence between users and products. Subsequently, the dataset will be appropriately divided and preprocessed to meet the needs of the actual task.

[0048] 2) Extract user long-term dependencies. Embed the processed sequence into expression E u Through the self-attention network, we can obtain the long-term preference embedding expression E in the user interaction sequence. attention .

[0049] 3) The processed sequence E u Frequency modulation is performed through the attention induction bias network to obtain the modulated embedding expression E t . Embedding long-term preferences into expression E attention and E t After splicing, the fused embedded expression E is obtained f .

[0050] 4) Embed the fusion into expression E f Send it to the feedforward network and calculate the loss through the CE loss function.

[0051] 5) E t and E attention It regards the images as different enhanced views of the same sequence, exploits contrastive learning, and uses the InfoNCE loss function to optimize the model.

[0052] 6) Add the InfoNCE loss and CE loss to get the final loss total , and then back-propagation is performed to optimize the model parameters.

[0053] Specifically, in step 1), we construct the initial embedding representation of user-item. The goal of SR is to predict the next interaction between a user and an item given the user's historical interaction sequence. Given a set of users U and items V, we can sort the interaction items of each user u∈U in chronological order as in represents the i-th interaction item in the user sequence, where v∈V. The purpose is to recommend items in the Top-k list as possible next items in the sequence. Formally, we predict After collecting the historical interaction sequences between users and items, we need to preprocess the data. u The maximum length N of the sequence is first truncated, the earliest item is removed, or it is filled with 0 to obtain a fixed-length sequence. Then the item embedding matrix M∈R|v|×D To make our model sensitive to the position of the item, we use position embedding to inject additional position information and obtain the embedding representation E while keeping the embedding dimension of the item embedding unchanged. u .

[0054] Specifically, the step 2) converts the initial embedding representation E with absolute position information obtained by the above operation into u Input the self-attention layer to obtain user intent information and capture the long-term dependencies in the user sequence. Specifically, Q is the query vector and K is the key vector:

[0055]

[0056] The self-attention mechanism uses the same object as the query vector, key vector, and value vector. In our case, the self-attention operation converts the initial embedding representation E u As input, it is converted into three matrices Q, K, V through linear projection and fed into the multi-head attention layer to obtain the new embedding representation E attention :

[0057] head i =SA(E p )=Attention(QW Q ,KW K ,VW V )

[0058] E attention =MultiHead(Q,K,V)=Concat(head1,head2,...,head h )W o

[0059] Where {W Q ,W K ,W V ,W o}∈R D×D are all learnable weight parameters. is a scaling factor used to prevent the dot product from being too large and causing the gradient to vanish or explode.

[0060] Specifically, the step 3) performs frequency domain modulation through the attention sensing bias network to obtain the modulated embedded representation. The attention sensing bias network is divided into two steps. We u A learnable filter is used to reduce the impact of noise on the model. The specific method is to convert the time domain information of the sequence into frequency domain information through fast Fourier transform, such as the formula R = Φ(E u), where Φ represents the fast Fourier transform. The R matrix is ​​modulated and denoised through a learnable filter Q, as shown in the formula After the modulation According to the hyperparameter c, it is divided into low-frequency components and high-frequency components. The low-frequency component of the sequence signal is defined as:

[0061]

[0062] The opposite high frequency component is expressed as:

[0063]

[0064] We transform the high-frequency component and the low-frequency component respectively through the inverse Fourier transform E = Φ -1 (R) is transformed into the corresponding time domain information E h and E l , and the low-frequency component and the high-frequency component are fused through the inductive bias network to obtain the modulated embedded expression E t =E h +βE l , where β is a learnable scalar.

[0065] Specifically, in order to alleviate the impact of data sparsity, the contrastive learning module is designed in step 4). We use unsupervised contrastive enhancement to provide semantically meaningful enhancement for a single sequence in an unsupervised manner without introducing external information. The method used is to convert E attention and the embedded representation E modulated by the attention-induced bias network t as different enhanced views of the same user history sequence. We use a contrastive loss function to distinguish whether the two representations are from the same user history sequence. To achieve this goal, we minimize the difference between different enhanced views of the same user history sequence and maximize the difference between enhanced sequences from different users. For each user, we set E attention and E t The similar sequences are regarded as positive samples of this task. InfoNCELoss is used to calculate E attention and E t The loss between them is as follows:

[0066]

[0067] Where k is the query sample, k + is a positive sample similar to the query sample, k i are other samples that are not related to the query sample. is the temperature coefficient to prevent the model from overfitting.

[0068] Specifically, step 5) predicts the probability of the next product. This task modulates the embedded expression E in step 3 t and the embedding expression E obtained by the self-attention mechanism in step 2 attention , fused through a gating mechanism. The fused embedding expression E f It includes both the long-term preferences in the user behavior sequence and the short-term preferences of the user. The formula is as follows: is a learnable constant:

[0069]

[0070] E f Input into the feedforward network and introduce nonlinear features into the self-attention module. The formula is as follows:

[0071]

[0072] in and are all learnable parameters. Then output the result Through the residual network, as follows:

[0073]

[0074] In the last layer of the model, we calculate the user's preference score for item I from the user's historical interactions. The cross entropy (CE) loss function is usually used in SR because the next item prediction task is regarded as a classification task for the entire item set. We use CE loss to optimize the model parameters as:

[0075]

[0076] Specifically, in step 6), we compare the loss L obtained from the learning task InfoNCE And the loss L obtained from the recommendation task e Add together to get the final loss L total For back propagation, it is as follows:

[0077] L total =L InfoNCE +L e

[0078] The present invention targets the possible misclick noise, outdated interest noise, redundant noise, hard noise (records caused by misclicks or system errors), and soft noise (users occasionally click on uninterested items) in sequence recommendation, performs filtering operations through frequency domain modulation, obtains an embedded representation after smoothing the noise, reduces the impact of noise on the model, and makes the model more stable and generalizable. The sequence recommendation model based on the self-attention network will pay more attention to the items that appear more times in the user sequence, resulting in a single prediction, too smooth prediction results, and easy overfitting of the model. The present invention sets an attention sensing bias network, inputs the embedded representation after smoothing the noise into the network, and obtains high and low frequency components. By introducing high-frequency components, it helps the model to pay more attention to changes in user interests and helps to make personalized recommendations. Sequence recommendation generally has the problem of data sparsity. In order to alleviate the impact of data sparsity, unsupervised contrastive learning is introduced. Without introducing external information, by comparing different enhanced views of the same sequence, the distance between similar views is shortened, thereby improving the understanding and modeling of the user's true intentions. Compared with the traditional method of artificially constructing similar sequences through contrastive learning, the present invention constructs similar sequences by introducing embedded representations of high-frequency components and embedding representations through self-attention networks, thus avoiding the uncertainty of artificial construction.

Claims

1. A sequence recommendation method based on frequency domain modulation and contrastive learning, characterized in that: The following steps are involved: 1) Obtain user data and construct the initial sequence of user-products based on the user data. The initial sequence is divided into a fixed length N sequence by removing the earliest item or filling it with 0 according to the length of the sequence. 2) Embed the processed sequence into the expression E u Through the self-attention network, we can obtain the long-term preference embedding expression E in the user interaction sequence. attention . 3) The processed sequence E u Frequency modulation is performed through the attention induction bias network to obtain the modulated embedding expression E t . Embedding long-term preferences into expression E attention and E t After splicing, the fused embedded expression E is obtained f . 4) Embed the fusion into expression E f Send it to the feedforward network and calculate the loss through the CE loss function. 5) E t and E attention Treat them as different enhanced views of the unified sequence, use contrastive learning, and use the InfoNCE loss function to optimize the model. 6) Add the InfoNCE loss and CE loss to get the final loss loss total .

2. The sequence recommendation method based on frequency domain modulation and contrastive learning according to claim 1, characterized in that: Step 3) includes: using an attention-sensing bias network to modulate the sequence, first using a learnable filter to embed the initial sequence into an expression E u Filter to reduce the impact of noise in the sequence. Then divide the filtered sequence into high-frequency and low-frequency components. The high-frequency and low-frequency components are fused through the gating network to obtain E t Introducing high-frequency information in the sequence in this way avoids the self-attention network paying too much attention to the low-frequency information in the sequence and ignoring the high-frequency information, thus avoiding the problem of model overfitting and overly smooth prediction.

3. The sequence recommendation method based on frequency domain modulation and contrastive learning according to claim 1, characterized in that: Step 4) includes: according to the fusion feature E obtained in step 3) f , and use it as the input of the feedforward network. In the above steps, the multi-head attention mechanism is mainly based on linear projection, and the feedforward network is used to introduce nonlinear features into the self-attention block.

4. The sequence recommendation method based on frequency domain modulation and contrastive learning according to claim 1, characterized in that: Step 5) includes: using contrastive learning method to transform E attention and step 3) in the fusion embedding expression E t As different enhanced views of the same sequence, i.e., positive samples. Sequences of different users are regarded as negative samples. Calculate the InfoNCE loss and get L InfoNCE In this way, the difference between different enhanced views of the same user's historical sequence is minimized, and the difference between enhanced sequences from different users is maximized. This helps alleviate the problem of data sparsity in sequence recommendation.

5. The sequence recommendation method based on frequency domain modulation and contrastive learning according to claim 1, characterized in that: Step 6) includes: adding the InfoNCE loss and the CE loss to obtain the final loss loss total , the loss total Perform back propagation to optimize the parameters in the model.

Citation Information

Patent Citations

  • Self-attention sequence recommendation method and system fused with feature contrast learning

    CN116150506A

  • Online platform user preference recommendation method and system based on big data processing

    CN118312676A

  • Commodity recommendation method based on comparative learning and graph attention network

    CN118350898A