Model training method, model application method and related device

By adjusting the image generation model by training the model using appearance attribute consistency, the problem of inconsistent image generation in the existing technology is solved, and the correlation between the image and text information and the browsing experience are improved.

CN118644751APending Publication Date: 2024-09-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310265503.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

In the existing technology, image generation technology based on text information cannot effectively correlate the contextual information of the text information, resulting in inconsistent image content generated from different parts of the same piece of text information, which reduces the reading experience.

Method used

By training the model, the consistency of the appearance attribute information in the sample image information collection is used to adjust the parameters of the image generation model to ensure that the generated image information is consistent with the reference image information in appearance attributes, thereby improving the image browsing experience.

Benefits of technology

It improves the accuracy of the image generation model in correlating text information and contextual information, reduces the jumpiness of image content, and improves the coherence and fluency of the image browsing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118644751A
    Figure CN118644751A
Patent Text Reader

Abstract

The embodiment of the invention discloses a model training method, a model application method and a related device, and an image generation model obtained through training of the model training method generates image information corresponding to text information to be generated. The method comprises the following steps: determining a reference mode of appearance attribute information of image composition elements in reference image information based on similarity between the image composition elements respectively described by to-be-generated text information and description text information of the reference image information; therefore, the image information matched with the image component elements described by the to-be-generated text information can be generated, and the generated image information and the reference image information can be ensured to have relatively high appearance attribute information consistency on the same image component elements; therefore, a series of image information with relatively high appearance attribute information consistency can be generated based on multiple pieces of to-be-generated text information, and the image browsing experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field, and in particular to a testing method and related devices. Background Art

[0002] In order to improve the reading experience of text information, image information that matches the content expressed by the text information is usually created based on the text information, so that the text reader can more intuitively feel the scene, characters, etc. that the text information wants to express.

[0003] Due to the low efficiency of manual drawing, in related technologies, technicians have developed image generation technology that can automatically generate image information based on text information. This image generation technology can perform semantic recognition on text information, determine the environment, human objects, non-human objects, etc. expressed by the text information, and then generate images based on this information to obtain image information that is more closely matched with the text information.

[0004] However, the image generation technology in the related art only generates images based on the text information itself, and cannot associate the contextual information of the text information. Therefore, when generating images for different text information parts in the same paragraph of text information, the same text content that appears multiple times in different text information parts may correspond to different image contents in the image information, resulting in confusing image content and poor consistency, which can easily reduce the image browsing experience of readers of the paragraph of text information. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a model training method, through which the image generation model trained can improve the consistency between the generated image information and the reference image information in the appearance attribute information of the image constituent elements, thereby improving the image information browsing experience.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] In a first aspect, an embodiment of the present application discloses a model training method, the method comprising:

[0008] Acquire a sample image information set, the sample image information set comprising a plurality of sample image information, the plurality of sample image information respectively comprising image constituent elements, the difference between the appearance attribute information corresponding to the same image constituent element in the plurality of sample image information being less than a first preset threshold, the plurality of sample image information having respectively corresponding description text information, the description text information being used to describe the image constituent elements included in the image information;

[0009] Determine first reference image information corresponding to target image information from the plurality of sample image information, the target image information is any one of the plurality of sample image information, and both the target image information and the first reference image information include target image constituent elements;

[0010] Obtaining undetermined image information according to the first reference image information, target description text information corresponding to the target image information, and reference description text information corresponding to the first reference image information through an initial image generation model, wherein the initial image generation model is used to determine, based on similarities between image constituent elements respectively described by the target description text information and the reference description text information, a reference method for the appearance attribute information of the image constituent information in the first reference image information when generating image information based on the image constituent elements described by the target description text information;

[0011] The model parameters of the initial image generation model are adjusted according to the difference between the target image information and the image information to be determined to obtain an image generation model, wherein the image generation model is used to generate image information corresponding to the text information to be generated according to the text information to be generated, the second reference image information corresponding to the text information to be generated, and the descriptive text information corresponding to the second reference image information.

[0012] In a second aspect, an embodiment of the present application discloses a model application method, the method comprising:

[0013] Get the text information to be generated;

[0014] Determine reference image information corresponding to the text information to be generated according to the target image constituent elements described by the text information to be generated, wherein the reference image information includes the target image constituent elements and has corresponding description text information, and the description text information is used to describe the image constituent elements included in the image information;

[0015] Through an image generation model, target image information corresponding to the text information to be generated is generated according to the text information to be generated, the reference image information and the descriptive text information corresponding to the reference image information, wherein the target image information includes the target image constituent elements, and the appearance attribute information corresponding to the target image constituent elements in the target image information is determined by the image generation model according to a reference method and the appearance attribute information corresponding to the image constituent elements in the reference image information, and the reference method is determined according to the similarity between the image constituent elements respectively described by the text information to be generated and the descriptive text information corresponding to the reference image information.

[0016] In a third aspect, an embodiment of the present application discloses a model training device, the device comprising a first acquisition unit, a first determination unit, a generation unit and an adjustment unit:

[0017] The first acquisition unit is used to acquire a sample image information set, the sample image information set includes a plurality of sample image information, the plurality of sample image information respectively includes image constituent elements, the difference between the appearance attribute information corresponding to the same image constituent element in the plurality of sample image information is less than a first preset threshold, the plurality of sample image information has respectively corresponding description text information, the description text information is used to describe the image constituent elements included in the image information;

[0018] The first determining unit is used to determine first reference image information corresponding to the target image information from the multiple sample image information, the target image information is any one of the multiple sample image information, and both the target image information and the first reference image information include target image constituent elements;

[0019] The generating unit is used to obtain the pending image information according to the first reference image information, the target description text information corresponding to the target image information and the reference description text information corresponding to the first reference image information through an initial image generating model, wherein the initial image generating model is used to determine, based on the similarity between the image constituent elements respectively described by the target description text information and the reference description text information, a reference method for the appearance attribute information of the image constituent information in the first reference image information when generating the image information based on the image constituent elements described by the target description text information;

[0020] The adjustment unit is used to adjust the model parameters of the initial image generation model according to the difference between the target image information and the to-be-determined image information to obtain an image generation model, and the image generation model is used to generate image information corresponding to the text information to be generated according to the text information to be generated, the second reference image information corresponding to the text information to be generated, and the descriptive text information corresponding to the second reference image information.

[0021] In a possible implementation manner, the generating unit is specifically configured to:

[0022] generating a first feature according to the target description text information and the first identifier, and generating a second feature according to the first reference image information, the reference description text information corresponding to the first reference image information, and the second identifier, wherein the first feature is used to reflect a first image constituent element described by the target description text information, and the second feature is used to reflect a second image constituent element described by the reference description text information, and appearance attribute information corresponding to the second image constituent element in the first reference image information;

[0023] The first identifier is used to instruct the initial image generation model to generate image information based on the image constituent elements embodied by the first feature, and the second identifier is used to instruct the initial image generation model to determine a reference method for the appearance attribute information embodied by the second feature when generating image information based on the similarity between the image constituent elements of the first image constituent elements and the second image constituent elements;

[0024] Generate a constraint condition according to the first feature and the second feature, wherein the constraint condition is used to constrain the initial image generation model to generate the pending image information including the first image constituent element based on the reference mode and with reference to the appearance attribute information of the second image constituent element reflected in the second feature;

[0025] The pending image information is generated according to the constraint condition.

[0026] In a possible implementation manner, the generating unit is specifically configured to:

[0027] Acquire features of the image to be adjusted, where the features of the image to be adjusted are used to identify image constituent elements to be adjusted in the image information to be adjusted, and appearance attribute information corresponding to the image constituent elements to be adjusted;

[0028] Adjusting the image feature to be adjusted according to the constraint condition, so that the plurality of image constituent elements to be adjusted identified by the image feature to be adjusted and the appearance attribute information respectively corresponding to the plurality of image constituent elements to be adjusted are close to the first image constituent element and the sample appearance attribute information corresponding to the first image constituent element, the sample appearance attribute information being determined based on the reference mode and the appearance attribute information embodied by the second image constituent element in the second feature;

[0029] The to-be-determined image information is generated according to the adjusted to-be-adjusted image features.

[0030] In a possible implementation manner, the second image constituent elements include scene constituent elements and object constituent elements, the scene constituent elements are used to generate a scene portion in the image information, the object constituent elements are used to generate an object portion in the image information, and the first reference image information includes scene reference image information having the scene constituent elements and object reference image information having the object constituent elements;

[0031] The second feature includes a scene reference feature and an object reference feature, and the generating unit is specifically used to:

[0032] Generate a scene reference feature according to the scene reference image information, the description text information corresponding to the scene reference image information, the scene identifier and the second identifier, wherein the scene identifier is used to instruct the initial image generation model to generate a scene constituent element in the pending image information based on the scene reference feature;

[0033] And, based on the object reference image information, the descriptive text information corresponding to the object reference image information, the object identifier and the second identifier, an object reference feature is generated, and the scene identifier is used to instruct the initial image generation model to generate the object constituent elements in the pending image information based on the object reference feature.

[0034] In a possible implementation, the object reference feature is used to perform an i-th adjustment on the image feature to be adjusted, where i is a positive integer not greater than N. Before generating the object reference feature according to the object reference image information, the descriptive text information corresponding to the object reference image information, and the object identifier, the device further includes a second determining unit and a third determining unit:

[0035] The second determining unit is used to determine the default text information as the description text information corresponding to the object reference image information in response to i not being greater than M, the default text information not describing any image constituent elements, M being a positive integer less than N, and N being a positive integer greater than 1;

[0036] The third determining unit is configured to determine, in response to i being greater than M, the description text information corresponding to the object reference image information in the sample image information set as the description text information corresponding to the object reference image information;

[0037] The generating unit is specifically used for:

[0038] generating a constraint condition corresponding to the i-th adjustment according to the first feature, the scene reference feature and the object reference feature;

[0039] According to the constraint conditions corresponding to the N adjustments, the image feature to be adjusted is adjusted N times to obtain the adjusted image feature to be adjusted;

[0040] Among them, for the j-th adjustment, based on the constraint conditions corresponding to the j-th adjustment, the image features to be adjusted after the j-1-th adjustment are adjusted to obtain the image features to be adjusted after the j-th adjustment, where j is a positive integer greater than 1 and not greater than N.

[0041] In a possible implementation manner, the object constituent elements include human object constituent elements and non-human object constituent elements, the object reference image information includes human object reference image information and non-human object reference image information, and the second determining unit is specifically configured to:

[0042] In response to i being greater than M, determining the description text information corresponding to the character object reference image information in the sample image information set as the description text information corresponding to the character object reference image information;

[0043] In response to i being greater than M but not greater than P, determining the default text information as the description text information corresponding to the non-human object reference image information, where P is a positive integer greater than M and less than N, and N is specifically a positive integer greater than 2;

[0044] In response to i being greater than P, the description text information corresponding to the non-human object reference image information in the sample image information set is determined as the description text information corresponding to the non-human object reference image information.

[0045] In a possible implementation manner, the sample image information set is generated in the following manner:

[0046] Get the video to be processed;

[0047] Determine a plurality of video frame image information corresponding to the video to be processed, the difference between the appearance attribute information corresponding to the same image constituent element in the plurality of video frame image information is less than the first preset threshold, the plurality of video frame image information has respectively corresponding description text information and video frame identifiers, and the video frame identifier is used to identify the time sequence of the video frame image information in the plurality of video frame image information;

[0048] Determine the plurality of video frame image information as a plurality of sample image information in the sample image information set, and generate the sample image information set;

[0049] The first determining unit is specifically configured to:

[0050] Determine, among the plurality of sample image information, a plurality of pending sample image information including the target image constituent elements;

[0051] According to the video frame identifier corresponding to the target image information and the video frame identifiers respectively corresponding to the multiple pending sample image information, the pending sample image information that is closest to the target image information in time sequence among the multiple pending sample image information is determined as the first reference image information.

[0052] In a possible implementation manner, determining a plurality of video frame image information corresponding to the video to be processed includes:

[0053] Acquire multiple initial video frame image information corresponding to the video to be processed;

[0054] The multiple video frame image information are determined from the multiple initial video frame image information, and the similarity between any two video frame image information in the multiple video frame image information is greater than a second preset threshold.

[0055] In a possible implementation manner, the generating unit is specifically configured to:

[0056] Determine query information corresponding to the attention adjustment mechanism in the j-th adjustment according to the features of the image to be adjusted after the j-1-th adjustment, and determine the constraint condition corresponding to the j-th adjustment as the address information and value information corresponding to the attention adjustment mechanism in the j-th adjustment;

[0057] Determining attention information corresponding to the attention adjustment mechanism in the j-th adjustment based on the query information, address information, and value information corresponding to the attention adjustment mechanism in the j-th adjustment;

[0058] The image feature to be adjusted after the j-1th adjustment is adjusted based on the attention information to obtain the image feature to be adjusted after the jth adjustment.

[0059] In a possible implementation manner, the reference manner is used to identify a reference object and a reference degree, and the generating unit is specifically used to:

[0060] Based on the similarity between the image constituent elements respectively described in the target description text information and the reference description text information, determining the image constituent element to be referenced corresponding to the image constituent element to be generated in the image constituent elements described in the reference description text information, the target similarity between the text information respectively corresponding to the image constituent element to be generated and the image constituent element to be referenced is greater than a third preset threshold, and the image constituent element to be generated is any one of the target image constituent elements;

[0061] Taking the reference image constituent element as a reference object and the target similarity as a reference degree, processing the appearance attribute information corresponding to the reference object in the first reference image information according to the reference degree, and generating the appearance attribute information corresponding to the image constituent element to be generated in the pending image information;

[0062] The pending image information is generated according to the appearance attribute information corresponding to the target image constituent elements in the pending image information.

[0063] In a fourth aspect, an embodiment of the present application discloses a model application device, the device comprising a second acquisition unit, a determination unit and a first generation unit:

[0064] The second acquisition unit is used to acquire the text information to be generated;

[0065] The determining unit is used to determine the reference image information corresponding to the text information to be generated according to the target image constituent elements described by the text information to be generated, the reference image information includes the target image constituent elements, the reference image information has corresponding description text information, and the description text information is used to describe the image constituent elements included in the image information;

[0066] The first generation unit is used to generate target image information corresponding to the text information to be generated through an image generation model according to the text information to be generated, the reference image information and the descriptive text information corresponding to the reference image information, wherein the target image information includes the target image constituent elements, and the appearance attribute information corresponding to the target image constituent elements in the target image information is determined by the image generation model according to a reference method and the appearance attribute information corresponding to the image constituent elements in the reference image information, and the reference method is determined according to the similarity between the image constituent elements respectively described by the text information to be generated and the descriptive text information corresponding to the reference image information.

[0067] In a possible implementation manner, the determining unit is specifically configured to:

[0068] According to the time sequence identifiers respectively corresponding to the multiple generated image information corresponding to the target image constituent elements in the generated image information set, the generated image information with the shortest generated time among the multiple generated image information is determined as the reference image information, wherein the time sequence identifier is used to identify the time sequence between the generation moments of the multiple image information;

[0069] The device also includes a second generating unit and a storage unit:

[0070] The second generating unit is used to generate a target timing identifier corresponding to the target image information according to the generation time of the target image information;

[0071] The storage unit is used to determine the target image information as the generated image information corresponding to the target image constituent elements, bind it with the target timing identifier and store it in the generated image information set, and the text information to be generated is the descriptive text information corresponding to the target image information.

[0072] In a possible implementation manner, the determining unit is specifically configured to:

[0073] In response to the absence of generated image information corresponding to the target image constituent element in the generated image information set, default image information corresponding to the target image constituent element is determined as the reference image information.

[0074] In a fifth aspect, an embodiment of the present application discloses a computer device, wherein the computer device includes a processor and a memory:

[0075] The memory is used to store a computer program and transmit the computer program to the processor;

[0076] The processor is used to execute the model training method described in any one of the first aspects, or the model application method described in any one of the second aspects according to the instructions in the computer program.

[0077] In the sixth aspect, an embodiment of the present application discloses a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the model training method described in any one of the first aspects, or the model application method described in any one of the second aspects.

[0078] In the seventh aspect, an embodiment of the present application discloses a computer program product including a computer program, which, when running on a computer, enables the computer to execute the model training method described in any one of the first aspects, or the model application method described in any one of the second aspects.

[0079] It can be seen from the above technical scheme that when the present application trains the image generation model, multiple sample image information will be collected first, wherein the appearance attribute information corresponding to the same image constituent elements in multiple sample image information has a high consistency. Any one of the sample image information is used as the target image information, and the first reference image information corresponding to the target image information is determined. Both the first reference image information and the target image information include the target image constituent elements, so that when the image information is generated based on the target description text information corresponding to the target image information, the first reference image information can be used as a reference basis for the appearance attribute information. The initial image generation model is used to determine the reference method for the appearance attribute information of the image constituent information in the first reference image information when generating the pending image information based on the image constituent elements described in the target description text information based on the similarity of the image constituent elements respectively described in the input target description text information and the reference description text information of the first reference image information, and the reference method is used to indicate which appearance attribute information in the first reference image information the initial image generation model refers to, and how to refer to these appearance attribute information to generate the image constituent elements in the pending image information. Finally, since the target description text information is used to describe the image elements included in the target image information, and the target image information and the first reference image information have consistency in appearance attribute information of the same image elements, the difference between the target image information and the to-be-determined image information can, on the one hand, reflect the accuracy of the initial image generation model in generating image information based on text information, and on the other hand, reflect the accuracy of the reference image information when referring to the appearance attribute information expressed by the reference image information. Thus, by adjusting the image generation model based on the difference to obtain the image generation model, a series of image information that fits the text information and has high consistency in appearance attribute information of image elements can be generated based on the reference image information and the text information to be generated, thereby reducing the probability of large jumps in image content when image viewers view image information corresponding to text information with strong relevance, thereby improving the image browsing experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0081] Figure 1 A schematic diagram of a model training method in an actual application scenario provided in an embodiment of the present application;

[0082] Figure 2A flowchart of a model training method provided in an embodiment of the present application;

[0083] Figure 3 A schematic diagram of a model training method provided in an embodiment of the present application;

[0084] Figure 4 A schematic diagram of a model training method provided in an embodiment of the present application;

[0085] Figure 5 A schematic diagram of a model training method provided in an embodiment of the present application;

[0086] Figure 6 A schematic diagram of a model training method provided in an embodiment of the present application;

[0087] Figure 7 A schematic diagram of a model training method provided in an embodiment of the present application;

[0088] Figure 8 A schematic diagram of a model training method provided in an embodiment of the present application;

[0089] Fig. 9 A flowchart for generating a sample image information set provided in an embodiment of the present application;

[0090] Fig.10 A flow chart of a model application method provided in an embodiment of the present application;

[0091] Fig.11 A schematic diagram of a model application method in an actual application scenario provided by an embodiment of the present application;

[0092] Fig.12 A schematic diagram of a model application method in an actual application scenario provided by an embodiment of the present application;

[0093] Fig.13 A structural block diagram of a model training device provided in an embodiment of the present application;

[0094] Fig.14 A structural block diagram of a model application device provided in an embodiment of the present application;

[0095] Fig.15 A structural diagram of a terminal provided in an embodiment of the present application;

[0096] Fig.16 A structural diagram of a server provided in an embodiment of the present application;

[0097] Fig.17 A schematic diagram of a model training method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0098] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0099] Image generation technology can be applied to various scenarios in daily life. For example, it can be used to generate corresponding image information for text information such as novels and scripts, enriching the information browsing dimension of readers. In related technologies, image generation is achieved by inputting the text information to be generated, and image information with a high degree of matching with the text information to be generated can be obtained.

[0100] However, the image generation technology in the related art can only refer to the text information to be generated itself to generate image information including the image constituent elements described by the text information to be generated. During the generation process, the appearance attribute information reflected by other image information will not be referenced. This leads to that when there are multiple text information to be generated that need to be generated for image generation, it is easy for the image information corresponding to the multiple text information to be generated to have large differences in the appearance attribute information reflected on the same image constituent elements. For example, for the image constituent element of "cat", in two text information that are contextual to each other, the color and breed of the generated image information will be quite different, and these text information to be generated usually describe image constituent elements corresponding to relatively consistent appearance attribute information (for example, the cat described in the context of a novel usually has consistent appearance attribute information). Therefore, the image information generated by the image generation technology in the related art does not meet the consistency characteristics in the associated text information, which will bring a poor image browsing experience to the reader.

[0101] In order to solve the above-mentioned technical problems, the present application provides a model training method. When an image generation model trained by the model training method generates image information corresponding to text information to be generated, the image generation model can determine the reference method for the appearance attribute information of the image constituent elements in the reference image information based on the similarity between the image constituent elements described in the descriptive text information of the text information to be generated and the reference image information, thereby being able to generate image information that matches the image constituent elements described in the text information to be generated, and being able to ensure that the generated image information and the reference image information have a high consistency in appearance attribute information on the same image constituent elements, thereby being able to generate a series of image information with a strong consistency in appearance attribute information based on multiple text information to be generated, thereby improving the image browsing experience.

[0102] It is understandable that the method can be applied to a computer device, which is a computer device capable of model training, for example, a terminal device or a server with a model training function. The method can be executed independently by a terminal device or a server, or it can be applied to a network scenario in which a terminal device and a server communicate, and is executed by the cooperation of a terminal device and a server. Among them, the terminal device can be a computer, a mobile phone and other devices. The server can be understood as an application server or a Web server. In actual deployment, the server can be an independent server, a cluster server or a cloud server.

[0103] In order to facilitate understanding of the technical solution provided in the embodiment of the present application, a model training method provided in the embodiment of the present application will be introduced below in combination with an actual application scenario.

[0104] See also Figure 1 , Figure 1 A schematic diagram of a model training method in an actual application scenario provided in an embodiment of the present application. In this actual application scenario, the computer device is a model training server 101 capable of performing model training.

[0105] First, the model training server 101 obtains a sample image information set including N sample image information including sample image information 1, sample image information 2, sample image information 3...sample image information N, and then obtains the target image information and the reference image information 1 and reference image information 2 corresponding to the target image information from the sample image information set. Among them, both the target image information and the reference image information 1 have the image constituent element "person A", and both the target image information and the reference image information 2 include the image constituent element "sword". In the sample image information set, the difference between the appearance attribute information corresponding to the same image constituent element in multiple sample image information is less than the first preset threshold value, so the image constituent element "person A" in the target image information and the reference image information 1 is relatively consistent in appearance attribute information, and the image constituent element "sword" in the target image information and the reference image information 2 is relatively consistent in appearance attribute information.

[0106] The model training server 101 inputs the target description text information corresponding to the target image information, the reference image information 1, the reference image information 2, the reference description text information 1 corresponding to the reference image information 1, and the reference description text information 2 corresponding to the reference image information 2 into the initial image generation model. The description text information is used to describe the image constituent elements included in the corresponding image information. The initial image generation model can determine the image constituent element similarity 1 based on the target text description information and the reference description text information 1. The image constituent element similarity 1 can reflect the similarity between the image constituent elements described by the target text description information and the reference description text information 1; similarly, the image constituent element similarity 2 can reflect the similarity between the image constituent elements described by the target text description information and the reference description text information 2. Thus, based on the similarity, the initial image generation model can learn which image constituent elements in the reference image information correspond to the appearance attribute information, as well as the degree of reference when referring to the appearance attribute information. For example, since both the target image information and the reference image information 1 contain the image element "Person A", the target description text information and the reference description text information 1 used to describe the two image information have a high degree of similarity in the image element "Person A", thereby enabling the initial image generation model to refer to the appearance attribute information corresponding to the "Person A" in the reference image information 1 (such as clothing color, clothing style, etc.) to generate the "Person A" in the pending image information.

[0107] The initial image generation model will refer to the appearance attribute information corresponding to the image constituent elements in the reference image information 1 and the reference image information 2 through the above-mentioned reference method, and finally generate the pending image information including the image constituent elements described by the target description text information. The appearance attribute information corresponding to the image constituent elements in the pending image information is determined based on the reference to the reference image information, and the purpose is to ensure that it has a high consistency with the reference image information in the appearance attribute information dimension. Since the target description text information is actually used to describe the target image information, based on the difference between the target image information and the pending image information, on the one hand, the initial image generation model can learn how to generate accurate image information based on the description text information, and on the other hand, it can learn how to make a reasonable reference to the appearance attribute information of the reference image information. Thus, the model training server 101 can adjust the model parameters of the initial image generation model according to the difference between the target image information and the pending image information to obtain the image generation model. The image generation model can be used to generate image information including the image constituent elements described by the text information to be generated, the reference image information and the descriptive text information corresponding to the reference image information, and the appearance attribute information of the same image constituent elements in the image information and the reference image information has a high consistency, and then a series of image information with a high consistency in the appearance attribute dimension can be generated, so that the image browser will not have a strong sense of jump when browsing the image, thereby improving the coherence and fluency of image browsing and improving the image browsing experience.

[0108] Next, a model training method provided in an embodiment of the present application will be introduced in conjunction with the accompanying drawings.

[0109] See also Figure 2 , Figure 2 A flowchart of a model training method provided in an embodiment of the present application, the model training method can be executed by the above-mentioned computer device, for example, can be executed by a server with a model training function, the method comprising:

[0110] S201: Obtain a sample image information set.

[0111] The sample image information set includes a plurality of sample image information, and the plurality of sample image information respectively includes image constituent elements. Image constituent elements refer to elements used to constitute image information, and may include, for example, environmental constituent elements (such as bedroom, restaurant, sea, sunshine, etc.), human object constituent elements (such as men, women, old people, children, etc.), non-human object constituent elements (knife, car, mouse, etc.), etc. Any element that can be added to the image information and visually perceived by the image viewer can be regarded as an image constituent element in this application.

