Method and device for generating Burmese text image by integrating character space features

By integrating the characteristics of character space characteristics, it solves the problem that the existing technology is difficult to generate real Myanmar text images, realizes the image generation effect closer to the real scene, and improves the performance of generating models.

CN119048632BActive Publication Date: 2025-01-24KUNMING UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411535637.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-01-24
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

The existing Burmese text image generation method is difficult to generate real Burmese text images. It is mainly due to the spatial characteristics and character encoding problems of Burmese language, making it difficult for the generation model to process complex Burmese texts, and the distribution of generated data is relatively single. It is difficult to train an identification model with excellent performance.

Method used

Using a generation method that incorporates character space features, feature extraction and preprocessing of Burmese text is carried out through Unicode encoding conversion and word embedding processing. Then, the improved Transformer module is used to predict the spatial distribution of text in the image, and the spatial diffusion module is designed to learn the inverse diffusion process, and finally the generated image is optimized through the post-processing module.

Benefits of technology

Effectively enhance the generating effect of Myanmar's Chinese text images, make the generated images closer to real scenes, and improve the performance of generating models, especially in terms of processing the complexity and diversity of Myanmar Chinese text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048632B_ABST
    Figure CN119048632B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and device for generating a Burmese text image incorporating character space features, and belongs to the field of natural language processing. Burmese is a low-resource language, and the existing Burmese text image generation method is difficult to solve the problem of uneven spatial distribution of characters in Burmese text images. In view of the fact that the existing Burmese generation model is difficult to solve the problem of uneven spatial distribution of characters in Burmese text images, the present invention proposes a method for generating a Burmese text image incorporating character space features, which mainly includes four parts: processing Burmese input text, constructing a character space feature generation module, constructing a Burmese text image generation model incorporating character space features, and generating Burmese text images. According to these four functional modules, a Burmese text image generation device incorporating character space features is manufactured, and a Burmese text image in a real scene is obtained by inputting the Burmese language. The present invention effectively improves the generation effect of the Burmese text image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method and a device for generating a Burmese text image incorporating character space features, and belongs to the technical field of natural language processing. Background Art

[0002] In the field of text image generation, the generation methods of text image data have achieved certain results in common languages ​​such as Chinese and English, but there are still many challenges in the generation of Burmese text images. The current mainstream generation methods are mainly divided into: (1) Rule-based methods convert text into images by setting specific rules. Although this method is simple, it has poor universality and is difficult to deal with complex Burmese text; (2) Template-based methods: pre-set a set of templates, fill the text information into the template, and generate text images. This method has certain flexibility, but there are still limitations in template design and matching; (3) Deep learning-based methods: use deep learning models such as convolutional neural networks (CNNs) to convert text into images. This method relies heavily on the quality of training data and model parameter adjustment. It has certain universality, but it is difficult to apply to Burmese. Specific examples are shown in Table 1.

[0003] Table 1. Examples of images generated by different current generation methods

[0004]

[0005] As a representative of generative tasks, the text-image generation task aims to generate images that meet the requirements based on a given text description. This task involves multimodal machine learning, which requires processing data of two different modalities, text and image, and understanding the relationship between them. In the text-image generation process, the input text usually contains a detailed description of the image, such as the location, color, size, and scale of the object. The training model aims to enable the model to understand and generate images that are consistent with the text description. This requires in-depth research on natural language and visual understanding, and the use of complex algorithms and models.

