Chinese character generation quality evaluation method based on twin network
The Chinese character font features are extracted through the contour perception and channel attention mechanism of the twin network, which solves the problem that traditional evaluation indicators are difficult to detect the error in the details of Chinese character fonts, and achieves efficient and objective evaluation of the quality of Chinese character generation.
Patent Information
- Application Number
- CN202510580815.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-15
AI Technical Summary
It is difficult to accurately evaluate the detailed structure errors in Chinese character font generation, such as ‘missing strokes’, ‘multiple strokes’ and ‘broken strokes’.
By constructing a Chinese character data set containing correct and wrong font samples, the contour perception attention and channel attention mechanism of the twin network are used to extract features, fuse features and calculate the matching degree to obtain the quality score of Chinese character fonts.
It realizes accurate evaluation of the quality of Chinese character generation, can effectively detect detailed structure errors, and provides an efficient and objective evaluation method.
Smart Images

Figure CN120496103A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a Chinese character generation quality evaluation method based on a twin network. Background Art
[0002] As a writing system with a long and rich history, Chinese characters have long been deeply ingrained into people's lives, becoming an irreplaceable cultural medium. Chinese characters are complex in structure, each composed of a few basic strokes, and different combinations of these strokes create unique characters. Generating a complete set of 70,000 Chinese font images and relying solely on traditional human visual evaluation is not only time-consuming and labor-intensive, but also difficult to achieve comprehensive and accurate quality control. Therefore, an efficient and objective evaluation method is urgently needed to ensure that the quality of generated fonts meets requirements.
[0003] However, traditional image evaluation metrics struggle to accurately assess the results of Chinese font generation. While common image evaluation metrics (such as PSNR, SSIM, and LPIPS) are valuable for measuring overall image similarity, they have significant limitations when evaluating Chinese font generation, particularly when addressing issues such as missing strokes, extra strokes, broken strokes, and inconsistent content. Specifically, these traditional metrics primarily focus on global pixel-level errors or perceptual differences, but are unable to effectively detect structural errors at the detailed level of Chinese fonts. Summary of the Invention
[0004] The purpose of this section is to summarize some aspects of the embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the abstract and title of this application to avoid obscuring the purpose of this section, the abstract and the title of the invention, and such simplifications or omissions should not be used to limit the scope of the present invention.
[0005] In view of the above existing problems, the present invention is proposed. Therefore, the present invention provides a Chinese character generation quality evaluation method based on a twin network to solve the problem that traditional image evaluation indicators are difficult to effectively detect detailed structural errors such as "missing strokes" and "extra strokes" when evaluating Chinese character font generation results.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a Chinese character generation quality evaluation method based on a twin network, comprising:
[0008] By manually screening samples, a Chinese character dataset containing correct font samples and incorrect font samples is created;
[0009] The generated font and the comparison font are input into the contour-aware attention of the Chinese character generation quality evaluation algorithm network based on the twin network to extract the contour-aware features.
[0010] The generated font and the comparison font are input into the channel attention mechanism of the Chinese character generation quality evaluation algorithm network based on the twin network to extract features and obtain the character meaning features;
[0011] The contour perception features and the word meaning features are fused to obtain the fused features. The fused features of the generated font and the comparison font are used to calculate the Chinese font feature matching degree to obtain the quality score of the Chinese font.
[0012] As a preferred solution of the Chinese character generation quality evaluation method based on the twin network described in the present invention, a Chinese character dataset containing correct font samples and incorrect font samples is created by manually screening samples, including:
[0013] The constructed Chinese character dataset consists of correct font samples and incorrect font samples. The incorrect font samples are consistent with the correct font samples in terms of category division and quantity distribution.
[0014] Correct font samples include various types of standard fonts with standardized glyph structure, complete strokes, and accurate semantics. Each font contains multiple Chinese character images.
[0015] Error font samples come from the error results that occur during the actual font generation process, covering various types of font defects.
[0016] As a preferred solution of the Chinese character generation quality evaluation method based on the twin network of the present invention, the generated font and the comparison font are input into the contour perception attention of the Chinese character generation quality evaluation algorithm network based on the twin network to perform feature extraction to obtain contour perception features, including:
[0017] Use the convolution layer in the convolutional neural network to perform convolution operations on the font image to extract the local features of the generated font and the contrast font, and obtain the feature map through multi-layer convolution;
[0018] After normalizing the feature map, the activation function is used to perform nonlinear transformation on the feature map;
[0019] The self-attention mechanism and the spatial attention mechanism are used to calculate the attention weights, and based on the weights, the overall weights are further calculated in the spatial dimension;
[0020] The generated font and the comparison font are multiplied by the overall weight respectively to obtain the outline perception features of the generated font and the comparison font.
[0021] As a preferred solution of the Chinese character generation quality evaluation method based on the twin network described in the present invention, it also includes:
[0022] The formula for obtaining contour-aware features is:
[0023]
[0024] Z FCPA =Z m *Softmax(f 1×1 (A(Z m )+M(Z m )))
[0025] Among them, I g Generate fonts and contrast fonts for input, Is the font image by W q , W k , W v The weighted value, f 1×1 (·) indicates a 1×1 convolution, A(·), M(·) respectively represent the average value and maximum value of the tensor along channel C, Z m It is the intermediate feature representation obtained after calculation by the self-attention mechanism, Z FCPA It is a feature of perceiving font outlines.
[0026] As a preferred solution of the Chinese character generation quality evaluation method based on the twin network described in the present invention, the generated font and the comparison font are input into the channel attention mechanism of the Chinese character generation quality evaluation algorithm network based on the twin network to perform feature extraction to obtain the character meaning features, including:
[0027] Perform global average pooling on the feature maps of the input generated font and the comparison font to obtain a 1×1×C vector;
[0028] The 1×1×C vector obtained by global average pooling is processed through two 1×1 convolutional layers and a fully connected layer, and then nonlinearly transformed using an activation function to calculate the weight of the channel attention;
[0029] Multiply the font content feature vector by the calculated channel attention weight and extract the word meaning features from the feature map.
[0030] As a preferred solution of the Chinese character generation quality evaluation method based on the twin network described in the present invention, it also includes:
[0031] The formula for extracting word meaning features from the feature map is:
[0032] Z FA =f 1×1 (Fc (f 1×1 (A_ pool (Z c ))))
[0033] Z FM =f 1×1 (F c (f 1×1 (M_ pool (Z c ))))
[0034] Z CA =Z m *Softmax(Z FA +Z FM )
[0035] Among them, f 1×1 (·) represents a 1×1 convolution function, A_ pool (·) represents the average pooling layer function, M_ pool (·) represents the maximum pooling layer function, F c (·) represents the fully connected layer function, Z FA With Z FM Represents the output of the average pooling layer and the output of the maximum pooling layer, Zm is the intermediate feature representation obtained after calculation by the self-attention mechanism, and Z c is the font content feature vector of the input channel attention mechanism, Fc(.) is the fully connected layer function, Z CA is the semantic feature finally obtained through the channel attention mechanism.
[0036] As a preferred solution of the Chinese character generation quality evaluation method based on the twin network described in the present invention, wherein: the fusion features of the generated font and the comparison font are used to calculate the Chinese character font feature matching degree to obtain the quality score of the Chinese character font, including:
[0037] The Euclidean distance is used to calculate the distance between the generated font and the comparison font fusion features. The smaller the distance, the more similar the two are, and the higher the quality score of the generated font; conversely, the larger the distance, the lower the quality score.
[0038] In a second aspect, the present invention provides a system for evaluating the quality of Chinese character generation based on a twin network, comprising:
[0039] The data processing module is used to create a Chinese character dataset containing correct font samples and incorrect font samples by manually screening samples;
[0040] The feature acquisition module is used to input the generated font and the comparison font into the contour perception attention of the Chinese character generation quality evaluation algorithm network based on the twin network to extract the contour perception features; the generated font and the comparison font are input into the channel attention mechanism of the Chinese character generation quality evaluation algorithm network based on the twin network to extract the character meaning features;
[0041] The comparison calculation module is used to fuse the contour perception features and the word meaning features to obtain the fusion features, calculate the Chinese font feature matching degree between the fusion features of the generated font and the comparison font, and obtain the quality score of the Chinese font.
[0042] In a third aspect, the present invention provides a computing device, comprising:
[0043] memory and processor;
[0044] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the Chinese character generation quality evaluation method based on the twin network are implemented.
[0045] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the Chinese character generation quality evaluation method based on the twin network.
[0046] Compared with existing technologies, this invention offers the following advantages: It constructs a Chinese character dataset containing both correct and incorrect samples through manual screening, utilizes contour-aware attention and channel-attention mechanisms to extract contour and semantic features, respectively, and then fuses these features and calculates matching scores to evaluate character generation quality. This effectively addresses the difficulty of traditional image evaluation metrics in detecting errors in the detailed structure of Chinese fonts, enabling accurate assessment of character generation quality and providing an efficient and objective evaluation method for related fields such as font generation and quality control. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive effort. Among them:
[0048] Figure 1 This is a schematic diagram of the general process of the Chinese character generation quality evaluation method based on the twin network described in one embodiment of the present invention.
[0049] Figure 2This is a schematic diagram of the overall process of the Chinese character generation quality evaluation method based on the twin network described in one embodiment of the present invention.
[0050] Figure 3 This is a schematic diagram of the algorithm framework of the Chinese character generation quality evaluation method based on the twin network described in one embodiment of the present invention. DETAILED DESCRIPTION
[0051] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the following detailed description of the specific embodiments of the present invention is given in conjunction with the accompanying drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in this field without creative work should fall within the scope of protection of the present invention.
[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0053] Secondly, the term "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in various places throughout this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive of other embodiments.
[0054] The present invention is described in detail with reference to schematic diagrams. For ease of illustration, cross-sectional views of device structures may be partially enlarged and not to scale when describing embodiments of the present invention. Furthermore, the schematic diagrams are merely illustrative and should not limit the scope of the present invention. Furthermore, in actual production, the three-dimensional dimensions of length, width, and depth should be included.
[0055] Furthermore, in the description of the present invention, it should be noted that the terms "upper, lower, inner, and outer" and other references to orientations or positional relationships are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the systems or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first, second, or third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0056] In this disclosure, unless otherwise specified or limited, the terms "mounted," "connected," and "connected" should be interpreted broadly. For example, they may refer to fixed, removable, or integral connections. They may also refer to mechanical, electrical, or direct connections, indirect connections through an intermediary, or internal communication between two components. Those skilled in the art will understand the specific meanings of these terms in this disclosure.
[0057] Example 1
[0058] Reference Figure 1-Figure 3 , as an embodiment of the present invention, provides a Chinese character generation quality evaluation method based on a twin network, comprising:
[0059] S100: Create a Chinese character dataset containing correct and incorrect font samples by manually screening samples;
[0060] Preferably, the constructed Chinese character dataset consists of correct font samples and incorrect font samples, and the incorrect font samples are consistent with the correct font samples in terms of category division and quantity distribution;
[0061] Preferably, the correct font samples are various types of standard fonts with standardized glyph structures, complete strokes, and accurate semantics, and each font contains multiple Chinese character images; the incorrect font samples are derived from the erroneous results that occur during the actual font generation process, covering various different types of font defects.
[0062] Specifically, correct font samples were selected from ten common standard font styles, including Songti, Heiti, and Kaiti, each containing approximately 70,000 Chinese character images. Incorrect font samples included common font defect types such as "broken strokes," "missing strokes," "extra strokes," and "content mismatch." These samples were obtained by collecting error cases from various font generation software, tools, or manual writing.
[0063] S200: Inputting the generated font and the comparison font into the contour-aware attention of the Chinese character generation quality evaluation algorithm network based on the twin network to perform feature extraction to obtain contour-aware features;
[0064] Preferably, a convolution operation is performed on the font image using a convolution layer in a convolutional neural network to extract local features of the generated font and the contrast font, and a feature map is obtained through multi-layer convolution; after normalizing the feature map, an activation function is used to perform a nonlinear transformation on the feature map;
[0065] Preferably, the attention weights are calculated using the self-attention mechanism and the spatial attention mechanism, and the overall weights are further calculated in the spatial dimension based on the weights; the generated font and the comparison font are multiplied by the overall weights respectively to obtain the contour perception features of the generated font and the comparison font.
[0066] Preferably, the formula for obtaining the contour perception feature is:
[0067]
[0068] Z FCPA =Z m *Softmax(f 1×1 (A(Z m )+M(Z m )))
[0069] Among them, I g Generate fonts and contrast fonts for input, Is the font image by W q , W k , W v The weighted value, f 1×1 (·) indicates a 1×1 convolution, A(·), M(·) respectively represent the average value and maximum value of the tensor along channel C, Z m It is the intermediate feature representation obtained after calculation by the self-attention mechanism, Z FCPA It is a feature of perceiving font outlines.
[0070] Specifically, the generated and comparison fonts are fed into the contour-aware attention module of the Siamese-based Chinese character generation quality assessment algorithm. The convolutional layers of the convolutional neural network are used to perform convolution operations on the font images, extracting local features of the generated and comparison fonts. After multiple layers of convolution, feature maps are obtained. After normalization, activation functions are used to perform nonlinear transformations.
[0071] Attention weights are calculated using self-attention and spatial attention mechanisms. In the self-attention mechanism, the input font image is subjected to operations with a specific learnable weight matrix to obtain different feature representations. The correlation scores between these feature representations are calculated and normalized, and then the Softmax function is used to obtain the distribution of attention weights at different positions. In the spatial attention mechanism, the intermediate feature representations obtained by the self-attention mechanism are subjected to average pooling and max pooling operations, respectively, to obtain the average and maximum information in the channel dimension. The two are added together and then subjected to a 1×1 convolution. The Softmax function is then used to obtain the attention weight for each position in the spatial dimension, i.e., the overall weight. The generated and comparison fonts are multiplied by the overall weight respectively to highlight the features of important areas and suppress information in irrelevant areas, thereby obtaining the contour perception features of the generated and comparison fonts.
[0072] It should be noted that the use of convolutional neural networks for convolution, normalization and nonlinear transformation can more accurately mine the local features of fonts and highlight key information; the self-attention mechanism and the spatial attention mechanism are combined to calculate weights and multiply them with the font, which can focus on the key parts of the font strokes and suppress irrelevant information, so that the obtained contour perception features accurately reflect the shape, position and structure of the font strokes, providing a solid and reliable basis for subsequent feature fusion and Chinese font quality evaluation, and improving the accuracy and effectiveness of the evaluation.
[0073] S300: Inputting the generated font and the comparison font into the channel attention mechanism of the Chinese character generation quality evaluation algorithm network based on the twin network to perform feature extraction to obtain the character meaning feature;
[0074] Preferably, global average pooling is performed on the feature maps of the input generated font and the comparison font to obtain a 1×1×C vector;
[0075] Preferably, the 1×1×C vector obtained by global average pooling is processed through two 1×1 convolutional layers and a fully connected layer, and then a nonlinear transformation is performed using an activation function to calculate the channel attention weight; the content feature vector of the font is multiplied by the calculated channel attention weight, and the word meaning feature is extracted from the feature map.
[0076] Preferably, the formula for extracting the word meaning feature from the feature map is:
[0077] Z FA =f 1×1 (F c (f 1×1 (A _pool (Z c )))),
[0078] Z FM =f 1×1 (F c (f 1×1 (M _pool (Z c )))),
[0079] Z CA =Z m *Softmax(Z FA +Z FM ),
[0080] Among them, f 1×1 (·) represents a 1×1 convolution function, A _pool (·) represents the average pooling layer function, M _pool (·) represents the maximum pooling layer function, F c (·) represents the fully connected layer function, Z FA With ZFM Represents the output of the average pooling layer and the output of the maximum pooling layer, Zm is the intermediate feature representation obtained after calculation by the self-attention mechanism, and Z c is the font content feature vector of the input channel attention mechanism, Fc(.) is the fully connected layer function, Z CA is the semantic feature finally obtained through the channel attention mechanism.
[0081] Specifically, when extracting semantic features, a global average pooling operation is first performed on the feature maps of the generated and compared fonts that are input into the network channel attention mechanism of the Chinese character generation quality evaluation algorithm based on the twin network. This step averages the feature maps in the spatial dimension, ultimately obtaining a vector of size 1×1×C, which condenses the overall spatial information of the feature maps. The 1×1×C vector is then processed sequentially through two 1×1 convolutional layers and a fully connected layer. The 1×1 convolutional layer can fuse and adjust information between channels, while the fully connected layer can learn the complex correlations between different channels. After processing, an activation function is used for nonlinear transformation to introduce nonlinear factors into the model and enhance its expressive power, thereby calculating the channel attention weights. The calculated channel attention weights are then multiplied by the font content feature vector.
[0082] It should be noted that the font's content features are adjusted based on the importance of each channel, accurately extracting feature information related to the character's meaning from the feature map. Through these steps, the resulting semantic features can effectively reflect the semantic information of Chinese characters, complementing the previously obtained contour-perception features and laying the foundation for more accurate evaluation of the quality of Chinese font generation.
[0083] S400: Fusing the contour perception features and the character meaning features to obtain fused features, calculating the Chinese character font feature matching between the fused features of the generated font and the comparison font, and obtaining a quality score for the Chinese character font;
[0084] The low-level font outline features and high-level font meaning features are transformed and fused to achieve deep extraction of Chinese character font content features. The formula is:
[0085]
[0086] Among them, Z is the total content feature of the Chinese character font, L(·) is the dimension transformation function, through which the feature is transformed into a one-dimensional feature. For splicing operation;
[0087] Preferably, the Euclidean distance is used to calculate the distance between the fusion features of the generated font and the comparison font. The smaller the distance, the more similar the two are, and the higher the quality score of the generated font; conversely, the larger the distance, the lower the quality score.
[0088] For two fonts with different styles but the same content, the formula for calculating the matching degree of their feature vectors is:
[0089]
[0090] Among them, d(Z g ,Z c ) represents the similarity between the generated font and the comparison font, and the result is a score of 0-1. The higher the score, the higher the quality of the generated Chinese character.
[0091] It should be noted that this method constructs a Chinese character dataset containing both correct and incorrect samples through manual screening. It then uses contour-aware attention and channel-attention mechanisms to extract contour and character semantic features, respectively. These features are then fused and the matching degree is calculated to evaluate the quality of Chinese character generation. This effectively addresses the difficulty of traditional image evaluation metrics in detecting errors in the detailed structure of Chinese character fonts. It can accurately assess the quality of Chinese character generation, providing an efficient and objective evaluation method for related fields such as font generation and quality control, and promoting the development of Chinese character-related technologies.
[0092] The above is a schematic scheme of a Chinese character generation quality evaluation method based on a twin network in this embodiment. It should be noted that the technical solution of the system for evaluating the quality of Chinese character generation based on a twin network and the technical solution of the above-mentioned method for evaluating the quality of Chinese character generation based on a twin network are of the same concept. For details not described in detail in the technical solution of the Chinese character generation quality evaluation system based on a twin network in this embodiment, please refer to the description of the technical solution of the above-mentioned method for evaluating the quality of Chinese character generation based on a twin network.
[0093] The Chinese character generation quality evaluation system based on the twin network in this embodiment includes:
[0094] The data processing module is used to create a Chinese character dataset containing correct font samples and incorrect font samples by manually screening samples;
[0095] The feature acquisition module is used to input the generated font and the comparison font into the contour perception attention of the Chinese character generation quality evaluation algorithm network based on the twin network to extract the contour perception features; the generated font and the comparison font are input into the channel attention mechanism of the Chinese character generation quality evaluation algorithm network based on the twin network to extract the character meaning features;
[0096] The comparison calculation module is used to fuse the contour perception features and the word meaning features to obtain the fusion features, calculate the Chinese font feature matching degree between the fusion features of the generated font and the comparison font, and obtain the quality score of the Chinese font.
[0097] This embodiment further provides a computing device suitable for evaluating the quality of Chinese character generation based on a twin network, including:
[0098] Memory and processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement the Chinese character generation quality evaluation method based on the twin network as proposed in the above embodiment.
[0099] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for evaluating the quality of Chinese character generation based on a twin network as proposed in the above embodiment is implemented.
[0100] The storage medium proposed in this embodiment and the Chinese character generation quality evaluation method based on the twin network proposed in the above embodiment belong to the same inventive concept. The technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0101] Through the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented with the help of software and necessary general-purpose hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a computer's floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.
[0102] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A Chinese character generation quality evaluation method based on twin networks, characterized in that: include: By manually screening samples, a Chinese character dataset containing correct font samples and incorrect font samples is created; The generated font and the comparison font are input into the contour-aware attention of the Chinese character generation quality evaluation algorithm network based on the twin network to extract the contour-aware features. The generated font and the comparison font are input into the channel attention mechanism of the Chinese character generation quality evaluation algorithm network based on the twin network to extract features and obtain the character meaning features; The contour perception features and the word meaning features are fused to obtain the fused features. The fused features of the generated font and the comparison font are used to calculate the Chinese font feature matching degree to obtain the quality score of the Chinese font.
2. The Chinese character generation quality evaluation method based on the twin network according to claim 1, characterized in that: By manually screening samples, a Chinese character dataset containing correct and incorrect font samples is created, including: The constructed Chinese character dataset consists of correct font samples and incorrect font samples. The incorrect font samples are consistent with the correct font samples in terms of category division and quantity distribution. Correct font samples include various types of standard fonts with standardized glyph structure, complete strokes, and accurate semantics. Each font contains multiple Chinese character images. Error font samples come from the error results that occur during the actual font generation process, covering various types of font defects.
3. The Chinese character generation quality evaluation method based on the twin network according to claim 1 or 2, characterized in that: The generated font and the comparison font are input into the contour-aware attention of the Chinese character generation quality evaluation algorithm network based on the twin network for feature extraction to obtain contour-aware features, including: Use the convolution layer in the convolutional neural network to perform convolution operations on the font image to extract the local features of the generated font and the contrast font, and obtain the feature map through multi-layer convolution; After normalizing the feature map, the activation function is used to perform nonlinear transformation on the feature map; The self-attention mechanism and the spatial attention mechanism are used to calculate the attention weights, and based on the weights, the overall weights are further calculated in the spatial dimension; The generated font and the comparison font are multiplied by the overall weight respectively to obtain the outline perception features of the generated font and the comparison font.
4. The Chinese character generation quality evaluation method based on the twin network according to claim 3 is characterized in that: Also includes: The formula for obtaining contour-aware features is: Z FCPA =Z m *Softmax(f 1×1 (A(Z m )+M(Z m ))) Among them, I g Generate fonts and contrast fonts for input, Is the font image by W q , W k , W v The weighted value, f 1×1 (·) indicates a 1×1 convolution, A(·), M(·) respectively represent the average value and maximum value of the tensor along channel C, Z m It is the intermediate feature representation obtained after calculation by the self-attention mechanism, Z FCPA It is a feature of perceiving font outlines.
5. The Chinese character generation quality evaluation method based on the twin network according to claim 4 is characterized in that: The generated font and the comparison font are input into the channel attention mechanism of the Chinese character generation quality evaluation algorithm network based on the twin network to extract the character semantic features, including: Perform global average pooling on the feature maps of the input generated font and the comparison font to obtain a 1×1×C vector; The 1×1×C vector obtained by global average pooling is processed through two 1×1 convolutional layers and a fully connected layer, and then nonlinearly transformed using an activation function to calculate the weight of the channel attention; Multiply the font content feature vector by the calculated channel attention weight and extract the word meaning features from the feature map.
6. The Chinese character generation quality evaluation method based on the twin network according to claim 5, characterized in that: Also includes: The formula for extracting word meaning features from the feature map is: Z FA =f 1×1 (F c (f 1×1 (A_ pool (Z c )))) Z FM =f 1×1 (F c (f 1×1 (M_ pool (Z c )))) WITH CA =Z m *Softmax(Z FA +Z FM ) Among them, f 1×1 (·) represents a 1×1 convolution function, A_ pool (·) represents the average pooling layer function, M_ pool (·) represents the maximum pooling layer function, F c (·) represents the fully connected layer function, Z FA With Z FM Represents the output of the average pooling layer and the output of the maximum pooling layer, Zm is the intermediate feature representation obtained after calculation by the self-attention mechanism, and Z c is the font content feature vector of the input channel attention mechanism, Fc(.) is the fully connected layer function, Z CA is the semantic feature finally obtained through the channel attention mechanism.
7. The Chinese character generation quality evaluation method based on the twin network according to claim 6 is characterized in that: The fusion features of the generated font and the comparison font are used to calculate the Chinese font feature matching degree to obtain the quality score of the Chinese font, including: The Euclidean distance is used to calculate the distance between the generated font and the comparison font fusion features. The smaller the distance, the more similar the two are, and the higher the quality score of the generated font; conversely, the larger the distance, the lower the quality score.
8. A system for evaluating the quality of Chinese character generation based on a twin network, characterized in that: include, The data processing module is used to create a Chinese character dataset containing correct font samples and incorrect font samples by manually screening samples; The feature acquisition module is used to input the generated font and the comparison font into the contour perception attention of the Chinese character generation quality evaluation algorithm network based on the twin network to extract features and obtain contour perception features; The generated font and the comparison font are input into the channel attention mechanism of the Chinese character generation quality evaluation algorithm network based on the twin network to extract features and obtain the character meaning features; The comparison calculation module is used to fuse the contour perception features and the word meaning features to obtain the fusion features, calculate the Chinese font feature matching degree between the fusion features of the generated font and the comparison font, and obtain the quality score of the Chinese font.
9. An electronic device comprising: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the Chinese character generation quality evaluation method based on the twin network as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the Chinese character generation quality evaluation method based on a twin network as described in any one of claims 1 to 7.