Image generation data processing method, image generation method and device

By extracting the concept identification information and category text features of the target object in the image generation model, the problem of mismatch between action and appearance in the image generation model is solved, and the coordination of the image generation results is improved.

CN118229844BActive Publication Date: 2024-09-20TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410635196.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-09-20
Estimated Expiration
2044-05-22

AI Technical Summary

Technical Problem

It is difficult for traditional image generation models to ensure the coordination between the action and appearance of the object to be predicted in the prediction image during the training phase, leading to the problem of mismatch between action and appearance in the prediction results.

Method used

By obtaining a sample set, including sample images and sample texts of the target object, the image generation model is trained, and based on the model, feature extraction is performed on the concept identification information and category text of the target object, and reference information is generated to ensure that the object to be predicted in the image is predicted. The action is consistent with the appearance.

Benefits of technology

The consistency of the appearance and action of the object to be predicted in the predicted image is improved, ensuring that the appearance of the object in the generated image is consistent with the input image, and the action conforms to the category of the object in the input image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118229844B
    Figure CN118229844B
Patent Text Reader

Abstract

The present application relates to a method for processing image generation data, an image generation method and a device, and belongs to the field of artificial intelligence technology. The method comprises: obtaining a sample set; training an image generation model based on the sample image and the sample text; extracting features from the concept identification information of the target object based on the image generation model to obtain a first embedded feature; obtaining a second embedded feature obtained by extracting features from the category text of the target object; associating and storing the concept identification information, the first embedded feature, and the second embedded feature of the target object to obtain reference information, wherein the reference information is used to generate a target text, and the target text and the input image containing the object to be predicted are used to be input into the image generation model, and a predicted image is output. The disclosed embodiment can improve the consistency of the appearance and action of the object to be predicted in the predicted image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method for processing image generation data, an image generation method, an apparatus, a computer device, a storage medium, and a computer program product. Background Art

[0002] In the related art, the text and the image of the target object are input into the image generation model, and the predicted image containing the target object related to the text is output. The prediction quality of the predicted image can be measured by the object appearance and the object action. For example, the target object is a blue robot with a "black circle on the left eye" and the text content is "Let the robot run on the road". It is necessary to ensure that the object appearance is correct and the object action is correct, where the correct object appearance means that the blue robot has a black circle on the left eye, and the correct object action means that the running action of the blue robot is consistent with the running action of the robot, not the running action of other target objects.

[0003] However, in the training phase, the traditional image generation model sets identification information for the object to be predicted and adds the identification information to the expression features of the sample text to limit the object to be predicted in the predicted image to be the same target object as the object to be predicted in the input image of the model. The prediction results of the image generation model trained by the above method are difficult to ensure the coordination of the action, that is, the action of the object to be predicted in the predicted image does not match the appearance. Summary of the invention

[0004] Based on this, it is necessary to provide a method for processing image generation data, an image generation method, an apparatus, a computer device, a storage medium and a computer program product that can improve the consistency between the appearance and action of the object to be predicted in the predicted image in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for processing image generation data, the method comprising:

[0006] Acquire a sample set; wherein the sample set includes a plurality of sample images containing a target object and sample texts corresponding to the sample images, and the sample texts include concept identification information of the target object and category text of the target object;

[0007] Based on the sample image and the sample text, an image generation model is trained;

[0008] Extracting features from the concept identification information of the target object based on the image generation model to obtain a first embedded feature;

[0009] Acquire a second embedded feature obtained by extracting features from the category text of the target object;

[0010] The concept identification information, the first embedded feature, and the second embedded feature of the target object are associated and stored to obtain reference information, wherein the reference information is used to generate a target text, and the target text and an input image containing the object to be predicted are input into the image generation model to output a predicted image, wherein the target action of the object to be predicted in the predicted image matches the target text.

[0011] In a second aspect, the present application also provides an image generation method, the method comprising:

[0012] Acquire an input image containing an object to be predicted and a corresponding original text; wherein the original text includes concept identification information;

[0013] Searching for a first embedded feature and a second embedded feature corresponding to the concept identification information; replacing the concept identification information in the original text with the first embedded feature and the second embedded feature to obtain a target text; wherein the first embedded feature is obtained by extracting features from the concept identification information, and the second embedded feature is obtained by extracting features from the category text corresponding to the object to be predicted;

[0014] The image and the target text are input into an image generation model, and a predicted image is output; wherein the target action of the object to be predicted in the predicted image matches the target text; wherein the image generation model is trained based on sample images and sample texts; wherein the sample image contains the target object, and the sample text includes the concept identification information of the target object and the category text of the target object.

[0015] In a third aspect, the present application also provides a training device for an image generation model, the device comprising:

[0016] A first acquisition module is used to acquire a sample set; wherein the sample set includes a plurality of sample images containing a target object and sample texts corresponding to the sample images, and the sample texts include concept identification information of the target object and category text of the target object;

[0017] A training module, used for training an image generation model based on the sample image and the sample text;

[0018] An extraction module, configured to extract features from the concept identification information of the target object based on the image generation model to obtain a first embedded feature;

[0019] A second acquisition module is used to acquire a second embedded feature obtained by extracting features from the category text of the target object;

[0020] A storage module is used to associate and store the concept identification information, the first embedded feature, and the second embedded feature of the target object to obtain reference information, wherein the reference information is used to generate a target text, and the target text and an input image containing the object to be predicted are used to be input into the image generation model, and a predicted image is output, and the target action of the object to be predicted in the predicted image matches the target text.

[0021] In one embodiment, the second embedded feature is obtained by extracting features of the category text of the target object based on the initial image generation model, and the device further includes:

[0022] An extraction module is used to extract features of the category text of the target object based on the image generation model to obtain a third embedded feature; wherein the image generation model is obtained by training the initial image generation model based on the sample image and the sample text.

[0023] The storage module also includes:

[0024] The storage submodule is used to associate and store the concept identification information, the first embedded feature, the second embedded feature, and the third embedded feature of the target object to obtain reference information.

[0025] In one embodiment, the sample text includes a first text and a second text, and the training module is further used for:

[0026] Based on the first text and the sample image, an initial image generation model is trained to obtain an intermediate image generation model; wherein the first text includes a concept identifier of the target object and an action text describing a target action of the target object;

[0027] Based on the intermediate image generation model, feature extraction is performed on the concept identifier of the target object to obtain an intermediate embedding feature;

[0028] Based on the initial image generation model, feature extraction is performed on the second text to obtain a second text feature vector; wherein the second text includes a category text of the target object and an action text describing a target action of the target object;

[0029] Fusing the intermediate embedding feature and the second text feature vector to obtain a fused text feature vector;

[0030] The intermediate image generation model is trained based on the fused text feature vector to obtain an image generation model.

[0031] In one embodiment, the initial image generation model includes an original image generation network and a first attention mechanism network, and the training module is further used to:

[0032] Extracting features of the sample text based on the original image generation network in the initial image generation model to obtain a text feature vector; extracting features of the sample image based on the original image generation network to obtain an original image feature vector;

[0033] Adding noise to the original image feature vector based on the original image generation network to obtain a noise image feature vector;

[0034] Based on the first attention mechanism network in the initial image generation model, the text feature vector and the noise image feature vector are fused to obtain a first fused feature vector;

[0035] Based on the first fused feature vector and the original image generation network, a predicted image and predicted noise are obtained;

[0036] Based on the difference between the predicted noise and the noise added to the sample image, the network parameters of the first attention mechanism network in the initial image generation model are iteratively adjusted until preset requirements are met to obtain an image generation model.

[0037] In one embodiment, the original image generation network includes a text encoder and a second attention mechanism network, and the training module is further used to:

[0038] Based on the text encoder, feature extraction is performed on the sample text to obtain a text feature vector;

[0039] Based on the first fused feature vector and the original image generation network, a predicted image and predicted noise are obtained, including:

[0040] Based on the second attention mechanism network, the text feature vector and the noise image feature vector are fused to obtain a second fused feature vector;

[0041] Performing weighted fusion on the first fused feature vector and the second fused feature vector to obtain a total fused feature vector;

[0042] Based on the total fused feature vector, a predicted image and predicted noise are obtained.

[0043] In one embodiment, the training module is further used to:

[0044] Extracting a text feature key vector and a text feature value vector of the text feature vector based on a first attention mechanism network in the initial image generation model;

[0045] Extracting an image feature query vector of the noise image feature vector based on the first attention mechanism network;

[0046] Based on the similarity between the image feature query vector and the text feature key vector, the text feature value vector is weighted to obtain a first fused feature vector.

[0047] In one embodiment, the training module is further used to:

[0048] Adding noise corresponding to the current time step to the original image feature vector based on the original image generation network to obtain a first image feature vector;

[0049] Adding noise corresponding to the next time step of the current time step to the first image feature vector to obtain a second image feature vector, and continuing to add noise corresponding to the time step to the second image feature vector until a preset requirement is met to obtain a noise image feature vector;

[0050] The generating network based on the first fused feature vector and the original image to obtain a predicted image and predicted noise includes:

[0051] Based on the first fused feature vector, the target time step corresponding to the noise image feature vector, and the original image generation network, obtaining the predicted noise corresponding to the target time step;

[0052] The prediction noise corresponding to the target time step is removed from the first fused feature vector to obtain a fused feature vector corresponding to a time step before the target time step, and the prediction noise corresponding to the previous time step is continued to be removed from the fused feature vector corresponding to the previous time step until preset requirements are met to obtain a predicted image.