[0112] In the related art, it is precisely because the model lacks the ability to refer to the appearance attribute information in the image information that it is unable to generate multiple image information that are relatively consistent in the dimension of the appearance attribute information of the image constituent elements. Therefore, the core improvement of this application lies in how to enable the model to learn how to refer to the appearance attribute information in the image information.

[0113] The computer device may first obtain the above-mentioned sample image information set, wherein the difference between the appearance attribute information corresponding to the same image constituent element in multiple sample image information is less than the first preset threshold, and the appearance attribute information is information used to determine the appearance of the image constituent element in the visual dimension, for example, it may include the color information, type information, size information, etc. of the image constituent element, which is not limited here. The first preset threshold can be adjusted based on the needs of image generation. Since the model parameters will eventually be adjusted based on the sample image information in the sample image information set, the smaller the first preset threshold, the higher the consistency of the multiple sample image information in the appearance attribute information dimension, the greater the learning strength of the model in the dimension of generating image information with reference to the appearance attribute information, and the higher the consistency of the image information generated in the application in the appearance attribute information dimension; conversely, the larger the first preset threshold, the lower the consistency of the image information generated in the application in the appearance attribute information dimension.

[0114] The plurality of sample image information have respectively corresponding description text information, and the description text information is used to describe the image constituent elements included in the image information;

[0115] S202: Determine first reference image information corresponding to the target image information from a plurality of sample image information.

[0116] The target image information may be any sample image information among a plurality of sample image information, and both the target image information and the first reference image information include target image constituent elements, and the target image constituent elements may be any image constituent elements, and may be one or more image constituent elements. The purpose of selecting the first reference image information is to enable the initial image generation model to learn how to generate image information by referring to the appearance attribute information of the target image constituent elements in the first reference image information.

[0117] The first reference image information may be determined by analyzing the image constituent elements included in the target image information, and then selecting sample image information having the image constituent elements from multiple sample image information as the first reference image information. It should be emphasized that the target image constituent elements may be any one or more of the image constituent elements included in the target image information, that is, each image constituent element in the target image information may have its own corresponding first reference image information. For example, Figure 1In the scene shown, the reference image information corresponding to the image element "sword" in the target image information is reference image information 2, and the reference image information corresponding to the image element "character A" is reference image information 1. For the target image information and reference image information 1, the target image element is "character A", and for the target image information and reference image information 2, the target image element is "sword".

[0118] S203: Obtain pending image information through an initial image generation model according to the first reference image information, target description text information corresponding to the target image information, and reference description text information corresponding to the first reference image information.

[0119] The target description text information is used to describe the image constituent elements included in the target image information, and the reference description text information is used to describe the image constituent elements included in the first reference image information. Therefore, the similarity between the image constituent elements described by the target description text information and the reference description text information can reflect which image constituent elements are the same in the first reference image information and the target image information, thereby guiding the initial image generation model to refer to the appearance attribute information of which image constituent elements in the first reference image information.

[0120] Since the first reference image information displays the included image constituent elements from a visual dimension, the first reference image information contains the appearance attribute information of the included image constituent elements. Combined with the information guided by the above similarity, the initial image generation model can know the appearance attribute information of the multiple image constituent elements described by the target description text information in the pending image information when generating the pending image information corresponding to the target description text information. Therefore, based on the above content, the initial image generation model can be used to determine the reference method for the appearance attribute information of the image constituent information in the first reference image information when generating image information based on the image constituent elements described by the target description text information based on the similarity between the image constituent elements described by the target description text information and the reference description text information, and the reference method is to refer to the appearance attribute information expressed by the first reference image information to determine the appearance attribute information expressed by the image constituent elements described by the target description text information in the pending image information. That is, the image constituent elements included in the pending image information are the image constituent elements described by the target description text information, and the appearance attribute information of the image constituent elements in the pending image information is determined based on the reference method with reference to the appearance attribute information embodied by the first sample image information.

[0121] S204: adjusting the model parameters of the initial image generation model according to the difference between the target image information and the pending image information to obtain the image generation model.

[0122] Since the target image information is the image information actually described by the target description text information, and the difference between the corresponding appearance attribute information of the same image constituent elements in the target image information and the first reference image information is less than the first preset threshold, therefore, when the initial image information can accurately generate image information based on the target description text information and can reasonably refer to the appearance attribute information in the first reference image information, the generated pending image information should be close to the target image information.

[0123] Based on this, the computer device can adjust the model parameters of the initial image generation model according to the difference between the target image information and the pending image information. The smaller the difference, the closer the image information generated by the model based on the target description text information is to the image constituent elements described by the target description text information, and the reference to the appearance attribute information embodied by the first reference image information is also more reasonable. Therefore, by adjusting the model parameters based on the difference to reduce the difference between the pending image information generated by the model and the target image information, on the one hand, the initial image generation model can learn how to accurately generate image constituent elements based on text information, so that the generated image information fits the image constituent elements described by the text information; on the other hand, the initial image generation model can learn how to reasonably and accurately reference the appearance attribute information in the image information used for reference, and finally combine these two aspects of learning to generate image information.

[0124] Therefore, the image generation model can be used to generate image information corresponding to the text information to be generated based on the text information to be generated, the second reference image information corresponding to the text information to be generated, and the descriptive text information corresponding to the second reference image information. The second reference image information is the image information used to refer to the appearance attribute information in the process of generating the image information this time. The reference method is determined based on the similarity between the image constituent elements described by the text information to be generated and the descriptive text information. The image information includes the image constituent elements described by the text information to be generated.

[0125] It can be seen from the above technical scheme that when the present application trains the image generation model, multiple sample image information will be collected first, wherein the appearance attribute information corresponding to the same image constituent elements in multiple sample image information has a high consistency. Any one of the sample image information is used as the target image information, and the first reference image information corresponding to the target image information is determined. Both the first reference image information and the target image information include the target image constituent elements, so that when the image information is generated based on the target description text information corresponding to the target image information, the first reference image information can be used as a reference basis for the appearance attribute information. The initial image generation model is used to determine the reference method for the appearance attribute information of the image constituent information in the first reference image information when generating the pending image information based on the image constituent elements described in the target description text information based on the similarity of the image constituent elements respectively described in the input target description text information and the reference description text information of the first reference image information, and the reference method is used to indicate which appearance attribute information in the first reference image information the initial image generation model refers to, and how to refer to these appearance attribute information to generate the image constituent elements in the pending image information. Finally, since the target description text information is used to describe the image elements included in the target image information, and the target image information and the first reference image information have consistency in appearance attribute information of the same image elements, the difference between the target image information and the to-be-determined image information can, on the one hand, reflect the accuracy of the initial image generation model in generating image information based on text information, and on the other hand, reflect the accuracy of the reference image information when referring to the appearance attribute information expressed by the reference image information. Thus, by adjusting the image generation model based on the difference to obtain the image generation model, a series of image information that fits the text information and has high consistency in appearance attribute information of image elements can be generated based on the reference image information and the text information to be generated, thereby reducing the probability of large jumps in image content when image viewers view image information corresponding to text information with strong relevance, thereby improving the image browsing experience.

[0126] For example, for multiple text information in the same novel, when the image element "cat" is described in multiple text information, the restriction of the reference image information can be used to make the image element "cat" have relatively consistent appearance attribute information (such as fur color, size, etc.) in the image information corresponding to the multiple generated text information, so that viewers browsing this series of image information can have a smoother and more integrated image perception.

[0127] In one possible implementation, the reference method can be used to identify a reference object and a reference degree. By identifying the reference object, the model can know which image constituent element in the reference image information to refer to for appearance attribute information when generating a certain image constituent element to be generated in the pending image information. By identifying the reference degree, the model can know how to generate the appearance attribute information of the image constituent element to be generated based on the appearance attribute information.

[0128] Next, the process of generating the pending image information by combining the model will be described in detail, focusing on the role of the reference method in the process of generating the pending image information.

[0129] The computer device may determine, based on the similarity between the image constituent elements respectively described in the target description text information and the reference description text information, the image constituent element to be generated corresponding to the image constituent element to be referenced in the image constituent elements described in the reference description text information, wherein the target similarity of the text information respectively corresponding to the image constituent element to be generated and the image constituent element to be referenced is greater than a third preset threshold. The image constituent element to be generated may be any one of the target image constituent elements.

[0130] That is, the image constituent element to be referenced is an image constituent element that is closer to the image constituent element to be generated among the multiple image constituent elements included in the first reference image information. Therefore, it is more reasonable to generate the image constituent element to be generated by referring to the appearance attribute information corresponding to the image constituent element to be referenced.

[0131] Based on this, the computer device can use the to-be-referenced image constituent element as a reference object and the target similarity as a reference degree to refer to the appearance attribute information included in the first reference image information. Specifically, when the to-be-determined image information is generated by the initial image generation model, the appearance attribute information corresponding to the reference object in the first reference image information can be processed according to the reference degree to generate the appearance attribute information corresponding to the to-be-generated image constituent element in the to-be-generated image information, and the appearance attribute information corresponding to the to-be-generated image constituent element and the appearance attribute information corresponding to the reference object meet the reference degree (i.e., meet the target similarity).

[0132] Thus, in this way, the computer device can determine the appearance attribute information corresponding to each image constituent element in the target image constituent element. Further, knowing which image constituent elements need to be generated in the pending image information and knowing the appearance attribute information corresponding to these image constituent elements, the computer device can generate the pending image information according to the appearance attribute information corresponding to the target image constituent elements in the pending image information.

[0133] For example, when the third preset threshold is set to 99%, the image constituent element to be generated and the image constituent element to be referenced are basically the same image constituent element. The computer device can refer to the appearance attribute information of the image constituent element to be referenced with a reference degree of 99% to obtain the corresponding appearance attribute information of the image constituent element to be generated in the pending image information.

[0134] Alternatively, the image constituent element to be generated may correspond to multiple image constituent elements to be referenced, and the appearance attribute information corresponding to the multiple object constituent elements to be referenced may be different. The model may determine the degree of reference to these appearance attribute information based on the target similarities corresponding to the graphic constituent element to be generated and the multiple image constituent elements to be referenced. The higher the similarity, the higher the degree of reference, and finally the appearance attribute information corresponding to the image constituent element to be generated in the pending image information is obtained comprehensively.

[0135] See also Fig.17 The multiple image constituent elements described in the target description text information include image constituent element 1, image constituent element 2, etc., and the image constituent elements described in the reference description text information include image constituent element A, image constituent element B, etc. The third preset threshold can be set to 80%. Through similarity analysis, it can be found that the similarity between image constituent element C and image constituent element 1 in the description text information is 90%, which meets the third preset threshold. At this time, image constituent element C can be determined as the reference object corresponding to image constituent element 1. 90% is used as a reference degree. The appearance attribute information A corresponding to the reference object in the reference image information is processed to obtain appearance attribute information B. The appearance attribute information B is the appearance attribute information corresponding to the image constituent element 1 when the pending image information is generated. The appearance attribute information B and the appearance attribute information A meet the reference degree. For example, the similarity between the appearance attribute information B and the appearance attribute information A is not less than 90%.

[0136] Next, the image information generation logic of the initial image generation model will be introduced in detail.

[0137] As mentioned above, the initial image generation model determines the image constituent elements in the generated image information based on the target description information, and determines the appearance attribute information corresponding to the image constituent elements based on the reference image information. In one possible implementation, in order to enable the initial image generation model to accurately process this information, the computer device can combine the first identifier and the second identifier to indicate how the model processes the information.

[0138] When obtaining the pending image information according to the first reference image information, the target description text information corresponding to the target image information, and the reference description text information corresponding to the first reference image information, the computer device may perform the following operation steps, wherein steps S2031 to S2033 are a possible implementation of the above step S203:

[0139] S2031: Generate a first feature according to the target description text information and the first identifier, and generate a second feature according to the first reference image information, the reference description text information corresponding to the first reference image information, and the second identifier.

[0140] Among them, the first feature is used to reflect the first image constituent element described by the target description text information, and the second feature is used to reflect the second image constituent element described by the reference description text information, as well as the appearance attribute information corresponding to the second image constituent element in the first reference image information. Therefore, based on the first feature and the second feature, the similarity between the image constituent elements described by the target description text information and the reference description text information can be analyzed, and the second feature can provide the initial image generation model with appearance attribute information for reference.

[0141] The first identifier is used to instruct the initial image generation model to generate image information based on the image constituent elements embodied by the first feature, so that the pending image information generated by the initial image includes the image constituent elements described by the target description information.

[0142] The second identifier is used to indicate that the initial image generation model determines the reference method for the appearance attribute information embodied by the second feature when generating image information based on the similarity between the image constituent elements of the first image constituent element and the second image constituent element. That is, the second identifier can indicate that the initial image generation model refers to the appearance attribute information of each image constituent element embodied in the second feature.

[0143] S2032: Generate constraint conditions based on the first feature and the second feature.

[0144] From the above content, it can be seen that the first feature can indicate which image elements the model generates, and the second feature can indicate which appearance attribute information the model refers to to generate the image elements in the image information. The combination of the first feature and the second feature can reflect the similarity between the image elements described by the two descriptive text information. Therefore, the constraint conditions generated by combining the first feature and the second feature can be used to constrain the initial image generation model to generate pending image information including the first image elements based on this reference method, with reference to the appearance attribute information of the second image elements reflected in the second feature.

