Sample generation method and device, model training method and device and storage medium

By using the combination method of multi-machine learning models in the literary graphics model, the difficulty of the existing literary graphics model to generate images when the input text is inaccurate, and a more efficient and friendly image generation process is achieved.

CN119625098APending Publication Date: 2025-03-14SHANGHAI SOULGATE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411676184.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When the input text description is inaccurate or detailed, it is difficult to generate images that users expect, and the process of adjusting text descriptions to guide the generation of the model is complicated and unfriendly.

Method used

The first machine learning model obtains prompt information for generating images from the text information, uses the second machine learning model to generate images, and filters the prompt information and images, obtains the target prompt information and target text information, and forms sample data in order to fine-tune the third machine learning model to generate more accurate image prompts.

Benefits of technology

It improves the convenience and quality of image generation based on text, reduces the requirements for user description capabilities, simplifies the generation process, is suitable for ordinary users, and improves the data generation quality of the generation model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625098A_ABST
    Figure CN119625098A_ABST
Patent Text Reader

Abstract

The invention provides a sample generation and model training method and device and a storage medium, and relates to the technical field of machine learning. The sample generation method comprises the steps of obtaining prompt information for generating an image through a first machine learning model according to text information; acquiring an image through a second machine learning model according to the prompt information; screening the prompt information according to the prompt information and the image, and obtaining target prompt information; obtaining text information used for generating target prompt information as target text information; and associating the target text information with the target prompt information as sample data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of machine learning, and in particular to a sample generation and model training method, device and storage medium. Background Art

[0002] LLM (Large Language Model) is a natural language processing model based on deep learning technology. It can understand and generate human language by training on a large amount of text data. The core function of large language models is to understand and generate natural language text. They can perform a variety of tasks such as text generation, language understanding, translation, summarization, dialogue systems, etc. The training of large language models usually involves two main stages: pre-training and fine-tuning. In the pre-training stage, the model learns the basic structure and patterns of the language on a large amount of unlabeled text data through self-supervised learning. In the fine-tuning stage, the model is further trained on labeled data for a specific task to improve its performance on the specific task.

[0003] Stable Diffusion (text-to-image model) is a type of text-to-image model based on deep learning technology, which can generate corresponding images based on text descriptions. Its generation ability depends on the accuracy and detail of the input text description. These text-to-image models are widely used in art creation, advertising design, game development and other fields. However, a significant limitation of this type of model is that it is only possible to output the expected results of users when accurate and detailed text descriptions are input. Many users often find it difficult to find suitable words or expressions when describing the details of the required images, which makes the generated images have a large gap with expectations. How to adjust the input text description to ensure that it can effectively guide the generation model is a task that requires professional knowledge and experience. At present, this part of the work is mainly done by professionals, but this process is time-consuming and labor-intensive, and is not user-friendly enough for ordinary users. Summary of the invention

[0004] One object of the present disclosure is to improve the convenience and quality of generating images based on text.

[0005] According to one aspect of some embodiments of the present disclosure, a sample generation method is proposed, including: obtaining prompt information for generating an image through a first machine learning model based on text information; obtaining an image through a second machine learning model based on the prompt information; filtering the prompt information and obtaining target prompt information based on the prompt information and the image; obtaining text information for generating the target prompt information as target text information; and associating the target text information with the target prompt information as sample data.

[0006] In some embodiments, the text information and the prompt information are in different languages, and the prompt information is in English.

[0007] In some embodiments, based on the prompt information and the image, filtering the prompt information includes at least one of the following: filtering the image through at least one of machine screening or manual screening, and filtering the prompt information used to generate the image by screening the image; filtering the prompt information according to the degree to which the image satisfies the prompt information.

[0008] In some embodiments, the sample generation method further includes: obtaining a predetermined amount of descriptive information related to image generation from at least one of user input and historical request data as text information.

[0009] In some embodiments, the sample data is used to fine-tune a third machine learning model, and the third machine learning model is used to output prompt information for generating an image based on the input text.

