Figure and graph model training method, text and graph model training device, text and graph model training device, text and graph model training equipment, storage medium and computer program product

By using regional sample text information to constrain the noisy images in the training of literary graph models, the problems of excessive training times and poor image generation results caused by random noise graphs are solved, and more efficient training and more accurate image generation are achieved .

CN118887306APending Publication Date: 2024-11-01CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410910953.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

During the training of literary graph model, the randomly generated noise graph is not constrained, resulting in too many training times, taking a long time, and the generated image effect is difficult to meet expectations, resulting in poor performance and low prediction accuracy.

Method used

By obtaining sample text sets, including global and regional sample text information, the noise image is constrained, and the spatial fill curve algorithm is used to fill the area to form a noise graph with text constraints of a specific area, and input it to the literary graph model for update. To reduce the number of training times and time and improve the accuracy of image generation.

Benefits of technology

It effectively reduces the number and time of training of literary and genomic graphics models, improves the accuracy of generated images, and makes the generation of key targets in the target image more accurate and achieves the expected results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887306A_ABST
    Figure CN118887306A_ABST
Patent Text Reader

Abstract

The invention discloses a text graph model training method and device, a text graph method and device, equipment, a storage medium and a computer program product. The text generation graph model training method comprises the steps of obtaining a sample text set; the sample text set comprises a first sample text and one or more second sample texts, the first sample text represents global sample text information, and the second sample text represents regional sample text information; constraining the noise image based on the one or more second sample texts to obtain a constrained noise image; updating a text graph model based on the constrained noise image and the first sample text to obtain an updated text graph model; the updated text graph model is used for determining a target image corresponding to a to-be-recognized target text set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text graph model training and text graph method, device, equipment, storage medium and computer program product. Background Art

[0002] Text-to-image technology is a major research direction in the field of text-to-image conversion, which refers to generating corresponding images based on text. The Stable Diffusion (SD) model is one of the important models for implementing text-to-image, which can perform image generation tasks based on text descriptions.

[0003] However, in the related art, during the training process of the SD model, since the randomly generated noise map is not constrained, the model is trained too many times and takes a long time, resulting in high training costs, and the effect of the image generated by the SD model is difficult to meet expectations, that is, the performance of the SD model is poor, resulting in the problem of low prediction accuracy. Summary of the invention

[0004] In order to solve the technical problems existing in the related art, the embodiments of the present application provide a text graph model training and text graph method, device, equipment, storage medium and computer program product.

[0005] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for training a text graph model, the method comprising:

[0007] Acquire a sample text set; the sample text set includes a first sample text and one or more second sample texts, the first sample text represents global sample text information, and the second sample text represents regional sample text information;

[0008] Constraining the noise image based on the one or more second sample texts to obtain a constrained noise image;

[0009] The text graph model is updated based on the constrained noise image and the first sample text to obtain an updated text graph model; the updated text graph model is used to determine a target image corresponding to a target text set to be recognized.

[0010] In a second aspect, the present application also provides a method for producing a text map, the method comprising:

[0011] Acquire a target text set to be recognized; the target text set includes a first target text and one or more second target texts, the first target text represents global target text information, and the second target text represents regional target text information;

[0012] Constraining the noisy image based on the one or more second target texts to obtain a constrained noisy image;

[0013] Inputting the constrained noise image and the first target text into an updated text graph model to obtain a target image corresponding to the target text set;

[0014] Wherein, the updated culture graph model is obtained based on any of the culture graph model training methods described above.

[0015] In a third aspect, an embodiment of the present application provides a device for training a cultural graph model, the device comprising:

[0016] A first acquisition unit is used to acquire a sample text set; the sample text set includes a first sample text and one or more second sample texts, the first sample text represents global sample text information, and the second sample text represents regional sample text information;

[0017] A first constraint unit, used for constraining the noise image based on the one or more second sample texts to obtain a constrained noise image;

[0018] An updating unit is used to update the text graph model based on the constrained noise image and the first sample text to obtain an updated text graph model; the updated text graph model is used to determine the target image corresponding to the target text set to be recognized.

[0019] In a fourth aspect, the present application also provides a Wenshengtu device, the device comprising:

[0020] A second acquisition unit is used to acquire a target text set to be recognized; the target text set includes a first target text and one or more second target texts, the first target text represents global target text information, and the second target text represents regional target text information;

[0021] A second constraint unit, used for constraining the noisy image based on the one or more second target texts to obtain a constrained noisy image;

[0022] A determination unit, configured to input the constrained noise image and the first target text into an updated text graph model to obtain a target image corresponding to the target text set;

[0023] Wherein, the updated culture graph model is obtained based on any of the culture graph model training methods described above.

[0024] In a fifth aspect, an embodiment of the present application provides a Wensheng graph model training device, comprising: a first processor and a first memory for storing a computer program that can be run on the first processor;

[0025] Wherein, when the first processor is used to run the computer program, it executes the steps of the method for training the text graph model described in any one of the embodiments of the present application.

[0026] In a sixth aspect, an embodiment of the present application provides a Wenshengtu device, including: a second processor and a second memory for storing a computer program that can be run on the second processor;

[0027] Wherein, when the second processor is used to run the computer program, it executes the steps of the Vincent diagram method described in any one of the embodiments of the present application.

[0028] In a seventh aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for training a Vincent graph model described in any one of the embodiments of the present application are implemented, or the steps of the Vincent graph method described in any one of the embodiments of the present application are implemented.

[0029] In an eighth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the Vincent graph model training method described in any one of the embodiments of the present application, or implements the steps of the Vincent graph method described in any one of the embodiments of the present application.

[0030] The embodiment of the present application provides a method, device, equipment, storage medium and computer program product for training a Wensheng graph model and a Wensheng graph, and obtains a sample text set; the sample text set includes a first sample text and one or more second sample texts, the first sample text represents global sample text information, and the second sample text represents regional sample text information; based on the one or more second sample texts, the noise image is constrained to obtain a constrained noise image; based on the constrained noise image and the first sample text, the Wensheng graph model is updated to obtain an updated Wensheng graph model; the updated Wensheng graph model is used to determine the target image corresponding to the target text set to be identified. Using the scheme of the embodiment of the present application, in the training process of the Wensheng graph model, the regional sample text information (i.e., regional text description) is used to constrain the noise image, so that the generated constrained noise image is not completely random before being input into the Wensheng graph model, but is constrained, that is, the text description of the region is supported to conditionally restrict the key area part of the noise image, thereby effectively reducing the number and time of training, reducing the training cost, and by adding the regional text description as a condition, the generation of key targets in the target image is more accurate, thereby achieving the expected effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a schematic diagram of the main structure of the SD model in the related art;

[0032] Figure 2 Schematic diagram of the training process of the SD model in the related art;