[0145] S2033: Generate pending image information according to the constraint conditions.

[0146] For example, when the target description text information and the reference description text information both describe the image element "cat", the initial image generation model can firstly, based on the first identifier, know that the image element "cat" should be generated in the image information. Through the second identifier, based on the similarity between the image element information embodied by the first feature and the second feature, it can be known that when generating the image element "cat" in the pending image information, the appearance attribute information of the "cat" embodied by the second feature should be referred to to determine the appearance attribute information.

[0147] See also Figure 3 , Figure 3 A schematic diagram of a model training method provided in an embodiment of the present application, wherein a computer device can extract a text feature vector 1 corresponding to target description text information through a text feature extraction model, wherein the text feature vector 1 can reflect the image constituent elements described by the target description text information, and then perform vector concatenation of the text feature vector 1 and modality 0 (i.e., the first identifier) ​​to obtain a first feature;

[0148] For the reference description text information, the computer device can fuse the reference description text information and the reference image information through the graphic information fusion model. Since the reference description text information is used to describe the image constituent elements included in the reference image information, the reference image information can reflect the appearance attribute information corresponding to these image constituent elements. Therefore, the text feature vector 2 obtained by the fusion can identify the image constituent elements included in the reference image information while reflecting the appearance attribute information corresponding to each image constituent element, which is equivalent to using the corresponding appearance attribute information as the description content corresponding to the image constituent element in the text feature. The computer device can perform vector addition of the text feature vector and the mode 1 (i.e., the second identifier) ​​to obtain the second feature, and then perform vector splicing of the first feature and the second feature to obtain the constraint condition.

[0149] When generating image information based on constraint conditions, there may be multiple ways of generating image information based on different types of models. For example, in one possible implementation, the initial image generation model continuously adjusts the initially generated image information based on the constraint conditions to obtain image information that ultimately fits the constraint conditions.

[0150] When generating pending image information according to the constraint conditions, the following steps may be included, wherein steps S20331 to S20332 are a possible implementation of the above step S2033:

[0151] S20331: Obtain features of the image to be adjusted.

[0152] The image feature to be adjusted is used to identify the image elements to be adjusted in the image information to be adjusted, and the appearance attribute information corresponding to the image elements to be adjusted. The image information to be adjusted is the image information adjusted when the image information output by the generation model is generated. In this step, the image information to be adjusted can be randomly generated, can be a preset default image information, or can be image information obtained after adjustment by other image adjustment steps, which is not limited here.

[0153] S20332: adjusting the image feature to be adjusted according to the constraint condition, so that the multiple image constituent elements to be adjusted identified by the image feature to be adjusted and the appearance attribute information respectively corresponding to the multiple image constituent elements to be adjusted are close to the first image constituent element and the sample appearance attribute information corresponding to the first image constituent element.

[0154] Among them, the sample appearance attribute information is determined based on the reference method and the appearance attribute information embodied in the second feature of the second image constituent element, that is, the sample appearance attribute information is determined by the initial image generation model based on the reference method, with reference to the appearance attribute information of the second image constituent element corresponding to the first image constituent element in the first reference image information. The sample appearance attribute information is the appearance attribute information that the first image constituent element should correspond to in the pending image information when the generated pending image information is relatively consistent with the first reference image constituent element in the appearance attribute dimension.

[0155] As mentioned above, the constraint condition is used to constrain the initial image generation model to generate the pending image information including the first image constituent element based on the reference mode and with reference to the appearance attribute information of the second image constituent element reflected in the second feature. Therefore, when adjusting the image feature to be adjusted based on the constraint condition, on the one hand, the image constituent element reflected by the image feature to be adjusted can be made to fit the image constituent element described by the target description text information according to the first image constituent element reflected by the first feature; on the other hand, by making the appearance attribute information corresponding to the image constituent element to be adjusted close to the sample appearance attribute information, the image information generated based on the adjusted image feature to be adjusted can maintain a high degree of consistency with the first reference image information in the dimension of appearance attribute information.

[0156] S20333: Generate image information to be determined based on the adjusted features of the image to be adjusted.

[0157] It can be seen from the above content that, through the adjusted image features to be adjusted, it is possible to generate image information to be determined that not only fits the image constituent elements described by the target description text information, but also has a high consistency with the first reference image information in the dimension of appearance attribute information.

[0158] It can be understood that the content of image information is usually rich and diverse, so the image information may also include multiple image constituent elements. In a possible implementation, the second image constituent elements may include scene constituent elements and object constituent elements. The scene constituent elements are used to generate the scene part in the image information, such as "open air", "beach", "bedroom" and other scene constituent elements; the object constituent elements are used to generate the object part in the image information, such as "cat", "dog", "character", "prop" and other object constituent elements.

[0159] The first reference image may include scene reference image information having the scene constituent elements and object reference image information having the object constituent elements, which are used to refer to the generation of scene constituent elements and object constituent elements of the pending image information, respectively. Based on the above-mentioned method of generating the second feature, the second feature may include a scene reference feature and an object reference feature. Specifically, when generating the second feature according to the first reference image information, the reference description text information corresponding to the first reference image information, and the second identifier, the following steps may be included, wherein steps S20311 to S20312 are a possible implementation method of the above-mentioned step S2031:

[0160] S20311: Generate a scene reference feature according to the scene reference image information, the description text information corresponding to the scene reference image information, the scene identifier and the second identifier.

[0161] In order to enable the initial object model to more accurately refer to the reference image information, the computer device can set corresponding identifiers for each type of image constituent element, and instruct the initial object generation model to refer to the appearance attribute information corresponding to each type of image constituent element based on the identifier. The scene reference feature is used to reflect the scene constituent elements in the reference description text information, and the appearance attribute information corresponding to the scene constituent elements in the first reference image information.

[0162] The scene identifier is used to instruct the initial image generation model to generate scene constituent elements in the pending image information based on the scene reference features, so that the initial image generation model can focus on referring to the appearance attribute information of the scene constituent elements in the appearance attribute information corresponding to the image constituent elements reflected by the scene reference features, and reduce the degree of reference to non-scene image constituent elements.

[0163] S20312: And, generating an object reference feature according to the object reference image information, the description text information corresponding to the object reference image information, the object identifier and the second identifier.

[0164] The object identifier is used to instruct the initial image generation model to generate object constituent elements in the pending image information based on the object reference feature, so that the initial image generation model can focus on referring to the appearance attribute information of the object constituent elements in the appearance attribute information corresponding to the image constituent elements reflected by the object reference feature, and reduce the degree of reference to non-object image constituent elements. The object reference feature is used to reflect the object constituent elements in the reference description text information, and the appearance attribute information of the object constituent elements corresponding to the first reference image information.

[0165] In order to further improve the image generation accuracy of the model, the computer device can set a multi-level feature adjustment process in the initial image generation model to achieve more fine-grained feature adjustment. For example, when the feature to be adjusted is adjusted to obtain the adjusted feature to be adjusted for generating the image information to be determined, N adjustments can be included in the initial image generation model, where N is a positive integer greater than 1.

[0166] The above-mentioned object reference features can be used to adjust the image features to be adjusted for the i-th time, where i is a positive integer not greater than N. It can be understood that, usually in image information, scene constituent elements determine the main visual tone of the image information. Relatively speaking, the influence of object constituent elements on the visual dimension is smaller than that of scene constituent elements. Based on this, for the model, in the process of generating image information, the scene constituent elements in the image information will be learned and generated first. It is a more reasonable and accurate generation method to generate image constituent elements by combining scene constituent elements, and the generated image information is more in line with the image viewing preference in the visual dimension.

[0167] Therefore, in order to strengthen the reference to the appearance attribute information of the scene constituent elements during the image generation process, before generating the object reference features based on the object reference image information, the descriptive text information corresponding to the object reference image information and the object identifier, the computer device can set the features to be used as the basis for each feature adjustment.

[0168] The computer device can preset a positive integer M less than N. In response to i not being greater than M, it means that the feature adjustment is still in a relatively early stage. At this time, the computer device can determine the default text information as the descriptive text information corresponding to the object reference image information. The default text information does not describe any image constituent elements. As mentioned above, the reference method is determined based on the similarity between the image constituent elements described by the target description text information and the reference description text information. Therefore, after using the default text information as the descriptive text information corresponding to the object reference image information, since it does not describe any image constituent elements, there will be no reference to the appearance attribute information in the object reference image information in the reference method. Therefore, in the first M feature adjustments, only the appearance attribute information corresponding to the scene constituent elements can be referenced and adjusted.

[0169] In response to i being greater than M, it indicates that the feature adjustment is already in the middle and late stages of the N feature adjustments. At this time, the computer device can determine the description text information corresponding to the object reference image information in the sample image information set as the description text information corresponding to the object reference image information, that is, the description text information originally corresponding to the object reference image information. At this time, the initial image generation model will refer to both the appearance attribute information corresponding to the scene constituent elements and the appearance attribute information corresponding to the object constituent elements. It can be seen that this setting method can enable the initial object model to preferentially learn and refer to the appearance attribute information of the scene constituent elements, and compared with the object constituent elements, the appearance attribute information of the scene constituent elements has more times and more targeted feature adjustments, so that the scene constituent elements in the generated image information are sufficiently accurate and the overall image quality is improved. Here, the object reference feature can also be directly set to 0, so that the model cannot refer to the appearance attribute information of the object constituent elements based on the object reference feature, which is equivalent to replacing the description text information with 0 (default text information).

[0170] When generating the constraint condition according to the first feature and the second feature, the following steps may be included, wherein step S20321 is a possible implementation of the above step S2032:

[0171] S20321: Generate constraint conditions corresponding to the i-th adjustment based on the first feature, the scene reference feature, and the object reference feature.

[0172] When adjusting the image feature to be adjusted according to the constraint condition, the following steps may be included, wherein step S203321 is a possible implementation of the above step S20332:

[0173] S203321: According to the constraint conditions corresponding to the N adjustments, the image features to be adjusted are adjusted N times to obtain the adjusted image features to be adjusted.

[0174] Among them, for the jth adjustment, the computer device can adjust the image feature to be adjusted after the j-1th adjustment based on the constraint conditions corresponding to the jth adjustment, and obtain the image feature to be adjusted after the jth adjustment, where j is a positive integer greater than 1 and not greater than N. That is, the image feature to be adjusted is adjusted in sequence based on the constraint conditions corresponding to the N adjustments respectively, and the above method ensures the priority reference learning of the appearance attribute information of the scene constituent elements, and increases the reference learning intensity of the appearance attribute information.

[0175] like Figure 4 As shown in the figure, the text feature vector a can be obtained by fusion based on the scene reference image information and the corresponding description text information, and the scene reference feature can be obtained by adding the mode 1 and the scene identifier; the text feature vector b can be obtained by fusion based on the object reference image information and the corresponding description text information, and the scene reference feature can be obtained by adding the mode 1 and the object identifier. Among them, when j is greater than M, the original description text information is used as the description text information corresponding to the object reference image information; when j is not greater than M, the default text information is used as the description text information corresponding to the object reference image information.

[0176] In a possible implementation, the computer device may further divide the reference method for the appearance attribute information of different types of object constituent elements in a more fine-grained manner based on the degree of influence of different types of object constituent elements in the image information. It is understandable that, generally, in image information including human objects, the appearance attribute information of human objects has a greater impact on the image information browsing experience than the appearance attribute information of non-human objects. Therefore, the computer device may perform more accurate and preferential reference learning on human object constituent elements.

[0177] In this implementation, the above-mentioned object constituent elements may include human object constituent elements and non-human object constituent elements, and the object reference image information includes human object reference image information and non-human object reference image information. The human object constituent elements are used to generate the human object part in the image information, such as image constituent elements such as "father" and "mother"; the non-human object constituent elements are used to generate the non-human object part in the image information, such as image constituent elements such as "dog", "cat", and "cup".

[0178] The computer device may preset a P value, where P is a positive integer greater than M and less than N, for distinguishing between the middle part and the late part of the N adjustments.

[0179] In response to i being greater than M, the computer device may determine the descriptive text information corresponding to the character object reference image information in the sample image information set as the descriptive text information corresponding to the character object reference image information, so that the appearance attribute information of the elements constituting the character object can be referenced in the subsequent feature adjustment process.

[0180] In response to i being greater than M but not greater than P, it indicates that the i-th adjustment is in the middle stage of N adjustments. At this time, the computer device can first strengthen the model's reference to the elements that constitute the human object, and reduce the reference to the appearance attribute information of the elements that constitute the non-human object. Similar to the above method, the computer device can determine the default text information as the descriptive text information corresponding to the reference image information of the non-human object, so as to reduce the reference to the appearance attribute information of the elements that constitute the non-human object. It should be emphasized that in this implementation, N is specifically a positive integer greater than 2, so that it can be divided into three adjustment stages: front, middle and back.