[0010] According to one aspect of some embodiments of the present disclosure, a model training method is proposed, comprising: generating sample data by any one of the sample generation methods mentioned above; fine-tuning a pre-trained third machine learning model according to the sample data, wherein the third machine learning model is used to output prompt information for generating an image according to the input text.

[0011] According to one aspect of some embodiments of the present disclosure, an image generation method is proposed, including: obtaining descriptive information related to image generation from a user; obtaining prompt information based on a third machine learning model according to the descriptive information, the third machine learning model being trained and generated according to the model training method mentioned above; and generating a target image based on an image generation model according to the prompt information.

[0012] According to one aspect of some embodiments of the present disclosure, a sample generation device is proposed, including: a prompt information generation unit, configured to obtain prompt information for generating an image through a first machine learning model based on text information; an image acquisition unit, configured to obtain an image through a second machine learning model based on the prompt information; a screening unit, configured to screen the prompt information based on the prompt information and the image, and obtain target prompt information; obtain text information for generating the target prompt information as target text information; and a sample determination unit, configured to associate the target text information with the target prompt information as sample data.

[0013] According to one aspect of some embodiments of the present disclosure, a data processing device is provided, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute any one of the above methods based on instructions stored in the memory.

[0014] According to one aspect of some embodiments of the present disclosure, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, any one of the above methods is implemented.

[0015] According to one aspect of some embodiments of the present disclosure, a computer program product is provided, including a computer program or instructions, and when the computer program or instructions are executed by a processor, any one of the above methods is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute improper limitations on the present disclosure.

[0017] Figure 1 Flowcharts of some embodiments of the sample generation method of the present disclosure.

[0018] Figure 2 The present invention is a flowchart of some embodiments of the sample generation method disclosed herein.

[0019] Figure 3 Flowcharts of some embodiments of the model training method disclosed herein.

[0020] Figure 4 The following is a flowchart of some embodiments of the image generation method disclosed in the present invention.

[0021] Figure 5 Schematic diagrams of some embodiments of the sample generating device disclosed herein.

[0022] Figure 6 Schematic diagrams of some embodiments of the model training system disclosed herein.

[0023] Figure 7 Schematic diagrams of some embodiments of the image generating device disclosed herein.

[0024] Figure 8 Schematic diagrams of some embodiments of the data processing device disclosed herein.

[0025] Fig. 9 Schematic diagrams of other embodiments of the data processing device disclosed in the present invention. DETAILED DESCRIPTION

[0026] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments.

[0027] The inventors have discovered that the capabilities of a large language model are suitable for making reasonable inferences and expansions based on text information input by users, and for generating prompt information suitable for generating images. In this way, users only need to provide descriptive information according to their own expression needs and habits (for example, when generating images containing people, character information can be provided), thereby reducing restrictions on user usage thresholds.

[0028] In response to the above problems, the present disclosure proposes a sample generation and model training method, device and storage medium, which can generate sample data suitable for training a large language model, and fine-tune the model on the pre-trained large language model so that it has the ability to generate prompt information suitable for an image generation model based on the pre-trained text reasoning. The fine-tuned large language model is used as an intermediate processing link between the user's request to generate an image and the image generation model, which can improve the convenience and quality of text-based image generation.

[0029] The flow charts of some embodiments of the sample generation method disclosed in the present invention are as follows: Figure 1 shown.

[0030] In step S12, prompt information for generating an image is obtained through a first machine learning model based on the text information. In some embodiments, the text information may be information provided (e.g., input) by a user for generating an image, and the information provided by the user may be in its original form as the text information without adjustment.

[0031] The above text information may be in any language, for example, Chinese.

[0032] The first machine learning model is a large language model, which has the ability to convert from text to text. According to the text information and the corresponding large language instructions, they are input into the pre-trained large language model, and the prompt information Prompt for generating the image is output. In some embodiments, considering that the current image generation model has better image generation capabilities for English Prompt than for other languages, the Prompt output by the first machine learning model is in English.

[0033] In some embodiments, a large language model template may be pre-set, and a large language model instruction may be generated according to the text information and the large language model template, and then the large language model instruction may be input into the large language model to obtain a Prompt.