[0053] In one embodiment, the training module is further used to:

[0054] Determining a noise difference corresponding to the time step based on the noise added at the time step and the predicted noise corresponding to the time step;

[0055] Based on the noise differences corresponding to each time step, the network parameters of the first attention mechanism network are iteratively adjusted.

[0056] In one embodiment, the first acquisition module is further used for:

[0057] Acquire an initial sample text, wherein the initial sample text includes a concept word of the target object and an action text describing a target action of the target object;

[0058] Acquire a concept identifier corresponding to the concept word of the target object and a category text of the target object;

[0059] Replacing the concept words in the initial sample text with the concept identifier and the category text to obtain a sample text;

[0060] A sample set is obtained based on the sample text and the sample image of the target object.

[0061] In a fourth aspect, the present application further provides an image generating device, the device comprising:

[0062] A third acquisition module is used to acquire an input image containing an object to be predicted and a corresponding original text; wherein the original text includes concept identification information;

[0063] A search module is used to search for a first embedded feature and a second embedded feature corresponding to the concept identification information; replace the concept identification information in the original text with the first embedded feature and the second embedded feature to obtain a target text; wherein the first embedded feature is obtained by extracting features from the concept identification information, and the second embedded feature is obtained by extracting features from the category text corresponding to the concept identification information;

[0064] A generation module is used to input the input image and the target text into an image generation model and output a predicted image; wherein the target action of the object to be predicted in the predicted image matches the target text; wherein the image generation model is trained based on sample images and sample texts; wherein the sample image contains the target object, and the sample text includes the concept identification information of the target object and the category text of the target object.

[0065] In one embodiment, the second embedded feature is obtained by extracting features of the category text corresponding to the concept identification information based on the initial image generation model, and the search module is further used to:

[0066] Based on the image generation model, extract the category text of the object to be predicted to obtain a third embedded feature;

[0067] The concept identification information in the original text is replaced with the first embedded feature, the second embedded feature and the third embedded feature to obtain a target text.

[0068] In a fifth aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any method of the embodiments of the present disclosure are implemented.

[0069] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored thereon, and when the computer program is executed by a processor, the steps of any method of the embodiments of the present disclosure are implemented.

[0070] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of any method of the embodiments of the present disclosure are implemented.

[0071] In the above embodiment, the concept identification information can uniquely identify the target object in the image. In the reasoning stage (application stage) of the image generation model, by adding the first embedded feature corresponding to the concept identification information to the original text, the target text with the first embedded feature is used to guide the generation of the action of the object to be predicted in the input image containing the object to be predicted, so that the appearance of the object to be predicted in the generated predicted image can be kept consistent with the object to be predicted in the input image. For example, the appearance of the cat in the predicted image is consistent with the appearance of the cat in the input image, rather than the same as the appearance of other cats. Further, the category text can characterize the category of the target object. By adding the second embedded feature corresponding to the category text to the original text, the target text to be input with the second feature is used to guide the generation of the action of the object to be predicted in the input image, so that the action of the object to be predicted in the generated predicted image can be consistent with the category of the object to be predicted in the input image, rather than being limited to the action of the object to be predicted itself, thereby enriching the generated action of the object to be predicted. Thereby, the consistency between the appearance and action of the object to be predicted in the predicted image can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 A diagram of an application environment of a method for processing image generation data in one embodiment;

[0073] FIG2 is a schematic flow chart of a method for processing image generation data in one embodiment;

[0074] Figure 3 A schematic diagram of the relationship between the first embedded feature, the second embedded feature and the third embedded feature in one embodiment;

[0075] Figure 4 A schematic flow chart of a method for processing image generation data in one embodiment;

[0076] Figure 5 A schematic flow chart of a method for processing image generation data in one embodiment;

[0077] Figure 6 An architecture diagram of a training image generation model in one embodiment;

[0078] Figure 7 A schematic flow chart of a method for processing image generation data in one embodiment;

[0079] Figure 8 A schematic diagram of a denoising process of an image generation model in one embodiment;

[0080] Fig. 9 A schematic flow chart of a method for processing image generation data in one embodiment;

[0081] Fig.10 A schematic flow chart of a method for processing image generation data in one embodiment;

[0082] Fig.11 An application interface diagram of an image generation method in an embodiment;

[0083] Fig.12 is an architectural diagram of an image generation model in one embodiment;

[0084] Fig.13 A schematic diagram of a training device for an image generation model in one embodiment;

[0085] Fig.14 is a schematic diagram of an image generating device in one embodiment;

[0086] FIG15 is a diagram showing the internal structure of a computer device in one embodiment;

[0087] FIG. 16 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0088] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0089] In order to facilitate those skilled in the art to understand the technical solution provided by the embodiments of the present disclosure, the technical environment in which the technical solution is implemented is described below.