[0181] In response to i being greater than P, it means that the i-th adjustment is already in the later part of N adjustments. At this time, the computer device can determine the description text information corresponding to the non-human object reference image information in the sample image information set as the description text information corresponding to the non-human object reference image information, that is, the description text information originally corresponding to the non-human object reference image information, so that the initial image generation model can refer to the appearance attribute information of the non-human object constituent elements. It can be seen from the above process that the present application can refer to the appearance attribute information of the three types of image constituent elements, namely, scene constituent elements, human object constituent elements and non-human object constituent elements, in the order of reference learning degree from large to small and adjustment times from many to few, so that the generated image information has accurate expression of image constituent elements and fits the actual image browsing habits.

[0182] See also Figure 5 Based on the reference image information of the human object and the corresponding description text information, a text feature vector b1 can be obtained by fusion, and the human scene reference feature can be obtained by adding the modality 1 and the human object identifier; based on the reference image information of the non-human object and the corresponding description text information, a text feature vector b2 can be obtained by fusion, and the non-human scene reference feature can be obtained by adding the modality 1 and the non-human object identifier. The human object identifier is used to instruct the initial image generation model to generate the human object constituent elements in the pending image information based on the human object reference features, and the non-human object identifier is used to instruct the initial image generation model to generate the non-human object constituent elements in the pending image information based on the non-human object reference features.

[0183] When j is greater than M, the original description text information is used as the description text information corresponding to the reference image information of the person object; when j is not greater than M, the default text information is used as the description text information corresponding to the reference image information of the person object. When j is greater than P, the original description text information is used as the description text information corresponding to the reference image information of the non-person object; when j is not greater than P, the default text information is used as the description text information corresponding to the reference image information of the non-person object.

[0184] There may be multiple types of models that can be used as the above-mentioned image generation model. In a possible implementation, in order to ensure the accuracy of image generation, the computer device may use a model including a multi-head attention mechanism (cross attion) to adjust the image features to be adjusted.

[0185] The three key information in the attention mechanism model are query information, address information (key) and value information (value). The attention mechanism can be regarded as a soft addressing (Soft Addressing). The elements are composed of address information and value information. Currently there is a query with Key = Query, the purpose is to retrieve the corresponding value information in the memory, and the retrieved value information is the attention information.

[0186] In combination with the relevant parameters in the present application, when adjusting the image features to be adjusted after the j-1th adjustment based on the constraints corresponding to the j-th adjustment to obtain the image features to be adjusted after the j-1th adjustment, the computer device can determine the query information corresponding to the attention adjustment mechanism in the j-th adjustment based on the image features to be adjusted after the j-1th adjustment, and determine the constraints corresponding to the j-th adjustment as the address information and value information corresponding to the attention adjustment mechanism in the j-th adjustment. Through this information setting method, when the model is adjusted based on the attention mechanism, the image features to be adjusted as the query information can continuously approach the features constrained by the constraints. For example, as mentioned above, the image information to be adjusted may include multiple image constituent elements to be adjusted, and in the attention mechanism, the value information is processed based on the similarity between the query information and the address information to generate attention information, and then the features to be adjusted are adjusted based on the attention information. Therefore, through the similarity, the image constituent elements corresponding to the constraints in the image features to be adjusted (that is, the image constituent elements described in the target description text information) can be highlighted, and at the same time, the reference learning of this part of the image constituent elements on the appearance attribute information can be highlighted, and the image constituent elements without constraints in the constraints (that is, the image constituent elements not described in the target description text information) can be downplayed, and finally image information that meets the requirements can be obtained.

[0187] Based on this, through the initial image generation model, the attention information corresponding to the attention adjustment mechanism in the jth adjustment can be determined based on the query information, address information and value information corresponding to the attention adjustment mechanism in the jth adjustment, and then the image features to be adjusted after the j-1th adjustment are adjusted based on the attention information to obtain the image features to be adjusted after the jth adjustment.

[0188] See also Figure 6 , Figure 6 A possible initial image generation model architecture is shown. The model adopts the semantic segmentation network (U-Net) architecture. The model will first randomly generate noise image information x as the overall input, and obtain the latent space representation through the encoder. The latent space representation can reflect the image characteristics of the noise image information. The latent space representation of x at time T (i.e., the image feature to be adjusted) is obtained by sampling the latent space diffusion model. This representation is predicted by the denoising UN et module (the denoising process of the denoising module is constrained by constraints) to predict the latent space representation at time T-1. Among them, the latent space representation at time T is the feature to be adjusted for the first feature adjustment, the latent space representation at time T-1 is the feature to be adjusted during the second feature adjustment, and so on. The feature denoising operation is the above-mentioned feature adjustment operation.

[0189] The latent space representation at time T-1 is continuously input to the input of U-Net to predict the representation at time T-2, and so on, to complete T-step predictions, and obtain the representation prediction at time T=0, which is the feature to be adjusted after T times of feature adjustment. The representation is passed through the decoder to obtain the generated image information.

[0190] Depend on Figure 6 It can be seen that in the T steps of denoising and restoration, the initial step (stage 1) is mainly used to determine the scene constituent elements of the generated image. Once the scene style is initially revealed, the subsequent steps (stages 2 and 3) mainly adjust the object constituent elements in the image to meet the needs of describing text information. The fine-tuning of the final output effect of the image is in the steps of stages 2 and 3. Combined with experience, the computer device can use the above-mentioned feature information generation method to integrate the scene reference image information for reference in stage 1 (such as the first T / 3 denoising steps), and in stage 2 (such as the middle T / 3 denoising steps), on the basis of the scene reference image information, integrate the human object reference image information for reference, and in stage 3 (such as the last T / 3 denoising steps), on the basis of the above image information, integrate the non-human object reference image information for reference.

[0191] For each model structure used for noise reduction and restoration in U-Net, constraints can be added to the network in the form of a multi-head attention mechanism. In this solution, in order to allow the constraints that incorporate scene reference image information, person object reference image information, and non-person object reference image information to act on the noise reduction and restoration process, the key and value can be input using constraints, and the query still uses U-Net input (i.e., the latent control representation encoded by the encoder), such as Figure 7 As shown in the figure, the three are projected with dimension consistency to make their feature dimensions the same. The attention information in the multi-head attention mechanism is obtained based on the three features, and then conventional multi-head attention learning is performed.

[0192] Among them, for this model architecture, the generation process of the constraint conditions can be as follows. In stage 1, for the scene reference image information, the scene reference image information and the corresponding description text information are used for image-text fusion to obtain a text vector with scene reference image information constraints (i.e., the above-mentioned text feature vector a, with a vector dimension of 1x1x768), which is vector-added with modality 1 (vector dimension of 1x1x768) and image type information 2 (i.e., scene identifier, a matrix with a dimension of 1x1x768) to obtain scene reference features (vector dimension of 1x1x768). Similarly, character object reference features and non-character object reference features can be obtained, where modality 0 is a vector with a dimension of 1x1x768, and the character object identifier is image type information 1, which is a full 1 matrix with a dimension of 1x1x768, and so on. Since the vector value ranges from 0 to 1, after different biases (such as adding a bias of 1), the three types of image type information are distinguishable for the network.

[0193] In stage 1, the text vector with the reference image information constraint of the human object and the text vector with the reference image information constraint of the non-human object can be set to 0, so that the corresponding description text information becomes the default text information that is not used to describe any image constituent elements. When entering stage 2 (if there are 90 steps of denoising and restoration in total, then the 31st step of restoration), the scene reference image information + the human object reference image information is used as the text constraint. At this time, it is only necessary to set the text vector with the reference image information constraint of the non-human object to 0; when entering stage 3 (if there are 90 steps of denoising and restoration in total, then the 61st step of denoising and restoration), the scene + human object + non-human object is used to generate the constraint condition and input it into U-Net.

[0194] Among them, the fusion of graphic and text information can be adopted Figure 8The image-grounded text encoder (IGTE) shown in the figure is executed, the image information is input into the vision transformer (ViT) part in the IGTE, and the text information is input into the bootstrapping language-image pre-training model (BLIP) part in the IGTE, and a text vector with image information constraints can be output. In the present application, the vector is a descriptive text vector with appearance attribute information reflected by the reference image information, and the appearance attribute information corresponding to each image constituent element in the reference image information can be reflected through the vector.

[0195] The loss of the model can be calculated using the mean square error (MSE) loss, which is calculated by the difference between the target sample image information and the pending image information at each pixel. The formula is as follows: Where y is the pixel value of each point in the image. i represents the pixel in the target sample image information, The pixel representing the pending image information, n is the number of pixels.

[0196]

[0197] As mentioned above, the key to model training lies in multiple sample image information that is consistent in the dimension of appearance attribute information. It is understandable that, usually, the scenes, human objects, and non-human objects in the video are coherent and unified. Therefore, in multiple video frame image information of the same video, the same image constituent elements usually have relatively consistent appearance attribute information. For example, the cats that appear in the same video are usually the same cat. And because there are rich camera positions in the video, multiple video frame image information of the same video can have appearance attribute information corresponding to image constituent elements at multiple angles. Using this video frame image information for model training can enable the model to accurately generate image constituent elements at multiple angles.

[0198] Based on this, in a possible implementation, the computer device can obtain a sample image information set by processing the video. The sample image information set is specifically generated in the following manner:

[0199] First, the computer device can obtain the video to be processed, and then determine multiple video frame image information corresponding to the video to be processed, and the multiple video frame image information meets the following conditions: the difference between the appearance attribute information corresponding to the same image constituent elements in the multiple video frame image information is less than the above-mentioned first preset threshold.

[0200] The multiple video frame image information have corresponding descriptive text information and video frame identifiers respectively. The video frame identifier is used to identify the corresponding time sequence of the video frame image information in the multiple video frame image information. That is, through the video frame identifier, it is possible to know what the order of each video frame image information in the video time dimension is. The computer device can determine the multiple video frame image information as multiple sample image information in a sample image information set to generate a sample image information set.

[0201] It can be understood that the closer the two video frame image information are in video time, generally, the smaller the change of the image constituent elements in the two video frame image information is, and the higher the consistency of the appearance attribute information corresponding to the same image constituent elements in the two video frame image information is. Therefore, in order to further improve the model training accuracy and strengthen the model's reference learning ability for appearance attribute information, when determining the first reference image information corresponding to the target image information from multiple sample image information, the following steps can be included, wherein steps S2021 to S2022 are a possible implementation of the above step S202:

[0202] S2021: Determine, among multiple sample image information, multiple pending sample image information including target image constituent elements.

[0203] S2022: Determine the pending sample image information that is closest to the target image information in time sequence among the multiple pending sample image information as the first reference image information according to the video frame identifier corresponding to the target image information and the video frame identifiers corresponding to the multiple pending sample image information.

[0204] The target image information can be any one of multiple video frame image information. Through the time sequence in the video identified by the video frame identifier, the computer device can determine the first reference image information that is closest in time sequence, thereby obtaining reference image information with higher consistency for reference of appearance attribute information.

[0205] Among them, in order to improve the training efficiency and the effectiveness of training samples, the computer device can remove images with too high similarity on the image screen when generating a set of sample image information, so that the model can be trained based on samples with consistent appearance attributes but diverse specific expressions of image constituent elements in the image information, so that the model can meet the needs of various text information to be generated on the image screen.

[0206] When determining multiple video frame image information corresponding to the video to be processed, the computer device may first obtain multiple initial video frame image information corresponding to the video to be processed, and the initial video frame image information is all video frame image information corresponding to the video.

[0207] The computer device can determine multiple video frame image information from multiple initial video frame image information based on the similarity between the video frame image information. The similarity between any two video frame image information among the multiple video frame image information is greater than a second preset threshold, that is, there will be no situation where the two video frame image information are too similar. The second preset threshold is used to judge whether the similarity between the image information is too high.

[0208] For example, Fig. 9 As shown, Fig. 9 A flowchart for generating a sample image information set is provided in an embodiment of the present application, and the flowchart includes:

[0209] S901: Obtain the video to be processed.

[0210] The computer device first obtains a video to be processed, which may be, for example, a film or TV series video, a documentary video, or the like.

[0211] S902: extract video frames.

[0212] The computer device extracts frames from the video to be processed, and the frame extraction interval can be adjusted as needed, such as extracting 1 frame per second, 1 frame every 2 seconds, etc., to obtain initial video frame image information.

[0213] S903: Classify the video frame object information.

[0214] The storyboard corresponds to the lens position corresponding to the video frame image information, and one lens position corresponds to one storyboard. Since in a video, the video frame image information under one storyboard usually has a high degree of similarity, the computer device can only retain one video frame image information for multiple video frame image information corresponding to one storyboard.

[0215] S904: De-duplicate the video storyboards.

[0216] De-duplicate storyboards and remove video frame image information with little change in image information content.

[0217] S905: Annotate description text information.

[0218] The computer device can add corresponding description text information to each video frame image information to describe the image elements included in the image information. At the same time, since the storyboard appears once in the video, the storyboard mark used to identify the storyboard can be used as a timing mark to reflect the timing relationship of the video frame image information.

