Online interest group recommendation method and system based on space-frequency dual-domain contrast learning
Through the space-frequency dual-domain contrast learning framework, combined with space-domain and frequency-domain contrast learning, and using multi-layer perceptron to approximate Fourier transform, the spectrum deviation problem of the GNN model when capturing users' high-frequency interests is solved, efficient interest group recommendation is achieved, and recommendation accuracy and computational efficiency are improved.
Patent Information
- Application Number
- CN202511020976.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-07-24
AI Technical Summary
Existing GNN recommendation models have spectral bias when capturing users' high-frequency short-term interests, making it difficult to fully reflect users' dynamic interests. In addition, the high computational complexity of frequency domain analysis limits its application in large-scale networks.
A method based on space-frequency dual-domain contrastive learning is adopted to extract the user's online and offline interaction network representations respectively through graph neural network. Combining space-domain and frequency-domain contrastive learning, a multi-layer perceptron is used to approximate Fourier transform, and the frequency weighting parameters are adaptively adjusted to construct a multi-task learning framework for joint training.
It effectively integrates users' long-term and short-term interests, improves recommendation accuracy and timeliness, reduces computational complexity, and achieves refined decoupling and enhancement of users' diverse interests, significantly outperforming existing models.
Smart Images

Figure CN120541314B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer recommendation systems, and in particular to an online interest group recommendation method and system based on space-frequency dual-domain contrast learning. Background Art
[0002] Event-based social networks (EBSNs), such as Meetup and Douban, provide platforms for users to organize and participate in online and offline activities around shared interests. Within these platforms, online interest groups are central to connecting users. With the rapid expansion of these platforms, the number of interest groups has skyrocketed, and users face the challenge of finding groups that match their preferences within this vast amount of information, a phenomenon known as "information overload." Therefore, efficient and accurate interest group recommendation systems are crucial for improving user experience and platform activity.
[0003] In recent years, graph neural networks (GNNs) have achieved remarkable success in the field of recommendation systems due to their powerful ability to model graph-structured data. GNN-based recommendation models can effectively capture high-level interactions between users and items. GNN recommendation models that incorporate self-supervised learning, particularly contrastive learning, effectively alleviate the problems of sparse supervision signals and noise interference in traditional recommendation systems by constructing self-supervisory signals, thus becoming a current research hotspot.
[0004] However, existing research has found that most GNN models behave like a low-pass filter in their message-passing mechanism. This means that during the aggregate update of node representations, the model tends to smooth node features, retaining low-frequency signals in the graph while attenuating or filtering out high-frequency signals. In recommendation scenarios, signals of different frequencies often correspond to different user interest patterns: low-frequency signals typically represent stable, long-term core interests, while high-frequency signals capture dynamic, fleeting, and immediate interests. For example, a user who regularly participates in fitness activities (low-frequency interest) might temporarily join a movie discussion group (high-frequency interest) due to a friend's recommendation or the release of a popular movie.
[0005] The inherent low-pass filtering characteristics of existing GNN recommendation methods make it difficult to capture the short-term interests conveyed by high-frequency signals, resulting in "spectral bias" in recommendation results and an inability to fully reflect users' true, dynamic interests. While some studies have attempted to incorporate high-frequency information, most have failed to explicitly model and decouple the semantics of interest represented by signals at different frequencies within the GNN framework, or have relied solely on simple gating mechanisms, resulting in limited effectiveness. Furthermore, direct operations in the frequency domain (such as Fourier transforms) are often computationally expensive, limiting their practical application in large networks.
[0006] Therefore, how to design a recommendation method that can effectively model both low-frequency long-term interests and high-frequency short-term interests while taking into account computational efficiency is a technical problem that needs to be solved urgently in the current EBSN interest group recommendation field. Summary of the Invention
[0007] The main purpose of the present invention is to provide an online interest group recommendation method and system based on space-frequency dual-domain comparative learning, aiming to solve the spectrum deviation problem existing in the GNN recommendation model in the prior art, effectively integrate the long-term and short-term interests of users, and reduce the computational complexity of frequency domain analysis, thereby improving the accuracy and timeliness of recommendations.
[0008] In a first aspect, the present invention provides an online interest group recommendation method based on space-frequency dual-domain contrastive learning, comprising the following steps:
[0009] Acquire a first user representation formed in an online interaction network of a target user and a second user representation formed in an offline interaction network;
[0010] performing spatial contrastive learning, wherein the spatial contrastive learning uses the first user representation and the second user representation as complementary views for representing the same user, and enhances the first user representation and the second user representation by constructing a first contrastive loss function;
[0011] performing frequency domain contrastive learning, wherein the frequency domain contrastive learning performs a nonlinear transformation on the first user representation and the second user representation through a preset neural network model to directly approximate and generate a plurality of frequency components corresponding to the first user representation and the second user representation in the spatial domain, and constructing a second contrastive loss function based on the plurality of frequency components to decouple and enhance long-term interests and short-term interests contained in the user representations;
[0012] Based on a supervised recommendation loss function, the first contrast loss function and the second contrast loss function, a recommendation model is jointly trained, and the trained recommendation model is used to generate an online interest group recommendation list for the target user.
[0013] As an optional implementation scheme of the first aspect of the present application, the step of obtaining a first user representation formed in the online interaction network of the target user and a second user representation formed in the offline interaction network specifically includes: modeling the online interaction network as a first graph structure including user nodes and interest group nodes, and using a first graph neural network encoder to propagate and aggregate information on the first graph structure to generate the first user representation; modeling the offline interaction network as a second graph structure including user nodes and event nodes, and using a second graph neural network encoder to propagate and aggregate information on the second graph structure to generate the second user representation.
[0014] As an optional implementation of the first aspect of the present application, the step of performing spatial contrastive learning specifically includes: for any target user, forming a positive sample pair with its first user representation and the second user representation; forming a negative sample pair with the first user representation of the target user and the second user representation of other users, or forming a negative sample pair with the second user representation of the target user and the first user representation of other users; constructing the first contrast loss function to maximize the similarity of the positive sample pair in the representation space and minimize the similarity of the negative sample pair.
[0015] As an optional implementation of the first aspect of the present application, the step of performing frequency domain contrast learning specifically includes: inputting the first user representation into the preset neural network model to obtain a set of first frequency components; inputting the second user representation into the preset neural network model to obtain a set of second frequency components; in the second contrast loss function, introducing a learnable frequency weighting parameter for the comparison of each pair of frequency components, and the frequency weighting parameter is used to adaptively adjust the contribution weight of different frequency components to the total loss during the model training process.
[0016] As an optional implementation of the first aspect of the present application, the preset neural network model is a multi-layer perceptron; the multi-layer perceptron is configured to learn an optimal nonlinear mapping from a feature vector representing the user to a set of basis vectors, wherein a linear combination of the basis vectors is used to approximate a frequency domain signal obtained by eigendecomposition of a graph Laplacian matrix to avoid explicit eigendecomposition calculations.
[0017] As an optional implementation of the first aspect of the present application, it also includes: after the output layer of the multi-layer perceptron, applying a preset scaling factor to adjust the output feature dimension, wherein the value of the scaling factor is less than 1.
[0018] As an optional implementation of the first aspect of the present application, the step of jointly training the recommendation model specifically includes: using Bayesian personalized ranking loss as the supervised recommendation loss function; weighted summing the Bayesian personalized ranking loss, the first contrast loss function and the second contrast loss function to form a total loss function under a multi-task learning framework, and synchronously optimizing the recommendation task and the contrast learning task of the two domains by minimizing the total loss function.
[0019] In a second aspect, an embodiment of the present application provides an online interest group recommendation system based on space-frequency dual-domain contrastive learning, including:
[0020] A feature extraction module is used to obtain a first user representation formed in the target user's online interaction network and a second user representation formed in the offline interaction network;
[0021] a spatial domain learning module, configured to perform spatial domain contrastive learning, wherein the spatial domain contrastive learning uses the first user representation and the second user representation as complementary views for representing the same user, and enhances the first user representation and the second user representation by constructing a first contrastive loss function;
[0022] a frequency domain learning module, configured to perform frequency domain contrastive learning, wherein the frequency domain contrastive learning performs a nonlinear transformation on the first user representation and the second user representation using a preset neural network model to directly approximate multiple frequency components corresponding to the first user representation and the second user representation in the spatial domain, and constructs a second contrastive loss function based on the multiple frequency components to decouple and enhance long-term interests and short-term interests contained in the user representations;
[0023] The recommendation generation module is used to jointly train the recommendation model based on a supervised recommendation loss function, the first contrast loss function and the second contrast loss function, and use the trained recommendation model to generate an online interest group recommendation list for the target user.
[0024] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.
[0025] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] 1. Comprehensive and Dynamic Interest Capture: Through an innovative spatial-frequency dual-domain comparative learning framework, this paper effectively overcomes the low-pass filtering and spectral bias issues of traditional GNNs. The model explicitly models and distinguishes between low-frequency signals representing long-term stable preferences and high-frequency signals representing short-term dynamic needs, resulting in a more comprehensive and comprehensive user profile and recommendations that better reflect the diverse interests of users.
[0028] 2. Computationally Efficient Frequency Domain Analysis: This paper uniquely proposes using an MLP to approximate the Fourier transform, transforming the computationally complex frequency domain analysis problem into a nonlinear mapping learning problem that can be efficiently performed in the spatial domain. This significantly reduces the time complexity and enables the application of frequency domain analysis in large-scale recommendation systems, especially when using large-batch training, where its efficiency advantage is particularly prominent.
[0029] 3. Adaptive interest enhancement mechanism: The introduction of learnable weighting parameters in the frequency domain contrastive loss endows the model with an inherent adaptive ability. Without the need for artificial setting of complex rules, the model can automatically identify and enhance the most discriminative frequency components according to the characteristics of different data sets and user behavior patterns, significantly improving the generalization ability and robustness of the model.
[0030] 4. Excellent recommendation performance: By combining the two complementary self-supervised tasks of spatial information enhancement and frequency domain interest decoupling with the main recommendation task, the method of the present application can learn more informative and expressive user and item representations. Extensive experimental results on multiple real-world EBSN data sets show that the model proposed in the present application is significantly superior to the current state-of-the-art baseline models in various evaluation indicators. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is a schematic diagram of the overall architecture of the SFCL model according to an embodiment of the present application;
[0032] Figure 2 is a flowchart of an online interest group recommendation method based on spatial-frequency dual domain contrastive learning according to an embodiment of the present application;
[0033] Figure 3 is a graph of efficiency verification results of the frequency domain contrastive loss approximation method according to an embodiment of the present application;
[0034] Figure 4 is a graph of effectiveness verification results of the frequency domain contrastive loss approximation method according to an embodiment of the present application;
[0035] Figure 5 is a schematic diagram of the structure of an online interest group recommendation system based on spatial-frequency dual domain contrastive learning according to an embodiment of the present application. DETAILED DESCRIPTION
[0036] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0037] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the application can be implemented in a sequence other than those illustrated or described here. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated before and after are in a kind of "or" relationship. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically limited.
[0038] Example 1
[0039] See also Figure 1 , the online interest group recommendation model based on space-frequency dual-domain contrastive learning proposed in this paper is named SFCL. The model first captures the high-order nonlinear interactions in online and offline social networks respectively through a graph encoder, thereby achieving a comprehensive modeling of users' multi-dimensional social behaviors. Secondly, in order to mine different interest patterns, an innovative space-frequency dual-domain contrastive learning framework is proposed: (1) In the spatial domain, online and offline social networks are regarded as complementary views of users' social relationships. By constructing a cross-view contrastive loss function, the discriminability of instance representation is effectively enhanced; (2) In the frequency domain, an adaptive contrastive learning mechanism is proposed based on the characteristics of frequency signals. By introducing a learnable frequency weighting parameter in the contrastive loss, the model can autonomously identify key frequency components and suppress noise interference, ultimately achieving effective separation of different frequency components. It is worth noting that in order to solve the problem of high computational complexity of Fourier transform, a multi-layer perceptron model is constructed in the spatial domain, and the approximate solution of the feature matrix is obtained by learning the optimal linear combination of feature vectors.
[0040] To facilitate understanding, the following definitions and problem descriptions are first explained:
[0041] In EBSN, users participate in online interest groups and form an online network, which can be formalized as ,in, Represents a user collection, represents a set of online interest groups, Indicates the i interest groups, Represents the set of edges between users and interest groups. If a user joins an interest group, he is connected to the interest group through an edge. The online user network can be represented as ,in, Represents the set of edges between online users. If two users join the same interest group, they are connected by an edge. The adjacency matrix of , the corresponding degree matrix is denoted as , the normalized Laplace matrix is defined as .
[0042] In EBSN, users participate in offline events and form an offline network, which is formalized as ,in, Represents a collection of events, Indicates the i events, represents the edge set between users and events. If a user attends an event, there is an edge between the two. The offline user network is formalized as ,in, Represents the set of edges between users. If two users attend the same event, there is an edge between them. The adjacency matrix is defined as , the corresponding degree matrix is recorded as , represents the set of integers, the normalized Laplacian matrix is defined as .
[0043] In addition, will participate in the event The user is defined as a collection , interest groups The events held are defined as collections , the user The group you join is defined as a collection , the user The participating events are defined as a set . The user’s embedding matrix is also defined , the embedding matrix of interest groups and the embedding matrix of events ,in Represents the dimension of the embedding.
[0044] For target users , online network in a given event social network and offline networks ,The main goal of online interest group recommendation is to recommend K online ,groups that the user is most likely to be interested in.
[0045] The problem is formally defined as follows:
[0046] (1)
[0047] in Indicates recommendation to target users The set of K interest groups, Calculate candidate groups Prediction score on .
[0048] See also Figure 2 , which is a flowchart of an online interest group recommendation method based on space-frequency dual-domain contrastive learning provided by an embodiment of the present invention. The method may include the following steps:
[0049] S1: Obtain a first user representation formed in an online interaction network of a target user and a second user representation formed in an offline interaction network.
[0050] Online interaction network: It consists of users and the online interest groups they join. This network can be modeled as a user-interest group bipartite graph. This embodiment uses a lightweight graph convolutional network (such as LightGCN) as a graph encoder. Given randomly initialized embeddings of users and interest groups, LightGCN learns to capture the high-order connection patterns between users and interest groups through L-layer neighborhood information propagation and aggregation. The process is shown in formula (2), and the final result is an online user representation that integrates online social information. and interest group representation .
[0051] Offline interaction network: It consists of users and the offline events they participate in, and can also be modeled as a user-event bipartite graph. This embodiment uses another independent GNN encoder (the structure can be the same or different from the online encoder) and follows a similar information propagation mechanism, as shown in formula (3), to learn offline user representations that reflect users' offline activity preferences. and event representation .
[0052] Specifically, first for online networks , select the backbone network to extract user features and interest group features, the formula is as follows:
[0053] (2)
[0054] in 、 Represents online users Characterization and online interest groups Characterization of the characteristics, Represents the backbone network.
[0055] Secondly, for offline networks , and similarly select another backbone network to extract user features and event features. The formula is as follows:
[0056] (3)
[0057] in 、 Represents offline users and events The feature representation of represents the backbone network used to extract these features.
[0058] After feature extraction, the representations of all online users are stacked into a matrix (i.e., the first user representation in this embodiment), the representations of all offline users are stacked into a matrix (ie, the second user representation in this embodiment).
[0059] S2: Perform spatial contrastive learning, where the spatial contrastive learning uses the first user representation and the second user representation as complementary views for representing the same user, and enhances the first user representation and the second user representation by constructing a first contrastive loss function.
[0060] This step aims to enhance the semantic consistency and differentiation of the representations by comparing the user representations under different views. In this embodiment, the user's online representation and offline representation are regarded as two complementary "views" that describe the user's intrinsic interests.
[0061] In specific implementation, for any user , its online representation and offline representation constitutes a positive sample pair. The representation of this user is the same as the representation of any other user v (e.g. and ) constitutes a negative sample pair. Based on this, the spatial domain contrast loss is constructed as shown in formula (4) (i.e., the first contrast loss function in this embodiment):
[0062] (4)
[0063] in Represents the temperature parameter, which is used to control the distribution range of the similarity score. The larger the value, the smoother the distribution.
[0064] This loss function, based on the InfoNCE framework, aims to maximize the cosine similarity between pairs of positive examples while minimizing the similarity of all pairs of negative examples. By optimizing this loss, the model is encouraged to learn a shared semantic space that aligns different behavioral representations of the same user. Furthermore, to further improve the model's generalization capabilities, we can borrow ideas from SimGCL and apply a small, uniformly distributed random noise to the representations at each layer to create a more robust contrast view.
[0065] S3: Execute frequency domain contrastive learning, which performs nonlinear transformation on the first user representation and the second user representation through a preset neural network model to directly approximate and generate multiple frequency components corresponding to the first user representation and the second user representation in the spatial domain, and construct a second contrastive loss function based on the multiple frequency components to decouple and enhance the long-term interests and short-term interests contained in the user representations.
[0066] This step is the technical core of the present invention, and its goal is to explicitly decouple and enhance the long-term and short-term interests contained in the user representation through frequency domain analysis.
[0067] The traditional frequency domain analysis method, as shown in formulas (5)-(7), requires the normalized Laplace matrix of the graph to be Perform eigendecomposition and obtain eigenvalues And the feature vector V, then the spatial domain feature H is converted to the frequency domain through Fourier transform The computational complexity of this method is , which is totally infeasible for real EBSNs with tens of thousands or even millions of users.
[0068] In order to overcome this computational bottleneck, this paper proposes an innovative Fourier transform approximation method based on MLP. It is found that the mathematical essence of the frequency domain transform formula (13) can be regarded as a linear combination of spatial eigenvectors using a set of basis vectors (i.e., eigenvectors of the Laplace matrix). Based on this, a learnable function is proposed. To directly learn this optimal transformation basis, thus completely bypassing the eigendecomposition.
[0069] In this embodiment, this learnable function is implemented as a multi-layer perceptron (MLP) as shown in Equation (15). The MLP is based on the normalized Laplacian matrix of the graph As input, its output is a set of new vectors. Through its powerful nonlinear fitting ability, MLP learns how to project the original features into a new basis space, which can effectively separate the semantic information of different frequencies.
[0070] In order to ensure that the output feature vectors are as orthogonal as possible, a hyperparameter is introduced - the output dimension adjustment factor By setting the output dimension of MLP Being smaller than the input dimension d can effectively reduce the risk of linear correlation between output vectors and make them tend to be orthogonal, thereby better simulating the characteristics of the real Fourier basis.
[0071] In getting After outputting the feature matrix, the frequency domain contrast loss is constructed , as shown in Equation (14). This loss aligns the corresponding frequency components in the online and offline views of the same user. The parameters in Equation (14) are optimized together with the MLP model parameters, allowing the model to autonomously learn the importance of different frequencies: the model assigns greater weight to frequencies that are crucial for distinguishing user interests and less weight to frequencies that are noisy or redundant. This adaptive mechanism enables the model to demonstrate strong adaptability across different datasets.
[0072] Finally, the computation of the entire frequency domain contrast loss is done entirely in the spatial domain, and its time complexity is only related to the forward propagation of the MLP, which is much lower than .like Figure 3 The experimental results show that the running time of the approximate method of the present invention on all data sets is much shorter than that of the method based on eigendecomposition, and the efficiency advantage becomes more obvious as the batch size increases. Figure 4 Experimental results show that the performance is even better than using real, fixed high / low pass frequency bands due to the learning ability of MLP.
[0073] It should be noted that in order to verify the efficiency of approximating the frequency domain contrast loss in the spatial domain, the running time of our model (Ours) and the model based on eigenvalue decomposition (abbreviated as Decom.) are also compared on three datasets. Figure 3 It can be observed that the computation time of this model is significantly lower than that of the eigendecomposition-based method on datasets such as California (CA), New York (NY), and Texas (TX). It is particularly noteworthy that when the batch size increases from 256 to 512, a special phenomenon occurs: the running time of the eigendecomposition-based model increases instead of decreases, while this model maintains a steady downward trend. Generally speaking, increasing the batch size should improve memory utilization and thus reduce computation time. However, the eigenvalue decomposition operation introduces additional computational overhead when the batch size is larger (such as 512), which ultimately causes its processing time to be longer than that of a small batch size (256). In contrast, this method does not have this problem.
[0074] Specifically, a method based on MLP (Multi-layer Perceptron) is proposed to approximate the frequency domain contrast loss in the spatial domain. To verify the effectiveness of this method, a contrast loss is constructed on a specific frequency band. Specifically, three experimental versions are designed according to the frequency band selection method: (1) High Pass: Only the front pass with the highest eigenvalue is selected. Proportional band construction contrast loss ( ); (2) Low Pass: Only the posterior with the lowest eigenvalue is selected Proportional frequency band; (3) Rand Pass: Random selection When constructing the approximate contrast loss in the spatial domain, MLP is used to generate an equal number of "feature vectors", that is, by setting the scaling factor of the MLP output dimension Numerically equal to The recall R@k and normalized discounted cumulative gain (NDCG@k) are used to evaluate the model, where the number of interest groups in the recommendation list is The setting range is {10, 20, 30, 40}. In addition, due to the high computational complexity of directly constructing the frequency domain contrast loss, this experiment is only implemented on a small TX dataset. Figure 4 It can be seen that in most cases, the performance of this model is better than the method of directly using the specified feature vector. This is because MLP can learn to find better linear combinations instead of relying on fixed combinations, thus achieving better performance. In addition, as the ratio As increases, the performance of all models decreases slightly.
[0075] Specifically, in this step, the feature matrices of online and offline users ( 、 ) are converted to the frequency domain respectively, and the specific formulas are as follows:
[0076] (5)
[0077] (6)
[0078] (7)
[0079] in Online user network The normalized Laplace matrix of Arranged by columns The characteristic vector of The main diagonal elements are The diagonal matrix of the eigenvalues of 、 Representatives 、 A tensor of frequency spectra.
[0080] Specifically, considering that different frequency signals contain different amounts of information (high-frequency signals have less feature information, low-frequency signals have more feature information), we assign different weights to different frequency signals and define the contrast loss as follows:
[0081] (8)
[0082] in 、 is a learnable parameter whose absolute value can control the weight of the corresponding frequency in the loss function. and Represents frequency Online and offline views of When it is 0, it means that the frequency does not participate in the loss calculation; when When it is not 0, two views with the same frequency will be drawn closer. and When the product of is positive, the frequency and The view that is closer will be pushed away; otherwise, it will be brought closer.
[0083] Furthermore, in the loss function described in formula (8), and All through the matrix Obtained, and Need to The time complexity of this decomposition is In order to reduce the computation time, the loss calculation is limited to a small batch. Assume that there are For a user in a mini-batch of size B, the corresponding loss function value is calculated as follows:
[0084] (9)
[0085] (10)
[0086] (11)
[0087] (12)
[0088] in 、 、 、 、 Represent the normalized Laplace matrix, eigenvector matrix, diagonal matrix, online user matrix and offline user matrix in a mini-batch B respectively. 、 Representatives and A tensor of frequency spectra. 、 They are the frequencies in mini-batch B Online and offline views. Now the time complexity becomes .
[0089] Despite the above optimization, the time complexity is still proportional to the square of the batch size, which means that for larger batches, the performance will drop significantly and further optimization is needed. Therefore, Formula (12) is transformed as follows:
[0090] (13)
[0091] in 、 、 is a matrix No. i Column vector.
[0092] From the above formula, we can see that the process of converting user features from the spatial domain to the frequency domain can be understood as obtaining a new user representation by linearly combining user feature vectors, where the weight of the linear combination is given by Given, and There are two factors involved: 、 ,in It is from is obtained from the characteristic decomposition of is a learnable variable. Therefore, can be considered as the output of a learnable function, which is given by Decision, that is ,in Represents learnable parameters and uses a multilayer perceptron (MLP) model as the learnable function .
[0093] Given that the MLP output is difficult to meet The inherent orthogonality constraint introduces a scaling factor To reduce the output dimension ,in is the original output dimension. This reduces the risk of linear correlation in the output. Subsequently, the frequency domain loss (i.e., the second contrast loss function in this embodiment) is defined as:
[0094] (14)
[0095] in It is defined as an MLP model, and its formula is:
[0096] (15)
[0097] in ( ). This gives feature vectors. The time complexity is , than the time required for eigendecomposition This provides significant computational efficiency improvements when using larger batch sizes. Finally, the computation of the frequency contrastive loss no longer relies on the Fourier transform and is performed directly in the spatial domain.
[0098] S4: Based on a supervised recommendation loss function, the first contrast loss function and the second contrast loss function, jointly train a recommendation model, and use the trained recommendation model to generate an online interest group recommendation list for the target user.
[0099] Based on the representations of online users and interest groups, the vector inner product method is used to obtain the user's rating of the candidate interest group. The calculation method is as follows:
[0100] (16)
[0101] Bayesian Personalized Ranking Loss (BPR) is used as the supervised recommendation loss function , which is used to learn the representation of online users and interest groups, and its formula is as follows:
[0102] (17)
[0103] in, Represents a user The collection of interest groups you have joined, and Represents the remaining set of groups that have not been joined. According to the contrast loss function defined above, the final total loss function is constructed using a multi-task framework, as follows:
[0104] (18)
[0105] in and is the loss coefficient.
[0106] In summary, in this embodiment, the present invention proposes an online interest group recommendation method based on contrastive learning in the spatial-frequency dual domain. First, the method extracts multidimensional user interaction data from EBSN and performs representation learning. Specifically, the user's online interactions (e.g., joining an interest group) and offline interactions (e.g., attending an event) are constructed as independent graph structures. Using a graph neural network (GNN) encoder, such as LightGCN, information is propagated across the two graphs, capturing high-level contextual information about the user in different social scenarios. This generates a first user representation for the online interaction scenario and a second user representation for the offline interaction scenario. Second, the method performs contrastive learning in the spatial domain. The core concept is that even if a user's online and offline behaviors manifest differently, they both originate from the user's intrinsic interests and should therefore be semantically consistent. The method considers the online representation (first user representation) and offline representation (second user representation) of the same user as a positive pair, while combinations of representations from different users are considered negative pairs. By constructing and optimizing a first contrastive loss function based on InfoNCE, the model forces the positive pairs to be closer in the embedding space while pushing the negative pairs further apart. This process not only enhances the instance-level distinguishing ability of user representation, but also improves the robustness of representation by fusing multi-source information. Again, and this is the core innovation of the present invention, the method performs adaptive contrastive learning in the frequency domain. In order to avoid the high computational complexity (usually 10 ... This paper proposes an efficient approximate computation scheme. This scheme employs a pre-defined neural network model, specifically a multi-layer perceptron (MLP), to directly learn a nonlinear transformation from spatial user representations to a set of approximate "frequency components." This MLP approximates the transformation defined by the eigenvectors of the graph Laplacian matrix by learning optimal combinations of eigenvectors. This effectively generates multiple components representing different frequency information in the spatial domain, bypassing the explicit and time-consuming Fourier transform. After obtaining the approximate frequency components, the method constructs a second contrastive loss function. This loss function aims to align similar frequency components across different views (online and offline) for the same user. Furthermore, to enable adaptive learning, this loss function incorporates a learnable weighting parameter for each frequency component. During model training, these parameters are automatically adjusted based on the data and task, enabling the model to amplify key frequency signals that contribute significantly to the recommendation task (whether low-frequency signals representing long-term interests or high-frequency signals representing short-term interests) while suppressing interference from irrelevant or noisy frequencies. This achieves a refined decoupling and enhancement of diverse user interests. Finally, this method uses a multi-task learning framework to jointly optimize the entire recommendation model end-to-end. A weighted summation of a primary supervisory loss (such as the Bayesian Personalized Ranking (BPR) loss) for optimizing recommendation ranking accuracy, the aforementioned spatial first contrast loss, and the frequency domain second contrast loss is used to form the final total loss function. By minimizing this total loss, the model parameters are collaboratively updated. After training, the final learned user and interest group representations are used to calculate matching scores and generate the top K ranked interest groups for the target user as recommendations.
[0107] Example 2
[0108] See also Figure 5 , shown is a schematic structural diagram of an online interest group recommendation system based on space-frequency dual-domain contrastive learning proposed in the second embodiment of the present application. The system includes the following key modules:
[0109] A feature extraction module 100 is configured to obtain a first user representation formed in the target user's online interaction network and a second user representation formed in the offline interaction network;
[0110] a spatial domain learning module 200 configured to perform spatial domain contrastive learning, wherein the spatial domain contrastive learning uses the first user representation and the second user representation as complementary views for representing the same user and enhances the first user representation and the second user representation by constructing a first contrastive loss function;
[0111] A frequency domain learning module 300 is configured to perform frequency domain contrastive learning, wherein the frequency domain contrastive learning performs a nonlinear transformation on the first user representation and the second user representation using a preset neural network model to directly approximate multiple frequency components corresponding to the first user representation and the second user representation in the spatial domain, and construct a second contrastive loss function based on the multiple frequency components to decouple and enhance the long-term and short-term interests contained in the user representations;
[0112] The recommendation generation module 400 is used to jointly train the recommendation model based on a supervised recommendation loss function, the first contrast loss function and the second contrast loss function, and use the trained recommendation model to generate an online interest group recommendation list for the target user.
[0113] In the embodiments of the present application, an online interest group recommendation system based on space-frequency dual-domain contrastive learning can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, network attached storage (NAS), personal computer (PC), etc., which is not specifically limited in the embodiments of the present application.
[0114] In the embodiments of the present application, an online interest group recommendation system based on space-frequency dual-domain contrastive learning can be a device having an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
[0115] The online interest group recommendation system based on space-frequency dual-domain contrast learning provided by the embodiment of the present application can achieve Figure 1 In order to avoid repetition, each process of implementing the online interest group recommendation method based on space-frequency dual-domain contrast learning in the method embodiment will not be repeated here.
[0116] Optionally, the embodiments of the present application further provide an electronic device, comprising a processor, a memory, a program or instructions stored in the memory and executable in the processor, which, when executed by the processor, implement each process of the above-mentioned embodiment of the online interest group recommendation method based on space-frequency dual-domain contrast learning and achieve the same technical effects. To avoid repetition, details are not described here.
[0117] The embodiments of the present application further provide a readable storage medium having a program or instructions stored thereon, which, when executed by a processor, implement each process of the above-mentioned embodiment of the online interest group recommendation method based on space-frequency dual-domain contrast learning and achieve the same technical effects. To avoid repetition, details are not described here.
[0118] The processor is the processor of the electronic device in the above-mentioned embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, etc.
[0119] It should be noted that in this paper, the term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of another identical element in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiments of the present application is not limited to the order of performing the functions shown or discussed, but can also include performing the functions in a substantially simultaneous manner or in the opposite order, for example, the described method can be performed in an order different from that described, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.
[0120] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a more preferred embodiment. Based on this understanding, the technical solution of this application, or the part that contributes to the existing technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of this application.
[0121] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. An online interest group recommendation method based on space-frequency dual-domain contrastive learning, characterized by: The following steps are involved: Acquire a first user representation formed in an online interaction network of a target user and a second user representation formed in an offline interaction network; performing spatial contrastive learning, wherein the spatial contrastive learning uses the first user representation and the second user representation as complementary views for representing the same user, and enhances the first user representation and the second user representation by constructing a first contrastive loss function; Performing frequency domain contrastive learning, wherein the frequency domain contrastive learning performs a nonlinear transformation on the first user representation and the second user representation through a preset neural network model to directly approximate and generate multiple frequency components corresponding to the first user representation and the second user representation in the spatial domain, and constructing a second contrastive loss function based on the multiple frequency components to decouple and enhance the long-term interest and short-term interest contained in the user representation. Specifically, the frequency domain contrastive learning includes: inputting the first user representation into the preset neural network model to obtain a set of first frequency components; Inputting the second user representation into the preset neural network model to obtain a set of second frequency components; introducing a learnable frequency weighting parameter for the comparison of each pair of frequency components in the second contrast loss function, wherein the frequency weighting parameter is used to adaptively adjust the contribution weight of different frequency components to the total loss during the model training process; Based on a supervised recommendation loss function, the first contrast loss function and the second contrast loss function, a recommendation model is jointly trained, and the trained recommendation model is used to generate an online interest group recommendation list for the target user.
2. The method according to claim 1, characterized in that The step of obtaining a first user representation formed in the target user's online interactive network and a second user representation formed in the offline interactive network specifically includes: Modeling the online interaction network as a first graph structure including user nodes and interest group nodes, and performing information propagation and aggregation on the first graph structure using a first graph neural network encoder to generate the first user representation; The offline interaction network is modeled as a second graph structure including user nodes and event nodes, and a second graph neural network encoder is used to propagate and aggregate information on the second graph structure to generate the second user representation.
3. The method according to claim 1, characterized in that The steps of performing spatial domain contrastive learning specifically include: For any target user, the first user representation and the second user representation constitute a positive sample pair; Forming a negative sample pair by combining the first user representation of the target user with the second user representation of other users, or by combining the second user representation of the target user with the first user representation of other users; The first contrastive loss function is constructed to maximize the similarity of the positive sample pairs and minimize the similarity of the negative sample pairs in the representation space.
4. The method according to claim 1, wherein The preset neural network model is a multi-layer perceptron; The multilayer perceptron is configured to learn an optimal nonlinear mapping from a feature vector representing a user to a set of basis vectors, wherein a linear combination of the basis vectors is used to approximate a frequency domain signal obtained by eigendecomposition of a graph Laplacian matrix, thereby avoiding explicit eigendecomposition calculations.
5. The method according to claim 4, characterized in that Also includes: After the output layer of the multilayer perceptron, a preset scaling factor is applied to adjust the output feature dimension, wherein the value of the scaling factor is less than 1.
6. The method according to claim 1, characterized in that The steps of jointly training the recommendation model specifically include: Using Bayesian personalized ranking loss as the supervised recommendation loss function; The Bayesian personalized ranking loss, the first contrast loss function, and the second contrast loss function are weightedly summed to form a total loss function under a multi-task learning framework. The recommendation task and the contrastive learning tasks of the two domains are simultaneously optimized by minimizing the total loss function.
7. An online interest group recommendation system based on space-frequency dual-domain contrastive learning, characterized by: include: A feature extraction module is used to obtain a first user representation formed in the target user's online interaction network and a second user representation formed in the offline interaction network; a spatial domain learning module, configured to perform spatial domain contrastive learning, wherein the spatial domain contrastive learning uses the first user representation and the second user representation as complementary views for representing the same user, and enhances the first user representation and the second user representation by constructing a first contrastive loss function; A frequency domain learning module is used to perform frequency domain contrastive learning, wherein the frequency domain contrastive learning performs a nonlinear transformation on the first user representation and the second user representation through a preset neural network model to directly approximate multiple frequency components corresponding to the first user representation and the second user representation in the spatial domain, and constructs a second contrastive loss function based on the multiple frequency components to decouple and enhance the long-term interests and short-term interests contained in the user representations; specifically comprising: inputting the first user representation into the preset neural network model to obtain a set of first frequency components; inputting the second user representation into the preset neural network model to obtain a set of second frequency components; in the second contrastive loss function, introducing a learnable frequency weighting parameter for the comparison of each pair of frequency components, wherein the frequency weighting parameter is used to adaptively adjust the contribution weight of different frequency components to the total loss during the model training process; The recommendation generation module is used to jointly train the recommendation model based on a supervised recommendation loss function, the first contrast loss function and the second contrast loss function, and use the trained recommendation model to generate an online interest group recommendation list for the target user.
8. An electronic device, characterized in that: The invention comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the online interest group recommendation method based on space-frequency dual-domain contrastive learning as described in any one of claims 1 to 6 are implemented.
9. A readable storage medium, characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the online interest group recommendation method based on space-frequency dual-domain contrastive learning as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Long-term and short-term interest comparative learning method under sequence recommendation
CN117076760A
Online interest group recommendation method based on self-attention and contrast learning
CN117171447A