[0090] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0091] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics and other technologies. Among them, the pre-trained model is also called a large model or a basic model. After fine-tuning, it can be widely used in downstream tasks in various major directions of artificial intelligence. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0092] Computer Vision (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision that uses cameras and computers to replace human eyes to identify, locate and measure targets, and further performs image processing to make computer processing into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multidimensional data. Large model technology has brought important changes to the development of computer vision technology. Pre-trained models in the visual field such as swin-transformer, ViT, V-MOE, and MAE can be quickly and widely applied to downstream specific tasks after fine tuning. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

[0093] The key technologies of speech technology include automatic speech recognition technology (ASR), text-to-speech technology (TTS) and voiceprint recognition technology. Enabling computers to listen, see, speak and feel is the future development direction of human-computer interaction, among which speech becomes one of the promising human-computer interaction methods. Large model technology has brought changes to the development of speech technology. Pre-trained models such as WavLM and UniSpeech that use the Transformer architecture have strong generalization and versatility, and can excellently complete speech processing tasks in various directions.

[0094] Natural language processing (NLP) is an important field in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing involves natural language, which is the language people use in daily life, and is closely related to linguistic research. The pre-trained model is developed from the large language model in the field of NLP. After fine-tuning, the large language model can be widely used in downstream tasks. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.

[0095] Machine Learning (ML) is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by induction. The pre-trained model is the latest development of deep learning, which integrates the above technologies.

[0096] Autonomous driving technology refers to the ability of a vehicle to drive itself without the need for a driver. It usually includes technologies such as high-precision maps, environmental perception, computer vision, behavioral decision-making, path planning, and motion control. Autonomous driving includes multiple development paths such as single-vehicle intelligence, vehicle-road collaboration, and networked cloud control. Autonomous driving technology has a wide range of application prospects. In addition to the current fields of logistics, public transportation, taxis, and smart transportation, it will be further developed in the future.

[0097] With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, digital twins, virtual humans, robots, artificial intelligence generated content (AIGC), conversational interaction, smart medical care, smart customer service, game AI, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role. The solution provided in the embodiment of this application involves computer vision technology, natural language processing, machine learning / deep learning and other technologies.

[0098] The image generation data processing method or image generation method provided in the embodiments of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store data that the server 104 needs to process. The data storage system can be set up separately, can be integrated on the server 104, or can be placed on the cloud or other servers. In an exemplary embodiment, after the processing method of image generation data is trained and generated in the server 104, the input image containing the object to be predicted and the corresponding original text can be obtained at the terminal 102, and the image of the object to be predicted and the corresponding original text are sent to the server 104 to instruct the server 104 to process and predict the image of the object to be predicted and the corresponding original text based on the trained image generation model, obtain a predicted image, and return the predicted image to the terminal 102.

[0099] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.

[0100] As shown in FIG. 2 , a method for processing image generation data is provided. The method can be executed by a computer device. The computer device can be Figure 1 The method comprises the following steps:

[0101] Step S201, obtaining a sample set; wherein the sample set includes a plurality of sample images containing a target object and sample texts corresponding to the sample images, and the sample texts include concept identification information of the target object and category text of the target object.

[0102] Among them, the target object may include an object that objectively exists in the real world, such as a cat, a dog, a bird, a frog, a bee, etc., and the target object may also include an object that virtually exists in the virtual world, such as a cartoon character, a cartoon animal, an animation object, etc. Optionally, the target object may include an object with actions, such as a frog that can jump and a bird that can fly. Exemplarily, the target object may also include a static object, such as a table, a flower, a tree, etc., but static objects do not have exclusive or clearly distinguishable action attributes and are not the focus of this application.

[0103] Among them, the concept identification information may include identification information that can uniquely identify the target object. The concept identification information may include a concept identifier and a concept word. Among them, the concept identifier: for example, the concept identification information "DJ" and the concept identification information "HH" both represent a cat, the concept identification information "DJ" represents the yellow cat lying under the seat, and the concept identification information "HH" represents the tabby cat climbing the tree, that is, although there may be many kinds of yellow cats, "DJ" has unique identification. In an exemplary embodiment, the way to obtain the concept identification information may include multiple methods, for example, selecting existing words as concept identification information, constructing a special marker with letters or numbers as concept identification information, or selecting rare words from the vocabulary as concept identification information. In the specific implementation process, the concept identifier of the target object is difficult for the user to remember, so the concept word of the target object can be set to distinguish the target object. For example, "Winnie".

[0104] The category text may include the category of the target object presented in text form, for example, both wild geese and egrets belong to the category of birds, while bees and butterflies belong to the category of insects. Then, the category of wild geese and egrets is "birds", while the category of bees and butterflies is "insects".

[0105] In the disclosed embodiment, in addition to the above-mentioned concept identification information of the target object and the category text of the target object, the sample text may also include an action text describing the target action of the target object, for example, the target object: "Winnie", the action text: "running on the floor"; the target object: "Flower", the action text: "climbing a tree"; the target object "Wangwang", the action text: "rolling on the lawn with a bone in mouth". The action text describing the target action of the target object is used to limit the specific action displayed by the object to be predicted in the prediction image during the training process.

[0106] Step S203: training an image generation model based on the sample image and the sample text.

[0107] Specifically, the image generation model can be trained based on the sample image and the sample text on the basis of the initial image generation model. The initial image generation model may include a diffusion model, wherein the diffusion model may be a model that adds noise to the target image based on the target text and the target image, and recovers a predicted image related to the target text from the noise image driven by the target text. Specifically, the initial image generation model may include an Imagen model, a NovelAI model, a Midjourney model, a Sora model, a Stable Diffusion model, and the like.

[0108] In the disclosed embodiment, based on the sample images and sample texts, a machine learning method can be used to train the initial image generation model to obtain the image generation model, wherein machine learning includes deep learning, supervised learning, reinforcement learning, etc.

[0109] Step S205: extracting features of the concept identification information of the target object based on the image generation model to obtain a first embedded feature.

[0110] In an exemplary embodiment, a text encoder in an image generation model may be used to perform feature encoding on the concept identification information of the target object to obtain a first embedded feature. The text encoder may include a pre-trained text encoder, such as a CLIP model, a BERT model, etc. Taking the CLIP model as an example, the CLIP model maps words in the text to text vectors through vocabulary mapping, and the word vector corresponding to each word may be called a token.

[0111] Step S207: Acquire a second embedded feature obtained by performing feature extraction on the category text of the target object.

[0112] Similarly, the text encoder in the initial image generation model can also be used to feature encode the category text of the target object in the target object to obtain the second embedded feature. The text encoder can have the same network structure as the text encoder in the above embodiment, and this disclosure will not repeat it here.

[0113] It should be noted that the initial image generation model already has the ability to generate actions of the target object category. Therefore, in the embodiments of the present disclosure, the second embedded features of the target object category can be generated by the initial image generation model.

[0114] Step S209: The concept identification information, the first embedded feature, and the second embedded feature of the target object are associated and stored to obtain reference information.

[0115] The reference information is used to generate a target text, and the target text and an input image containing an object to be predicted are input into the image generation model to output a predicted image, in which the target action of the object to be predicted in the predicted image matches the target text.

[0116] In the specific implementation process, the concept identifier of the target object is difficult for the user to remember, so the concept word of the target object can be set to distinguish the target object. In an exemplary embodiment, the database can store concept identification information, the first embedded feature, and the second embedded feature. In another exemplary embodiment, the above concept words can also be added to the database, for example: concept word: concept identifier, category text, first embedded feature, second embedded feature. In a specific embodiment, for example: "Winnie": DJ, cat, [V], [ACT].

[0117] In the specific application process of the image generation model in the disclosed embodiment, according to the original text input by the user and the input image containing the object to be predicted, wherein the original text may include concept identification information and action text describing the target action of the object to be predicted, the first embedded feature and the second embedded feature corresponding to the concept identification information are searched; the concept identification information in the original text is replaced with the first embedded feature and the second embedded feature to obtain the target text. The input image and the target text are input into the image generation model, and the predicted image is output.

[0118] In the above embodiment, the concept identification information can uniquely identify the target object in the image. In the reasoning stage (application stage) of the image generation model, by adding the first embedded feature corresponding to the concept identification information to the original text, the target text with the first embedded feature is used to guide the generation of the action of the object to be predicted in the input image containing the object to be predicted, so that the appearance of the object to be predicted in the generated predicted image can be kept consistent with the object to be predicted in the input image. For example, the appearance of the cat in the predicted image is consistent with the appearance of the cat in the input image, rather than the same as the appearance of other cats. Further, the category text can characterize the category of the target object. By adding the second embedded feature corresponding to the category text to the original text, the target text with the second feature is used to guide the generation of the action of the object to be predicted in the input image, so that the action of the object to be predicted in the generated predicted image can be consistent with the category of the object to be predicted in the input image, rather than being limited to the action of the object to be predicted itself, thereby enriching the generated action of the object to be predicted. Thereby, the consistency between the appearance and action of the object to be predicted in the predicted image can be improved.

[0119] In one embodiment, the second embedded feature is obtained by extracting features of the category text of the target object based on an initial image generation model, and after the image generation model is trained based on the sample image and the sample text, the method further includes:

[0120] Extracting features of the category text of the target object based on the image generation model to obtain a third embedded feature;

[0121] The step of associating and storing the concept identification information of the target object, the first embedded feature, and the second embedded feature to obtain reference information includes:

[0122] The concept identification information, the first embedded feature, the second embedded feature, and the third embedded feature of the target object are stored in association to obtain reference information.

[0123] Specifically, the text encoder in the image generation model can be used to perform feature encoding on the concept category of the target object to obtain the third embedding feature. The text encoder can include a pre-trained text encoder, such as a CLIP model, a BERT model, etc.

[0124] In the embodiments of the present disclosure, reference Figure 3 As shown, when introducing the first embedded feature corresponding to the concept identification information and the second embedded feature corresponding to the category text, it is taken into account that the embedded features of the same word are different in different contexts, that is, the second embedded feature is extracted by the initial image generation model. In order to improve the adaptability of the image generation model to the second embedded feature and the first embedded feature, the trained image generation model is used to extract features of the category text again to obtain the third embedded feature, thereby improving the coordination of the image generation model in predicting the appearance and action of the target object in the image; wherein the first embedded feature is used to characterize the appearance information of the target object, and the second embedded feature is used to characterize the action information of the target object.

[0125] In one embodiment, reference Figure 4 As shown, the sample text includes a first text and a second text, and the image generation model is trained based on the sample image and the sample text, including:

[0126] Step S401, based on the first text and the sample image, an initial image generation model is trained to obtain an intermediate image generation model; wherein the first text includes a concept identifier of the target object and an action text describing a target action of the target object.

[0127] Specifically, the original sample text is, for example, "Winnie is running on the floor", where Winnie represents the concept word of the target object. In an exemplary embodiment, assuming that the concept identifier of the target object is represented by V1, the first text can be represented as: "V2 is running on the floor". Wherein, "running on the floor" represents the action text of the target action of the target object.

[0128] Wherein, similar to the above-mentioned embodiment, the initial image generation model may include a diffusion model, wherein the diffusion model may be a model that adds noise to the target image based on the target text and the target image, and recovers a predicted image related to the target text from the noise image under the drive of the target text. Specifically, the initial image generation model may include an Imagen model, a NovelAI model, a Midjourney model, a Sora model, a Stable Diffusion model, etc. In an exemplary embodiment, a machine learning method may be used to train the initial image generation model to obtain an image generation model. Wherein, the condition for the end of training may include that the number of iterations meets a preset requirement, such as 1000 times.

[0129] Step S403: Based on the intermediate image generation model, feature extraction is performed on the concept identifier of the target object to obtain intermediate embedded features.

[0130] In an exemplary embodiment, a text encoder in an intermediate image generation model may be used to perform feature encoding on a concept identifier of a target object to obtain an intermediate embedding feature. The text encoder may include a pre-trained text encoder, such as a CLIP model, a BERT model, etc. For example, the intermediate embedding feature is represented as V2.

[0131] Step S405, based on the initial image generation model, feature extraction is performed on the second text to obtain a second text feature vector; wherein the second text includes the category text of the target object and the action text describing the target action of the target object.

[0132] Specifically, the original sample text is, for example: "Winnie is running on the floor", where Winnie represents the concept word of the target object. In an exemplary embodiment, assuming that the category text of the target object is represented as "cat", the second text can be represented as "cat running on the floor". Among them, "running on the floor" represents the action text of the target action of the target object. In an exemplary embodiment, the text encoder in the initial image generation model can be used to perform feature encoding on the second text to obtain a second text feature vector. Among them, the text encoder may include a pre-trained text encoder, such as a CLIP model, a BERT model, etc. Among them, the second text feature vector includes a second embedded feature corresponding to the category text, for example, represented as [act] and a feature vector corresponding to the action text of the target action of the target object.

[0133] Step S407: fusing the intermediate embedded feature and the second text feature vector to obtain a fused text feature vector.

[0134] In an exemplary embodiment, the fusion processing of the intermediate embedded feature and the second text feature vector may include inserting the intermediate embedded feature into the second text feature vector. In the above example, the intermediate embedded feature can be represented as V2, and the second text feature vector can be represented as: [act] and the feature vector corresponding to the action text of the target object target action, then the fused text feature vector can be represented as: V2, [act] and the feature vector corresponding to the action text of the target object target action.

[0135] Step S409 trains the intermediate image generation model based on the fused text feature vector to obtain an image generation model.

[0136] In an exemplary embodiment, the intermediate image generation model is trained based on the fused text feature vector, and a machine learning method can be used to train the intermediate image generation model to obtain an image generation model. Machine learning includes deep learning, supervised learning, reinforcement learning, etc. The condition for the end of training may include that the number of iterations meets a preset requirement, such as 1000 times.

[0137] In the above embodiment, the initial image generation model is trained in a staged manner. In the first stage, the concept identifier of the target object is trained to obtain the intermediate embedded features corresponding to the concept identifier; in the second stage, the intermediate generation model is trained based on the fusion features of the intermediate embedded features and the second text feature vector, wherein the second text feature vector contains the second embedded features corresponding to the category text, and the second stage training increases the overall adaptability of the model to the second embedded features and the first embedded features. In the staged training method, the task of each training is clear, which facilitates the optimization of the model.

[0138] In one embodiment, reference Figure 5 As shown, the image generation model is trained based on the sample image and the sample text, including:

[0139] Step S501, extracting features from the sample text based on the original image generation network in the initial image generation model to obtain a text feature vector; and extracting features from the sample image based on the original image generation network to obtain an original image feature vector.

[0140] Specifically, the original image generation network may include a diffusion model, wherein the diffusion model may be a model that adds noise to the target image based on the target text and the target image, and recovers a predicted image related to the target text from the noise image under the drive of the target text. Specifically, the original image generation network may include an Imagen model, a NovelAI model, a Midjourney model, a Sora model, a Stable Diffusion model, etc. Figure 6 The Stable Diffusion model shown in the embodiment of the present disclosure adds a first attention mechanism network based on the original Stable Diffusion model.

[0141] In an exemplary embodiment, a text encoder in the initial image generation model may be used to perform feature encoding on the sample text to obtain a text feature vector. The text encoder may include a pre-trained text encoder, such as a CLIP model, a BERT model, etc. Taking the CLIP model as an example, the CLIP model maps words in the text to text vectors through vocabulary mapping, and the word vector corresponding to each word may be called a token.

[0142] In an exemplary embodiment, an image encoder may be used to extract features from a sample image, such as a convolutional neural network, a transformation network, etc. Optionally, the disclosed embodiment uses a VAE image encoder to extract features from a sample image, mapping pixel information to feature information in a latent space. For example, a 512×512 image is compressed from a pixel space to a latent space of 4×64×64, reducing the amount of data by nearly 64 times. VAE encoding can be used to compress data on a sample image to filter out some less important information and retain key information.

[0143] Step S503: adding noise to the original image feature vector based on the original image generation network to obtain a noise image feature vector.

[0144] In the embodiments of the present disclosure, noise is added to the original image feature vector, such as Gaussian noise, salt and pepper noise, Poisson noise, etc., and the present disclosure does not impose any restrictions on this. In an exemplary embodiment, the noise information can be directly added to the original image feature vector at one time to obtain a noise image feature vector. In another exemplary embodiment, the addition can also be performed over time steps. For example, at time t0, noise is added to the original image feature vector to obtain a noise image feature vector p0; at time t1, noise is added to the noise image feature vector p1 to obtain a noise image feature vector p1; at time t2, noise is added to the noise image feature vector p1 to obtain a noise image feature vector p2; ... at t n At this moment, the noise image feature vector p n Add noise to get the noise image feature vector p n . The noise image feature vector p n As the final required noise image feature vector. It should be noted that the noise added corresponding to each time step can be the same or different, and the present disclosure does not limit this.

[0145] Step S505, based on the first attention mechanism network in the initial image generation model, the text feature vector and the noise image feature vector are fused to obtain a first fused feature vector; wherein the first attention mechanism network is a network in the initial image generation model, the initial image generation model is used to generate an image generation model, and the initial image generation model includes the original image generation network and the first attention mechanism network.

[0146] In an exemplary embodiment, the text feature vector and the noise image feature vector are fused based on the first attention mechanism network to obtain a first fused feature vector, including: extracting a text feature key vector and a text feature value vector of the text feature vector based on the first attention mechanism network. Extracting an image feature query vector of the noise image feature vector based on the first attention mechanism network. Based on the similarity between the image feature query vector and the text feature key vector, weighting the text feature value vector to obtain a first fused feature vector.

[0147] Specifically, the noise image feature vector can be represented as P, and the text feature vector can be represented as T. In an exemplary embodiment, the text feature vector is subjected to feature extraction based on the first attention mechanism network to obtain a text feature key vector, which is represented as , and the text feature value vector, expressed as Based on the first attention mechanism network, the feature vector of the noise image is extracted to obtain the image feature query vector .

[0148] Furthermore, based on the similarity between the image feature query vector and the text feature key vector, the similarity can be mapped to a corresponding weight distribution through a related weight function, wherein the weight function can include a Softmax function, a Sigmoid function, a Tanh function, a ReLU function, a Gaussian function, and the like.

[0149] In a specific implementation process, the first fused feature vector can be obtained by the following formula:

[0150] (1)

[0151] in, Represents the dimension of the text feature key vector.

[0152] Step S507: Generate a network based on the first fused feature vector and the original image to obtain a predicted image and predicted noise.

[0153] In an exemplary embodiment, a denoising network may be used to remove noise from the first fused feature vector to obtain a predicted image. The denoising network may include a U-Net network, which is characterized in that it can use the first fused feature vector as an entry and find a low-dimensional representation of the image by reducing sampling, which makes it more suitable for processing and finding important attributes, and then restore the image by increasing sampling to obtain a predicted image and predicted noise.

[0154] Step S509, iteratively adjusting the network parameters of the first attention mechanism network in the initial image generation model based on the difference between the predicted noise and the noise added to the sample image until the preset requirements are met to obtain the image generation model.

[0155] In an exemplary embodiment, a loss may be constructed based on the difference between the predicted noise and the noise added to the sample image. By minimizing the loss, the text encoder and the first attention mechanism network are adjusted until a preset requirement is met, for example, the number of iterations meets a preset requirement, or the accuracy of the model meets a preset requirement, etc.

[0156] In the above embodiment, by adding a first attention mechanism network on the basis of the original image generation network, the first attention mechanism network is used to fuse the text feature vector and the noise image feature vector, thereby realizing the dual control of the text feature vector on the appearance and action of the target object in the predicted image. Furthermore, when adjusting the parameters, the parameters of the added first attention mechanism network and the text encoder network in the original generation network are adjusted, while the parameters of the networks other than the text encoder in the original generation network are not adjusted, which is conducive to the rapid convergence of the image generation model and improves the generation efficiency of the image generation model.

[0157] In one embodiment, the original image generation network includes a text encoder and a second attention mechanism network, and the feature extraction of the sample text to obtain a text feature vector includes:

[0158] Based on the text encoder, feature extraction is performed on the sample text to obtain a text feature vector.

[0159] Specifically, the text encoder may include a pre-trained text encoder, such as a CLIP model, a BERT model, etc. Taking the CLIP model as an example, the CLIP model maps words in the text to text vectors through vocabulary mapping, and the word vector corresponding to each word can be called a token.

[0160] In an exemplary embodiment, reference Figure 7 As shown, based on the first fused feature vector and the original image generation network, a predicted image and predicted noise are obtained, including:

[0161] Step S701: Based on the second attention mechanism network, the text feature vector and the noise image feature vector are fused to obtain a second fused feature vector.

[0162] Reference Figure 6 As shown, the second attention mechanism network may include the attention mechanism network of the original image generation network itself. Based on the second attention mechanism network, the text feature vector and the noise image feature vector are fused to obtain a second fused feature vector, including: extracting the text feature key vector and the text feature value vector of the text feature vector based on the second attention mechanism network. Extracting the image feature query vector of the noise image feature vector based on the second attention mechanism network. Based on the similarity between the image feature query vector and the text feature key vector, the text feature value vector is weighted to obtain a second fused feature vector.

[0163] Specifically, the noise image feature vector can be represented as P, and the text feature vector can be represented as T. In an exemplary embodiment, the text feature vector is subjected to feature extraction based on the second attention mechanism network to obtain a text feature key vector, which is represented as , and the text feature value vector, expressed as Based on the second attention mechanism network, the feature vector of the noise image is extracted to obtain the image feature query vector .

[0164] Furthermore, based on the similarity between the image feature query vector and the text feature key vector, the similarity can be mapped to a corresponding weight distribution through a related weight function, wherein the weight function can include a Softmax function, a Sigmoid function, a Tanh function, a ReLU function, a Gaussian function, and the like.

[0165] In a specific implementation process, the second fused feature vector can be obtained by the following formula:

[0166] (2)

[0167] in, Represents the dimension of the text feature key vector.

[0168] Step S703: performing weighted fusion on the first fused feature vector and the second fused feature vector to obtain a total fused feature vector.

[0169] In an exemplary embodiment, for example, the first fused feature vector is represented as , the weight coefficient is a; the second fused feature vector is expressed as , the weight coefficient is b. The total fusion feature vector can be expressed as a× +b× .

[0170] Step S705: obtaining a predicted image and predicted noise based on the total fused feature vector.

[0171] In an exemplary embodiment, a denoising network may be used to remove noise from the total fused feature vector to obtain a predicted image. The denoising network may include a U-Net network, which is characterized in that it can use the total fused feature vector as an entry and find a low-dimensional representation of the image by reducing sampling, which makes it more suitable for processing and finding important attributes, and then restore the image by increasing sampling to obtain a predicted image and predicted noise.

[0172] In the above embodiment, by combining the added first attention mechanism network with the original image generation network including the text encoder and the second attention mechanism network, the first fused feature vector and the second fused feature vector are weighted fused in a linear weighted manner to obtain a total fused feature vector, which can provide more comprehensive information to the model and improve the accuracy of the image generation model prediction.

[0173] In one embodiment, the adding noise to the original image feature vector based on the original image generation network to obtain the noise image feature vector includes:

[0174] Based on the original image generation network, noise corresponding to the current time step is added to the original image feature vector to obtain a first image feature vector.

[0175] Noise corresponding to the next time step of the current time step is added to the first image feature vector to obtain a second image feature vector, and noise corresponding to the time step is continued to be added to the second image feature vector until a preset requirement is met to obtain a noise image feature vector.

[0176] refer to Figure 6 As shown, in the embodiment of the present disclosure, the process of adding noise to the original image feature vector corresponds to Figure 6 Specifically, for example, at the current time step t0, noise is added to the original image feature vector to obtain the first image feature vector p0; at t1, noise is added to the first image feature vector p1 to obtain the second image feature vector p1; at t2, noise is added to the second image feature vector p1 to obtain the third image feature vector p2; ... at t n At this moment, at the nth image feature vector p n Add noise to get the n+1th image feature vector p n . The n+1th image feature vector p n As the final required noise image feature vector.

[0177] The generating network based on the first fused feature vector and the original image to obtain a predicted image and a predicted noise comprises:

[0178] Based on the first fused feature vector, the target time step corresponding to the noise image feature vector, and the original image generation network, obtaining the predicted noise corresponding to the target time step;

[0179] The prediction noise corresponding to the target time step is removed from the first fused feature vector to obtain a fused feature vector corresponding to a time step before the target time step, and the prediction noise corresponding to the previous time step is continued to be removed from the fused feature vector corresponding to the previous time step until preset requirements are met to obtain a predicted image.

[0180] Specifically, the original image generation network may include a U-Net network, which predicts the noise corresponding to each time step, gradually removes the predicted noise, and obtains a predicted image. The input of the U-Net network may include: the first fusion feature corresponding to the current time step (or the total fusion feature), the current time step, and outputs the predicted added noise corresponding to the current time step.

[0181] refer to Figure 8 As shown, then, the prediction noise corresponding to the target time step n is removed from the first fused feature vector to obtain the first fused feature vector corresponding to the n-1th time step; the prediction noise corresponding to the n-1th time step is continued to be removed from the first fused feature vector corresponding to the n-1th time step to obtain the first fused feature vector corresponding to the n-2th time step, and so on to obtain the first fused feature vector corresponding to the 0th time step, that is, the predicted image is obtained.

[0182] In the above embodiment, by introducing random noise at each time step, the randomness and uncertainty in the real world can be simulated. This randomness can help the model better capture the fluctuation characteristics of information. And it can increase the complexity of the model, making it closer to the actual situation and improving the predictive ability of the model. Furthermore, noise may cause excessive fluctuations in data, making it difficult to conduct effective analysis and prediction. Subtracting noise step by step can help smooth the data, reduce volatility, and make the data easier to understand and analyze; subtracting noise step by step can help remove the impact of noise on the model, making the model more stable and reliable.

[0183] In one embodiment, iteratively adjusting the network parameters of the first attention mechanism network based on the difference between the predicted image and the noise added to the sample image includes:

[0184] Determining a noise difference corresponding to the time step based on the noise added at the time step and the predicted noise corresponding to the time step;

[0185] Based on the noise differences corresponding to each time step, the network parameters of the first attention mechanism network are iteratively adjusted.

[0186] Specifically, the time step can be expressed as , time step The corresponding prediction noise can be expressed as , time step The corresponding noise difference can be expressed as follows:

[0187] (3)

[0188] in, Represents a sample image, a sample image Converted to the original image feature vector through the image encoder , represents the model prediction noise, represents Gaussian distributed noise, represents the noise image feature vector added to the original image feature vector, represents a text feature vector, which may include the first embedded feature, the second embedded feature, and the third embedded feature in the above embodiment.

[0189] In an exemplary embodiment, based on the noise difference corresponding to each time step, the network parameters of the first attention mechanism network are iteratively adjusted to obtain the image generation model. In another exemplary embodiment, based on the noise difference corresponding to each time step, the network parameters in the first attention mechanism network and the text encoder are iteratively adjusted to obtain the image generation model.

[0190] In one embodiment, reference Fig. 9 As shown, obtaining a sample set includes:

[0191] Step S901: acquiring an initial sample text, wherein the initial sample text includes a concept word of the target object and an action text describing a target action of the target object.

[0192] In the specific implementation process, the identifier of the target object is difficult for the user to remember, so the concept word of the target object can be set to distinguish the target object. For example, "Winnie", "Flower", "Wangwang". The initial sample text includes the concept word of the target object and the action text describing the target action of the target object. Specifically, in the above example, the initial sample text is such as: "Winnie is running on the floor"; "Flower is climbing a tree"; "Wangwang is rolling on the lawn with a bone in his mouth".

[0193] Step S903: Acquire a concept identifier corresponding to the concept word of the target object and a category text of the target object.

[0194] The concept identification information may include identification information that can uniquely identify the target object. For example, the concept identification information "DJ" and the concept identification information "HH" both represent a cat. The concept identification information "DJ" represents the yellow cat lying under the seat, and the concept identification information "HH" represents the calico cat climbing a tree. That is, although there may be many kinds of yellow cats, "DJ" is uniquely identifiable.

[0195] The category text may include the category of the target object presented in text form, for example, both wild geese and egrets belong to the category of birds, while bees and butterflies belong to the category of insects. Then, the category of wild geese and egrets is "birds", while the category of bees and butterflies is "insects".

[0196] Step S905: replace the concept words in the initial sample text with the concept identifier and the category text to obtain a sample text.

[0197] In an exemplary embodiment, for example, "Winnie is running on the floor", the concept identifier corresponding to "Winnie" is "V", and the category text corresponding to "Winnie" is "cat". The concept words in the initial sample text are replaced with the concept identifier and the category text, and the sample text obtained is: ""V" "Cat" is running on the floor".

[0198] In an exemplary embodiment, when the image generation model includes multiple training stages, the sample text may include a first text and a second text, wherein the first text may include a concept identifier of a target object and an action text describing a target action of the target object. In the above example, the first text may be expressed as: "V is running on the floor". The second text includes a category text of the target object and an action text describing a target action of the target object. In the above example, the second text may be expressed as: "Cat is running on the floor".

[0199] It should be noted that the setting method of the target object is not limited to the above examples. For example, birds, insects, robots, etc. can also be used as the target objects. Technical personnel in the relevant field may make other changes under the inspiration of the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they should be covered within the scope of protection of this application.

[0200] Step 907: Obtain a sample set based on the sample text and the sample image of the target object.

[0201] In the embodiment of the present disclosure, the target object in the sample image is consistent with the target object in the sample text. Based on the sample text and the sample image of the target object obtained in the above embodiment, a sample set is obtained.

[0202] Based on the same inventive concept, Fig.10 As shown, the embodiment of the present application also provides an image generation method, which can be executed by a computer device, and the computer device can be Figure 1 The method comprises:

[0203] Step S1001, obtaining an input image containing an object to be predicted and a corresponding original text; wherein the original text includes concept identification information.

[0204] Among them, the objects to be predicted may include: objects that exist objectively in the real world, such as cats, dogs, birds, frogs, bees, etc., and the objects to be predicted may also include objects that exist virtually in the virtual world, such as cartoon characters, cartoon animals, animation objects, etc. Optionally, the objects to be predicted may include objects with actions, such as frogs that can jump and birds that can fly. Exemplarily, the objects to be predicted may also include static objects, such as tables, flowers, trees, etc., but static objects do not have exclusive or clearly distinguished action attributes, which is not the focus of this application.

[0205] The concept identification information may include identification information that can uniquely identify the target object. The concept identification information may include a concept identifier. For example, the concept identifier "DJ" and the concept identifier "HH" both represent a cat. The concept identifier "DJ" represents the yellow cat lying under the seat, and the concept identifier "HH" represents the tabby cat climbing a tree. That is, although there may be many kinds of yellow cats, "DJ" has unique identification. In an exemplary embodiment, the method of obtaining the concept identifier may include multiple methods, for example, selecting an existing word as the concept identification information, constructing a special marker with letters or numbers as the concept identification information, or selecting a rare word from the vocabulary as the concept identification information.

[0206] In the specific implementation process, the concept identifier is not easy for the user to remember. In an exemplary embodiment, the concept identification information may also include concept words. For example: Winnie, Huahua, Wangwang. "Winnie" means a wounded cat, "Huahua" means a cat, and "Wangwang" means a dog. In the embodiment of the present disclosure, there is also a one-to-one correspondence between the concept words and the target objects. That is, the concept words can also uniquely identify the target objects.

[0207] In the embodiment of the present disclosure, the original text may further include concept identification information and an action text describing the target action of the object to be predicted, for example: "Winnie is running on the floor"; "Flower is climbing a tree"; "Wangwang is rolling on the lawn with a bone in his mouth". The action text describing the target action of the target object in the original text is used to limit the specific action displayed by the object to be predicted in the prediction image during the actual application process.

[0208] Step S1003, searching for a first embedded feature and a second embedded feature corresponding to the concept identification information; replacing the concept identification information in the original text with the first embedded feature and the second embedded feature to obtain a target text.

[0209] The first embedded feature is obtained by extracting the concept identification information, and the second embedded feature is obtained by extracting the category text corresponding to the object to be predicted. In an exemplary embodiment, the database may store the concept identification information, the first embedded feature, and the second embedded feature. For example: Winnie: DJ, [V], [ACT].

[0210] In another exemplary embodiment, the above-mentioned concept words may also be added to the database, for example: concept words: concept identifier, category text, first embedded feature, second embedded feature. In a specific embodiment, for example: "Winnie": DJ, cat, [V], [ACT].

[0211] In the above example, for example, the original text may include: Winnie is running on the floor. After replacing the concept word "Winnie" with the first embedding feature and the second embedding feature, the text to be input is obtained: [V], [ACT] is running on the floor.

[0212] Step S1005: input the image and the target text into an image generation model, and output a predicted image.

[0213] Wherein, the target action of the object to be predicted in the predicted image matches the target text; wherein, the image generation model is obtained by training based on sample images and sample texts; wherein, the sample image contains the target object, and the sample text includes the concept identification information of the target object and the category text of the target object. Optionally, the sample text may also include an action text describing the target action of the target object, for example, target object: "Winnie", action text: "Running on the floor"; target object: "Flower", action text: "Climbing a tree"; target object "Wangwang", action text: "Rolling on the lawn with a bone in mouth". Wherein, the action text describing the target action of the target object is used to limit the specific action displayed by the object to be predicted in the predicted image during the training process.

[0214] Specifically, in an exemplary application scenario, refer to Fig.11As shown, by inputting image 1101 and the corresponding target text into the image generation model, predicted images of the object to be predicted in various poses can be generated, such as predicted image 1102. In other application scenarios, for example, pet portraits can be produced. Virtual pet games can be produced: by generating different pet images and actions to increase the diversity and fun of the game. Pet training images can be produced to help owners understand and learn how to train pets by generating different pet action images.

[0215] In the embodiments of the present disclosure, reference Fig.12 As shown, after the image and the target text are input into the image generation model, the image generation model processes the image and the target text in a similar manner to the training phase, and the disclosure will not repeat them here. It should be noted that the image generation model is trained based on sample images and sample texts; wherein the sample image contains the target object, and the sample text may include the concept identification information of the target object and the category text of the target object.

[0216] Among them, the target object may include an object that objectively exists in the real world, such as a cat, a dog, a bird, a frog, a bee, etc., and the target object may also include an object that exists virtually in the virtual world, such as a cartoon character, a cartoon animal, an animation object, etc. Optionally, the target object may include an object with an action, for example, a frog can jump and a bird can fly. Exemplarily, the target object may also include a static object, such as a table, a flower, a tree, etc., but the static object does not have a unique or obviously different action attribute, which is not the focus of this application. The concept identification information and the category text of the target object of the embodiment of the present disclosure have been described in the above embodiment, and will not be repeated here. In the embodiment of the present disclosure, in addition to the concept identification information of the target object and the category text of the target object, the sample text may also include an action text describing the target action of the target object, for example, the target object: "Winnie", the action text: "Running on the floor"; the target object: "Flower", the action text: "Climbing a tree"; the target object "Wangwang", the action text: "Rolling on the lawn with a bone in his mouth".

[0217] Specifically, the image generation model can be trained based on the sample image and the sample text on the basis of the initial image generation model. The initial image generation model may include a diffusion model, wherein the diffusion model may be a model that adds noise to the target image based on the target text and the target image, and recovers a predicted image related to the target text from the noise image under the drive of the target text. Specifically, the initial image generation model may include an Imagen model, a NovelAI model, a Midjourney model, a Sora model, a Stable Diffusion model, and the like.

[0218] In the disclosed embodiment, based on the sample images and sample texts, a machine learning method can be used to train the initial image generation model to obtain the image generation model, wherein machine learning includes deep learning, supervised learning, reinforcement learning, etc.

[0219] In the above embodiment, the concept identification information can uniquely identify the target object in the image. In the reasoning stage (application stage) of the image generation model, by adding the first embedded feature corresponding to the concept identification information to the original text, the target text with the first embedded feature is used to guide the generation of the action of the object to be predicted in the input image containing the object to be predicted, so that the appearance of the object to be predicted in the generated predicted image can be kept consistent with the object to be predicted in the input image. For example, the appearance of the cat in the predicted image is consistent with the appearance of the cat in the input image, rather than the same as the appearance of other cats. Further, the category text can characterize the category of the target object. By adding the second embedded feature corresponding to the category text to the original text, the target text with the second feature is used to guide the generation of the action of the object to be predicted in the input image, so that the action of the object to be predicted in the generated predicted image can be consistent with the category of the object to be predicted in the input image, rather than being limited to the action of the object to be predicted itself, thereby enriching the generated action of the object to be predicted. Thereby, the consistency between the appearance and action of the object to be predicted in the predicted image can be improved.

[0220] In one embodiment, the second embedded feature is obtained by extracting features of the category text corresponding to the concept identification information based on the initial image generation model, and replacing the concept identification information in the original text with the first embedded feature and the second embedded feature to obtain the target text includes:

[0221] Based on the image generation model, extract the category text of the object to be predicted to obtain a third embedded feature;

[0222] The concept identification information in the original text is replaced with the first embedded feature, the second embedded feature and the third embedded feature to obtain a target text.

[0223] Among them, the initial image generation model may include a diffusion model, wherein the diffusion model may be a model that adds noise to the target image based on the target text and the target image, and recovers the predicted image related to the target text from the noise image driven by the target text. Specifically, the initial image generation model may include an Imagen model, a NovelAI model, a Midjourney model, a Sora model, a Stable Diffusion model, and the like. In an exemplary embodiment, a machine learning method may be used to train the initial image generation model to obtain an image generation model. Among them, the condition for the end of training may include that the number of iterations meets a preset requirement, such as 1000 times. In the disclosed embodiment, based on the initial image generation model, feature extraction is performed on the category text corresponding to the concept identification information to obtain a second embedded feature.

[0224] In an exemplary embodiment, the text encoder in the image generation model performs feature encoding on the concept category of the target object to obtain a third embedding feature. The text encoder may include a pre-trained text encoder, such as a CLIP model, a BERT model, etc.

[0225] In a specific implementation process, the concept identification information in the original text is replaced with the first embedding feature, the second embedding feature and the third embedding feature to obtain the target text, for example: the original text: "Winnie is running on the floor", the first embedding feature corresponding to "Winnie" is "V", and the second embedding feature corresponding to "Winnie" is "ACT". The third embedding feature corresponding to "Winnie" is "adapt". The concept words in the initial sample text are replaced with the concept identification information and the category text, and the obtained sample text is: ""V" "ACT" "adapt" is running on the floor.

[0226] In the disclosed embodiment, when introducing the first embedded feature (appearance-related) corresponding to the concept identification information and the second embedded feature (Action-related) corresponding to the category text, it is considered that the embedded features of the same word are different in different contexts, that is, the second embedded feature is extracted by the initial image generation model. In order to improve the adaptability of the image generation model to the second embedded feature and the first embedded feature, the trained image generation model is used to extract features of the category text again to obtain the third embedded feature (adapt), thereby improving the coordination of the image generation model in predicting the appearance and action of the target object in the image.

[0227] In a specific embodiment, the method of the present application can be applied to an implementation scenario of generating a target action of an object to be predicted in an image, for example, a photo of a pet can be made. A virtual pet game can be made: the diversity and fun of the game can be increased by generating different pet images and actions. Pet training images can be made to help owners understand and learn how to train their pets by generating different pet action images. In the related art, it is difficult for the image generation model prediction results to ensure the coordination of the action, that is, the predicted action of the target object in the image does not match the target object. The present application provides a method for processing image generation data, an image generation method, an apparatus, a computer device, a storage medium, and a computer program product, which can ensure the coordination of the action and appearance of the object to be predicted in the predicted image. Specifically, the disclosed embodiment may include the following stages: a sample collection stage, a first training stage of the image generation model, and a second training stage of the image generation model.

[0228] Sample collection stage: including: step S901, obtaining an initial sample text, wherein the initial sample text includes the concept word of the target object and the action text describing the target action of the target object. Step S903, obtaining a concept identifier corresponding to the concept word of the target object and the category text of the target object. Step S905, replacing the concept word in the initial sample text with the concept identifier and the category text to obtain a sample text.

[0229] In the specific implementation process, the concept identifier of the target object is difficult for the user to remember. Therefore, the concept word of the target object can be set to distinguish the target object. For example, "Winnie", "Flower", "Wangwang". The initial sample text includes the concept word of the target object and the action text describing the target action of the target object. Specifically, in the above example, the initial sample text is such as: "Winnie is running on the floor"; "Flower is climbing a tree"; "Wangwang is rolling on the lawn with a bone in his mouth".

[0230] The concept identifier may include identification information that can uniquely identify the target object. For example, the concept identifier "DJ" and the concept identifier "HH" both represent a cat. The concept identifier "DJ" represents the yellow cat lying under the seat, and the concept identifier "HH" represents the calico cat climbing a tree. That is, although there may be many kinds of yellow cats, "DJ" is uniquely identifiable.

[0231] The category text may include the category of the target object presented in text form, for example, both wild geese and egrets belong to the category of birds, while bees and butterflies belong to the category of insects. Then, the category of wild geese and egrets is "birds", while the category of bees and butterflies is "insects".

[0232] In an exemplary embodiment, for example, "Winnie is running on the floor", the concept identifier corresponding to "Winnie" is "V", and the category text corresponding to "Winnie" is "cat". The concept words in the initial sample text are replaced with the concept identifier and the category text, and the sample text obtained is: ""V" "Cat" is running on the floor".

[0233] In an exemplary embodiment, when the image generation model includes multiple training stages, the sample text may include a first text and a second text, wherein the first text may include a concept identifier of a target object and an action text describing a target action of the target object. In the above example, the first text may be expressed as: "V is running on the floor". The second text includes a category text of the target object and an action text describing a target action of the target object. In the above example, the second text may be expressed as: "Cat is running on the floor".

[0234] The first training stage of the image generation model: specifically includes: step S401, based on the first text and the sample image, the initial image generation model is trained to obtain an intermediate image generation model; wherein the first text includes the concept identifier of the target object and the action text describing the target action of the target object. The initial image generation model may include a diffusion model, wherein the diffusion model may be a model that adds noise to the target image based on the target text and the target image, and recovers the predicted image related to the target text from the noise image under the drive of the target text. Specifically, the initial image generation model may include an Imagen model, a NovelAI model, a Midjourney model, a Sora model, a Stable Diffusion model, etc. In an exemplary embodiment, a machine learning method may be used to train the initial image generation model based on the first text to obtain an image generation model. The condition for the end of training may include that the number of iterations meets the preset requirements, such as 1000 times.

[0235] The second training stage of the image generation model: Step S403, based on the intermediate image generation model, feature extraction is performed on the concept identifier of the target object to obtain intermediate embedded features. Step S405, based on the initial image generation model, feature extraction is performed on the second text to obtain a second text feature vector; wherein the second text includes the category text of the target object and the action text describing the target action of the target object. Step S407, the intermediate embedded features and the second text feature vector are fused to obtain a fused text feature vector. Step S409, the intermediate image generation model is trained based on the fused text feature vector to obtain an image generation model.

[0236] In the specific implementation process, regardless of the first training stage and the second training stage, the initial image generation model, the intermediate image generation model and the image generation model can include the original image generation network and the first attention mechanism network. The process of extracting features using the first attention mechanism network may include the following steps: Step S501, extracting features from the sample text to obtain a text feature vector; extracting features from the sample image to obtain an original image feature vector. Step S503, adding noise to the original image feature vector to obtain a noise image feature vector. Step S505, based on the first attention mechanism network, fusing the text feature vector and the noise image feature vector to obtain a first fused feature vector. Step S507, based on the first fused feature vector, obtaining a predicted image and predicted noise. Step S509, iteratively adjusting the network parameters of the first attention mechanism network based on the difference between the predicted image and the noise added to the sample image until the preset requirements are met to obtain an image generation model.

[0237] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0238] Based on the same inventive concept, the embodiment of the present application also provides a training device for an image generation model for implementing the above-mentioned method for processing image generation data. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of the training device for one or more image generation models provided below can refer to the limitations of the method for processing image generation data above, and will not be repeated here.