[0219] Based on the model training method provided in the above embodiment, this application also provides a model application method, see Fig.10 , Fig.10 A flowchart of a model application method provided in an embodiment of the present application, the method comprising:

[0220] S1001: Obtain text information to be generated.

[0221] The text information to be generated can be any text information that needs to be used to generate image information. Of course, in order to generate image information, the text information to be generated should describe image constituent elements.

[0222] S1002: Determine reference image information corresponding to the text information to be generated according to target image constituent elements described by the text information to be generated.

[0223] In order to obtain image information that is relatively consistent in appearance attribute information, when the model generates image information based on the image constituent elements described in the image information to be generated, reference image information for referencing the appearance attribute information can be provided to the model, and the reference image information includes target image constituent elements. It should be emphasized that the target image constituent element can be any one or more image constituent elements described in the text information to be generated, that is, each image constituent element described in the text information to be generated can have its corresponding reference image information.

[0224] The reference image information has corresponding description text information, and the description text information is used to describe the image constituent elements included in the image information.

[0225] The judgment of the image constituent elements described by the text information to be generated may be obtained through various methods such as recognizing the text, which is not limited here.

[0226] S1003: Generate target image information corresponding to the text information to be generated through an image generation model according to the text information to be generated, the reference image information and the description text information corresponding to the reference image information.

[0227] Since the target image information is generated by the image generation model based on the image constituent elements described by the text information to be generated, the target image information includes all the image constituent elements described by the text information to be generated, including the target image constituent elements. From the above model training process, it can be seen that the appearance attribute information corresponding to the target image constituent elements in the target image information is determined by the image generation model based on the reference method and the appearance attribute information corresponding to the image constituent elements in the reference image information, and the reference method is determined based on the similarity between the image constituent elements described by the description text information corresponding to the text information to be generated and the reference image information.

[0228] It is understandable that when multiple image information needs to be generated for multiple image information to be generated, the adjacent generated image information is usually generated for image constituent elements that are relatively consistent in appearance attribute information. For example, in a novel, there may be a variety of "character" image constituent elements described. When generating image information for the novel, the generation order is usually the order of the novel's text. Therefore, the text information corresponding to the adjacent generated image information has a closer contextual relevance, and the "character" in the image information is likely to be the same "character", so the appearance attribute information should be relatively consistent.

[0229] Based on this, in a possible implementation, when determining the reference image information corresponding to the text information to be generated according to the target image constituent elements described in the text information to be generated, the following steps may be included:

[0230] S10021: According to the time sequence identifiers respectively corresponding to the multiple generated image information corresponding to the target image constituent elements in the generated image information set, the generated image information with the shortest generated time among the multiple generated image information is determined as the reference image information.

[0231] Among them, the timing identifier is used to identify the time sequence between the generation moments of multiple image information. The multiple generated image information corresponding to the target image constituent elements are generated image information that all have the target image constituent elements. The descriptive text information corresponding to the reference image information with the shortest generation time is the text information that is more closely contextually related to the text information to be generated. Therefore, the target image constituent elements described in the text information to be generated and the target image constituent elements in the reference image information usually have a high consistency in appearance attribute information. Therefore, referring to the appearance attribute information of the target image constituent elements in the reference image information can generate more accurate and reasonable target image information.

[0232] Similarly, after generating the target image information, the computer device can generate a target timing mark corresponding to the target image information according to the generation time of the target image information, and the target timing mark is used to identify the time sequence of the generation time of the target image information between the generation times of multiple generated image information. Since the target image information is generated based on the image constituent elements described by the text information to be generated, the text information to be generated can be used to describe the image constituent elements included in the target image information. At the same time, since the target image information includes the target image constituent elements, the computer device can determine the target image information as the generated image information corresponding to the target image constituent elements, bind it with the target timing mark and store it in the generated image information set, and the text information to be generated is the description text information corresponding to the target image information, so that when the image information corresponding to the text information describing the target image constituent elements is generated later, the target image information can be used as reference image information for reference. At the same time, by storing the image information based on the corresponding image constituent elements, it is convenient for the computer device to quickly find the image information for reference, thereby improving the efficiency of image information generation.

[0233] Not all image constituent elements necessarily have corresponding generated image information. For example, when generating image information for the first paragraph of text information of a novel, since image information has not been generated before, there is no generated image information for reference. In a possible implementation, a relevant person or computer device can analyze the requirements for the text information to be generated and set corresponding default image information for it, and the default image information includes the target image constituent element.

[0234] When determining the reference image information corresponding to the text information to be generated according to the target image constituent element described in the text information to be generated, in response to the absence of the generated image information corresponding to the target image constituent element in the generated image information set, the computer device may determine the default image information corresponding to the target image constituent element as the reference image information. Since after the target image information is generated based on the default image information, the target image information becomes the reference image information with the shortest generated time corresponding to the target image constituent element, and serves as a reference for the next generation of image information including the target image constituent element in terms of appearance attribute information, it can be seen that by setting the default image information, the appearance attribute information of the target image constituent element in a series of image information generated subsequently can be determined, so that the consistency of the appearance attribute information can be flexibly adjusted by setting the default image information, thereby improving the degree of freedom of image information generation.

[0235] In order to facilitate understanding of the technical solution provided in the embodiment of the present application, a model application method provided in the embodiment of the present application will be introduced below in combination with an actual application scenario.

[0236] See also Fig.11 , Fig.11 A schematic diagram of a model application method in an actual application scenario provided by an embodiment of the present application. First, a computer device can archive the generated image information, and the generated image information can include image information 1, image information 2, and image information 3, etc., which are generated by the image information generation model based on text information 1, text information 2, and text information 3, respectively.

[0237] Information archiving methods such as Fig.12 As shown, based on identifying the image information or performing text analysis on the corresponding descriptive text information, the image constituent elements included in the image information can be determined, and the generated image information can be stored based on the included image constituent elements, wherein the types of image constituent elements can be mainly divided into scene constituent elements, character object constituent elements and non-character object constituent elements.

[0238] After acquiring new text information to be generated (ie, text information 4), the computer device will first determine whether the image constituent element described by the text information 4 is a new image constituent element, that is, whether there is corresponding generated image information in the generated image information set.

[0239] If so, then obtain the generated image information with the shortest generation time corresponding to the image constituent element, use the generated image information as a reference, and input it together with the text information 4 into the image information generation model to generate image information 4 corresponding to the text information 4; if not, obtain the default image information corresponding to the image constituent element, use the default image information as a reference, and input it together with the text information 4 into the image information generation model to generate image information 4 corresponding to the text information 4, and finally archive the image information 4.

[0240] Therefore, in this way, when generating image information based on a series of text information, based on the connection between the context information, reasonable reference can be made to the appearance attribute elements in the generated image information to ensure that the text information with close contextual connection has a high consistency in the appearance attribute information of the image constituent elements, thereby improving the browsing experience of image viewers.

[0241] Similarly, when the model training generates a sample image information set, the computer device can also archive the information in the above manner. For example, when the sample image information set is generated based on a video, the sample image information set can retain 120 historical video frame image information, and the image information that is the most advanced in time sequence can be deleted after the new image information is added. For example, taking the storyboard id as a reference, since one storyboard only retains one video frame image information, the video frame image information with the smallest storyboard id is the image information with the largest time interval with the newly added video frame image information.

[0242] At the same time, for the newly generated video frame image information, the computer device can extract entity words based on the description text information to obtain three entity words corresponding to human objects, scenes, and non-human objects (not necessarily all appear, and may be any combination of the three), thereby determining the three types of image constituent elements included in the video frame image information. The computer device can search for the generated video frame image information set according to the image constituent elements, and when the image constituent element exists in the set, the image information and the storyboard id to which it belongs are associated with the image constituent element in the inventory.

[0243] When a certain image composition element does not exist, a new image composition element is added under the image composition element type, and the new image information and the corresponding storyboard ID are stored under the image composition element.

[0244] In addition, since each video will generate a lot of descriptive text information and video frame image information, if only the training samples generated by one video are learned each time during training, it is easy to make the model generation biased, such as remembering the specific image style corresponding to a certain video, resulting in a certain degree of overfitting. Therefore, before training, the computer device can construct a sample image information set for each video separately. In subsequent training, each time an image information is generated, the image information is updated to the sample image information set of the video to which it belongs. During training, the computer device can randomly extract multiple videos from all videos each time it generates, and randomly extract 5 sample image information from each video as the target sample image information for training. After the image information is generated, the newly generated image information is archived in the sample image information set of the corresponding video, so that it can be achieved during iterative training, and multiple videos can be integrated for mixed training to improve the effectiveness of training.

[0245] Based on the model training method provided in the above embodiment, the present application embodiment also provides a model training device, see Fig.13 , Fig.13 A structural block diagram of a model training device 1300 provided in an embodiment of the present application, the device includes a first acquisition unit 1301, a first determination unit 1302, a generation unit 1303 and an adjustment unit 1304:

[0246] The first acquisition unit 1301 is used to acquire a sample image information set, the sample image information set includes a plurality of sample image information, the plurality of sample image information respectively includes image constituent elements, the difference between the appearance attribute information corresponding to the same image constituent element in the plurality of sample image information is less than a first preset threshold, the plurality of sample image information has respectively corresponding description text information, the description text information is used to describe the image constituent elements included in the image information;

[0247] The first determining unit 1302 is configured to determine first reference image information corresponding to target image information from the plurality of sample image information, wherein the target image information is any one of the plurality of sample image information, and both the target image information and the first reference image information include target image constituent elements;

[0248] The generating unit 1303 is used to obtain the pending image information according to the first reference image information, the target description text information corresponding to the target image information and the reference description text information corresponding to the first reference image information through an initial image generating model, wherein the initial image generating model is used to determine, based on the similarity between the image constituent elements respectively described by the target description text information and the reference description text information, a reference method for the appearance attribute information of the image constituent information in the first reference image information when generating the image information based on the image constituent elements described by the target description text information;

[0249] The adjustment unit 1304 is used to adjust the model parameters of the initial image generation model according to the difference between the target image information and the image information to be determined, so as to obtain an image generation model. The image generation model is used to generate image information corresponding to the text information to be generated according to the text information to be generated, the second reference image information corresponding to the text information to be generated, and the descriptive text information corresponding to the second reference image information.

[0250] In a possible implementation, the generating unit 1303 is specifically configured to:

[0251] generating a first feature according to the target description text information and the first identifier, and generating a second feature according to the first reference image information, the reference description text information corresponding to the first reference image information, and the second identifier, wherein the first feature is used to reflect a first image constituent element described by the target description text information, and the second feature is used to reflect a second image constituent element described by the reference description text information, and appearance attribute information corresponding to the second image constituent element in the first reference image information;

[0252] The first identifier is used to instruct the initial image generation model to generate image information based on the image constituent elements embodied by the first feature, and the second identifier is used to instruct the initial image generation model to determine a reference method for the appearance attribute information embodied by the second feature when generating image information based on the similarity between the image constituent elements of the first image constituent elements and the second image constituent elements;

[0253] Generate a constraint condition according to the first feature and the second feature, wherein the constraint condition is used to constrain the initial image generation model to generate the pending image information including the first image constituent element based on the reference mode and with reference to the appearance attribute information of the second image constituent element reflected in the second feature;

[0254] The pending image information is generated according to the constraint condition.

[0255] In a possible implementation, the generating unit 1303 is specifically configured to:

[0256] Acquire features of the image to be adjusted, where the features of the image to be adjusted are used to identify image constituent elements to be adjusted in the image information to be adjusted, and appearance attribute information corresponding to the image constituent elements to be adjusted;

[0257] adjusting the image feature to be adjusted according to the constraint condition, so that the plurality of image constituent elements to be adjusted identified by the image feature to be adjusted and the appearance attribute information respectively corresponding to the plurality of image constituent elements to be adjusted are close to the first image constituent element and the sample appearance attribute information corresponding to the first image constituent element, the sample appearance attribute information being determined based on the reference mode and the appearance attribute information embodied by the second image constituent element in the second feature;

[0258] The to-be-determined image information is generated according to the adjusted to-be-adjusted image features.

[0259] In a possible implementation manner, the second image constituent elements include scene constituent elements and object constituent elements, the scene constituent elements are used to generate a scene portion in the image information, the object constituent elements are used to generate an object portion in the image information, and the first reference image information includes scene reference image information having the scene constituent elements and object reference image information having the object constituent elements;

[0260] The second feature includes a scene reference feature and an object reference feature, and the generating unit 1303 is specifically used for:

[0261] Generate a scene reference feature according to the scene reference image information, the description text information corresponding to the scene reference image information, the scene identifier and the second identifier, wherein the scene identifier is used to instruct the initial image generation model to generate a scene constituent element in the pending image information based on the scene reference feature;

[0262] And, based on the object reference image information, the descriptive text information corresponding to the object reference image information, the object identifier and the second identifier, an object reference feature is generated, and the scene identifier is used to instruct the initial image generation model to generate the object constituent elements in the pending image information based on the object reference feature.

