Image generation method and device, equipment and storage medium

By combining the extended text model and the multi-modal model, the limitations of existing text models in processing complex text descriptions are solved, and more accurate and efficient image generation is achieved.

CN119338934APending Publication Date: 2025-01-21PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411355086.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

Existing text models have text length limitations when processing input, which cannot adapt to complex text descriptions or scenes, resulting in inaccurate image generation.

Method used

By expanding the text model, the target text is analyzed, the text vector is generated, and the multi -modal model is combined as the supervision signal, and the image generation model is entered to generate the target image.

Benefits of technology

Improve the accuracy and efficiency of the image generation in complex field scenarios, effectively handle long text and complex descriptions, and generate images that match the high degree of input text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338934A_ABST
    Figure CN119338934A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image generation method and device, equipment and a storage medium. The method comprises the steps that a target text is obtained, and the text length of the target text exceeds a preset length; the target text is analyzed through an extended text model, a text vector corresponding to the target text is obtained, the extended text model takes a multi-modal model as a supervision signal and is obtained through training of the training data set, the training data set comprises a plurality of image text pairs, and the image text pairs are obtained through the text vector. The text in the image text pair comprises words with preset text lengths; and inputting the text vector into an image generation model to obtain a target image corresponding to the target text, and the embodiment of the invention aims to improve the accuracy and efficiency of image generation in a complex scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology, and in particular to an image generating method, an image generating device, a computer device and a computer-readable storage medium. Background Art

[0002] In the insurance and finance field, companies usually need to design and produce different images and texts according to different scenarios, different times, and even different regions to promote products such as insurance and secured loans. Therefore, in order to improve the efficiency of image generation, it is necessary to use an automated image generation model to generate images.

[0003] In the related art, the image generation model mainly relies on the text model to control the content of the generated image. However, the existing text model has certain limitations when processing input, especially the input text length cannot exceed 77 characters. Therefore, the existing text model cannot adapt to complex text descriptions or complex scenes, that is, it cannot overcome the limitation of text length, and thus cannot generate images more accurately. Summary of the invention

[0004] The present application provides an image generation method, an image generation device, a computer device and a computer-readable storage medium, aiming to improve the accuracy and efficiency of image generation in complex scenes.

[0005] To achieve the above objectives, the present application provides an image generation method, comprising:

[0006] Acquire a target text, wherein the text length of the target text exceeds a preset length;

[0007] Analyzing the target text through an extended text model to obtain a text vector corresponding to the target text, wherein the extended text model uses a multimodal model as a supervisory signal and is obtained by training the training data set, the training data set includes a plurality of image-text pairs, and the text in the image-text pairs includes words of a preset text length;

[0008] The text vector is input into an image generation model to obtain a target image corresponding to the target text.

[0009] To achieve the above objectives, the present application also provides an image generating device, comprising:

[0010] An acquisition module, the acquisition module is used to acquire a target text, wherein the text length of the target text exceeds a preset length;

[0011] An analysis module, the analysis module is used to analyze the target text through an extended text model to obtain a text vector corresponding to the target text, wherein the extended text model uses a multimodal model as a supervisory signal and is obtained by training the training data set, the training data set includes a plurality of image-text pairs, and the text in the image-text pairs includes words of a preset text length;

[0012] An image generation module is used to input the text vector into an image generation model to obtain a target image corresponding to the target text.