[0034] In step S13, an image is acquired through a second machine learning model according to the prompt information. The second machine learning model is an image generation model that can generate an image according to the input prompt. In some embodiments, the image generation model can adopt a model for generating images based on text in related technologies, such as the open source Stable Diffusion XL model.

[0035] In step S14, the prompt information is screened according to the prompt information and the image to obtain target prompt information.

[0036] In some embodiments, image technical indicators can be pre-set, images can be screened by machine screening, images that do not meet the requirements can be discarded, remaining images can be determined, and prompt information for generating the remaining images can be obtained as target prompt information.

[0037] In some embodiments, images can be screened by manual screening, such as manually observing the aesthetics of the images, discarding images that do not meet the requirements, determining the remaining images, and then obtaining prompt information for generating the remaining images as target prompt information.

[0038] In some embodiments, the prompt information can be filtered according to the degree to which the image satisfies the prompt information. For example, the CLIP (Contrastive Language-Image Pre-training) score is measured, the consistency between the image and the prompt information is quantified, and images with consistency below a predetermined standard are discarded. The remaining images are determined, and then the prompt information used to generate the remaining images is obtained as the target prompt information.

[0039] One or more of the above methods may be used to filter the prompt information, thereby increasing the accuracy requirements for the prompt information, thereby helping to improve the accuracy of the trained model.

[0040] In step S15, the text information used to generate the target prompt information is obtained as the target text information. In some embodiments, after determining the target prompt information, the text information corresponding to the target prompt information can be obtained as the target text information according to the text information used when generating the prompt information in step S12 above.

[0041] In step S16, the target text information and the target prompt information are associated as sample data, for example, the sample data may be in the form of a (target text information, target prompt information) data pair. The sample data is used to fine-tune the third machine learning model, which is used to output prompt information for generating an image based on the input text.

[0042] Based on the method in the embodiment shown above, the prompt information generated based on the text information can be screened using the image generation quality, and text information and prompt information pairs with high consistency can be screened out, and the prompt information in the screened text information and prompt information pairs is suitable for the image generation model. The generation operation of the sample data does not require manual adjustment of the text information input by the user, which reduces the pressure on technical personnel and is conducive to quickly providing a large amount of sample data, thereby optimizing the sample generation speed and sample quality of the machine learning model that uses sample data for user training and fine-tuning, and improving the data generation quality of the machine learning model, thereby improving the convenience and quality of generating images based on text.

[0043] In some embodiments, Figure 1 As shown, the sample generation method of the present disclosure also includes step S11.

[0044] In step S11, a predetermined amount of descriptive information related to image generation from at least one of user input and historical request data is obtained as text information. The historical request data is the stored descriptive information related to image generation input by the user when requesting to generate an image.

[0045] In some embodiments, the descriptive information related to image generation in user input and historical request data does not need to be screened and adjusted and can be used directly, so that the text information in the sample data can take into account the expression habits of different users and improve the robustness of the machine learning model trained using the sample data.

[0046] Based on the method in the embodiment shown above, the description information in the real user request can be used as the text information for generating sample data, thereby reducing the pressure of obtaining text information while further improving the degree of conformity of the text information to the user behavior and improving the quality of the sample data.

[0047] In some embodiments, the sample generation method of the present disclosure is as follows Figure 2 as shown in .

[0048] Prepare N Chinese character information and corresponding large language model instructions, input them into the pre-trained large language model A, and generate N English raw picture prompts, where N is a positive integer. To ensure the quality of model training, N is a positive integer greater than 200. In some embodiments, considering the amount of calculation for model fine-tuning and the accuracy of the model, the number of N can be increased, such as N is a positive integer greater than 1000 or 10,000. Since it is difficult to predict the behavior of users, the input characters may be diverse, so there is no need to clean or filter these data.

[0049] The design of the large language model instructions does not require too much human involvement. It only needs to use simple natural language to tell the large language model the task to be completed. In some embodiments, instructions that meet the task requirements can be pre-designed, thereby improving the output effect of the large language model A to a certain extent.

