Method for constructing character image generation combination library, electronic device and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-06-02
Smart Images

Figure CN121330117B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image synthesis technology, and in particular to a method for constructing a character image generation and combination library, an electronic device, and a storage medium. Background Technology
[0002] With the widespread application of AI-generated content technology, image generation containing text is becoming increasingly important in brand design, advertising creativity, and user interface prototyping. These applications not only require generated images to have visual realism and semantic consistency, but also impose strict requirements on the readability and accuracy of the characters within the image, including quality standards such as clear characters, no distortion, no missing or incorrect characters, and reasonable arrangement.
[0003] Currently, to achieve high-quality character image generation, related technologies mainly rely on cue word engineering to guide the model in generating character images that meet expectations. This involves optimizing input conditions by adjusting description methods, adding character format constraints, or introducing character quality requirements, thereby generating images with stable and satisfactory character quality. However, in practice, a significant amount of time and effort is often required for repeated experimentation and cue word adjustments to ensure the model generates the necessary high-quality character images, resulting in extremely low efficiency.
[0004] Therefore, how to balance character quality and generation efficiency in the process of generating character images has become a technical problem that urgently needs to be solved in the industry. Summary of the Invention
[0005] The main purpose of this application is to provide a method for constructing a character image generation library, an electronic device, and a storage medium, aiming to solve the technical problem of balancing character quality and generation efficiency in the process of character image generation.
[0006] To achieve the above objectives, this application provides a method for constructing a character image generation and combination library, the method comprising:
[0007] Obtain the character image generation combination to be evaluated, wherein the character image generation combination consists of a prompt word and a seed value;
[0008] The prompt word is adjusted to obtain multiple neighboring variant prompt words, wherein the similarity between the multiple neighboring variant prompt words and the prompt word is greater than the first similarity.
[0009] Based on the multiple neighborhood variant prompt words and the seed value, multiple neighborhood variant combinations of the character image generation combination are constructed;
[0010] Using a pre-trained image generation model, character images corresponding to each neighborhood variant combination are generated, and the character quality of each character image is determined.
[0011] Based on the character quality of each character image, it is determined whether the character image generation combination is a high-quality character image generation combination, and a character image generation combination library is constructed based on at least one of the high-quality character image generation combinations.
[0012] In one feasible implementation, the step of determining whether the character image generation combination is a high-quality character image generation combination based on the character quality of each character image includes:
[0013] The percentage of character images with the target character quality in each character image was statistically determined.
[0014] If the target character quality is a first character quality and the proportion of the number of images is less than a first preset proportion, then the character image generation combination is determined to be a high-quality character image generation combination.
[0015] And / or, if the target character quality is the second character quality and the proportion of the number of images is greater than the second preset proportion, the character image generation combination is determined to be a high-quality character image generation combination;
[0016] The quality of the second character is higher than that of the first character, and the second preset percentage is greater than that of the first preset percentage.
[0017] In one feasible implementation, prior to the step of adjusting the prompt word to obtain multiple neighboring variant prompt words, the method further includes:
[0018] Using a pre-trained image generation model, a target character image corresponding to the character image generation combination is generated, and the character quality of the target character image is determined.
[0019] When the character quality of the target character image is the second character quality, the step of adjusting the prompt word to obtain multiple neighboring variant prompt words is performed.
[0020] In one feasible implementation, the step of determining the character quality of each of the character images includes:
[0021] Obtain character quality annotations for each of the character images, wherein the character quality annotations include at least one of the following: number of misspelled characters, number of missing characters, degree of distortion, positional consistency, and size consistency.
[0022] Based on the character quality annotations of each character image, the character quality of each character image is evaluated to obtain the character quality of each character image.
[0023] In one feasible implementation, the step of determining the character quality of each of the character images includes:
[0024] Perform character recognition on each of the character images to obtain the character recognition results for each of the character images;
[0025] Based on the character recognition results of each character image, the character quality of each character image is evaluated to obtain the character quality of each character image.
[0026] In one feasible implementation, the character recognition result includes the number of characters recognized;
[0027] The step of evaluating the character quality of each character image based on the character recognition results of each character image to obtain the character quality of each character image includes:
[0028] Based on the neighborhood variant prompt words corresponding to each of the neighborhood variant combinations, the number of target characters corresponding to each of the character images is determined, wherein the number of target characters is the number of characters to be generated in the character image;
[0029] The character image in which the number of characters recognized is less than the number of target characters is determined as the first character image, and the character quality of the first character image is determined as the first character quality;
[0030] Character images other than the first character image in each of the character images are identified as second character images, and the character quality of the second character images is determined.
[0031] In one feasible implementation, the character recognition result includes the confidence level of the recognized character;
[0032] The step of evaluating the character quality of each character image based on the character recognition results of each character image to obtain the character quality evaluation results of each character image includes:
[0033] The number of low-confidence characters in each of the character images is counted, wherein the number of low-confidence characters is the number of recognized characters with a confidence level lower than a preset confidence level;
[0034] The character image with more than a preset number of low confidence values among all the character images is identified as the first character image, and the character quality of the first character image is identified as the first character quality.
[0035] Character images other than the first character image in each of the character images are identified as second character images, and the character quality of the second character images is determined.
[0036] In one feasible implementation, the step of determining the character quality of the second character image includes:
[0037] Obtain the character quality annotation of the second character image, wherein the character quality annotation includes at least one of the following: number of misspelled words, number of missing words, degree of deformity, positional coordination, and size coordination.
[0038] Based on the character quality annotations of each second character image, the character quality of each second character image is evaluated to obtain the character quality of each second character image.
[0039] In one feasible implementation, the prompt words include a content description field, a style constraint field, a quality requirement field, and a format requirement field;
[0040] The step of adjusting the prompt word to obtain multiple neighboring variant prompt words includes:
[0041] Adjusting at least one of the content description field, the style constraint field, the quality requirement field, and the format requirement field yields multiple neighboring variant prompt words.
[0042] Wherein, when the target field is adjusted, the similarity between the target field of the multiple neighboring variant prompt words and the target field of the prompt word is greater than the second similarity. The target field is the content description field, the style constraint field, the quality requirement field, or the format requirement field, and the second similarity is greater than the first similarity.
[0043] Furthermore, to achieve the above objectives, this application also provides an apparatus for constructing a character image generation and combination library, the apparatus comprising:
[0044] The acquisition module is used to acquire the character image generation combination to be evaluated, wherein the character image generation combination consists of a prompt word and a seed value;
[0045] An adjustment module is used to adjust the prompt word to obtain multiple neighboring variant prompt words, wherein the similarity between the multiple neighboring variant prompt words and the prompt word is greater than the first similarity.
[0046] The combination module is used to construct multiple neighborhood variant combinations of the character image generation combination based on the multiple neighborhood variant prompt words and the seed value;
[0047] The generation module is used to generate character images corresponding to each neighborhood variant combination using a pre-trained image generation model, and to determine the character quality of each character image;
[0048] The construction module is used to determine whether the character image generation combination is a high-quality character image generation combination based on the character quality of each character image, and to construct a character image generation combination library based on at least one of the high-quality character image generation combinations.
[0049] In addition, to achieve the above objectives, this application also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the character image generation and combination library construction method described above.
[0050] In addition, to achieve the above objectives, this application also provides a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the character image generation and combination library construction method described above.
[0051] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the character image generation and combination library construction method described above.
[0052] This application provides a method for constructing a character image generation combination library, an electronic device, and a storage medium, relating to the field of image synthesis technology. The method includes: acquiring a character image generation combination to be evaluated, wherein the character image generation combination consists of a prompt word and a seed value; adjusting the prompt word to obtain multiple neighboring variant prompt words, wherein the similarity between the multiple neighboring variant prompt words and the prompt word is greater than a first similarity; constructing multiple neighboring variant combinations of the character image generation combination based on the multiple neighboring variant prompt words and the seed value; generating character images corresponding to each neighboring variant combination using a pre-trained image generation model, and determining the character quality of each character image; determining whether the character image generation combination is a high-quality character image generation combination based on the character quality of each character image, and constructing a character image generation combination library based on at least one of the high-quality character image generation combinations.
[0053] This application embodiment effectively solves the problem of low generation efficiency caused by relying on repeated manual adjustments of prompt words to improve character image quality in the prior art by constructing a systematic character image generation combination library. Specifically, firstly, a character image generation combination containing specific character image generation prompt words and seed values is obtained as an object; then, while keeping the seed value unchanged, the original prompt words are adjusted to be semantically similar, generating multiple neighborhood variant combinations with prompt word similarity higher than a preset threshold, thus forming a set of test samples with consistent semantics but slightly different expressions; next, a pre-trained image generation model is used to generate character images corresponding to these combination instances, and the quality of the character parts in each character image is evaluated, including indicators such as clarity, character accuracy, no distortion, and reasonable arrangement; based on the overall character quality performance, it is determined whether the combination can stably produce high-quality character images under different prompt word variants, and thus determine whether it is a "high-quality character image generation combination"; if the determination is successful, its character image generation combination (i.e., the original prompt word and corresponding seed value) is included in the character image generation combination library. In subsequent practical applications, when a user inputs a new generation request, the system performs a similarity match between the new prompt word and the prompt words of high-quality character image generation combinations already stored in the combination library. Once a successful match is found, the associated proven seed value can be directly reused for image generation without repeated optimization. Thus, this embodiment of the application realizes a shift from experience-driven to data-driven approaches. By accumulating and reusing proven "prompt word-seed value" combination patterns, it significantly improves the stability, reproducibility, and automation level of character quality during the character image generation process. While ensuring output quality, it greatly improves generation efficiency, achieving a technical effect that balances high character quality and high generation efficiency. Attached Figure Description
[0054] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0055] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0056] Figure 1 A flowchart illustrating the first embodiment of the method for constructing a character image generation and combination library according to this application;
[0057] Figure 2A flowchart illustrating the second embodiment of the method for constructing a character image generation and combination library according to this application;
[0058] Figure 3 A flowchart illustrating the third embodiment of the method for constructing a character image generation and combination library according to this application;
[0059] Figure 4 This is a schematic diagram of the module structure of the character image generation and combination library construction device according to an embodiment of this application;
[0060] Figure 5 This is a schematic diagram of the hardware operating environment of the electronic device involved in the construction method of the character image generation and combination library in this application embodiment.
[0061] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0062] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0063] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0064] Currently, to achieve high-quality character image generation, related technologies mainly rely on cue word engineering to guide the model in generating character images that meet expectations. This involves optimizing input conditions by adjusting description methods, adding character format constraints, or introducing character quality requirements, thereby generating images with stable and satisfactory character quality. However, in practice, a significant amount of time and effort is often required for repeated experimentation and cue word adjustments to ensure the model generates the necessary high-quality character images, resulting in extremely low efficiency.
[0065] Therefore, how to balance character quality and generation efficiency in the process of generating character images has become a technical problem that urgently needs to be solved in the industry.
[0066] To address the aforementioned technical challenges, the technical solution provided in this application is as follows: A character image generation combination to be evaluated is obtained, wherein the character image generation combination consists of a prompt word and a seed value; the prompt word is adjusted to obtain multiple neighboring variant prompt words, wherein the similarity between the multiple neighboring variant prompt words and the prompt word is greater than a first similarity; based on the multiple neighboring variant prompt words and the seed value, multiple neighboring variant combinations of the character image generation combination are constructed; a character image corresponding to each neighboring variant combination is generated using a pre-trained image generation model, and the character quality of each character image is determined; based on the character quality of each character image, it is determined whether the character image generation combination is a high-quality character image generation combination, and a character image generation combination library is constructed based on at least one of the high-quality character image generation combinations.
[0067] This application embodiment effectively solves the problem of low generation efficiency caused by relying on repeated manual adjustments of prompt words to improve character image quality in existing technologies by constructing a systematic character image generation combination library. Specifically, firstly, a character image generation combination to be evaluated (consisting of a prompt word and a seed value) is obtained. Multiple neighboring variant prompt words with a similarity higher than the first similarity are generated by adjusting the prompt word, and these are combined with the original seed value to form multiple neighboring variant combinations of the character image generation combination. Subsequently, a pre-trained image generation model is used to generate character images corresponding to each neighboring variant combination, and their character quality (including clarity, no distortion, no missing characters, reasonable arrangement, etc.) is evaluated. Finally, based on the character quality evaluation results of each character image, if the character image generation combination can stably generate high-quality character images under most neighboring variant combinations, it is determined to be a high-quality character image generation combination and included in the character image generation combination library. Subsequently, when a user inputs a new prompt word requesting the generation of an image containing characters, the system can retrieve a high-quality character image generation combination from the character image generation combination library where the similarity between the prompt word and the user input is greater than the first similarity. The system then directly reuses the corresponding seed value. Since the prompt word input by the user is highly similar to the prompt word in this high-quality character image generation combination, it is essentially a neighboring variant of that prompt word. Therefore, combining the validated seed value from this high-quality character image generation combination with it creates a neighboring variant combination similar to historical successful cases. This significantly improves the stability and character quality of the model when generating character images, avoiding the inefficient process of repeatedly debugging prompt words in traditional methods, and ultimately achieving efficient and reliable generation of high-quality character images.
[0068] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0069] This application proposes a method for constructing a character image generation and combination library according to a first embodiment.
[0070] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the method for constructing the character image generation and combination library of this application.
[0071] In this embodiment, the method for constructing the character image generation and combination library may include steps S100~S500:
[0072] Step S100: Obtain the character image generation combination to be evaluated, wherein the character image generation combination consists of a prompt word and a seed value;
[0073] It should be noted that, in this embodiment, a character image refers to an image whose content contains identifiable text (such as titles, slogans, advertising phrases, speech bubbles, brand logos, etc.). The goal of its generation is not only the overall visual quality of the image, but more importantly, the readability, structural integrity, and accuracy of the characters within the image. This includes, but is not limited to, clear and unblurred characters, no missing or misaligned characters, reasonable font arrangement that conforms to semantic logic, and sharp, distortion-free character edges. Such images are widely used in scenarios with extremely high requirements for consistency between text and images, such as brand design, advertising creativity, and user interface prototyping.
[0074] It should also be noted that, in this embodiment, the prompt word refers to a natural language description used to guide the image generation model to generate a specific character image. Its content can specifically cover the character image's theme, style, composition, color, lighting, and the specific character content and its presentation (e.g., "a poster with a blue background, a white bold 'SALE' in the center, and 'Up to 50% off' in smaller font below"). The quality of the prompt word directly affects the accuracy and visual expressiveness of the generated image. Especially for character images, the prompt word must accurately express the character's position, style, content, and quality requirements; otherwise, it can easily lead to problems such as missing characters, misspellings, distortion, or layout chaos.
[0075] A seed value is an integer value used to initialize the random number generator during image generation. Its function is to control the noise input pattern during the generation process. With the same cue word and model parameters, using the same seed value will always produce completely consistent image results, while different seed values will lead to visually significantly different outputs, even with the same cue word. Therefore, although the seed value does not directly participate in semantic expression, it indirectly determines the detail stability and structural features of the generated image by influencing the initial noise distribution in the latent space. Especially in character generation tasks, certain seed values can significantly improve the clarity and regularity of character regions, thereby improving the character quality of the image.
[0076] The character image generation combination refers to the input parameter pair consisting of a specific prompt word and a specific seed value. This character image generation combination serves as the complete input condition for the image generation model, determining the specific form and content of the final generated character image.
[0077] This embodiment selects character image generation combinations for evaluation and screening, thereby exploring and solidifying "successful parameter configurations" that can stably produce high-quality character images. This is used to build a character image generation combination library, so that in subsequent character image generation tasks, combinations with high similarity between the prompt words and the prompt words of the current character image generation task can be directly found from this library. The seed value of the combination is then used for the current character image generation task, ensuring that the image synthesis model can stably generate high-quality character images under the guidance of the prompt words of the current character image generation task. In this way, there is no need for repeated debugging of prompt words with expert experience, saving a lot of effort and time.
[0078] Step S200: Adjust the prompt word to obtain multiple neighboring variant prompt words, wherein the similarity between the multiple neighboring variant prompt words and the prompt word is greater than the first similarity.
[0079] It should be noted that, in this embodiment, neighborhood variant prompts refer to a new set of prompts generated by semantically preserving perturbations of the original prompts. These adjustments may include, but are not limited to: synonym replacement (e.g., replacing "red" with "dark red"), sentence restructuring (e.g., changing "brand name with large font" to "brand name displayed in large font"), adding modifiers that do not affect the core semantics (e.g., adding "modern style" or "simple design"), or slightly deleting non-critical descriptions. These adjustments aim to simulate the prompt fine-tuning behavior that real users might perform when using the image generation model, thereby testing whether the seed value in a certain combination can still guide the image generation model to maintain stable, high-quality output capabilities when combined with neighborhood variant prompts that are semantically similar but slightly different in expression.
[0080] It should also be noted that, in this embodiment, the first similarity refers to a threshold used to measure the degree of similarity between two prompt words, and its value is usually set between 0 and 1 (e.g., 0.85). Prompt words obtained by adjusting the original prompt words are only considered as neighborhood variant prompt words if their similarity to the original prompt word is higher than this threshold. The purpose of setting the first similarity in this embodiment is to limit the scope of the "neighborhood," avoiding excessive deviation from the original prompt word that would cause a fundamental change in the generation task (such as changing from generating an advertising poster to generating product packaging), thereby ensuring that subsequent character quality evaluation reflects the robustness of the combination to "reasonable prompt word fluctuations," rather than its ability to generalize to irrelevant tasks.
[0081] This embodiment adjusts the prompt words in the character image generation combination to be evaluated, generating multiple neighboring variant prompt words with high similarity to the original prompt word. This constructs a local semantic perturbation test set to simulate common user modification patterns of prompt words in real-world applications. The core principle of this mechanism is that if a character image generation combination can consistently generate high-quality character images when faced with multiple semantically similar prompt word variants, it indicates that the combination possesses robust anti-interference capabilities and generalization potential, making it an ideal candidate for constructing a reliable generation strategy.
[0082] Step S300: Based on the multiple neighborhood variant prompt words and the seed value, construct multiple neighborhood variant combinations of the character image generation combination;
[0083] It should be noted that, in this embodiment, the neighborhood variant combination refers to a new parameter combination formed by pairing each neighborhood variant prompt with the seed value in the original character image generation combination. For example, if the original combination is (Prompt_A, Seed_123), and three neighborhood variant prompts Prompt_A1, Prompt_A2, and Prompt_A3 are generated, then the corresponding neighborhood variant combinations are (Prompt_A1, Seed_123), (Prompt_A2, Seed_123), and (Prompt_A3, Seed_123). Each neighborhood variant combination represents the response behavior of the image generation model to semantically similar prompts under a fixed initial noise state (i.e., a fixed seed value).
[0084] This embodiment achieves independent verification of "seed value stability" by keeping the seed value constant and only changing the prompt word. Its technical advantage lies in eliminating interference from variables other than prompt word changes, focusing on whether a specific seed value can consistently guide the model to generate structurally complete and clearly defined character images under different but semantically related prompt conditions. This design reveals the "anchoring effect" of seed values in the latent space on the character generation path in the character image; that is, the initial noise pattern corresponding to certain seed values is precisely conducive to the image generation model correctly parsing character semantics and generating regular characters, thus exhibiting excellent performance under various prompt variations.
[0085] Step S400: Generate character images corresponding to each neighborhood variant combination using a pre-trained image generation model, and determine the character quality of each character image;
[0086] It should be noted that, in this embodiment, the image generation model refers to an image-generating machine learning model that has been trained on a large-scale image and text dataset. This image-generating machine learning model has a deep learning architecture with character-to-image mapping capabilities, such as generative adversarial networks and diffusion models. Its structural design supports generating character images by taking a combination of prompt words and seed values as input.
[0087] It should also be noted that, in this embodiment, character quality refers to the overall performance level of the character portion in the generated image, and may specifically include any one or more of the following dimensions:
[0088] Clarity: Are the character edges sharp? Are there any blurring, ghosting, or pixelation issues?
[0089] No distortion: Whether the character shape is normal, and whether there is stretching, twisting, breakage or adhesion;
[0090] No missing or incorrect characters: Whether the generated characters are completely consistent with the content specified in the prompt word, with no typos, missing characters, or extra characters;
[0091] Reasonableness of layout: Whether the position, direction, and size ratio of characters in the image meet the semantic expectations, whether the line spacing and character spacing are uniform, and whether there are overlaps or overflows of boundaries.
[0092] The evaluation of character quality in character images can be accomplished by combining automated indicators (such as the character recognition accuracy of optical character recognition) with manual scoring, ensuring that the evaluation results are both objective and closely aligned with practical application needs.
[0093] This embodiment establishes an output stability profile under the "specific seed value + diverse prompt words" by batch executing character image generation tasks of neighborhood variant combinations and systematically evaluating the character quality of each character image. Essentially, this process is a stress test of the robustness of the seed value. Its mechanism is to expose potential quality problems using semantic perturbations; only those combinations that maintain high character quality under most variant prompts are considered truly reliable high-quality generation strategies.
[0094] Step S500: Based on the character quality of each character image, determine whether the character image generation combination is a high-quality character image generation combination, and construct a character image generation combination library based on at least one of the high-quality character image generation combinations.
[0095] It should be noted that, in this embodiment, a high-quality character image generation combination refers to a combination of multiple neighboring variant combinations where, in generating character images, the vast majority (e.g., ≥80%) meet the preset character quality standard for the original prompt word-seed value pair. The judgment logic does not only consider performance under a single prompt word, but emphasizes "group stability" within the semantic neighborhood. For example, even if a combination generates good results under the original prompt, but exhibits blurred or disordered characters under most neighboring variant prompts, it is still considered a low-quality combination; conversely, if almost all variant prompts can generate clear, accurate, and well-organized character images, it is judged as a high-quality combination. This standard ensures that the selected combinations have the tolerance to handle minor adjustments to prompt words in actual use.
[0096] It should also be noted that, in this embodiment, the character image generation combination library refers to a database consisting of multiple verified high-quality character image generation combinations. This library stores the prompt words, seed values, and even historical evaluation records for each combination (such as average character quality score, number of passed neighboring variants, etc.), and supports indexing and retrieval by keywords, prompt word similarity, style tags, or application scenarios. Its core function is to quickly match high-quality combinations semantically similar to the user's input prompt words when the user initiates a new character image generation request, and reuse their seed values to improve the character quality and generation efficiency of the character image.
[0097] This embodiment achieves a paradigm shift from "trial and error" to "knowledge accumulation" by establishing a closed-loop evaluation-screening-database mechanism. Its key technical value lies in transforming the originally unpredictable influence of seed values into accumulative and reusable prior knowledge, enabling the system to automatically select the optimal generation parameters without user intervention, significantly reducing the technical threshold and time cost of high-quality character image generation.
[0098] In summary, this embodiment proposes a method for constructing a combined library for high-quality character image generation. Its core innovation lies in introducing a "neighborhood variant testing" mechanism. By applying semantically preserving perturbations to prompt words and generating multiple sets of test samples using a fixed seed value, the output stability of a character image generation combination in the face of prompt word fluctuations is comprehensively evaluated. High-quality combinations selected based on this evaluation result are incorporated into the combined library, forming transferable knowledge assets. When a user inputs a new prompt word, the system can retrieve successful seed values corresponding to similar prompt words from the library through semantic matching and reuse them directly. This bypasses the time-consuming and laborious prompt word debugging process in traditional methods, achieving a highly efficient generation mode of "one-time verification, multiple benefits."
[0099] This embodiment effectively solves the problem of low generation efficiency caused by relying on repeated manual adjustments of prompt words to improve character image quality in existing technologies by constructing a systematic character image generation combination library. Specifically, firstly, a character image generation combination to be evaluated (consisting of a prompt word and a seed value) is obtained. Multiple neighboring variant prompt words with a similarity higher than the first similarity are generated by adjusting the prompt word, and these are combined with the original seed value to form multiple neighboring variant combinations of the character image generation combination. Subsequently, a pre-trained image generation model is used to generate character images corresponding to each neighboring variant combination, and their character quality is evaluated (including clarity, no distortion, no missing characters, reasonable arrangement, etc.). Finally, based on the character quality evaluation results of each character image, if the character image generation combination can stably generate high-quality character images under most neighboring variant combinations, it is determined to be a high-quality character image generation combination and included in the character image generation combination library. Subsequently, when a user inputs a new prompt word requesting the generation of an image containing characters, the system can retrieve a high-quality character image generation combination from the character image generation combination library where the similarity between the prompt word and the user input is greater than the first similarity. The system then directly reuses the corresponding seed value. Since the prompt word input by the user is highly similar to the prompt word in this high-quality character image generation combination, it is essentially a neighboring variant of that prompt word. Therefore, combining the validated seed value from this high-quality character image generation combination with it creates a neighboring variant combination similar to historical successful cases. This significantly improves the stability and character quality of the model when generating character images, avoiding the inefficient process of repeatedly debugging prompt words in traditional methods, and ultimately achieving efficient and reliable generation of high-quality character images.
[0100] In one feasible implementation, the step S500 above, which determines whether the character image generation combination is a high-quality character image generation combination based on the character quality of each character image, may include steps S510 to S530:
[0101] Step S510: Calculate the percentage of character images with target character quality in each character image;
[0102] Step S520: If the target character quality is a first character quality and the proportion of the number of images is less than a first preset proportion, then the character image generation combination is determined to be a high-quality character image generation combination.
[0103] And / or, in step S530, if the target character quality is the second character quality and the proportion of the number of images is greater than the second preset proportion, the character image generation combination is determined to be a high-quality character image generation combination;
[0104] The quality of the second character is higher than that of the first character, and the second preset percentage is greater than that of the first preset percentage.
[0105] It should be noted that, in this embodiment, the quality of the character portion in the first character quality characterization image is relatively low, while the quality of the character portion in the second character quality characterization image is relatively high.
[0106] The target character quality refers to the character quality level selected as the criterion in the process of determining high-quality character image generation combinations. It can be dynamically set to either the first character quality or the second character quality, thereby supporting the measurement of the output stability of the character image generation combination to be evaluated from different perspectives. By flexibly switching the target character quality, the system can determine whether the combination has the potential to become a high-quality candidate under different evaluation strategies.
[0107] It should also be noted that, in this embodiment, the image quantity percentage refers to the proportion of the number of images with the currently set "target character quality" among all character images generated by the combination of neighboring variants, out of the total number of generated images. For example, if a total of 10 sets of character images corresponding to the combination of neighboring variants are generated, and 7 of the character images have the second character quality, then the image quantity percentage is 70%.
[0108] The first preset percentage refers to the upper limit of the threshold used to determine whether "poor output is controllable," and it is usually set to a small value (such as 20% or 30%). When the first character quality is used as the target character quality, if the percentage of the corresponding number of images is lower than this threshold, it means that the output under most variant prompts is better than the minimum quality standard, indicating that the combination has strong anti-perturbation ability and output robustness, and can therefore be identified as a high-quality character image generation combination.
[0109] The second preset percentage refers to the lower threshold used to determine whether "high-quality output is dominant." Its value is higher than the first preset percentage (such as 60% or 70%), reflecting a higher screening threshold. When the second character quality is used as the target character quality, only when the proportion of its corresponding image quantity exceeds this threshold can it be said that the combination can still continuously produce high-fidelity character images under most semantically similar prompts, thus possessing the core characteristics of a high-quality combination.
[0110] This implementation constructs a robust and accurate high-quality combination recognition mechanism by defining character quality in a graded manner and combining it with differentiated proportion judgment logic. Specifically, step S520 adopts a "reverse elimination method," which indirectly verifies the overall reliability of the combination by controlling the proportion of low-quality images—only when a very small number of outputs fall into the low-quality range can the combination be considered to have good fault tolerance. Step S530, on the other hand, adopts a "positive confirmation method," which directly proves the superior performance of the combination by ensuring that high-quality outputs occupy an absolute advantage. The two strategies complement each other, and one can be selected to be used or executed in parallel according to the actual application scenario, enhancing the flexibility and adaptability of the evaluation system. More importantly, this implementation transforms the judgment process that originally relied on subjective experience into a quantifiable and reproducible objective indicator, significantly improving the construction efficiency and screening accuracy of the character image generation combination library, and providing key support for achieving efficient and stable high-quality character image generation.
[0111] In one feasible implementation, before adjusting the prompt word in step S200 to obtain multiple neighboring variant prompt words, the method for constructing the character image generation combination library may further include steps A10-A20:
[0112] Step A10: Using a pre-trained image generation model, generate a target character image corresponding to the character image generation combination, and determine the character quality of the target character image;
[0113] Step A20: When the character quality of the target character image is the second character quality, perform the step of adjusting the prompt word to obtain multiple neighboring variant prompt words.
[0114] It should be noted that, in this embodiment, the target character image refers to the character image generated directly by the image generation model based on the original character image generation combination to be evaluated (i.e., the combination of the original prompt word and the original seed value). This target character image represents the basic output performance of the combination without any semantic perturbation, and serves as a benchmark sample for evaluating whether the combination is qualified to enter the subsequent neighborhood testing process. Its role is to act as the "first quality screening checkpoint," used to determine whether the combination has demonstrated sufficiently high character generation capabilities under the original prompt conditions, thereby deciding whether it is worthwhile to invest computational resources for more in-depth robustness verification.
[0115] This implementation introduces a pre-emptive quality screening mechanism. Before generating neighboring variant prompts through prompt word perturbation, it first verifies the output quality of the original combination under standard input. Specifically, the system only initiates the subsequent neighboring variant testing process if the target character image generated by the combination meets the second character quality standard (i.e., high fidelity, no errors, reasonable arrangement, and clear edges). If the target character image does not meet this standard, the combination is directly excluded, and the time-consuming variant generation and batch evaluation are no longer performed.
[0116] The pre-emptive quality screening mechanism in this embodiment effectively avoids invalid evaluation of obviously low-quality combinations. During the construction of a large-scale combination library, many prompt-seed value combinations cannot generate qualified character images under the original conditions. Performing a complete neighborhood variant test on all combinations (including generating multiple variant prompts, calling the model multiple times for inference, and performing quality evaluation) would result in a serious waste of computational resources. This embodiment, by setting steps A10 and A20 as pre-filtering conditions, allows the system to quickly eliminate candidate combinations that lack basic generation capabilities, significantly reducing unnecessary computational overhead and improving overall library construction efficiency.
[0117] On the other hand, it strengthens the logical rationality of high-quality combination selection. The core objective of this embodiment is to identify reliable combinations that can stably generate high-quality character images even under multiple semantically similar prompts. If a combination cannot produce a high-quality image even under the original prompt, then its likelihood of performing well under perturbation prompts is extremely low. Therefore, taking "meeting the original output quality standard" as a prerequisite for entering the depth test conforms to the evaluation logic from "point" to "surface": first confirm that the combination performs well at the "center point" (original prompt), and then further examine its stability in the "neighborhood surface" (variant prompts), thereby ensuring that each entry in the final combination library has real and reliable high-quality generation potential.
[0118] Furthermore, this implementation method enhances the reliability and reusability of the combination library. Since all combinations added to the library undergo a dual screening process of "original quality verification + neighborhood stability testing," users can highly rely on their performance during subsequent calls. When a new suggestion word is similar to or identical to a combination suggestion word in the library, reusing its seed value not only improves generation efficiency but also ensures that the generated result has a high-quality foundation under the original input conditions, thereby improving the overall service stability and user experience.
[0119] In summary, this implementation method constructs a hierarchical evaluation architecture of "initial screening followed by in-depth testing" by adding a pre-screening step based on the quality of the target character image. This mechanism significantly optimizes resource utilization efficiency and the rigor of the screening logic without altering the original technical framework, making the construction process of the character image generation library more efficient, accurate, and scalable, thus providing strong support for realizing a large-scale, highly available character image generation system.
[0120] In one feasible implementation, the prompt words include a content description field, a style constraint field, a quality requirement field, and a format requirement field;
[0121] Step S200 above adjusts the prompt word to obtain multiple neighboring variant prompt words, which may include step S210:
[0122] Step S210: Adjust at least one of the content description field, the style constraint field, the quality requirement field, and the format requirement field to obtain multiple neighborhood variant prompt words of the prompt word;
[0123] Wherein, when the target field is adjusted, the similarity between the target field of the multiple neighboring variant prompt words and the target field of the prompt word is greater than the second similarity. The target field is the content description field, the style constraint field, the quality requirement field, or the format requirement field, and the second similarity is greater than the first similarity.
[0124] It should be noted that, in this embodiment, the prompt words include a content description field, a style constraint field, a quality requirement field, and a format requirement field.
[0125] The content description field refers to the information in the prompt word used to specifically describe the character content, image content, and theme that the character image should contain.
[0126] The style constraint field refers to the information in the prompt word that is used to limit the overall visual style of the character image. Specifically, it may include, but is not limited to, artistic style (such as "modern style"), color scheme (such as "blue background"), etc., and aims to guide the image generation model to generate character images that conform to a specific visual style.
[0127] The quality requirements field refers to the explicit quality standards for the characters in the character image specified in the prompt. These standards cover multiple dimensions such as sharpness, distortion-free images, and proper layout, ensuring that the characters in the generated character image are not only aesthetically pleasing but also highly readable.
[0128] The format requirements field specifies the exact layout, arrangement, and presentation of the characters in the character image within the prompt text. This includes details such as character size ratios, positional relationships, and line spacing, to ensure the characters appear in the image as intended.
[0129] It should also be noted that, in this embodiment, the target field refers to the field adjusted during the prompt word adjustment, which can be any one of the content description field, style constraint field, quality requirement field, or format requirement field. The second similarity is a standard used to measure the degree of similarity between two prompt words in a specific field. Its value is set higher than the first similarity to ensure that even after semantically preserving perturbations, the generated neighboring variant prompt words still closely revolve around the core intent of the original prompt words, guaranteeing the effectiveness and accuracy of the evaluation. This prevents over-adjustment of a certain field during the adjustment process, which could lead to the adjusted prompt words still being highly similar to the original prompt words overall, but deviating from the core intent of the original prompt words, thus rendering the evaluation results meaningless.
[0130] This implementation refines the generation strategy for neighboring variant prompts by finely dividing the different components of the prompt words and selectively fine-tuning these fields. This method not only more accurately simulates user modification behavior in real-world applications but also delves into the impact mechanism of different fields on the final generated result. In particular, by setting a high second similarity threshold, it ensures that even adjusted prompt words maintain a high degree of relevance to the original prompt words in terms of core intent, thereby effectively focusing on the key factors that truly affect the stability of character image generation. This layered and fine-tuning method greatly improves the reliability and practicality of the selected high-quality character image generation combinations, while also providing more flexible and powerful support for subsequent applications.
[0131] Based on the first embodiment described above, a method for constructing a character image generation and combination library according to the second embodiment of this application is proposed.
[0132] In the second embodiment of this application, the same or similar content as in the above embodiments can be referred to the above description, and will not be repeated hereafter.
[0133] Please refer to Figure 2 , Figure 2This is a flowchart illustrating the second embodiment of the method for constructing a character image generation and combination library according to this application.
[0134] In this embodiment, the step of determining the character quality of each character image in step S400 above may include steps S410 to S420:
[0135] Step S410: Obtain character quality annotations for each of the character images, wherein the character quality annotations include at least one of the following: number of misspelled characters, number of missing characters, degree of distortion, positional coordination, and size coordination.
[0136] It should be noted that, in this embodiment, character quality annotation refers to structured and quantifiable annotation information on various key attributes of the character portion in the generated character image. This information is used to systematically record and reflect the character's defects or performance level in terms of content accuracy, morphological integrity, and layout rationality. This character quality annotation serves as the original basis for subsequent character quality assessment and is fundamental to achieving objective and consistent evaluation. Specifically, it may include at least one of the following: annotation of the number of misspelled characters, annotation of the number of missing characters, annotation of the degree of distortion, annotation of positional coordination, and annotation of size coordination.
[0137] The error count label refers to the number of incorrectly replaced characters in the generated character image compared to the characters specified in the prompt. For example, if the prompt requires "WELCOME" but the image displays "WELC0ME" (mistaking "O" for "0"), the error count is 1. This error count label measures the semantic accuracy of the character content in the character image and is a core indicator for determining whether characters can be correctly understood.
[0138] The missing character count refers to the number of characters that are not explicitly required to be included in the prompt in the generated character image. For example, if the prompt specifies "SALE TODAY," but the image only displays "SALE ODAY," then the absence or missing characters between "T" and "D" will result in a missing character count of 1 or more, determined by the number of missing characters. This missing character count reflects the ability of the image generation model under the current combined guidance to cover the complete text of the prompt, directly affecting the completeness of information delivery.
[0139] Distortion labeling refers to the quantitative description of the degree of abnormality in the shape of characters in a character image. Specifically, it can be graded or scored based on whether the character has been stretched, distorted, broken, stuck together, has blurred edges, or pixelated. For example, a 5-level scoring system can be used (1 for severe distortion, 5 for perfectly normal), or an automated algorithm can be used to calculate the similarity score between the character outline and a standard font template. This distortion labeling is used to evaluate the visual readability and rendering quality of character portions in a character image, and is particularly crucial in high-resolution output or printing scenarios.
[0140] Positional coordination annotation refers to the evaluation of whether the arrangement of characters in an image conforms to semantic logic and visual expectations. For example, if the prompt description is "brand name in the center, slogan below," and the brand name is offset to the left or the slogan overlaps with the brand name in the generated image, it is considered positional inconsistency. This positional coordination annotation can be achieved through manual judgment of whether it meets the layout requirements, or by using image analysis technology to detect alignment deviations between the character area and the reference composition, and is used to measure the overall rationality of the text and image composition.
[0141] Size coordination refers to the assessment of whether the relative sizes of different parts within a character in a character image (such as the main title and subtitle) are harmonious, or whether the character is in harmony with other visual elements. For example, the main title "SALE" should be significantly larger than the subtitle; if they are similar in size or the order is reversed, it is considered a size inconsistency. This size coordination can be determined by manually judging or measuring the font height ratio of each text block and comparing it with the expected ratio, ensuring clear visual hierarchy and highlighting key points.
[0142] In this embodiment, the character quality annotation of each character image can be obtained through various methods, such as manual annotation, automated detection, or a combination of both. Manual annotation involves professionals scoring or marking each character according to unified standards, offering high accuracy and suitability for small-scale, high-precision evaluation. Automated detection utilizes optical character recognition technology to extract the actual character content from the image to count errors and omissions, and combines image segmentation and geometric analysis algorithms to evaluate position and size consistency, offering high efficiency and suitability for large-scale batch processing. By integrating manual and automated methods, overall efficiency can be improved while ensuring evaluation quality.
[0143] This embodiment introduces a structured, multi-dimensional character quality annotation system, transforming the originally vague and subjective concept of "whether a character is good or bad" into recordable, comparable, and analyzable quantitative data, providing a solid data foundation for subsequent systematic evaluation. This method not only enhances the transparency and traceability of the character quality evaluation process but also provides refined decision-making basis for building a high-quality, reusable character image generation and combination library.
[0144] Step S420: Based on the character quality annotation of each character image, perform character quality evaluation on each character image to obtain the character quality of each character image.
[0145] It should be noted that the character quality assessment in this embodiment refers to the process of comprehensively judging and classifying the overall character quality of each character image by integrating various character quality annotation results and using a preset evaluation model or rules. Its goal is to integrate the scattered character quality annotation information into a unified character quality conclusion, such as "high quality," "medium quality," or "low quality," or to output a continuous quality score (e.g., 0-100 points), to support the stability determination of the generated character image combinations in subsequent steps.
[0146] In this embodiment, after obtaining the character quality standards for each character image, the character quality of each character image can be evaluated using methods such as weighted scoring, rule-based judgment models, or machine learning classifiers, thereby obtaining the character quality of each character image. Specifically, the weight coefficients of each annotation dimension can be preset (e.g., the number of misspelled words has the highest weight, followed by positional coordination), and the various annotations can be converted into standardized scores and then weighted and summed to obtain a comprehensive quality score; or hard rules can be set, such as "if the number of misspelled words > 0, it is directly judged as low quality", and "if there are 0 misspelled words and the degree of distortion is ≥ 4 points, it is judged as high quality"; or a classification model can be trained, using historical annotation data as input, to learn the mapping relationship between different annotation combinations and the final quality level, thereby achieving intelligent evaluation.
[0147] This embodiment establishes a complete chain from annotation to evaluation, achieving standardization and automation of character quality assessment. Compared to methods relying solely on subjective human judgment, this mechanism significantly improves the consistency, objectivity, and scalability of the evaluation. More importantly, the evaluation results directly serve the judgment of "combinatorial stability" in step S500—only combinations that consistently achieve high evaluation scores under various neighborhood variant prompts will be included in the character image generation combination library, thereby ensuring that the combinations in the library possess reliable and high-quality generation capabilities. This implementation provides key technical support for building an efficient, stable, and reliable character image generation system, further promoting the development of image and text generation technology towards specialization and engineering.
[0148] Based on the first embodiment described above, a method for constructing a character image generation and combination library according to the third embodiment of this application is proposed.
[0149] In the third embodiment of this application, the same or similar content as the above embodiments can be referred to the above description, and will not be repeated hereafter.
[0150] Please refer to Figure 3 , Figure 3This is a flowchart illustrating the third embodiment of the method for constructing a character image generation and combination library according to this application.
[0151] In this embodiment, the step of determining the character quality of each character image in step S400 above may further include steps S430 to S440:
[0152] Step S430: Perform character recognition on each of the character images to obtain the character recognition results for each of the character images;
[0153] It should be noted that, in this embodiment, character recognition refers to the process of automatically detecting and extracting readable text content from generated character images using optical character recognition technology. This process typically includes three core stages: text region localization, character segmentation, and character classification. It can transform the pixel information of characters in the image into structured text strings and their related attributes (such as position, confidence level, etc.). Character recognition is a key bridge connecting image output and semantic content verification, and is particularly suitable for scenarios where the accuracy, completeness, and clarity of generated characters need to be automatically evaluated.
[0154] Character recognition results refer to the structured data output after processing by the OCR (Optical Character Recognition) engine. This data includes at least: the recognized text content, the bounding box coordinates of each character or text block, and the confidence score during the recognition process. This result serves as the basic input for subsequent character quality assessment in this embodiment, and can be used to quantitatively analyze the accuracy, completeness, and readability of the character portions in the generated image.
[0155] This embodiment introduces OCR technology to automate the parsing of character image content, overcoming the limitations of traditional methods that rely on manual interpretation or implicit feedback within the model. This makes large-scale, high-efficiency character quality assessment possible. This mechanism not only improves the objectivity and consistency of the assessment but also provides underlying technical support for building a traceable and verifiable high-quality character image generation and combination library.
[0156] Step S440: Based on the character recognition results of each character image, perform character quality assessment on each character image to obtain the character quality of each character image.
[0157] It should be noted that the character quality assessment in this embodiment refers to the process of comprehensively determining whether the character components in the generated image meet the expected standards by using the character recognition results obtained from OCR as the core basis, combined with the character content and format requirements specified in the original prompts, through comparison, statistics, and logical judgment. Its goal is to transform unstructured visual information into structured quality conclusions, supporting the subsequent scientific screening of the stability of character image generation combinations.
[0158] In this embodiment, after obtaining the character recognition results for each character image, the character quality of each character image can be evaluated in various ways to obtain the character quality of each character image. Specifically, the system can design differentiated evaluation strategies based on different dimensions of information in the recognition results (such as the number of recognitions, confidence level, etc.) to flexibly adapt to diverse application scenarios and quality requirements.
[0159] For example, in a first feasible implementation, the character recognition result includes the number of characters recognized;
[0160] Step S440 above, based on the character recognition results of each character image, performs character quality assessment on each character image to obtain the character quality of each character image, and may include steps S441 to S443:
[0161] Step S441: Based on the neighbor variant prompt words corresponding to each of the neighbor variant combinations, determine the number of target characters corresponding to each of the character images, wherein the number of target characters is the number of characters to be generated in the character image;
[0162] It should be noted that in this embodiment, the character recognition result includes the number of recognized characters, where recognized characters refer to the text characters successfully detected by the OCR module, and the number of recognized characters refers to the total number of characters contained in these recognized characters.
[0163] It should also be noted that, in this embodiment, the target character count refers to the theoretical total number of characters calculated based on the text content explicitly described in the neighboring variant prompt. For example, if the neighboring variant prompt is "The poster displays 'BLACK FRIDAY' in the center, with '2025' below," then the target text count is 11 characters for "BLACK FRIDAY" + 4 characters for "2025" = 15 characters. This value represents the total number of characters that should be fully presented in the image under ideal conditions and is a benchmark standard for measuring the completeness of the generated content.
[0164] This implementation method establishes a comparison between "expected" and "actual recognition" by parsing the target text content from the prompt words and counting its character count, providing a quantitative basis for judging whether there are problems such as missing or missing characters.
[0165] Step S442: The character image in which the number of characters recognized is less than the number of target characters is determined as the first character image, and the character quality of the first character image is determined as the first character quality;
[0166] It should be noted that the first character image refers to the character image that was identified as having obvious character quality problems in the text quality assessment based on the character recognition results.
[0167] In this embodiment, the first character image has obvious missing characters or is severely blurred, making it unrecognizable. This is usually accompanied by structural defects, which seriously affect the integrity and professionalism of the information conveyed.
[0168] This implementation uses a hard criterion of "number of recognized characters < number of target characters" to achieve rapid filtering of low-quality text images. This strategy is highly robust and has a low false positive rate, making it particularly suitable for commercial design scenarios with strict requirements for text integrity. Once identified as a first-class text image, it can be directly classified as first-class text quality (i.e., low-quality level) without further complex analysis, significantly improving evaluation efficiency.
[0169] Step S443: Determine the character images other than the first character image in each of the character images as the second character images, and determine the character quality of the second character images.
[0170] It should also be noted that the second character image refers to the character image other than the first character image among the character images corresponding to each neighborhood variant combination.
[0171] In this embodiment, if the number of characters recognized in the second character image is equal to or greater than the number of target characters, it indicates that it has basically completed the complete presentation of the text content specified by the prompt word and is qualified to enter the high-level quality assessment.
[0172] In this embodiment, the text quality of the second text image can be directly determined as the second text quality (i.e., high quality level), or it can be further refined by combining other quality dimensions (such as misspellings, degree of distortion, and layout rationality). For example, the presence of misspellings can be determined by comparing the consistency between the OCR recognition result and the specified text content in the prompt; or visual features such as font edge sharpness and character spacing uniformity can be evaluated using image analysis technology; or the text quality annotation of the second text image can be obtained, and then the text quality of the second text image can be evaluated based on the text quality annotation, thereby determining the text quality of the second text image. This hierarchical evaluation mechanism ensures both efficiency and accuracy, and is suitable for different levels of quality control needs.
[0173] This implementation method effectively balances evaluation speed and accuracy through a two-stage strategy of "coarse screening followed by fine evaluation." Images with significant missing characters are quickly eliminated using simple rules; while images that pass the initial screening can be allocated more resources for in-depth analysis to ensure the high reliability and high reusability of the final database combination.
[0174] In a second feasible implementation, the character recognition result includes the confidence level of the recognized character;
[0175] The above-mentioned step S440, based on the character recognition results of each character image, performs character quality evaluation on each character image to obtain the character quality of each character image, and may further include steps S444~S4436:
[0176] Step S444: Count the number of low-confidence characters in each of the character images, wherein the number of low-confidence characters is the number of recognized characters with a confidence level lower than a preset confidence level.
[0177] It should be noted that in this embodiment, the character recognition result includes the confidence level of the recognized characters. This confidence level refers to the probability value output by the OCR engine when recognizing each character or text block, used to represent the reliability of the recognition result. It typically ranges from 0 to 1 or from 0% to 100%. High confidence level means that the character outline is clear, the background is clean, the font is standardized, and it is easy to recognize correctly; low confidence level often corresponds to blurry, distorted, occluded, or low-contrast text areas.
[0178] It should also be noted that, in this embodiment, the preset confidence level refers to a pre-set threshold (such as 0.7 or 70%) used to distinguish between "reliable identification" and "suspicious identification". When the confidence level of an identified character is lower than this threshold, it is regarded as a "low-confidence character", reflecting its poor visual quality or potential error risk.
[0179] This implementation method introduces a confidence index to deepen the text quality assessment from "whether it is recognized" to "how reliably it is recognized", thereby capturing subtle quality problems that are difficult to find by the number of characters alone, such as slight blurring, jagged edges, uneven lighting, and other factors that affect readability.
[0180] Step S445: The character image with more than a preset number of low confidence values among the character images is identified as the first character image, and the character quality of the first character image is identified as the first character quality.
[0181] It should be noted that, in this embodiment, the preset number of characters refers to a threshold set in advance to evaluate the quality of a text image. This threshold is used to compare with the number of low-confidence characters identified in the text image. Specifically, the preset number of characters is an acceptable minimum standard or limit used to determine whether a text image has reached a sufficient quality standard.
[0182] For example, if the preset number of characters is set to 3, it means that in a text image, if more than 3 characters have a confidence level lower than the preset confidence level (e.g., 70%), then this text image will be labeled as a first-level text image, and its text quality will be considered substandard (i.e., first-level text quality). Conversely, if the number of low-confidence characters in an image does not exceed this preset number of characters, then the image can be considered a second-level text image, and its quality can be further evaluated to determine if it meets a higher standard (i.e., second-level text quality).
[0183] This mechanism allows for flexible adjustment of text image quality requirements based on specific business needs and application scenarios. By setting different preset text counts, a suitable balance can be found between precision and recall, effectively filtering out text images that meet specific quality requirements. Therefore, the selection of the preset text count is crucial to ensuring the quality of the final generated text image library.
[0184] This implementation uses a criterion of "number of low-confidence characters > preset number of characters" to identify images that, while recognizing all the characters, have poor overall clarity. For example, if an image has more than three characters with a recognition confidence level below 70%, it may be classified as the first text image due to overall blurriness, even without missing characters. This strategy effectively prevents images that are "formally complete but substantively low-quality" from being included in the high-quality candidate set, thus improving the rigor of the selection process.
[0185] Step S446: Determine the character images other than the first character image in each of the character images as the second character images, and determine the character quality of the second character images.
[0186] In this embodiment, for text images with a small number or zero low confidence scores, it can be preliminarily determined that their text portion has a good readability foundation and be classified as a second text image. Further evaluation can be conducted to determine whether they meet the quality standards for second-level text images. This evaluation can be completed by combining dimensions such as content consistency verification (whether there are typos) and layout analysis (position / size coordination) to form a comprehensive quality profile.
[0187] This embodiment provides several methods for text quality assessment based on character recognition results. These methods can be used independently or in combination to form a multi-dimensional and multi-level assessment system. Compared to purely manual or experience-driven methods, the text quality assessment methods provided in this embodiment have the advantages of high automation, scalability, and traceability of results. More importantly, this assessment mechanism directly serves the core objective of "seed value stability testing"—only combinations that can consistently produce high recognition rates and high confidence in text images under various cue perturbations are judged as high-quality combinations, thereby ensuring that every configuration in the text image generation combination library has reliable generalization ability and engineering usability.
[0188] In summary, this embodiment, through the deep integration of OCR technology and structured evaluation logic, constructs an efficient, accurate, and scalable automated text quality evaluation framework, significantly improving the construction efficiency and quality assurance level of the text-image generation combination library, and laying a solid technical foundation for realizing a "high-quality, high-efficiency" text and image generation system.
[0189] It should be noted that the above embodiments / implementations are only used to assist in understanding this application and do not constitute a limitation on the construction method of the character image generation and combination library of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0190] In addition, this application also provides a construction apparatus for a character image generation and combination library, please refer to... Figure 4 The device includes:
[0191] The acquisition module 10 is used to acquire the character image generation combination to be evaluated, wherein the character image generation combination consists of a prompt word and a seed value;
[0192] The adjustment module 20 is used to adjust the prompt word to obtain multiple neighboring variant prompt words of the prompt word, wherein the similarity between the multiple neighboring variant prompt words and the prompt word is greater than the first similarity.
[0193] Combination module 30 is used to construct multiple neighborhood variant combinations of the character image generation combination based on the multiple neighborhood variant prompt words and the seed value;
[0194] The generation module 40 is used to generate character images corresponding to each neighborhood variant combination through a pre-trained image generation model, and to determine the character quality of each character image;
[0195] The construction module 50 is used to determine whether the character image generation combination is a high-quality character image generation combination based on the character quality of each character image, and to construct a character image generation combination library based on at least one of the high-quality character image generation combinations.
[0196] In one feasible implementation, the building module 50 is further configured to:
[0197] The percentage of character images with the target character quality in each character image was statistically determined.
[0198] If the target character quality is a first character quality and the proportion of the number of images is less than a first preset proportion, then the character image generation combination is determined to be a high-quality character image generation combination.
[0199] And / or, if the target character quality is the second character quality and the proportion of the number of images is greater than the second preset proportion, the character image generation combination is determined to be a high-quality character image generation combination;
[0200] The quality of the second character is higher than that of the first character, and the second preset percentage is greater than that of the first preset percentage.
[0201] In one feasible implementation, the device is further used for:
[0202] Using a pre-trained image generation model, a target character image corresponding to the character image generation combination is generated, and the character quality of the target character image is determined.
[0203] When the character quality of the target character image is the second character quality, the step of adjusting the prompt word to obtain multiple neighboring variant prompt words is performed.
[0204] In one feasible implementation, the generation module 40 is further configured to:
[0205] Obtain character quality annotations for each of the character images, wherein the character quality annotations include at least one of the following: number of misspelled characters, number of missing characters, degree of distortion, positional consistency, and size consistency.
[0206] Based on the character quality annotations of each character image, the character quality of each character image is evaluated to obtain the character quality of each character image.
[0207] In one feasible implementation, the generation module 40 is further configured to:
[0208] Perform character recognition on each of the character images to obtain the character recognition results for each of the character images;
[0209] Based on the character recognition results of each character image, the character quality of each character image is evaluated to obtain the character quality of each character image.
[0210] In one feasible implementation, the character recognition result includes the number of characters recognized;
[0211] The generation module 40 is further configured to:
[0212] Based on the neighborhood variant prompt words corresponding to each of the neighborhood variant combinations, the number of target characters corresponding to each of the character images is determined, wherein the number of target characters is the number of characters to be generated in the character image;
[0213] The character image in which the number of characters recognized is less than the number of target characters is determined as the first character image, and the character quality of the first character image is determined as the first character quality;
[0214] Character images other than the first character image in each of the character images are identified as second character images, and the character quality of the second character images is determined.
[0215] In one feasible implementation, the character recognition result includes the confidence level of the recognized character;
[0216] The generation module 40 is further configured to:
[0217] The number of low-confidence characters in each of the character images is counted, wherein the number of low-confidence characters is the number of recognized characters with a confidence level lower than a preset confidence level;
[0218] The character image with more than a preset number of low confidence values among all the character images is identified as the first character image, and the character quality of the first character image is identified as the first character quality.
[0219] Character images other than the first character image in each of the character images are identified as second character images, and the character quality of the second character images is determined.
[0220] In one feasible implementation, the generation module 40 is further configured to:
[0221] Obtain the character quality annotation of the second character image, wherein the character quality annotation includes at least one of the following: number of misspelled words, number of missing words, degree of deformity, positional coordination, and size coordination.
[0222] Based on the character quality annotations of each second character image, the character quality of each second character image is evaluated to obtain the character quality of each second character image.
[0223] In one feasible implementation, the prompt words include a content description field, a style constraint field, a quality requirement field, and a format requirement field;
[0224] The adjustment module 20 is also used for:
[0225] Adjusting at least one of the content description field, the style constraint field, the quality requirement field, and the format requirement field yields multiple neighboring variant prompt words.
[0226] Wherein, when the target field is adjusted, the similarity between the target field of the multiple neighboring variant prompt words and the target field of the prompt word is greater than the second similarity. The target field is the content description field, the style constraint field, the quality requirement field, or the format requirement field, and the second similarity is greater than the first similarity.
[0227] The character image generation and combination library construction apparatus provided in this application, employing the character image generation and combination library construction method in the above embodiments, can solve the technical problem of balancing character quality and generation efficiency during the character image generation process. Compared with the prior art, the beneficial effects of the character image generation and combination library construction apparatus provided in this application are the same as those of the character image generation and combination library construction method provided in the above embodiments, and other technical features in the character image generation and combination library construction apparatus are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0228] In addition, please refer to Figure 5 , Figure 5 This is a schematic diagram of the hardware operating environment of the electronic device involved in the construction method of the character image generation and combination library in this application embodiment.
[0229] This application also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of the character image generation and combination library construction method in the above embodiments.
[0230] The following is for reference. Figure 5 It shows a structural schematic diagram of an electronic device suitable for implementing the embodiments of this application. The electronic device may include, but is not limited to, terminal devices such as mobile phones, laptops, tablets, and desktop computers, or any electronic device capable of performing the above functions. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0231] like Figure 5 As shown, the electronic device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays, speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tape, hard disks, etc.; and communication devices 1009. The communication device 1009 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although the diagrams show electronic devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented alternatively.
[0232] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0233] The electronic device provided in this application, employing the character image generation and combination library construction method described in the above embodiments, can solve the technical problem of balancing character quality and generation efficiency during the character image generation process. Compared with the prior art, the beneficial effects of the electronic device provided in this application are the same as those of the character image generation and combination library construction method provided in the above embodiments, and other technical features of this electronic device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0234] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0235] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of protection of the above claims.
[0236] In addition, this application also provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to perform the steps of the character image generation and combination library construction method in the above embodiments.
[0237] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory (erasable programmable read-only memory), optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0238] The aforementioned computer-readable storage medium may be an electronic device or contained within an electronic device; or it may exist independently and not assembled into or contained within an electronic device.
[0239] The aforementioned computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device causes the following: to acquire a character image generation combination to be evaluated, wherein the character image generation combination consists of a prompt word and a seed value; to adjust the prompt word to obtain multiple neighboring variant prompt words, wherein the similarity between the multiple neighboring variant prompt words and the prompt word is greater than a first similarity; to construct multiple neighboring variant combinations of the character image generation combination based on the multiple neighboring variant prompt words and the seed value; to generate character images corresponding to each of the neighboring variant combinations using a pre-trained image generation model, and to determine the character quality of each of the character images; to determine whether the character image generation combination is a high-quality character image generation combination based on the character quality of each of the character images, and to construct a character image generation combination library based on at least one of the high-quality character image generation combinations.
[0240] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including local area networks (LANs) or wide area networks (WANs), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0241] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0242] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0243] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for performing the steps of the above-described method for constructing a character image generation library, which solves the technical problem of balancing character quality and generation efficiency during the character image generation process. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the character image generation library construction method provided in the above embodiments, and will not be repeated here.
[0244] Furthermore, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method for constructing a character image generation and combination library as described in the above embodiments.
[0245] The computer program product provided in this application solves the technical problem of balancing character quality and generation efficiency during the generation of character images. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the character image generation combination library construction method provided in the above embodiments, and will not be repeated here.
[0246] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for constructing a character image generation and combination library, characterized in that, The method includes: Obtain the character image generation combination to be evaluated, wherein the character image generation combination consists of a prompt word and a seed value; The prompt word is adjusted to obtain multiple neighboring variant prompt words, wherein the similarity between the multiple neighboring variant prompt words and the prompt word is greater than the first similarity. Based on the multiple neighborhood variant prompt words and the seed value, multiple neighborhood variant combinations of the character image generation combination are constructed; Using a pre-trained image generation model, character images corresponding to each neighborhood variant combination are generated, and the character quality of each character image is determined. Based on the character quality of each character image, determine whether the character image generation combination is a high-quality character image generation combination, and construct a character image generation combination library based on at least one of the high-quality character image generation combinations; The step of determining whether the character image generation combination is a high-quality character image generation combination based on the character quality of each character image includes: The percentage of character images with the target character quality in each character image was statistically determined. If the target character quality is a first character quality and the proportion of the number of images is less than a first preset proportion, then the character image generation combination is determined to be a high-quality character image generation combination. And / or, if the target character quality is the second character quality and the proportion of the number of images is greater than the second preset proportion, the character image generation combination is determined to be a high-quality character image generation combination; Wherein, the quality of the second character is higher than that of the first character, and the second preset percentage is greater than that of the first preset percentage.
2. The method for constructing a character image generation and combination library as described in claim 1, characterized in that, Before the step of adjusting the prompt word to obtain multiple neighboring variant prompt words, the method further includes: Using a pre-trained image generation model, a target character image corresponding to the character image generation combination is generated, and the character quality of the target character image is determined. When the character quality of the target character image is the second character quality, the step of adjusting the prompt word to obtain multiple neighboring variant prompt words is performed.
3. The method for constructing a character image generation and combination library as described in claim 1 or 2, characterized in that, The step of determining the character quality of each of the character images includes: Obtain character quality annotations for each of the character images, wherein the character quality annotations include at least one of the following: number of misspelled characters, number of missing characters, degree of distortion, positional consistency, and size consistency. Based on the character quality annotations of each character image, the character quality of each character image is evaluated to obtain the character quality of each character image.
4. The method for constructing a character image generation and combination library as described in claim 1 or 2, characterized in that, The step of determining the character quality of each of the character images includes: Perform character recognition on each of the character images to obtain the character recognition results for each of the character images; Based on the character recognition results of each character image, the character quality of each character image is evaluated to obtain the character quality of each character image.
5. The method for constructing a character image generation and combination library as described in claim 4, characterized in that, The character recognition result includes the number of characters that have been recognized; The step of evaluating the character quality of each character image based on the character recognition results of each character image to obtain the character quality of each character image includes: Based on the neighborhood variant prompt words corresponding to each of the neighborhood variant combinations, the number of target characters corresponding to each of the character images is determined, wherein the number of target characters is the number of characters to be generated in the character image; The character image in which the number of characters recognized is less than the number of target characters is determined as the first character image, and the character quality of the first character image is determined as the first character quality; Character images other than the first character image in each of the character images are identified as second character images, and the character quality of the second character images is determined.
6. The method for constructing a character image generation and combination library as described in claim 4, characterized in that, The character recognition result includes the confidence level of the recognized characters; The step of evaluating the character quality of each character image based on the character recognition results of each character image to obtain the character quality evaluation results of each character image includes: The number of low-confidence characters in each of the character images is counted, wherein the number of low-confidence characters is the number of recognized characters with a confidence level lower than a preset confidence level; The character image with more than a preset number of low confidence values among all the character images is identified as the first character image, and the character quality of the first character image is identified as the first character quality. Character images other than the first character image in each of the character images are identified as second character images, and the character quality of the second character images is determined.
7. The method for constructing a character image generation and combination library as described in claim 5 or 6, characterized in that, The step of determining the character quality of the second character image includes: Obtain the character quality annotation of the second character image, wherein the character quality annotation includes at least one of the following: number of misspelled words, number of missing words, degree of deformity, positional coordination, and size coordination. Based on the character quality annotations of each second character image, the character quality of each second character image is evaluated to obtain the character quality of each second character image.
8. The method for constructing a character image generation and combination library as described in claim 1, characterized in that, The prompt words include a content description field, a style constraint field, a quality requirement field, and a format requirement field; The step of adjusting the prompt word to obtain multiple neighboring variant prompt words includes: Adjusting at least one of the content description field, the style constraint field, the quality requirement field, and the format requirement field yields multiple neighboring variant prompt words. Wherein, when the target field is adjusted, the similarity between the target field of the multiple neighboring variant prompt words and the target field of the prompt word is greater than the second similarity. The target field is the content description field, the style constraint field, the quality requirement field, or the format requirement field, and the second similarity is greater than the first similarity.
9. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for constructing the character image generation and combination library as described in any one of claims 1 to 8.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the method for constructing the character image generation and combination library as described in any one of claims 1 to 8.