Multi-modal knowledge graph completion negative sampling method and system in recommendation system
By extracting multimodal features and dynamically classifying relationship types through a pre-trained model, generating hard negative samples, and optimizing the loss function, the problem of low fusion and sampling efficiency in multimodal knowledge graph completion is solved, thus realizing efficient, accurate, and personalized recommendations in the recommendation system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DALIAN MARITIME UNIVERSITY
- Filing Date
- 2026-01-09
- Publication Date
- 2026-05-15
AI Technical Summary
Existing recommendation systems struggle to effectively integrate multimodal information such as text and images in multimodal knowledge graph completion, ignore semantic differences in relation types, exhibit low efficiency in negative sampling strategies, and face model update lag issues in dynamic recommendation scenarios, leading to a decline in recommendation performance.
By extracting multimodal features through a pre-trained model, dynamically classifying relationship types, injecting relationship information using a gating mechanism, generating hard negative samples using a denoising diffusion probability model, and optimizing the loss function by combining the knowledge graph scoring function, efficient completion of the multimodal knowledge graph is achieved.
It improves the link prediction accuracy and personalized recommendation quality of the recommendation system, solves the shortcomings of multimodal knowledge graphs in terms of real-time performance and accuracy, adapts to complex recommendation scenarios, and improves the accuracy and robustness of the recommendation system.
Smart Images

