A science popularization content generation method based on knowledge graph constraint and multi-modal alignment
By using knowledge graph constraints and multimodal alignment, the problems of inaccurate factual descriptions and semantic disconnect between multimodal information in the generation of popular science content are solved. This enables the generation of logically rigorous and factually accurate multimodal popular science content, which is suitable for highly rigorous popular science scenarios and has wide applicability.
Patent Information
- Application Number
- CN202610838667.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-07-14
AI Technical Summary
Existing methods for generating popular science content suffer from problems such as inaccurate factual descriptions, lack of scientific logic, and semantic disconnect between multimodal information, making it difficult to generate logically rigorous, factually accurate, and expressive multimodal popular science content.
By employing a knowledge graph constraint and multimodal alignment approach, and constructing a knowledge graph extraction module, a logical path planning module, a knowledge-constrained text generation module, and a multimodal semantic alignment module, we achieve deep decoupling and precise mapping between the generated content and objective scientific facts. We also utilize knowledge masking technology and contrastive learning algorithms to apply rigid constraints, ensuring the accuracy and logical consistency of the generated content.
It significantly improves the factual accuracy and logical coherence of popular science content, achieves entity-level deep alignment between text and visual content, and generates multimodal popular science content that is logically rigorous, factually accurate, and expressive. It is suitable for highly rigorous popular science scenarios and has wide applicability.
Smart Images