[0239] In one embodiment, Fig.13 As shown, a training device 1300 for an image generation model is provided, comprising:

[0240] The first acquisition module 1301 is used to acquire a sample set; wherein the sample set includes a plurality of sample images containing a target object and sample texts corresponding to the sample images, and the sample texts include concept identification information of the target object and category text of the target object;

[0241] A training module 1303, configured to train an image generation model based on the sample image and the sample text;

[0242] An extraction module 1305 is used to extract features from the concept identification information of the target object based on the image generation model to obtain a first embedded feature;

[0243] A second acquisition module 1307 is used to acquire a second embedded feature obtained by extracting features from the category text of the target object;

[0244] The storage module 1309 is used to associate and store the concept identification information, the first embedded feature, and the second embedded feature of the target object to obtain reference information, wherein the reference information is used to generate a target text, and the target text and the input image containing the object to be predicted are used to be input into the image generation model, and the predicted image is output, and the target action of the object to be predicted in the predicted image matches the target text.

[0245] In one embodiment, the second embedded feature is obtained by extracting features of the category text of the target object based on the initial image generation model, and the device further includes:

[0246] An extraction module is used to extract features of the category text of the target object based on the image generation model to obtain a third embedded feature; wherein the image generation model is obtained by training the initial image generation model based on the sample image and the sample text.

