Agricultural product recommendation method and system based on multi-source incidence relation graph fusion
By constructing multi-source association graphs and heterogeneous graphs, combining sparse graph aggregation and self-attention mechanisms, and using the Bayesian personalized ranking method, the problem of inaccuracy in existing agricultural product recommendations is solved and more accurate and personalized the recommendation effect.
Patent Information
- Application Number
- CN202410713240.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-09-27
AI Technical Summary
Existing agricultural product recommendation methods have inaccuracies in comprehensively considering the intuitive relationships between agricultural products, deep user feature learning, and multi-modal data fusion, resulting in inaccurate recommendation results.
Using a method based on multi-source association graphs, by constructing an isomorphic graph of agricultural product association relations and a heterogeneous graph of user-agricultural products, combined with sparse graph aggregation and self-attention mechanism, user preference characteristics are captured, and the Bayesian personalized ranking method is used. Model training enables users to make personalized recommendations for agricultural products.
It improves the accuracy of recommendation results, alleviates cold start and data sparse problems, makes recommendation results more personalized and accurate, and can quickly adapt to changes in users and the market.
Smart Images

Figure CN118710355A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer recommendation algorithms, and in particular to a method and system for recommending agricultural products based on the fusion of multi-source association relationship graphs. Background Art
[0002] The continuous emergence of new technologies, such as digitalization, artificial intelligence, 5G and other technologies, are changing the way people obtain, disseminate and consume information. In the increasingly vast Internet, the dependence of various application software on data processing is gradually increasing. How to extract key information quickly and effectively is particularly important. In this context, recommendation algorithms came into being. The emergence of recommendation algorithms effectively alleviates the various problems caused by information overload. It can predict potential agricultural products that users are interested in based on effective information such as user interest preferences and historical interaction data.
[0003] Traditional recommendation algorithms are mainly divided into collaborative filtering, content-based filtering and hybrid recommendation. Collaborative filtering is a method of predicting based on historical user behavior data, mainly in the form of historical interaction information, such as clicks, purchases, and ratings. It is not difficult to find that this is a form of recommendation that focuses on human behavior and mines the similarities between the recommender and other people; content-based filtering is equivalent to injecting prior knowledge into items. This method is mainly based on the characteristics of the project itself, so it is a project-centered recommendation method; hybrid recommendation combines collaborative filtering and content-based filtering methods, aiming to improve the accuracy of prediction by bridging the advantages of two different recommendation methods.
[0004] With the rapid development of e-commerce, social media and other platforms, the introduction of multimodal information has brought new opportunities and challenges to recommendation systems. In this context, multimodal recommendations not only focus on users' shopping history and click behavior, but also provide users with more personalized and accurate recommendation services by integrating multiple elements of information such as images and texts.
[0005] Existing methods for recommending agricultural products mainly focus on calculating the similarity of agricultural products and deeply studying the potential relationship between them, but usually ignore the more intuitive relationship between different agricultural products; for traditional user feature characterization methods, they rely on user similarity and the establishment of neighbor sets, which, although simple and intuitive, may be limited when faced with large-scale data sets and complex associations; when introducing multimodal data, we face the challenge of balancing the impact of different modalities on agricultural products and user feature data. These problems together lead to a certain degree of inaccuracy in the results of current agricultural product recommendation methods.
[0006] Therefore, the technical problem that has yet to be solved is how to comprehensively consider the intuitive relationship between agricultural products, deep user feature learning, and multimodal data fusion to obtain more accurate representations of user and agricultural product features, thereby achieving high-quality recommendations. Summary of the invention
[0007] In view of the deficiencies in the prior art, the present invention provides a method and system for recommending agricultural products based on the fusion of multi-source association graphs, so as to overcome at least one technical problem existing in the prior art.
[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions: a method for recommending agricultural products based on the fusion of multi-source association graphs, comprising:
[0009] Obtain an agricultural product data set and user agricultural product interaction rating data, wherein the agricultural product data set contains product information of each product and corresponding image information;
[0010] Constructing a homogeneous graph of agricultural product association relationships through agricultural product datasets, where association relationships include but are not limited to "also purchased", "co-browsed", "browsed and purchased" and "bought at the same time";
[0011] By analyzing the user agricultural product interaction rating data, a user-agricultural product heterogeneous graph is obtained, and the similarity between users is measured by the rating similarity. The top N users with the highest similarity to the target user are selected as their neighbors to establish a more accurate user relationship network;
[0012] The user relationship network is aggregated into a sparse graph to evaluate the influence of similar users on the target user, so as to obtain a more comprehensive user feature set including neighbor influence;
[0013] Combining the user feature set including neighbor influence and the user-agricultural product heterogeneous graph, we can capture the user's sensitivity to different modalities and improve the comprehensive understanding of different modal data.
[0014] The Bayesian personalized ranking method is used as the loss function to model the user's personalized preferences, maximize the difference between positive samples and negative samples, and train the model through parameter learning to obtain the user's ranking of the top K agricultural products;
[0015] Through continuous learning of the model, combined with the agricultural product association isomorphic graph and user relationship network, and the user-agricultural product heterogeneous graph, user-to-user agricultural product recommendations can be achieved.
[0016] In order to solve the above problems, the present invention also provides an agricultural product recommendation system based on multi-source association relationship graph fusion, the system comprising:
[0017] The data acquisition module is used to collect product information of agricultural products, including product name, brand, type, function, origin and product association, as well as corresponding image information, to obtain agricultural product data sets and obtain user agricultural product interaction rating data;
[0018] A data processing module, used to map the text and image information collected from the agricultural product data set to an embedding vector of a fixed dimension to obtain feature representations of agricultural products under different modalities;
[0019] A graph construction module is used to construct an agricultural product association relationship isomorphic graph and an M-nearest neighbor agricultural product isomorphic graph based on the association relationship in the agricultural product data set and the agricultural product feature representation under different modes, and to extract a user-agricultural product heterogeneous graph based on the user agricultural product interaction rating data and construct a user relationship network with high-order connectivity information;
[0020] A feature extraction module, used to extract features from the user-agricultural product heterogeneous graph to obtain the user's affinity under different modes;
[0021] A feature fusion module is used to perform weighted summation on the agricultural product association relationship isomorphic graph and the M nearest neighbor agricultural product isomorphic graph features to obtain an agricultural product feature set, and simultaneously adopt sparse graph aggregation, weighted summation and self-attention mechanism to fuse the user's affinity in different modes and the user relationship network carrying high-order connectivity information to obtain the user's feature set;
[0022] A prediction module is used to calculate the acquired user feature set and agricultural product feature set according to the prediction function to generate the top K product recommendations for the target user;
[0023] A model training module is used to model the user's personalized preferences through the agricultural product data set and the user's agricultural product interaction rating data, using the Bayesian personalized ranking method as a loss function, maximizing the difference between positive samples and negative samples, and performing model training by parameter learning;
[0024] The recommendation module is used to input the acquired agricultural product interaction data of the target user and the agricultural product data into the model, and generate the recommendation results of the target user for the target item.
[0025] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0026] At least one processor, a memory, and a computer program stored in the memory and executable on the processor, so that when the processor executes the program, the steps in the agricultural product recommendation method and system based on the fusion of multi-source association relationship graphs as described above can be implemented.
[0027] In order to solve the above problems, the present invention also provides a computer-readable storage medium, the computer-readable storage medium, the computer-readable storage medium contains at least one or more programs, and when the program is executed by the at least one processor, it implements the above-mentioned agricultural product recommendation method and system based on the fusion of multi-source association relationship graphs.
[0028] The present invention provides a method and system for recommending agricultural products based on the fusion of multi-source association graphs. Compared with the prior art, it has the following beneficial effects:
[0029] Based on agricultural product information, M nearest neighbor agricultural product isomorphic graphs and agricultural product association relationship isomorphic graphs under various modes are constructed to obtain agricultural product representation feature sets; based on user agricultural product interaction rating data, by constructing a user-agricultural product heterogeneous graph and integrating a user relationship network carrying high-order connectivity information, a sparse graph feature aggregator, a self-attention mechanism and a weighted summation technology are introduced to effectively fuse multiple graphs, thereby being able to comprehensively capture the user's preference feature set, and ultimately improving the accuracy of the recommendation results; the present invention alleviates the cold start and data sparsity problems existing in the existing agricultural product recommendation model by utilizing multimodal information and a personalized recommendation algorithm, making the recommendation results more accurate, thereby quickly adapting to changes in users and the market. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more intuitively illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required in the embodiments. The drawings are only used to intuitively explain the present invention and are not considered to be limitations of the present invention.
[0031] Figure 1 A schematic diagram of the steps of a method for recommending agricultural products based on fusion of multi-source association graphs in an embodiment of the present invention is shown;
[0032] Figure 2 A model framework diagram in an embodiment of the present invention is shown;
[0033] Figure 3 The embodiment of the present invention shows the fusion process of the target agricultural product similarity isomorphic graph;
[0034] Figure 4 The embodiment of the present invention shows the fusion process of the target agricultural product association relationship isomorphic graph and the agricultural product similarity isomorphic graph;
[0035] Figure 5 A user relationship network carrying high-order connectivity information in an embodiment of the present invention is shown;
[0036] Figure 6 A flow chart of a sparse graph feature aggregator in an embodiment of the present invention is shown;
[0037] Figure 7A module schematic diagram of an agricultural product recommendation system based on multi-source association relationship graph fusion in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] Embodiment 1
[0040] Figure 1 A schematic flow chart of the steps of a method for recommending agricultural products based on fusion of multi-source association graphs in an embodiment of the present invention is shown; the method can be executed by a system, and the system can be implemented by software and hardware.
[0041] Figure 1 An agricultural product recommendation method based on multi-source association graph fusion is described as follows: Figures 1 to 5 As shown, in this embodiment, a method for recommending agricultural products based on the fusion of multi-source association graphs includes steps S10, S20, S30, S40, S50, S60, and S70:
[0042] Wherein, S10, obtaining an agricultural product data set and user agricultural product interaction score data, wherein the agricultural product data set includes product information of each product and corresponding image information;
[0043] Specifically, in this embodiment, the server can obtain an agricultural product data set and user agricultural product interaction rating data, wherein the agricultural product data set includes n kinds of agricultural product information and corresponding image information; and perform data processing on data of different modalities to obtain corresponding agricultural product embeddings, and then construct M nearest neighbor agricultural product isomorphism graphs under different modalities;
[0044] As an optional embodiment of the present invention, an agricultural product data set and user agricultural product interaction rating data are obtained, wherein the agricultural product data set contains product information of each product, and the corresponding image information includes:
[0045] Acquiring the agricultural product dataset, including text information such as the region, type, function and description of the agricultural products, and the corresponding image information;
[0046] Performing text and image feature extraction on the agricultural product dataset and user agricultural product interaction rating data to obtain agricultural product embeddings under different modalities;
[0047] According to the agricultural product embedding application similarity calculation formula under the different modes, the M agricultural products closest to the target agricultural product under the corresponding mode are obtained, and the M nearest neighbor agricultural product isomorphism graph under each mode is constructed;
[0048] The M nearest neighbor isomorphic graphs under each mode are aggregated, and different importances are assigned to agricultural products of different modes through weights. A weighted fusion method is used to construct an isomorphic graph describing the similarity of agricultural products, in which each edge represents the similarity between different agricultural products.
[0049] Specifically, necessary data processing is performed on the agricultural product data set and the user agricultural product interaction score data. First, the user agricultural product interaction score data is processed, and the main goal is to filter out the interaction records of users and items that meet specific conditions. Specifically, the filtering condition is that the number of interactions between users and agricultural products must be within a specific range. If the number of interactions of a user is lower than the set threshold, or the number of interactions of a certain agricultural product is also lower than the set threshold, then the interaction record of the user or item will be deleted from the data.
[0050] Secondly, the product information of each agricultural product in the agricultural product data set is processed. The product information includes text information such as the region, type, function, association and description of the agricultural product, as well as its corresponding image information. During the processing, the scattered text data is aggregated to form a complete text data to describe the agricultural product.
[0051] Let I represent the agricultural product set, and its modal characteristics are expressed as where d a represents the feature dimension, a∈A represents the mode, and A represents the mode set, that is, A={v,t}. In order to better reflect the similarity relationship between agricultural products, the M nearest neighbor isomorphic graph S under each mode is introduced a =(V i ,E), where a∈A, the node set V i It is composed of a set of agricultural products, that is, V'=I, and the edge set E represents the similarity relationship between agricultural products based on similarity.
[0052] In the embodiment of the present invention, Sentence-BERT is used to process the text data in the agricultural product dataset to obtain the agricultural product features under the text mode, that is, Sentence-BERT uses twin networks and triplet networks to generate semantic sentence embedding vectors, so that sentences with similar semantics are closer in the embedding space. Similarly, the visual information processed by the convolutional neural network is represented as Specifically expressed as:
[0053]
[0054]
[0055] According to the embedding of agricultural products under different modalities, the M agricultural products closest to the target agricultural products under the corresponding modality are constructed to construct the M nearest neighbor agricultural product isomorphism graph S under each modality. a ; In the interaction, the similarity of agricultural products directly affects the possibility of subsequent interaction between them; therefore, cosine similarity is introduced to evaluate the similarity between two agricultural products. The cosine similarity calculation follows the following process:
[0056] in,
[0057] and Respectively represent the characteristics of agricultural products i and j in mode a, Represents the similarity between the two. Arrange in descending order according to the similarity, extract the first M similar agricultural products under each mode, construct the M nearest neighbor agricultural product isomorphism graph under each mode, and then process the isomorphism graph using the normalized Laplace matrix method to obtain S a Therefore, in this isomorphic graph, the similarity between the target agricultural product and its first M agricultural products is regarded as
[0058] For the M nearest neighbor isomorphic graphs S under each mode a Aggregation is performed and different importance is given to agricultural products of different modes through weights. Therefore, the similarity between agricultural products can be expressed as:
[0059] in,
[0060] ω v With ω t Represent the weight index given to text and visual modality respectively. It should be noted that ω v +ω t =1. The specific fusion process is as follows Figure 3 As shown, each edge represents the similarity between different agricultural products.
[0061] S20. Construct an agricultural product association relationship isomorphism graph through the agricultural product data set, where the association relationship includes but is not limited to "also purchased", "browsed together", "browsed after purchased" and "purchased at the same time".
[0062] Specifically, association relationships are an indispensable part of the representation of agricultural product features because they can provide important information about the relationships between agricultural products. These relationships are not just simple connections, but also important factors that determine the representation of agricultural product features. By extracting these association relationships, we can obtain one-to-one agricultural product representation relationships. The association relationships here are mainly four types: "also purchased", "browsed together", "purchased after browsing" and "purchased at the same time". In order to more intuitively reflect the agricultural product relationships between agricultural products based on the association relationships, the agricultural product association relationship isomorphism graph can be used to reflect it. In addition, in order to better reflect the relationship between different agricultural products, the agricultural product association relationship isomorphism graph and the agricultural product similarity isomorphism graph (obtained by step S10) are merged together by a multi-graph joint learning method to capture more accurate and more comprehensive agricultural product relationships, thereby accurately obtaining the feature representation set of agricultural products.
[0063] As an optional embodiment of the present invention, an agricultural product association relationship isomorphism graph is constructed through an agricultural product data set, wherein the association relationship includes but is not limited to "also purchased", "browsed together", "browsed after purchase" and "purchased at the same time" including:
[0064] According to the agricultural product data set, obtaining association relationships between different agricultural products, wherein the association relationships include but are not limited to "also purchased", "browsed together", "browsed after purchased" and "purchased at the same time";
[0065] For the associations between the agricultural products, an agricultural product association isomorphic graph carrying high-order connectivity information is constructed based on the affinity between different associations, and its connectivity information is expressed as follows:
[0066]
[0067] Among them, R ij is the sum of the affinities between agricultural product i and agricultural product j in the agricultural product association isomorphism graph, and the parameter ω k It indicates the affinity between agricultural products under a certain relationship;
[0068] By performing multi-graph joint learning on the agricultural product association relationship isomorphic graph and the agricultural product similarity isomorphic graph, information aggregation of the isomorphic graphs is achieved, thereby obtaining a representation feature set that comprehensively captures the agricultural products.
[0069] Specifically, other agricultural products that are associated with the target agricultural product are screened out from the agricultural product data set, and the extracted associated agricultural products are constructed into an associated relationship graph R. R=(V i ,E'), where the node set V iIt is composed of a set of agricultural products, that is, V'=I. The edge set E' describes the interaction between items. We use E'={(i,i')|i∈I,i'∈I'} to represent the edge set, where I'=I\{i}, which means the set of agricultural products excluding agricultural product i. Each edge connects an agricultural product i and another agricultural product i'. These edges represent four unique associations, namely "also purchased", "browsed together", "browsed after purchase" and "purchased at the same time". Different learnable affinities are assigned to different edges according to different associations, which are expressed as Therefore, for any two agricultural products i and j, the affinity R ij , we can express it in the following way:
[0070]
[0071] In order to more accurately and effectively capture the relationship between nodes in multiple isomorphic graph structures, a multi-graph joint learning method is used to process the association relationship graph R and the agricultural product similarity isomorphic graph S. a , realize the aggregation S of the information in the two graphs, and then learn and update the embedding of agricultural products through a multi-layer graph convolutional neural network, which is specifically expressed as:
[0072]
[0073] S30, by analyzing the user agricultural product interaction rating data, a user-agricultural product heterogeneous graph is obtained, and the similarity between users is measured by the rating similarity. The top N users with the highest similarity to the target user are selected as its neighbors to establish a more accurate user relationship network;
[0074] Specifically, in order to obtain user information, we mainly rely on the interactive rating data between users and agricultural products. By learning the user-agricultural product heterogeneous graph, we can extract the user's preference characteristics. According to the user's rating, we can find users with similar interests to the target user, thereby building a user relationship network.
[0075] As an optional embodiment of the present invention, by analyzing the user agricultural product interaction rating data, a user-agricultural product heterogeneous graph is obtained, and the similarity between users is measured by the rating similarity. The top N users with the highest similarity to the target user are selected as its neighbors to establish a more accurate user relationship network, including:
[0076] Extracting interaction information from the user agricultural product interaction rating data, initializing the user using a neural network weight initialization method to obtain an initial representation of the user node, constructing user embedding feature information based on the user node representation, and constructing a user-agricultural product heterogeneous graph based on the extracted interaction information;
[0077] According to the user-agricultural product heterogeneous graph, N users with scores closest to the target user are extracted using score similarity, and these users are regarded as neighbor nodes of the target user;
[0078] Through the target users and their corresponding neighbor nodes, a corresponding user relationship network carrying high-order connectivity information is constructed for each user to fully capture the complex relationships between users.
[0079] Let U represent the user set, and the modal feature of user u is expressed as Specifically, the user-agricultural product interaction information is extracted based on the user-agricultural product interaction rating data, and an undirected graph G = (V, E) is constructed based on the interaction data, where the node set V is composed of the total set of users U and agricultural products I, that is, V = U ∪ I, and the edge set E represents the interaction between users and agricultural products, represented by E = {(u, i) | u∈U, i∈I}, where each edge connects a user u and an agricultural product i. Through the matrix based on the user-agricultural product interaction We can get a symmetric adjacency matrix The expression is:
[0080]
[0081] In this matrix, if user u has interacted with agricultural product i, then Z ui =1, otherwise Z ui =0.
[0082] Specifically, an edge l in the graph k , the edge connects node i and node j, and the probability of their possible interaction can be expressed as:
[0083] in,
[0084] ω i With ω j are the degrees of nodes i and j in graph G respectively. In order to obtain more efficient edge information, the edges of the graph are sorted. Specifically, delete edges, where γ is the deletion ratio, which means that in a graph with |E| edges, only edges, and then construct the symmetric adjacency matrix T γ , and then through the normalization of the Laplace matrix, we get
[0085] According to the user-agricultural product heterogeneous graph, N users with the closest scores to the target user are extracted through score similarity. These users are regarded as neighbor nodes of the target user, such as Figure 5As shown. For example, if both user u1 and user u2 have interaction edges with agricultural product i1, but the difference is that user u1 scores agricultural product i1 as 5, while user u2 scores agricultural product i2 as 1, this situation does not reflect that u1 and u2 have the same interest characteristics. Therefore, we should not only pay attention to the interaction between users and agricultural products, but also pay attention to the user's rating data. This method can effectively construct a user relationship network G with high-order connectivity information. u .
[0086] Assume user relationship network G u =(V u ,E u ), where the node set V u The edge set E is composed of users. u It reflects the similarity of ratings between users, represented by E = {(u,u')|u∈U,u'∈U'}, where U' = U\{u}. The N users with the closest ratings to the target user are extracted through the rating similarity to construct a user relationship network. Subsequently, through the normalization operation, the user relationship network G with high-order connectivity information is obtained. u .
[0087] S40: The user relationship network is aggregated into a sparse graph to evaluate the influence of similar users on the target user, so as to obtain a more comprehensive user feature set including neighbor influence.
[0088] Specifically, the user relationship network G carrying high-order connectivity information is aggregated according to the created sparse graph aggregation module. u Aggregate user feature information to obtain a user feature set from similar users including neighbor influences.
[0089] As an optional embodiment of the present invention, by aggregating the sparse graph, evaluating the influence of similar users on the target user to obtain a more comprehensive user feature set including neighbor influence includes:
[0090] The user relationship network and user embedded feature information are cross-processed to calculate the edge E between the target user i and each neighbor j ij , the calculation formula is:
[0091] E ij =[e i ,(e i -e j )-||e i -e j ||1], j = 1, 2, ..., N; where
[0092] e i With e jare the feature representations of user i and user j respectively, [.,.] represents the connection operation, ||e i -e j ||1 is e i With e j The L1 norm of ;
[0093] For each user, the target user and each of its neighbor node features are aggregated through edges to construct a feature set that includes neighbor influences, expressed as:
[0094] in,
[0095] The feature obtained by aggregating the features of user i and its neighbor node j;
[0096] According to the feature set including neighbor influence, an attention mechanism and a graph convolutional neural network are used to propagate the acquired local feature information to a global scope.
[0097] Specifically, in this embodiment, in order to better capture the influence of users on their neighbors, the user relationship network G carrying high-order connectivity information is u The present invention is introduced to aggregate scattered user feature information on the target user node through a sparse graph aggregation module, so that the present invention can fully consider the relationship between the user and his neighbors and improve the accurate modeling of user behavior.
[0098] According to the user relationship network G carrying high-order connectivity information u And user feature representation u , by connecting the relationship network corresponding to the target user and its semantic information in series, an edge E between the target user i and each neighbor j is established ij , side E ij The description is:
[0099] E ij =[e i ,(e i -e j )-||e i -e j ||1], j = 1, 2, ..., N; where
[0100] e i With e j are the feature representations of user i and user j respectively, [.,.] represents the connection operation, and N is the number of selected neighborhoods. i -e j represents the difference between the target user i’s features and the neighbor user j’s features, i.e., the residual of the user features. ||e i -ej ||1 is e i With e j The L1 norm of , that is, the sum of the absolute values of the residuals. (e i -e j )-||e i -e j ||1 can reduce the negative impact of the absolute positions of adjacent user features and better capture long-distance correspondences than simply introducing residual features.
[0101] In order to learn more semantic features, L1 regularization is applied to ensure the sparsity of its features, so that the feature dependency of each dimension is reduced, so that a wider range of sparse semantic information can be learned. The feature information obtained in this way can not only retain the positive feature information, but also eliminate unnecessary feature information, thereby reducing the negative impact of outliers.
[0102] In order to make full use of the user relationship network, a convolutional layer is first introduced to better learn the relationship between users. Then, the features of the target user and each of its neighbor nodes are aggregated along the edge through the attention feature collection block after the convolutional layer. The specific expressions are as follows:
[0103] in,
[0104] is the feature vector obtained by aggregating the features of user i and its neighbor node j. Next, a multi-layer perceptron is used to evaluate The regional confidence score ω of the corresponding relationship selected in i .
[0105] Since the global information features are closely related to the local information features, a certain connection is established between the local and the global information to update the user feature representation. Specifically, the relationship graph between the target user i and each neighbor j can be expressed as The node V g Represents local features The corresponding set of edge E g It means that since the global information features and local information features of every two users are closely connected, a certain connection is established between the local and the overall information to update the user feature representation. Specifically, the relationship graph between the target user i and each neighbor j can be expressed as The node V g Represents local features The corresponding set of edge E g represents the combination corresponding to every two users, that is, (u i ,u j), 1≤i,j≤N and i≠j. Using the regional confidence score, (u i ,u j ) is encoded as:
[0106] in,
[0107] Can reflect (u i ,u j 0 compatibility. Construct an adjacency matrix A to reflect global information, where Specifically, the adjacency matrix A conveys global information as follows:
[0108]
[0109] in,
[0110] F g represents the global target user embedding, W g and GL are respectively the learnable matrix and graph Laplacian operator, It is beneficial to numerical stability, and D represents The diagonalized degree matrix of . The global information propagation property of GL is used to consider the isolated local user embedding.
[0111] S50. Combine the user feature set including neighbor influence and the user-agricultural product heterogeneous graph to capture the user's sensitivity to different modalities and improve the comprehensive understanding of different modal data.
[0112] Specifically, the user feature set including the influence of neighbors (obtained in S40) is integrated and the information in the user-agricultural product heterogeneous graph is combined. The user feature representation is enriched through the attention mechanism and the present invention pays more attention to the modality that has a greater impact on the target user.
[0113] As an optional embodiment of the present invention, combining a user feature set including neighbor influence and a user-agricultural product heterogeneous graph to capture the user's sensitivity to different modalities and improve the comprehensive understanding of different modal data includes:
[0114] By extracting features from the user-product heterogeneous graph, the goal is to construct the affinity of the target user for different modalities. By combining user features including neighbor influence and gated attention mechanism, the importance of each modality to different users is learned in an adaptive manner, thereby achieving dynamic feature selection in the process of generating different modality affinities;
[0115] According to the different affinities of target users, the information of user-specific modalities is fused by multimodal connection to obtain user embedding that fuses different modalities.
[0116] Specifically, considering that each user u may have different affinities for different modalities, in order to capture this personalized sensitivity, we introduce the affinity of user u for different modalities Affinity indicates the degree of attention that user u pays to modality m. Therefore, the embedding of user u to modality m can be expressed as:
[0117] in, and is a gating function, which is used to adjust the influence of user embedding and sensitivity respectively, and ⊙ is element-by-element multiplication. Parameters W1, b1, W2, and b2 are learnable parameters.
[0118] The acquired user embeddings of different modalities are concatenated and input into the fully connected layer to further learn the abstract representation of the user. The specific representation is:
[0119]
[0120] e u =ReLU(W u ·e u +b u ),in,
[0121] |M| represents the number of modes, W u , b u are learnable parameters.
[0122] Finally, in order to aggregate the information on all the constructed graphs, the embedding of users and agricultural products is learned and updated through a multi-layer graph convolutional neural network, which is specifically expressed as follows:
[0123] e=concatenate(e u ,e i );
[0124] e l =∑ j∈N(i) Z ui e l ,in,
[0125] N(i) is the item that interacts with agricultural product i. The embedding matrix obtained by multi-layer adjacency matrix propagation is integrated and segmented to finally obtain user e u With agricultural products i Since the characteristics of agricultural products are composed of two parts, the characteristics of agricultural products are expressed as
[0126] S60. Use the Bayesian personalized ranking method as the loss function to model the user's personalized preferences, maximize the difference between positive samples and negative samples, and train the model through parameter learning to obtain the user's ranking of the top K agricultural products.
[0127] As an optional embodiment of the present invention, the Bayesian personalized ranking method is used as the loss function to model the personalized preferences of users, maximize the difference between positive samples and negative samples, and train the model by parameter learning to obtain the user's ranking of the top K agricultural products, including:
[0128] During the training process, a triplet R is constructed for each user u. The triplet is represented as (u, i, j), where i is the positive item that user u actually interacts with, and j is the negative item that has never interacted with user u, obtained by random sampling. The specific expression of the loss function is:
[0129]
[0130] in,
[0131] e u is the embedding vector of the target user u obtained based on the user preference feature set, e i With e j denote the embedding vectors associated with positive item i and negative item j extracted from the agricultural product representation set, respectively. represents the preference of user u for agricultural product i, Θ represents the model parameters, λ is a hyperparameter used to measure the loss term and regularization term of the model to control the complexity of the model, the hyperparameter ρ is used to control the L2 regularization effect, and σ is the activation function.
[0132] Specifically, since there is a large amount of implicit data in agricultural product recommendation, that is, users do not have clear ratings for agricultural products, the Bayesian personalized ranking (BPR Loss) method is used as the loss function. BPR Loss aims to maximize the difference between the scores of positive samples and negative samples as much as possible, and optimizes by Bayesian maximization of posterior probability using matrix decomposition and user agricultural product rating matrix. The training data is mainly represented by multiple triplets (u, i, j), which means that user u's choice of agricultural product i takes precedence over agricultural product j. In the present invention, the loss function is defined as:
[0133]
[0134] in,
[0135] e u is the embedding vector of the target user u obtained based on the user preference feature set, ei With e j denote the embedding vectors associated with positive item i and negative item j extracted from the agricultural product representation set, respectively. represents the preference of user u for agricultural product i, Θ represents the model parameters, λ is a hyperparameter used to measure the loss term and regularization term of the model to control the complexity of the model, the hyperparameter ρ is used to control the L2 regularization effect, and σ is the activation function.
[0136] The Adam optimization algorithm is used to optimize the parameters in the present invention. The Adam optimization algorithm is a first-order optimization algorithm that can replace the traditional stochastic gradient descent process. It can iteratively update the neural network weights based on the training data. The algorithm can provide an optimization method to solve the sparse gradient and noise problems.
[0137] In order to prevent overfitting in the present invention, the early stopping method is used. The early stopping method is to calculate the performance of the model on the validation set during training. When the performance of the model on the validation set begins to decline, the training is stopped, so as to avoid the problem of overfitting caused by continued training. In the present invention, the original training set is divided into a training set and a validation set, and the number of early stopping steps n is set. stop And the total number of training rounds n total , train on the training set and calculate the error of the model on the validation set for each cycle. When the error of the model on the validation set is n consecutive stop The round is worse than the current best training result or reaches n total Stop training at the end of the round and use the current last training parameters as the final parameters of the model.
[0138] S70. Through continuous learning of the model, combined with the agricultural product association isomorphic graph and the user relationship network, and the user-agricultural product heterogeneous graph, user-to-user agricultural product recommendations can be achieved.
[0139] Specifically, the obtained agricultural product data set and the user agricultural product interaction score data are processed through the following steps (S10~S50), and the model is learned through step S60, and finally the effect of the invention is measured through certain evaluation indicators.
[0140] As an optional embodiment of the present invention, through continuous learning of the model, combining the agricultural product association relationship isomorphic graph and the user relationship network, the user-agricultural product heterogeneous graph, the user-to-user agricultural product recommendation is implemented, including:
[0141] The model performance is evaluated by using the evaluation indicators Precision@K, NDCG@K, and Recall@K to ensure that the recommendation system has good generalization performance among different users and agricultural products;
[0142] After the model training is completed, it will be deployed to the online environment to provide users with personalized agricultural product recommendations in real time. The model will be continuously updated based on new user behaviors and product information to adapt to changes in users and the market.
[0143] Specifically, the present invention adopts three common recommendation method evaluation indicators: Precision@K, NDCG@K, and Recall@K, which respectively represent the precision, normalized cumulative discounted gain, and recall rate of the first K items in the recommendation list.
[0144] Precision@K (TOP-K accuracy) is used to measure the accuracy of the recommendation system in hitting the user's real interests in the top K recommendations. It is specifically expressed as:
[0145]
[0146] NDCG@K is mainly used to measure the quality of recommendation lists. Its prediction results are closely related to the relevance and location information of the recommended items. Relevant items with higher user rankings are often given higher weights.
[0147] Specifically expressed as:
[0148] Among them, DCG is an indicator that performs a weighted sum of the rankings of each item in a recommendation list. The calculation formula is:
[0149] Among them, rank i is the ranking of agricultural product i. For each item in the recommendation list, its weight is The higher the ranking of an item, the smaller its weight. Then, these weighted values are added together to get DCG, and IDCG@K is the DCG@K in the ideal case, which represents the cumulative gain when the relevance is ideally sorted.
[0150] Recall@K is used to measure how many of the top K recommended items are actually of interest to the user and are successfully recommended; the calculation formula is:
[0151] in,
[0152] TP represents the number of items that users are actually interested in among the first K recommended items, and FN represents the number of items that users are actually interested in but have not been successfully recommended.
[0153] like Figure 6 to Figure 7As shown, the present invention provides an agricultural product recommendation system 100 based on the fusion of multi-source association relationship graphs, and the present invention can be installed in any electronic device. Specifically implemented functions, the agricultural product recommendation system 100 based on the fusion of multi-source association relationship graphs may include a data acquisition module 110, a data processing module 120, a graph construction module 130, a feature extraction module 140, a feature fusion module 150, a prediction module 160, a model training module 170 and a recommendation module 180. The unit of the present invention can also be called a module, which refers to a computer program segment that can be executed by an electronic device processor and can complete a series of functionalizations, which is stored in the memory of the electronic device.
[0154] In this embodiment, the functions of each module are as follows:
[0155] The data acquisition module 110 is used to collect product information of agricultural products, including data on product name, brand, type, function, origin and product association, as well as corresponding image information, to obtain agricultural product data sets, and obtain user agricultural product interaction rating data;
[0156] A data processing module 120 is used to map the text and image information collected from the agricultural product dataset to an embedding vector of a fixed dimension to obtain feature representations of agricultural products under different modalities;
[0157] A graph construction module 130 is used to construct an agricultural product association relationship isomorphic graph and an M-nearest neighbor agricultural product isomorphic graph based on the association relationship in the agricultural product data set and the agricultural product feature representation under different modes, and to extract a user-agricultural product heterogeneous graph based on the user agricultural product interaction rating data and construct a user relationship network with high-order connectivity information;
[0158] A feature extraction module 140 is used to extract features from the user-agricultural product heterogeneous graph to obtain the user's affinity under different modes;
[0159] The feature fusion module 150 is used to perform weighted summation on the agricultural product association relationship isomorphic graph and the M nearest neighbor agricultural product isomorphic graph features to obtain an agricultural product feature set, and simultaneously adopt sparse graph aggregation, weighted summation and self-attention mechanism to fuse the user's affinity in different modes and the user relationship network carrying high-order connectivity information to obtain the user's feature set;
[0160] Prediction module 160, used to calculate the acquired user feature set and agricultural product feature set according to the prediction function to generate top K product recommendations for the target user;
[0161] A model training module 170 is used to model the user's personalized preferences using the agricultural product data set and the user's agricultural product interaction rating data, using the Bayesian personalized ranking method as a loss function, maximizing the difference between positive samples and negative samples, and performing model training by parameter learning;
[0162] The recommendation module 180 is used to input the acquired agricultural product interaction data of the target user and the agricultural product data into the model, and generate the recommendation result of the target user for the target item.
[0163] The agricultural product recommendation system 100 based on the fusion of multi-source association relationship graphs of the present invention constructs M nearest neighbor agricultural product isomorphic graphs and agricultural product association relationship isomorphic graphs under various modes based on agricultural product information to obtain agricultural product representation feature sets; based on user agricultural product interaction rating data, by constructing user-agricultural product heterogeneous graphs and integrating user relationship networks carrying high-order connectivity information, sparse graph feature aggregators, self-attention mechanisms, and weighted summation techniques are introduced to effectively fuse multiple graphs, thereby being able to comprehensively capture the user's preference feature sets, ultimately improving the accuracy of the recommendation results, and presenting the recommended results through intuitive and comprehensive system visualization. The present invention alleviates the cold start and data sparsity problems existing in the existing agricultural product recommendation model by utilizing multimodal information and personalized recommendation algorithms, making the recommendation results more accurate, thereby quickly adapting to changes in users and the market.
[0164] An embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the following is achieved:
[0165] S10, obtaining an agricultural product data set and user agricultural product interaction rating data, wherein the agricultural product data set includes product information of each product and corresponding image information;
[0166] S20, constructing an agricultural product association relationship isomorphism graph through the agricultural product data set, wherein the association relationship includes but is not limited to "also purchased", "browsed together", "browsed after purchased" and "purchased at the same time";
[0167] S30, by analyzing the user agricultural product interaction rating data, a user-agricultural product heterogeneous graph is obtained, and the similarity between users is measured by the rating similarity. The top N users with the highest similarity to the target user are selected as its neighbors to establish a more accurate user relationship network;
[0168] S40, evaluating the influence of similar users on the target user by aggregating the user relationship network through a sparse graph, so as to obtain a more comprehensive user feature set including neighbor influence;
[0169] S50, combining the user feature set including neighbor influence and the user-agricultural product heterogeneous graph, captures the user's sensitivity to different modalities and improves the comprehensive understanding of different modal data;
[0170] S60. Use the Bayesian personalized ranking method as the loss function to model the user's personalized preferences, maximize the difference between positive samples and negative samples, and train the model through parameter learning to obtain the user's ranking of the top K agricultural products;
[0171] S70. Through continuous learning of the model, combined with the agricultural product association isomorphic graph and the user relationship network, and the user-agricultural product heterogeneous graph, user-to-user agricultural product recommendations can be achieved.
[0172] Specifically, the specific implementation method when the computer program is executed by the processor can refer to the description of the relevant steps in the embodiment of a method and system for recommending agricultural products based on fusion of multi-source association relationship graphs.
[0173] In several embodiments provided by the present invention, the implementation methods are not limited to specific device configurations, system structures or method steps. On the contrary, different devices, system components or method processes can be used according to actual conditions and specific needs to achieve the same or similar technical effects. For example, the division of the modules is only one possibility provided according to their logical order. In actual applications, the division method can be adjusted according to actual needs.
[0174] In various embodiments of the present invention, the layout of each functional module can be selected to be integrated into one processing unit, or they can be selected to be stored separately in different units. The choice of this layout depends on the specific application scenario, performance requirements and system design considerations.
[0175] It will be apparent to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0176] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for recommending agricultural products based on fusion of multi-source association graphs, characterized in that: The following steps are involved: Obtain an agricultural product data set and user agricultural product interaction rating data, wherein the agricultural product data set contains product information of each product and corresponding image information; Construct an agricultural product association isomorphism graph through the agricultural product dataset, where the associations include but are not limited to "also purchased", "browsed together", "browsed and purchased" and "purchased at the same time"; By analyzing the user agricultural product interaction rating data, a user-agricultural product heterogeneous graph is obtained, and the similarity between users is measured by the rating similarity; the top N users with the highest similarity to the target user are selected as their neighbors to establish a more accurate user relationship network; The user relationship network is aggregated into a sparse graph to evaluate the influence of similar users on the target user, so as to obtain a more comprehensive user feature set including neighbor influence; Combining the user feature set including neighbor influence and the user-product heterogeneous graph to capture the user's sensitivity to different modalities; The Bayesian personalized ranking method is used as the loss function to model the user's personalized preferences, maximize the difference between positive samples and negative samples, and train the model through parameter learning to obtain the user's ranking of the top K agricultural products; Through continuous learning of the model, combined with the agricultural product association isomorphic graph and user relationship network, and the user-agricultural product heterogeneous graph, user-to-user agricultural product recommendations can be achieved.
2. The agricultural product recommendation method based on multi-source association graph fusion according to claim 1 is characterized in that: The obtaining of agricultural product data set and user agricultural product interaction rating data includes: Acquiring the agricultural product dataset, including text information such as the region, type, function, association, and description of the agricultural products, as well as the corresponding image information; Performing text and image feature extraction on the agricultural product dataset and user agricultural product interaction rating data to obtain agricultural product embeddings under different modalities; According to the agricultural product embedding application similarity calculation formula under the different modes, M agricultural products closest to the target agricultural product under the corresponding mode are obtained, and M nearest neighbor agricultural product isomorphism graphs under each mode are constructed; The M nearest neighbor isomorphic graphs under each mode are aggregated, and different importances are assigned to agricultural products of different modes through weights. A weighted fusion method is used to construct an isomorphic graph describing the similarity of agricultural products, in which each edge represents the similarity between different agricultural products.
3. The agricultural product recommendation method based on multi-source association graph fusion according to claim 1 is characterized in that: The agricultural product association relationship isomorphism graph is constructed by using the agricultural product data set, wherein the association relationship includes but is not limited to "also purchased", "browsed together", "browsed and purchased" and "purchased at the same time" including: According to the agricultural product data set, the association relationship between different agricultural products is obtained, wherein the association relationship includes "also purchased", "browsed together", "browsed and purchased" and "purchased at the same time"; For the associations between the agricultural products, an agricultural product association isomorphic graph carrying high-order connectivity information is constructed based on the affinity between different associations, and its connectivity information is expressed as follows: in, R ij is the sum of the affinities between agricultural product i and agricultural product j in the agricultural product association isomorphism graph, and the parameter ω k It indicates the affinity between agricultural products under a certain relationship; By performing multi-graph joint learning on the agricultural product association relationship isomorphic graph and the agricultural product similarity isomorphic graph, information aggregation of the isomorphic graphs is achieved, thereby obtaining a representation feature set that comprehensively captures the agricultural products.
4. The agricultural product recommendation method based on multi-source association graph fusion according to claim 1 is characterized in that: The user-agricultural product heterogeneous graph is obtained by analyzing the user agricultural product interaction rating data, and the similarity between users is measured by using the rating similarity, and the top N users with the highest similarity to the target user are selected as its neighbors to establish a more accurate user relationship network, including: Extracting interaction information from the user agricultural product interaction rating data, initializing the user using a neural network weight initialization method to obtain an initial representation of the user node, constructing user embedding feature information based on the user node representation, and constructing a user-agricultural product heterogeneous graph based on the extracted interaction information; According to the user-agricultural product heterogeneous graph, N users with scores closest to the target user are extracted using score similarity, and these users are regarded as neighbor nodes of the target user; Through the target users and their corresponding neighbor nodes, a corresponding user relationship network carrying high-order connectivity information is constructed for each user to fully capture the complex relationships between users.
5. The agricultural product recommendation method based on multi-source association graph fusion according to claim 1 is characterized in that: The user relationship network is aggregated into sparse graphs to evaluate the influence of similar users on the target user, so as to obtain a more comprehensive user feature set including neighbor influence, including: The user relationship network and user embedded feature information are cross-processed to calculate the edge E between the target user i and each neighbor j ij , the calculation formula is: E ij =[e i ,(e i -e j )-||e i -e j ||1], j=1,2,…,N; e i With e j are the feature representations of user i and user j respectively, [.,.] represents the connection operation, ||e i -e j ||1 is f i With f j The L1 norm of For each user, the target user and each of its neighbor node features are aggregated through edges to construct a feature set that includes neighbor influences, expressed as: in, The feature obtained by aggregating the features of user i and its neighbor node j; According to the feature set including neighbor influence, an attention mechanism and a graph convolutional neural network are used to propagate the acquired local feature information to a global scope.
6. The agricultural product recommendation method based on multi-source association graph fusion according to claim 1 is characterized in that: Combining the user feature set including neighbor influence and the user-agricultural product heterogeneous graph, we can capture the user's sensitivity to different modalities and improve the comprehensive understanding of different modal data, including: By extracting features from the user-agricultural product heterogeneous graph, the target user's affinity for different modalities is constructed; the importance of each modality to different users is learned in an adaptive manner in combination with a gated attention mechanism, thereby achieving dynamic feature selection in the process of generating different modal affinities; According to the different modal affinities of the target users, the information of the user's specific modality is fused with different weights by weighted summation to obtain the user embedding that integrates different modalities.
7. The agricultural product recommendation method based on multi-source association graph fusion according to claim 1 is characterized in that: The Bayesian personalized ranking method is used as the loss function to model the user's personalized preferences, maximize the difference between positive samples and negative samples, and train the model through parameter learning to obtain the user's ranking of the top K agricultural products, including: During the training process, a triplet R is constructed for each user u. The triplet is expressed as (u, i, j), where i is the positive item that user u actually interacts with, and j is the negative item that has never interacted with user u, obtained by random sampling; the specific expression of the loss function is: in, e u is the embedding vector of the target user u obtained based on the user preference feature set, e i With e j denote the embedding vectors associated with positive item i and negative item j extracted from the agricultural product representation set, respectively. represents the preference of user u for agricultural product i, Θ represents the model parameters, λ is a hyperparameter used to measure the loss term and regularization term of the model to control the complexity of the model, the hyperparameter ρ is used to control the L2 regularization effect, and σ is the activation function; Through continuous learning of the model, combined with the agricultural product association isomorphic graph and user relationship network, and the user-agricultural product heterogeneous graph, the agricultural product recommendations for users are realized, including: The model performance is evaluated by using the evaluation indicators Precision@K, NDCG@K, and Recal l@K to ensure that the recommendation system has good generalization performance among different users and agricultural products; After the model training is completed, it will be deployed to the online environment to provide users with personalized agricultural product recommendations in real time. The model will be continuously updated based on new user behaviors and product information to adapt to changes in users and the market.
8. An agricultural product recommendation system based on multi-source association graph fusion, characterized in that: The system comprises: The data acquisition module is used to collect product information of agricultural products, including product name, brand, type, function, origin and product association, as well as corresponding image information, to obtain agricultural product data sets and obtain user agricultural product interaction rating data; A data processing module, used to map the text and image information collected from the agricultural product data set to an embedding vector of a fixed dimension to obtain feature representations of agricultural products under different modalities; A graph construction module is used to construct an agricultural product association relationship isomorphic graph and an M-nearest neighbor agricultural product isomorphic graph based on the association relationship in the agricultural product data set and the agricultural product feature representation under different modes, and to extract a user-agricultural product heterogeneous graph based on the user agricultural product interaction rating data and construct a user relationship network with high-order connectivity information; A feature extraction module, used to extract features from the user-agricultural product heterogeneous graph to obtain the user's affinity under different modes; A feature fusion module is used to perform weighted summation on the agricultural product association relationship isomorphic graph and the M nearest neighbor agricultural product isomorphic graph features to obtain an agricultural product feature set, and simultaneously adopt sparse graph aggregation, weighted summation and self-attention mechanism to fuse the user's affinity in different modes and the user relationship network carrying high-order connectivity information to obtain the user's feature set; A prediction module is used to calculate the acquired user feature set and agricultural product feature set according to the prediction function to generate the top K product recommendations for the target user; A model training module is used to model the user's personalized preferences through the agricultural product data set and the user's agricultural product interaction rating data, using the Bayesian personalized ranking method as a loss function, maximizing the difference between positive samples and negative samples, and performing model training by parameter learning; The recommendation module is used to input the acquired agricultural product interaction data of the target users and the agricultural product data into the model, and generate the recommendation results of the target users for the target items.
9. An electronic device, characterized in that: The electronic device comprises: At least one processor, a memory, and a computer program stored in the memory and executable on the processor, so that when the processor executes the program, it can implement the agricultural product recommendation method and system based on the fusion of multi-source association relationship graphs as described in any one of claims 1 to 8.
10. A storage medium, characterized in that: include: The storage medium stores one or more programs, which, when executed by the at least one processor, implement the agricultural product recommendation method and system based on multi-source association relationship graph fusion as described in any one of claims 1-8.
Citation Information
Cited By
Big data information processing method
CN120492722A