[0006] The spatial characteristics and character encoding issues of Burmese bring challenges to the generative model, making it difficult for the current generative model to generate real Burmese text images. In addition, most of the existing generative methods follow fixed rules, which leads to a relatively simple distribution of the generated data in the real Burmese dataset. This single distribution of generated data makes it difficult to train a Burmese text image recognition model with excellent performance. First, in terms of the spatial characteristics of Burmese, its writing method is unique, and the order of its characters in words is very different from other languages, and there are a large number of nested characters. This spatial characteristic makes the current mainstream generative model face great difficulties in processing Burmese. At the same time, there are also problems with character encodings of different formats in Burmese, which further increases the complexity of the generative model. For these reasons, it is difficult for the existing generative model to generate Burmese text images with real distribution. Secondly, in terms of character encoding, Burmese has a variety of different formats of character encoding. Different encodings have different character arrangement orders in the same combination of characters, and even different character sets. The multiple encodings of Burmese make it very difficult for the text image generation network to parse Burmese text. Finally, most of the current methods that can generate Burmese text images are algorithms with fixed rules. These methods follow pre-set rules when generating text images, which results in a relatively uniform distribution of the generated data in real Burmese datasets. This uniformity makes the training data lack diversity, making it difficult to train a Burmese text image recognition model with excellent performance. Summary of the invention

[0007] The technical problem solved by the present invention is: the present invention provides a method and device for generating a Burmese text image incorporating character space features, performs Unicode encoding conversion on the Burmese text to be generated and then performs word embedding processing, and predicts the spatial distribution of these texts in the subsequently generated images, and finally incorporates the conditions required for generating the text image into the word embedding matrix; utilizes the model to learn the inverse diffusion process in the process of spatial diffusion, and generates a Burmese text image that is closer to the real scene. The present invention effectively improves the generation effect of the Burmese text image.

[0008] The technical solution of the present invention is: in a first aspect, the present invention provides a method for generating a Burmese text image incorporating character space features, the method comprising the following steps:

[0009] Step 1: Processing Burmese input text: Using the Burmese character combination rules as prior knowledge, split the Burmese phrases and align the different combination forms and possible spatial distribution features;

[0010] Step 2, build a character space feature generation module: use the improved Transformer module to predict the spatial distribution of combined characters;

[0011] Step 3: Build a Burmese text image generation model that incorporates character space features:

[0012] Design a text encoding module to perform word embedding preprocessing on the input Burmese text;

[0013] Design a text style module to obtain a final matrix containing all the information of the generated text image according to the text style conditions;

[0014] Use the character space feature generation module to predict the spatial distribution of characters and the combination relationship between characters in the generated image;

[0015] Design a spatial diffusion module to gradually add noise to the image so that the model can learn the image inverse diffusion process;

[0016] Design a post-processing module to process the size of the final generated image to obtain the final Burmese text image;

[0017] Step 4. Burmese text image generation: Establish a Burmese text image generation server, deploy the model and develop a Burmese text image generation API interface. Use the API to call the Burmese text image generation model deployed on the server to generate Burmese text into Burmese text images.

[0018] Furthermore, the Step 1 includes:

[0019] Step 1.1, obtain Burmese text images and divide them into training set, test set and validation set; use the Burmese character cluster segmentation tool to segment the Burmese phrases into combined character sequences; annotate the text distribution in each Burmese text image by manual annotation method;

[0020] Step 1.2: Segment the text labels in all training data and align them with the manually annotated spatial distribution features to obtain the input text. .

[0021] Furthermore, in the Step 2, the improved Transformer module includes: based on the traditional Transformer module, the improved Transformer module also includes a text encoder and a conditional encoder.

[0022] Furthermore, in the Step 3, designing a text encoding module to perform word embedding preprocessing on the input Burmese text includes:

[0023] In the process of Burmese text processing, we first need to Perform transcoding operation to obtain transcoded text ; After transcoding, use the pre-trained Embedding model to The encoding is converted into a word embedding matrix; the words in the text are mapped to the vector space to capture the semantic relationship and similarity between words; through pre-training Model, Burmese Encoding is converted into word vectors with practical meaning .

[0024] Furthermore, in Step 3, the text style module is designed to obtain a final matrix containing all information of the generated text image according to the text style condition, including:

[0025] In the process of generating Burmese text images, the style conditions required to generate images are As input, generate a Gaussian noise matrix ;

[0026] The obtained Gaussian noise matrix The output of the text encoding module , the output of the character space feature generation module Superposition, we get The final matrix containing all the information of the generated text image at this moment ;