[0247] The storage module also includes:

[0248] The storage submodule is used to associate and store the concept identification information, the first embedded feature, the second embedded feature, and the third embedded feature of the target object to obtain reference information.

[0249] In one embodiment, the sample text includes a first text and a second text, and the training module is further used for:

[0250] Based on the first text and the sample image, an initial image generation model is trained to obtain an intermediate image generation model; wherein the first text includes a concept identifier of the target object and an action text describing a target action of the target object;

[0251] Based on the intermediate image generation model, feature extraction is performed on the concept identifier of the target object to obtain an intermediate embedding feature;

[0252] Based on the initial image generation model, feature extraction is performed on the second text to obtain a second text feature vector; wherein the second text includes a category text of the target object and an action text describing a target action of the target object;

[0253] Fusing the intermediate embedding feature and the second text feature vector to obtain a fused text feature vector;

[0254] The intermediate image generation model is trained based on the fused text feature vector to obtain an image generation model.

[0255] In one embodiment, the training module is further used to:

[0256] Extracting features of the sample text based on the original image generation network in the initial image generation model to obtain a text feature vector; extracting features of the sample image based on the original image generation network to obtain an original image feature vector;

[0257] Adding noise to the original image feature vector based on the original image generation network to obtain a noise image feature vector;

[0258] Based on the first attention mechanism network in the initial image generation model, the text feature vector and the noise image feature vector are fused to obtain a first fused feature vector;