[0033] Figure 3 A schematic diagram of the process of the text graph model training method according to an embodiment of the present application;

[0034] Figure 4 A schematic diagram of the process flow of the Vincent graph method of an embodiment of the present application;

[0035] Figure 5 A schematic diagram of the training process of the SD model for regional text control according to an embodiment of the present application;

[0036] Figure 6 A schematic diagram of a Hilbert space filling curve according to an embodiment of the present application;

[0037] Figure 7 A schematic diagram of the text graph reasoning process for regional text control in an embodiment of the present application;

[0038] Figure 8 A schematic diagram of the composition structure of a Wensheng graph model training device according to an embodiment of the present application;

[0039] Fig. 9This is a schematic diagram of the composition structure of the Wenshengtu device of an embodiment of the present application;

[0040] Fig.10 A schematic diagram of the hardware structure of the Wensheng graph model training device according to an embodiment of the present application;

[0041] Fig.11 Schematic diagram of the hardware composition structure of the Wenshengtu device according to an embodiment of the present application. DETAILED DESCRIPTION

[0042] The present application will be further described in detail below with reference to the accompanying drawings and embodiments.

[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0044] The SD model is a latent diffusion model (LDMs, Latent Diffusion Models), specifically, a text-to-image model based on the denoising diffusion probability model (DDPM) for speed optimization. The text-to-image model can also be called a text-to-image model, which refers to generating corresponding pictures or images based on text descriptions. The code and training data of the SD model are open source.

[0045] The SD model introduces text condition in the UNet network to realize text-controlled image generation. The core of the SD model comes from the work of LDMs. LDMs is a model that can generate images. Specifically, LDMs first uses an autoencoder to compress the input sample image into the latent space, convert it into a compressed feature map, and perform denoising and denoising processes based on the feature map, that is, using a diffusion model to generate the latents of the sample image, rather than the conventional pixel-based diffusion model, which can make the calculation more efficient, that is, greatly reduce the amount of calculation, and finally based on the decoder module in the autoencoder, the generated image can be obtained.

[0046] Figure 1 Schematic diagram of the main structure of the SD model in the related art, wherein the main structure of the SD model mainly includes the following three modules:

[0047] Autoencoder: used to compress the input sample image into the potential feature space based on the encoder module in the autoencoder, while the decoder module in the autoencoder decodes the potential features of the sample image into the target image;

[0048] CLIP text encoder: It is used to extract text embeddings of input text and input them into the UNet network of the latent diffusion model as text condition through cross attention. CLIP is a classic work in text-image retrieval commonly used in related technologies.

[0049] UNet network: The main body of the latent diffusion model, used to achieve text-guided latent feature generation.

[0050] Figure 2 It is a schematic diagram of the training process of the SD model in the related art, such as Figure 2 As shown in the figure, during the training phase of the SD model, the interaction process of each module in the SD model is as follows: first, obtain the input text (that is, the input sample text, which is an overall description of the input sample image, such as a cute kitten and a cute puppy); secondly, use a text encoder (such as CLIP text encoder) to extract features from the input text, that is, obtain text features through feature extraction, and initialize a random noise map (the noise map can be predicted by DDPM); then, input the text features and the noise map into the UNet network of the latent diffusion model to generate denoised latent features, and finally send them to the decoding module to obtain the generated image.

[0051] When the SD model performs text-generated images, the text features of the input text are extracted through the CLIP text encoder module, and are input into the UNet network of the potential diffusion model as text conditions through the cross-attention method. It can be seen that the mainstream controllable text-generated image method in the related technology is based on mask + full-image text, which requires a lot of time and rounds to complete the model training process, resulting in high training costs. In addition, there is no way to intervene in the text description of the image area during the training process, that is, it does not support text description of different regions, which will make it difficult for the image generated by the model to achieve the expected effect, that is, the performance of the SD model is poor, resulting in the problem of low prediction accuracy.

[0052] Based on this, an embodiment of the present application proposes a method for training a text graph model. In various embodiments of the present application, in the process of training the text graph model, regional sample text information (i.e., regional text description) is used to constrain the noise image, so that the generated constrained noise image is not completely random before being input into the text graph model, but is constrained, that is, it supports regional text descriptions to conditionally restrict the key area part of the noise image, thereby effectively reducing the number and time of training, reducing training costs, and by adding regional text descriptions as conditions, the generation of key targets in the target image is more accurate, thereby achieving the expected effect.

[0053] The present application embodiment provides a method for training a text graph model, which is applied to a text graph model training device. Figure 3 Schematic diagram of the process of the text graph model training method of the embodiment of the present application; Figure 3 As shown, the method includes:

[0054] Step 301: Obtain a sample text set.

[0055] In an embodiment of the present application, the sample text set includes a first sample text and one or more second sample texts, the first sample text represents global sample text information, and the second sample text represents regional sample text information.

[0056] Here, the text-based graph model training device that executes the text-based graph model training method can be a computer device that performs image generation tasks based on text descriptions, wherein a computer device refers to an electronic device with data calculation and processing capabilities. For example, the executor of the text-based graph model training method of an embodiment of the present application can be a server.

[0057] In actual application, the first sample text and one or more second sample texts in the sample text set are associated with the sample image, that is, the sample text set and the sample image have a corresponding relationship. Specifically, the first sample text describes the entire image content of the sample image, and the one or more second sample texts are partial descriptions of the image content of the sample image, that is, a regional description of the sample image.

[0058] It should be noted that the purpose of the correspondence between the sample text set and the sample image is to enable the text graph model to fully learn the correspondence between the information of the text in the sample text set and the information in the sample image. The learning process of this correspondence is reflected in the original training process and inherent structure design of the text graph model. In addition, the text graph model training method of the embodiment of the present application does not change the inherent structure of the text graph model.

[0059] In one embodiment, the method further comprises: acquiring a sample image corresponding to the first sample text;

[0060] The obtaining of the sample text set includes: determining one or more area targets in the sample image; and performing text description on the one or more area targets to obtain one or more second sample texts in the sample text set.

[0061] Specifically, when annotating image data in a sample image, a specific target frame in the sample image is usually drawn, that is, each frame corresponds to a regional target, and then a text description is given to the regional target in each frame, so that one or more second sample texts in the sample text set can be obtained.

[0062] Here, the number of regional targets in the sample image matches the number of second sample texts, and one or more second sample texts are partial descriptions of the image content of the sample image, that is, a regional description of the image content of the sample image. For example, if the sample image includes both a kitten and a puppy, the corresponding second sample texts may be "a cute kitten" or "a cute puppy", that is, the number of second sample texts at this time is 2.

[0063] In one embodiment, the method further comprises: acquiring a sample image corresponding to the first sample text;

[0064] The obtaining of the sample text set includes: performing a text description on the entire sample image to obtain a first sample text in the sample text set.