[0263] In a possible implementation, the object reference feature is used to perform an i-th adjustment on the image feature to be adjusted, where i is a positive integer not greater than N. Before generating the object reference feature according to the object reference image information, the descriptive text information corresponding to the object reference image information, and the object identifier, the device further includes a second determining unit and a third determining unit:

[0264] The second determining unit is used to determine the default text information as the description text information corresponding to the object reference image information in response to i not being greater than M, the default text information not describing any image constituent elements, M being a positive integer less than N, and N being a positive integer greater than 1;

[0265] The third determining unit is configured to determine, in response to i being greater than M, the description text information corresponding to the object reference image information in the sample image information set as the description text information corresponding to the object reference image information;

[0266] The generating unit 1303 is specifically used for:

[0267] generating a constraint condition corresponding to the i-th adjustment according to the first feature, the scene reference feature and the object reference feature;

[0268] According to the constraint conditions corresponding to the N adjustments, the image feature to be adjusted is adjusted N times to obtain the adjusted image feature to be adjusted;

[0269] Among them, for the j-th adjustment, based on the constraint conditions corresponding to the j-th adjustment, the image features to be adjusted after the j-1-th adjustment are adjusted to obtain the image features to be adjusted after the j-th adjustment, where j is a positive integer greater than 1 and not greater than N.

[0270] In a possible implementation manner, the object constituent elements include human object constituent elements and non-human object constituent elements, the object reference image information includes human object reference image information and non-human object reference image information, and the second determining unit is specifically configured to:

[0271] In response to i being greater than M, determining the description text information corresponding to the character object reference image information in the sample image information set as the description text information corresponding to the character object reference image information;

[0272] In response to i being greater than M but not greater than P, determining the default text information as the description text information corresponding to the non-human object reference image information, where P is a positive integer greater than M and less than N, and N is specifically a positive integer greater than 2;

[0273] In response to i being greater than P, the description text information corresponding to the non-human object reference image information in the sample image information set is determined as the description text information corresponding to the non-human object reference image information.

[0274] In a possible implementation manner, the sample image information set is generated in the following manner:

[0275] Get the video to be processed;

[0276] Determine a plurality of video frame image information corresponding to the video to be processed, the difference between the appearance attribute information corresponding to the same image constituent element in the plurality of video frame image information is less than the first preset threshold, the plurality of video frame image information has respectively corresponding description text information and video frame identifiers, and the video frame identifier is used to identify the time sequence of the video frame image information in the plurality of video frame image information;

[0277] Determine the plurality of video frame image information as a plurality of sample image information in the sample image information set, and generate the sample image information set;

[0278] The first determining unit 1302 is specifically configured to:

[0279] Determine, among the plurality of sample image information, a plurality of pending sample image information including the target image constituent elements;

[0280] According to the video frame identifier corresponding to the target image information and the video frame identifiers respectively corresponding to the multiple pending sample image information, the pending sample image information that is closest to the target image information in time sequence among the multiple pending sample image information is determined as the first reference image information.

[0281] In a possible implementation manner, determining a plurality of video frame image information corresponding to the video to be processed includes:

[0282] Acquire multiple initial video frame image information corresponding to the video to be processed;

[0283] The multiple video frame image information are determined from the multiple initial video frame image information, and the similarity between any two video frame image information in the multiple video frame image information is greater than a second preset threshold.

[0284] In a possible implementation, the generating unit 1303 is specifically configured to:

[0285] Determine query information corresponding to the attention adjustment mechanism in the j-th adjustment according to the features of the image to be adjusted after the j-1-th adjustment, and determine the constraint condition corresponding to the j-th adjustment as the address information and value information corresponding to the attention adjustment mechanism in the j-th adjustment;

[0286] Determining attention information corresponding to the attention adjustment mechanism in the j-th adjustment based on the query information, address information, and value information corresponding to the attention adjustment mechanism in the j-th adjustment;

[0287] The image feature to be adjusted after the j-1th adjustment is adjusted based on the attention information to obtain the image feature to be adjusted after the jth adjustment.

[0288] In a possible implementation manner, the reference manner is used to identify a reference object and a reference degree, and the generating unit 1303 is specifically used to:

[0289] Based on the similarity between the image constituent elements respectively described in the target description text information and the reference description text information, determining the image constituent element to be referenced corresponding to the image constituent element to be generated in the image constituent elements described in the reference description text information, the target similarity between the text information respectively corresponding to the image constituent element to be generated and the image constituent element to be referenced is greater than a third preset threshold, and the image constituent element to be generated is any one of the target image constituent elements;

[0290] Taking the reference image constituent element as a reference object and the target similarity as a reference degree, processing the appearance attribute information corresponding to the reference object in the first reference image information according to the reference degree, and generating the appearance attribute information corresponding to the image constituent element to be generated in the pending image information;

[0291] The pending image information is generated according to the appearance attribute information corresponding to the target image constituent elements in the pending image information.

[0292] Based on the model application method provided in the above embodiment, the present application embodiment also provides a model application device, see Fig.14 , Fig.14 A structural block diagram of a model application device 1400 provided in an embodiment of the present application, the device includes a second acquisition unit 1401, a determination unit 1402 and a first generation unit 1403:

[0293] The second acquisition unit 1401 is used to acquire the text information to be generated;

[0294] The determining unit 1402 is used to determine the reference image information corresponding to the text information to be generated according to the target image constituent elements described by the text information to be generated, the reference image information includes the target image constituent elements, the reference image information has corresponding description text information, and the description text information is used to describe the image constituent elements included in the image information;

[0295] The first generation unit 1403 is used to generate target image information corresponding to the text information to be generated through an image generation model according to the text information to be generated, the reference image information and the descriptive text information corresponding to the reference image information, wherein the target image information includes the target image constituent elements, and the appearance attribute information corresponding to the target image constituent elements in the target image information is determined by the image generation model according to a reference method and the appearance attribute information corresponding to the image constituent elements in the reference image information, and the reference method is determined according to the similarity between the image constituent elements respectively described by the text information to be generated and the descriptive text information corresponding to the reference image information.

[0296] In a possible implementation manner, the determining unit 1402 is specifically configured to:

[0297] According to the time sequence identifiers respectively corresponding to the multiple generated image information corresponding to the target image constituent elements in the generated image information set, the generated image information with the shortest generated time among the multiple generated image information is determined as the reference image information, wherein the time sequence identifier is used to identify the time sequence between the generation moments of the multiple image information;

[0298] The device also includes a second generating unit and a storage unit:

[0299] The second generating unit is used to generate a target timing identifier corresponding to the target image information according to the generation time of the target image information;

[0300] The storage unit is used to determine the target image information as the generated image information corresponding to the target image constituent elements, bind it with the target timing identifier and store it in the generated image information set, and the text information to be generated is the descriptive text information corresponding to the target image information.

[0301] In a possible implementation manner, the determining unit 1402 is specifically configured to:

[0302] In response to the absence of generated image information corresponding to the target image constituent element in the generated image information set, default image information corresponding to the target image constituent element is determined as the reference image information.

[0303] The present application also provides a computer device, which is described below in conjunction with the accompanying drawings. Fig.15 As shown, the embodiment of the present application provides a computer device, taking the terminal device as a mobile phone as an example:

[0304] Fig.15 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Fig.15 The mobile phone includes: a radio frequency (RF) circuit 710, a memory 720, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a wireless fidelity (WiFi) module 770, a processor 780, and a power supply 790. Those skilled in the art will understand that Fig.15 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0305] Combine the following Fig.15 A detailed introduction to the various components of the mobile phone:

[0306] The RF circuit 710 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 780 for processing; in addition, the designed uplink data is sent to the base station. Usually, the RF circuit 710 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, referred to as LNA), a duplexer, etc. In addition, the RF circuit 710 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0307] The memory 720 can be used to store software programs and modules. The processor 780 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 720. The memory 720 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 720 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0308] The input unit 730 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732. The touch panel 731, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 731 or near the touch panel 731 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 731 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 780, and can receive and execute commands sent by the processor 780. In addition, the touch panel 731 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 731, the input unit 730 may also include other input devices 732. Specifically, the other input devices 732 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.

[0309] The display unit 740 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 740 may include a display panel 741. Optionally, the display panel 741 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc. Further, the touch panel 731 may cover the display panel 741. When the touch panel 731 detects a touch operation on or near it, it is transmitted to the processor 780 to determine the type of touch event. Subsequently, the processor 780 provides a corresponding visual output on the display panel 741 according to the type of touch event. Although in Fig.15 In the embodiment, the touch panel 731 and the display panel 741 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 731 and the display panel 741 can be integrated to realize the input and output functions of the mobile phone.

[0310] The mobile phone may also include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 741 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 741 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0311] The audio circuit 760, the speaker 761, and the microphone 762 can provide an audio interface between the user and the mobile phone. The audio circuit 760 can transmit the received audio data to the speaker 761 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 762 converts the collected sound signal into an electrical signal, which is received by the audio circuit 760 and converted into audio data, and then the audio data is output to the processor 780 for processing, and then sent to another mobile phone through the RF circuit 710, or the audio data is output to the memory 720 for further processing.

[0312] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 770. It provides users with wireless broadband Internet access. Fig.15 A WiFi module 770 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.

[0313] The processor 780 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 720, and calling data stored in the memory 720, it executes various functions of the mobile phone and processes data, thereby performing overall detection of the mobile phone. Optionally, the processor 780 may include one or more processing units; preferably, the processor 780 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 780.

[0314] The mobile phone also includes a power supply 790 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 780 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions.

[0315] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0316] In this embodiment, the processor 780 included in the terminal device also has the following functions:

[0317] Acquire a sample image information set, the sample image information set comprising a plurality of sample image information, the plurality of sample image information respectively comprising image constituent elements, the difference between the appearance attribute information corresponding to the same image constituent element in the plurality of sample image information being less than a first preset threshold, the plurality of sample image information having respectively corresponding description text information, the description text information being used to describe the image constituent elements included in the image information;

[0318] Determine first reference image information corresponding to target image information from the plurality of sample image information, the target image information is any one of the plurality of sample image information, and both the target image information and the first reference image information include target image constituent elements;

[0319] Obtaining undetermined image information according to the first reference image information, target description text information corresponding to the target image information, and reference description text information corresponding to the first reference image information through an initial image generation model, wherein the initial image generation model is used to determine, based on similarities between image constituent elements respectively described by the target description text information and the reference description text information, a reference method for the appearance attribute information of the image constituent information in the first reference image information when generating image information based on the image constituent elements described by the target description text information;

[0320] The model parameters of the initial image generation model are adjusted according to the difference between the target image information and the image information to be determined to obtain an image generation model, wherein the image generation model is used to generate image information corresponding to the text information to be generated according to the text information to be generated, the second reference image information corresponding to the text information to be generated, and the descriptive text information corresponding to the second reference image information.

[0321] Or with the following functionality:

[0322] Get the text information to be generated;

[0323] Determine reference image information corresponding to the text information to be generated according to the target image constituent elements described by the text information to be generated, wherein the reference image information includes the target image constituent elements and has corresponding description text information, and the description text information is used to describe the image constituent elements included in the image information;

[0324] Through an image generation model, target image information corresponding to the text information to be generated is generated according to the text information to be generated, the reference image information and the descriptive text information corresponding to the reference image information, wherein the target image information includes the target image constituent elements, and the appearance attribute information corresponding to the target image constituent elements in the target image information is determined by the image generation model according to a reference method and the appearance attribute information corresponding to the image constituent elements in the reference image information, and the reference method is determined according to the similarity between the image constituent elements respectively described by the text information to be generated and the descriptive text information corresponding to the reference image information.

[0325] The computer device provided in the embodiment of the present application may also be a server. Fig.16 As shown, Fig.16 The structural diagram of the server 800 provided in the embodiment of the present application, the server 800 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 822 (for example, one or more processors) and a memory 832, and one or more storage media 830 (for example, one or more mass storage devices) storing application programs 842 or data 844. Among them, the memory 832 and the storage medium 830 can be temporary storage or permanent storage. The program stored in the storage medium 830 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 822 can be configured to communicate with the storage medium 830 and execute a series of instruction operations in the storage medium 830 on the server 800.

[0326] The server 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input and output interfaces 858, and / or one or more operating systems 841, such as Windows Server 2000. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.

[0327] The steps performed by the server in the above embodiment can be based on Fig.16 The server structure shown.

[0328] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, which is used to execute any implementation of the model training method or model application method described in the aforementioned embodiments.

[0329] An embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the model training method or model application method described in any one of the above embodiments.

[0330] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store computer programs.