[0259] Based on the first fused feature vector and the original image generation network, a predicted image and predicted noise are obtained;

[0260] Based on the difference between the predicted noise and the noise added to the sample image, the network parameters of the first attention mechanism network in the initial image generation model are iteratively adjusted until preset requirements are met to obtain an image generation model.

[0261] In one embodiment, the original image generation network includes a text encoder and a second attention mechanism network, and the training module is further used to:

[0262] Based on the text encoder, feature extraction is performed on the sample text to obtain a text feature vector;

[0263] Based on the first fused feature vector and the original image generation network, a predicted image and predicted noise are obtained, including:

[0264] Based on the second attention mechanism network, the text feature vector and the noise image feature vector are fused to obtain a second fused feature vector;

[0265] Performing weighted fusion on the first fused feature vector and the second fused feature vector to obtain a total fused feature vector;

[0266] Based on the total fused feature vector, a predicted image and predicted noise are obtained.

[0267] In one embodiment, the training module is further used to:

[0268] Extracting a text feature key vector and a text feature value vector of the text feature vector based on a first attention mechanism network in the initial image generation model;

[0269] Extracting an image feature query vector of the noise image feature vector based on the first attention mechanism network;

[0270] Based on the similarity between the image feature query vector and the text feature key vector, the text feature value vector is weighted to obtain a first fused feature vector.