Figure CN122048469A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and recommendation system technology, and more particularly to a multimodal knowledge graph completion negative sampling method and system for recommendation systems. Background Technology
[0002] Recommender systems, as core tools for information filtering, rely on user behavior data and item attributes to generate personalized recommendations. In recent years, knowledge graphs have been introduced into recommender systems to enhance recommendation logic by leveraging semantic relationships between entities. For example, using triples composed of users, interactions, and items can effectively model user preferences; however, knowledge graphs often suffer from incompleteness, requiring link prediction to fill in missing relationships. Traditional recommender systems, however, primarily rely on collaborative filtering or shallow models, making it difficult to effectively integrate multimodal information such as text and images, and they face challenges related to data sparsity and dynamic evolution.
[0003] Multimodal knowledge graphs, by integrating heterogeneous data such as text and images, can more comprehensively represent entity semantics and provide rich context for recommendation systems. However, multimodal knowledge graph completion faces two major challenges: First, the semantic differences between relation types, such as one-to-one, one-to-many, many-to-one, and many-to-many, are ignored during multimodal fusion, resulting in insufficient entity representation discriminability and affecting the judgment of recommendation relevance. Second, negative sampling strategies are inefficient, generating a large number of simple negative samples through random sampling, while some generative methods lack attention to local semantic boundaries, making it difficult to generate hard negative samples adjacent to positive samples, thus limiting the model's ability to fine-grainedly segment user interests.
[0004] Existing methods, such as pure structural models like TransE and DistMult, cannot utilize multimodal information; multimodal fusion methods like AdaMF can adaptively integrate different modalities, but they are not optimized for relation cardinality; negative sampling methods like KBGAN or MIRANS can improve sampling quality, but they do not solve the concept drift problem in dynamic recommendation scenarios. Furthermore, these methods struggle to balance real-time performance and accuracy when applied to recommendation systems, especially when dealing with massive streaming data, where model update lag leads to decreased recommendation performance. Therefore, there is an urgent need for a multimodal knowledge graph completion method that can dynamically adapt to relation types, efficiently generate hard negative samples, and tightly couple with recommendation logic. Summary of the Invention
[0005] In view of this, the purpose of this invention is to propose a negative sampling method and system for multimodal knowledge graph completion in recommendation systems, so as to solve the existing technical problem of difficulty in balancing real-time performance and accuracy.
[0006] The technical means employed in this invention are as follows: A negative sampling method for multimodal knowledge graph completion in a recommender system includes the following steps: S1: Obtain structured information of multimodal knowledge graphs in real time from the multi-source data stream of the recommendation system. The structured information includes entity sets, relation sets, text description sets, visual image sets, and fact triple sets. Perform feature extraction, dimension alignment, and normalization on the structured information through a pre-trained model to obtain pre-processed multimodal data. The pre-processed multimodal data includes text embeddings, visual embeddings, structural embeddings, and relation embeddings. S2: Based on the preprocessed multimodal data, the relation types are dynamically classified according to the cardinality of the relations, and the relation information is adaptively injected into the entity representation using a gating mechanism to generate multimodal entity embeddings with high semantic accuracy; S3: Use a denoising diffusion probability model to learn the distribution of multimodal entity embeddings, generate hard negative sample embeddings through spherical linear interpolation, and dynamically adjust the interpolation coefficients to realize the course learning strategy. S4: Combining the knowledge graph scoring function, positive samples are constructed based on the set of fact triples and their corresponding multimodal entity embeddings, and compared with hard negative samples. The total loss function is constructed and optimized, and the model parameters are updated to improve the accuracy of link prediction. The trained model parameters and optimized embedding representations are obtained. S5: Based on the trained model parameters and optimized embedding representation, output the completed knowledge graph and integrate it into the recommendation system to generate personalized recommendation results.
[0007] Furthermore, S1 specifically includes the following steps: S11: Obtain multimodal knowledge graph data, including entity sets, from the data source of the recommender system. Relation sets Text description set Visual image collection and the set of fact triples ; S12: Extracting text embeddings using the pre-trained BERT model Visual embeddings were extracted using the pre-trained model VGG-16. Multiple instance features are aggregated using average pooling; S13: Mapping textual and visual features to a unified dimension using a two-layer projection network. The entity embedding space is given by the formula: (1) in, , This is the weight matrix. , Here, ReLU is the bias vector, and ReLU is the activation function. S14: Embedding of Structures and relational embedding The learnable parameters are initialized and normalized to the range [-1,1] to complete the data preprocessing.
[0008] Furthermore, S2 specifically includes the following steps: S21: Calculation Relationship Average head entity cardinality and the cardinality of the average tail entity The formula is: , (2) in, For relationship The head entity set, For relationship The set of tail entities; S22: Classify the relation into 1-1, 1-N, N-1 or NN type based on the threshold of 1.5; S23: Perform basic fusion on entity multimodal embeddings, and generate initial joint representations using average pooling. ; S24: Embedding Relationships Projecting onto physical space, the formula is:
[0009] in, and These are projection parameters; S25: Use a gated function based on the relation type. Dynamically inject relationship information in the gate function and For learnable network parameters, This indicates a splicing operation. It's the sigmoid function: For 1-1 relationships: do not inject relationship information, retain the basic embedding. (3) For 1-N relations: the semantics of the tail entity depend more on the relation. Therefore, only relational information is integrated into the tail entity: (4) For N-1 relations: only the relation information is merged into the head entity: (5) For NN relations: Simultaneously fuse relation information: (6) in, This indicates the embedding of the head entity obtained through S23. This indicates the tail entity embedding obtained through S23. This represents element-wise multiplication, while and These represent the fused embedding of the head and tail entities after integrating relational information.
[0010] Furthermore, S3 specifically includes the following steps: S31: Train the denoised diffusion probability model to learn the entity embedding distribution, reshaping the one-dimensional entity embedding into a two-dimensional form. Let... Expanding dimensions by padding Then reshaped into And perform min-max normalization to the range [-1,1]; S32: The diffusion process includes forward noise addition and reverse noise reduction. Gaussian noise is added at time step t during the forward process. (7) in, For noise scheduling parameters; S33: The reverse process predicts noise using a U-Net network, with the loss function being: (8) in, from Uniform sampling It is random noise. It is the maximum time step; S34: For positive triplet Generate random negative triplets Perform spherical linear interpolation in the noise space: (9) in, These are interpolation coefficients. It is the angle between vectors; S35: Input the interpolation results into the diffusion model for denoising, and then inversely normalize to generate hard negative sample embeddings. and ; S36: Dynamically adjust interpolation coefficients The following learning strategies are adopted: (10) in, These are the initial coefficients. This is the final coefficient.
[0011] Furthermore, S4 specifically includes the following steps: S41: Using the RotatE scoring function to measure the rationality of ternary combinations: (11) in, , , Don't represent the complex embedding vectors of the head entity, tail entity, and relation. This represents element-wise multiplication; S42: Calculate the random negative sampling loss, introducing self-adversarial weights: (12) in, , It is the sigmoid function. It is the interval hyperparameter. It is a temperature parameter; S43: Calculate the hard negative sampling loss, including replacing the head and tail entities: (13) (14) The total hard negative sampling loss is ; S44: The total training loss is a weighted sum. (15) in, It is a balancing hyperparameter. It is a regularization term. It is the regularization coefficient; S45: Use the Adam optimizer for parameter optimization, and select hyperparameters through grid search.
[0012] Furthermore, S5 specifically includes the following steps: S51: Output the completed knowledge graph, which includes the complete embedded representations of all entities and relations; S52: Integrate knowledge graphs into the recommendation system for entity recommendation tasks; S53: Evaluate recommendation performance using link prediction metrics.
[0013] This invention also provides a multimodal knowledge graph completion negative sampling system for a recommendation system, used to implement any of the above-mentioned multimodal knowledge graph completion negative sampling methods in a recommendation system, comprising the following sequentially connected components: The data acquisition layer is used to extract multimodal knowledge graph data from the recommendation system and perform preprocessing. A relation type-aware fusion layer is used to dynamically fuse multimodal information and generate semantically accurate entity representations; A localized diffusion negative sampling layer is used to generate hard negative samples and implement course learning; The training optimization layer is used for updating and optimizing model parameters. The output layer is used to output the completed knowledge graph and apply it to recommendation tasks.
[0014] The present invention also provides a storage medium comprising a stored program, wherein, when the program is executed, the multimodal knowledge graph completion negative sampling method described above in any of the recommendation systems is performed.
[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the multimodal knowledge graph completion negative sampling method in any of the above recommendation systems through the computer program.
[0016] Compared with the prior art, the present invention has the following advantages: This invention provides a negative sampling method and system for multimodal knowledge graph completion in recommendation systems. It addresses the shortcomings of existing negative sampling methods in semantic awareness and the generation of locally challenging samples, which leads to low accuracy in recommendation systems. Given the diverse and complex nature of multimodal knowledge graph data, and considering the dynamic nature of relation types and the ambiguity of semantic boundaries, a relation type-aware adaptive fusion method is proposed. To address the issues of low negative sampling quality and the fusion strategy's inability to distinguish relation types, a localized diffusion interpolation negative sampling strategy is proposed, thereby achieving high-quality completion of the multimodal knowledge graph. This effectively improves the accuracy of link prediction and the quality of personalized recommendations in recommendation systems, enabling data completion in various recommendation scenarios such as e-commerce and content recommendation, and building accurate and robust recommendation systems. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the system structure of the present invention.
[0019] Figure 2 This is a schematic diagram of the relation type-aware adaptive fusion module of the present invention.
[0020] Figure 3 This is a diagram of the localized diffusion interpolation process in the negative sampling method of the present invention. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0023] like Figure 1 As shown, this invention provides a negative sampling method for multimodal knowledge graph completion in a recommendation system, comprising the following steps: S1: Obtain structured information of multimodal knowledge graphs in real time from the multi-source data stream of the recommendation system. The structured information includes entity sets, relation sets, text description sets, visual image sets, and fact triple sets. Perform feature extraction, dimension alignment, and normalization on the structured information through a pre-trained model to obtain pre-processed multimodal data. The pre-processed multimodal data includes text embeddings, visual embeddings, structural embeddings, and relation embeddings. S11: Obtain multimodal knowledge graph data, including entity sets, from the data source of the recommender system. Relation sets Text description set Visual image collection and the set of fact triples ; S12: Extracting text embeddings using the pre-trained BERT model Visual embeddings were extracted using the pre-trained model VGG-16. Multiple instance features are aggregated using average pooling; S13: Mapping textual and visual features to a unified dimension using a two-layer projection network. The entity embedding space is given by the formula: (1) in , This is the weight matrix. , Here, ReLU is the bias vector, and ReLU is the activation function. S14: Embedding of Structures and relational embedding Learnable parameters are initialized and normalized to the range of [-1,1] to complete data preprocessing. The overall output of S1 is standardized multimodal embedding data, including the initial embedding of entities and relations, which is used for subsequent fusion and sampling. S2: Based on the preprocessed multimodal data, the relation types are dynamically classified according to the cardinality of the relations, and the relation information is adaptively injected into the entity representation using a gating mechanism to generate multimodal entity embeddings with high semantic accuracy; S21: Calculation Relationship Average head entity cardinality and the cardinality of the average tail entity The formula is: , (2) in and Relationship The set of head and tail entities; S22: Classify the relation into 1-1, 1-N, N-1 or NN type based on the threshold of 1.5; S23: Perform basic fusion on entity multimodal embeddings, and generate initial joint representations using average pooling. ; S24: Embedding Relationships Projecting onto physical space, the formula is: ,in and These are projection parameters; S25: Use a gated function based on the relation type. Dynamically inject relationship information in the gate function and For learnable network parameters, This indicates a splicing operation. It's the sigmoid function: For 1-1 relationships: do not inject relationship information, retain the basic embedding. (3) For 1-N relations: the semantics of the tail entity depend more on the relation. Therefore, only relational information is integrated into the tail entity: (4) For N-1 relations: the semantics of the head entity depend more on the relation. Therefore, only relational information is integrated into the head entity: (5) For NN relations: both the head entity and the tail entity depend on the relation. Therefore, relational information is also integrated: (6) In formulas (4)-(6), This indicates the embedding of the head entity obtained through S23. This indicates the tail entity embedding obtained through S23. This represents element-wise multiplication, while and These represent the fused embedding of the head and tail entities after integrating relational information.
[0024] The input of S2 is the preprocessed data output by S1, and the output is the entity embedding after relation type-aware fusion, which enhances semantic discriminability and is used for subsequent negative sampling. S3: Use a denoising diffusion probability model to learn the distribution of multimodal entity embeddings, generate hard negative sample embeddings through spherical linear interpolation, and dynamically adjust the interpolation coefficients to realize the course learning strategy. S31: Train the denoised diffusion probability model to learn the entity embedding distribution, reshaping the one-dimensional entity embedding into a two-dimensional form. Let... Expanding dimensions by padding Then reshaped into And perform min-max normalization to the range [-1,1]; S32: The diffusion process includes forward noise addition and reverse noise reduction. Gaussian noise is added at time step t during the forward process. (7) in For noise scheduling parameters; S33: The reverse process predicts noise using a U-Net network, with the loss function being: (8) in from Uniform sampling It is random noise. It is the maximum time step; S34: For positive triplet Generate random negative triplets Perform spherical linear interpolation in the noise space: (9) in, These are interpolation coefficients. It is the angle between vectors; S35: Input the interpolation results into the diffusion model for denoising, and then inversely normalize to generate hard negative sample embeddings. and ; S36: Dynamically adjust interpolation coefficients The following learning strategies are adopted: (10) in and and represent the initial and final coefficients, respectively, and is the number of warm-up cycles. The input to S3 is the fused entity embedding output from S2, and the output is a hard negative sample generated through a diffusion model and interpolation, used for subsequent training and optimization. S4: Combining the knowledge graph scoring function, positive samples are constructed based on the set of fact triples and their corresponding multimodal entity embeddings, and compared with hard negative samples. The total loss function is constructed and optimized, and the model parameters are updated to improve the accuracy of link prediction. The trained model parameters and optimized embedding representations are obtained. S41: Using the RotatE scoring function to measure the rationality of ternary combinations: (11) in , , Don't represent the complex embedding vectors of the head entity, tail entity, and relation. This represents element-wise multiplication; S42: Calculate the random negative sampling loss, introducing self-adversarial weights: (12) in , It is the sigmoid function. It is the interval hyperparameter. It is a temperature parameter; S43: Calculate the hard negative sampling loss, including replacing the head and tail entities: (13) (14) The total hard negative sampling loss is ; S44: The total training loss is a weighted sum. (15) in It is a balancing hyperparameter. It is a regularization term. It is the regularization coefficient; S45: Parameter optimization is performed using the Adam optimizer, with hyperparameters selected via grid search. The inputs to S4 are the positive and hard negative samples output from S2 and S3, and the outputs are the trained model parameters and the optimized scoring function, used for the final output. S5: Based on the trained model parameters and optimized embedding representation, output the completed knowledge graph and integrate it into the recommendation system to generate personalized recommendation results.
[0025] S51: Output the completed knowledge graph, including the full embedded representation of all entities and relations; S52: Integrate knowledge graphs into recommendation systems for entity recommendation tasks, such as given a user query. Predict the tail entity t as the recommended item; S53: Evaluate recommendation performance using link prediction metrics, including MRR, Hit@1, Hit@3, and Hit@10. S5 takes the model parameters output from S4 as input and outputs the completed knowledge graph and recommendation results, thus completing the entire process. Table 1 shows a comparison of the link prediction performance of the method of this invention on three commonly used multimodal knowledge graph completion datasets: DB15K, MKG-W, and MKG-Y. This covers three mainstream methods: single-modal knowledge graph completion models (such as TransE and DistMult), multimodal knowledge graph completion models (such as IKRL and AdaMF), and negative sampling-based models (such as KBGAN and DHNS). By comparing metrics such as MRR, Hit@1, Hit@3, and Hit@10, it can be seen that the method of this invention outperforms existing technologies in all metrics, especially in handling complex relationships. This is attributed to the synergistic effect of relationship type-aware fusion and localized diffusion negative sampling mechanisms, which effectively improve the accuracy and robustness of knowledge graph completion.
[0026] Table 1 Comparison of Relinking Prediction Performance of the Method of the Present Invention
[0027] In recommender system applications, the comparison results in Table 1 directly demonstrate the practical value of the method of this invention: a higher MRR index indicates better average quality of the recommendation results, helping users find content of interest more quickly; an improvement in Hit@1 means higher accuracy of the first recommended item, enhancing the user experience; optimizations in Hit@3 and Hit@10 ensure the diversity and coverage of the recommendation list, avoiding over-concentration. These improvements collectively drive the performance improvement of recommender systems in e-commerce, content distribution, and other scenarios, achieving more accurate personalized services.
[0028] This invention also provides a multimodal knowledge graph completion negative sampling system for recommendation systems, used to implement a multimodal knowledge graph completion negative sampling method in any recommendation system, including a data acquisition layer, a relation type-aware fusion layer, a localization diffusion negative sampling layer, and an output layer: The data acquisition layer is used to extract multimodal knowledge graph data from the recommendation system and perform preprocessing. A relation type-aware fusion layer is used to dynamically fuse multimodal information and generate semantically accurate entity representations; A localized diffusion negative sampling layer is used to generate hard negative samples and implement course learning; The training optimization layer is used for updating and optimizing model parameters. The output layer is used to output the completed knowledge graph and apply it to recommendation tasks.
[0029] The data acquisition layer further includes a text encoding module, a visual encoding module, and a projection module; the relation type-aware fusion layer further includes a relation cardinality calculation module, a relation classification module, and a gating fusion module; the localized diffusion negative sampling layer further includes a diffusion model training module, an interpolation module, and a dynamic coefficient adjustment module; the training optimization layer further includes a scoring function module, a loss calculation module, and an optimizer module; and the output layer further includes a knowledge graph storage module and a recommendation interface module.
[0030] The present invention also provides a storage medium comprising a stored program, wherein, when the program is executed, a multimodal knowledge graph completion negative sampling method is performed.
[0031] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes a multimodal knowledge graph completion negative sampling method through the computer program.
[0032] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A negative sampling method for multimodal knowledge graph completion in a recommender system, characterized in that, Includes the following steps: S1: Obtain structured information of multimodal knowledge graphs in real time from the multi-source data stream of the recommendation system. The structured information includes entity sets, relation sets, text description sets, visual image sets, and fact triple sets. Perform feature extraction, dimension alignment, and normalization on the structured information through a pre-trained model to obtain pre-processed multimodal data. The pre-processed multimodal data includes text embeddings, visual embeddings, structural embeddings, and relation embeddings. S2: Based on the preprocessed multimodal data, the relation types are dynamically classified according to the cardinality of the relations, and the relation information is adaptively injected into the entity representation using a gating mechanism to generate multimodal entity embeddings with high semantic accuracy; S3: The distribution of multimodal entity embeddings is learned using a denoising diffusion probability model. Hard negative sample embeddings are generated through spherical linear interpolation, and the interpolation coefficients are dynamically adjusted to realize the course learning strategy. S4: Combining the knowledge graph scoring function, positive samples are constructed based on the set of fact triples and their corresponding multimodal entity embeddings, and compared with hard negative samples. The total loss function is constructed and optimized, and the model parameters are updated to improve the accuracy of link prediction. The trained model parameters and optimized embedding representations are obtained. S5: Based on the trained model parameters and optimized embedding representation, output the completed knowledge graph and integrate it into the recommendation system to generate personalized recommendation results.
2. The multimodal knowledge graph completion negative sampling method in the recommendation system according to claim 1, characterized in that, S1 specifically includes the following steps: S11: Obtain multimodal knowledge graph data, including entity sets, from the data source of the recommender system. Relation sets Text description set Visual image collection and the set of fact triples ; S12: Extracting text embeddings using the pre-trained BERT model Visual embeddings were extracted using the pre-trained model VGG-16. Multiple instance features are aggregated using average pooling; S13: Mapping textual and visual features to a unified dimension using a two-layer projection network. The entity embedding space is given by the formula: (1) in, , This is the weight matrix. , Here, ReLU is the bias vector, and ReLU is the activation function. S14: Embedding of Structures and relational embedding The learnable parameters are initialized and normalized to the range [-1,1] to complete the data preprocessing.
3. The multimodal knowledge graph completion negative sampling method in the recommendation system according to claim 1, characterized in that, S2 specifically includes the following steps: S21: Calculation Relationship Average head entity cardinality and the cardinality of the average tail entity The formula is: , (2) in, For relationship The head entity set, For relationship The set of tail entities; S22: Classify the relation into 1-1, 1-N, N-1 or NN type based on the threshold of 1.5; S23: Perform basic fusion on entity multimodal embeddings, and generate initial joint representations using average pooling. ; S24: Embedding Relationships Projecting onto physical space, the formula is: in, and These are projection parameters; S25: Use a gated function based on the relation type. Dynamically inject relationship information in the gate function and For learnable network parameters, This indicates a splicing operation. It's the sigmoid function: For 1-1 relationships: do not inject relationship information, retain the basic embedding. (3) For 1-N relations: the semantics of the tail entity depend more on the relation. Therefore, only relational information is integrated into the tail entity: (4) For N-1 relations: only the relation information is merged into the head entity: (5) For NN relations: Simultaneously fuse relation information: (6) in, This indicates the embedding of the head entity obtained through S23. This indicates the tail entity embedding obtained through S23. This represents element-wise multiplication. and These represent the fused embedding of the head and tail entities after integrating relational information.
4. The multimodal knowledge graph completion negative sampling method in the recommendation system according to claim 1, characterized in that, S3 specifically includes the following steps: S31: Train the denoised diffusion probability model to learn the entity embedding distribution, reshaping the one-dimensional entity embedding into a two-dimensional form. Let... Expanding dimensions by padding Then reshaped into And perform min-max normalization to the range [-1,1]; S32: The diffusion process includes forward noise addition and reverse noise reduction. Gaussian noise is added at time step t during the forward process. (7) in, For noise scheduling parameters; S33: The reverse process predicts noise using a U-Net network, with the loss function being: (8) in, from Uniform sampling It is random noise. It is the maximum time step; S34: For positive triplet Generate random negative triplets Perform spherical linear interpolation in the noise space: (9) in, These are interpolation coefficients. It is the angle between vectors; S35: Input the interpolation results into the diffusion model for denoising, and then inversely normalize to generate hard negative sample embeddings. and ; S36: Dynamically adjust interpolation coefficients The following learning strategies are adopted: (10) in, These are the initial coefficients. This is the final coefficient.
5. The multimodal knowledge graph completion negative sampling method in the recommendation system according to claim 1, characterized in that, S4 specifically includes the following steps: S41: Using the RotatE scoring function to measure the rationality of ternary combinations: (11) in, , , Don't represent the complex embedding vectors of the head entity, tail entity, and relation. This represents element-wise multiplication; S42: Calculate the random negative sampling loss, introducing self-adversarial weights: (12) in, , It is the sigmoid function. It is the interval hyperparameter. It is a temperature parameter; S43: Calculate the hard negative sampling loss, including replacing the head and tail entities: (13) (14) The total hard negative sampling loss is ; S44: The total training loss is a weighted sum. (15) in, It is a balancing hyperparameter. It is a regularization term. It is the regularization coefficient; S45: Use the Adam optimizer for parameter optimization, and select hyperparameters through grid search.
6. The multimodal knowledge graph completion negative sampling method in the recommendation system according to claim 1, characterized in that, S5 specifically includes the following steps: S51: Output the completed knowledge graph, which includes the complete embedded representations of all entities and relations; S52: Integrate knowledge graphs into the recommendation system for entity recommendation tasks; S53: Evaluate recommendation performance using link prediction metrics.
7. A multimodal knowledge graph completion negative sampling system for a recommendation system, used to implement the multimodal knowledge graph completion negative sampling method for the recommendation system according to any one of claims 1-6, characterized in that, Including those connected sequentially: The data acquisition layer is used to extract multimodal knowledge graph data from the recommendation system and perform preprocessing. A relation type-aware fusion layer is used to dynamically fuse multimodal information and generate semantically accurate entity representations; A localized diffusion negative sampling layer is used to generate hard negative samples and implement course learning; The training optimization layer is used for updating and optimizing model parameters. The output layer is used to output the completed knowledge graph and apply it to recommendation tasks.
8. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, it performs the multimodal knowledge graph completion negative sampling method in the recommendation system according to any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the multimodal knowledge graph completion negative sampling method in the recommendation system according to any one of claims 1 to 6 through the computer program.