[0331] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0332] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A model training method, characterized in that: The method comprises: Acquire a sample image information set, the sample image information set comprising a plurality of sample image information, the plurality of sample image information respectively comprising image constituent elements, the difference between the appearance attribute information corresponding to the same image constituent element in the plurality of sample image information being less than a first preset threshold, the plurality of sample image information having respectively corresponding description text information, the description text information being used to describe the image constituent elements included in the image information; Determine first reference image information corresponding to target image information from the plurality of sample image information, the target image information is any one of the plurality of sample image information, and both the target image information and the first reference image information include target image constituent elements; Obtaining undetermined image information according to the first reference image information, target description text information corresponding to the target image information, and reference description text information corresponding to the first reference image information through an initial image generation model, wherein the initial image generation model is used to determine, based on similarities between image constituent elements respectively described by the target description text information and the reference description text information, a reference method for the appearance attribute information of the image constituent information in the first reference image information when generating image information based on the image constituent elements described by the target description text information; The model parameters of the initial image generation model are adjusted according to the difference between the target image information and the image information to be determined to obtain an image generation model, wherein the image generation model is used to generate image information corresponding to the text information to be generated according to the text information to be generated, the second reference image information corresponding to the text information to be generated, and the descriptive text information corresponding to the second reference image information.

2. The method according to claim 1, characterized in that The obtaining the pending image information according to the first reference image information, the target description text information corresponding to the target image information, and the reference description text information corresponding to the first reference image information includes: generating a first feature according to the target description text information and the first identifier, and generating a second feature according to the first reference image information, the reference description text information corresponding to the first reference image information, and the second identifier, wherein the first feature is used to reflect a first image constituent element described by the target description text information, and the second feature is used to reflect a second image constituent element described by the reference description text information, and appearance attribute information corresponding to the second image constituent element in the first reference image information; The first identifier is used to instruct the initial image generation model to generate image information based on the image constituent elements embodied by the first feature, and the second identifier is used to instruct the initial image generation model to determine a reference method for the appearance attribute information embodied by the second feature when generating image information based on the similarity between the image constituent elements of the first image constituent elements and the second image constituent elements; Generate a constraint condition according to the first feature and the second feature, wherein the constraint condition is used to constrain the initial image generation model to generate the pending image information including the first image constituent element based on the reference mode and with reference to the appearance attribute information of the second image constituent element reflected in the second feature; The pending image information is generated according to the constraint condition.

3. The method according to claim 2, characterized in that The generating the pending image information according to the constraint condition comprises: Acquire features of the image to be adjusted, where the features of the image to be adjusted are used to identify image constituent elements to be adjusted in the image information to be adjusted, and appearance attribute information corresponding to the image constituent elements to be adjusted; adjusting the image feature to be adjusted according to the constraint condition, so that the plurality of image constituent elements to be adjusted identified by the image feature to be adjusted and the appearance attribute information respectively corresponding to the plurality of image constituent elements to be adjusted are close to the first image constituent element and the sample appearance attribute information corresponding to the first image constituent element, the sample appearance attribute information being determined based on the reference mode and the appearance attribute information embodied by the second image constituent element in the second feature; The to-be-determined image information is generated according to the adjusted to-be-adjusted image features.

4. The method according to claim 3, characterized in that The second image constituent elements include scene constituent elements and object constituent elements, the scene constituent elements are used to generate a scene part in the image information, the object constituent elements are used to generate an object part in the image information, and the first reference image information includes scene reference image information having the scene constituent elements and object reference image information having the object constituent elements; The second feature includes a scene reference feature and an object reference feature, and generating the second feature according to the first reference image information, the reference description text information corresponding to the first reference image information, and the second identifier includes: Generate a scene reference feature according to the scene reference image information, the description text information corresponding to the scene reference image information, the scene identifier and the second identifier, wherein the scene identifier is used to instruct the initial image generation model to generate a scene constituent element in the pending image information based on the scene reference feature; And, based on the object reference image information, the descriptive text information corresponding to the object reference image information, the object identifier and the second identifier, an object reference feature is generated, and the scene identifier is used to instruct the initial image generation model to generate the object constituent elements in the pending image information based on the object reference feature.

5. The method according to claim 4, characterized in that The object reference feature is used to perform an i-th adjustment on the image feature to be adjusted, where i is a positive integer not greater than N. Before generating the object reference feature according to the object reference image information, the descriptive text information corresponding to the object reference image information, and the object identifier, the method further includes: In response to i being not greater than M, determining default text information as the description text information corresponding to the object reference image information, the default text information not describing any image constituent elements, M being a positive integer less than N, and N being a positive integer greater than 1; In response to i being greater than M, determining the description text information corresponding to the object reference image information in the sample image information set as the description text information corresponding to the object reference image information; The generating a constraint condition according to the first feature and the second feature includes: generating a constraint condition corresponding to the i-th adjustment according to the first feature, the scene reference feature and the object reference feature; The step of adjusting the image feature to be adjusted according to the constraint condition comprises: According to the constraint conditions corresponding to the N adjustments, the image feature to be adjusted is adjusted N times to obtain the adjusted image feature to be adjusted; Among them, for the j-th adjustment, based on the constraint conditions corresponding to the j-th adjustment, the image features to be adjusted after the j-1-th adjustment are adjusted to obtain the image features to be adjusted after the j-th adjustment, where j is a positive integer greater than 1 and not greater than N.

6. The method according to claim 5, characterized in that The object constituent elements include human object constituent elements and non-human object constituent elements, the object reference image information includes human object reference image information and non-human object reference image information, and in response to i being greater than M, determining the description text information corresponding to the object reference image information in the sample image information set as the description text information corresponding to the object reference image information, including: In response to i being greater than M, determining the description text information corresponding to the character object reference image information in the sample image information set as the description text information corresponding to the character object reference image information; In response to i being greater than M but not greater than P, determining the default text information as the description text information corresponding to the non-human object reference image information, where P is a positive integer greater than M and less than N, and N is specifically a positive integer greater than 2; In response to i being greater than P, the description text information corresponding to the non-human object reference image information in the sample image information set is determined as the description text information corresponding to the non-human object reference image information.

7. The method according to claim 1, characterized in that The sample image information set is generated in the following manner: Get the video to be processed; Determine a plurality of video frame image information corresponding to the video to be processed, the difference between the appearance attribute information corresponding to the same image constituent element in the plurality of video frame image information is less than the first preset threshold, the plurality of video frame image information has respectively corresponding description text information and video frame identifiers, and the video frame identifier is used to identify the time sequence of the video frame image information in the plurality of video frame image information; Determine the plurality of video frame image information as a plurality of sample image information in the sample image information set, and generate the sample image information set; The determining the first reference image information corresponding to the target image information from the plurality of sample image information comprises: Determine, among the plurality of sample image information, a plurality of pending sample image information including the target image constituent elements; According to the video frame identifier corresponding to the target image information and the video frame identifiers respectively corresponding to the multiple pending sample image information, the pending sample image information that is closest to the target image information in time sequence among the multiple pending sample image information is determined as the first reference image information.

8. The method according to claim 7, characterized in that The determining of a plurality of video frame image information corresponding to the video to be processed includes: Acquire multiple initial video frame image information corresponding to the video to be processed; The multiple video frame image information are determined from the multiple initial video frame image information, and the similarity between any two video frame image information in the multiple video frame image information is greater than a second preset threshold.

9. The method according to claim 5, characterized in that The step of adjusting the image feature to be adjusted after the j-1th adjustment based on the constraint condition corresponding to the jth adjustment to obtain the image feature to be adjusted after the jth adjustment includes: Determine query information corresponding to the attention adjustment mechanism in the j-th adjustment according to the features of the image to be adjusted after the j-1-th adjustment, and determine the constraint condition corresponding to the j-th adjustment as the address information and value information corresponding to the attention adjustment mechanism in the j-th adjustment; Determining attention information corresponding to the attention adjustment mechanism in the j-th adjustment based on the query information, address information, and value information corresponding to the attention adjustment mechanism in the j-th adjustment; The image feature to be adjusted after the j-1th adjustment is adjusted based on the attention information to obtain the image feature to be adjusted after the jth adjustment.

10. The method according to claim 1, characterized in that The reference method is used to identify a reference object and a reference degree, and the initial image generation model is used to obtain the pending image information according to the first reference image information, the target description text information corresponding to the target image information, and the reference description text information corresponding to the first reference image information, including: Based on the similarity between the image constituent elements respectively described in the target description text information and the reference description text information, determining the image constituent element to be referenced corresponding to the image constituent element to be generated in the image constituent elements described in the reference description text information, the target similarity between the text information respectively corresponding to the image constituent element to be generated and the image constituent element to be referenced is greater than a third preset threshold, and the image constituent element to be generated is any one of the target image constituent elements; Taking the reference image constituent element as a reference object and the target similarity as a reference degree, processing the appearance attribute information corresponding to the reference object in the first reference image information according to the reference degree, and generating the appearance attribute information corresponding to the image constituent element to be generated in the pending image information; The pending image information is generated according to the appearance attribute information corresponding to the target image constituent elements in the pending image information.

11. A model application method, characterized in that: The method comprises: Get the text information to be generated; Determine reference image information corresponding to the text information to be generated according to the target image constituent elements described by the text information to be generated, wherein the reference image information includes the target image constituent elements and has corresponding description text information, and the description text information is used to describe the image constituent elements included in the image information; Through an image generation model, target image information corresponding to the text information to be generated is generated according to the text information to be generated, the reference image information and the descriptive text information corresponding to the reference image information, wherein the target image information includes the target image constituent elements, and the appearance attribute information corresponding to the target image constituent elements in the target image information is determined by the image generation model according to a reference method and the appearance attribute information corresponding to the image constituent elements in the reference image information, and the reference method is determined according to the similarity between the image constituent elements respectively described by the text information to be generated and the descriptive text information corresponding to the reference image information.

12. The method according to claim 11, characterized in that The determining, according to the target image constituent elements described by the text information to be generated, reference image information corresponding to the text information to be generated includes: According to the time sequence identifiers respectively corresponding to the multiple generated image information corresponding to the target image constituent elements in the generated image information set, the generated image information with the shortest generated time among the multiple generated image information is determined as the reference image information, wherein the time sequence identifier is used to identify the time sequence between the generation moments of the multiple image information; The method further comprises: Generate a target timing mark corresponding to the target image information according to the generation time of the target image information; The target image information is determined as the generated image information corresponding to the target image constituent elements, bound with the target timing identifier and stored in the generated image information set, and the text information to be generated is the description text information corresponding to the target image information.

13. The method according to claim 11, characterized in that The determining, according to the target image constituent elements described by the text information to be generated, reference image information corresponding to the text information to be generated includes: In response to the absence of generated image information corresponding to the target image constituent element in the generated image information set, default image information corresponding to the target image constituent element is determined as the reference image information.

14. A model training device, characterized in that: The device comprises a first acquisition unit, a first determination unit, a generation unit and an adjustment unit: The first acquisition unit is used to acquire a sample image information set, the sample image information set includes a plurality of sample image information, the plurality of sample image information respectively includes image constituent elements, the difference between the appearance attribute information corresponding to the same image constituent element in the plurality of sample image information is less than a first preset threshold, the plurality of sample image information has respectively corresponding description text information, the description text information is used to describe the image constituent elements included in the image information; The first determining unit is used to determine first reference image information corresponding to the target image information from the multiple sample image information, the target image information is any one of the multiple sample image information, and both the target image information and the first reference image information include target image constituent elements; The generating unit is used to obtain the pending image information according to the first reference image information, the target description text information corresponding to the target image information and the reference description text information corresponding to the first reference image information through an initial image generating model, wherein the initial image generating model is used to determine, based on the similarity between the image constituent elements respectively described by the target description text information and the reference description text information, a reference method for the appearance attribute information of the image constituent information in the first reference image information when generating the image information based on the image constituent elements described by the target description text information; The adjustment unit is used to adjust the model parameters of the initial image generation model according to the difference between the target image information and the to-be-determined image information to obtain an image generation model, and the image generation model is used to generate image information corresponding to the text information to be generated according to the text information to be generated, the second reference image information corresponding to the text information to be generated, and the descriptive text information corresponding to the second reference image information.

15. A model application device, characterized in that: The device comprises a second acquisition unit, a determination unit and a first generation unit: The second acquisition unit is used to acquire the text information to be generated; The determining unit is used to determine the reference image information corresponding to the text information to be generated according to the target image constituent elements described by the text information to be generated, the reference image information includes the target image constituent elements, the reference image information has corresponding description text information, and the description text information is used to describe the image constituent elements included in the image information; The first generation unit is used to generate target image information corresponding to the text information to be generated through an image generation model according to the text information to be generated, the reference image information and the descriptive text information corresponding to the reference image information, wherein the target image information includes the target image constituent elements, and the appearance attribute information corresponding to the target image constituent elements in the target image information is determined by the image generation model according to a reference method and the appearance attribute information corresponding to the image constituent elements in the reference image information, and the reference method is determined according to the similarity between the image constituent elements respectively described by the text information to be generated and the descriptive text information corresponding to the reference image information.

16. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute the model training method described in any one of claims 1-10, or the model application method described in any one of claims 11-13 according to the instructions in the computer program.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the model training method described in any one of claims 1-10, or the model application method described in any one of claims 11-13.

18. A computer program product comprising a computer program, which, when executed on a computer, enables the computer to execute the model training method described in any one of claims 1 to 10, or the model application method described in any one of claims 11 to 13.

Citation Information

Cited By

  • Advertising map generation method based on AIGC

    CN119417950A