[0027] .

[0028] Furthermore, in the Step 3, using the character space feature generation module to predict the spatial distribution of characters and the combination relationship between characters in the generated image includes:

[0029] In the character space feature generation module, transcoded text and space constraints The corresponding word embedding matrix is ​​obtained through the text encoder and conditional encoder respectively, and then the spatial layout of the text in the image is predicted and generated through the multi-head attention mechanism. ;

[0030]

[0031] in , for , for , for Dimension.

[0032] Furthermore, in Step 3, the spatial diffusion module is designed to gradually add noise to the image, so that the model learns that the image inverse diffusion process includes:

[0033] The Transformer-based diffusion model is used to perform spatial diffusion in image processing tasks with Gaussian noise. In the Transformer-based diffusion model, the original text image is first input , the output of the text style module , processed through a multi-layer encoder and decoder structure; the encoder part is responsible for extracting features from the image, while the decoder part is responsible for generating noise in the diffusion process. In this process, the self-attention mechanism is used to capture the correlation between different regions in the image, and position encoding is used to introduce spatial information. Optimization strategies are also used to improve the diffusion effect;

[0034] ;

[0035] Current Status It is the state at the previous moment It is updated based on, and at the same time through a Transformer network Perform nonlinear transformation to extract Features in;

[0036] ;

[0037] The above is a standard Gaussian distribution formula. t∈[1,T] , is through From the previous state Generated, Used to control the noise level during the generation process, Indicates the previous state is a Gaussian distribution with a mean;

[0038] Through the above conditional probability formula , and finally Gradually add noise to the image to obtain a noisy image with time step t ;

[0039]

[0040] in .

[0041] Furthermore, in the Step 3, a post-processing module is designed to perform size processing operations on the finally generated image, and the final Burmese text image is obtained, including:

[0042] The post-processing module optimizes the generated image according to the noise removal loss function Loss1 of the Transformer-based diffusion model, gradually removes noise, and makes the image clearer; according to the loss function Loss2 between the generated image and the real image, the final output image is guided to be close to the target image while further optimizing the image quality, including the adjustment of resolution and color temperature, to ensure that the output image achieves the expected effect.

[0043] Furthermore, the specific steps of Step 4 are:

[0044] Step 4.1. Build the backend service framework of the Burmese text image generation model and deploy it on the server for Burmese text image generation.

[0045] Step 4.2, deploy the trained Burmese text image generation model in the form of a ".pth" format file to the Burmese text image recognition server; at the same time, develop an API interface for interaction and communication with the server;

[0046] Step 4.3, the Burmese text image recognition server will receive the Burmese text and input it into the Burmese text generation model for processing; the Burmese text generation model will generate corresponding Burmese text images according to the input Burmese text and related constraints; then these images will be sent to the post-processing module, and the post-processing module will modify the Burmese text image size;

[0047] Step 4.4. Call the Burmese text image generation model deployed on the server on the Web side, test it by uploading Burmese text on the Web interface, and obtain high-quality Burmese text image generation results.

[0048] In a second aspect, the present invention provides a device for generating a Burmese text image incorporating character space features, comprising a module for executing the method described in the first aspect.

[0049] The beneficial effects of the present invention are:

[0050] 1. The present invention uses a diffusion model to generate Burmese text images, making it more convenient to generate Burmese text images in real scenarios;

[0051] 2. Designed a character space feature generation module to predict the position distribution of text in the generated image, so as to better cope with the character nesting characteristics in Burmese;

[0052] 3. On the artificially collected dataset, the experimental results show that the Burmese text images generated by the proposed method are closer to the images in the real scene, with a FID of 60.42, which is better than multiple comparison models and effectively improves the generation effect of Burmese text images. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A framework diagram of a Burmese text image generation model incorporating character space features in the present invention;

[0054] Figure 2 A character space feature generation module diagram in the present invention;

[0055] Figure 3 The figure is an overall flow chart of the method for generating Burmese text images incorporating character space features in the present invention. DETAILED DESCRIPTION