[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a computer device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the steps of any one of the image generation methods provided in the embodiments of the present application when executing the computer program.

[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the steps of any one of the image generation methods provided in the embodiments of the present application.

[0015] The image generation method, image generation device, computer equipment and computer-readable storage medium disclosed in the embodiment of the present application. Among them, the method includes obtaining a target text, wherein the text length of the target text exceeds a preset length. Further, the target text can be analyzed by an extended text model to obtain a text vector corresponding to the target text, wherein the extended text model uses a multimodal model as a supervisory signal and is obtained by training a training data set, and the training data set includes a number of image-text pairs, and the text in the image-text pair includes words of a preset text length. Thus, the text vector can be input into the image generation model to obtain a target image corresponding to the target text. The present application analyzes the target text by an extended text model and combines it with a multimodal model to ensure that the generated image can be highly matched with the input text content. Due to the use of the association information between the image and the text, the generated image is more semantically accurate. In addition, by analyzing the target text whose text length exceeds the preset value, complex and highly descriptive text content can be effectively processed. This processing method can cope with richer scenarios and meet a variety of application requirements. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0017] Figure 1 is a scene schematic diagram of an image generation method provided in an embodiment of the present application;

[0018] Figure 2 It is a flowchart of an image generation method provided in an embodiment of the present application;

[0019] Figure 3 is a schematic block diagram of an image generating device provided in an embodiment of the present application;

[0020] Figure 4 It is a schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions. In addition, although the functional modules are divided in the device schematic, in some cases, the module division can be different from that in the device schematic.

[0023] The term "and / or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0024] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0025] like Figure 1 As shown, the image generation method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. The application environment includes a terminal device 110 and a server 120, wherein the terminal device 110 can communicate with the server 120 through a network. Specifically, the server 120 can obtain a target text, wherein the text length of the target text exceeds a preset length; the target text is analyzed by an extended text model to obtain a text vector corresponding to the target text, wherein the extended text model uses a multimodal model as a supervisory signal and is trained by the training data set, wherein the training data set includes a plurality of image-text pairs, and the text in the image-text pair includes words of a preset text length; the text vector is input into an image generation model to obtain a target image corresponding to the target text, thereby sending the target image to the terminal device 110. Among them, the server 120 can be an independent server, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal device 110 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, and this application does not limit this.

[0026] Please continue reading Figure 2 , Figure 2 is a flow chart of an image generation method provided in an embodiment of the present application. Figure 2 As shown, the image generating method can be implemented through steps S11 to S14.

[0027] Step S11: Obtain target text.

[0028] The text length of the target text exceeds the preset length.

[0029] The target text is used to represent a piece of text information input by the user, which can serve as the basis for generating an image. The target text can include descriptive text or text with certain semantic meanings, which serves as the core content source for generating an image.

[0030] The preset length may include 100 characters, 150 characters, etc., which is not limited in this application.

[0031] Step S12: Analyze the target text through the extended text model to obtain a text vector corresponding to the target text.

[0032] Among them, the extended text model uses a multimodal model as a supervisory signal and is trained through a training data set. The training data set includes a number of image-text pairs, and the text in the image-text pairs includes words of a preset text length.

[0033] The extended text model is a model used to convert text into vector representation. It can analyze and process the target text through specific algorithms and structures, map the text content into a numerical vector (text vector), and use it to represent the semantic information of the text.

[0034] A multimodal model is a model that processes multiple information modalities (such as text and images) simultaneously. In this scenario, the multimodal model trains images and text together, with the goal of enabling the model to understand the correspondence between text and images. By using the multimodal model as a supervisory signal, the extended text model can learn how to extract visually relevant features from text and represent them as vectors suitable for generating images.

[0035] The training dataset consists of a large number of image-text pairs, i.e. images and text describing these images, which are usually limited to a fixed length to ensure that the model can better learn the relationship between images and text.

[0036] For example, the text in the training data set is limited to a certain length, which can optimize the processing efficiency of the model. Training with these length-constrained texts can improve the accuracy and consistency of the images generated by the model.

[0037] Step S13: Input the text vector into the image generation model to obtain the target image corresponding to the target text.

[0038] For example, the text vectors generated by the extended text model are input into an image generation model. The task of the image generation model is to generate images that semantically match the target text based on these vectors. The text vectors contain the semantic information of the text, so they can guide the model to generate images that match the text description.

[0039] It should be noted that an image generation model is a deep learning model specifically used to generate images, usually based on architectures such as generative adversarial networks (GANs), diffusion models, or variational autoencoders (VAE). These models can decode visual information from high-dimensional text vectors and generate images consistent with the text description.

[0040] For example, the image generation model can generate a target image corresponding to the target text based on the input text vector, and the target image can reflect the content of the text. For example, if the target text describes a forest, the generated target image will show the corresponding forest scene.

[0041] In the above implementation, the target text is first obtained and converted into a vector form, and then the image is generated using a multimodal supervision signal and an image generation model. Through the multimodal learning model, the text vector not only contains language information, but also encodes the semantic information corresponding to the visual image, so that the generated image has a high semantic consistency with the text.

[0042] The image generation method disclosed in the embodiment of the present application includes obtaining a target text, wherein the text length of the target text exceeds a preset length. Further, the target text can be analyzed by an extended text model to obtain a text vector corresponding to the target text, wherein the extended text model uses a multimodal model as a supervisory signal and is obtained by training a training data set, and the training data set includes a number of image-text pairs, and the text in the image-text pair includes words of a preset text length. Thus, the text vector can be input into the image generation model to obtain a target image corresponding to the target text. The present application analyzes the target text by an extended text model and combines it with a multimodal model to ensure that the generated image can be highly matched with the input text content. Due to the use of the association information between the image and the text, the generated image is more semantically accurate. In addition, by analyzing the target text whose text length exceeds the preset value, complex and highly descriptive text content can be effectively processed. This processing method can cope with richer scenarios and meet a variety of application requirements.

[0043] Optionally, the target text is analyzed through an extended text model to obtain a text vector corresponding to the target text, including: performing a preprocessing operation on the target text to obtain a preprocessed target text, wherein the preprocessing operation includes at least one of a stop word removal operation, a punctuation removal operation, and a special character removal operation; encoding the preprocessed target text through the extended text model to obtain a text vector corresponding to the target text.

[0044] Specifically, at least one of a stop word removal operation, a punctuation removal operation, and a special character removal operation may be performed on the target text to obtain a preprocessed target text to prevent invalid data from affecting subsequent word segmentation of the target text. Furthermore, the preprocessed target text may be encoded to obtain a text vector corresponding to the target text.

[0045] The above method, by encoding the target text in combination with the extended text model, can capture the semantic and syntactic information in the target text, thereby helping the model to more accurately identify and extract the key information of the target text.

[0046] Optionally, the method also includes: obtaining a training data set and a pre-trained model; using the multimodal model as a supervisory signal, training the pre-trained model with the training data set to obtain an extended text model.

[0047] For example, a training dataset usually includes several image-text pairs, where the text portion contains descriptive words or sentences related to the image. The quality and diversity of the training dataset directly affects the performance of the final extended text model.

[0048] For example, a natural language processing model trained with large-scale text data is usually used as a pre-trained model. The model already has a certain text understanding ability, but has not undergone special multimodal training.

[0049] Optionally, the multimodal model is used as a supervisory signal, and the pre-trained model is trained through a training data set to obtain an extended text model, including: aligning the output of the multimodal model with the output of the pre-trained model, and training the aligned pre-trained model through a training data set to obtain an extended text model.

[0050] For example, by learning the association between images and text, the multimodal model can extract visual features from images and match these features with the corresponding text descriptions. The multimodal model is used here as a supervisory signal to guide the adjustment of the pre-trained model.

[0051] For example, during the training process, the text output of the pre-trained model is aligned with the output of the multimodal model to ensure that the two have the same understanding of the same text. For example, the text vector representation of the pre-trained model can be matched with the text features extracted by the multimodal model so that the output of the pre-trained model can be highly consistent with the output of the multimodal model.

[0052] Optionally, the aligned pre-trained model is trained by a training data set to obtain an extended text model, including: training the aligned pre-trained model by a training data set, and keeping the output of the aligned pre-trained model below a preset threshold, and obtaining an extended text model.

[0053] For example, during training, the aligned pre-trained model is trained using a dataset of image-text pairs. The goal of the training is to allow the extended text model to gradually learn the semantic relationship between text and image. The specific operation may include adjusting the model parameters so that the output result of the model is closer to the actual image features.

[0054] For example, in order to ensure that the text vectors generated by the model maintain a high degree of similarity with the target features and avoid output deviation, a preset threshold can be set. During the training process, the output difference of the model needs to be kept within the threshold range. In this way, it can be ensured that the text vectors generated by the model have a high correlation with the image features, thereby enhancing the generalization ability and accuracy of the model.

[0055] In the above implementation, the extended text model can not only accurately extract semantic information from the input text, but also generate a text vector that is highly matched with the image based on the supervisory signal of the image-text pair. By aligning the output of the multimodal model and keeping the output difference below the threshold during training, the consistency of the image generated by the model with the input text can be ensured, thereby improving the quality and diversity of the final image generation.

[0056] Optionally, after the initial deep learning model is trained by the training data set and the annotation results to obtain the target deep learning model, the method includes: iteratively training the target deep learning model based on the training data set and the annotation results to extract data features, and calculating the loss function; iteratively training the loss function using a preset method with the purpose of reducing the value of the loss function until the expected threshold requirement is met; based on the loss function after iterative training, obtaining the iterative target deep learning model.

[0057] It should be noted that this application does not limit the target deep learning model, such as BERT, BiLSTM, CRF, GPT and ELMo, etc. This application takes the target deep learning model as CRF as an example for explanation.

[0058] The CRF (conditional random field algorithm) model is a probabilistic graph model that is often used in tasks such as sequence labeling or text processing. The CRF model is an undirected graph model used to model the conditional probability distribution between a label sequence and an input sequence. The main idea of ​​the CRF model is to use contextual information to jointly label the elements in the sequence. It takes into account the dependencies between adjacent elements and the conditional dependencies between the features of the current element and the label. By learning the relationship between the features and labels in the training data, the CRF model can predict the most likely label for each input element, thereby completing the sequence labeling task. In addition, the CRF model improves the performance of the model by considering contextual information and conditional dependencies in the sequence labeling task, making label prediction more accurate. This makes the CRF model a commonly used model for processing tasks such as named entity recognition, part-of-speech tagging, syntactic analysis, and text segmentation in natural language processing.

[0059] Specifically, a training data set containing several texts may be collected for training. For example, the training data set may be obtained by manual collection, web crawlers, or public data sets, etc., which is not limited in this application.

[0060] Furthermore, each set of labeled training data sets is input into the CRF model for supervised learning. When the training end conditions are met, such as the number of training times reaches the number threshold or the output accuracy of the model reaches the accuracy threshold, the training is terminated to obtain the iterative target deep learning model.

[0061] In an embodiment of the present application, the training data set and the annotation results can be input into the CRF model for supervised learning, and then trained to obtain the iterative target deep learning model.

[0062] Optionally, the loss function is iteratively trained using a preset method for the purpose of reducing the value of the loss function until an expected threshold requirement is met, including: iteratively training the loss function using a preset learning rate and stochastic gradient descent until the expected threshold requirement is met, wherein the preset learning rate includes 1e-5.

[0063] It can be understood that in order to train a target deep learning model with higher accuracy, the target deep learning model can be repeatedly iterated to continuously reduce the loss function until the loss function meets the expected threshold requirement, and then a more accurate word segmentation result corresponding to the target text can be obtained based on the iterated target deep learning model.

[0064] It should be noted that the present application does not limit the above-mentioned preset method and expected threshold. For example, the preset method may be a gradient descent algorithm, a batch gradient descent algorithm, a stochastic gradient descent algorithm, etc. The present application takes the stochastic gradient descent algorithm as an example for explanation.

[0065] The purpose of the stochastic gradient descent algorithm is to find the minimum value of the loss function by iteration, or to converge to the minimum value. In a geometric sense, the stochastic gradient descent algorithm is that the gradient decreases fastest in the direction opposite to the vector where the function changes the fastest, so it is easier to find the minimum value of the function. Based on this, in an embodiment of the present application, the target deep learning model can be repeatedly iterated and trained by the stochastic gradient descent algorithm so that the loss function is continuously reduced, thereby reducing the error of the calculation result.

[0066] In an embodiment of the present application, the target deep learning model is repeatedly trained by using a stochastic gradient descent algorithm so that the loss function is continuously reduced to obtain the target deep learning model after iteration.

[0067] See also Figure 3 , Figure 3 1 is a schematic block diagram of an image generation device provided in an embodiment of the present application. The image generation device can be configured in a server to execute the aforementioned image generation method.

[0068] like Figure 3As shown, the image generating device 200 includes: an acquisition module 201 , an analysis module 202 and an image generating module 203 .

[0069] An acquisition module 201 is used to acquire a target text, wherein the text length of the target text exceeds a preset length;

[0070] An analysis module 202 is used to analyze the target text through an extended text model to obtain a text vector corresponding to the target text, wherein the extended text model uses a multimodal model as a supervisory signal and is obtained by training the training data set, the training data set includes a plurality of image-text pairs, and the text in the image-text pairs includes words of a preset text length;

[0071] The image generation module 203 is used to input the text vector into an image generation model to obtain a target image corresponding to the target text.

[0072] The analysis module 202 is also used to perform a preprocessing operation on the target text to obtain a preprocessed target text, wherein the preprocessing operation includes at least one of a stop word removal operation, a punctuation removal operation, and a special character removal operation; the preprocessed target text is encoded through the extended text model to obtain a text vector corresponding to the target text.

[0073] The acquisition module 201 is also used to acquire a training data set and a pre-trained model; using the multimodal model as a supervisory signal, the pre-trained model is trained with the training data set to obtain the extended text model.

[0074] The acquisition module 201 is also used to align the output of the multimodal model with the output of the pre-trained model, and train the aligned pre-trained model through the training data set to obtain the extended text model.

[0075] The acquisition module 201 is also used to train the aligned pre-trained model through the training data set, keep the output of the aligned pre-trained model below a preset threshold, and obtain the extended text model.

[0076] The acquisition module 201 is further used to iteratively train the target deep learning model based on the training data set and the annotation result to extract data features and calculate the loss function; iteratively train the loss function using a preset method for the purpose of reducing the value of the loss function until the expected threshold requirement is met;

[0077] The acquisition module 201 is further used to iteratively train the loss function by using a preset learning rate and a stochastic gradient descent method until an expected threshold requirement is met, wherein the preset learning rate includes 1e-5.

[0078] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0079] The method and apparatus of the present application can be used in many general or special computing system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer terminal devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices.