[0050] In some embodiments, the selection of the pre-trained large language model A is not unique, as long as it has basic text-to-text capabilities, but the stronger the model performance, the better the ability to understand the user's input intent and the diversity of output results. In some embodiments, the pre-trained large language model A can select the gpt-4o model developed by OpenAI, and the calling method is API call.

[0051] Furthermore, the generated N English raw image prompts are input into the text-to-image model (i.e., the image generation model mentioned above, such as Stable Diffusion) to obtain N images. The image generation model is not unique, and can be any generative model that supports generating images from input text, for example, the open source Stable DiffusionXL model can be selected.

[0052] First, the data is filtered by calculating objective technical indicators such as image-text correlation (such as CLIP score), and then manually filtered for a second time to select M prompts that meet the requirements from N English raw image prompts, where M is a positive integer greater than 0 and less than N.

[0053] In some embodiments, images can be screened from the perspectives of image-text consistency and image aesthetics. Image-text consistency reflects the correlation between the image-generated content and the input text. The higher the consistency, the more consistent the image content is with the input text content, which can be used to evaluate the large language model's ability to understand the user's input intent; image aesthetics reflects the details and exquisiteness of the image-generated content, which can be used to evaluate the large language model's ability to expand and polish.

[0054] The selected M pairs of (Chinese character information, English raw picture prompt) samples are used as sample data training sets for fine-tuning the large language model B to improve its performance in the task of converting Chinese character information into English raw picture prompts.

[0055] The difference between different large language models lies in the architecture and model parameter size. The larger the model parameters, the stronger the model is, but it also means longer reasoning time. Therefore, when selecting a model, it is necessary to comprehensively consider the effect and performance required by the business scenario. In some embodiments, large language models of various architectures can be used. For example, the open source Qwen2-7B model can be selected.

[0056] After obtaining the sample data training set, the large language model B can be fine-tuned using supervised fine-tuning technology. After training to convergence, the required machine learning model for generating prompt information for images based on input text output is obtained.

[0057] Based on the method in the embodiment shown above, it is possible to utilize the Chinese character information provided by real users, automatically generate prompt information through the model, and then obtain (Chinese character information, English raw picture Prompt) that meets the requirements by screening the images generated using the prompt information. This is to fine-tune the large language model used to output prompt information for generating images based on the input text, improve the automation and efficiency of sample data generation, and improve the prompt information generation capability of the large language model.

[0058] The flowcharts of some embodiments of the model training method disclosed in the present invention are as follows Figure 3 shown.

[0059] In step S31 , sample data is generated based on the sample generation method in any of the above-mentioned embodiments.

[0060] In step S32, a pre-trained third machine learning model is fine-tuned according to the sample data, where the model is used to output prompt information for generating an image according to the input text.

[0061] Based on the method in the embodiment shown above, the training efficiency and data generation quality of the third machine learning model can be improved, thereby improving the convenience and quality of text-based image generation.

[0062] The flowcharts of some embodiments of the image generation method disclosed in the present invention are as follows: Figure 4 shown.

[0063] In step S41, descriptive information related to image generation is obtained from the user. In some embodiments, the descriptive information is text information, and the user can input text information based on his or her own expression habits and the language used. In some embodiments, the descriptive information related to image generation can be a description of the personality, identity, and appearance of the content (person or object) carried by the image, and can also include a description of environmental information. The above descriptive information is only an example and does not constitute an improper limitation on the present disclosure.

[0064] In step S42, according to the description information, prompt information is obtained based on the third machine learning model, and the third machine learning model is based on the above Figure 3 The model training method mentioned in the illustrated embodiment is trained and generated. In some embodiments, the third machine learning model can be a large language model of various architectures, for example, the open source Qwen2-7B model can be selected.

[0065] In step S43, a target image is generated based on the image generation model according to the prompt information.

[0066] Based on the method in the embodiment shown above, the trained third machine learning model can be used to convert the descriptive information input by the user into prompt information, and then generate an image based on the prompt information, which reduces the requirements for the user's description ability and is conducive to improving the accuracy and convenience of generating images based on the descriptive information provided by the user.