[0056] Example 1: Figure 1-Figure 3 As shown, a method for generating a Burmese text image incorporating character space features comprises the following steps:

[0057] Step 1: Processing Burmese input text: Using the Burmese character combination rules as prior knowledge, split the Burmese phrases and align the different combination forms and possible spatial distribution features;

[0058] Step 1.1, obtain Burmese text images and divide them into training set, test set and validation set; use the Burmese character cluster segmentation tool to segment the Burmese phrases into combined character sequences; annotate the text distribution in each Burmese text image by manual annotation method;

[0059] Step 1.2: Segment the text labels in all training data and align them with the manually annotated spatial distribution features to obtain the input text. .

[0060] Step 2, construct a character space feature generation module: use an improved Transformer module to predict the spatial distribution of combined characters; the improved Transformer module includes: based on the traditional Transformer module, the improved Transformer module also includes a text encoder and a conditional encoder.

[0061] Step 3: Build a Burmese text image generation model that incorporates character space features:

[0062] Design a text encoding module to perform word embedding preprocessing on the input Burmese text;

[0063] Design a text style module to obtain a final matrix containing all the information of the generated text image according to the text style conditions;

[0064] Use the character space feature generation module to predict the spatial distribution of characters and the combination relationship between characters in the generated image;

[0065] Design a spatial diffusion module to gradually add noise to the image so that the model can learn the image inverse diffusion process;

[0066] Design a post-processing module to process the size of the final generated image to obtain the final Burmese text image;

[0067] Furthermore, in the Step 3, designing a text encoding module to perform word embedding preprocessing on the input Burmese text includes:

[0068] In the process of Burmese text processing, we first need to Perform transcoding operation to obtain transcoded text The purpose of transcoding is to convert the Burmese text from the original encoding system to the currently widely used Unicode encoding format. This step is crucial because mixing different encoding formats may cause the loss or deformation of text information, thus affecting the subsequent text analysis and processing effects. After the transcoding is completed, the pre-trained Embedding model is used to convert the Burmese text into the Unicode encoding format. The encoding is converted into a word embedding matrix; the words in the text are mapped to the vector space to capture the semantic relationship and similarity between words; through pre-training Model, Burmese Encoding is converted into word vectors with practical meaning .

[0069] ;

[0070] ;

[0071] Furthermore, in Step 3, the text style module is designed to obtain a final matrix containing all information of the generated text image according to the text style condition, including:

[0072] In the process of generating Burmese text images, it is often necessary to generate some complex text images to meet the needs of various application scenarios. Therefore, it is necessary to impose certain style conditions on them. As input, generate a Gaussian noise matrix ;

[0073] ;

[0074] in, It is an upsampling module based on CNN network;

[0075] The obtained Gaussian noise matrix The output of the text encoding module , the output of the character space feature generation module Superposition, we get The final matrix containing all the information of the generated text image at this moment ; This matrix It contains all the information needed to generate text images, which can meet the conditional restrictions and have rich randomness. Using this matrix, more natural and diverse text images can be generated to meet the needs of various application scenarios;

[0076] .

[0077] Furthermore, in the Step 3, using the character space feature generation module to predict the spatial distribution of characters and the combination relationship between characters in the generated image includes:

[0078] In view of the fact that Burmese text presents rich combined character features at the spatial level, a character space feature generation module is specially designed. In the character space feature generation module, the transcoded text and space constraints The corresponding word embedding matrix is ​​obtained through the text encoder and conditional encoder respectively, and then the spatial layout of the text in the image is predicted and generated through the multi-head attention mechanism. , such as the precise position and spatial expression of consonants and vowels after combination;

[0079]

[0080] in , for , for , for Dimension.

[0081] Furthermore, in Step 3, the spatial diffusion module is designed to gradually add noise to the image, so that the model learns that the image inverse diffusion process includes:

[0082] The Transformer-based diffusion model is used to perform spatial diffusion in image processing tasks with Gaussian noise. In the Transformer-based diffusion model, the original text image is first input , the output of the text style module , processed through a multi-layer encoder and decoder structure; the encoder part is responsible for extracting features from the image, while the decoder part is responsible for generating noise in the diffusion process. In this process, the self-attention mechanism is used to capture the correlation between different regions in the image, and position encoding is used to introduce spatial information. In this way, the Transformer-based diffusion model can predict the required noise in each step of the diffusion process. In addition, optimization strategies are used to improve the diffusion effect, including residual connection, layer normalization and weight sharing.

[0083] ;

[0084] Current Status It is the state at the previous moment It is updated based on, and at the same time through a Transformer network Perform nonlinear transformation to extract Features in;

[0085] ;

[0086] The above is a standard Gaussian distribution formula. t∈[1,T] , is through From the previous state Generated, Used to control the noise level during the generation process, Indicates the previous state is a Gaussian distribution with a mean;

[0087] Through the above conditional probability formula , and finally Gradually add noise to the image to obtain a noisy image with time step t ;

[0088]

[0089] in .

[0090] The post-processing module is mainly responsible for performing a series of fine processing on the images generated by the inverse diffusion process learned by the model, so that the generated images can reflect the characteristics and style of Burmese text in real scenes.

[0091] Furthermore, in the Step 3, a post-processing module is designed to perform size processing operations on the finally generated image, and the final Burmese text image is obtained, including:

[0092] The post-processing module optimizes the generated image according to the noise removal loss function Loss1 of the Transformer-based diffusion model, gradually removes noise, and makes the image clearer. The post-processing module guides the final output image to be close to the target image according to the loss function Loss2 between the generated image and the real image, while further optimizing the image quality, including the adjustment of resolution and color temperature, to ensure that the output image achieves the expected effect, making the image richer in details and with better visual effects. At the same time, the optimized image can better show the unique artistic style of Burmese text, laying the foundation for subsequent text recognition and analysis.

[0093] Step 4. Burmese text image generation: Establish a Burmese text image generation server, deploy the model and develop a Burmese text image generation API interface. Use the API to call the Burmese text image generation model deployed on the server to generate Burmese text into Burmese text images.

[0094] Step 4.1. Build the backend service framework of the Burmese text image generation model and deploy it on the server for Burmese text image generation.

[0095] Step 4.2, deploy the trained Burmese text image generation model in the form of a ".pth" format file to the Burmese text image recognition server; at the same time, develop an API interface for interaction and communication with the server;

[0096] Step 4.3, the Burmese text image recognition server will receive the Burmese text and input it into the Burmese text generation model for processing; the Burmese text generation model will generate corresponding Burmese text images according to the input Burmese text and related constraints; then these images will be sent to the post-processing module, and the post-processing module will modify the Burmese text image size;

[0097] Step 4.4. Call the Burmese text image generation model deployed on the server on the Web side, test it by uploading Burmese text on the Web interface, and obtain high-quality Burmese text image generation results.

[0098] According to the concept of the present invention, the present invention also provides a device for generating a Burmese text image integrating character space features, the device comprising the following integrated modules:

[0099] Burmese input text processing module: It is used to split Burmese phrases based on the Burmese character combination rules as prior knowledge, and to perform feature alignment on different combination forms and possible spatial distribution features;

[0100] The first building module is used to build a character space feature generation module, including using an improved Transformer module to predict the spatial distribution of combined characters;

[0101] The second building block is used to build a Burmese text image generation model that incorporates character space features, specifically including the following functions:

[0102] Design a text encoding module to perform word embedding preprocessing on the input Burmese text;

[0103] Design a text style module to obtain a final matrix containing all the information of the generated text image according to the text style conditions;

[0104] Use the character space feature generation module to predict the spatial distribution of characters and the combination relationship between characters in the generated image;

[0105] Design a spatial diffusion module to gradually add noise to the image so that the model can learn the image inverse diffusion process;