[0080] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in the form of a computer program. Figure 4 Runs on the computer device shown.

[0081] See also Figure 4 , Figure 4 1 is a schematic diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.

[0082] like Figure 4 As shown, the computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a volatile storage medium, a non-volatile storage medium and an internal memory.

[0083] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any image generation method.

[0084] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0085] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any image generation method.

[0086] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that the structure of the computer device is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0087] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0088] Among them, in some embodiments, the processor is used to obtain a target text, wherein the text length of the target text exceeds a preset length; the target text is analyzed by an extended text model to obtain a text vector corresponding to the target text, wherein the extended text model uses a multimodal model as a supervisory signal and is trained by the training data set, the training data set includes a plurality of image-text pairs, and the text in the image-text pairs includes words of a preset text length; the text vector is input into an image generation model to obtain a target image corresponding to the target text.

[0089] In some embodiments, the processor is further used to perform a preprocessing operation on the target text to obtain a preprocessed target text, wherein the preprocessing operation includes at least one of a stop word removal operation, a punctuation removal operation, and a special character removal operation; and the preprocessed target text is encoded through the extended text model to obtain a text vector corresponding to the target text.

[0090] In some embodiments, the processor is further used to obtain a training data set and a pre-trained model; using the multimodal model as a supervisory signal, the pre-trained model is trained with the training data set to obtain the extended text model.

