An agricultural product AI personalized recommendation method and system based on a knowledge graph
By constructing a collaborative knowledge graph and utilizing graph convolutional networks for information propagation, the problems of data sparsity and cold start in agricultural product recommendation systems are solved, enabling more accurate personalized recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- KUNMING UNIV OF SCI & TECH
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-19
AI Technical Summary
Existing agricultural product recommendation systems suffer from data sparsity and cold start conditions. Traditional collaborative filtering algorithms struggle to accurately capture user preferences, leading to inaccurate recommendation results. Furthermore, the cold start problem is severe, making it difficult to establish reliable associations between newly listed products or newly registered users' interests and product features.
We construct a collaborative knowledge graph that integrates user interaction information. We use graph convolutional networks combined with personalized attention mechanisms for users and relationships to perform information dissemination and feature aggregation. Through multi-layer information dissemination, we recursively aggregate the feature information of neighboring nodes in the graph structure to establish semantic connections between users and agricultural products.
It effectively alleviates the problems of data sparsity and cold start, improves the accuracy and personalization of agricultural product recommendations, and can accurately depict users' multi-dimensional attribute preferences for agricultural products in the absence of historical interaction data.
Smart Images

Figure CN122243614A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer and AI technology, specifically to a knowledge graph-based AI-driven personalized recommendation method and system for agricultural products. Background Technology
[0002] Currently, with the deepening of "Internet + Agriculture," agricultural e-commerce platforms, while expanding sales channels, also face a serious problem of "information overload." E-commerce platforms offer a wide variety of agricultural products with complex attributes, making it difficult for consumers to efficiently filter out products that meet their individual needs from a massive amount of goods. Meanwhile, many high-quality agricultural products with regional characteristics struggle to accurately reach potential consumer groups due to insufficient brand influence. Against this backdrop, personalized recommendation technology is widely used in the agricultural e-commerce sector, aiming to achieve precise matching between products and users by analyzing users' historical behavior, thereby improving information acquisition efficiency and platform marketing effectiveness.
[0003] In existing technologies, traditional personalized recommendation methods mainly include content-based recommendation, collaborative filtering-based recommendation, and hybrid recommendation. While collaborative filtering is a relatively mature method, it still has significant shortcomings in agricultural product recommendation scenarios. Due to the vast variety of agricultural products and the relatively sparse user interaction data, the effective interaction records between users and agricultural products are far fewer than the total number of products. This makes it difficult for traditional collaborative filtering algorithms to accurately capture users' potential preferences, easily leading to inaccurate recommendation results. Simultaneously, the cold start problem also limits the performance of recommendation systems. For newly listed agricultural products or newly registered users, the lack of sufficient historical interaction data makes it difficult for traditional algorithms to establish reliable associations between user interest representations and product features, thus affecting recommendation effectiveness.
[0004] To alleviate the aforementioned problems, researchers have attempted to introduce knowledge graphs into recommender systems. Knowledge graphs can organize scattered agricultural product attribute data, such as origin, category, price, storage conditions, and cooking suggestions, into a structured semantic network, revealing the inherent relationships between entities. By constructing a knowledge graph in the agricultural product domain and integrating it with user interaction information, richer semantic connections can be established between users and agricultural products. Even with sparse interaction data, interest inference and matching can be achieved through attribute-level associations, thereby improving the coverage and interpretability of the recommender system. Existing knowledge graph-based recommender methods, such as embedding-based and path-based methods, while improving recommendation performance to some extent, still suffer from limitations such as insufficient utilization of high-order semantic information and reliance on manually defined paths, making it difficult to fully explore the complex relationships between users and agricultural products.
[0005] In recent years, graph neural network (Graph Neural Network) technology, as a core and cutting-edge AI technology, has shown promising application prospects in the field of knowledge graph recommendation. Graph convolutional networks (GCNNs), as an important branch of GCNNs, can recursively aggregate feature information of multi-hop neighbor nodes in a graph structure through a multi-layered information propagation mechanism, achieving effective modeling of high-order semantic relationships. Applying GCNNs to agricultural product recommendation can dynamically propagate user interests along multi-dimensional semantic paths in the knowledge graph, such as "product-origin," "product-category," and "product-cooking suggestions," thereby more accurately depicting users' potential preferences for the multi-dimensional attributes of agricultural products. Based on this, this technical solution proposes a knowledge graph-based AI-driven personalized recommendation method and system for agricultural products. By constructing a collaborative knowledge graph that integrates user interaction information and utilizing GCNNs combined with a personalized attention mechanism between users and relationships for information propagation and feature aggregation, this approach aims to effectively alleviate data sparsity and cold-start problems, and improve the accuracy and personalization of agricultural product recommendations. Summary of the Invention
[0006] The purpose of this invention is to provide a knowledge graph-based AI-driven personalized recommendation method and system for agricultural products. By constructing a collaborative knowledge graph that integrates user interaction, and using graph convolutional networks to combine personalized weights of users and relationships for information dissemination, accurate recommendations can be achieved.
[0007] To achieve the above-mentioned technical objectives and effects, the present invention is implemented through the following technical solution: A knowledge graph-based personalized recommendation method for agricultural products includes: Acquire source data related to agricultural products, including agricultural product attribute data and user interaction data; Based on the agricultural product attribute data, an agricultural product attribute knowledge graph is constructed. User entities and their historical interaction relationships with agricultural product entities are then integrated into this agricultural product attribute knowledge graph to construct a collaborative knowledge graph, which is represented as a set of triples. ,in This represents the set of all entities after the addition of the user entity. This represents the set of all relationships after a purchase relationship has been established; Each user node, agricultural product node, and relation edge in the collaborative knowledge graph is mapped to a low-dimensional vector space to obtain an initial embedding vector; A graph convolutional network is used to perform multi-layer information propagation in the collaborative knowledge graph to aggregate the feature information of neighboring nodes and update the node embedding vectors in the collaborative knowledge graph. In each layer of information propagation, a personalized weight is assigned to the neighboring node based on the degree of matching between the embedding vector of the current user node and the embedding vector of the relation edge connected to the neighboring node, and the feature information of the neighboring node is aggregated based on the personalized weight. Based on the updated user node embedding vector and agricultural product node embedding vector, the interaction probability between users and candidate agricultural products is calculated, and a recommendation list is generated according to the interaction probability.
[0008] Furthermore, the construction of the agricultural product attribute knowledge graph includes: Multiple agricultural product entities and their attributes are extracted from the agricultural product attribute data. The attributes include at least one of the following: place of origin attribute, category attribute, price attribute, storage condition attribute, and cooking suggestion attribute. Determine the semantic relationships between agricultural product entities and attributes, wherein the semantic relationships include at least one of the following: source relationship, attribution relationship, price relationship, storage relationship, and cooking method relationship.
[0009] Furthermore, the initial embedding vectors are respectively , , , where d is the predetermined dimension.
[0010] Furthermore, the matching degree is calculated by taking the inner product of the embedding vector of the user node and the embedding vector of the relation edge. It is confirmed that, among them, For users and relationships Match scores between them and users respectively and relationships Embedded representation, It is an inner product function. express right The importance of this is the matching weight between users and relationships. This personalized weight is normalized using the following formula: in Let represent the set of neighboring nodes of agricultural product node i, and let e represent the neighboring entity.
[0011] Furthermore, when using graph convolutional networks for multi-layer information propagation, a sampling strategy is employed to select a preset number of K neighboring nodes from the neighboring nodes of each agricultural product node. ,satisfy Construct the receptive field of this agricultural product node.
[0012] Furthermore, the sampling strategy is a uniform sampling strategy, and the preset quantity K is a fixed value.
[0013] Furthermore, the graph convolutional network has 3 layers for information propagation.
[0014] Furthermore, the low-dimensional vector space has a dimension of 64.
[0015] Furthermore, the interaction probability is calculated using a binary cross-entropy loss function for model optimization: Where D is the training sample set, , As a positive sample, For negative samples, For model parameters, This is the regularization coefficient.
[0016] On the other hand, this invention proposes a personalized recommendation system for agricultural products based on knowledge graphs, comprising: The data acquisition module is configured to acquire source data related to agricultural products, including agricultural product attribute data and user interaction data. The collaborative knowledge graph construction module is configured to construct an agricultural product attribute knowledge graph based on the agricultural product attribute data, and to integrate user entities and their historical interaction relationships with agricultural product entities into the agricultural product attribute knowledge graph to construct a collaborative knowledge graph, which is represented as a set of triples. ,in This represents the set of all entities after the addition of the user entity. This represents the set of all relationships after a purchase relationship has been established; The embedding module is configured to map each user node, agricultural product node, and relation edge in the collaborative knowledge graph to a low-dimensional vector space to obtain an initial embedding vector. The graph convolutional propagation module is configured to use a graph convolutional network to propagate information in multiple layers in the collaborative knowledge graph, thereby aggregating the feature information of neighboring nodes and updating the node embedding vectors in the collaborative knowledge graph. In each layer of information propagation, personalized weights are assigned to different neighboring nodes based on the degree of matching between the embedding vector of the current user node and the embedding vectors of the relation edges associated with the neighboring nodes, and the feature information of the neighboring nodes is aggregated based on the personalized weights. The prediction output module is configured to calculate the interaction probability between users and candidate agricultural products based on the updated user node embedding vector and agricultural product node embedding vector, and generate a recommendation list based on the interaction probability.
[0017] The beneficial effects of this invention are: This invention constructs a collaborative knowledge graph that integrates user entity and agricultural product attribute knowledge graphs. During information propagation in a graph convolutional network, it determines the personalized aggregation weights of neighboring nodes based on the inner product calculation results of user node embeddings and relation edge embeddings. This allows the model to establish semantic connections between users and agricultural products using attribute nodes, mitigating data sparsity and cold start problems, even under sparse user-agricultural product interaction data. The collaborative knowledge graph adds user nodes to the agricultural product attribute knowledge graph, connecting users and agricultural products through purchase relationships, while preserving the semantic relationships between agricultural products and attributes such as origin, category, and price. During graph convolutional network propagation, the model calculates the inner product of the user node embedding and the corresponding relation edge embeddings of each neighboring node. This inner product value is used as the matching score of the neighboring node relative to the current user, and after normalization, it serves as the aggregation weight. The inner product operation projects user interests onto the relational semantic space for measurement, and the weight value directly reflects the user's preference strength for specific semantic relationships. When there is no direct purchase record between the user and the target agricultural product, the model can achieve interest propagation along the path of user-purchase-agricultural product-attribute-similar agricultural products, with attribute nodes acting as semantic mediators. New users or new agricultural products can be integrated into the graph based on their associated attribute nodes, and recommendation relationships can be established based on semantic associations at the attribute level, without relying on historical interaction data.
[0018] This invention employs a multi-layer graph convolutional network for layer-by-layer information propagation within a collaborative knowledge graph. In each layer, weighted aggregation is performed based on the matching degree of the embedding edges between the user node and its neighbors. This ensures that the final embedding vectors of user nodes and agricultural product nodes incorporate multi-level semantic information guided by user personalization preferences, thereby improving recommendation accuracy. The first layer aggregates information from directly connected attribute nodes and user nodes. In the second layer, attribute nodes further aggregate information from other connected agricultural product nodes, allowing the embeddings of the original agricultural product nodes to indirectly acquire associations with similar agricultural products. The third layer transmits user preference information for similar agricultural products back to the original agricultural product nodes. Each layer repeatedly performs a personalized weight allocation operation based on the inner product. User preferences for specific attribute dimensions amplify the information contribution along that attribute path layer by layer, while suppressing information along irrelevant paths. The prediction layer obtains the interaction probability by calculating the inner product of the user node embedding and the agricultural product node embedding; both vectors deeply encode user preferences and multi-level semantic associations.
[0019] This invention constructs a receptive field by sampling a predetermined number of nodes from all neighboring nodes of an agricultural product node. Combined with an end-to-end joint training framework, it controls the computational graph size while maintaining the ability to model higher-order semantic information, thereby improving the model's training efficiency and generalization performance. A predetermined number of nodes are uniformly selected from all neighboring nodes of each agricultural product node as the aggregation objects for that layer. The computational complexity of each layer's propagation is limited to the product of the predetermined number of samples and the number of propagation layers, decoupling it from the overall graph size. The sampling process is performed independently at each layer, and the cumulative receptive field of multiple propagations expands to the power of the number of propagation layers, ensuring the model does not lose its ability to acquire higher-order semantic information due to sampling. Negative sampling is used to construct training samples. A binary cross-entropy loss function is used as the optimization objective, and L2 regularization is introduced. The embedding layer, graph convolutional propagation layer, and prediction layer are jointly optimized end-to-end through backpropagation, ensuring that the update objectives of each module consistently serve the recommendation task.
[0020] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of the agricultural product knowledge graph construction process in an embodiment of the present invention; Figure 2 This is an entity relationship diagram of a single agricultural product knowledge graph in an embodiment of the present invention; Figure 3 This is a screenshot of the visualization portion of the agricultural product knowledge graph in an embodiment of the present invention; Figure 4 This is a diagram illustrating the overall architecture of the ARKG model in an embodiment of the present invention. Figure 5 This is an example diagram of two receptive fields in an embodiment of the present invention; Figure 6 This is a comparison chart of the recommendation performance of different models in the embodiments of the present invention; Figure 7 This is a graph showing the impact of vector embedding dimension on model performance in an embodiment of the present invention. Figure 8 This is a graph showing the impact of the domain level on model performance in an embodiment of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Example 1
[0024] This embodiment provides a knowledge graph-based personalized agricultural product recommendation method. This method constructs a collaborative knowledge graph that integrates user interaction information and utilizes graph convolutional networks combined with personalized user attention mechanisms for information dissemination and aggregation, thereby achieving accurate agricultural product recommendations. Specifically, it includes the following steps.
[0025] S1: Data Acquisition and Collaborative Knowledge Graph Construction In this embodiment, the first step is to acquire source data related to agricultural products. As an optional implementation, the source data includes agricultural product attribute data and user interaction data. Specifically, agricultural product attribute data can be obtained from e-commerce platforms using web crawling technology. In a specific example, the "Houyi Data Collector" is used to crawl semi-structured data such as the name, product number, origin, category, and price of agricultural products from the agricultural product section of the JD.com platform. The crawled raw data may contain incomplete, duplicate, or inconsistent structures, therefore data cleaning and preprocessing are required, including removing duplicate data, filling missing values, correcting erroneous data, and data standardization.
[0026] As an optional implementation method, the process of constructing an agricultural product knowledge graph in this embodiment is as follows: Figure 1 As shown, the process includes five key steps: data acquisition, data cleaning and preprocessing, knowledge extraction, entity alignment, and knowledge storage. Specifically, the data acquisition step uses web crawling technology to collect semi-structured agricultural product data from e-commerce platforms; the data cleaning and preprocessing step removes duplicate data, fills in missing values, corrects erroneous data, and standardizes the data; the knowledge extraction step identifies entities and their relationships from the cleaned data; the entity alignment step ensures semantic consistency through entity disambiguation and coreference resolution; and the knowledge storage step uses a graph database to achieve persistent data storage.
[0027] A knowledge graph of agricultural product attributes is constructed based on the cleaned agricultural product attribute data. This embodiment defines seven entity types: product number, price, store, place of origin, category, storage conditions, and cooking suggestions. The "product number" serves as the unique identifier for the agricultural product. Six semantic relationships are also defined: a "price-owning" relationship between product and price; a "sold by..." relationship between product and store; a "sourced from" relationship between product and place of origin; a "belongs to" relationship between product and category; a "stored in" relationship between product and storage conditions; and a "cooking method is..." relationship between product and cooking suggestions.
[0028] In this embodiment, to ensure a concise and clear knowledge graph structure, the "product number" is used as the unique identifier for agricultural products, and entities of other categories are associated as their attribute nodes. For example... Figure 2 As shown, a single agricultural product knowledge graph illustrates the "ownership price" relationship between a product and its price, the "sold by..." relationship between a product and its store, the "source of" relationship between a product and its place of origin, the "belongs to" relationship between a product and its category, the "stored in" relationship between a product and its storage conditions, and the "cooking method is" relationship between a product and its cooking suggestions.
[0029] As an optional implementation, this embodiment uses the graph database Neo4j for knowledge storage. Seven types of entities are modeled as nodes, and six semantic relationships are modeled as edges, forming a complete graph schema. For knowledge storage, this embodiment uses the graph database Neo4j as the core storage engine, achieving persistent storage and efficient management of the agricultural product knowledge graph. Visualization is achieved using the built-in visualization engine of the Neo4j Browser, supplemented by custom style configuration rules. For example... Figure 3 As shown, a force-directed layout algorithm is used in the layout process, which enables closely related nodes to cluster into a community structure, intuitively reflecting the inherent relational patterns of agricultural product knowledge. Node coloring follows semantic encoding principles, with different entity types using differentiated color schemes to enhance the readability of the graph.
[0030] Furthermore, to support personalized recommendations, this embodiment integrates user entities and their historical interaction relationships with agricultural product entities into the agricultural product attribute knowledge graph to construct a collaborative knowledge graph. Specifically, user interaction data is extracted from user review information on e-commerce platforms, and users are treated as a special type of entity and added to the knowledge graph. Purchase behavior between users and agricultural products is represented by triples (user, purchase, agricultural product). By merging all user interaction triples with the aforementioned agricultural product attribute knowledge graph, a collaborative knowledge graph is formed, which can be represented as a set of triples. This represents the set of all entities after the addition of the user entity. This represents the set of all relationships after the purchase relationship is added.
[0031] It should be understood that in actual data processing, the number of comments for some popular agricultural products is extremely large. To avoid the graph size becoming too large and affecting subsequent calculation efficiency, this embodiment sets an upper limit on the maximum number of associated users for a single product, in order to control the graph size and improve computational feasibility.
[0032] S2: Embedding layer processing After the collaborative knowledge graph is constructed, this embodiment maps each user node, agricultural product node, and relation edge to a low-dimensional vector space to obtain an initial embedding vector.
[0033] As an optional implementation, the initial embedding vectors are respectively , , Where d is a predetermined dimension. In a specific example, the low-dimensional vector space has a dimension of 64. This dimension setting can better balance the expressive power and generalization ability of the model, avoiding the risks of underfitting due to too low a dimension or overfitting due to too high a dimension.
[0034] User embedding vectors are trained using historical user behavior data, mapping each user to a d-dimensional dense vector. This vector serves as a learnable parameter for the model, optimized through an end-to-end backpropagation algorithm. Agricultural product embedding vectors are learned from the attribute information of agricultural products, acting as a bridge connecting the recommendation space and the knowledge space. Entity and relation embeddings in the knowledge graph are obtained through graph learning methods. Entity embeddings capture semantic features such as category and origin, while relation embeddings define semantic operations for transformations between entities, such as "originates from" and "belongs to."
[0035] S3: Knowledge Graph Convolutional Layer Processing This embodiment utilizes a graph convolutional network to perform multi-layer information propagation within the collaborative knowledge graph, aggregating feature information from neighboring nodes and updating the embedding vectors of the agricultural product nodes. This process is the core of the model, aiming to provide richer feature representations for recommendation tasks by propagating information within the graph structure, allowing each node to learn and aggregate feature information from its neighbors.
[0036] The knowledge graph-based personalized recommendation method for agricultural products proposed in this embodiment has the following overall model architecture: Figure 4As shown, the architecture mainly consists of three core modules: an embedding layer, a knowledge graph convolutional layer, and a prediction layer. The embedding layer maps users, agricultural products, and entities and relationships in the knowledge graph to a low-dimensional vector space; the knowledge graph convolutional layer recursively aggregates neighbor node information along the relationship links of the knowledge graph through multiple layers of graph convolution operations; and the prediction layer calculates the interaction probability based on the updated user and agricultural product representations to generate a recommendation list.
[0037] In each layer of information propagation, this embodiment assigns personalized weights to different neighboring nodes based on the degree of matching between the embedding vector of the current user node and the embedding vector of the relation edge associated with the neighboring node, and aggregates the feature information of the neighboring nodes based on the personalized weights.
[0038] Specifically, for user u and relation r, the degree of matching is determined by calculating the inner product of the embedding vector of the user node and the embedding vector of the relation edge: in, For users and relationships Match scores between them and users respectively and relationships Embedded representation, It is an inner product function. express right The importance of this relationship lies in the matching weight between users and the relationships, which characterizes the intensity of a user's interest in a certain type of semantic relationship. For example, some users are more concerned with the relationship with "place of origin" ("originates from"), while others may be more concerned with the relationship with "category" ("belongs to").
[0039] Furthermore, to prevent excessively disparate weight distributions and to ensure comparability of weights among different neighbors, this embodiment normalizes the personalized weights. For the neighbor entity e of agricultural product node i, its corresponding normalized weight is calculated using the following formula: in Let represent the set of neighboring nodes of agricultural product node i, and let e represent the neighboring entity.
[0040] Based on the above weights, the neighborhood representation of agricultural product node i from user u's perspective can be expressed as the weighted sum of the embeddings of all neighboring entities of that node: It should be understood that, due to the significant differences in the neighborhood size of entities in the knowledge graph, in order to maintain the controllability of the computation graph structure, this embodiment adopts a sampling strategy to select a preset number K neighbor nodes from the neighbor nodes of each agricultural product node. ,satisfy Construct the receptive field of this agricultural product node. For example... Figure 5 As shown in the figure, an example of a two-layer receptive field for a given entity is illustrated, where K is set to 2. This design allows the model to fully capture users' differentiated preferences for item attribute dimensions while controlling computational complexity.
[0041] As an optional implementation, the sampling strategy is a uniform sampling strategy, and the preset quantity K is a fixed value.
[0042] As an optional implementation, the graph convolutional network has three information propagation layers. With this setting, the model can fully aggregate effective semantic information within a 2-3 hop range from the agricultural product knowledge graph, avoiding the loss of higher-order information due to too few layers, and also preventing the introduction of noisy entities due to too many layers.
[0043] S4: Prediction Layer Processing After multiple layers of information propagation, this embodiment calculates the interaction probability between users and candidate agricultural products based on the updated user node embedding vector and agricultural product node embedding vector, and generates a recommendation list based on the interaction probability.
[0044] Specifically, the final representation vectors of user u and agricultural product i obtained after H layers of convolution are denoted as follows: The prediction layer uses vector inner product as the interaction function to measure the degree of matching between user preference vectors and agricultural product feature vectors in a unified semantic space. The prediction function has the following form: The model output is the estimated probability of positive interaction between users and agricultural products. A higher score indicates that the agricultural product is more in line with the user's historical interests and potential needs.
[0045] During the model training phase, for implicit feedback scenarios, this embodiment employs negative sampling techniques to construct training samples. For each positive sample... Sampling K negative samples Construct the training set: Based on this, the binary cross-entropy loss function is used for model optimization: It is the binary cross-entropy loss function: in, These are model parameters, including embedding vectors for users, entities, and relationships, as well as linear transformation weights and biases for each aggregator layer. This is the L2 regularization coefficient, used to suppress overfitting and improve generalization ability.
[0046] To ensure the stability and reproducibility of model training results, this embodiment sets the key parameters uniformly. As shown in Table 1, the vector embedding dimension is set to 64 dimensions, the domain layer of the graph convolutional network is set to 3 layers, the batch size is set to 128, the L2 regularization coefficient is set to 1e-4, the dropout rate is set to 0.2, and the negative sampling ratio is set to 1:1. These parameter configurations effectively balance the model's expressive power and generalization ability, improving recommendation performance.
[0047] Table 1 Parameter Settings As an alternative implementation, for explicit feedback scenarios, the mean squared error loss function can be used to directly fit the specific score value.
[0048] Through the aforementioned end-to-end joint training, the error signal of the prediction layer is backpropagated to the embedding layer and the convolutional layer, ensuring that the semantic features extracted from the knowledge graph can most effectively serve the final agricultural product recommendation task, thereby achieving more accurate personalized matching.
[0049] S5: Experimental Verification and Technical Results To verify the technical effectiveness of the method proposed in this embodiment, a comparative experiment was conducted on a real agricultural product dataset. For example... Figure 6 As shown, our method outperforms benchmark models such as SVD, MF, CKE, and RippleNet on both the two core evaluation metrics, Recall@20 and NDCG@20. Experimental results demonstrate that our method effectively improves the accuracy and personalization of agricultural product recommendations by deeply integrating knowledge graphs with graph convolutional networks and introducing a personalized attention mechanism for users and relationships.
[0050] As an optional implementation, this embodiment performs sensitivity analysis on key parameters. For example... Figure 7 As shown, the model performance reaches its optimal level when the vector embedding dimension is set to 64 dimensions; further increasing the dimension actually leads to a decrease in performance. Figure 8 As shown, when the number of information propagation layers in the graph convolutional network is set to 3, the model can achieve the best balance between fully aggregating high-order semantic information and avoiding the introduction of noise. Example 2
[0051] This embodiment provides a knowledge graph-based personalized recommendation system for agricultural products. This system corresponds to the method described in Embodiment 1 and is used to implement the aforementioned recommendation method. It includes a data acquisition module, a collaborative knowledge graph construction module, an embedding module, a graph convolutional propagation module, and a prediction output module.
[0052] The data acquisition module is configured to acquire source data related to agricultural products, including agricultural product attribute data and user interaction data. Specifically, this module can use web crawler technology to obtain product information, attribute information, and user review information of agricultural products from e-commerce platforms, and then clean and preprocess the acquired data.
[0053] The collaborative knowledge graph construction module is configured to construct an agricultural product attribute knowledge graph based on the agricultural product attribute data, and to integrate user entities and their historical interaction relationships with agricultural product entities into the agricultural product attribute knowledge graph to construct a collaborative knowledge graph. This module extracts and stores entities and relationships according to predefined categories, forming a structured semantic network. The collaborative knowledge graph is represented as a set of triples. ,in This represents the set of all entities after the addition of the user entity. This represents the set of all relationships after the purchase relationship is added.
[0054] The embedding module is configured to map each user node, agricultural product node, and relation edge in the collaborative knowledge graph to a low-dimensional vector space to obtain an initial embedding vector. As an optional implementation, the initial embedding vectors are respectively... , , , where d is a predetermined dimension, such as 64 dimensions.
[0055] The graph convolutional propagation module is configured to utilize a graph convolutional network to perform multi-layer information propagation in the collaborative knowledge graph, aggregating feature information of neighboring nodes and updating the embedding vectors of the agricultural product nodes. Specifically, in each layer of information propagation, the module assigns personalized weights to different neighboring nodes based on the matching degree between the embedding vector of the current user node and the embedding vectors of the relation edges associated with neighboring nodes, and aggregates the feature information of neighboring nodes based on these personalized weights. As an optional implementation, the matching degree is determined by calculating the inner product of the embedding vector of the user node and the embedding vectors of the relation edges. The number of information propagation layers in the graph convolutional network can be set to three.
[0056] The prediction output module is configured to calculate the interaction probability between a user and candidate agricultural products based on the updated user node embedding vector and agricultural product node embedding vector, and generate a recommendation list according to the interaction probability. This module uses vector inner product operations to calculate the interaction probability and performs end-to-end optimization of the model using a binary cross-entropy loss function.
[0057] It should be understood that the specific implementation details of each of the above modules have been described in detail in Embodiment 1, and will not be repeated in this embodiment. In practical applications, the above modules can be integrated into a single computing device or distributed across multiple computing devices to achieve personalized agricultural product recommendation functionality.
[0058] In summary, this invention proposes a knowledge graph-based AI-driven personalized recommendation method and system for agricultural products, comprising: acquiring agricultural product attribute data and user interaction data; constructing an agricultural product attribute knowledge graph; integrating user entities and their historical interaction relationships with agricultural product entities into this graph to form a collaborative knowledge graph; mapping user nodes, agricultural product nodes, and relationship edges in the graph to a low-dimensional vector space to obtain initial embedding vectors; utilizing a graph convolutional network to perform multi-layer information propagation in the collaborative knowledge graph; assigning personalized weights to neighboring nodes based on the matching degree between the current user node embedding and the relationship edge embedding in each layer of propagation; and aggregating neighbor features based on these weights; calculating the interaction probability based on the updated user node embedding and agricultural product node embedding to generate a recommendation list. This invention can effectively alleviate the problems of data sparsity and cold start, and improve the accuracy and personalization of agricultural product recommendations.
[0059] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A knowledge graph-based AI-powered personalized recommendation method for agricultural products, characterized in that, include: Acquire source data related to agricultural products, including agricultural product attribute data and user interaction data; Based on the agricultural product attribute data, an agricultural product attribute knowledge graph is constructed. User entities and their historical interaction relationships with agricultural product entities are then integrated into this agricultural product attribute knowledge graph to construct a collaborative knowledge graph, which is represented as a set of triples. ,in This represents the set of all entities after the addition of the user entity. This represents the set of all relationships after a purchase relationship has been established; Each user node, agricultural product node, and relation edge in the collaborative knowledge graph is mapped to a low-dimensional vector space to obtain an initial embedding vector; A graph convolutional network is used to perform multi-layer information propagation in the collaborative knowledge graph to aggregate the feature information of neighboring nodes and update the node embedding vector in the collaborative knowledge graph. In each layer of information propagation, the personalized weights assigned to the neighboring nodes are determined based on the degree of matching between the embedding vector of the current user node and the embedding vector of the relation edge connected to the neighboring node, and the feature information of the neighboring nodes is aggregated based on the personalized weights. Based on the updated user node embedding vector and agricultural product node embedding vector, the interaction probability between users and candidate agricultural products is calculated, and a recommendation list is generated according to the interaction probability.
2. The method as described in claim 1, characterized in that, The construction of the agricultural product attribute knowledge graph includes: Multiple agricultural product entities and their attributes are extracted from the agricultural product attribute data. The attributes include at least one of the following: place of origin attribute, category attribute, price attribute, storage condition attribute, and cooking suggestion attribute. Determine the semantic relationships between agricultural product entities and attributes, wherein the semantic relationships include at least one of the following: source relationship, attribution relationship, price relationship, storage relationship, and cooking method relationship.
3. The method as described in claim 1, characterized in that, The initial embedding vectors are respectively , , , where d is the predetermined dimension.
4. The method as described in claim 1, characterized in that, The matching degree is calculated by multiplying the embedding vector of the user node with the embedding vector of the relation edge. It is confirmed that, among them, For users and relationships Match scores between them and users respectively and relationships Embedded representation, It is an inner product function. express right The importance of this is the matching weight between users and relationships. This personalized weight is normalized using the following formula: in Let represent the set of neighboring nodes of agricultural product node i, and let e represent the neighboring entity.
5. The method as described in claim 1, characterized in that, When using graph convolutional networks for multi-layer information propagation, a sampling strategy is employed to select a predetermined number of K neighboring nodes from the neighboring nodes of each agricultural product node. ,satisfy Construct the receptive field of this agricultural product node.
6. The method as described in claim 5, characterized in that, The sampling strategy is a uniform sampling strategy, and the preset quantity K is a fixed value.
7. The method as described in claim 1, characterized in that, The graph convolutional network has 3 layers for information propagation.
8. The method as described in claim 1, characterized in that, The low-dimensional vector space has a dimension of 64.
9. The method as described in claim 1, characterized in that, The interaction probability is calculated using a binary cross-entropy loss function for model optimization. Where D is the training sample set, , As a positive sample, For negative samples, For model parameters, This is the regularization coefficient.
10. A knowledge graph-based AI-powered personalized recommendation system for agricultural products, characterized in that: include: The data acquisition module is configured to acquire source data related to agricultural products, including agricultural product attribute data and user interaction data. The collaborative knowledge graph construction module is configured to construct an agricultural product attribute knowledge graph based on the agricultural product attribute data, and to integrate user entities and their historical interaction relationships with agricultural product entities into the agricultural product attribute knowledge graph to construct a collaborative knowledge graph, which is represented as a set of triples. ,in This represents the set of all entities after the addition of the user entity. This represents the set of all relationships after a purchase relationship has been established; The embedding module is configured to map each user node, agricultural product node, and relation edge in the collaborative knowledge graph to a low-dimensional vector space to obtain an initial embedding vector. The graph convolutional propagation module is configured to use a graph convolutional network to propagate information in multiple layers in the collaborative knowledge graph, thereby aggregating the feature information of neighboring nodes and updating the node embedding vectors in the collaborative knowledge graph. In each layer of information propagation, personalized weights are assigned to different neighboring nodes based on the degree of matching between the embedding vector of the current user node and the embedding vectors of the relation edges associated with the neighboring nodes, and the feature information of the neighboring nodes is aggregated based on the personalized weights. The prediction output module is configured to calculate the interaction probability between users and candidate agricultural products based on the updated user node embedding vector and agricultural product node embedding vector, and generate a recommendation list based on the interaction probability.