Figure CN122391411A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and information processing technology, and in particular relates to a method for generating popular science content with knowledge graph constraints and multimodal alignment. Background Technology
[0002] In today's era of increasingly widespread digital information dissemination, science popularization, as a crucial bridge connecting cutting-edge scientific discoveries with public awareness, is undergoing a profound paradigm shift in its presentation and generation quality. With the rapid advancement of artificial intelligence technology, particularly the cross-integration of natural language processing, computer vision, and cross-modal understanding, the automated generation of science popularization content using generative AI has become a key path to alleviate the scarcity of high-quality science popularization resources and improve the efficiency of science outreach. Due to its specific knowledge dissemination attributes, science popularization content requires generated materials that not only possess high accessibility and engaging readability but also strictly adhere to the rigor of scientific facts and the integrity of logical chains. This presents the technology for automatically generating science popularization content with more stringent technical challenges than that for generating general content.
[0003] Existing automatic generation solutions for popular science content typically rely on large-scale pre-trained language models (LLMs) combined with multimodal generation frameworks. These solutions leverage statistical patterns learned by the models from massive corpora to quickly construct fluent and structurally complete text paragraphs based on given topics or keywords, supplemented with relevant visual images. This probabilistic prediction-based generation mechanism performs well in handling broad tasks such as creative writing or everyday communication, and through algorithmic innovations such as the introduction of attention mechanisms, it effectively enhances the diversity of generated content and the transferability of text style. However, with the continuous development of related technologies and the increasingly refined requirements for knowledge accuracy and logical depth in popular science applications, some inherent characteristics of the aforementioned technical solutions at the principle level are gradually revealing insurmountable limitations when addressing the professional challenges of popular science tasks.
[0004] The core technical contradiction in the generation of popular science content lies in the severe imbalance between the "degree of freedom in generation" and the "certainty of facts." The soul of popular science content lies in scientific facts, but the current mainstream large-scale generation models are essentially based on fitting the probability distribution of terms, lacking explicit modeling of the underlying objective physical laws or scientific logic system.
[0005] Specifically, this statistical probability-based reasoning model often produces the so-called "model illusion" phenomenon. In this phenomenon, the model, in its generation process, may fabricate seemingly reasonable but ultimately contradictory knowledge in pursuit of logical consistency. In fields with extremely low tolerance for error, such as biomedicine and aerospace, even minor factual deviations can directly lead to the collapse of the authority of popular science content and may even mislead the public into developing incorrect scientific understanding.
[0006] Although existing research attempts to introduce methods such as retrieval enhancement to provide external reference information, the generated texts often exhibit fragmented and superficial characteristics due to a lack of deep and structured understanding of the domain's knowledge structure. They are difficult to reproduce the knowledge deduction path that human experts demonstrate in popular science creation, which progresses from the superficial to the profound and is interconnected.
[0007] Furthermore, the quality of popular science content largely depends on the synergistic expressive effect of multimodal information (such as text, images, and videos). However, existing technologies, when handling multimodal alignment, often only achieve weak connections at the surface semantic level. This is because there is a natural "semantic gap" between textual and visual feature spaces when representing complex scientific concepts. For example, when explaining abstract concepts such as atomic structure or cell signal transduction, because multimodal models lack the ability to perceive the logical relationships between entities in the relevant domain's knowledge graph, the generated images often only capture macroscopic outlines and cannot accurately match the textual descriptions in terms of microscopic details, topological connections, and dynamic evolution processes. This "decoupling" between visual presentation and knowledge content not only reduces the explanatory power of popular science materials but also significantly diminishes the practical value of multimodal content in serious scenarios such as popular science education. In addition, existing constraint methods are mostly a posteriori filtering or correction methods, unable to achieve real-time, rigid constraints on the generation path from complex semantic relationships in the knowledge graph during the generation stage.
[0008] Existing methods for generating popular science content still face significant technical barriers and limitations in areas such as the deterministic maintenance of scientific logic, multimodal alignment of deep semantics, and dynamic injection of structured knowledge. This situation directly results in automatically generated popular science content failing to meet the practical application standards in the two core dimensions of "professional reliability" and "text-image collaboration."
[0009] Therefore, how to construct a strong constraint mechanism that can deeply integrate knowledge graphs and drive high-fidelity, deep alignment of cross-modal features to produce logically rigorous, factually accurate, and expressive multimodal popular science content has become a technical challenge that urgently needs to be overcome in the current technological evolution of natural language processing and multimodal learning. Summary of the Invention
[0010] The purpose of this invention is to provide a method for generating popular science content based on knowledge graph constraints and multimodal alignment, in order to solve the technical problems of inaccurate factual descriptions, lack of scientific logic, and semantic disconnect of multimodal information in the existing popular science content generation process.
[0011] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for generating popular science content based on knowledge graph constraints and multimodal alignment is proposed. At the system construction level, a collaborative architecture is established, consisting of a knowledge graph extraction module, a logical path planning module, a knowledge-constrained text generation module, a multimodal semantic alignment module, and a logical consistency verification module. By using a structured domain knowledge graph as the underlying rigid constraint of the generation process, deep decoupling and precise mapping between the generated content and objective scientific facts are achieved.
[0012] Includes the following steps: S1: Perform multi-dimensional semantic analysis on the input science popularization keywords, retrieve core entity nodes from the preset domain knowledge graph, and construct a science popularization task subgraph through a subgraph extraction strategy based on breadth-first search and path evaluation function.
[0013] In the knowledge graph extraction module's workflow, the system first performs semantic parsing on the input science popularization topic terms. Using an entity recognition algorithm based on a multi-head self-attention mechanism, it retrieves and extracts core entity nodes related to the science popularization topic terms from a pre-defined large-scale domain knowledge graph. The domain knowledge graph is organized using a Resource Description Framework (RDF), containing an entity set EE, a relation set RR, and an attribute set AA. Further, the system employs a subgraph extraction strategy based on breadth-first search and a path evaluation function. Using the core entity as the center, it expands outwards with k-order neighborhood relations to construct a science popularization task subgraph containing a complete logical chain. The path evaluation function comprehensively considers the semantic relevance between nodes, topological centrality, and the logical density of knowledge propagation; its mathematical expression is: ; in, f ( e n ) is an entity node e n The overall evaluation score; α Semantic relevance weighting coefficient, with a value range of 0.4 to 0.5; β γ: Topological centrality weight coefficient, with a value range of 0.2~0.3; γ: Relationship path weight coefficient, with a value range of 0.2~0.3; α+β +γ=1;Sim(C, e n ): Popular Science Theme CWith entity nodes e n Cosine similarity; Deg( e n ): Entity node e n The normalized degree of is the topological centrality, which reflects the importance of entity nodes; m Entity node e n The number of associated edges; W ( r i ): No. i Relationship r i The weights are predefined; the stronger the scientific logic, the higher the weight.
[0014] S2: Based on the science popularization task subgraph, the entity node type in the subgraph is identified through a heuristic knowledge reasoning algorithm. A path optimization algorithm based on depth-first traversal is used to determine the order of each knowledge point in the generated content, forming a knowledge presentation path.
[0015] In a preferred embodiment of the present invention, the logical path planning module utilizes the extracted science popularization task subgraph and, through a heuristic knowledge reasoning algorithm, automatically generates a knowledge presentation path that progresses from simple to complex and conforms to the audience's cognitive logic. The logical path planning module first identifies the basic definition nodes, principle analysis nodes, and application extension nodes in the subgraph, and then uses a path optimization algorithm based on depth-first traversal to determine the order of each knowledge point in the generated content. This process ensures that the generated science popularization content follows a narrative pattern from the known to the unknown and from the macro to the micro in its logical structure, thereby eliminating the problems of content fragmentation and logical jumps in existing technologies.
[0016] S3: It adopts a variational autoencoder structure that integrates external knowledge injection mechanism. During the decoding stage, it dynamically reshapes the vocabulary distribution through knowledge masking technology, so that the entities and their attributes pointed to by the current logical path are injected with prediction bias, generating popular science text that is rigidly constrained by the knowledge graph.
[0017] The above process is implemented through a knowledge-constrained text generation module, which employs a variational autoencoder structure that integrates an external knowledge injection mechanism. In the decoding phase, this invention does not rely solely on the statistical probability distribution of the pre-trained language model, but introduces a dynamic knowledge-guided vector. Specifically, during term generation at each time step t, the system reshapes the vocabulary distribution using knowledge masking technology. The knowledge mask dynamically increases the prediction probability of relevant terms based on the entity and its attributes pointed to by the current logical path. Its term prediction distribution... P ( w tThe calculation formula is: , in, P ( w t ):time t Output terms w t The final predicted probability; W h : Decoder hidden layer weight matrix; h t Decoder Moment t The hidden layer state vector; M t Knowledge mask bias matrix, positively enhancing the probability of words within the subgraph; The indicator function takes the value 1 if the term belongs to a subgraph entity or attribute, and 0 otherwise. This rigid constraint mechanism fundamentally eliminates model illusions, ensuring that every scientific term and logical connector generated is verifiable.
[0018] S4: By constructing a shared cross-modal semantic projection space, a contrastive learning algorithm based on knowledge graph guidance is introduced to achieve the coupling of textual description and visual representation of popular science texts at the entity level. The spatial relationship attributes in the popular science task subgraph guide the denoising iteration process of the diffusion model to generate visual content that conforms to scientific norms in terms of topological structure.
[0019] The above process is implemented through a multimodal semantic alignment module, which achieves deep coupling between text description and visual representation at the entity level by constructing a shared cross-modal semantic projection space. This multimodal semantic alignment module includes a visual feature extraction submodule based on a residual convolutional neural network and a text feature encoding submodule based on a multi-layer bidirectional Transformer. To overcome the "semantic gap" in the multimodal representation of scientific concepts, this invention introduces a contrastive learning algorithm guided by a knowledge graph. During the training phase, the system uses the entity definitions and their structural relationships in the knowledge graph as constraints for the triplet contrastive loss. Let the text feature vector be... v t The visual feature vector is v i The entity feature vector in the knowledge graph is v k The system minimizes the cross-modal contrastive loss function. To achieve alignment, the expression is: , Indicates cross-modal entity-level alignment loss; v i' Represents the feature vector of visual negative samples;v k λ represents the feature vector of the corresponding entity in the subgraph of the science popularization task; cos(·) represents the cosine similarity function; Δ represents the boundary interval threshold, which can be 0.2; λ represents the weight of the knowledge guidance factor, which ranges from 0.1 to 0.5. Indicates L2 regularization; j This indicates the sample index within the batch. In this way, the visual content generated by the system (such as schematic diagrams and structural diagrams) not only matches the text in terms of visual effect, but also strictly conforms to the scientific specifications defined by knowledge graphs in terms of topological structure and distribution of key components.
[0020] In a preferred embodiment of the present invention, the multimodal semantic alignment module utilizes spatial relationship attributes (such as "above" and "contains") from the knowledge graph to guide the attention weight distribution of the image generation model when generating visual content. During the denoising iteration of the diffusion model, the system transforms the spatial layout constraints extracted from the knowledge graph into guiding gradients, forcing the model to generate corresponding scientific entity representations in specific pixel regions. For example, when generating popular science content on cell structure, the entity "mitochondria" mentioned in the text will be directly associated with a pre-defined potential spatial region with specific morphological features in the image generator, thereby ensuring the professionalism and accuracy of the popular science image.
[0021] S5: Perform real-time detection on the generated text and image content, use the fact checker to perform isomorphic matching of predicate relations, and use the visual compliance checker to verify the connection relationship of visual components. If a conflict is found, a local backtracking mechanism is triggered for correction.
[0022] Step S5 is implemented through a logical consistency verification module, which serves as a closed-loop monitoring mechanism for the generation process, performing real-time detection on the generated text and image content. This module includes a fact checker based on Natural Language Inference (NLI) and a visual compliance checker based on image semantic segmentation. The fact checker converts each generated text sentence into a logical predicate expression and performs isomorphic matching with the original knowledge graph. If a conflict is found between the generated predicate relation and the facts in the graph, the system triggers a local backtracking mechanism, reactivating the knowledge constraint text generation module to correct the relevant paragraphs. The visual compliance checker uses an object detection algorithm to identify the generated image content and verifies whether the connection relationships between components in the image conform to the physical or biological constraints defined by the knowledge graph.
[0023] Preferably, the specific process of constructing the science popularization task subgraph containing a complete logical chain in step S1 is as follows: S11: Perform multi-head self-attention semantic encoding on the input science popularization topic C to obtain the topic semantic vector. VC Using a multi-head self-attention-based entity recognition algorithm, retrieve semantic vectors related to the topic from the domain knowledge graph. V C The core entity node set for semantic matching E core ; S12: With core entities E core Centered on the data, expand outwards using a breadth-first search. k By analyzing neighborhood relationships, we can obtain a set of candidate subgraph entity nodes and edges. S13: Calculate the path evaluation function: for each entity node in the candidate subgraph e n Calculate the comprehensive evaluation score f ( e n ), to screen high-value entity nodes; S14: Calculate the mean score of all candidate entity nodes. m with standard deviation s Delete those that meet the requirements f ( e n )< m - s Low-value peripheral branches are separated, while high-value entity nodes and relationships are retained to form the final science popularization task subgraph. KG sub .
[0024] Preferably, the specific process of step S2 is as follows: S21: Subgraphs for Science Popularization Tasks Based on Graph Convolutional Neural Networks KG sub Each entity node in e n Type annotations are performed, dividing them into three categories: basic definition class nodes. E def 、 Principle Analysis Nodes E pri Application extension nodes E app ; S22: Use depth-first traversal to search for paths, aiming to maximize the comprehensive weight of the paths F(P), and generate the optimal knowledge laying path; S23: Search for the optimal path according to the forced cognitive order constraint: Starting point constraint: must start from... E def Basic definition node starts; Inter-node constraints: priority traversal E pri Principle analysis nodes; endpoint constraints: with E appThe application extension node ends; during the traversal, the path with the largest comprehensive weight F(P) is retained as the candidate knowledge laying path; S24: For adjacent entity nodes in the path ( e u , e v Logical guide markers are inserted based on the relation type to form the final knowledge deployment path. P seq .
[0025] Preferably, the specific process of step S3 is as follows: S31: Knowledge Path Deposition via the Encoder of a Variational Autoencoder P seq Mapped to the latent semantic space, text is generated word by word through a decoder, with each step rigidly constrained by a knowledge mask; S32: At decoding time t, a bias is applied to the vocabulary probability distribution through a knowledge mask, prioritizing the output of entity or attribute words that the path points to; S33: Using gating mechanisms to dynamically balance general language features and knowledge graph features; S34: Generate corresponding entity node content based on rigid constraint generation rules: following the knowledge paving path in S2. P seq The content of the corresponding entity nodes is generated sequentially.
[0026] Preferably, the specific process of step S4 is as follows: S41: The popular science text generated in S3 is encoded using multi-layer bidirectional Transformer encoding to obtain the text feature vector. v t For visual materials or initial visual latent variables, a residual convolutional neural network is used to extract visual feature vectors. v i Construct a shared cross-modal semantic projection space to map text features, visual features, and knowledge graph entity features to the same semantic space; S42: Subgraph of Science Popularization Task KG sub The entity features serve as the semantic hub, minimizing cross-modal contrast loss and forcing textual and visual features to converge towards the same entity semantics; S43: From the Science Popularization Task Subgraph KG sub Extracting entity spatial relationship attributes, including containment, location, connection, hierarchy, and orientation, and transforming them into spatial layout constraint gradients that can be executed by the diffusion model. G space : S44: Spatial constraint gradient G spaceInject the self-attention weight matrix of the diffusion model to force the model to generate corresponding scientific entities in the specified pixel region during the denoising iteration, ensuring topological compliance; S45: Entity-level coupling and scientific visual content output: Text description and visual representation are aligned at the entity level within a shared semantic space; the diffusion model outputs popular science visual content with compliant structure, accurate position, and correct component relationships.
[0027] Preferably, the specific process of step S45 is as follows: S451: Latent Variable Decoding and Initial Image Generation in a Diffusion Model: Decoding Latent Variables in an Image After Denoising Iteration X T Perform decoder upsampling to generate the initial visual image. I 0; S452: Entity-level semantic-visual coupling binding: Constructing an entity-image region mapping table based on aligned text features, visual features, and entity features of the science popularization task subgraph. Map ( e k , R k , p k This enables a one-to-one binding between semantic entities and pixel regions in an image; S453: Based on entity-image region mapping table Map ( e k , R k , p k ), verify whether the topological relationships between entities in the image are consistent with the spatial relationship attributes of the science popularization task subgraph, and make local corrections to the deviation areas; S454: After completing the topology correction, output the final entity-level coupled science popularization visual content. I final And the entity-image region mapping relationship table Map ( e k , R k , p k )and I final Perform consistency verification.
[0028] Preferably, the specific process of step S5 is as follows: S51: Text Layer Validation: Based on Science Popularization Task Subgraph KG sub The generated science popularization text is subjected to predicate relation verification to determine whether the entity relations described in the text are isomorphically matched with the standard triples of the knowledge graph. Extracting text triples from popular science texts Triples T ; from KG sub Extracting the standard triplet set Triples KG ; Calculate the isomorphic match degree between text triples and standard triples, i.e., the text fact consistency score. Score fact ; when Score fact < t fact The text is determined to contain factual conflicts, triggering a partial backtracking. S52: Based on entity-image mapping table Map ( e k , R k , p k ), for popular science visual content I final Perform topological relationship verification to determine whether the connection or spatial relationship between entity components in the image is consistent with the topological relationship. KG sub The spatial relationship attributes are consistent: Extract the connectivity or spatial relationships between entity regions from an image to construct a set of image topological relationships; from KG sub Obtain the standard spatial relation set of corresponding entity pairs from the [source]. Computational vision topology consistency score Score vis ; when Score vis < t vis When a conflict is detected in the connection relationship of the visual components, a local backtracking is triggered. S53: Conflict Location and Local Backtracking Correction: Based on the verification results, locate the conflict type and location, and trigger the corresponding level of local backtracking mechanism for correction; S54: For the corrected text and image content, repeat the consistency check in steps S51 and S52 until... Score fact ≥ t fact and Score vis ≥ t vis Output consistent and logically coherent popular science text and image content.T* final and I* final .
[0029] Preferably, the modification of the local backtracking mechanism at the corresponding level in step S53 specifically includes: Correction of factual conflicts in texts: like Score fact < t fact Positioning conflict triples ( s i , p i , o i ), going back to S3, based on the knowledge laying path P seq and KG sub The standard triplet is used to re-execute the decoding and generation steps to correct conflicting text fragments; Visual topology conflict correction: like Score vis < t vis Locating conflicting entity pairs ( e p , e q ) and their corresponding image regions ( R p ,R q ), going back to the S4 denoising iteration stage, only the conflict region ( R p ,R q Apply an enhanced spatial constraint gradient, re-execute the denoising step for local fine-tuning, and leave the rest of the region unchanged.
[0030] The beneficial effects of this invention include: 1. Significantly improves the factual accuracy of popular science content and eliminates model illusions from the source: By constructing a subgraph of popular science tasks and using knowledge masking technology to rigidly constrain text generation, the model is forced to output only entities, attributes and relationships within the knowledge graph, so that the generated content is strictly anchored to objective scientific facts, the factual accuracy rate is greatly improved, and the occurrence rate of logical illusions is significantly reduced. It can be directly applied to popular science scenarios with high rigor requirements such as medicine, aerospace, physics and chemistry.
[0031] 2. Achieve logical narratives that conform to human cognitive patterns, with coherent and easy-to-understand content: Based on graph convolutional neural networks and depth-first traversal algorithms, it automatically plans a cognitively friendly knowledge presentation path from basic definitions to principle analysis to application extensions, and automatically inserts appropriate logical connectors, so that popular science content presents a complete logical chain that progresses from simple to complex and is interconnected, solving the problems of fragmented, disjointed, and poorly readable traditional content generation.
[0032] 3. Breaking down the semantic gap between text and images to achieve deep multimodal alignment at the entity level: By constructing a shared cross-modal semantic projection space and using knowledge graph entities as the semantic hub for comparative learning constraints, text descriptions and visual representations are precisely coupled at the entity level; at the same time, the spatial relationship attributes of the knowledge graph are used to guide the generation of diffusion models to ensure that the component positions, topological structures, and connection relationships of visual content fully comply with scientific norms, achieving deep collaboration between text and images and significantly improving the explanatory power of popular science.
[0033] 4. It has strong versatility and scalability, and is suitable for popular science scenarios in multiple fields: The method does not rely on knowledge of specific fields. It can be quickly adapted to vertical popular science fields such as biology, medicine, geography, astronomy, and engineering technology by simply replacing the underlying knowledge graph. At the same time, it supports audience adaptive adjustment and can generate popular science content of different depths for teenagers, the general public, and professionals. It has a wide range of applications and low cost. Attached Figure Description
[0034] Figure 1 This is a flowchart illustrating the method for generating popular science content based on knowledge graph constraints and multimodal alignment according to the present invention. Figure 2 This is a schematic diagram of the logical architecture of the knowledge-constrained text generation module in this invention; Figure 3 This is a schematic diagram illustrating the implementation principle of the multimodal semantic alignment module in this invention. Detailed Implementation
[0035] The following is in conjunction with the appendix Figure 1~Figure 3 The present invention will be further described in detail below: Example 1 See appendix Figure 1-Figure 3 As shown, a method for generating popular science content based on knowledge graph constraints and multimodal alignment is implemented based on a collaborative architecture consisting of a knowledge graph extraction module, a logical path planning module, a knowledge constraint text generation module, a multimodal semantic alignment module, and a logical consistency verification module. The method includes the following steps: S1: The knowledge graph extraction module performs multi-dimensional semantic analysis on the input popular science keywords, uses an entity recognition algorithm based on a multi-head self-attention mechanism to retrieve core entity nodes from the preset domain knowledge graph, and constructs a popular science task subgraph containing a complete logical chain through a subgraph extraction strategy based on breadth-first search and path evaluation function; wherein, the path evaluation function comprehensively considers the semantic relevance between nodes, topological centrality, and logical density of knowledge propagation.
[0036] S2: The logical path planning module uses the popular science task subgraph to identify the node types in the subgraph through a heuristic knowledge reasoning algorithm, and adopts a path optimization algorithm based on depth-first traversal to determine the order of each knowledge point in the generated content, forming a knowledge presentation path that conforms to the audience's cognitive logic.
[0037] S3: The knowledge-constrained text generation module adopts a variational autoencoder structure that integrates an external knowledge injection mechanism. During the decoding stage, the vocabulary distribution is dynamically reshaped through knowledge masking technology, so that the entities and their attributes pointed to by the current logical path are injected with prediction bias, generating popular science text that is rigidly constrained by the knowledge graph.
[0038] S4: The multimodal semantic alignment module constructs a shared cross-modal semantic projection space, introduces a contrastive learning algorithm guided by a knowledge graph, realizes the coupling of text description and visual representation of the popular science text at the entity level, and uses the spatial relationship attributes in the knowledge graph to guide the denoising iteration process of the diffusion model to generate visual content that conforms to scientific norms in terms of topological structure.
[0039] S5: The logical consistency verification module performs real-time detection on the generated graphic content, uses a fact checker to perform isomorphic matching of predicate relations, and uses a visual compliance checker to verify the connection relationship of visual components. If a conflict is found, a local backtracking mechanism is triggered for correction.
[0040] The specific process of constructing the science popularization task subgraph containing a complete logical chain in step S1 is as follows: S11: Multidimensional Semantic Parsing and Core Entity Retrieval Multi-head self-attention semantic encoding is performed on the input science popularization topic C to obtain the topic semantic vector. V C ; A multi-head self-attention-based entity recognition algorithm is used to retrieve semantic vectors related to the topic in a domain knowledge graph (KG). V C The core entity node set for semantic matching E core ; The domain knowledge graph is organized using RDF structure and defined as a triple: KG = {E, R, A}; Wherein, E: global entity set; R: set of relationships between entities, including causality, inclusion, spatial orientation, and attribute association; A: set of entity attributes, including numerical value, state, and spatial layout.
[0041] S12: Perform k-order neighborhood expansion and preliminary subgraph extraction: focusing on core entities E core Expand outwards from the center using breadth-first search (BFS). k By analyzing neighborhood relationships, we can obtain a set of candidate subgraph entity nodes and edges. k =2~4.
[0042] S13: Calculate the path evaluation function: for each entity node in the candidate subgraph e n Calculate the comprehensive evaluation score f ( e n ), Screening high-value entity nodes: ; in, f ( e n ) is an entity node e n The overall evaluation score; α Semantic relevance weighting coefficient, with a value range of 0.4 to 0.5; β γ: Topological centrality weight coefficient, with a value range of 0.2~0.3; γ: Relationship path weight coefficient, with a value range of 0.2~0.3; α+β +γ=1;Sim(C, e n ): Popular Science Theme C With entity nodes e n Cosine similarity; Deg( e n ): Entity node e n The normalized degree of is the topological centrality, which reflects the importance of entity nodes; m Entity node e n The number of associated edges; W ( r i ): No. i Relationship r i The weights are predefined; the stronger the scientific logic, the higher the weight.
[0043] S14: Dynamic Pruning and Subgraph Generation for Popular Science Tasks Calculate the mean score of all candidate entity nodes. m with standard deviation s ; Delete f ( e n )< m - s Low-value peripheral branches are separated, while high-value entity nodes and relationships are retained to form the final science popularization task subgraph. KG sub .
[0044] Example 2 Based on Example 1, the specific process of step S2 is as follows: S21: Entity Node Type Labeling: Subgraph for Science Popularization Task Based on Graph Convolutional Neural Network (GCN) KG sub Each entity node in e n Type annotations are performed, dividing them into three categories: basic definition class nodes. E def 、 Principle Analysis Nodes E pri Application extension nodes E app ; Node type annotation results: Type ( e n )∈{ E def , E pri , E app}; Type ( e n ): Entity node e n The type.
[0045] S22: Construct the path optimization objective function: Use depth-first traversal (DFS) to search for paths, with the goal of maximizing the comprehensive weight of the paths, to generate the optimal knowledge laying path; The formula for calculating the overall path weight is as follows: F(P) = λ1· S logical (P)+λ2· S cognitive (P)+λ3· S related (P); Where F(P) represents the comprehensive weight of path P; λ1: logical coherence weight, which can be 0.4; λ2: cognitive rationality weight, which can be 0.3; λ3: topic relevance weight, which can be 0.3; λ1+λ2+λ3=1; S logical : Path logical coherence score (based on relation type); S cognitive Cognitive friendliness score (scoring from definition → principle → application); S related : Topic relevance score, similar to cosine similarity in S1.
[0046] S23: Constrained Depth-First Search for Optimal Path: Searching for the optimal path by forcing a cognitive order constraint. Starting point constraint: Must start from E def The basic definition node begins; Intermediate constraints: priority passage E pri Principle analysis nodes; Endpoint constraint: E app Application extension node ends; During the traversal, the path with the largest comprehensive weight F(P) is retained as the candidate knowledge laying path.
[0047] S24: Automatic insertion of logical connectors: For adjacent entity nodes in the path ( e u , e v Logical guide markers are inserted based on the relation type to form the final knowledge deployment path. P seq ; The relationship matching rules are as follows: ; in, Conn. ( e u , e v ): Entity node e u and e v Logical connector between; R( e u , e v ):node e u arrive e v The relationship type.
[0048] The specific process of step S3 is as follows: S31: Employs a variational autoencoder (VAE) structure that integrates external knowledge injection: the knowledge path is laid out through the encoder of the variational autoencoder. P seq Mapped to the latent semantic space, text is generated word by word through a decoder, with each step rigidly constrained by a knowledge mask.
[0049] S32: Dynamically reshape the vocabulary distribution: At decoding time t, apply a bias to the vocabulary probability distribution through a knowledge mask, forcing the model to prioritize the output of entity or attribute words that the path points to; ; in, P ( w t ):time t Output terms w t The final predicted probability; W h : Decoder hidden layer weight matrix; h t Decoder Moment t The hidden layer state vector; M t Knowledge mask bias matrix, positively enhancing the probability of words within the subgraph; : Indicator function, takes the value 1 if the term belongs to a subgraph entity or attribute, otherwise takes the value 0.
[0050] S33: Perform gated feature fusion: Use a gating mechanism to dynamically balance general language features and knowledge graph features to ensure fluency and accuracy. ; ; in, : Dynamic gating weights, with values ranging from 0 to 1, output by the Sigmoid activation function; s : Sigmoid activation function; : Gating layer weight matrix; h lm : General semantic vectors output by pre-trained language models; h kg : Structured knowledge vectors of entities or attributes in a knowledge graph; W lm , W kg Semantic projection weight matrix; Element-wise product; h fuse : The final feature vector after gating fusion.
[0051] S34: Generate corresponding entity node content based on rigid constraint generation rules: following the knowledge paving path in S2. P seq The content of the corresponding entity nodes is generated sequentially. The rules for generating rigid constraints are as follows: Each decoding step only allows the generation of: The name and definition of the current entity; Entity attributes (values, status, relationships); Allowed logical connection words within a subgraph; Non-subgraph word probabilities are forcibly suppressed by a mask to ensure no illusions and no factual errors.
[0052] Example 3 Based on Example 1 or 2, the specific process of step S4 is as follows: S41: Cross-modal feature extraction and construction of shared semantic projection space: The popular science text generated by S3 is encoded using multi-layer bidirectional Transformer encoding to obtain text feature vectors. v t ; For visual materials or initial visual latent variables, a residual convolutional neural network is used to extract visual feature vectors. v i ; Construct a shared cross-modal semantic projection space to map text features, visual features, and knowledge graph entity features to the same semantic space.
[0053] S42: Comparative Learning Guided by Knowledge Graphs: Using Science Popularization Task Subgraphs KG sub Entity features serve as semantic centers, minimizing cross-modal contrast loss and forcing textual and visual features to converge towards the same entity semantics: ; in, Indicates cross-modal entity-level alignment loss; v i' Represents the feature vector of visual negative samples; v k λ represents the feature vector of the corresponding entity in the subgraph of the science popularization task; cos(·) represents the cosine similarity function; Δ represents the boundary interval threshold, which can be 0.2; λ represents the weight of the knowledge guidance factor, which ranges from 0.1 to 0.5. Indicates L2 regularization; j This indicates the sample index within the batch.
[0054] S43: Spatial Relationship Attribute Extraction and Constrained Gradient Generation: From the Subgraph of the Popular Science Task KG subExtract the spatial relationship attributes of entities, including containment, location, connection, hierarchy, and orientation, and transform them into spatial layout constraint gradients that can be executed by the diffusion model: ; in, G space Spatial layout constraint gradient; Spatial relationship → gradient mapping function; Rel space ( e p ,e q ): Entity node e p and e q Spatial relationship attributes between them; e p ,e q : Any two entity nodes in the science popularization task subgraph.
[0055] S44: Spatial Constraint-Guided Denoising Iteration of Diffusion Model: Denoising the Spatial Constraint Gradient G space Injecting the self-attention weight matrix of the diffusion model forces the model to generate corresponding scientific entities in specified pixel regions during denoising iterations, ensuring topological compliance: ; in, Att new Self-attention weights after adding spatial constraints; Att orig : Original self-attention weights in the diffusion model; or Spatial constraint strength coefficient, with a value range of 0.3 to 0.7; G space Spatial layout constraint gradient; Mask pos : Entity location mask, i.e., the area where pixels are generated.
[0056] S45: Entity-level Coupling and Scientific Visual Content Output: Textual descriptions and visual representations are aligned at the entity level within a shared semantic space; The diffusion model outputs popular science visual content with compliant structure, accurate positioning, and correct component relationships.
[0057] In this embodiment, the specific process of entity-level coupling and scientific visual content output in step S45 is as follows: S451: Latent Variable Decoding and Initial Image Generation in a Diffusion Model: Decoding Latent Variables in an Image After Denoising Iteration X TPerform decoder upsampling to generate the initial visual image. I 0: I 0 = Dec( X T ; i D ); in, I 0: Initial science image generated by decoding; Dec(·); i D ): Diffusion model decoder i D These are the trainable parameters for the decoder.
[0058] S452: Entity-level Semantic-Visual Coupling Binding: Based on aligned text features, visual features, and entity features of the science popularization task subgraph, an entity-image region mapping relationship is constructed to achieve one-to-one binding between semantic entities and pixel regions in the image. ; in, Map ( e k , R k , p k ): Entity-image region mapping table, containing three core fields: e k The k-th entity node in the science popularization task subgraph; R k : The pixel region (bounding box) of the corresponding entity in the image x 1, y 1, x 2, y 2]); p k : Semantic matching confidence between entity regions and text entities; v t,k In the popular science text generated by S3, entity nodes e k The corresponding text feature vector (from the cross-modal feature encoding in step 2); v i,k Initial visual image I In 0, the first k Visual feature vectors of candidate regions; cos(·): cosine similarity function, used to measure the semantic matching degree between text and visual features; argmax k : Regarding the first k For each entity node, the image region with the highest semantic similarity is selected as its binding region.
[0059] S453: Secondary Verification and Local Correction of Topological Compliance: Based on Entity-Image Region Mapping Relationship Table Map ( e k , R k , p k ), verify whether the topological relationships between entities in the image are consistent with the spatial relationship attributes of the science popularization task subgraph, and perform local corrections on the deviation areas: ; in, This is the topology compliance loss function, used to measure the deviation between the image topology and the standard knowledge graph topology; e p ,e q This refers to a pair of entity nodes that have a spatial relationship within the subgraph of the science popularization task. R p ,R q For entities e p ,e q The corresponding pixel region in the image comes from the Map entity-image region mapping relationship; Rel img ( R p ,R q () represents the measured spatial relationship vector between two entity regions in the image, including center distance, relative orientation, and connectivity. Rel kg ( e p ,e q ) represents entity nodes in a knowledge graph. e p and e q The standard spatial relationships are derived from S1; E sub : A set of entity pairs with spatial relationships in the subgraph of a science popularization task.
[0060] S454: Final Science Popularization Visual Content Output: After completing topology correction, output the final entity-level coupled science popularization visual content. I final And the entity-image region mapping relationship table Map ( e k , R k , p k )andI final Perform consistency verification; I final = I 0+α1·Δ I ; Where, Δ I The local adjusted image generated during the topology correction stage, α1 is the correction intensity coefficient, which controls the adjustment range and avoids over-correction that could lead to image distortion. Its value range is 0.1 to 0.3. I 0 represents the initial science popularization image generated by decoding.
[0061] The entity-level coupling and scientific visual content output process in step S45 first involves upsampling the latent variables of the image after denoising iteration using a decoder to generate an initial science popularization image. Based on aligned text features, visual features, and entity features of the science popularization task subgraph from S1, an entity-image region mapping relationship is constructed to achieve one-to-one binding between semantic entities and pixel regions in the image. Subsequently, based on the mapping relationship, it is verified whether the topological structure between entities in the image is consistent with the spatial relationship attributes of the science popularization task subgraph. The deviation is quantified by a topological loss function, and local fine-tuning corrections are made to the deviation areas. Finally, science popularization visual content with completed entity-level coupling and a topological structure conforming to scientific standards is output, and an entity-image mapping table is generated to provide a verification basis for subsequent logical consistency verification.
[0062] The specific process of step S5 is as follows: S51: Predicate relation isomorphism matching of the fact checker, i.e., text layer verification: S1-based popular science task subgraph KG sub The generated science text undergoes predicate relation verification to determine whether the entity relations described in the text match the standard triples of the knowledge graph. Extracting text triples from popular science texts Triples T : ; in, s i For the subject of the text triple, p i For the predicate of the text triple, o i It is the object of the text triple; from KG sub Extracting the standard triplet set Triples KG : ; Calculate the isomorphic matching degree between text triples and standard triples: ; in, Score fact : Textual factual consistency score, with a value range of [0,1]; s j , p j , o j The subject, predicate, and object of a standard triple in a knowledge graph; d ( a,b ): Matching indicator function, when a and b Set to 1 for semantic matching, otherwise set to 0; N: number of text triples, M: number of standard triples; when Score fact < t fact ( t fact The fact verification threshold (which can be 0.9) is used to determine if there is a factual conflict in the text, triggering a local backtracking. S52: Verification of component connectivity in the visual compliance checker: based on the entity-image mapping table. Map ( e k , R k , p k ), for popular science visual content I final Perform topological relationship verification to determine whether the connection or spatial relationship between entity components in the image is consistent with the topological relationship. KG sub The spatial relationship attributes are consistent: Extract the connectivity or spatial relationships between entity regions in an image to construct a set of image topological relationships: ; from KG sub Retrieve the standard spatial relation set for the corresponding entity pairs: ; Computational visual topology consistency score: ; in, Score vis Visual topology consistency score, with a value range of [0,1]. Rel I ( Rp ,R q ): Entity region in the image R p and R q The measured spatial relationship or connection vector; Rel KG ( e p , e q ): Entity nodes in a knowledge graph e p and e q Standard spatial relationship or connection relationship vector; E sub : A set of entity pairs with spatial relationships in the subgraph of the science popularization task; | E sub |: Number of entity pairs; Sim(·): Relation similarity function, which can be cosine similarity or Hamming similarity; when Score vis < t vis ( t vis When the visual verification threshold is set to 0.9, a conflict is determined in the connection relationship of the visual components, triggering a local backtracking. S53: Conflict Location and Local Backtracking Correction: Based on the verification results, locate the conflict type and location, and trigger the corresponding level of local backtracking mechanism for correction, specifically including: Correction of factual conflicts in texts: like Score fact < t fact Positioning conflict triples ( s i , p i , o i ), going back to S3, based on the knowledge laying path P seq and KG sub The standard triplet is used to re-execute the decoding and generation steps to correct conflicting text fragments; Visual topology conflict correction: like Score vis < t vis Locating conflicting entity pairs ( e p , eq ) and their corresponding image regions ( R p ,R q ), going back to the S4 denoising iteration stage, only the conflict region ( R p ,R q Apply an enhanced spatial constraint gradient, re-execute the denoising step for local fine-tuning, and leave the rest of the region unchanged.
[0063] The expression for applying the enhanced spatial constraint gradient in the local backtracking correction is as follows: ; in, Enhanced spatial layout constraint gradient during the correction phase ;G space Spatial layout constraint gradient generated in the original S4; β 1: Backtracking correction strength coefficient, with a value range of 1.5~2.0, is used to amplify the gradient signal of topological loss; The topological loss gradient of conflicting entity pairs is used to guide the model to correct spatial relationships.
[0064] S54: For the corrected text and image content, repeat the consistency check in steps S51 and S52 until... Score fact ≥ t fact and Score vis ≥ t vis Output consistent and logically coherent popular science text and image content. T* final and I* final .
Claims
1. A method for generating popular science content based on knowledge graph constraints and multimodal alignment, characterized in that, Includes the following steps: S1: Perform multi-dimensional semantic analysis on the input popular science keywords, retrieve core entity nodes from the preset domain knowledge graph, and construct a popular science task subgraph through a subgraph extraction strategy based on breadth-first search and path evaluation function; S2: Based on the science popularization task subgraph, the entity node type in the subgraph is identified through a heuristic knowledge reasoning algorithm. A path optimization algorithm based on depth-first traversal is used to determine the order of each knowledge point in the generated content and form a knowledge laying path. S3: Adopting a variational autoencoder structure that integrates external knowledge injection mechanism, the vocabulary distribution is dynamically reshaped through knowledge masking technology during the decoding stage, so that the entities and their attributes pointed to by the current logical path are injected with prediction bias, generating popular science text that is rigidly constrained by the knowledge graph. S4: Construct a shared cross-modal semantic projection space, introduce a contrastive learning algorithm guided by knowledge graphs, realize the coupling of text description and visual representation of popular science texts at the entity level, perform denoising iteration based on the spatial relationship attributes in the popular science task subgraph, and generate visual content. S5: Perform real-time detection on the generated text and image content, use the fact checker to perform isomorphic matching of predicate relations, and use the visual compliance checker to verify the connection relationship of visual components. If a conflict is found, a local backtracking mechanism is triggered for correction.
2. The method for generating popular science content based on knowledge graph constraints and multimodal alignment according to claim 1, characterized in that, The specific process of constructing the science popularization task subgraph containing a complete logical chain in step S1 is as follows: S11: Perform multi-head self-attention semantic encoding on the input science popularization topic C to obtain the topic semantic vector. V C Using a multi-head self-attention-based entity recognition algorithm, retrieve semantic vectors related to the topic from the domain knowledge graph. V C The core entity node set for semantic matching E core ; S12: With core entities E core Centered on the data, expand outwards using a breadth-first search. k By analyzing neighborhood relationships, we can obtain a set of candidate subgraph entity nodes and edges. S13: Calculate the path evaluation function: for each entity node in the candidate subgraph e n Calculate the comprehensive evaluation score f ( e n ), to screen high-value entity nodes; S14: Calculate the mean score of all candidate entity nodes. μ with standard deviation σ Delete those that meet the requirements f ( e n )< μ - σ Low-value peripheral branches are separated, while high-value entity nodes and relationships are retained to form the final science popularization task subgraph. KG sub .
3. The method for generating popular science content based on knowledge graph constraints and multimodal alignment according to claim 2, characterized in that, The specific process of step S2 is as follows: S21: Subgraphs for Science Popularization Tasks Based on Graph Convolutional Neural Networks KG sub Each entity node in e n Type annotations are performed, dividing them into three categories: basic definition class nodes. E def 、 Principle Analysis Class Nodes E pri Application extension nodes E app ; S22: Use depth-first traversal to search for paths, aiming to maximize the comprehensive weight of the paths F(P), and generate the optimal knowledge laying path; S23: Search for the optimal path according to the forced cognitive order constraint: Starting point constraint: must start from... E def Basic definition node starts; Inter-node constraints: priority traversal E pri Principle analysis nodes; endpoint constraints: with E app The application extension node ends; during the traversal, the path with the largest comprehensive weight F(P) is retained as the candidate knowledge laying path; S24: For adjacent entity nodes in the path ( e u , e v Logical guide markers are inserted based on the relation type to form the final knowledge deployment path. P seq .
4. The method for generating popular science content based on knowledge graph constraints and multimodal alignment according to claim 3, characterized in that, The specific process of step S3 is as follows: S31: Knowledge Path Deposition via the Encoder of a Variational Autoencoder P seq Mapped to the latent semantic space, text is generated word by word through a decoder, with each step rigidly constrained by a knowledge mask; S32: At decoding time t, a bias is applied to the vocabulary probability distribution through a knowledge mask, prioritizing the output of entity or attribute words that the path points to; S33: Using gating mechanisms to dynamically balance general language features and knowledge graph features; S34: Generate corresponding entity node content based on rigid constraint generation rules: following the knowledge paving path in S2. P seq The content of the corresponding entity nodes is generated sequentially.
5. The method for generating popular science content based on knowledge graph constraints and multimodal alignment according to claim 4, characterized in that, The specific process of step S4 is as follows: S41: The popular science text generated in S3 is encoded using multi-layer bidirectional Transformer encoding to obtain the text feature vector. v t For visual materials or initial visual latent variables, a residual convolutional neural network is used to extract visual feature vectors. v i Construct a shared cross-modal semantic projection space to map text features, visual features, and knowledge graph entity features to the same semantic space; S42: Subgraph of Science Popularization Task KG sub The entity features serve as the semantic hub, minimizing cross-modal contrast loss and forcing textual and visual features to converge towards the same entity semantics; S43: From the Science Popularization Task Subgraph KG sub Extracting entity spatial relationship attributes, including containment, location, connection, hierarchy, and orientation, and transforming them into spatial layout constraint gradients that can be executed by the diffusion model. G space : S44: Spatial constraint gradient G space Inject the self-attention weight matrix of the diffusion model to force the model to generate corresponding scientific entities in the specified pixel region during the denoising iteration, ensuring topological compliance; S45: Entity-level coupling and scientific visual content output: Text description and visual representation are aligned at the entity level within a shared semantic space; the diffusion model outputs popular science visual content with compliant structure, accurate position, and correct component relationships.
6. The method for generating popular science content based on knowledge graph constraints and multimodal alignment according to claim 5, characterized in that, The specific process of step S45 is as follows: S451: Latent Variable Decoding and Initial Image Generation in a Diffusion Model: Decoding Latent Variables in an Image After Denoising Iteration X T Perform decoder upsampling to generate the initial visual image. I 0; S452: Entity-level semantic-visual coupling binding: Constructing an entity-image region mapping table based on aligned text features, visual features, and entity features of the science popularization task subgraph. Map ( e k , R k , p k This enables a one-to-one binding between semantic entities and pixel regions in an image; S453: Based on entity-image region mapping table Map ( e k , R k , p k ), verify whether the topological relationships between entities in the image are consistent with the spatial relationship attributes of the science popularization task subgraph, and make local corrections to the deviation areas; S454: After completing the topology correction, output the final entity-level coupled science popularization visual content. I final And the entity-image region mapping relationship table Map ( e k , R k , p k )and I final Perform consistency verification.
7. The method for generating popular science content based on knowledge graph constraints and multimodal alignment according to claim 1, characterized in that, The specific process of step S5 is as follows: S51: Text Layer Validation: Based on Science Popularization Task Subgraph KG sub The generated science popularization text is subjected to predicate relation verification to determine whether the entity relations described in the text are isomorphically matched with the standard triples of the knowledge graph. Extracting text triples from popular science texts Triples T ; from KG sub Extracting the standard triplet set Triples KG ; Calculate the isomorphic match degree between text triples and standard triples, i.e., the text fact consistency score. Score fact ; when Score fact < τ fact The text is determined to contain factual conflicts, triggering a partial backtracking. S52: Based on entity-image mapping table Map ( e k , R k , p k ), for popular science visual content I final Perform topological relationship verification to determine whether the connection or spatial relationship between entity components in the image is consistent with the topological relationship. KG sub The spatial relationship attributes are consistent: Extract the connectivity or spatial relationships between entity regions from an image to construct a set of image topological relationships; from KG sub Obtain the standard spatial relation set of corresponding entity pairs from the [source]. Computational vision topology consistency score Score vis ; when Score vis < τ vis When a conflict is detected in the connection relationship of the visual components, a local backtracking is triggered. S53: Conflict Location and Local Backtracking Correction: Based on the verification results, locate the conflict type and location, and trigger the corresponding level of local backtracking mechanism for correction; S54: For the corrected text and image content, repeat the consistency check in steps S51 and S52 until... Score fact ≥ τ fact and Score vis ≥ τ vis Output consistent and logically coherent popular science text and image content. T* final and I* final .
8. The method for generating popular science content based on knowledge graph constraints and multimodal alignment according to claim 1, characterized in that, The specific modifications to the local backtracking mechanism at the corresponding level in step S53 include: Correction of factual conflicts in texts: like Score fact < τ fact Positioning conflict triples ( s i , p i , o i ), going back to S3, based on the knowledge laying path P seq and KG sub The standard triplet is used to re-execute the decoding and generation steps to correct conflicting text fragments; Visual topology conflict correction: like Score vis < τ vis Locating conflicting entity pairs ( e p , e q ) and their corresponding image regions ( R p ,R q ), going back to the S4 denoising iteration stage, only the conflict region ( R p ,R q Apply an enhanced spatial constraint gradient, re-execute the denoising step for local fine-tuning, and leave the rest of the region unchanged.
