Graph contrast learning recommendation method and system based on model enhancement
Through the graph neural network encoder with dynamic selection operator number and order strategy, a diversified embedded representation is generated, which solves the shortcomings of existing graph comparison learning methods in sparse data and complex relationships, and improves the accuracy and personalization of the recommendation system.
Patent Information
- Application Number
- CN202510846369.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-24
AI Technical Summary
Existing graph comparison learning methods cannot completely retain the inherent semantic structure and are susceptible to noise interference, resulting in low recommendation accuracy and speed, and have limited effects when processing sparse data and complex user-project relationships.
Through dynamically selecting the number of operators and operator order enhancement strategies, multiple embedded representations are generated, inputted to graph neural network models with different number of operators and sequences, and the preference value loss value is calculated to optimize model training and output recommended items.
It improves the accuracy and personalization of the recommendation system, avoids overfitting and noise interference, enhances the diversity of views and the stability of the model, and adapts to complex user-project relationships.
Smart Images

Figure CN120372098A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of recommendation systems, and particularly to a graph contrast learning recommendation method and system based on model enhancement. Background Art
[0002] Model enhancement refers to using some additional mechanisms or methods to improve the performance of the original model in a recommendation system or machine learning. Graph contrast learning is an unsupervised learning method commonly used for the representation learning of graph data. The core idea is to train the model by comparing different views (or enhanced graphs) of the graph, so that the model can learn effective representations of nodes and edges in the graph. A graph contrast learning recommendation method based on model enhancement refers to combining graph contrast learning and model enhancement to enable the recommendation system to more accurately predict user preferences and interests.
[0003] With the improvement of computing power and the support of large-scale data sets, contrast learning methods have gradually become a powerful tool in the field of deep learning, helping researchers learn feature representations more efficiently. By enhancing the learning of graph data, the accuracy and robustness of the recommendation system are improved, thereby providing a better user experience, which is of great significance for the recommendation system to achieve accurate recommendations.
[0004] However, in recommendation systems, most existing graph contrast learning methods (GCL) either perform random enhancements (e.g., node / edge perturbations) on the user-item interaction graph or rely on heuristic-based enhancement techniques (e.g., user clustering) to generate contrast views. These methods cannot fully preserve the inherent semantic structure and are easily affected by noise interference. In addition, existing graph contrast learning methods all use two view encoders with exactly the same neural structure and bound parameters, which may damage the diversity of enhanced views, resulting in low recommendation accuracy and speed. Furthermore, it reduces the expressive power of the model and the personalization degree of recommendations, thus having limited effects when dealing with sparse data and complex user-item relationships. Summary of the Invention
[0005] In view of the above deficiencies in the prior art, the purpose of the embodiments of the present invention is to provide a graph contrast learning recommendation method based on model enhancement, which can solve the technical problems that existing graph contrast learning methods cannot fully preserve the inherent semantic structure and are easily affected by noise interference. In addition, by using two view encoders with exactly the same neural structure and bound parameters, this may damage the diversity of enhanced views, resulting in low recommendation accuracy and speed. Furthermore, it reduces the expressive power of the model and the personalization degree of recommendations, thus having limited effects when dealing with sparse data and complex user-item relationships.
[0006] In the first aspect of the embodiments of the present invention, a graph contrast learning recommendation method based on model enhancement is proposed, including: S1: Obtain the original graph of the interaction relationship between users and items; S2: According to the original graph of the interaction relationship, generate multiple different embedding representations, that is, the enhanced graph of the original graph of the interaction relationship, through a graph neural network encoder based on the dynamic selection operator number strategy and the operator order enhancement strategy; S3: Input the original graph of the interaction relationship and the enhanced graph into graph neural network models with different operator numbers and different operator permutation orders respectively, and output the first preference value corresponding to the original graph of the interaction relationship and the second preference value corresponding to the enhanced graph; S4: Calculate the loss value of the first preference value and the second preference value; S5: Determine whether the loss value is less than the preset loss value. If so, enter step S6; otherwise, return to step S3 to retrain the graph neural network model; S6: Obtain the original graph of the real-time interaction relationship between the user and different items; S7: Input the original graph of the real-time interaction relationship into the trained graph neural network model and output the recommended items.
[0007] In the second aspect of the embodiments of the present invention, a graph contrast learning recommendation system based on model enhancement is proposed, including: a processor and a memory; The memory stores a program or instructions that can be run on the processor. When the program or instructions are executed by the processor, the steps of the graph contrast learning recommendation method based on model enhancement as in the first aspect are implemented.
[0008] In the third aspect of the embodiments of the present invention, a readable storage medium is proposed. A program or instructions are stored on the readable storage medium. When the program or instructions are executed by the processor, the steps of the graph contrast learning recommendation method based on model enhancement as in the first aspect are implemented.
[0009] The beneficial effects brought by the technical solutions provided by the embodiments of the present invention at least include: In the embodiments of the present invention, by obtaining the original graph of the interaction relationship between the user and the project, and using a graph neural network encoder based on the dynamic selection operator number strategy and the operator order enhancement strategy to enhance the original graph of the interaction relationship, the high-frequency noise is effectively alleviated. Then, the original graph of the interaction relationship and the enhanced graph are respectively input into graph neural network models with different operator numbers and different operator arrangement orders, and the first preference value corresponding to the original graph of the interaction relationship and the second preference value corresponding to the enhanced graph are output. According to the loss values of the first preference value and the second preference value, it is judged whether the graph neural network model can enter the actual recommendation stage. Finally, the real-time original graph of the interaction relationship is obtained, and according to the trained graph neural network model, the recommended items are output, ensuring that the recommendation system can capture the subtle differences of user interests, while avoiding overfitting and noise interference, enhancing the diversity of views and the stability of the model, and improving the accuracy and personalization degree of the recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings are only for the purpose of showing specific embodiments and are not considered as a limitation of the present invention. Throughout the drawings, the same reference signs denote the same components. Obviously, the drawings described below are only some embodiments described in the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0011] Figure 1 is a schematic flowchart of a graph contrast learning recommendation method based on model enhancement provided by an embodiment of the present invention; Figure 2 is a schematic structural diagram of a graph contrast learning recommendation system based on model enhancement provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0012] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the drawings. Obviously, the described embodiments are some embodiments of the present invention, rather than all embodiments. It should be understood that these descriptions are only exemplary and are not used to limit the scope of the present invention. In combination with the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present invention.
[0013] The graph contrast learning recommendation method provided by the embodiments of the present invention will be described in detail below in conjunction with the drawings, through specific embodiments and their application scenarios.
[0014] Refer to the attached Figure 1 illustrates a schematic flowchart of a graph contrast learning recommendation method based on model enhancement provided by an embodiment of the present invention.
[0015] An embodiment of the present invention provides a graph contrast learning recommendation method based on model enhancement, which may include the following steps: S1: Obtain the original graph of the interaction relationship between users and items.
[0016] Among them, the interaction relationship between users and items refers to the interaction behaviors between users and items (such as goods, movies, services, etc.). These interaction relationships can be manifested in forms such as clicks, purchases, ratings, comments, etc., reflecting users' interests and preferences for items.
[0017] Specifically, in a recommendation system, the interaction relationship can be represented by a graph structure, where nodes represent users and items, and edges represent the interaction relationship between users and items. The original graph is a basic graph constructed based on actual interaction data without any transformation or enhancement.
[0018] It should be noted that by constructing the interaction relationship graph between users and items, complex user preferences can be intuitively and systematically represented. This graph structure can not only effectively capture the association between users and items but also provide a clear data basis for subsequent recommendation models.
[0019] S2: According to the original graph of the interaction relationship, generate multiple different embedding representations, that is, enhanced graphs of the original graph of the interaction relationship, through a graph neural network encoder based on a dynamic selection operator number strategy and an operator order enhancement strategy.
[0020] Among them, an operator refers to an operation used to update the node representation in a graph neural network (such as graph convolution, pooling, etc.).
[0021] Among them, the dynamic selection operator number strategy is to adaptively select the number of operators used according to the specific task or the structure of the graph during the training process of the graph neural network. By flexibly adjusting how many operators to use, the model can more effectively learn the representation of the graph, avoiding overcomputation or information loss. The operator order enhancement strategy refers to changing the execution order of different operators during the training process of the graph neural network. Different operator orders may have different effects on the node representation, thus affecting the final graph embedding.
[0022] Among them, multiple different embedding representations refer to multiple graph embedding representations generated after encoding the graph through a GNN encoder, which are representations of the original graph under different enhancement strategies. Each embedding representation captures the features in the graph from different perspectives.
[0023] It should be noted that the strategy of dynamically selecting the number of operators helps to improve the robustness and generalization ability of the model, because it encourages the model to flexibly adapt and make corresponding adjustments when facing different input data. This method may significantly improve the performance of the model on diverse tasks in practical applications, especially in complex learning environments where the model needs to handle a large amount of variability and uncertainty.
[0024] In a possible implementation, S2 specifically includes: S201: Construct a graph matrix according to the original interaction graph.
[0025] Among them, the graph matrix generally refers to a matrix representation form used to represent the structure in the graph. It can be an adjacency matrix, which is used to represent the connectivity relationship between nodes in the graph.
[0026] S202: Extract the adjacency matrix and eigenvectors of the graph matrix through the approximate SVD algorithm.
[0027] Among them, the approximate SVD algorithm is a matrix decomposition method used to decompose a matrix into the product of multiple sub-matrices. SVD is widely used in recommendation systems. By decomposing the adjacency matrix, the latent features in the graph are extracted. The adjacency matrix is a matrix representing the connection relationship between nodes in the graph. The eigenvector is a vector in the matrix obtained by SVD decomposition, representing certain latent features in the data.
[0028] S203: Encode the view composed of the adjacency matrix and eigenvectors through a graph neural network encoder based on the strategy of dynamically selecting the number of operators and the strategy of enhancing the operator order to generate multiple different embedding representations, that is, the enhanced graph of the original interaction graph.
[0029] It should be noted that by constructing the graph matrix, the interaction relationship between users and items can be transformed into a matrix form, which is convenient for subsequent processing. Then, the approximate SVD algorithm extracts the adjacency matrix and eigenvectors of the graph matrix, helping to reveal the latent structure and features in the data, which is very useful for the recommendation of sparse data. Finally, by introducing a graph neural network encoder based on the number of dynamically selected operators and the operator order, the diversity of graph embeddings and the expressive ability of the model are enhanced, enabling the recommendation system to more flexibly handle complex user-item relationships and improving the accuracy and personalization of recommendations.
[0030] In a possible implementation, S202 specifically includes: S2021: Decompose the graph matrix through the approximate SVD algorithm: ; Among them, represents the graph matrix, U andV Both represent orthonormal matrices, S represents a diagonal matrix, T represents the transpose.
[0031] S2022: According to the obtained diagonal matrix, select a preset number of singular values to construct an adjacency matrix: ; where, A represents the adjacency matrix, q represents the rank of the graph matrix, i.e., the singular value.
[0032] S2023: According to the adjacency matrix, construct the eigenvectors of the graph matrix.
[0033] It should be noted that the approximate SVD algorithm decomposes the graph matrix into three matrices (U, S, V), laying a foundation for subsequent feature extraction, capable of capturing the principal components of the graph matrix. By selecting a specific number of singular values to construct the adjacency matrix, the core information of the graph structure is retained, while reducing the computational complexity and avoiding data redundancy. Finally, eigenvectors are constructed through the adjacency matrix, mapping the structural information in the graph to a low-dimensional space, making subsequent learning and embedding more efficient.
[0034] In a possible implementation manner, the strategy of dynamically selecting the number of operators specifically includes: Taking the SGC encoder as an example, the mathematical expression of the SGC encoder is specifically: ; where, f () represents the encoding of the view, X represents the feature matrix, h The operator represents the transformation layer of the graph neural network, β represents g the number of operators, represents the composite operation.
[0035] By changing the number of operators, train the SGC encoder until the maximum number of iterations is reached, end the training of the SGC encoder, and output the graph embedding: ; where, Z 1 represents the view encoding based on encoder 1, F represents the graph filtering matrix, β 1 represents the number of operators in encoder 1, W represents the linear transformation matrix, Z 2 represents the view encoding based on encoder 2, β 2 represents the number of operators in encoder 2.
[0036] It should be noted that by introducing this dynamic adjustment mechanism, it is aimed to promote the design of the encoder to develop in a more efficient and adaptable direction.
[0037] In a possible implementation manner, the operator order enhancement strategy specifically includes: Encoding the view with a view encoder of a preset number of operators: ; Wherein, f 1() represents encoding the view using encoder 1, Z 1 represents the node embedding representation after encoding, represents K α pieces g of the composition of operators, K α represents the number of times of operator composition, represents K 1 piece g of the composition of operators, represents K 2 pieces g of the composition of operators.
[0038] By changing the arrangement order of different operators, re-encoding the view: ; Wherein, f 2() represents encoding the view using encoder 2, Z 2 represents the node embedding representation, represents pieces g of the composition of operators, represents pieces g of the composition of operators, represents pieces g of the composition of operators.
[0039] It should be noted that by changing the arrangement order of different operators, it is possible to ensure that important connection relationships are retained in the topological structure of the graph, while flexibly enhancing specific features. This method not only reduces the potential risks brought by random perturbations, but also improves the robustness and accuracy of the model in downstream tasks. The design idea of this enhancement strategy is based on a deep understanding of the graph structure, aiming to optimize information transmission and feature learning by precisely controlling the application order of operators, so that the enhancement effect is more targeted and effective.
[0040] In a possible implementation manner, the calculation method for enhancing the graph is specifically: ; Among them, Z represents the enhanced graph, f ( ) represents the view encoder, X represents the feature matrix, represents K α a g composition of operators, K α represents the number of operator compositions, represents K 2 g compositions of operators, h and g both represent operators, E represents the node embedding, F represents the graph filtering matrix, W represents the weight matrix, σ represents the ReLU activation function, I represents the identity matrix, D represents the degree matrix, A represents the graph adjacency matrix.
[0041] It should be noted that in the recommendation system, the data is often sparse or incomplete. Through the enhanced view, the model can obtain more information to supplement or correct the missing parts, thereby improving the model's robustness to uncertainty and noise.
[0042] S3: Input the original graph of interaction relationship and the enhanced graph into the graph neural network models with different numbers of operators and different operator arrangement orders respectively, and output the first preference value corresponding to the original graph of interaction relationship and the second preference value corresponding to the enhanced graph.
[0043] Among them, the graph neural network (GNN) is a deep learning model specifically designed to process graph-structured data. Through operations such as graph convolution, GNN can effectively learn the relationships between nodes and the global structure of the graph. The first preference value and the second preference value refer to the predicted values of the model for the interaction between users and items. Usually, in the recommendation system, the preference value represents the user's interest or rating for a certain item.
[0044] It should be noted that by inputting the original graph and the enhanced graph into the graph neural network models with different numbers of operators and operator arrangement orders respectively, diverse preference values can be generated. This approach enhances the expressive power of the model and can capture various potential relationships in the graph structure. By changing the number and order of operators, the model can adaptively select the most effective feature representation, thereby improving the accuracy of the recommendation system and the personalized recommendation effect. This strategy improves the flexibility of the recommendation system, enabling it to better adapt to different user behaviors and item characteristics.
[0045] In a possible implementation, the first preference value and the second preference value of a user for an item are calculated by the following formula: ; where, Y represents the predicted preference of the user for the item, i.e., the rating matrix, Z (u) represents the matrix composed of the final embedding vectors of all users, T represents the transpose, Z (v) represents the matrix composed of the final embedding vectors of all items.
[0046] S4: Calculate the loss value of the first preference value and the second preference value.
[0047] where, the loss value (or loss function) is used to measure the difference between the model prediction result and the true result. The loss value is calculated based on the difference between the first preference value and the second preference value, and is used to guide the direction of model optimization.
[0048] It should be noted that by calculating the loss value between the first preference value and the second preference value, the model can quantify the difference between the original graph and the enhanced graph, thereby effectively optimizing the graph neural network. In this way, the model can continuously adjust the weights during the training process, making the prediction results of the two views as close as possible, and improving the accuracy and robustness of the recommendation system.
[0049] In a possible implementation, the specific formula for calculating the loss value is: ; where, L represents the loss function value, Y 1 represents the preference of the user for the item predicted based on Encoder 1, Y 2 represents the preference of the user for the item predicted based on Encoder 2, min represents taking the minimum value, represents the trace of the matrix, T represents the transpose, I represents the identity matrix.
[0050] It should be noted that the loss value enables the model to better understand the relationship between different views, avoid overfitting, improve the generalization ability under different data conditions, and thus enhance the personalization and accuracy of recommendations.
[0051] S5: Determine whether the loss value is less than the preset loss value. If so, go to step S6; otherwise, return to step S3 to retrain the graph neural network model.
[0052] Among them, those skilled in the art can set the size of the preset loss value according to the actual situation, and the present invention does not make any limitations.
[0053] S6: Obtain the original graph of the real-time interaction relationship between the user and the project.
[0054] S7: Input the original graph of the real-time interaction relationship into the trained graph neural network model to output the recommended project.
[0055] It should be noted that by obtaining the original graph of the interaction relationship between the user and the project in real time, the model can reflect the changes in the user's interests in real time and make dynamic recommendations based on the latest data. This method ensures the timeliness and personalization of the recommendation system, can provide the most relevant projects based on the current behavior and interests, and avoids the problems of outdated or lagging data in traditional methods. By inputting the real-time interaction graph into the trained graph neural network, the model can make full use of the previous training experience combined with the latest user behavior data to provide more accurate and real-time recommendations for users, improving user satisfaction and the overall efficiency of the system.
[0056] In practical applications, first obtain the interaction relationship graph between the user and the project, save the graph in the form of a matrix, then use the approximate SVD algorithm to approximate the range of the input matrix with a low-rank orthonormal matrix, and then input this smaller matrix into the algorithm used in this article as the input, and use the output graph representation to predict the relationship between the next user and the project.
[0057] The beneficial effects brought by the technical solutions provided in the embodiments of the present invention at least include: In the embodiments of the present invention, by obtaining the original graph of the interaction relationship between the user and the project, and using a graph neural network encoder based on the dynamic selection operator number strategy and the operator order enhancement strategy to enhance the original graph of the interaction relationship, the high-frequency noise is effectively alleviated. Then, input the original graph of the interaction relationship and the enhanced graph into the graph neural network models with different operator numbers and different operator arrangement orders respectively, output the first preference value corresponding to the original graph of the interaction relationship and the second preference value corresponding to the enhanced graph, and judge whether the graph neural network model can enter the actual recommendation stage according to the loss values of the first preference value and the second preference value. Finally, obtain the original graph of the real-time interaction relationship, and output the recommended project according to the trained graph neural network model, ensuring that the recommendation system can capture the subtle differences in the user's interests, while avoiding overfitting and noise interference, enhancing the diversity of the view and the stability of the model, and improving the accuracy and personalization of the recommendation.
[0058] Refer to the attached Figure 2 illustrates the structural schematic diagram of a graph contrast learning recommendation system based on model enhancement provided by the embodiments of the present invention.
[0059] An embodiment of the present invention provides a graph contrast learning recommendation system 20 based on model enhancement, including: a processor 201 and a memory 202; The memory 202 stores programs or instructions that can be run on the processor 201. When the programs or instructions are executed by the processor 201, the steps of the above-mentioned graph contrast learning recommendation method based on model enhancement are implemented, and the same technical effects can be achieved. To avoid repetition, the present invention will not elaborate further.
[0060] It should be understood that the processor 201 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0061] It should also be understood that the memory 202 in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM).
[0062] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware, or any combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, or magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.
[0063] It should be understood that in various embodiments of the present invention, the sequence numbers of the above processes do not imply the order of execution. The order of execution of each process should be determined by its function and internal logic and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0064] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0065] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the devices, apparatuses, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0066] In several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.
[0067] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0068] In addition, in each embodiment of the present invention, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0069] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. With this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0070] The embodiment of the present invention provides a readable storage medium including: a program or instruction is stored on the readable storage medium. When the program or instruction is executed by a processor, it implements the steps of the above-mentioned graph contrast learning recommendation method based on model enhancement and can achieve the same technical effect. To avoid repetition, the present invention will not elaborate further.
[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A graph contrastive learning recommendation method based on model enhancement, characterized in that, Including: S1: Obtain the original graph of the interaction relationship between the user and the project; S2: According to the original graph of the interaction relationship, through a graph neural network encoder based on a dynamic selection operator number strategy and an operator order enhancement strategy, generate multiple different embedding representations, that is, the enhanced graph of the original graph of the interaction relationship; S3: Input the original graph of the interaction relationship and the enhanced graph into graph neural network models with different operator numbers and different operator arrangement orders respectively, and output the first preference value corresponding to the original graph of the interaction relationship and the second preference value corresponding to the enhanced graph; S4: Calculate the loss value between the first preference value and the second preference value; S5: Determine whether the loss value is less than a preset loss value. If so, go to step S6; otherwise, return to step S3 to retrain the graph neural network model; S6: Obtain the original graph of the real-time interaction relationship between the user and the project; S7: Input the original graph of the real-time interaction relationship into the trained graph neural network model and output the recommended project.
2. The method for graph contrastive learning recommendation based on model enhancement according to claim 1, wherein The specific content of S2 includes: S201: According to the original graph of the interaction relationship, construct a graph matrix; S202: Through the approximate SVD algorithm, extract the adjacency matrix and eigenvectors of the graph matrix; S203: Through a graph neural network encoder based on a dynamic selection operator number strategy and an operator order enhancement strategy, encode the view composed of the adjacency matrix and the eigenvectors to generate multiple different embedding representations, that is, the enhanced graph of the original graph of the interaction relationship.
3. The method for graph contrastive learning recommendation based on model enhancement according to claim 2, wherein The specific content of S202 includes: S2021: Decompose the graph matrix through the approximate SVD algorithm: ; Among them, represents a graph matrix, U and V both represent orthogonal matrices, S represents a diagonal matrix, T represents the transpose; S2022: According to the obtained diagonal matrix, select a preset number of singular values to construct the adjacency matrix: ; Among them, A represents the adjacency matrix, q represents the rank of the graph matrix, that is, the singular value; S2023: According to the adjacency matrix, construct the eigenvectors of the graph matrix.
4. The graph contrastive learning recommendation method based on model enhancement according to claim 1, wherein The dynamic selection operator number strategy specifically includes: Taking the SGC encoder as an example, the mathematical expression of the SGC encoder is specifically: ; Among them, f () represents the encoding of the view, X represents the feature matrix, h The operator represents the transformation layer of the graph neural network, β represents g the number of operators, represents the composite operation; By changing the number of operators, train the SGC encoder until the maximum number of iterations is reached, end the training of the SGC encoder, and output the graph embedding: ; Among them, Z 1 represents the view encoding based on Encoder 1, F represents the graph filtering matrix, β 1 represents the number of operators in Encoder 1, W represents the linear transformation matrix, Z 2 represents the view encoding based on Encoder 2, β 2 represents the number of operators in Encoder 2.
5. The method for graph contrastive learning recommendation based on model enhancement according to claim 1, wherein The operator order enhancement strategy specifically includes: Encode the view with a view encoder with a preset number of operators: ; Among them, f 1() represents encoding the view using encoder 1, Z 1 represents the encoded node embedding representation, represents K α a g composition of operators, K α represents the number of times of operator composition, represents K one g composition of operators, represents K two g compositions of operators; By changing the arrangement order of different operators, re-encode the view: ; Among them, f 2() represents encoding the view using encoder 2, Z 2 represents the node embedding representation, represents a g composition of operators, represents a g composition of operators, represents a g composition of operators.
6. The model-enhanced graph contrastive learning recommendation method according to claim 1, wherein The calculation method of the enhanced graph is specifically: ; Among them, Z represents the enhanced graph, f ( ) represents the view encoder, X represents the feature matrix, represents K α a g composition of operators, K α represents the number of operator compositions, represents K 2 g compositions of operators, h and g both represent operators, E represents the node embedding, F represents the graph filtering matrix, W represents the weight matrix, σ represents the ReLU activation function, I represents the identity matrix, D represents the degree matrix, A represents the graph adjacency matrix.
7. The method for graph contrastive learning recommendation based on model enhancement according to claim 1, wherein The first preference value and the second preference value of the user for the project are calculated through the following formula: ; Among them, Y represents the predicted user preference for items, that is, the rating matrix, Z (u) represents the matrix composed of the final embedding vectors of all users, T represents the transpose, Z (v) represents the matrix composed of the final embedding vectors of all items.
8. The method for graph contrastive learning recommendation based on model enhancement according to claim 1, wherein The calculation formula of the loss value is specifically: ; Among them, L represents the loss function value, Y 1 represents the user's preference for an item predicted based on Encoder 1, Y 2 represents the user's preference for an item predicted based on Encoder 2, and min represents taking the minimum value, represents the trace of a matrix, T represents the transpose, I represents the identity matrix.
9. A graph contrastive learning recommendation system based on model enhancement, characterized in that Including: A processor and a memory; The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the graph contrast learning recommendation method based on model enhancement as described in any one of claims 1 to 8 are implemented.
10. A readable storage medium, characterized in that, A program or instruction is stored on the readable storage medium. When the program or instruction is executed by the processor, the steps of the graph contrast learning recommendation method based on model enhancement as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Graph comparison representation learning method and system based on cross-granularity joint training
CN114943016A
Recommendation model training method and device based on graph contrast learning
CN115659059A
KR20240128466A