A personalized image generation method based on background embedding and feature separation based on text inverse mapping
By separating the foreground and background of the image and using the text inverse mapping model to train word embedding vectors, the problem of difficult distinction between target concepts and background information in the text inverse mapping method is solved, and the accuracy and editability of personalized image generation are improved.
Patent Information
- Application Number
- CN202410735557.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-06-07
AI Technical Summary
The text inverse mapping method has difficulty in distinguishing the target concept and background information in image personalized generation, resulting in low generation accuracy and overfitting, and cannot independently modify the characteristics of the target concept.
By separating the foreground and background of the original image, adding text descriptions respectively, and using the text inverse mapping model to train on the optimized data set to obtain the word embedding vector with the highest adaptability, and then inputting the diffusion model to generate a personalized image to ensure that the target concept and background Clear distinction and characteristic details of information.
It improves the accuracy of personalized image generation, prevents the mixing of background information, and enhances the detailed depiction and editability of the target concept.
Smart Images

Figure CN118314238B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital image generation, and more specifically, to a personalized image generation method based on background embedding and feature separation of text inverse mapping. Background Art
[0002] In recent years, stable diffusion generative models have made significant progress in the field of image personalization. There are currently several main methods for training models, such as DreamBooth, Textual Inversion, Key-Locked ROME, etc. The obvious advantage of textual inversion over other text-to-image generation is that only 3-5 images are needed to accurately learn the "semantic" essence of the concept provided by the user. Traditional image personalization methods are based on text-to-image translation of users' more precise natural language descriptions of concepts, which places high demands on users' language description capabilities. Since limited language descriptions themselves can never fully provide all the visual information of a specific thing, using them for image generation of specific topics will produce considerable visual differences. Therefore, textual inversion proposes an in-depth visual analysis and understanding of images to grasp the essence of concepts. DreamBooth also uses a similar visual analysis method. The difference between the two is that the former will fine-tune the entire model, while textual inversion will only adjust the text embedding part.
[0003] The text inverse mapping method replaces the image concept provided by the user with a pseudo word S*, which is a keyword that does not exist in the existing model. Then the pseudo word S* is treated as any other word, and a token id is generated through the Tokenizer, and then converted into an embedding vector in the text converter. The text converter will map the best embedding vector for the new keyword, that is, it can be regarded as finding a new representation in the model to represent the new keyword. Figure 1 The figure shows a flowchart of the traditional text inverse mapping method. The text inverse mapping method can minimize the image reconstruction loss. However, when learning the image distribution corresponding to the pseudo-word, the text inverse mapping method does not distinguish the target concept from the background information well. It is easy to treat the background information as part of the target concept during training, resulting in overfitting and low accuracy. In addition, when generating new images according to the text prompt words, the model will retain part of the background information of the original image, and the model learns all the feature information of the target concept into the same word embedding vector, and cannot change a single feature of the target concept, resulting in unsatisfactory editability. Summary of the invention
[0004] In order to overcome the defect that the stable diffusion generation model trained by the above-mentioned text inverse mapping method cannot distinguish between target concepts and background information, resulting in low accuracy of personalized image generation, the present invention provides a personalized image generation method based on background embedding and feature separation of text inverse mapping.
[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0006] A personalized image generation method based on background embedding and feature separation of text inverse mapping, comprising the following steps:
[0007] Inputting an original image and preprocessing it, separating a foreground object from a background object in the original image, and adding text descriptions to the foreground object and the background object respectively;
[0008] Based on the foreground target text description and the background target text description, a foreground or background replacement operation is performed on the original image to generate an optimized data set including the original image, the image with the foreground replaced, and the image with the background replaced;
[0009] The text inverse mapping model is used to train on the optimized data set to obtain the word embedding vector with the highest degree of adaptation for describing the foreground target and the background target; wherein when training on the original image, the matched text description includes the foreground target text description and the background target text description; when training on the image with the foreground replaced, the matched text description includes the background target text description; when training on the image with the background replaced, the matched text description includes the foreground target text description;
[0010] The original image and the word embedding vector with the highest adaptation degree are input into the diffusion model to generate a personalized image.
[0011] Furthermore, the present invention also proposes a personalized image generation system based on background embedding and feature separation of text inverse mapping, and applies the personalized image generation method based on background embedding and feature separation of text inverse mapping proposed by the present invention. The system comprises:
[0012] A feature separation module is used to separate the foreground object and the background object in the input original image, and add text descriptions to the foreground object and the background object respectively;
[0013] An image inpainting module is used to perform a foreground or background replacement operation on the original image based on the foreground target text description and the background target text description, and generate an optimized data set including the original image, the image with the foreground replaced, and the image with the background replaced;
[0014] A text inverse mapping module is equipped with a pre-trained text inverse mapping model, and is used to use the text inverse mapping model to perform training on the optimized data set, and output a word embedding vector with the highest degree of adaptation for describing a foreground target and a background target; wherein when training on the original image, the matched text description includes the foreground target text description and the background target text description; when training on the image with the foreground replaced, the matched text description includes the background target text description; when training on the image with the background replaced, the matched text description includes the foreground target text description;
[0015] The personalized generation module is equipped with a pre-trained diffusion model, which is used to input the original image and the word embedding vector with the highest adaptability into the diffusion model to generate a personalized image.
[0016] Furthermore, the present invention also proposes a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor performs the steps of the personalized image generation method based on background embedding and feature separation of text inverse mapping as proposed in the present invention.
[0017] Furthermore, the present invention also proposes a storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by a processor, implement the steps of the personalized image generation method based on background embedding and feature separation of text inverse mapping as proposed in the present invention.
[0018] Compared with the prior art, the beneficial effect of the technical solution of the present invention is as follows: the present invention separates and replaces the foreground target from the background target, and simultaneously learns the target concept and the background using the text inverse mapping technology to obtain the word embedding vector with the highest degree of adaptability for describing the foreground target and the background target, that is, to obtain a personalized text description, which is used to input into the diffusion model to generate a personalized image, so that the diffusion model can distinguish between the target concept and the image background, prevent the learned target concept from being mixed with irrelevant background information, and can better describe the target concept in detail when generating a new personalized image, so as to improve the accuracy of personalized image generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Schematic diagram of the flow of traditional text inverse mapping method.
[0020] Figure 2 The figure is a flow chart of the personalized image generation method of the present invention.
[0021] Figure 3 It is a structural diagram of the text encoder of the present invention.
[0022] Figure 4 Schematic diagram of personalized image generation with "toy cat" as the target concept.
[0023] Figure 5 Schematic diagram of personalized image generation with "stone bird" as the target concept.
[0024] Figure 6 Schematic diagram of personalized image generation with the target concept of "headless sculpture".
[0025] Figure 7 It is an architecture diagram of the personalized image generation system of the present invention. DETAILED DESCRIPTION
[0026] The drawings are only used for illustrative purposes and are not to be construed as limiting the present invention. It is understandable to those skilled in the art that some well-known descriptions may be omitted in the drawings.
[0027] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0028] Example 1
[0029] This embodiment proposes a personalized image generation method based on background embedding and feature separation of text inverse mapping, such as Figure 2 FIG. 1 is a flowchart of the personalized image generation method of this embodiment.
[0030] The personalized image generation method based on background embedding and feature separation of text inverse mapping proposed in this embodiment includes the following steps:
[0031] S1, inputting an original image and preprocessing it, separating a foreground object from a background object in the original image, and adding text descriptions to the foreground object and the background object respectively;
[0032] S2, based on the foreground target text description and the background target text description, performing a foreground or background replacement operation on the original image to generate an optimized data set including the original image, the image with the foreground replaced, and the image with the background replaced;
[0033] S3, using the text inverse mapping model to perform training on the optimized data set to obtain the word embedding vector with the highest degree of adaptation for describing the foreground target and the background target; wherein, when training on the original image, the matched text description includes the foreground target text description and the background target text description; when training on the image with the foreground replaced, the matched text description includes the background target text description; when training on the image with the background replaced, the matched text description includes the foreground target text description;
[0034] S4. Input the original image and the word embedding vector with the highest adaptability into the diffusion model to generate a personalized image.
[0035] In this embodiment, by separating and replacing the foreground target and the background target, the target concept and the background are simultaneously learned using the text inverse mapping technology to obtain the most suitable word embedding vector for describing the foreground target and the background target, that is, a personalized text description is obtained, which is used to input into the diffusion model to generate a personalized image, so that the diffusion model can distinguish between the target concept and the image background, prevent the learned target concept from being mixed with irrelevant background information, and can have a better detailed description of the target concept when generating a new personalized image, so as to improve the accuracy of personalized image generation.
[0036] In an optional embodiment, preprocessing the original image includes the following steps:
[0037] The object subject in the original image that is the learning target is selected as the foreground target, and the rest is selected as the background target;
[0038] A text description is added to the foreground object and the background object respectively.
[0039] Further, in an optional embodiment, performing a foreground or background replacement operation on the original image includes the following steps:
[0040] Keep the foreground target text description, modify the background target text description, and generate an image with a changed background;
[0041] The background target text description is retained, the foreground target text description is modified, and an image with the foreground replaced is generated.
[0042] As an exemplary explanation, the Inpaint Anything technology is used to realize the separation and replacement of the foreground target and the background target of the image. Among them, the Inpaint Anything technology includes an image segmentation model (SAM) module and a patching (Inpaint) module. The original image is input into the SAM module, and the main body of the object to be learned by the model is framed as the foreground target, and the rest is framed as the background target. Then add a text description to the framed foreground target to obtain a foreground target text description; add a text description to the framed background target to obtain a background target text description. Then the foreground target text description and the background target text description are passed into the Inpaint module to generate an image with a replaced background and an image with a replaced foreground, and obtain an optimized data set. Among them, any text description is matched and associated with the corresponding image.
[0043] Further, in an optional embodiment, using the text inverse mapping model, training is performed on the optimized data set, comprising the following steps:
[0044] Use placeholder strings S* and B* to represent the foreground target text description and background target text description respectively; the placeholder string S* is composed of the target word embedding vector v* and the feature word embedding vector c*, and the placeholder string B* is composed of the background embedding vector b*;
[0045] Initialize the placeholder strings S* and B*; use the words of the class to which the target concept belongs to initialize the target word embedding vector v*; use several word embedding vectors representing the target features and take their average to initialize the feature word embedding vector c*; use the word embedding of the class to which the original image background belongs to initialize the background embedding vector b*;
[0046] Matching the images in the optimized data set with the placeholder strings S* and B*; wherein, on the original image, the placeholder strings S* and B* are matched simultaneously; on the image with the foreground changed, only the placeholder string B* is matched; and on the image with the background changed, only the placeholder string S* is matched;
[0047] The matched image and text description are input into the text inverse mapping model for training to obtain the placeholder strings S* and B* with the highest degree of adaptation.
[0048] In order to further improve the accuracy of the description and the correctness of the distribution of the text vector in the latent space, this embodiment adopts a text inverse mapping method, in which placeholder strings S* and B* are used to represent the foreground target text description and the background target text description, respectively. It should be noted that in the process of generating personalized images, the specified string S* or B* represents the new concept we want to learn.
[0049] Furthermore, this embodiment defines the placeholder string S* as a string consisting of a target word embedding vector v* and a feature word embedding vector c*, where v* is a new, learnable word embedding vector, which refers to the target concept to be learned; and c* is a word embedding vector representing the target feature, which includes color, material, texture, etc., and is an editable word embedding vector. This embodiment defines the placeholder string B* as a string consisting of a background embedding vector b*, where b* is a word embedding vector representing the background feature.
[0050] Using the above matching relationship, a dataset with clear image-text matching is constructed, which includes the following three types of images:
[0051] (1) a photo of S* in B*: original image;
[0052] (2) a photo of S* in “artificial background description”: an image with a replaced background;
[0053] (3) a photo of “artificial foreground description” in B*: replace the foreground image.
[0054] In this embodiment, the target word embedding vector v* is embedded using the word of the class to which the target concept belongs, and its expression is:
[0055]
[0056] in, As the target concept, before training, Assign initial values to complete initialization.
[0057] Further, in an optional embodiment, a plurality of word embedding vectors representing target features are used to take their average value to initialize the feature word embedding vector c*, including the following steps:
[0058] Add the placeholder of the target feature to the tokenizer and add a token id to match the placeholder.
[0059] Input a word vector describing the target feature into the word segmenter to obtain the corresponding token id, and use the token id to read the pre-trained word embedding vector representing the target feature from the word embedding lookup module in the text encoder; repeat this step n times to obtain n pre-trained word embedding vectors representing the target feature, take the average of them, and output the final feature word embedding vector c*.
[0060] like Figure 3 The figure shows the architecture diagram of the text encoder of this embodiment.
[0061] As an example, taking the color feature as an example, in the initialization process of the feature word embedding vector c*, the placeholder <color>Add a tokenizer, add a token id corresponding to this placeholder, then obtain multiple word embedding vectors about color features and average them. Then compare the average word embedding vector with the placeholder in the word embedding lookup module of the text encoder. <color>Corresponding.
[0062] Among them, the word embedding search module can be understood as a two-dimensional w × h The tensor of w , h The value of is related to the pre-trained model; the word embedding search module directly obtains the corresponding word vector through the corresponding token id.
[0063] As an example, in the process of obtaining multiple word embedding vectors about color features and averaging them, first obtain a color word embedding vector. Take the color word red as an example. When red enters the word segmenter, it will get the corresponding token id. Use the token id to obtain the pre-trained word embedding vector with a dimension of 1024 in the word embedding search module. Loop to obtain n 1×1024 color word embedding vectors, average the n 1×1024 color word embedding vectors, and obtain a 1*1024 color word embedding vector as the final feature word embedding vector c* output. Its expression is:
[0064]
[0065] in, is the output feature word embedding vector, The word embedding vector obtained by the word embedding lookup module, n is the number of cycles.
[0066] After completing the initialization of the target word embedding vector v* and the feature word embedding vector c*, you can start model training.
[0067] In an optional embodiment, the matched image and text description are input into a text inverse mapping model for training, including the following steps: allowing gradient updates for the target word embedding vector v*, feature word embedding vector c* and background word embedding vector b* in the text inverse mapping model, freezing other parameters in the text inverse mapping model, and training the text inverse mapping model.
[0068] In this embodiment, the word embedding vector of the target concept and the word embedding vector of the learning background can be learned to improve the accuracy of learning the target concept and alleviate the overfitting problem.
[0069] Furthermore, in an optional embodiment, the method further comprises the following steps: when the target feature needs to be modified, the modified word vector describing the target feature is input into the text encoder to obtain the corresponding token id, and the token id is used to read the pre-trained word embedding vector representing the target feature from the word embedding search module in the text encoder; this step is repeated n times to obtain n pre-trained word embedding vectors representing the target feature, and the average value is taken to output the final feature word embedding vector. , which is used to replace the feature word embedding vector c* in the placeholder string S*; the replaced placeholder string S* is input into the diffusion model to perform the forward generation process to generate a new personalized image.
[0070] This embodiment can achieve the function of changing the corresponding features, such as color, material, texture, etc., by learning the features of the target concept separately, and also helps to improve the accuracy of learning.
[0071] In a specific implementation process, Figure 4 As shown, Figure 4 (a) is the original image. Figure 4 (b) is a personalized image generated by the method of the present invention. Figure 4 (c) in the figure is a personalized image generated using traditional methods. Its foreground target text is described as "toy cat" and its background target text is described as "in Times Square". Figure 4 It can be seen that the traditional method does not generate the picture under Times Square as required.
[0072] like Figure 5 As shown, Figure 5 (a) is the original image. Figure 5 (b) is a personalized image generated by the method of the present invention. Figure 5 (c) in the figure is a personalized image generated using the traditional method. Its foreground target text is described as "stone bird" and its background target text is described as "application icon". Figure 5 It can be seen that the traditional method does not generate personalized pictures in icon style as required.
[0073] like Figure 6 As shown, Figure 6 (a) is the original image. Figure 6 (b) is a personalized image generated using traditional methods. Figure 6 (c) in FIG. 1 is a personalized image generated by the method of the present invention. The foreground target text description is "headless sculpture" and the color feature "gold" is added. Figure 6 It can be seen that the traditional method cannot modify the color of the target object. Figure 6 Based on (c) in the above, the method of the present invention is applied to modify the color feature, and the color feature "gold" is modified to "red", and the following is obtained: Figure 6 The personalized image shown in (d).
[0074] Obviously, the personalized image generation method proposed in this embodiment can enable the model to better distinguish between foreground target concepts and background information, prevent the target concepts learned by the model from being mixed with irrelevant background information, that is, prevent overfitting of fine-tuning training pictures, obtain a more ideal personalized image generation effect that is more in line with text prompts, and improve editability. At the same time, this embodiment can realize the separate representation of the specified features of the target concept, so that the model can modify one or more features of the target concept, and improve the learning accuracy of the target concept on the basis of improving editability.
[0075] Example 2
[0076] This embodiment proposes a personalized image generation system based on background embedding and feature separation based on text inverse mapping. Figure 7 , which is an architecture diagram of the personalized image generation system of this embodiment.
[0077] The personalized image generation system based on background embedding and feature separation based on text inverse mapping proposed in this embodiment includes:
[0078] A feature separation module is used to separate the foreground object and the background object in the input original image, and add text descriptions to the foreground object and the background object respectively;
[0079] An image inpainting module is used to perform a foreground or background replacement operation on the original image based on the foreground target text description and the background target text description, and generate an optimized data set including the original image, the image with the foreground replaced, and the image with the background replaced;
[0080] A text inverse mapping module is equipped with a pre-trained text inverse mapping model, which is used to train the text inverse mapping model on the optimized data set and output the word embedding vector with the highest degree of adaptation for describing the foreground target and the background target; wherein, when trained on the original image, the matched text description includes the foreground target text description and the background target text description; when trained on the image with the foreground replaced, the matched text description includes the background target text description; when trained on the image with the background replaced, the matched text description includes the foreground target text description;
[0081] The personalized generation module is equipped with a pre-trained diffusion model, which is used to input the original image and the word embedding vector with the highest adaptability into the diffusion model to generate a personalized image.
[0082] It can be understood that the system of this embodiment corresponds to the method of the above-mentioned embodiment 1, and the options in the above-mentioned embodiment 1 are also applicable to this embodiment, so they will not be described repeatedly here.
[0083] Example 3
[0084] This embodiment proposes a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the personalized image generation method proposed in Embodiment 1.
[0085] Example 4
[0086] This embodiment provides a storage medium on which computer-readable instructions are stored, wherein the computer-readable instructions, when executed by a processor, implement the steps of the personalized image generation method provided in Embodiment 1.
[0087] Exemplarily, the storage medium includes, but is not limited to, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0088] Exemplarily, the instructions, programs, code sets or instruction sets may be implemented using conventional programming languages.
[0089] Exemplarily, the processor includes but is not limited to a smart phone, a personal computer, a server, a network device, etc., and is used to execute all or part of the steps of the personalized image generation method described in Example 1.
[0090] The terms in the drawings are only used for illustrative purposes and are not to be construed as limiting the present invention;
[0091] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.< / color> < / color>
Claims
1. A personalized image generation method based on background embedding and feature separation based on text inverse mapping, characterized in that: The following steps are involved: Inputting an original image and preprocessing it, separating a foreground object from a background object in the original image, and adding text descriptions to the foreground object and the background object respectively; Based on the foreground target text description and the background target text description, a foreground or background replacement operation is performed on the original image to generate an optimized data set including the original image, the image with the foreground replaced, and the image with the background replaced; The text inverse mapping model is used to train on the optimized data set to obtain the word embedding vector with the highest degree of adaptation for describing the foreground target and the background target; wherein when training on the original image, the matched text description includes the foreground target text description and the background target text description; when training on the image with the foreground replaced, the matched text description includes the background target text description; when training on the image with the background replaced, the matched text description includes the foreground target text description; The original image and the word embedding vector with the highest adaptation degree are input into the diffusion model to generate a personalized image.
2. The personalized image generation method according to claim 1, characterized in that: Preprocessing the original image includes the following steps: The object subject in the original image that is the learning target is selected as the foreground target, and the rest is selected as the background target; A text description is added to the foreground object and the background object respectively.
3. The personalized image generation method according to claim 2, characterized in that: Performing a foreground or background replacement operation on the original image includes the following steps: Keep the foreground target text description, modify the background target text description, and generate an image with a changed background; The background target text description is retained, the foreground target text description is modified, and an image with the foreground replaced is generated.
4. The personalized image generation method according to any one of claims 1 to 3, characterized in that: Using the text inverse mapping model, training is performed on the optimized dataset, including the following steps: Use placeholder strings S* and B* to represent the foreground target text description and background target text description respectively; the placeholder string S* is composed of the target word embedding vector v* and the feature word embedding vector c*, and the placeholder string B* is composed of the background embedding vector b*; Initialize the placeholder strings S* and B*; use the words of the class to which the target concept belongs to initialize the target word embedding vector v*; use several word embedding vectors representing the target features and take their average to initialize the feature word embedding vector c*; use the word embedding of the class to which the original image background belongs to initialize the background embedding vector b*; Matching the images in the optimized data set with the placeholder strings S* and B*; wherein, on the original image, the placeholder strings S* and B* are matched simultaneously; on the image with the foreground changed, only the placeholder string B* is matched; and on the image with the background changed, only the placeholder string S* is matched; The matched image and text description are input into the text inverse mapping model for training to obtain the placeholder strings S* and B* with the highest degree of adaptation.
5. The personalized image generation method according to claim 4, characterized in that: Using several word embedding vectors representing the target features, taking their average value to initialize the feature word embedding vector c* includes the following steps: Add the placeholder of the target feature to the tokenizer and add a token id to match the placeholder; Input a word vector describing the target feature into the word segmenter to obtain the corresponding token id, and use the token id to read the pre-trained word embedding vector representing the target feature from the word embedding lookup module in the text encoder; repeat this step n times to obtain n pre-trained word embedding vectors representing the target feature, take the average of them, and output the final feature word embedding vector c*.
6. The personalized image generation method according to claim 5, characterized in that: In the method, when the placeholder strings S* and B* with the highest degree of adaptation are obtained, the following steps are also included: When the target feature needs to be modified, the modified word vector describing the target feature is input into the text encoder to obtain the corresponding token id. The token id is used to read the pre-trained word embedding vector representing the target feature from the word embedding lookup module in the text encoder. This step is repeated n times to obtain n pre-trained word embedding vectors representing the target feature, and the average value is taken to output the final feature word embedding vector. , used to replace with the feature word embedding vector c* in the placeholder string S*; The replaced placeholder string S* is input into the diffusion model to perform the forward generation process and generate a new personalized image.
7. The personalized image generation method according to claim 4, characterized in that: The matched images and text descriptions are input into the text inverse mapping model for training, which includes the following steps: The target word embedding vector v*, the feature word embedding vector c* and the background word embedding vector b* in the text inverse mapping model are partially allowed to be updated with gradients, other parameters in the text inverse mapping model are frozen, and the text inverse mapping model is trained.
8. A personalized image generation system based on background embedding and feature separation of text inverse mapping, applying the personalized image generation method according to any one of claims 1 to 7, characterized in that: include: A feature separation module is used to separate the foreground object and the background object in the input original image, and add text descriptions to the foreground object and the background object respectively; An image inpainting module is used to perform a foreground or background replacement operation on the original image based on the foreground target text description and the background target text description, and generate an optimized data set including the original image, the image with the foreground replaced, and the image with the background replaced; A text inverse mapping module is equipped with a pre-trained text inverse mapping model, and is used to use the text inverse mapping model to perform training on the optimized data set, and output a word embedding vector with the highest degree of adaptation for describing a foreground target and a background target; wherein when training on the original image, the matched text description includes the foreground target text description and the background target text description; when training on the image with the foreground replaced, the matched text description includes the background target text description; when training on the image with the background replaced, the matched text description includes the foreground target text description; The personalized generation module is equipped with a pre-trained diffusion model, which is used to input the original image and the word embedding vector with the highest adaptability into the diffusion model to generate a personalized image.
9. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, characterized in that: When the computer-readable instructions are executed by the processor, the processor performs the steps of the personalized image generation method according to any one of claims 1 to 7.
10. A storage medium having computer-readable instructions stored thereon, wherein: When the computer-readable instructions are executed by a processor, the steps of the personalized image generation method according to any one of claims 1 to 7 are implemented.