[0065] Here, the first sample text describes the entire image content of the sample image, that is, a global description of the sample image. For example, if the sample image includes both a kitten and a puppy, the corresponding first sample text may be "a cute kitten and a cute puppy".

[0066] Step 302: constraining the noise image based on one or more second sample texts to obtain a constrained noise image.

[0067] In one embodiment, before constraining the noise image based on one or more second sample texts to obtain the constrained noise image, the method may further include: initializing a random noise image to obtain the noise image.

[0068] Here, the Wensheng graph model training device initializes a random noise map for the potential features in the potential feature space of the sample image, and a multi-dimensional noise image can be obtained. Specifically, the random noise map can be predicted by the DDPM model. In practical applications, although the generation of the random noise map is random, the position of the random noise map is not random, but has a specific position, that is, the position of the random noise map corresponds to the regional target position of the sample image.

[0069] It should be noted that the Wensheng graph model training device can use an autoencoder to compress the input sample image into Latent Space, convert the sample image into a compressed feature map, and perform noise processing on the compressed feature map, that is, initialize a random noise map for the compressed feature map of the sample image to obtain a corresponding noise image.

[0070] In actual application, the Wensheng graph model training device has a constraint on the randomly generated noise image, so that the key area of ​​the noise image is not completely random, but conditionally restricted, thereby reducing the number and time of model training and reducing the cost of model training.

[0071] Based on this, in one embodiment, constraining the noise image based on the one or more second sample texts to obtain the constrained noise image includes: feature encoding the one or more second sample texts to obtain corresponding one or more first sample text features; constraining the noise image based on the one or more first sample text features to obtain the constrained noise image.

[0072] Here, after acquiring one or more second sample texts, the text graph model training device can first segment the regional sample text information (i.e., regional description text) represented by the one or more second sample texts, and then feature encode all the segmented words to obtain corresponding text features, and then conditionally restrict the noise image based on the text features.

[0073] In one embodiment, constraining the noise image based on the one or more first sample text features to obtain the constrained noise image includes: performing region filling on the noise image based on the one or more first sample text features to obtain the constrained noise image.

[0074] Specifically, the region filling of the noise image based on the one or more first sample text features to obtain the constrained noise image includes: using a space filling curve algorithm to fill the one or more first sample text features at the target position of the noise image to obtain the constrained noise image; wherein the target position of the noise image corresponds to the region target position of the sample image.

[0075] Here, there are many types of space filling curve (SFC) algorithms, such as the Hilbert space filling curve algorithm. Since the linear mapping of the Hilbert space filling curve is superior to other space filling curves in maintaining locality, the embodiment of the present application can use the Hilbert space filling curve algorithm to fill the region of the noise image. Specifically, one or more first sample text features (text embeddings) are placed at a specific position, i.e., the target position of the noise image, and the Hilbert space filling curve algorithm is used to fill the region to form a noise image with text constraints in a specific region, i.e., the constrained noise image.

[0076] It should be noted that the Hilbert space filling curve algorithm is used to fill the region to form a noise map with text constraints for a specific region. The specific implementation process is as follows: after the regional sample text information represented by one or more second sample texts is segmented and feature encoded, the specific region is divided and traversed according to the Hilbert space filling curve algorithm, and one or more first sample text features are filled into the latent feature space to form a noise map with text constraints for a specific region. This can impose a constraint on the randomly generated noise image, so that the part described by the regional text is not completely random, thereby reducing the number of model training times.

[0077] Here, the Hilbert space filling curve is a continuous fractal curve. Specifically, through a finite number of recursive operations, the multi-dimensional space of the noise image can be divided into multiple grids, and then a continuous curve passes through all the grids, so as to realize the traversal and filling of the one-dimensional first sample text feature into the designated specific area of ​​the noise image.

[0078] Step 303: updating the text graph model based on the constrained noise image and the first sample text to obtain an updated text graph model.

[0079] In an embodiment of the present application, the updated text graph model is used to determine a target image corresponding to a target text set to be recognized.

[0080] In actual application, the text-based graph model training device first uses the text-based graph model to obtain a predicted image of the first sample text, and then updates the text-based graph model based on the predicted image and the sample image.

[0081] Based on this, in one embodiment, the updating of the Vensheng graph model based on the constrained noise image and the first sample text to obtain the updated Vensheng graph model includes: inputting the constrained noise image and the first sample text into the Vensheng graph model to obtain a predicted image of the first sample text; and updating the Vensheng graph model based on the predicted image and a sample image corresponding to the first sample text to obtain the updated Vensheng graph model.

[0082] Here, in one embodiment, the step of inputting the constrained noise image and the first sample text into the text graph model to obtain a predicted image of the first sample text includes: performing feature encoding on the first sample text to obtain features of the second sample text; inputting the constrained noise image and the second sample text features into the text graph model to obtain a predicted image of the first sample text; wherein the text graph model includes a UNet network, and the predicted image represents an image generated based on the denoised latent features.

[0083] Here, the text-based graph model training device first segments the global sample text information represented by the first sample text, and then performs feature encoding on all the segmented words to obtain corresponding text features, namely, the second sample text features; then, the constrained noise image and the second sample text features are simultaneously input into the UNet network of the text-based graph model to obtain a predicted image.

[0084] It should be noted that the Wensheng graph model of the embodiment of the present application can be an SD model, specifically LDMs. The UNet network included in the Wensheng graph model is a convolutional neural network, which is a variant of the fully convolutional network (FCN, Fully Convolutional Networks). It is simple, efficient, easy to understand, and easy to build, and can be trained from a small data set. Among them, the network structure of the UNet network is symmetrical, and is mainly composed of two main parts: the Encoder module and the Decoder module, wherein the Encoder consists of convolution operations and downsampling operations for feature extraction; the Decoder consists of upsampling operations and convolution operations for restoring the original resolution of the feature map.

[0085] In an embodiment of the present application, after the constrained noise image and the second sample text features are simultaneously input into the UNet network of the text graph model, denoised latent features are first generated, and then the denoised latent features are input into the Decoder module of the UNet network. The original resolution of the denoised latent features is restored through the Decoder module to obtain a predicted image.

[0086] In actual application, after obtaining the predicted image, the Wensheng graph model training device can construct a loss function based on the predicted image and the sample image, and use the loss function to update the Wensheng graph model.

[0087] Based on this, in one embodiment, the updating of the text graph model based on the predicted image and the sample image corresponding to the first sample text to obtain the updated text graph model includes: determining a loss function based on the predicted image and the sample image; and adjusting the parameters of the text graph model using the loss function until the training is completed to obtain the updated text graph model.