[0106] Design a post-processing module to process the size of the final generated image to obtain the final Burmese text image;

[0107] Burmese text image generation module: used to establish a Burmese text image generation server, deploy models and develop a Burmese text image generation API interface, and generate Burmese text images from Burmese text by calling the Burmese text image generation model deployed on the server through the API.

[0108] In order to verify the effect of the Burmese text image generation method that incorporates character space features proposed in the present invention, comparative experiments and ablation experiments were designed.

[0109] Experiment 1: Main experiment and result analysis;

[0110] The present invention has been experimented on a Burmese text image dataset, and compared with the experimental results of the current mainstream generation model. As shown in Table 2, the FID scores under various methods are shown. As can be seen from Table 1, the rule-based method and the template-based method obtained scores of 83.56 and 42.82 respectively, proving that there is a big difference between the text images generated by the two methods and the text images in the real scene. The scores of the generation methods using DC-GAN and WGAN are 0.24 and 0.22 respectively, proving that the GAN-based generation model has a good ability to fit the text images in the real scene, and can generate samples that are close to the real data distribution. However, GAN has a certain degree of instability and mode collapse, which leads to its unsatisfactory effect in some cases. The VAE-based generation method scored 0.58, proving that this method can handle high-dimensional data well, but the disadvantage of VAE is that the quality of the generated samples is low and sometimes cannot meet actual needs. The score of the method based on Flow-based Model is 0.43, which proves that Flow-based Model has the characteristics of stable training and good learning ability. However, this method has low computational efficiency and high requirements for training data, resulting in a certain gap between the generated text images and the images in the real scene. The score of the method proposed in this invention is 0.13, which proves the effectiveness of the proposed method.

[0111] Table 2 Main experimental results

[0112]

[0113] Experiment 2: Ablation experiment of character space feature generation module;

[0114] In order to verify the effectiveness of the character space feature generation module, the present invention conducted ablation experiments on it on the baseline model. The experimental results are shown in Table 3 (“√” indicates that the module is used, and “×” indicates that the module is not used).

[0115] Table 3 Ablation experiment

[0116]

[0117] From the experimental results, it can be seen that the use of the character space feature generation module can obtain additional character space distribution information, making the spatial distribution of characters in the generated image closer to the real scene, improving the accuracy of the baseline model, and proving the effectiveness of the proposed method.

[0118] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. A method for generating Burmese text images based on character space features, characterized in that: The method comprises the following: Step 1: Processing Burmese input text: Using the Burmese character combination rules as prior knowledge, split the Burmese phrases and align the different combination forms and possible spatial distribution features; Step 2, build a character space feature generation module: use the improved Transformer module to predict the spatial distribution of combined characters; Step 3: Build a Burmese text image generation model that incorporates character space features: Design a text encoding module to perform word embedding preprocessing on the input Burmese text; Design a text style module to obtain a final matrix containing all the information of the generated text image according to the text style conditions; Use the character space feature generation module to predict the spatial distribution of characters and the combination relationship between characters in the generated image; Design a spatial diffusion module to gradually add noise to the image so that the model can learn the image inverse diffusion process; Design a post-processing module to process the size of the final generated image to obtain the final Burmese text image; Step 4. Burmese text image generation: Establish a Burmese text image generation server, deploy the model and develop a Burmese text image generation API interface. Use the API to call the Burmese text image generation model deployed on the server to generate Burmese text into Burmese text images. In the Step 3, designing a text encoding module to perform word embedding preprocessing on the input Burmese text includes: In the process of Burmese text processing, we first need to Perform transcoding operation to obtain transcoded text ; After transcoding, use the pre-trained Embedding model to The encoding is converted into a word embedding matrix; the words in the text are mapped to the vector space to capture the semantic relationship and similarity between words; through pre-training Model, Burmese Encoding is converted into word vectors with practical meaning ; In Step 3, the text style module is designed to obtain a final matrix containing all information of the generated text image according to the text style conditions, including: In the process of generating Burmese text images, the style conditions required to generate images are As input, generate a Gaussian noise matrix ; The obtained Gaussian noise matrix The output of the text encoding module , the output of the character space feature generation module Superposition, we get The final matrix containing all the information of the generated text image at this moment ; ; In the Step 3, using the character space feature generation module to predict the spatial distribution of characters and the combination relationship between characters in the generated image includes: In the character space feature generation module, transcoded text and space constraints The corresponding word embedding matrix is ​​obtained through the text encoder and conditional encoder respectively, and then the spatial layout of the text in the image is predicted and generated through the multi-head attention mechanism. ; ; in , for , for , for Dimension.

