A Meta-Rule Selection Strategy Learning Method for Visual Generative Reverse Learning
By using a meta-rule-based strategy selection learning method, the high time cost of logical derivation in visual generative derivation learning is solved, improving efficiency and the quality of generated results, enhancing the robustness and generalization ability of the model, and making it suitable for complex tasks and scenarios with unseen instances.
Patent Information
- Application Number
- CN202411700408.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-26
AI Technical Summary
Existing visual generative inverse learning suffers from excessively high time costs in logical inverse when dealing with large-scale sets of logical symbols, limiting its application in complex real-world scenarios.
A meta-rule selection strategy learning method is adopted, which includes self-attention embedding representation learning of symbol instance packages, embedding representation learning of meta-rules, selection of meta-rule subsets, logical reasoning, and updating of the meta-rule selection strategy network. By combining self-attention and cross-attention mechanisms, relevant meta-rule subsets are dynamically selected to reduce logical derivation time.
It significantly improves the efficiency of visual generative inverse learning, enhances the quality and logical consistency of generated results, improves the robustness and generalization ability of the model in complex tasks and unseen instances, and reduces the reliance on human intervention.
Smart Images

Figure CN119849595B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, and more particularly to a meta-rule selection strategy learning method for visual generative inverse learning. Background Technology
[0002] In recent years, with the development of artificial intelligence, constructing neural symbolic visual generation models based on logical symbols has become an important research direction. These models guide the visual generation process through logical rules, enhancing not only the interpretability and stability of the generated results but also demonstrating strong rule-based generalization ability and the potential to inductively generate logical rules from data. In this field, the AbdGen method is the first to introduce the concept of inverse learning into visual generation tasks, enabling simultaneous joint training of neural visual generators, symbolic grounding learning, and logical rule induction, requiring only a small amount of labeled symbolic data.
[0003] However, existing technologies face the problem of excessively high time costs for logical derivation when dealing with large-scale sets of logical symbols and complex logical rules, limiting the application of this method in complex real-world scenarios. Furthermore, previous inductive logic programming (ILP), including the logical induction part of AbdGen, typically relies on hand-designed inductive biases, which also poses a key challenge in visual generative derivation learning. These hand-designed biases often struggle to balance generality and efficiency when handling complex tasks, leading to significant limitations in the model's ability to cope with diverse and complex tasks.
[0004] Therefore, in practical applications, a technical means is needed to effectively reduce the time cost of logical derivation in order to improve the overall efficiency of visual generative derivation learning and ensure that it remains operable when dealing with complex logical tasks. Summary of the Invention
[0005] The purpose of this invention is to address the drawback of high time cost of logical derivation in existing visual generative derivation learning when dealing with large-scale logical symbol sets, and to provide a meta-rule selection strategy learning method.
[0006] The objective of this invention is achieved through the following technical solution: a meta-rule selection strategy learning method for Visual Generative Abductive Learning (AbdGen), comprising the following steps:
[0007] (1) Self-attention embedding representation learning of symbol instance package: feature extraction and representation learning of symbol instance package are performed through attention mechanism to obtain symbol instance package embedding representation; the symbol instance package contains several symbol instances, each symbol instance is composed of symbol data and does not contain any original image input, the symbol instance package is divided into positive examples and negative examples for the current rule;
[0008] (2) Meta-rule embedding representation learning: convert each meta-rule in the meta-rule pool into a corresponding vector embedding representation;
[0009] (3) Selecting a subset of meta-rules: Combining the feature representation of the symbol instance package and the embedding representation of meta-rules, calculate the correlation between each meta-rule and the current instance package, and select the subset of meta-rules that is most suitable for the current task;
[0010] (4) Perform logical reasoning: Input the subset of meta-rules selected in step (3) and the symbol instance package into the logical reasoning module Metatagol, and perform logical reasoning in combination with the background knowledge input in other steps.
[0011] (5) Update the meta-rule selection strategy network: Evaluate the effect of meta-rule selection based on the logical reasoning results, and optimize and update the meta-rule selection strategy network;
[0012] (6) Applying pre-trained models: In visual generative inverse learning, pre-trained policy networks are used to select appropriate meta-rules to guide visual generative inverse learning.
[0013] Furthermore, step (1) is implemented through the following sub-steps:
[0014] (1.1) Self-attention calculation of positive examples: Input the positive examples in the symbol instance bag into the self-attention mechanism, extract the correlation features inside the positive examples, and obtain the embedding representation of the positive examples;
[0015] (1.2) Self-attention calculation of negative examples: Input the negative examples in the symbol instance bag into the self-attention mechanism, extract the correlation features inside the negative examples, and obtain the embedding representation of the negative examples;
[0016] (1.3) Connection between positive and negative example embeddings: The positive and negative example embeddings generated by the self-attention mechanism are connected and merged into a combined tensor;
[0017] (1.4) Self-attention calculation of combined tensors: The self-attention mechanism is applied again to the concatenated combined tensors to obtain a comprehensive embedded representation.
[0018] Furthermore, step (3) is implemented through the following sub-steps:
[0019] (3.1) Calculate the relevance score between symbol instance package and meta rule: Use cross attention mechanism to interact the symbol instance package embedding representation in step (1) and the meta rule embedding representation in step (2), calculate the relevance score between each meta rule and symbol instance package, and reflect the degree to which the meta rule applies to the current rule;
[0020] (3.2) Generate the probability distribution of meta-rule selection: Convert the relevance score into a probability distribution using the Sigmoid function to obtain the probability of each meta-rule being selected;
[0021] (3.3) Apply Bernoulli sampling to select a subset of meta-rules: Based on the generated probability distribution, Bernoulli sampling is performed on each meta-rule to determine whether it is selected into the meta-rule subset of the current task, thereby dynamically adapting to the needs of different symbol instance packages.
[0022] Furthermore, step (5) is implemented through the following sub-steps:
[0023] (5.1) Calculate the reward signal of the strategy: Based on logical reasoning, the logical rules and the size of the selected meta-rule subset are deduced, and the corresponding reward signal is calculated to evaluate the effectiveness of the current meta-rule selection strategy.
[0024] (5.2) Backpropagation update of policy network parameters for near-end policy optimization: Using the calculated reward signal, the parameters of the meta-rule selection policy network are adjusted through the backpropagation algorithm of near-end policy optimization so that it can accurately select a suitable subset of meta-rules in subsequent tasks.
[0025] Specifically, in step (5.1), the corresponding reward signal is calculated based on the logical reasoning result, and the reward function is as follows:
[0026]
[0027] Where n is the total number of meta-rules in the meta-rule pool, n s This indicates the number of meta-rules selected.
[0028] Furthermore, step (6) is implemented through the following sub-steps:
[0029] (6.1) Few-shot pre-training of visual generative inverse learning: A small amount of labeled image data is needed to perform few-shot pre-training of visual generative inverse learning in order to achieve the starting accuracy of the meta-rule selection model.
[0030] (6.2) Input the original image instance package: The original image instance package contains positive and negative examples, which are symbolized and sub-symbolized by the symbol encoder and the sub-symbol encoder, respectively;
[0031] (6.3) Generating pseudo grounding symbols: Symbolization represents the generation of pseudo grounding symbols through the symbol grounding module;
[0032] (6.4) Selecting meta-rules: Using a pre-trained policy network, select a subset of meta-rules that are most relevant to the pseudo-grounding symbol from the meta-rule pool;
[0033] (6.5) Perform logical inversion learning: Input the selected meta-rules and pseudo-grounding symbols into the logical inversion reasoning module, and combine them with background knowledge to perform logical induction to generate logical rules and corrected grounding symbols;
[0034] (6.6) Decode and generate image: Find the symbol representation and sub-symbol representation corresponding to the corrected grounding symbol in the VQ encoding of the symbol grounding module, connect them, and input them into the decoder to generate the final visual output image;
[0035] (6.7) Network update for visual generative inverse learning: Network update for visual generative inverse learning is performed by reconstruction loss, cross-entropy loss of pseudo-ground symbol relative to the corrected symbol, discretization variational loss and inverse sub-symbol cross-entropy loss.
[0036] Specifically, in step (6.7), the network update for visual generative inverse learning is performed using the reconstruction loss Recon_loss, the cross-entropy loss sym_loss between the pseudo-ground symbol and the corrected symbol, the discrete loss VQ_loss, and the inverse sub-sym_loss cross-entropy loss subsym_loss. The loss function is as follows:
[0037] Loss=Recon_loss+sym_loss+VQ_loss+w adv *subsym_loss;
[0038] Among them, the inverse sub-symbol loss is the inverse of the cross-entropy loss of the pseudo-grounded symbol generated by the sub-symbol encoder relative to the corrected symbol, which helps to decouple the sub-symbol embedding representation and the symbol embedding representation.
[0039] The beneficial effects of this invention are as follows:
[0040] This invention significantly improves the efficiency of visual generative inverse learning through a pre-trained meta-rule selection strategy. The pre-trained policy network intelligently selects relevant meta-rules, reducing the computation time of logical inverse, while the self-attention mechanism improves the accuracy of symbolic feature extraction, enhancing the quality and logical consistency of the generated results. Furthermore, this method improves the model's robustness and generalization ability when handling complex tasks and unseen instances, reducing reliance on human intervention. Attached Figure Description
[0041] Figure 1 This is a flowchart of the pre-training process for a meta-rule selection strategy learning method for visual generative inverse learning;
[0042] Figure 2 This is a flowchart illustrating the application of this invention in visual generative inverse learning;
[0043] Figure 3 These are positive and negative examples of the original image instances in this invention;
[0044] Figure 4 This is an example of the generation effect of the present invention. Detailed Implementation
[0045] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.
[0046] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0047] The present invention will now be described in detail with reference to the accompanying drawings.
[0048] like Figure 1 As shown, the meta-rule selection strategy learning method for visual generative inverse learning mainly includes the following steps: learning the embedding representation of a symbol instance bag containing positive and negative examples using a self-attention mechanism; converting the meta-rules in the meta-rule pool into vector representations using an embedding representation generation module; calculating the relevance score between the symbol instance bag and the meta-rules using a cross-attention mechanism and selecting the subset of meta-rules with the highest score; combining the selected subset of meta-rules with the symbol instance input logic reasoning module and background knowledge for logical reasoning; updating the policy network based on the reasoning results; such as... Figure 2 As shown, a pre-trained model is applied in visual generative inverse learning. By selecting the most relevant meta-rules, the efficiency of logical inverse is accelerated, and finally, a visual output image that conforms to the logical rules is generated.
[0049] The following is a detailed explanation of each step:
[0050] (1) Self-attention embedding representation learning of symbol instance packages: A symbol instance package contains several symbol instances. Each symbol instance consists of symbol data and does not contain any original image input. It is divided into positive and negative examples for the current rule. Taking the "right-first" rule of the Mario dataset as an example, the format of the symbol instance is f([Mario position list][target position, target type, background type]). If the Mario position moves to the right and then up, and finally stops at the target position, it is a positive example. A positive example is [f([[0,0],[1,0],[2,0],[2,1],[2,2]],[[2,2],0,3])f([[0,0],[1,0],[2,0],[2,1]],[[2,1],1,1])f([[0,1],[1,1],[2,1],[2,2]],[[2,2],0,2])] The negative example is represented as [f([[0,0],[1,0],[2,0],[2,1],[2,2]],[[1,1],1,2])f([[0,0],[1,0],[1,1],[2,1],[2,2],[[2,2],0,2])f([[1,1],[1,2],[2,2]],[[2,2],1,2])]. First, the symbolic representation of the positive example is input into the self-attention mechanism computation module to extract the associated features within the positive example, generating the embedding representation of the positive example. Then, the symbolic representation of the negative example is also input into the self-attention mechanism computation module to generate the embedding representation of the negative example. The embedding representations of the positive and negative examples are merged into a combined tensor through a concat operation. This combined tensor is then processed by the self-attention mechanism to enhance the interactive understanding between the positive and negative examples, ultimately yielding a comprehensive embedding representation. The self-attention mechanisms described above are all implemented using Torch.nn.MultiheadAttention.
[0051] (2) Meta-rule Embedding Representation Learning: Each meta-rule in the meta-rule pool is converted into a corresponding vector embedding representation through the meta-rule embedding representation generation module, implemented by Torch.nn.Embedding. The generated meta-rule embedding representations are used in subsequent meta-rule selection steps. The meta-rule pool is as follows: Figure 1 As shown in the upper right corner.
[0052] (3) Meta-rule subset selected based on the relevance probability between meta-rules and symbolic instance packages: The symbolic instance package embedding representation generated in step (1) and the meta-rule embedding representation generated in step (2) are used to calculate the relevance score between each meta-rule and the symbolic instance package through a cross-attention mechanism, where the cross-attention mechanism is implemented using Torch.nn.MultiheadAttention. The relevance score is converted into a probability distribution using the Torch.nn.Sigmoid function, and the probability values are restricted to between 0 and 1. The Bernoulli sampling method is used to select the meta-rule subset most suitable for the current task, thereby dynamically adapting to the needs of different symbolic instance packages.
[0053] (4) Perform logical reasoning: Input the selected subset of meta-rules and symbol instances into the logical reasoning module (Metagol) and combine them with background knowledge to perform logical reasoning. When the meta-rule subset is selected well, this step can summarize logical rules that conform to the positive examples of the current instance and do not conform to the negative examples of the current instance. When the meta-rule subset is selected poorly, no logical rules can be summarized.
[0054] (5) Update the meta-rule selection policy network: Calculate the policy reward signal based on the logical reasoning results, where the reward function is as follows:
[0055]
[0056] Where n is the total number of meta-rules in the meta-rule pool, n s This represents the number of meta-rules selected. Then, the parameters of the policy network are updated via backpropagation using the Proximal Policy Optimization (PPO) algorithm, thereby optimizing the meta-rule selection strategy and enabling it to select suitable subsets of meta-rules more accurately and efficiently in subsequent tasks.
[0057] (6) Application in visual generative inverse learning: Flowchart as follows Figure 2 As shown, the original image example is... Figure 3 As shown, where Figure 3The logical rule for positive and negative examples is "Mario moves right then up until the finish line". First, pseudo-grounding symbols are generated through symbol encoding and sub-symbolization processes using a symbol encoder and a sub-symbol encoder. Then, pseudo-grounding symbols are generated through a symbol grounding module, and a pre-trained policy network selects the subset of meta-rules most relevant to the pseudo-grounding symbols from the meta-rule pool. The selected meta-rules and pseudo-grounding symbols are input into the logical inverse reasoning module, where logical induction is performed using background knowledge to generate logical rules and corrected grounding symbols. The symbol representation and sub-symbol representation corresponding to the corrected grounding symbols in the VQ encoder of the symbol grounding module are connected and input into the decoder to generate the visual output image. The visual generative inverse learning network is updated based on the reconstruction loss Recon_loss, the cross-entropy loss sym_loss of the pseudo-grounding symbols relative to the corrected symbols, the discrete loss VQ_loss, and the inverse subsym_loss, as shown in the following loss function:
[0058] Loss=Recon_loss+sym_loss+VQ_loss+w adv *subsym_loss
[0059] The inverse sub-symbol loss is the inverse of the cross-entropy loss of the pseudo-grounded symbol generated by the sub-symbol encoder relative to the corrected symbol, helping to decouple the sub-symbol embedding representation and the symbol embedding representation. The final output image effect is as follows. Figure 4 As shown.
[0060] The experiments in this invention demonstrate that the meta-rule selection strategy significantly optimizes visual generative inverse learning through the method of this invention. When dealing with large-scale sets of logical symbols and complex tasks, the time cost of logical inverse is greatly reduced, while the generated visual images have higher quality and logical consistency.
[0061] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0062] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A meta-rule selection strategy learning method for visual generative inverse learning, characterized in that, Includes the following steps: (1) Self-attention embedding representation learning of symbol instance package: feature extraction and representation learning of symbol instance package are performed through attention mechanism to obtain symbol instance package embedding representation; the symbol instance package contains several symbol instances, each symbol instance is composed of symbol data and does not contain any original image input, the symbol instance package is divided into positive examples and negative examples for the current rule; (2) Learning the embedding representation of meta-rules: convert each meta-rule in the meta-rule pool into a corresponding vector embedding representation; (3) Selecting a subset of meta-rules: Combining the feature representation of the symbol instance package and the embedding representation of the meta-rules, calculate the correlation between each meta-rule and the current instance package, and select the subset of meta-rules that is most suitable for the current task; (4) Perform logical reasoning: Input the subset of meta-rules selected in step (3) and the symbol instance package into the logical reasoning module Metatagol, and perform logical reasoning in combination with the background knowledge input in other steps; (5) Update the meta-rule selection strategy network: Evaluate the effect of meta-rule selection based on the logical reasoning results, and optimize and update the meta-rule selection strategy network; (6) Applying pre-trained models: In visual generative inverse learning, appropriate meta-rules are selected using a pre-trained policy network to guide visual generative inverse learning; this is specifically achieved through the following sub-steps: (6.1) Few-shot pre-training of visual generative inverse learning: A small amount of labeled image data is needed to perform few-shot pre-training of visual generative inverse learning in order to achieve the starting accuracy of the meta-rule selection model. (6.2) Input original image instance package: The original image instance package contains positive and negative examples, and is symbolized and sub-symbolized by the symbol encoder and sub-symbol encoder respectively; (6.3) Generating pseudo grounding symbols: Symbolic representation is achieved by generating pseudo grounding symbols through the symbolic grounding module; (6.4) Selecting meta-rules: Using a pre-trained policy network, select a subset of meta-rules that are most relevant to the pseudo-grounding symbol from the meta-rule pool; (6.5) Perform logical inverse learning: Input the selected meta-rules and pseudo-grounding symbols into the logical inverse reasoning module, and combine them with background knowledge to perform logical induction to generate logical rules and corrected grounding symbols; (6.6) Decoding and generating the image: Find the symbol representation and sub-symbol representation corresponding to the corrected grounding symbol in the VQ encoding of the symbol grounding module, connect them, and input them into the decoder to generate the final visual output image; (6.7) Network update for visual generative inverse learning: Network update for visual generative inverse learning is performed by reconstruction loss, cross-entropy loss of pseudo-ground symbol relative to the corrected symbol, discretization variational loss and inverse sub-symbol cross-entropy loss.
2. The meta-rule selection strategy learning method according to claim 1, characterized in that, Step (1) is achieved through the following sub-steps: (1.1) Self-attention calculation of positive examples: Input the positive examples in the symbol instance bag into the self-attention mechanism, extract the correlation features inside the positive examples, and obtain the embedding representation of the positive examples; (1.2) Self-attention calculation of negative examples: Input the negative examples in the symbol instance bag into the self-attention mechanism, extract the correlation features inside the negative examples, and obtain the embedding representation of the negative examples; (1.3) Connection between positive and negative example embeddings: The positive and negative example embeddings generated by the self-attention mechanism are connected and merged into a combined tensor; (1.4) Self-attention calculation of combined tensors: The self-attention mechanism is applied again to the concatenated combined tensors to obtain a comprehensive embedded representation.
3. The meta-rule selection strategy learning method according to claim 1, characterized in that, Step (3) is achieved through the following sub-steps: (3.1) Calculate the relevance score between symbol instance package and meta rule: Use cross attention mechanism to interact the symbol instance package embedding representation in step (1) and the meta rule embedding representation in step (2), calculate the relevance score between each meta rule and symbol instance package, reflecting the degree to which the meta rule applies to the current rule; (3.2) Generate the probability distribution of meta-rule selection: Convert the relevance score into a probability distribution using the Sigmoid function to obtain the probability of each meta-rule being selected; (3.3) Apply Bernoulli sampling to select a subset of meta-rules: Based on the generated probability distribution, Bernoulli sampling is performed on each meta-rule to determine whether it is selected into the meta-rule subset of the current task, thereby dynamically adapting to the needs of different symbol instance packages.
4. The meta-rule selection strategy learning method according to claim 1, characterized in that, Step (5) is achieved through the following sub-steps: (5.1) Calculate the reward signal of the strategy: Based on logical reasoning, the logical rules and the size of the selected meta-rule subset are deduced, and the corresponding reward signal is calculated to evaluate the effectiveness of the current meta-rule selection strategy; (5.2) Backpropagation of near-end policy optimization to update policy network parameters: Using the calculated reward signal, the parameters of the meta-rule selection policy network are adjusted through the backpropagation algorithm of near-end policy optimization so that it can accurately select a suitable subset of meta-rules in subsequent tasks.
5. The meta-rule selection strategy learning method according to claim 4, characterized in that, In step (5.1), the corresponding reward signal is calculated based on the logical reasoning result, and the reward function is as follows: in, It represents the total number of meta-rules in the meta-rule pool. This indicates the number of meta-rules selected.
6. The meta-rule selection strategy learning method according to claim 1, characterized in that, In step (6.7), the loss is reconstructed. Recon_loss Cross-entropy loss of pseudo-grounding symbols relative to the corrected symbols sym_loss Discrete loss VQ_loss Cross-entropy loss of the progenitor symbol subsym_loss The loss function for updating a network that performs visual generative inverse learning is shown below: ; Among them, the inverse sub-symbol loss is the inverse of the cross-entropy loss of the pseudo-grounded symbol generated by the sub-symbol encoder relative to the corrected symbol, which helps to decouple the sub-symbol embedding representation and the symbol embedding representation.