[0088] Here, the Wensheng graph model training device can determine the error value based on the predicted image and the sample image, that is, construct a loss function. When the error value is within a preset threshold range, it is determined that the Wensheng graph model has converged; when the error value is not within the preset threshold range, the model parameters in the Wensheng graph model are adjusted until the error value reaches the preset threshold range, and it is determined that the Wensheng graph model has converged. At this time, the training ends, and the converged Wensheng graph model is used as the updated Wensheng graph model.

[0089] By adopting the technical solution of the embodiment of the present application, during the training process of the text graph model, the noise image is constrained using regional sample text information, so that the generated constrained noise image is not completely random but constrained before being input into the text graph model, that is, it supports the conditional restriction of the key area part of the noise image by the regional text description, thereby effectively reducing the number and time of training and reducing the training cost.

[0090] The embodiment of the present application also provides a method for generating a Wensheng graph, which is applied to a Wensheng graph device. Figure 4 Schematic diagram of the process of the Wensheng diagram method of the embodiment of the present application; Figure 4 As shown, the method includes:

[0091] Step 401: Obtain a target text set to be recognized.

[0092] In an embodiment of the present application, the target text set includes a first target text and one or more second target texts, the first target text represents global target text information, and the second target text represents regional target text information.

[0093] Here, the text-generated image device that executes the text-generated image method can be a computer device that performs an image generation task based on the text description to be recognized, wherein the computer device refers to an electronic device with data calculation and processing capabilities. For example, the executor of the text-generated image method of the embodiment of the present application can be a server.

[0094] Step 402: constraining the noise image based on one or more second target texts to obtain a constrained noise image.

[0095] In one embodiment, before constraining the noise image based on one or more second target texts to obtain the constrained noise image, the method may further include: initializing a random noise map to obtain the noise image.

[0096] Here, the Vincent image device initializes a random noise map for the potential features in the potential feature space of the sample image, and thus obtains a multi-dimensional noise image. Specifically, the random noise map can be predicted by the DDPM model. In practical applications, although the generation of the random noise map is random, the position of the random noise map is not random, but has a specific position, that is, the position of the random noise map corresponds to the regional target position of the sample image.

[0097] It should be noted that the Wensheng graph device can use an automatic encoder to compress the input sample image into a latent feature space, convert the sample image into a compressed feature map, and perform noise processing on the compressed feature map, that is, initialize a random noise map for the compressed feature map of the sample image to obtain a corresponding noise image.

[0098] In actual application, the Wensheng image device has a constraint on the randomly generated noise image, so that the key area of ​​the noise image is not completely random, but conditionally restricted, thereby reducing the number of model inferences.

[0099] Based on this, in one embodiment, constraining the noise image based on one or more second target texts to obtain a constrained noise image includes: feature encoding the one or more second target texts to obtain corresponding one or more first target text features; constraining the noise image based on the one or more first target text features to obtain a constrained noise image.

[0100] Here, after acquiring one or more second target texts, the text image device can first segment the regional target text information represented by the one or more second target texts, and then feature encode all the segmented words to obtain corresponding target text features, and then conditionally restrict the noise image based on the target text features.

[0101] In one embodiment, constraining the noise image based on the one or more first target text features to obtain the constrained noise image includes: performing region filling on the noise image based on the one or more first target text features to obtain the constrained noise image.

[0102] Specifically, the region filling of the noise image based on the one or more first target text features to obtain the constrained noise image includes: using a space filling curve algorithm to fill the one or more first target text features at the target position of the noise image to obtain the constrained noise image; wherein the target position of the noise image corresponds to the region target position of the sample image.

[0103] Here, there are many types of space filling curve algorithms, for example, the Hilbert space filling curve algorithm. Since the linear mapping of the Hilbert space filling curve is superior to other space filling curves in maintaining locality, the embodiment of the present application can use the Hilbert space filling curve algorithm to fill the region of the noise image. Specifically, one or more first target text features are placed at a specific position, i.e., the target position of the noise image, and the Hilbert space filling curve algorithm is used to fill the region to form a noise image with text constraints in a specific region, i.e., the constrained noise image.

[0104] It should be noted that the Hilbert space filling curve algorithm is used to fill the region to form a noise map with text constraints on specific regions. The specific implementation process is as follows: after word segmentation and feature encoding of one or more second target texts, the specific region is divided and traversed according to the Hilbert space filling curve algorithm, and one or more first target text features are filled into the latent feature space to form a noise map with text constraints on specific regions. This can impose a constraint on the randomly generated noise image, so that the part of the regional text description is not completely random, thereby reducing the number of model inference times.

[0105] Here, the Hilbert space filling curve is a continuous fractal curve. Specifically, through a finite number of recursive operations, the multidimensional space of the noise image can be divided into multiple grids, and then a continuous curve passes through all the grids, so as to realize the traversal and filling of the one-dimensional first target text feature into the designated specific area of ​​the noise image.

[0106] Step 403: input the constrained noise image and the first target text into the updated text graph model to obtain a target image corresponding to the target text set.

[0107] In an embodiment of the present application, the updated culture graph model is obtained based on the culture graph model training method in any of the above embodiments.

[0108] In one embodiment, the constrained noise image and the first target text are input into an updated Vincent graph model to obtain a target image corresponding to the target text set, including: feature encoding the first target text to obtain second target text features; inputting the constrained noise image and the second target text features into the updated Vincent graph model to obtain denoised latent features; and decoding the denoised latent features to obtain the target image.

[0109] Here, the text graph device first segments the global target text information represented by the first target text, and then performs feature encoding on all the segmented words to obtain corresponding text features, namely, second target text features; then, the constrained noise image and the second target text features are simultaneously input into the UNet network of the updated text graph model to obtain denoised latent features, a latent feature space can be formed based on the denoised latent features, and the denoised latent features are input into the decoding module to obtain the target image.

[0110] By adopting the technical solution of the embodiment of the present application, by adding the regional text description as a condition, the generated target image and the input target text set to be recognized are kept more consistent, that is, the generation of key targets in the target image is more accurate, thereby achieving the expected effect.

[0111] The present application is described below in conjunction with application examples.

[0112] This application mainly focuses on solving the problem in the related art that in the process of SD model performing text-generated mapping, the global text description (corresponding to the aforementioned first target text) does not impose precise conditional restrictions on specific areas during the image generation process, resulting in too many rounds of training and reasoning processes, and the generated target image does not meet expectations. A controllable text-generated mapping method based on regional text description is proposed.

[0113] In the model training stage, this application improves on the original SD model training process, that is, adds regional text descriptions to the sample text (corresponding to one or more second target texts mentioned above). This will make the generation of key targets more accurate, reduce the number of model training rounds, and also have corresponding changes in the model reasoning stage.

[0114] Figure 5 Schematic diagram of the training process of the SD model for regional text control in an embodiment of the present application, such as Figure 5 As shown, the specific implementation steps of the training process are as follows:

[0115] 1. When labeling data, a specific target frame will be drawn for the input sample image, and a regional text description will be given to the target in the frame (for example, "a cute kitten", "a cute puppy"). At the same time, an overall text description will be labeled for the image content of the input sample image (for example, "a cute kitten and a cute puppy");

[0116] 2. According to the text description of the specific region input (corresponding to the one or more second sample texts mentioned above) and the overall text description (corresponding to the first sample text mentioned above), text features are extracted through a text encoder, that is, text features corresponding to the two regional texts and text features corresponding to the overall text description are obtained;

[0117] 3. Initialize a random noise map. However, the specific position of the noise map, that is, the position corresponding to the annotated image, is not random. Instead, the text features corresponding to the two regional texts are filled in these specific positions using the space filling curve algorithm to form a noise map with text constraints in specific regions.

[0118] 4. The noise map constrained by the regional text description is sent to the Unet network of the diffusion model. At the same time, the text features generated by the text description of the entire image are also sent to the Unet network of the diffusion model, thus generating the denoised latent features. The denoised latent features are then sent to the decoding module to obtain the generated image.

[0119] The improvement of the present application lies in the addition of a regional text description part. After the regional description text is segmented and feature encoded, the specific area is divided and traversed according to a space filling curve algorithm, such as the Hilbert space filling curve method, and the text features corresponding to the regional text are filled into the latent feature space. This can impose a constraint on the randomly generated noise image, so that the part of the regional text description is not completely random, thereby reducing the number of training and inference times.

[0120] Figure 6 Schematic diagram of the Hilbert space filling curve of the embodiment of the present application, wherein the left figure shows the Hilbert space filling curve when the recursion number r is 1, and the right figure shows the Hilbert space filling curve when the recursion number r is 2. Figure 6 It can be seen that the Hilbert space filling curve is a continuous fractal curve, which can completely fill a plane area through continuous motion, divide the multidimensional space into numerous grids through a finite number of recursive operations, and then pass through all the grids through a continuous curve, so that the one-dimensional text features can be filled into the designated specific area.

[0121] It can be seen that the space filling curve is very suitable for traversing and filling text feature data into the generated noise image. There are many ways of space filling curve. This application uses the Hilbert space filling curve method because the linear mapping based on the Hilbert space filling curve is superior to other space filling curves in maintaining locality.

[0122] Figure 7 Schematic diagram of the reasoning process of the text graph of the regional text control of the embodiment of the present application. This reasoning stage can also reduce the number of reasoning times, such as Figure 7 As shown in FIG. 1 , when performing model inference, the regional text in the input text (for example, “a cute kitten”, “a cute puppy”) is first input into the text encoder for feature extraction to obtain the corresponding two text features; then, the generated random noise map is filled in the region at a specific position using the space filling curve method to obtain the constrained noise map; finally, the text features corresponding to the overall text description (for example, “a cute kitten and a cute puppy”) and the constrained noise map are combined into a grid. Figure 1 And send it to the UNet network to obtain the denoised latent features, and send the denoised latent features to the automatic decoder module to obtain the generated image (corresponding to the aforementioned target image).

[0123] The main application scenario of this application is a controllable text-based image method based on regional text description. When training the SD model of the text-based image, this method uses regional text description to constrain the randomly generated noise image, thereby reducing the number of training and inference times, making the generated image more in line with expectations.

[0124] During the model training phase, Figure 5As shown, the image data in the input image (corresponding to the aforementioned sample image) is annotated to obtain the annotated data, and the annotated data includes the regional target position and the regional text describing it (corresponding to the aforementioned one or more second sample texts, for example, "a cute kitten", "a cute puppy"), and a description text of the entire image (i.e., the text description of the entire image, corresponding to the aforementioned first sample text, for example, "a cute kitten and a cute puppy"). The input text includes the regional text and the text description of the entire image. During the training process, the input image is automatically encoded by the autoencoder and enters the potential feature space. At the same time, the text encoder performs feature encoding on the two regional texts, namely, "a cute kitten" and "a cute puppy", respectively, to generate two corresponding text features, and the space filling curve method is used to traverse the two text features corresponding to the regional text into the random noise map, constrain the random noise map, and then send the constrained noise map and the text features generated based on the text description of the entire image to the Unet network of the diffusion model to generate denoised latent features. Finally, the denoised latent features are passed through the decoding module to obtain the generated image.

[0125] In the model inference phase, Figure 7 As shown, the text features generated based on the regional text (for example, "a cute kitten", "a cute puppy") are used to constrain the randomly generated noise image using the space filling curve method, and then the constrained noise image and the text features generated by the text describing the overall image (for example, "a cute kitten and a cute puppy") are sent to the Unet network together. After obtaining the latent feature space, the target image to be generated is obtained after passing through the automatic decoder module.

[0126] In summary, this application proposes a new SD text graph model algorithm. Since the randomly generated noise graph in the SD text graph model algorithm of the related art is not constrained, the number of training rounds and inference times is too many, which takes a long time, and there is a situation where the generated image may not meet expectations. Based on the original SD model, this application adds regional text descriptions and uses the method of space filling curves to fill the region, so that the key area of ​​the randomly generated noise graph will have text constraints, thereby reducing the number of training and inference times, and making the generated image more in line with expectations.

[0127] Compared with the methods of the related art, the solution of the present application has the following beneficial effects:

[0128] This application proposes a solution for a controllable text map based on regional text description. On the basis of the original SD model, the solution adds regional text description and uses the space filling curve method to fill the region of the generated random noise map, so that the generated noise map is not completely random before entering the Unet network, but is constrained and supports regional text description. This can effectively reduce the time and number of model training and reasoning, and can make the generated image more in line with expectations, which is also a relatively large optimization in terms of model performance.

[0129] In order to implement the Wensheng graph model training method of the embodiment of the present application, the embodiment of the present application also provides a Wensheng graph model training device, which is arranged on the Wensheng graph model training device. Figure 8 Schematic diagram of the composition structure of the text graph model training device of the embodiment of the present application, such as Figure 8 As shown, the text graph model training device includes:

[0130] A first acquisition unit 81 is used to acquire a sample text set; the sample text set includes a first sample text and one or more second sample texts, the first sample text represents global sample text information, and the second sample text represents regional sample text information;

[0131] A first constraint unit 82, configured to constrain the noise image based on the one or more second sample texts to obtain a constrained noise image;

[0132] The updating unit 83 is used to update the text graph model based on the constrained noise image and the first sample text to obtain an updated text graph model; the updated text graph model is used to determine the target image corresponding to the target text set to be recognized.

[0133] In one embodiment, the first acquisition unit 81 is further used to acquire a sample image corresponding to the first sample text;

[0134] The first acquisition unit 81 is specifically used to:

[0135] Determine one or more area targets in the sample image;

[0136] Performing a text description on the one or more regional targets to obtain one or more second sample texts in the sample text set.

[0137] In one embodiment, the first acquisition unit 81 is further used to acquire a sample image corresponding to the first sample text;

[0138] The first acquisition unit 81 is specifically used to:

[0139] A text description is performed on the entire sample image to obtain a first sample text in the sample text set.

[0140] In one embodiment, the first constraint unit 82 includes a first encoding unit and a first constraint sub-unit; wherein,

[0141] The first encoding unit is used to perform feature encoding on the one or more second sample texts to obtain corresponding one or more first sample text features;

[0142] The first constraint subunit is used to constrain the noise image based on the one or more first sample text features to obtain a constrained noise image.

[0143] In one embodiment, the first constraint subunit is specifically used to:

[0144] The noise image is region-filled based on the one or more first sample text features to obtain the constrained noise image.

[0145] In another embodiment, the first constraint subunit is further specifically configured to:

[0146] Using a space filling curve algorithm, filling the one or more first sample text features at target positions of the noise image to obtain the constrained noise image;

[0147] The target position of the noise image corresponds to the regional target position of the sample image.

[0148] In one embodiment, the updating unit 83 includes an input subunit and an updating subunit; wherein,

[0149] The input subunit is used to input the constrained noise image and the first sample text into the text graph model to obtain a predicted image of the first sample text;

[0150] The updating subunit is used to update the text graph model based on the predicted image and the sample image corresponding to the first sample text to obtain the updated text graph model.

[0151] In one embodiment, the input subunit is specifically used for:

[0152] Performing feature encoding on the first sample text to obtain features of the second sample text;

[0153] Inputting the constrained noise image and the second sample text feature into the text graph model to obtain a predicted image of the first sample text;

[0154] The text graph model includes a UNet network, and the predicted image representation is an image generated based on the denoised latent features.

[0155] In one embodiment, the updating subunit is specifically used for:

[0156] Determining a loss function based on the predicted image and the sample image;

[0157] The loss function is used to adjust the parameters of the Wensheng graph model until the training is completed to obtain the updated Wensheng graph model.

[0158] In actual application, the first acquisition unit 81 can be implemented by a communication interface in the text graph model training device, and the first constraint unit 82 and the updating unit 83 can be implemented by a processor in the text graph model training device.

[0159] It should be noted that: the Wensheng graph model training device provided in the above embodiment only uses the division of the above program modules as an example when performing Wensheng graph model training. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the Wensheng graph model training device provided in the above embodiment and the Wensheng graph model training method embodiment belong to the same concept. The specific implementation process is detailed in the Wensheng graph model training method embodiment, which will not be repeated here.

[0160] In order to implement the Wenshengtu method of the embodiment of the present application, the embodiment of the present application further provides a Wenshengtu device, which is arranged on a Wenshengtu device. Fig. 9 Schematic diagram of the composition structure of the Wensheng graph device of the embodiment of the present application, such as Fig. 9 As shown, the Wenshengtu device includes:

[0161] A second acquisition unit 91 is used to acquire a target text set to be recognized; the target text set includes a first target text and one or more second target texts, the first target text represents global target text information, and the second target text represents regional target text information;

[0162] A second constraint unit 92, configured to constrain the noise image based on the one or more second target texts to obtain a constrained noise image;

[0163] A determination unit 93, configured to input the constrained noise image and the first target text into an updated text graph model to obtain a target image corresponding to the target text set;

[0164] The updated text graph model is obtained based on the text graph model training method in any of the above embodiments.

[0165] In one embodiment, the second constraint unit 92 includes a second encoding unit and a second constraint sub-unit; wherein,

[0166] The second encoding unit is used to perform feature encoding on the one or more second target texts to obtain corresponding one or more first target text features;

[0167] The second constraint subunit is used to constrain the noise image based on the one or more first target text features to obtain a constrained noise image.

[0168] In one embodiment, the second constraint subunit is specifically used to:

[0169] The noise image is region-filled based on the one or more first target text features to obtain the constrained noise image.

[0170] In another embodiment, the second constraint subunit is further specifically used for:

[0171] Using a space filling curve algorithm, the one or more first target text features are filled in the target position of the noise image to obtain the constrained noise image;

[0172] The target position of the noise image corresponds to the regional target position of the sample image.

[0173] In one embodiment, the determining unit 93 is specifically configured to:

[0174] Performing feature encoding on the first target text to obtain features of the second target text;

[0175] Inputting the constrained noise image and the second target text feature into the updated text graph model to obtain denoised latent features;

[0176] The denoised latent features are decoded to obtain the target image.

[0177] In actual application, the second acquisition unit 91 can be implemented by a communication interface in the text image device, and the second constraint unit 92 and the determination unit 93 can be implemented by a processor in the text image device.

[0178] It should be noted that: the Wensheng map device provided in the above embodiment only uses the division of the above program modules as an example when performing Wensheng map. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the Wensheng map device provided in the above embodiment and the Wensheng map method embodiment belong to the same concept, and the specific implementation process is detailed in the Wensheng map method embodiment, which will not be repeated here.

[0179] Based on the hardware implementation of the above program modules, and in order to implement the Wensheng graph model training method of the embodiment of the present application, the embodiment of the present application also provides a Wensheng graph model training device, Fig.10 Schematic diagram of the hardware structure of the Wensheng graph model training device of the embodiment of the present application, such as Fig.10 As shown, the text graph model training device 100 includes:

[0180] The first communication interface 101 is capable of exchanging information with other devices;

[0181] The first processor 102 is connected to the first communication interface 101 to realize information interaction with other devices, and is used to execute the methods provided by one or more technical solutions on the above-mentioned model training side when running a computer program, and the computer program is stored in the first memory 103.

[0182] Specifically, the first communication interface 101 is used to obtain a sample text set; the sample text set includes a first sample text and one or more second sample texts, the first sample text represents global sample text information, and the second sample text represents regional sample text information;

[0183] The first processor 102 is used to constrain the noise image based on the one or more second sample texts to obtain a constrained noise image; update the text graph model based on the constrained noise image and the first sample text to obtain an updated text graph model; the updated text graph model is used to determine the target image corresponding to the target text set to be recognized.

[0184] In one embodiment, the first communication interface 101 is further used to obtain a sample image corresponding to the first sample text;

[0185] The first communication interface 101 is specifically used for:

[0186] Determine one or more area targets in the sample image;

[0187] Performing a text description on the one or more regional targets to obtain one or more second sample texts in the sample text set.

[0188] In one embodiment, the first communication interface 101 is further used to obtain a sample image corresponding to the first sample text;

[0189] The first communication interface 101 is specifically used for:

[0190] A text description is performed on the entire sample image to obtain a first sample text in the sample text set.

[0191] In one embodiment, the first processor 102 is specifically configured to:

[0192] Performing feature encoding on the one or more second sample texts to obtain corresponding one or more first sample text features;

[0193] The noise image is constrained based on the one or more first sample text features to obtain a constrained noise image.

[0194] In one embodiment, the first processor 102 is specifically configured to:

[0195] The noise image is region-filled based on the one or more first sample text features to obtain the constrained noise image.

[0196] In one embodiment, the first processor 102 is specifically configured to:

[0197] Using a space filling curve algorithm, filling the one or more first sample text features at target positions of the noise image to obtain the constrained noise image;

[0198] The target position of the noise image corresponds to the regional target position of the sample image.

[0199] In one embodiment, the first processor 102 is specifically configured to:

[0200] Inputting the constrained noise image and the first sample text into the text graph model to obtain a predicted image of the first sample text;

[0201] The text graph model is updated based on the predicted image and the sample image corresponding to the first sample text to obtain the updated text graph model.

[0202] In one embodiment, the first processor 102 is specifically configured to:

[0203] Performing feature encoding on the first sample text to obtain features of the second sample text;

[0204] Inputting the constrained noise image and the second sample text feature into the text graph model to obtain a predicted image of the first sample text;

[0205] The text graph model includes a UNet network, and the predicted image representation is an image generated based on the denoised latent features.

[0206] In one embodiment, the first processor 102 is specifically configured to:

[0207] Determining a loss function based on the predicted image and the sample image;

[0208] The loss function is used to adjust the parameters of the Wensheng graph model until the training is completed to obtain the updated Wensheng graph model.

[0209] It should be noted that the specific processing process of the first communication interface 101 and the first processor 102 can be understood by referring to the above-mentioned Wensheng graph model training method.

[0210] Of course, in actual application, the various components in the Wensheng graph model training device 100 are coupled together through the first bus system 104. It can be understood that the first bus system 104 is used to realize the connection and communication between these components. In addition to the data bus, the first bus system 104 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig.10 In the figure, various buses are labeled as a first bus system 104 .

[0211] The first memory 103 in the embodiment of the present application is used to store various types of data to support the operation of the Wensheng graph model training device 100. Examples of such data include: any computer program used to operate on the Wensheng graph model training device 100.

[0212] The Wensheng graph model training method disclosed in the above embodiment of the present application can be applied to the first processor 102, or implemented by the first processor 102. The first processor 102 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the Wensheng graph model training method can be completed by the hardware integrated logic circuit or software instructions in the first processor 102. The above-mentioned first processor 102 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The first processor 102 can implement or execute the various Wensheng graph model training methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the Wensheng graph model training method disclosed in the embodiments of the present application, it can be directly embodied as a hardware decoding processor for execution, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the first memory 103. The first processor 102 reads the information in the first memory 103 and completes the steps of the aforementioned text graph model training method in combination with its hardware.

[0213] In an exemplary embodiment, the Wensheng graph model training device 100 can be implemented by one or more application-specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general-purpose processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned Wensheng graph model training method.

[0214] Based on the hardware implementation of the above program modules, and in order to implement the Wensheng diagram method of the embodiment of the present application, the embodiment of the present application also provides a Wensheng diagram device, Fig.11 Schematic diagram of the hardware structure of the Wenshengtu device of the embodiment of the present application. Fig.11 As shown, the text image device 110 includes:

[0215] The second communication interface 1101 is capable of exchanging information with other devices;

[0216] The second processor 1102 is connected to the second communication interface 1101 to implement information interaction with other devices, and is used to execute the methods provided by one or more technical solutions on the above-mentioned model application side when running a computer program, and the computer program is stored in the second memory 1103.

[0217] Specifically, the second communication interface 1101 is used to obtain a target text set to be recognized; the target text set includes a first target text and one or more second target texts, the first target text represents global target text information, and the second target text represents regional target text information;

[0218] The second processor 1102 is configured to constrain the noise image based on the one or more second target texts to obtain a constrained noise image; input the constrained noise image and the first target text into the updated text graph model to obtain a target image corresponding to the target text set;

[0219] The updated document graph model is obtained based on the document graph model training method of any of the above embodiments.

[0220] In one embodiment, the second processor 1102 is specifically configured to:

[0221] Performing feature encoding on the one or more second target texts to obtain corresponding one or more first target text features;

[0222] The noisy image is constrained based on the one or more first target text features to obtain a constrained noisy image.

[0223] In one embodiment, the second processor 1102 is specifically configured to:

[0224] The noise image is region-filled based on the one or more first target text features to obtain the constrained noise image.

[0225] In one embodiment, the second processor 1102 is specifically configured to:

[0226] Using a space filling curve algorithm, the one or more first target text features are filled in the target position of the noise image to obtain the constrained noise image;

[0227] The target position of the noise image corresponds to the regional target position of the sample image.

[0228] In one embodiment, the second processor 1102 is specifically configured to:

[0229] Performing feature encoding on the first target text to obtain features of the second target text;

[0230] Inputting the constrained noise image and the second target text feature into the updated text graph model to obtain denoised latent features;

[0231] The denoised latent features are decoded to obtain the target image.

[0232] It should be noted that the specific processing process of the second communication interface 1101 and the second processor 1102 can be understood by referring to the above-mentioned Wensheng diagram method.

[0233] Of course, in actual application, the various components in the Wenshengtu device 110 are coupled together through the second bus system 1104. It can be understood that the second bus system 1104 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 1104 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig.11 Various buses are labeled as a second bus system 1104 .

[0234] The second memory 1103 in the embodiment of the present application is used to store various types of data to support the operation of the Vincent and Figure device 110. Examples of such data include: any computer program used to operate on the Vincent and Figure device 110.

[0235] The above-mentioned Wensheng diagram method disclosed in the embodiment of the present application can be applied to the second processor 1102, or implemented by the second processor 1102. The second processor 1102 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above-mentioned Wensheng diagram method can be completed by the hardware integrated logic circuit or software instructions in the second processor 1102. The above-mentioned second processor 1102 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The second processor 1102 can implement or execute the various Wensheng diagram methods, steps and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the Wensheng diagram method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the second memory 1103. The second processor 1102 reads the information in the second memory 1103 and completes the steps of the above-mentioned Wensheng diagram method in combination with its hardware.

[0236] In an exemplary embodiment, the Vincent diagram device 110 may be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general purpose processors, controllers, MCUs, microprocessors, or other electronic components to perform the aforementioned Vincent diagram method.

[0237] It can be understood that the memory (including the first memory 103 and the second memory 1103) of the embodiment of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a ferromagnetic random access memory, a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.