[0271] In one embodiment, the training module is further used to:

[0272] Adding noise corresponding to the current time step to the original image feature vector based on the original image generation network to obtain a first image feature vector;

[0273] Adding noise corresponding to the next time step of the current time step to the first image feature vector to obtain a second image feature vector, and continuing to add noise corresponding to the time step to the second image feature vector until a preset requirement is met to obtain a noise image feature vector;

[0274] The generating network based on the first fused feature vector and the original image to obtain a predicted image and a predicted noise comprises:

[0275] Based on the first fused feature vector, the target time step corresponding to the noise image feature vector, and the original image generation network, obtaining the predicted noise corresponding to the target time step;

[0276] The prediction noise corresponding to the target time step is removed from the first fused feature vector to obtain a fused feature vector corresponding to a time step before the target time step, and the prediction noise corresponding to the previous time step is continued to be removed from the fused feature vector corresponding to the previous time step until preset requirements are met to obtain a predicted image.

[0277] In one embodiment, the training module is further used to:

[0278] Determining a noise difference corresponding to the time step based on the noise added at the time step and the predicted noise corresponding to the time step;

[0279] Based on the noise differences corresponding to each time step, the network parameters of the first attention mechanism network are iteratively adjusted.

[0280] In one embodiment, the first acquisition module is further used for:

[0281] Acquire an initial sample text, wherein the initial sample text includes a concept word of the target object and an action text describing a target action of the target object;

[0282] Acquire a concept identifier corresponding to the concept word of the target object and a category text of the target object;

[0283] Replacing the concept words in the initial sample text with the concept identifier and the category text to obtain a sample text;

[0284] A sample set is obtained based on the sample text and the sample image of the target object.

[0285] In one embodiment, Fig.14 As shown, an image generating device 1400 is provided, comprising:

[0286] The third acquisition module 1401 is used to acquire an input image containing an object to be predicted and a corresponding original text; wherein the original text includes concept identification information;

[0287] A search module 1403 is used to search for a first embedded feature and a second embedded feature corresponding to the concept identification information; replace the concept identification information in the original text with the first embedded feature and the second embedded feature to obtain a target text; wherein the first embedded feature is obtained by extracting features from the concept identification information, and the second embedded feature is obtained by extracting features from the category text corresponding to the concept identification information;