2. The method for generating a Burmese text image by incorporating character space features according to claim 1, wherein: The Step 1 includes: Step 1.1, obtain Burmese text images and divide them into training set, test set and validation set; use the Burmese character cluster segmentation tool to segment the Burmese phrases into combined character sequences; annotate the text distribution in each Burmese text image by manual annotation method; Step 1.2: Segment the text labels in all training data and align them with the manually annotated spatial distribution features to obtain the input text. .

3. The method for generating a Burmese text image by incorporating character space features according to claim 1, characterized in that: In the Step 2, the improved Transformer module includes: based on the traditional Transformer module, the improved Transformer module also includes a text encoder and a conditional encoder.

4. The method for generating a Burmese text image incorporating character space features according to claim 1, wherein: In Step 3, the spatial diffusion module is designed to gradually add noise to the image, so that the model learns that the image inverse diffusion process includes: The Transformer-based diffusion model is used to perform spatial diffusion in image processing tasks with Gaussian noise. In the Transformer-based diffusion model, the original text image is first input , the output of the text style module , processed through a multi-layer encoder and decoder structure; the encoder part is responsible for extracting features from the image, while the decoder part is responsible for generating noise in the diffusion process. In this process, the self-attention mechanism is used to capture the correlation between different regions in the image, and position encoding is used to introduce spatial information. Optimization strategies are also used to improve the diffusion effect; ; Current Status It is the state at the previous moment It is updated based on Perform nonlinear transformation to extract Features in; ; The above is a standard Gaussian distribution formula. , is through From the previous state Generated, Used to control the noise level during the generation process, Indicates the previous state is a Gaussian distribution with a mean value; Through the above conditional probability formula , and finally Gradually add noise to the image to obtain a noisy image with time step t ; ; in .

5. The method for generating a Burmese text image incorporating character space features according to claim 1, characterized in that: In the Step 3, a post-processing module is designed to perform size processing operations on the finally generated image, and the final Burmese text image is obtained, including: The post-processing module optimizes the generated image according to the noise removal loss function Loss1 of the Transformer-based diffusion model and gradually removes the noise; according to the loss function Loss2 between the generated image and the real image, the final output image is guided to be close to the target image while further optimizing the image quality, including the adjustment of resolution and color temperature.

6. The method for generating a Burmese text image incorporating character space features according to claim 1, characterized in that: The specific steps of Step 4 are: Step 4.

1. Build the backend service framework of the Burmese text image generation model and deploy it on the server for Burmese text image generation. Step 4.2, deploy the trained Burmese text image generation model in the form of a ".pth" format file to the Burmese text image recognition server; at the same time, develop an API interface for interaction and communication with the server; Step 4.3, the Burmese text image recognition server will receive the Burmese text and input it into the Burmese text generation model for processing; the Burmese text generation model will generate corresponding Burmese text images according to the input Burmese text and related constraints; then these images will be sent to the post-processing module, and the post-processing module will modify the Burmese text image size; Step 4.

4. Call the Burmese text image generation model deployed on the server on the Web side, test it by uploading Burmese text on the Web interface, and obtain high-quality Burmese text image generation results.

7. A device for generating Burmese text images incorporating character space features, characterized in that: The method comprises a module for executing the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for generating images through text by introducing capsule network

    CN112765316A

  • Inverse text mapping-based background embedding and feature separation-based personalized image generation method

    CN118314238A