[0067] In some embodiments, the image generation method of the present invention can be applied to a variety of scenarios, such as generating pictures that meet the needs of individual users, or generating characters for animations, games, etc. For example, character images can be automatically generated based on text descriptions of animations and game characters, thereby improving the efficiency of generating characters in animations and games and shortening the development cycle.

[0068] Schematic diagrams of some embodiments of the sample generation device disclosed in the present invention are as follows Figure 5 shown.

[0069] The prompt information generating unit 511 can obtain prompt information for generating an image through a first machine learning model according to the text information. In some embodiments, the text information can be information provided by a user (e.g., input) for generating an image, and the information provided by the user can be in the original text as the text information without adjustment.

[0070] The above text information may be in any language, for example, Chinese.

[0071] The first machine learning model is a large language model, which has the ability to convert from text to text. According to the text information and the corresponding large language instructions, they are input into the pre-trained large language model, and the prompt information Prompt for generating the image is output. In some embodiments, considering that the current image generation model has better image generation capabilities for English Prompt than for other languages, the Prompt output by the first machine learning model is in English.

[0072] In some embodiments, a large language model template may be pre-set, and a large language model instruction may be generated according to the text information and the large language model template, and then the large language model instruction may be input into the large language model to obtain a Prompt.

[0073] The image acquisition unit 512 can acquire an image through a second machine learning model according to the prompt information. The second machine learning model is an image generation model, which can generate an image according to the input prompt.

[0074] The screening unit 513 can screen the prompt information according to the prompt information and the image, obtain the target prompt information, and obtain the text information used to generate the target prompt information as the target text information. In some embodiments, the screening unit 513 can execute the method in any embodiment of step S14 and step S15 above.

[0075] The sample determination unit 514 can associate the target text information with the target prompt information as sample data, for example, the sample data can be in the form of a (target text information, target prompt information) data pair. The sample data is used to fine-tune the third machine learning model, and the third machine learning model is used to output prompt information for generating an image according to the input text.

[0076] Based on the device in the embodiment shown above, the prompt information generated based on the text information can be screened by using the image generation quality, and text information and prompt information pairs with high consistency are screened out, and the prompt information in the screened text information and prompt information pairs is suitable for the image generation model. The sample data generation operation does not require manual adjustment of the text information input by the user, which reduces the pressure on technical personnel and is conducive to quickly providing a large amount of sample data, thereby optimizing the sample generation speed and sample quality of the machine learning model that uses sample data for user training and fine-tuning, and improving the data generation quality of the machine learning model, thereby improving the convenience and quality of generating images based on text.

[0077] Schematic diagrams of some embodiments of the model training system disclosed in the present invention are as follows Figure 6 shown.

[0078] The sample generating device 61 may be any one of the above-mentioned ones, and may execute the above-mentioned Figure 1 , Figure 2 The method of any of the embodiments shown.

[0079] The model training device 62 fine-tunes the pre-trained third machine learning model according to the sample data, and the model is used to output prompt information for generating an image according to the input text.

[0080] Based on the model training system in the embodiment shown above, the training efficiency and data generation quality of the third machine learning model can be improved, thereby improving the convenience and quality of text-based image generation.

[0081] Schematic diagrams of some embodiments of the image generating device disclosed in the present invention are as follows Figure 7 shown.

[0082] The information acquisition unit 71 can acquire descriptive information related to image generation from the user. In some embodiments, the descriptive information is text information, and the user can input text information based on his or her own expression habits and the language used. In some embodiments, the descriptive information related to image generation can be a description of the personality, identity, and appearance of the content (person or object) carried by the image, and can also include a description of environmental information. The above descriptive information is only an example and does not constitute an improper limitation on the present disclosure.

[0083] The prompt information determination unit 72 can obtain the prompt information based on the description information and the third machine learning model. Figure 6 The model training system shown is trained and generated, or according to the above Figure 3 The model training method mentioned in the illustrated embodiment is trained and generated. In some embodiments, the third machine learning model can be a large language model of various architectures, for example, the open source Qwen2-7B model can be selected.