[0091] In some embodiments, the processor is further used to align the output of the multimodal model with the output of the pre-trained model, and train the aligned pre-trained model using the training data set to obtain the extended text model.

[0092] In some embodiments, the processor is further used to train the aligned pre-trained model using the training data set, and keep the output of the aligned pre-trained model below a preset threshold, and obtain the extended text model.

[0093] In some embodiments, the processor is also used to iteratively train the target deep learning model based on the training data set and the annotation results to extract data features, and calculate the loss function; use a preset method to iteratively train the loss function for the purpose of reducing the value of the loss function until the expected threshold requirement is met; based on the loss function after iterative training, obtain the iterative target deep learning model.

[0094] In some embodiments, the processor is further configured to iteratively train the loss function using a preset learning rate and stochastic gradient descent until an expected threshold requirement is met, wherein the preset learning rate includes 1e-5.

[0095] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed, any one of the image generation methods provided in the embodiments of the present application is implemented.

[0096] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0097] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like.

[0098] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. An image generation method, characterized in that: The method comprises: Acquire a target text, wherein the text length of the target text exceeds a preset length; Analyzing the target text through an extended text model to obtain a text vector corresponding to the target text, wherein the extended text model uses a multimodal model as a supervisory signal and is obtained by training the training data set, the training data set includes a plurality of image-text pairs, and the text in the image-text pairs includes words of a preset text length; The text vector is input into an image generation model to obtain a target image corresponding to the target text.

