A dynamic evolutionary multimodal value generation method based on value system guidance
Through the dynamic semantic evolution module and the single confrontation multi-stage structure, the problem of static text features in the existing technology is solved, dynamic adjustment and fine-grained guidance of multi-modal content generation are achieved, the generation efficiency and quality are improved, and the problem of image and The problem of lack of interaction during text generation.
Patent Information
- Application Number
- CN202410805095.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-21
AI Technical Summary
In existing multi-modal content generation methods, image features are generated dynamically, while text features remain static and cannot evolve simultaneously at each stage, resulting in a lack of fine-grained semantic guidance in the generation process, affecting content quality and efficiency.
Adopt a dynamic evolution multi-modal generation method guided by a value system, design a dynamic semantic evolution module and a single confrontation multi-stage structure, realize interaction and adjustment at each stage by dynamically recombining word features and image features, and simplify traditional multi-stage generation process.
It improves the efficiency and quality of content generation, prevents the same semantics from being repeatedly generated, alleviates the problem of repeated rendering, and improves the precision and diversity of multi-modal content generation.
Smart Images

Figure CN118378707B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multimodal content generation, and in particular to a method for generating multimodal value based on a dynamic evolution guided by a value system. Background Art
[0002] With the deepening of the digital age, multimodal content has become an important way for people to obtain information and express their opinions. In this era, through clear value orientation, multimodal intelligent generation can better understand the psychological needs of the audience to carefully plan and create content, thereby enhancing the attractiveness and influence of the content. In addition, the guidance of the value system helps to form a healthy content ecology. In the cyberspace filled with a large amount of information and opinions, value orientation can help generate and guide the dissemination of high-quality content and maintain the clarity and order of the cyberspace. Therefore, multimodal content generation technology based on value system guidance has great research value.
[0003] Compared with other input forms for generating multimodal content (such as sketches or semantic segmentation maps), text description is a flexible and convenient form that can be used to represent visual concepts. Generative adversarial networks have achieved remarkable success in multimodal content generation. Most existing methods adopt a multi-stage architecture, that is, stacking multiple generator-discriminator pairs for multiple adversarial training. Specifically, the generator in each stage improves the results of the previous stage by increasing the image resolution and gradually adding details stage by stage. Based on this architecture, some recent studies focus on introducing different cross-modal fusion mechanisms between stages to better align text and images. However, most existing methods have one thing in common: image features are dynamically generated at each stage, while text features remain static on the contrary. Multi-stage multimodal content generation itself is a coarse-to-fine generation process, with the image resolution gradually increasing and details gradually added. In this process, text features should also evolve synchronously to provide semantic guidance from coarse-grained to fine-grained (e.g., from "plant" to "flower" and then to "red rose") to better guide multimodal content generation at each stage. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a dynamic evolutionary multimodal value generation method guided by a value system, which can dynamically recombine word features according to the historical stage status, and adopts a novel single adversarial multi-stage structure. On the one hand, the present invention designs a unique dynamic semantic evolution module, which not only dynamically selects words that need to be recombined at each stage, but also dynamically recombines them by enhancing or suppressing the semantics of subspaces of different granularity. On the other hand, in order to better promote the dynamic semantic evolution module, the present invention further proposes a novel single adversarial multi-stage structure, which simplifies traditional multi-stage generation by eliminating complex multi-stage generation requirements, and thus allows more stages of text and image interaction.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0006] A method for generating multimodal value based on dynamic evolution guided by a value system, inputting a given initial text related to the value system into a trained generation model to generate multimodal content that conforms to the value system; the training process of the generation model includes the following steps:
[0007] Step 1: Generate a query graph structure through the initial text, query the relevant corpus of the initial text in the knowledge graph related to the value system through the query graph structure, and encode the relevant corpus into sentence features through a text encoder. ; The features of each word in the relevant corpus obtained after passing through the text encoder are spliced together and recorded as the word features after reorganization in stage 0 , is the number of words in the relevant corpus, It is a sentence feature The dimension of represents a real number;
[0008] Step 2: construct a single adversarial multi-stage structure with M stages, each stage adopts a generative structure; each generative structure includes a generator and a dynamic semantic evolution module, and the generative structure of the last stage also includes a discriminator;
[0009] Random Gaussian noise and conditional enhanced sentence features Input to the generator , output the image features of stage 0 and the generated image at stage 0 ; The generator of the generated structure corresponding to the i-th stage is recorded as , , The input is the image feature of the i-1th stage and the word features after reorganization in stage i , the output is the image feature of the i-th stage and the generated image of the i-th stage ;
[0010] Dynamic semantic evolution module of the generated structure corresponding to the i-th stage The input is the image feature of the i-1th stage and the word features after reorganization in stage i-1 ; Dynamic semantic evolution module, which transforms the input image features Projected to the reorganized word features The same embedding space, get the aggregated image features ; Screen the word features at different stages and reorganize the word features Update; update the word features The space where the word is located is divided into multiple word subspaces and combined through the attention mechanism to output the reorganized word features in the i-th stage , ;
[0011] All generated images are connected through skip connections Weighted sum, , and get the final target image , that is, to obtain multimodal content that conforms to the value system;
[0012] Step three, train the generative model: train the generative model through the discriminator objective function composed of sentence features that match the generated image, sentence features that do not match the generated image, real images and generated images, the generator adversarial objective function, and the image-text matching objective function based on the divergence between the standard Gaussian distribution and the training text Gaussian distribution.
[0013] Furthermore, the input image features Projected to the reorganized word features The same embedding space, get the aggregated image features , including:
[0014] Image features , is the image feature The number of channels, is the image feature The number of image sub-features in ;
[0015] Using a learnable weight matrix Image features Projection to get the aggregation weight , and the image features Projection to word features The same embedding space, get the projected image features , and finally through the normalized exponential function Aggregation weight Perform normalization to obtain aggregated image features :
[0016] ;
[0017] ;
[0018] ;
[0019] in, is the image feature The dimension of is a learnable matrix, Indicates transpose.
[0020] Furthermore, the word features of the different stages of screening are reorganized into Updates include:
[0021] First calculate the cross-modal correlation matrix , and then perform mean pooling to obtain the image features after each aggregation Correlation with the whole word feature :
[0022] ;
[0023] ;
[0024] ;
[0025] in, Represents the cross-modal correlation matrix The Row and The elements of the column, represents the mean of all elements in the k columns of the cross-modal correlation matrix, is the image feature The dimension of represents transpose;
[0026] Determine whether a word needs to be regenerated in the next stage by weight The value of is determined by:
[0027] ;
[0028] in, The value range is , as the weight to update the next stage of word features, the updated word features , the word features that do not need to be reassembled are set to 0; is a learnable matrix, represents the cascade operation along the channel dimension, is a learnable parameter that controls the gating function; is the hyperbolic tangent function.
[0029] Furthermore, the updated word features The space where the word is located is divided into multiple word subspaces and combined through the attention mechanism, and the output is the reorganized word feature of the i-th stage , including:
[0030] The divided word subspace is expressed as , a list of the number of word subspaces , The dimension is The number of word subspaces, Represents the total number of dimensions of the word subspace; the semantics represented by the different divided word subspaces are recombined through the attention mechanism. When the number of word subspaces is When , the dimension of the word subspace is :
[0031] ;
[0032] ;
[0033] ;
[0034] in, , are all learnable matrices, , , Respectively represent the image features and word features through the learnable matrix The query matrix, key value matrix and value matrix obtained after mapping; is the attention value after the hyperbolic tangent function The processed value; Represents the operation of restoring the divided word subspace to its original size; is the Hammond matrix product; Features of words that indicate original size; It is the operation of weighted sum to get the attention value:
[0035] ;
[0036] Add another learnable weight , realize the combination of multiple word subspaces, and obtain the word features after the reorganization in the i-th stage :
[0037] ;
[0038] ;
[0039] ;
[0040] ;
[0041] in, The numerical matrix representing the dynamic granularity word subspace is obtained by multiplying the aggregated image features and the learnable weights. The weighted sum of the attention values of the numerical matrix representing the dynamic granularity word subspace, Represents the mean of the attention values of all granularities of the same word feature, , represents the averaging operation, is the activation function, Express The average attention value after nonlinear activation operation, express The attention value of the word subspace in the jth dimension.
[0042] Furthermore, the discriminator objective function for:
[0043] ;
[0044] Express satisfaction Distribution Seek hope, It means satisfying All distribution , Express satisfaction Distribution Seek hope, Indicates compliance All distribution , and Respectively and Find the gradient, represents the second-order norm, is the sentence feature that matches the generated image, are sentence features that do not match the generated image, is a real image, is to generate an image; It is the decision of whether the input sentence features given by the discriminator and the generated image output by the generator match. is a hyperparameter of the matching-aware zero-centered gradient penalty loss; is a hyperparameter for balancing gradients;
[0045] Generator against the objective function for:
[0046] ;
[0047] Image-text matching objective function for:
[0048] ;
[0049] in, represents the divergence, represents a Gaussian distribution, represents the mean of the sentence features, Represents the variance of sentence features; used as the overall objective function for training the generative model for:
[0050] ;
[0051] and It is a hyperparameter used to adjust the loss function.
[0052] Compared with the prior art, the beneficial technical effects of the present invention are:
[0053] The present invention creates images through a clear value orientation. The present invention utilizes a dynamic evolution module and a single adversarial multi-stage structure to achieve dynamic adjustment of content generation, and can recombine word features according to the status of the historical stage, effectively improving the efficiency and quality of content generation. In addition, the present invention dynamically recombines word features at different stages, suppresses previously used semantic information during the generation process, and activates new information to prevent repeated generation of the same semantics and alleviate the problem of repeated rendering. In summary, the present invention has obvious advantages in improving the quality and efficiency of multimodal content generation, and has important value and significance for multimodal content creation and social applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of a generation model used in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] A preferred embodiment of the present invention is described in detail below with reference to the accompanying drawings.
[0056] The generation of multimodal content guided by a value system is defined as: given a text content related to value guidance, a computer algorithm generates multimodal content related to the text and in line with the needs of value system guidance.
[0057] The structure of the generation model used in the present invention is as follows: Figure 1 As shown. The present invention adopts a single adversarial multi-stage structure, and designs a model based on a generative adversarial network model to implement a generation algorithm. For a given natural language text, the present invention uses a knowledge graph to query the corpus related to the value system and the importance of the corpus. For the obtained corpus related to the value system, the correlation between each word and the image aggregation vector is calculated with reference to the importance of the corpus. At each generation stage, dynamic word selection and combination are achieved through a gating function, and the semantic space is divided into multiple word subspaces. The attention mechanism is used to recombine different word subspaces to match the semantic guidance needs of different stages.
[0058] 1. Feature Fusion
[0059] The present invention utilizes a beam search method, starting from the core entities of the text, and gradually generates structured query statements or query graph structures to directly access the knowledge graph, thereby accurately extracting corpus related to the value system.
[0060] First, a series of query graph structures are generated through multiple rounds of iterations. For each query graph structure, operations such as expansion, connection, and integration are used to update it, and the score is calculated based on the semantic matching degree between the entity features and text features of the updated query graph structure. When the score no longer improves, the iteration ends, and the relevant corpus of the text is obtained. The relevant corpus is encoded into sentence features through a text encoder. .
[0061] Some symbols used in the present invention are explained as follows: and Represent sentence features and word features respectively, where is the number of words in the relevant corpus, is the dimension of the sentence feature. In the generation process, the image features output in the i-th stage and the reorganized word features are respectively expressed as and In the dynamic semantic evolution module, the input image features at a certain stage are represented as , By Image features generated by the stage The number of channels, is the number of image sub-features. Initial image features Random Gaussian noise passes through the generator get.
[0062] The present invention uses weighted pooling on image features to obtain a concise generative feedback for subsequent recombination. First, a learnable weight matrix Project the image features to get the aggregation weights , and project the image features into the same embedding space as the word features, and finally pass the normalized exponential function Normalize the aggregation weights to obtain the aggregated image features , the formula of the above process is expressed as follows:
[0063] ;
[0064] ;
[0065] ;
[0066] in, is the image feature dimension, is a learnable matrix.
[0067] 2. Dynamic element screening
[0068] After obtaining the aggregated image features, we need to further select the words that need to be reassembled. On the one hand, not all words have visual meaning, and unnecessary emphasis on these meaningless words will have a negative impact on the reorganization of other important words. On the other hand, different generation stages have different important words, so some important words may not need to be reassembled at a certain stage. This time, we first calculate the cross-modal correlation matrix , and then perform mean pooling to obtain the correlation between each aggregated image feature and the entire word feature , the above process is expressed by the formula as follows:
[0069] ;
[0070] ;
[0071] ;
[0072] in, express The Row and Elements of a column.
[0073] Finally, the following formula is used to determine whether a word needs to be regenerated in the next step:
[0074] ;
[0075] in is a learnable matrix, represents the cascade operation along the channel dimension, is a learnable parameter that controls the gating function.
[0076] Updated word features , the word features that do not need to be recombined are set to 0.
[0077] 3. Dynamic Subspace Combination
[0078] Since existing research has proved that different representation subspaces have different semantic information, the present invention divides the word feature space into multiple word subspaces. Instead of adjusting it as a hyperparameter, the feature space is divided into word subspaces of different granularities to construct a complete semantic space, and then dynamic word subspace routing is configured to generate paths in the perception stage, thereby bringing more accurate and diverse semantic reconstruction results. Word subspaces of different granularities are represented as , the list of word subspace numbers is recorded as , Refers to the number of word subspaces in the jth dimension. The semantics represented by the different divided word subspaces are recombined through the attention mechanism:
[0079] ;
[0080] ;
[0081] ;
[0082] in, is a learnable matrix. is the attention value after the hyperbolic tangent function The processed value. The operation remaps the divided word subspaces back to the original size. is the Hammond matrix product.
[0083] Yes Perform the following weighted sum operation:
[0084] ;
[0085] Here, the semantics of each divided word subspace is reassembled as a whole. The value range is , the different semantics of word features are suppressed or enhanced to different degrees, achieving recombination. In order to achieve dynamic granular word subspace combination, another learnable weight is added , the word features after reorganization in stage i The calculation formula is as follows:
[0086] ;
[0087] ;
[0088] ;
[0089] ;
[0090] in, , softmax is the activation function.
[0091] 4. Single versus multi-stage structure
[0092] The above three parts together constitute the Dynamic Semantic Evolution Module (DSE). In order to further facilitate text-image interaction, the present invention proposes to use a single adversarial multi-stage structure, that is, remove the discriminator in the intermediate process and only retain the discriminator in the final stage. On the one hand, since the discriminator at each stage is removed, each generator cannot get immediate generation feedback, so the grid deformation module (transformerblock) is adopted as the basic structure of the intermediate process generator. Its built-in self-attention operation enables it to have better expression and learning capabilities. On the other hand, the present invention introduces a weighted hierarchical image integration to form the final image, which allows each generator to focus only on adding corresponding details based on the generation results of the previous stages, rather than outputting a complete image. In the generation process, there is stage, corresponding to Generators , the generator of each stage is the image feature of the previous stage As input, and the output size increases from small to large generated images .
[0093] The generative model also includes a stage 0, and the corresponding generator is denoted as , The input is random Gaussian noise and conditionally enhanced sentence features , output the image features of stage 0 and the generated image at stage 0 :
[0094] ;
[0095] in It is a conditional enhancement that enhances the sentence features by resampling the input sentence features from an independent Gaussian distribution to avoid overfitting. is random Gaussian noise.
[0096] Stage 1 to stage M are expressed as:
[0097] ;
[0098] ;
[0099] in, Represents the i-th dynamic semantic evolution module. All generated images are weighted summed through jump connections to form the final target image :
[0100] .
[0101] in, The elements in are all learnable values and are initialized to ; Indicates sum.
[0102] 5. Generate model training
[0103] The overall objective function of the generative model includes the following three items: discriminator objective function, generator adversarial objective function and image-text matching objective function.
[0104] The discriminator objective function is ,in is the matching sentence feature, are the mismatched sentence features, is a real image, is to generate an image. is the decision given by the discriminator whether the input image matches the input sentence, and the variable and is the hyperparameter of the matching-aware zero-centered gradient penalty loss:
[0105] ;
[0106] in, All that satisfies Distribution , It means finding the corresponding expected value for the variable that satisfies the distribution. is the gradient operator, and Respectively and Find the gradient. The operation is to find the second-order norm of the corresponding matrix or value, for example Yes Find the second-order norm. is a hyperparameter that balances the gradient.
[0107] Generator against the objective function for:
[0108] ;
[0109] Image-text matching objective function for:
[0110] ;
[0111] in, is defined as the divergence between the standard Gaussian distribution and the training text Gaussian distribution, that is, . represents a Gaussian distribution, e.g. The mean is , the variance is Gaussian distribution.
[0112] The overall objective function used for training yes:
[0113] ;
[0114] and It is a hyperparameter used to adjust the loss function.
[0115] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention, and any reference numerals in the claims should not be regarded as limiting the claims involved.
[0116] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
Claims
1. A dynamic evolution multimodal value generation method based on value system guidance, characterized in that: The given initial text related to the value system is input into the trained generative model to generate multimodal content that conforms to the value system. The training process of the generative model includes the following steps: Step 1: Generate a query graph structure through the initial text, query the relevant corpus of the initial text in the knowledge graph related to the value system through the query graph structure, and encode the relevant corpus into sentence features through a text encoder. ; The features of each word in the relevant corpus obtained after passing through the text encoder are spliced together and recorded as the word features after reorganization in stage 0 , is the number of words in the relevant corpus, It is a sentence feature The dimension of represents a real number; Step 2: construct a single adversarial multi-stage structure with M stages, each stage adopts a generative structure; each generative structure includes a generator and a dynamic semantic evolution module, and the generative structure of the last stage also includes a discriminator; Random Gaussian noise and conditional enhanced sentence features Input to the generator , output the image features of stage 0 and the generated image at stage 0 ; The generator of the generated structure corresponding to the i-th stage is recorded as , , The input is the image feature of the i-1th stage and the word features after reorganization in stage i , the output is the image feature of the i-th stage and the generated image of the i-th stage ; Dynamic semantic evolution module of the generated structure corresponding to the i-th stage The input is the image feature of the i-1th stage and the word features after reorganization in stage i-1 ; Dynamic semantic evolution module, which transforms the input image features Projected to the reorganized word features The same embedding space, get the aggregated image features ; Screen the word features at different stages and reorganize the word features Updates include: First calculate the cross-modal correlation matrix , and then perform mean pooling to obtain the image features after each aggregation Correlation with the whole word feature : ; ; ; in, Represents the cross-modal correlation matrix The Row and The elements of the column, represents the mean of all elements in the k columns of the cross-modal correlation matrix, is the image feature The dimension of represents transpose; Determine whether a word needs to be regenerated in the next stage by weight The value of is determined by: ; in, The value range is , as the weight to update the next stage of word features, the updated word features , the word features that do not need to be recombined are set to 0; is a learnable matrix, represents the cascade operation along the channel dimension, is a learnable parameter that controls the gating function; is the hyperbolic tangent function; The updated word features The space where the word is located is divided into multiple word subspaces and combined through the attention mechanism to output the reorganized word features in the i-th stage , ; All generated images are connected through skip connections Weighted sum, , and get the final target image , that is, to obtain multimodal content that conforms to the value system; Step three, train the generative model: train the generative model through the discriminator objective function composed of sentence features that match the generated image, sentence features that do not match the generated image, real images and generated images, the generator adversarial objective function, and the image-text matching objective function based on the divergence between the standard Gaussian distribution and the training text Gaussian distribution.
2. The method for generating dynamic evolutionary multimodal value based on value system guidance according to claim 1 is characterized in that: The input image features Projected to the reorganized word features The same embedding space, get the aggregated image features , specifically including: Image features , is the image feature The number of channels, is the image feature The number of image sub-features in ; Using a learnable weight matrix Image features Projection to get the aggregation weight , and the image features Projection to word features The same embedding space, get the projected image features , and finally through the normalized exponential function Aggregation weight Perform normalization to obtain aggregated image features : ; ; ; in, is the image feature The dimension of is a learnable matrix, Indicates transpose.
3. The method for generating dynamic evolutionary multimodal value based on value system guidance according to claim 1 is characterized in that: The updated word features The space where the word is located is divided into multiple word subspaces and combined through the attention mechanism, and the output is the reorganized word feature of the i-th stage , including: The divided word subspace is expressed as , a list of the number of word subspaces , The dimension is The number of word subspaces, Represents the total number of dimensions of the word subspace; the semantics represented by the different divided word subspaces are recombined through the attention mechanism: ; ; ; in, , are all learnable matrices, , , Respectively represent the image features and word features through the learnable matrix The query matrix, key value matrix and value matrix obtained after mapping; is the attention value after the hyperbolic tangent function The processed value; Represents the operation of restoring the divided word subspace to its original size; is the Hammond matrix product; Features of words that indicate original size; It is the operation of weighted sum to get the attention value: ; Add another learnable weight , realize the combination of multiple word subspaces, and obtain the word features after the reorganization in the i-th stage : ; ; ; ; in, The numerical matrix representing the dynamic granularity word subspace is obtained by multiplying the aggregated image features and the learnable weights. The weighted sum of the attention values of the numerical matrix representing the dynamic granularity word subspace, Represents the mean of the attention values of all granularities of the same word feature, , represents the averaging operation, is the activation function, Express The average attention value after nonlinear activation operation, express The attention value of the word subspace in the jth dimension.
4. The method for generating multimodal value based on dynamic evolution guided by a value system according to claim 1 is characterized in that: The discriminator objective function for: ; Express satisfaction Distribution Seek hope, It means satisfying All distribution , Express satisfaction Distribution Seek hope, Indicates compliance All distribution , and Respectively and Find the gradient, represents the second-order norm, is the sentence feature that matches the generated image, are sentence features that do not match the generated image, is a real image, is to generate an image; It is the decision of whether the input sentence features given by the discriminator and the generated image output by the generator match. is a hyperparameter of the matching-aware zero-centered gradient penalty loss; is a hyperparameter for balancing gradients; Generator against the objective function for: ; Image-text matching objective function for: ; in, represents the divergence, represents a Gaussian distribution, represents the mean of the sentence features, Represents the variance of sentence features; used as the overall objective function for training the generative model for: ; and It is a hyperparameter used to adjust the loss function.