[0084] The image generation unit 73 can generate a target image based on the image generation model according to the prompt information.

[0085] Based on the device in the embodiment shown above, the third machine learning model obtained through training can be used to convert the descriptive information input by the user into prompt information, and then generate an image based on the prompt information, thereby reducing the requirements for the user's descriptive ability and is conducive to improving the accuracy and convenience of generating images based on the descriptive information provided by the user.

[0086] In addition, the present disclosure provides a data processing device, which can be any one of the sample generation device, model training system, and image generation device mentioned above.

[0087] A structural diagram of an embodiment of the data processing device disclosed in the present invention is shown in FIG. Figure 8 As shown. The data processing device includes a memory 801 and a processor 802. Among them: the memory 801 can be a disk, a flash memory or any other non-volatile storage medium. The memory is used to store instructions in the corresponding embodiments of the sample generation method, the model training method or the image generation method mentioned above. The processor 802 is coupled to the memory 801 and can be implemented as one or more integrated circuits, such as a microprocessor or a microcontroller. The processor 802 is used to execute the instructions stored in the memory, which can improve the convenience and quality of generating images based on text.

[0088] In one embodiment, it is also possible to Fig. 9As shown, the data processing device 900 includes a memory 901 and a processor 902. The processor 902 is coupled to the memory 901 via a BUS 903. The data processing device 900 can also be connected to an external storage device 905 via a storage interface 904 to call external data, and can also be connected to a network or another computer system (not shown) via a network interface 906. No further detailed description will be given here.

[0089] In this embodiment, by storing data instructions in a memory and processing the instructions through a processor, the convenience and quality of generating images based on text can be improved.

[0090] In another embodiment, a computer-readable storage medium stores computer program instructions thereon, which, when executed by a processor, implement the steps of the method in the corresponding embodiment of the sample generation method, model training method, or image generation method mentioned above. It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, devices, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0091] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0092] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0094] So far, the present disclosure has been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed here.

[0095] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0096] It should be noted that the terms "first", "second", etc. in the specification, claims, and drawings of the present disclosure are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present disclosure rather than to limit it. Although the present disclosure has been described in detail with reference to the preferred embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present disclosure can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present disclosure, which should be included in the scope of the technical solution for protection of the present disclosure.

Claims

1. A sample generation method, comprising: According to the text information, obtaining prompt information for generating an image through a first machine learning model; According to the prompt information, an image is acquired through a second machine learning model; According to the prompt information and the image, the prompt information is filtered to obtain target prompt information; Acquire text information used to generate the target prompt information as target text information; The target text information and the target prompt information are associated with each other as sample data.

2. The sample generation method according to claim 1, wherein: The text information and the prompt information are in different languages, and the prompt information is in English.

3. The sample generation method according to claim 1, wherein: The filtering of the prompt information according to the prompt information and the image includes at least one of the following: Filter the image by at least one of machine screening or manual screening, and filter the prompt information used to generate the image by screening the image; The prompt information is filtered according to the degree to which the image satisfies the prompt information.

4. The sample generation method according to claim 1, further comprising: A predetermined amount of descriptive information related to image generation from at least one of a user and historical request data is obtained as the text information.

5. The sample generation method according to claim 1, wherein: The sample data is used to fine-tune a third machine learning model, and the third machine learning model is used to output prompt information for generating an image based on the input text.

6. A model training method, comprising: Generate sample data by the sample generation method according to any one of claims 1 to 5; The pre-trained third machine learning model is fine-tuned according to the sample data, wherein the third machine learning model is used to output prompt information for generating an image according to the input text.

7. A method for generating an image, comprising: Obtaining description information related to image generation from a user; According to the description information, prompt information is obtained based on a third machine learning model, where the third machine learning model is trained and generated by the method according to claim 6; According to the prompt information, a target image is generated based on an image generation model.

8. A data processing device, comprising: Memory; as well as A processor coupled to the memory, the processor being configured to execute the method according to any one of claims 1 to 6 based on instructions stored in the memory.

9. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Training method of image processing model and image generation method and device

    CN120339756A