2. The method according to claim 1, characterized in that The step of analyzing the target text by using the extended text model to obtain a text vector corresponding to the target text includes: Performing a preprocessing operation on the target text to obtain a preprocessed target text, wherein the preprocessing operation includes at least one of an operation of removing stop words, an operation of removing punctuation marks, and an operation of removing special characters; The preprocessed target text is encoded by the extended text model to obtain a text vector corresponding to the target text.

3. The method according to claim 1, characterized in that The method further comprises: Get training data sets and pre-trained models; The multimodal model is used as a supervisory signal, and the pre-trained model is trained using the training data set to obtain the extended text model.

4. The method according to claim 3, characterized in that The multimodal model is used as a supervisory signal, and the pre-trained model is trained through the training data set to obtain the extended text model, including: The output of the multimodal model is aligned with the output of the pre-trained model, and the aligned pre-trained model is trained using the training data set to obtain the extended text model.

5. The method according to claim 4, characterized in that The step of training the aligned pre-trained model by using the training data set to obtain the extended text model includes: The aligned pre-trained model is trained using the training data set, and the output of the aligned pre-trained model is kept below a preset threshold, thereby obtaining the extended text model.

6. The method according to claim 3, characterized in that After the initial deep learning model is trained by the training data set and the annotation result to obtain the target deep learning model, the method includes: Iteratively train the target deep learning model based on the training data set and the annotation results to extract data features, and calculate the loss function; Iteratively training the loss function using a preset method for the purpose of reducing the value of the loss function until the expected threshold requirement is met; Based on the loss function after iterative training, the target deep learning model after iteration is obtained.

7. The method according to claim 6, characterized in that The method of iteratively training the loss function with the purpose of reducing the value of the loss function by using a preset method until the expected threshold value is met includes: The loss function is iteratively trained using a preset learning rate and stochastic gradient descent until an expected threshold requirement is met, wherein the preset learning rate includes 1e-5.

8. An image generating device, characterized in that: The image generating device comprises: An acquisition module, the acquisition module is used to acquire a target text, wherein the text length of the target text exceeds a preset length; An analysis module, the analysis module is used to analyze the target text through an extended text model to obtain a text vector corresponding to the target text, wherein the extended text model uses a multimodal model as a supervisory signal and is obtained by training the training data set, the training data set includes a plurality of image-text pairs, and the text in the image-text pairs includes words of a preset text length; An image generation module is used to input the text vector into an image generation model to obtain a target image corresponding to the target text.

9. A computer device, characterized in that: include: A memory and a processor; wherein the memory is connected to the processor and is used to store a program; the processor is used to implement the steps of the image generation method as described in any one of claims 1 to 7 by running the program stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the steps of the image generation method according to any one of claims 1 to 7.