[0288] Generation module 1405 is used to input the input image and the target text into an image generation model and output a predicted image; wherein the target action of the object to be predicted in the predicted image matches the target text; wherein the image generation model is trained based on sample images and sample texts; wherein the sample image contains the target object, and the sample text includes the concept identification information of the target object and the category text of the target object.

[0289] The training device of the image generation model and each module in the image generation device can be implemented in whole or in part by software, hardware and a combination thereof. The modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the modules.

[0290] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG15. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store training data of an image generation model. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for processing image generation data is implemented.

[0291] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG16. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for processing image generation data and an image generation method are implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0292] Those skilled in the art will understand that the structure shown in FIG. 16 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0293] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0294] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0295] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0296] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for processing image generation data, characterized in that: The method comprises: Acquire a sample set; wherein the sample set includes a plurality of sample images containing a target object and sample texts corresponding to the sample images, and the sample texts include concept identification information of the target object and category text of the target object; Based on the sample image and the sample text, an initial image generation model is trained to obtain an image generation model; Extracting features from the concept identification information of the target object based on the image generation model to obtain a first embedded feature; Based on the initial image generation model, extract the features of the category text of the target object to obtain a second embedded feature; Extracting features of the category text of the target object based on the image generation model to obtain a third embedded feature; The concept identification information, the first embedded feature, the second embedded feature, and the third embedded feature of the target object are associated and stored to obtain reference information, wherein the reference information is used to generate a target text, and the target text and an input image containing the object to be predicted are input into the image generation model to output a predicted image, and the target action of the object to be predicted in the predicted image matches the target text.

2. The method according to claim 1, characterized in that The concept identification information includes a concept identifier and a concept word.

3. The method according to claim 1, characterized in that The sample text includes a first text and a second text, and the initial image generation model is trained based on the sample image and the sample text to obtain the image generation model, including: Based on the first text and the sample image, an initial image generation model is trained to obtain an intermediate image generation model; wherein the first text includes a concept identifier of the target object and an action text describing a target action of the target object; Based on the intermediate image generation model, feature extraction is performed on the concept identifier of the target object to obtain an intermediate embedding feature; Based on the initial image generation model, feature extraction is performed on the second text to obtain a second text feature vector; wherein the second text includes a category text of the target object and an action text describing a target action of the target object; Fusing the intermediate embedding feature and the second text feature vector to obtain a fused text feature vector; The intermediate image generation model is trained based on the fused text feature vector to obtain an image generation model.

4. The method according to claim 1, characterized in that: The initial image generation model is trained based on the sample image and the sample text to obtain the image generation model, including: Based on the original image generation network in the initial image generation model, feature extraction is performed on the sample text to obtain a text feature vector; based on the original image generation network, feature extraction is performed on the sample image to obtain an original image feature vector; Adding noise to the original image feature vector based on the original image generation network to obtain a noise image feature vector; Based on the first attention mechanism network in the initial image generation model, the text feature vector and the noise image feature vector are fused to obtain a first fused feature vector; Based on the first fused feature vector and the original image generation network, a predicted image and predicted noise are obtained; Based on the difference between the predicted noise and the noise added to the sample image, the network parameters of the first attention mechanism network in the initial image generation model are iteratively adjusted until preset requirements are met to obtain an image generation model.

5. The method according to claim 4, characterized in that The original image generation network includes a text encoder and a second attention mechanism network, and the feature extraction of the sample text to obtain a text feature vector includes: Based on the text encoder, feature extraction is performed on the sample text to obtain a text feature vector; Based on the first fused feature vector and the original image generation network, a predicted image and predicted noise are obtained, including: Based on the second attention mechanism network, the text feature vector and the noise image feature vector are fused to obtain a second fused feature vector; Performing weighted fusion on the first fused feature vector and the second fused feature vector to obtain a total fused feature vector; Based on the total fused feature vector, a predicted image and predicted noise are obtained.

6. The method according to claim 4, characterized in that The fusing process of the text feature vector and the noise image feature vector based on the first attention mechanism network in the initial image generation model to obtain a first fused feature vector includes: Extracting a text feature key vector and a text feature value vector of the text feature vector based on a first attention mechanism network in the initial image generation model; Extracting an image feature query vector of the noise image feature vector based on the first attention mechanism network; Based on the similarity between the image feature query vector and the text feature key vector, the text feature value vector is weighted to obtain a first fused feature vector.

7. The method according to claim 4, characterized in that The adding noise to the original image feature vector based on the original image generation network to obtain the noise image feature vector includes: Adding noise corresponding to the current time step to the original image feature vector based on the original image generation network to obtain a first image feature vector; Adding noise corresponding to the next time step of the current time step to the first image feature vector to obtain a second image feature vector, and continuing to add noise corresponding to the time step to the second image feature vector until a preset requirement is met to obtain a noise image feature vector; The generating network based on the first fused feature vector and the original image to obtain a predicted image and predicted noise includes: Based on the first fused feature vector, the target time step corresponding to the noise image feature vector, and the original image generation network, obtaining the predicted noise corresponding to the target time step; The prediction noise corresponding to the target time step is removed from the first fused feature vector to obtain a fused feature vector corresponding to a time step before the target time step, and the prediction noise corresponding to the previous time step is continued to be removed from the fused feature vector corresponding to the previous time step until preset requirements are met to obtain a predicted image.

8. The method according to claim 7, characterized in that Iteratively adjusting network parameters of the first attention mechanism network based on the difference between the predicted noise and the noise added to the sample image, comprising: Determining a noise difference corresponding to the time step based on the noise added at the time step and the predicted noise corresponding to the time step; Based on the noise differences corresponding to each time step, the network parameters of the first attention mechanism network are iteratively adjusted.

9. The method according to claim 1, characterized in that: The obtaining of the sample set comprises: Acquire an initial sample text, wherein the initial sample text includes a concept word of the target object and an action text describing a target action of the target object; Acquire a concept identifier corresponding to the concept word of the target object and a category text of the target object; Replacing the concept words in the initial sample text with the concept identifier and the category text to obtain a sample text; A sample set is obtained based on the sample text and the sample image of the target object.

10. An image generation method, characterized in that: The method comprises: Acquire an input image containing an object to be predicted and a corresponding original text; wherein the original text includes concept identification information; Searching for the first embedded feature, the second embedded feature and the third embedded feature corresponding to the concept identification information; replacing the concept identification information in the original text with the first embedded feature, the second embedded feature and the third embedded feature to obtain the target text; wherein the first embedded feature is obtained by extracting the concept identification information based on the image generation model, the second embedded feature is obtained by extracting the category text of the object to be predicted based on the initial image generation model; the third embedded feature is obtained by extracting the category text of the object to be predicted based on the image generation model; The input image and the target text are input into the image generation model, and a predicted image is output; wherein the target action of the object to be predicted in the predicted image matches the target text; wherein the image generation model is trained based on the initial image generation model, sample images and sample text; wherein the sample image contains the target object, and the sample text includes the concept identification information of the target object and the category text of the target object.

11. The method according to claim 10, characterized in that The concept identification information includes a concept identifier and a concept word.

12. A training device for an image generation model, characterized in that: The device comprises: A first acquisition module is used to acquire a sample set; wherein the sample set includes a plurality of sample images containing a target object and sample texts corresponding to the sample images, and the sample texts include concept identification information of the target object and category text of the target object; A training module, used for training an image generation model based on the sample image, the sample text and the initial image generation model; An extraction module is used to extract features from the concept identification information of the target object based on the image generation model to obtain a first embedded feature; the extraction module is also used to extract features from the category text of the target object based on the image generation model to obtain a third embedded feature; A second acquisition module is used to extract the second embedded feature from the category text of the target object based on the initial image generation model; A storage module is used to associate and store the concept identification information, the first embedded feature, the second embedded feature, and the third embedded feature of the target object to obtain reference information, wherein the reference information is used to generate a target text, and the target text and an input image containing the object to be predicted are used to be input into the image generation model, and a predicted image is output, and the target action of the object to be predicted in the predicted image matches the target text.

13. An image generating device, characterized in that: The device comprises: A third acquisition module is used to acquire an input image containing an object to be predicted and a corresponding original text; wherein the original text includes concept identification information; A search module, used to search for a first embedded feature, a second embedded feature and a third embedded feature corresponding to the concept identification information; replace the concept identification information in the original text with the first embedded feature, the second embedded feature and the third embedded feature to obtain a target text; wherein the first embedded feature is obtained by extracting features of the concept identification information based on an image generation model, the second embedded feature is obtained by extracting features of the category text of the object to be predicted based on an initial image generation model; the third embedded feature is obtained by extracting features of the category text of the object to be predicted based on the image generation model; A generation module, used to input the input image and the target text into the image generation model, and output a predicted image; wherein the target action of the object to be predicted in the predicted image matches the target text; wherein the image generation model is trained based on the initial image generation model, sample images and sample text; wherein the sample image contains the target object, and the sample text includes the concept identification information of the target object and the category text of the target object.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the processor implements the steps of the method according to any one of claims 1 to 9 or the steps of the method according to any one of claims 10 to 11.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 or the steps of the method according to any one of claims 10 to 11 are implemented.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 or the steps of the method according to any one of claims 10 to 11 are implemented.