[0238] In an exemplary embodiment, the embodiment of the present application further provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a first memory 103 storing a computer program, the computer program can be executed by the first processor 102 in the Wensheng graph model training device 100 to complete the steps of the aforementioned Wensheng graph model training method, or, including a second memory 1103 storing a computer program, the computer program can be executed by the second processor 1102 in the Wensheng graph device 110 to complete the steps of the aforementioned Wensheng graph method. Among them, the computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM.

[0239] In an exemplary embodiment, the embodiment of the present application also provides a computer program product, including a computer program, which can be executed by the first processor 102 in the Wensheng graph model training device 100 to complete the steps of the aforementioned Wensheng graph model training method, or the computer program can be executed by the second processor 1102 in the Wensheng graph device 110 to complete the steps of the aforementioned Wensheng graph method.

[0240] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0241] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.

[0242] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which 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 method for training a text graph model, characterized in that: The method comprises: Acquire a sample text set; the sample text set includes a first sample text and one or more second sample texts, the first sample text represents global sample text information, and the second sample text represents regional sample text information; Constraining the noise image based on the one or more second sample texts to obtain a constrained noise image; The text graph model is updated based on the constrained noise image and the first sample text to obtain an updated text graph model; the updated text graph model is used to determine a target image corresponding to a target text set to be recognized.

2. The method according to claim 1, characterized in that The method further comprises: acquiring a sample image corresponding to the first sample text; The step of obtaining a sample text set includes: Determine one or more area targets in the sample image; Performing a text description on the one or more regional targets to obtain one or more second sample texts in the sample text set.

3. The method according to claim 1, characterized in that The method further comprises: acquiring a sample image corresponding to the first sample text; The step of obtaining a sample text set includes: A text description is performed on the entire sample image to obtain a first sample text in the sample text set.

4. The method according to claim 1, characterized in that: The constraining the noise image based on the one or more second sample texts to obtain the constrained noise image includes: Performing feature encoding on the one or more second sample texts to obtain corresponding one or more first sample text features; The noise image is constrained based on the one or more first sample text features to obtain a constrained noise image.

5. The method according to claim 4, characterized in that The constraining the noise image based on the one or more first sample text features to obtain a constrained noise image includes: The noise image is region-filled based on the one or more first sample text features to obtain the constrained noise image.

6. The method according to claim 5, characterized in that The performing region filling on the noise image based on the one or more first sample text features to obtain the constrained noise image includes: Using a space filling curve algorithm, filling the one or more first sample text features at target positions of the noise image to obtain the constrained noise image; The target position of the noise image corresponds to the regional target position of the sample image.

7. The method according to claim 1, characterized in that The updating of the text graph model based on the constrained noise image and the first sample text to obtain an updated text graph model includes: Inputting the constrained noise image and the first sample text into the text graph model to obtain a predicted image of the first sample text; The text graph model is updated based on the predicted image and the sample image corresponding to the first sample text to obtain the updated text graph model.

8. The method according to claim 7, characterized in that The step of inputting the constrained noise image and the first sample text into the text graph model to obtain a predicted image of the first sample text includes: Performing feature encoding on the first sample text to obtain features of the second sample text; Inputting the constrained noise image and the second sample text feature into the text graph model to obtain a predicted image of the first sample text; The text graph model includes a UNet network, and the predicted image representation is an image generated based on the denoised latent features.

9. The method according to claim 7, characterized in that: The updating of the text graph model based on the predicted image and the sample image corresponding to the first sample text to obtain the updated text graph model includes: Determining a loss function based on the predicted image and the sample image; The loss function is used to adjust the parameters of the Wensheng graph model until the training is completed to obtain the updated Wensheng graph model.

10. A Vincent diagram method, characterized in that: The method comprises: Acquire a target text set to be recognized; the target text set includes a first target text and one or more second target texts, the first target text represents global target text information, and the second target text represents regional target text information; Constraining the noisy image based on the one or more second target texts to obtain a constrained noisy image; Inputting the constrained noise image and the first target text into an updated text graph model to obtain a target image corresponding to the target text set; Wherein, the updated culture graph model is obtained based on the culture graph model training method according to any one of claims 1 to 9.

11. The method according to claim 10, characterized in that The constraining the noisy image based on the one or more second target texts to obtain a constrained noisy image includes: Performing feature encoding on the one or more second target texts to obtain corresponding one or more first target text features; The noisy image is constrained based on the one or more first target text features to obtain a constrained noisy image.

12. The method according to claim 11, characterized in that The constraining the noise image based on the one or more first target text features to obtain a constrained noise image includes: The noise image is region-filled based on the one or more first target text features to obtain the constrained noise image.

13. The method according to claim 12, characterized in that The performing region filling on the noise image based on the one or more first target text features to obtain the constrained noise image includes: Using a space filling curve algorithm, the one or more first target text features are filled in the target position of the noise image to obtain the constrained noise image; The target position of the noise image corresponds to the regional target position of the sample image.

14. The method according to claim 10, characterized in that The step of inputting the constrained noise image and the first target text into the updated text graph model to obtain a target image corresponding to the target text set includes: Performing feature encoding on the first target text to obtain features of the second target text; Inputting the constrained noise image and the second target text feature into the updated text graph model to obtain denoised latent features; The denoised latent features are decoded to obtain the target image.

15. A device for training a text graph model, characterized in that: The device comprises: A first acquisition unit is used to acquire a sample text set; the sample text set includes a first sample text and one or more second sample texts, the first sample text represents global sample text information, and the second sample text represents regional sample text information; A first constraint unit, used for constraining the noise image based on the one or more second sample texts to obtain a constrained noise image; An updating unit is used to update the text graph model based on the constrained noise image and the first sample text to obtain an updated text graph model; the updated text graph model is used to determine the target image corresponding to the target text set to be recognized.

16. A Wensheng map device, characterized in that: The device comprises: A second acquisition unit is used to acquire a target text set to be recognized; the target text set includes a first target text and one or more second target texts, the first target text represents global target text information, and the second target text represents regional target text information; A second constraint unit, used for constraining the noisy image based on the one or more second target texts to obtain a constrained noisy image; A determination unit, configured to input the constrained noise image and the first target text into an updated text graph model to obtain a target image corresponding to the target text set; Wherein, the updated culture graph model is obtained based on any of the culture graph model training methods described above.

17. A device for training a text graph model, characterized in that: include: a first processor and a first memory for storing a computer program executable on said first processor; Wherein, when the first processor is used to run the computer program, the steps of the method described in any one of claims 1 to 9 are executed.

18. A Wensheng map device, characterized in that: include: a second processor and a second memory for storing a computer program executable on the second processor; Wherein, when the second processor is used to run the computer program, the steps of the method described in any one of claims 10 to 14 are executed.

19. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 9, or implements the steps of the method according to any one of claims 10 to 14.

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