A high-frequency skeleton guided self-correcting Chinese calligraphy character generation method

By using a high-frequency skeleton-guided self-correction method, the shortcomings of existing technologies in style representation and structural control when generating Chinese calligraphy characters are solved, achieving high-quality calligraphy character generation that is suitable for digital calligraphy creation and cultural inheritance.

CN122156336APending Publication Date: 2026-06-05NORTHWEST UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NORTHWEST UNIV
Filing Date
2026-03-17
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing deep learning methods struggle to effectively capture subtle features such as flying white strokes and dry brush strokes when generating Chinese calligraphy characters. They suffer from weak structural control and a lack of semantic supervision, resulting in insufficient style fidelity and accuracy of character structure in the generated results.

Method used

A high-frequency skeleton-guided self-correction method is adopted, which extracts high-frequency features of images through Laplacian and Canny operators, extracts style features by combining convolutional neural networks, iterates the skeleton extraction module and the multi-feature fusion module, uses a convolution-recurrent hybrid architecture for supervised generation, and optimizes the model with a joint loss function.

Benefits of technology

It achieves precise control over the style and content of calligraphy, and the generated calligraphy characters are significantly improved in terms of style expression and structural accuracy, making them suitable for digital calligraphy creation and cultural inheritance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156336A_ABST
    Figure CN122156336A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of artificial intelligence generation, and specifically relates to a high-frequency skeleton-guided self-correcting Chinese calligraphy character generation method, which comprises the following steps: obtaining an image data set, pre-processing images in the image data set as original images to obtain images and text labels, taking the images and the text labels as inputs, training a self-correcting Chinese calligraphy character generation network, and obtaining a training model; the self-correcting Chinese calligraphy character generation network comprises a style high-frequency extraction module, an iterative skeleton extraction module, a multi-feature fusion module and a character recognition module; extraction and fusion of style features, style high-frequency features, skeleton features and the like are completed through the modules, and the character recognition module is used to supervise the generation result to realize self-correction; the application realizes self-correcting Chinese calligraphy character generation of specified text, reduces generation errors and improves the quality and realism of generated calligraphy images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence generation technology, specifically a high-frequency skeleton-guided self-correcting method for generating Chinese calligraphy characters. Background Technology

[0002] Chinese calligraphy, as an intangible cultural heritage of humanity, embodies the profound essence of Chinese culture through its diverse calligraphic styles and unique artistic expression. However, this traditional art is facing the dilemma of a break in its transmission and high barriers to creation. In recent years, deep learning technology has demonstrated groundbreaking potential in the field of cultural heritage protection, particularly in the significant progress made in generative artificial intelligence-driven artifact restoration and artistic creation. This technological trend has prompted us to explore digital preservation pathways for calligraphy, aiming to achieve the inheritance and innovation of calligraphy art by constructing intelligent generative models.

[0003] However, existing deep learning methods mainly focus on English character generation research, and still have significant limitations when dealing with the complex structural features and delicate brushstrokes of Chinese calligraphy: (1) Insufficient style representation: It is difficult to effectively capture the unique features of calligraphy such as flying white and dry brush when directly using style images as model input; (2) Weak structural control: Text feature extraction methods based on character library mapping are easily constrained by the completeness of the character library and have limited ability to model the topological structure of characters; (3) Lack of semantic supervision: Existing methods lack a mechanism for verifying the semantic consistency of the generated results, making it difficult to simultaneously ensure style fidelity and the accuracy of character structure.

[0004] Therefore, it is necessary to design an efficient, high-frequency skeleton-guided self-correcting method for generating Chinese calligraphy characters. Summary of the Invention

[0005] To address the problems of existing technologies, this invention provides a high-frequency skeleton-guided self-correcting method for generating Chinese calligraphy characters, comprising the following steps: Step 1: Acquire Image Dataset, containing images Images in the dataset are used as original images Preprocessing to obtain the image and text labels ;image Datasets and Text Labels One part is used as the training set, and the rest is used as the test set; Step 2: Use the training set as input data to train the self-correcting Chinese calligraphy character generation network and obtain the trained model; Self-correcting Chinese calligraphy character generation networks include: The high-frequency style extraction module extracts images using the Laplacian and Canny operators. high frequency characteristics ; and extract images using a convolutional neural network stylistic features ; The iterative skeleton extraction module extracts text tags. Mapped to standard character images Image extraction using convolutional neural networks Content features and skeletal features ; Multi-feature fusion module, fusing style features and high frequency characteristics and content features and skeletal features Generate fusion features g to balance image style and content and guide model training; The character recognition module generates results under supervision using a convolutional-recurrent hybrid architecture. Step 3: Input the test set into the trained self-correcting Chinese calligraphy character generation model to test the model's generation performance; Step 4: Input the text content to be generated and the target style image into the trained self-correcting Chinese calligraphy character generation model, and output the calligraphy character image of the corresponding style.

[0006] Furthermore, the preprocessing in step 1 is achieved through a self-written program and OCR-manual verification, specifically including: firstly, processing the acquired image using a self-written program. The images in the dataset are uniformly resolutiond and low-quality filtered to ensure the quality of the training images, resulting in the final images. Secondly, OCR recognition technology is used for preliminary coarse-grained recognition of the image. Text tags are generated by combining text labels and style categories with manual correction and verification. .

[0007] Furthermore, in step 2, the processing of the high-frequency style extraction module specifically includes: First, the image The Laplacian operator is applied to enhance high-frequency components, highlighting edge and texture features in the image. Then, the Canny edge detection algorithm is used to extract the edge contours of the calligraphic characters. A binary mask is generated based on the edge contour information, and the high-frequency components of the main character are separated through mask operations, effectively suppressing background noise interference. Finally, the character edge contours are fused pixel-level with the high-frequency features separated by the mask operation to ensure complete preservation of the detailed features of the main calligraphic character, resulting in a stylistic high-frequency image. The process is described as follows: ;

[0008] in, For image , Represents the Hadamard product. It is a feature fusion operator. This is a pixel-level fusion function. This is a binarized edge feature map. This is the character body mask matrix.

[0009] Furthermore, the processing of the iterative skeleton extraction module specifically includes: Text label Mapped to standard character images Standard character images are processed using convolutional neural networks. The process involves iterative refinement, with the encoder extracting features, the feature refinement module enhancing key regions, and the decoder restoring resolution to obtain a binary character skeleton image. The process is described as follows: ; ; in, It is a binary mapping function; This is the activation function. For encoder, For the feature refinement module, It's a decoder. The input image tensor values, This is a fixed threshold for binarization.

[0010] Furthermore, the character recognition module employs a convolutional-recurrent hybrid architecture to achieve supervision through the following steps: The front-end extracts spatial features using a convolutional neural network, while the back-end models the temporal relationships of characters using a bidirectional long short-term memory network. A temporal classification loss function is then used to calculate the difference between the recognition result and the true label. The process is described as follows: ; in, and It is a two-way feature. For splicing operations, For activation function, and For weights and biases, Character probability distribution This represents the number of time steps in the sequence.

[0011] Furthermore, the multi-feature fusion module employs a three-level attention mechanism, specifically including: Level 1, Content Features and skeletal features Weighted fusion was performed to obtain preliminary fusion results. Φ ; The second stage involves preliminary fusion results and high-frequency features. Through cross-attention fusion; Level 3, Level 2 results and style characteristics The final fused feature is obtained by fusing through cross-attention and then through self-attention. The process is described as follows: ; ; in, (i=1, 2, 3) is the th Layer dot product attention operator; (i=1, 2, 3) is the th The layer's parameter set includes three learnable weight matrices; These are the weighting coefficients.

[0012] Furthermore, a joint loss function is used for optimization during the training of the self-correcting Chinese calligraphy character generation model; The joint loss function includes reconstruction loss, high-frequency contrastive learning loss, multi-scale structural similarity loss, and continuous temporal classification loss, wherein: Reconstruction losses This is used to guide the model to generate an image that is as similar as possible to the original image. The process is described as follows: ; in, This represents the total number of pixels in each image sample. and Representing the locations of the real and reconstructed images, respectively. Pixel intensity value at; High-frequency contrastive learning loss Instructing high-frequency style encoders Learning more features from high-frequency information to discriminate styles can be described as follows: ; in Indicates batch size, It is a set of sample indexes. Includes and Positive samples of the same type; and These represent anchor point samples respectively. and positive samples eigenvectors, It's a temperature parameter. Including All samples outside; Multiscale structural similarity loss The process is described as follows: ; in Indicates the total number of scales. For the current scale; and These represent the mean values ​​of the generated image and the real image, respectively. and For the corresponding variance, This represents the covariance between the two. , It is a small constant used to avoid division by zero; and These are the weighting coefficients for the luminance and contrast components at different scales; Continuous time-series classification loss The process is described as follows: ; in, The final output sequence that needs to be predicted. For sequence length, For the model in the first Input features received at each time step The model at time step Predicted characters The conditional probability, This is a mapping operation.

[0013] The final joint loss function is expressed as follows: ; in, and These are the weighting coefficients.

[0014] The beneficial effects of this invention are: This invention effectively addresses the limitations of existing methods in style representation, structural control, and semantic supervision by modeling calligraphy generation as a conditional generation task. Specifically, this method innovatively integrates high-frequency style features with character skeleton representation, achieving precise control over calligraphy style and content. Simultaneously, a character recognition module supervises the generation process to ensure quality. The final model can automatically generate calligraphy characters conforming to the target style features based on the input text content and style reference images. This method overcomes the limitations of traditional calligraphy generation, achieving high-quality automated generation of multi-style calligraphy, and has significant application value in fields such as digital calligraphy creation and cultural heritage preservation. Attached Figure Description

[0015] Figure 1 This is a flowchart of the high-frequency skeleton-guided self-correcting Chinese calligraphy character generation method of the present invention; Figure 2 This is a framework diagram of the high-frequency style extraction module in this invention; Figure 3 This is a framework diagram of the iterative skeleton extraction module in this invention; Figure 4 This is a framework diagram of the character recognition module in this invention; Figure 5 This is a framework diagram of the multi-feature fusion module of the present invention; Figure 6 This is a qualitative comparative analysis of the present invention with other advanced methods on the Chinese dataset CHC; Figure 7 This is a qualitative comparative analysis of the present invention with other advanced methods on the English dataset IAM; Figure 8 This is a qualitative comparative analysis of the present invention with other advanced methods in CVL; Figure 9 This is a visual quantitative comparison chart of key steps in the generation process of this invention; Figure 10 This is an ablation result diagram comparing the various modules and loss functions of this invention with the self-correcting Chinese calligraphy character generation results. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] refer to Figure 1 This invention provides a high-frequency skeleton-guided self-correcting method for generating Chinese calligraphy characters, comprising the following steps: Step 1: Acquire Image Dataset, containing images The images in the dataset are used as raw images for preprocessing to obtain the final images. and text labels ;image Datasets and Text Labels One part is used as the training set, and the rest as the test set; where the text labels The character skeleton is then extracted by mapping the standard font library into a graphic component. Step 2: Use the training set as input data to train the self-correcting Chinese calligraphy character generation network and obtain the trained model; Self-correcting Chinese calligraphy character generation networks include: The high-frequency style extraction module extracts images using the Laplacian and Canny operators. high frequency characteristics ; and extract images using a convolutional neural network stylistic features ; The iterative skeleton extraction module extracts text tags. Mapped to standard character images Image extraction using convolutional neural networks Content features and skeletal features ; Multi-feature fusion module, fusing style features and high frequency characteristics and content features and skeletal features Generate fusion features This is used to balance image style and content, and to guide model training. The character recognition module generates results under supervision using a convolutional-recurrent hybrid architecture. Step 3: Input the test set into the trained self-correcting Chinese calligraphy character generation model to test the model's generation performance; Step 4: Input the text content to be generated and the target style image into the trained self-correcting Chinese calligraphy character generation model to obtain the calligraphy character image of the corresponding style.

[0018] It should be noted that the image This dataset compiles works by 20 renowned calligraphers, including Fan Wenqiang, Guan Jun, and Liu Gongquan, with each calligrapher contributing 2,000 to 6,000 unique calligraphic character samples. Each image represents a single Chinese character written by the calligrapher in a specific style, and all images are uniformly 64×64 pixels. Text labels corresponding to these images were obtained during data preprocessing, while high-frequency style images and skeleton images were obtained using the method module proposed in this invention. The dataset is divided into a training set (90% of the calligraphy images, text labels, high-frequency style images, and skeleton images for each calligrapher) and a test set (10% of the calligraphy images, text labels, high-frequency style images, and skeleton images for each calligrapher).

[0019] Furthermore, the preprocessing in step 1 is achieved through a simple image resolution unification script written with AI assistance, an image filtering script (filtering pure white and pure black images), and OCR-manual verification. Specifically, it includes: firstly, processing the acquired image using the image resolution unification script. The images in the dataset undergo resolution unification and low-quality filtering (low-quality images mainly refer to solid color images and images where calligraphy characters are not fully displayed; these are processed by a script and then manually filtered) to ensure the quality of the training images and obtain the final images. Secondly, OCR recognition technology is used for preliminary coarse-grained recognition of the image. Text tags are generated by combining text labels and style categories with manual correction and verification. .

[0020] Furthermore, in step 2, the processing of the high-frequency style extraction module specifically includes: First, the image The Laplacian operator is applied to enhance high-frequency components, highlighting edge and texture features in the image. Then, the Canny edge detection algorithm is used to extract the edge contours of the calligraphic characters. A binary mask is generated based on the edge contour information, and the high-frequency components of the main character are separated through mask operations, effectively suppressing background noise interference. Finally, the character edge contours are fused pixel-level with the high-frequency features separated by the mask operation to ensure complete preservation of the detailed features of the main calligraphic character, resulting in a stylistic high-frequency image. The process is described as follows: ; in, The image obtained from the preprocessing in step 1 , Represents the Hadamard product. It is a feature fusion operator. This is a pixel-level fusion function. It is the high-frequency feature map of the style obtained by the final fusion. and These represent the binarized edge feature map and the character body mask matrix obtained through processing, respectively. The overall framework of the Style High Frequency Extraction Module (SHFEM) is as follows: Figure 2 As shown; SHFEM employs a multi-level high-frequency feature extraction strategy to accurately capture the stylistic details of calligraphy works. First, the input calligraphy image is processed using the Laplacian operator. High-frequency enhancement processing significantly improves the contrast of stroke edges and texture features. Simultaneously, the Canny edge detection algorithm with adaptive thresholding accurately extracts the structured contour information of calligraphic characters. Based on the extracted edge features, a precise binary mask is generated. This mask is used to selectively extract high-frequency features, preserving the high-frequency components of stroke details while effectively filtering out background noise. Finally, feature fusion technology is employed to deeply fuse the optimized high-frequency features with the edge contour features, generating a high-frequency information representation containing complete stylistic details. .

[0021] Furthermore, the iterative skeleton extraction module is implemented using a convolutional neural network structure, specifically including: Text label Mapped to standard character images Standard character images are processed using convolutional neural networks. The process involves iterative refinement, with the encoder extracting features, the feature refinement module enhancing key regions, and the decoder restoring resolution to obtain a binary character skeleton image. The process is described as follows: ; ; in, It is a binary mapping function; It is the sigmoid activation function. For encoder, As a feature refinement module, it mainly uses the combination of residual blocks and attention gating mechanism to gradually approximate the real skeleton graphic of the character through multiple iterations; It's a decoder. Let the input image tensor be denoted as . The fixed threshold is used for binarization. The tensor of the preprocessed input image is denoted as... , Set as probability Figure Two A fixed threshold for value-based evaluation. The framework diagram of the Iterative Skeleton Extraction (ISEM) module is shown below. Figure 3 As shown; It should be noted that ISEM based on convolutional neural networks is more flexible and more accurate in extracting details of the main skeleton. First, the input image... The image is preprocessed by grayscale conversion and size normalization, then converted to tensor format for input into the network. The iterative skeleton extraction module employs an encoder-decoder structure: the encoder primarily uses standard Conv2d convolutions with 3x3 and 1x1 kernels for encoding, and progressively extracts and compresses features using batch normalization, ReLU activation, and pooling operations (max pooling and average pooling); intermediate layers enhance feature representation through residual blocks and attention mechanisms; the decoder restores spatial resolution through upsampling and convolutional layers, ultimately outputting a probability map with the same size as the input. After sigmoid activation, threshold binarization (>0.5 for skeleton, otherwise for background) yields the final skeleton image. This enables end-to-end character skeleton extraction.

[0022] By processing the results of these modules, we successfully constructed a multimodal calligraphy dataset, CHC, which gathers works by 20 renowned calligraphers, including Fan Wenqiang, Guan Jun, and Liu Gongquan. Each calligrapher contributed 2,000 to 6,000 unique calligraphy character samples. Each image represents a single Chinese character written by the calligrapher in a specific style, and all images are uniformly 64×64 pixels. Each calligraphy image has corresponding text labels, high-frequency style images, and skeleton images. The dataset is divided into a training set (90% of the calligraphy images, text labels, high-frequency style images, and skeleton images for each calligrapher) and a test set (10% of the calligraphy images, text labels, high-frequency style images, and skeleton images for each calligrapher).

[0023] Furthermore, the character recognition module employs a convolutional-recurrent hybrid architecture to achieve supervision through the following steps: The front-end extracts spatial features using a standard convolutional neural network, while the back-end models the temporal relationships of characters using a bidirectional long short-term memory network. A temporal classification loss function is then used to calculate the difference between the recognition result and the true label. The process is described as follows: ; in, and It is a two-way feature. For splicing operations, For activation function, and For weights and biases, Character probability distribution This represents the sequence time steps. The framework diagram of the Character Recognition Module (CRM) is as follows: Figure 4 As shown; It should be noted that the CRM module employs a deep learning-based character recognition supervision mechanism, optimizing the accuracy of generated calligraphy content through end-to-end training. This module uses a CNN-Bi-LSTM hybrid architecture: the CNN part extracts character spatial features through a combination of four standard Conv2d convolutional layers (kernel sizes: 3*3 and 7*7), batch normalization, and ReLU activation functions, forming a compact feature representation after MaxPooling compression; the Bi-LSTM part models the temporal structural relationships of characters. The CTC loss function is used to measure the difference between the generated result and the target character, providing semantic-level feedback to the generation model and ensuring that the output retains the correct text structure and stroke order. This joint training mechanism significantly improves the controllability of the generated calligraphy content.

[0024] Furthermore, the multi-feature fusion module employs a three-level attention mechanism, specifically including: Level 1, Content Features and skeletal features Weighted fusion was performed to obtain preliminary fusion results. Φ ; The second stage involves preliminary fusion results and high-frequency features. Through cross-attention fusion; Level 3, Level 2 results and style characteristics The final fused feature is obtained by fusing through cross-attention and then through self-attention. The process is described as follows: ; ; in, , These are content and skeletal features, respectively. This indicates the preliminary fusion results; and These are frequency characteristics and style characteristics, respectively; (i=1, 2, 3) is the th Layer dot product attention operator; (i=1, 2, 3) is the th The layer's parameter set includes three learnable weight matrices; These are weighting coefficients. In practice, the most appropriate weighting coefficients are obtained by gradually approximating them through multiple sets of experiments. This results in the final fused features. The framework diagram of the Multi-Feature Fusion Module (MFFM) is shown below. Figure 5 As shown; It should be noted that the feature fusion module (MFFM, Multi-Feature Fusion Model) employs a multi-stage processing strategy, processing the four input features... , , and To achieve synergistic integration. First... and After sample segmentation and feature extraction modules, embedding vectors representing high- and low-frequency information are generated respectively. Meanwhile, and Features are used to extract deep representations through a shared encoder and leverage a based... An attention mechanism is used to achieve adaptive weighted fusion. Finally, the content feature fusion result is integrated with high- and low-frequency style features, and self-attention is used to enhance the contextual features, forming a fused feature that combines style characteristics and content accuracy. This provides comprehensive supervision signals for the conditional diffusion model. MFFM achieves an optimized balance between style expression and content structure through hierarchical feature processing.

[0025] Furthermore, a joint loss function is used for optimization during the training of the self-correcting Chinese calligraphy character generation model; The joint loss function includes reconstruction loss, high-frequency contrastive learning loss, multi-scale structural similarity loss, and continuous temporal classification loss, wherein: Reconstruction losses This is used to guide the model to generate an image that is as similar as possible to the original image. The process is described as follows: ; in, This represents the total number of pixels in each image sample. and Representing the locations of the real and reconstructed images, respectively. Pixel intensity value at; High-frequency contrastive learning loss Instructing high-frequency style encoders Learning more features from high-frequency information to discriminate styles can be described as follows: ; in Indicates batch size, It is a set of sample indexes. Includes and Positive samples of the same type; and These represent anchor point samples respectively. and positive samples eigenvectors, It's a temperature parameter. Including All samples outside the range are similar after calculating the inner product and then applying an exponential function. The normalized contrast loss is obtained through computation; Multiscale structural similarity loss When calculating image similarity, information at multiple scales is considered, comparing images at both the global and local levels. This is beneficial for feature recovery at different scales. The process can be described as follows: ; in Indicates the total number of scales. For the current scale; and These represent the mean values ​​of the generated image and the real image, respectively. and For the corresponding variance, This represents the covariance between the two. , It is a small constant used to avoid division by zero; and These are the weighting coefficients for the brightness and contrast components at different scales. By comparing the structural similarity of image patches scale by scale, the loss value is finally obtained by subtracting the weighted product of the similarities at each scale from 1.

[0026] Continuous time-series classification loss The goal of continuous temporal classification loss is to maximize the probability of the correct label sequence, allowing for inconsistent temporal lengths between the input and output. The process can be described as follows: ; in, It is the final output sequence that needs to be predicted, and its length is usually less than the length of the input sequence. . The model represents the first time. The input features received at each time step. The model at time step Predicted characters The conditional probability is calculated using the Softmax function. An intermediate sequence of the same length as the input, which may contain repeated characters and blanks. path Mapping to target sequence The operation.

[0027] The final joint loss function is expressed as follows: ; in, and These are weighting coefficients. It should be noted that... and The specific values ​​were obtained through multiple experiments in actual operation, and there is no single value.

[0028] The present invention, a high-frequency skeleton-guided self-correcting Chinese calligraphy character generation method (An Error CorrectionDiffusion Model for Multi-Style Chinese Calligraphy Generation, hereinafter referred to as CalliECD), is capable of extracting high-frequency style information, extracting skeletons, and generating stylized calligraphy characters from traditional Chinese calligraphy images.

[0029] Performance testing: First, qualitative comparison: Compared with models such as GANWriting, HiGAN+, VATr, Diff-Font, and One-DM, the CalliECD method in this application has significant advantages in preserving the calligraphic details of characters and ensuring the style quality of the generated character results; To more concretely demonstrate the generation performance of the CalliECD method, we conducted a qualitative comparison on the CHC, IAM, and CVL datasets. The generation results of all methods are based on the same training data and are visualized at a resolution where the image height is 64. To highlight the key differences, we focused on showing cases with more obvious differences in the generation results.

[0030] The qualitative display on the CHC dataset is as Figure 6 shown. The top three methods with better generation results are: CalliECD, Diff-Font, and One-DM. Among them, when the One-DM method generates Chinese characters, it is prone to errors for similar character structures, such as confusing "示" with "尔"; at the same time, in parts with more and denser strokes, it cannot complete the detail generation well. For the Diff-Font method, it can complete the generation of most Chinese characters, but there are still problems such as misaligned or missing strokes in the generated characters ("砭") and unclear textures ("败"). In the method of this paper, by introducing skeleton information, the problem of misaligned and missing strokes of characters is avoided; at the same time, due to the existence of the recognition module, it forces the model to adjust the model in time when generating incorrect results, ensuring the high quality and accuracy of the final generation results.

[0031] In Figure 7 and Figure 8 the visual qualitative results of each method on the Computer Vision Laboratory (CVL) dataset and the IAM dataset (an open dataset used for handwritten recognition research in the fields of computer vision and machine learning) are respectively shown. Compared with the generation of Chinese calligraphy characters, the generation results of CalliECD for English characters are also good, and the difference from the generation results of other comparison methods is very small. In the generation results of some English words, it is even better than other methods, such as Figure 7 the word "shall" in

[0032] For a more intuitive understanding of the model generation mechanism and to explore the reason why the single-sample-based diffusion methods (such as CalliECD, One-DM, and Diff-Font) are significantly better than the few-sample-based GAN methods (such as GANwriting, HT, and VATr) in the Chinese character generation task, we conducted a visual analysis of the key stages in the denoising process. AsFigure 9 As shown, the CalliECD model divides the Chinese character generation process into two stages: First, in the early stage of the diffusion process (t=0-20 steps), the model prioritizes establishing the basic topological structure of the characters, generating a rough outline that conforms to the target character category; subsequently, under the guidance of conditional mechanisms (including character skeleton constraints, high-frequency style features, and style references), the model gradually refines the brushstroke details and style features (t=20-50 steps), ultimately generating calligraphic characters with complete structure and stylistic consistency. This generation strategy effectively solves the structural distortion and style degradation problems commonly encountered by GAN methods under few-sample conditions.

[0033] In contrast, CalliECD exhibits stable training characteristics and demonstrates superior performance on both the CHC Chinese dataset and the IAM and CVL English datasets. The cross-dataset adaptability of the CalliECD method validates its universality and effectiveness for stylized character generation tasks.

[0034] Second, quantitative evaluation: Widely recognized image quality metrics, including FID, RMSE, Structural Similarity Index (SSIM), and Perceptual Image Quality Evaluation (LPIPS), were employed to systematically evaluate the visual quality and realism of the generated images. LPIPS is a learned perceptual image patch similarity metric, derived through neural network learning. Lower LPIPS values ​​indicate closer and more similar images. SSIM measures the similarity between two images. FID (Fréchet Inception Distance) measures the similarity between the generated and real images. RMSE (Root Mean Square Error) measures the error between the predicted (or reconstructed) value and the true value. These multiple metrics are combined to evaluate the generated calligraphy character images, thus measuring the model's performance. Table 1 compares the model with current state-of-the-art character generation methods using SSIM, FID, LPIPS, and RMSE, demonstrating superior performance across all evaluation metrics and surpassing existing technologies.

[0035] Table 1. Quantitative comparison results with advanced character generation methods on the CHC dataset. ; In the quantitative results shown in Table 1, our proposed CalliECD method outperforms similar one-time methods (One-DM, Diff-Font, HiGAN+

[20] ) and few-sample methods (GANWriting, VATr, HT) on the CHC dataset. In the SSIM index, CalliECD leads with an excellent score of 0.840, which is 7.6% higher than the second-ranked Diff-Font (0.781). This significant advantage shows that our method has outstanding advantages in maintaining the similarity of calligraphic structure. In terms of the FID index, CalliECD achieves the lowest value of 14.420, which is 12.8% lower than the second-ranked Diff-Font (16.534), proving that the distribution difference between the generated image and the real sample is smaller. In the LPIPS index, CalliECD outperforms the second-ranked Diff-Font (0.114) by 14.9% with an excellent performance of 0.097, showing better perceptual similarity. In the RMSE metric, CalliECD's lowest value of 0.131 is 29.2% lower than One-DM (0.185), which ranks second, demonstrating higher pixel-level accuracy.

[0036] To verify the universality of the CalliECD method, we conducted training tests on the IAM and CVL datasets respectively, and the calculated index results are summarized in Tables 2 and 3.

[0037] Table 2. Quantitative comparison results with advanced character generation methods on the IAM dataset. ; As shown in Table 2, CalliECD achieves an SSIM of 0.779 on the IAM dataset, significantly outperforming other methods (such as One-DM's 0.723 and Diff-Font's 0.681), indicating that its generated images are structurally closer to real samples. Furthermore, CalliECD achieves the best FID (18.547) and LPIPS (0.112), which are 0.8% and 15.2% lower than One-DM, respectively, suggesting that the distribution of the generated images is closer to the real data distribution with less perceptual difference. RMSE (0.148) further validates the advantage of pixel-level accuracy.

[0038] Table 3. Quantitative comparison results with advanced character generation methods on the CVL dataset. ; As shown in Table 3, CalliECD also performs exceptionally well on the CVL dataset: SSIM (0.747) improves by 7.6% compared to the suboptimal method One-DM (0.694), demonstrating stronger structure preservation capabilities. FID (24.375) and LPIPS (0.123) are reduced by 5.6% and 13.4% respectively compared to One-DM, proving that the generated quality is higher and more consistent with human visual perception. The significant advantage of RMSE (0.162) (13.4% lower than One-DM) reflects more accurate pixel-level reconstruction capabilities.

[0039] Overall, CalliECD outperforms existing methods across all core metrics, achieving a comprehensive lead in calligraphy generation quality. Its performance is particularly outstanding in maintaining structural similarity and reducing perceptual discrepancies, providing a new technical reference for the field of calligraphy generation research.

[0040] To verify the effectiveness of this method, ablation experiments were conducted on the SHFEM, ISEM, MFFM modules, multi-scale structural similarity loss (MS-SSIM), and continuous temporal classification loss (CTC) in this invention, and qualitative and quantitative analyses were performed by visualizing them. Figure 10 Qualitative results are presented regarding the impact of SHFEM, ISEM, MFFM modules, and MS-SSIM and CTC losses on calligraphic character generation. From... Figure 10 It is readily apparent that without the ISEM module, characters exhibit incomplete strokes and structural errors; while the lack of the CRM module leads to a significant decrease in character detail quality; the MFFM module effectively integrates stroke details and stylistic features, reducing artifacts caused by insufficient control. When all three are applied simultaneously, the generated calligraphy results are very close to the real samples. Without MS-SSIM loss, the generated calligraphy characters begin to show stroke misalignment and blurred structure; and the absence of CTC loss results in a significant decrease in the quality of the generated calligraphy character images.

[0041] Table 4 Network Ablation Research ; To further quantify the effectiveness of the CalliECD module, a series of image quality metrics were used for evaluation, as shown in Table 2. Experimental results show significant improvements across all test samples, fully validating the effectiveness of each module design. Specifically, compared to the variant without the ISEM module, the complete model improved SSIM by 37.0%, reduced FID by 20.7%, reduced LPIPS by 39.8%, and reduced RMSE by 30.0%, demonstrating the important role of the ISEM module in extracting and preserving calligraphic style features. Compared to the variant without the CRM module, the complete model improved SSIM by 6.7%, reduced FID by 9.0%, reduced LPIPS by 28.7%, and reduced RMSE by 22.5%, validating the key contribution of the CRM module in content reconstruction and preserving structural accuracy. In particular, the significant reduction in LPIPS indicates that the CRM module effectively improves the perceptual quality of the generated results. Compared to the variant without the MFFM module, the complete model improved SSIM by 12.7%, reduced FID by 11.9%, reduced LPIPS by 24.8%, and reduced RMSE by 14.4%. These data confirm the importance of the MFFM module in multi-feature fusion modules, which can better integrate feature information at different levels.

[0042] Regarding the loss function, the complete model compared to removing... The variant improved SSIM by 5.8%, reduced FID by 9.1%, decreased LPIPS by 31.2%, and reduced RMSE by 23.8%, validating the crucial role of CTC loss in maintaining character content accuracy. And compared to removing... Compared to the variant, the full model improves SSIM by 19.8%, reduces FID by 17.1%, LPIPS by 38.2%, and RMSE by 24.3%, demonstrating the importance of multi-scale structural similarity loss for improving generation quality.

[0043] In summary, these experimental results fully validate the effectiveness of the CalliECD model's component design, particularly in maintaining calligraphic style characteristics, improving content accuracy, and optimizing perceptual quality, where significant progress has been made. The complete model's comprehensive leadership across all metrics not only demonstrates the synergistic effect of its modules but also provides new technical references for the field of calligraphy generation research.

[0044] Quantitative evaluation: The CalliECD model outperforms existing technologies in all aspects of the evaluation using indicators such as FID, RMSE, SSIM, and LPIPS. Ablation experiments also verified the effectiveness of the SHFEM, ISEM, MFFM modules, MS-SSIM, and CTC loss.

[0045] It is worth noting that the high-frequency skeleton-guided self-correcting Chinese calligraphy character generation method of this invention first extracts style high-frequency information from the style pattern by passing the input calligraphy image through a high-frequency information filter. Secondly, it utilizes an encoder to perform sufficient feature extraction and processing on the style reference and its high-frequency information. For the guidance and constraint of the text content, we will use the input text content... The images are mapped to single-character images, and the skeleton information of each character is extracted from them using our designed skeleton extraction network. The mapping results are then fed into a text content encoder, which first processes each character image in parallel using ResNet18, and then concatenates them to form text string features. These features are then processed by a Transformer encoder to extract informative content features with global context. The extracted font skeleton information serves as a guiding constraint for the text content, processed along with the text content encoder. The resulting text content features, skeleton features, and style features are then fed into a fusion module for integration, guiding the learning and generation of the diffusion model. Finally, character recognition is performed on the generated calligraphy results to ensure stylistic consistency and content accuracy. Corresponding loss functions (reconstruction loss, high-frequency contrastive learning loss, multi-scale structural similarity loss, and continuous temporal classification loss) are provided to optimize the model.

[0046] It is worth noting that this invention proposes a complete framework for feature extraction, feature fusion, and supervision for Chinese calligraphy generation tasks, achieving more accurate generation of stylized calligraphic characters and content preservation. While ensuring generation efficiency, it significantly improves the quality of generated calligraphy. Experimental results show that the CalliECD model achieves an excellent SSIM score of 0.840, fully demonstrating the superior performance of the generated results in terms of structural similarity. The FID value is as low as 14.420, indicating that the generated calligraphy highly matches the overall distribution of real samples. The LPIPS score is as low as 0.097, objectively verifying the generation quality and achieving a high degree of consistency with human visual perception in subjective visual experience. The excellent RMSE score of 0.131 strongly confirms the significant improvement in pixel-level accuracy of the generated results. This series of groundbreaking achievements provides strong technical support for the digital inheritance, innovative creation, and cultural promotion of Chinese calligraphy art.

[0047] This method models calligraphy generation as a conditional generation task, effectively addressing the shortcomings of existing methods in style representation, structural control, and semantic supervision. Specifically, this method innovatively introduces high-frequency style information and character skeleton features, while supervising the generation results through a character recognition module, prompting the model to adjust generation parameters and significantly improving the structural integrity and style consistency of the generated characters.

[0048] Experimental validation: Compared with methods such as HiGAN+, VATr, HT, DiffFont, GANWriting, and One-DM, the CalliECD model outperforms other methods in generating Chinese calligraphy images in terms of character stroke structure, stroke details, and style quality. Ablation experiments show that the SHFEM, ISEM, and MFFM modules, as well as the multi-scale structural similarity loss (MS-SSIM) and continuous temporal classification loss (CTC), play a key role in improving the quality of generated Chinese calligraphy character images, and all evaluation metrics confirm the model's advantages.

[0049] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A high-frequency skeleton-guided self-correcting method for generating Chinese calligraphy characters, characterized in that, Includes the following steps: Step 1: Acquire Image Dataset, containing images Images in the dataset are used as original images Preprocessing to obtain the image and corresponding text labels Select a portion of the image. Dataset and its corresponding text labels The rest is used as the test set, serving as the training set. Step 2: Use the training set as input data to train the self-correcting Chinese calligraphy character generation network and obtain the trained model; Self-correcting Chinese calligraphy character generation networks include: The high-frequency style extraction module extracts images using the Laplacian and Canny operators. high frequency characteristics ; and extract images using a convolutional neural network stylistic features ; The iterative skeleton extraction module extracts text tags. Mapped to standard character images Image extraction using convolutional neural networks Content features and skeletal features ; Multi-feature fusion module, fusing style features and high frequency characteristics and content features and skeletal features Generate fusion features g to balance image style and content and guide model training; The character recognition module generates results under supervision using a convolutional-recurrent hybrid architecture. Step 3: Input the test set into the trained self-correcting Chinese calligraphy character generation model to test the model's generation performance; Step 4: Input the text content to be generated and the target style image into the trained self-correcting Chinese calligraphy character generation model, and output the calligraphy character image of the corresponding style.

2. The high-frequency skeleton-guided self-correcting Chinese calligraphy character generation method according to claim 1, characterized in that, The preprocessing described in step 1 includes: first, processing the acquired image... The images in the dataset are subjected to resolution unification and low-quality filtering to obtain the image. Then, OCR recognition technology is used to analyze the image. Perform preliminary coarse-grained recognition to identify images. Text tags are generated by combining text tags and style categories with manual correction and verification. .

3. The high-frequency skeleton-guided self-correcting Chinese calligraphy character generation method according to claim 2, characterized in that, Step 2, the processing of the high-frequency style extraction module, specifically includes: First, the image The Laplacian operator is applied to enhance high-frequency components, highlighting edge and texture features in the image. Then, the Canny edge detection algorithm is used to extract the edge contours of the calligraphic characters. A binary mask is generated based on the edge contour information, and the high-frequency components of the main character are separated through mask operations, effectively suppressing background noise interference. Finally, the character edge contours are fused pixel-level with the high-frequency features separated by the mask operation to ensure complete preservation of the detailed features of the main calligraphic character, resulting in a stylistic high-frequency image. The process is described as follows: ; in, For image , Represents the Hadamard product. It is a feature fusion operator. This is a pixel-level fusion function. This is a binarized edge feature map. This is the character body mask matrix.

4. The high-frequency skeleton-guided self-correcting Chinese calligraphy character generation method according to claim 1, characterized in that, The iterative skeleton extraction module processes images through a convolutional neural network. Content features and skeletal features Specifically, it includes: Standard character images are processed using convolutional neural networks. The process involves iterative refinement, with the encoder extracting features, the feature refinement module enhancing key regions, and the decoder restoring resolution to obtain a binary character skeleton image. The process is described as follows: ; ; in, It is a binary mapping function; For activation functions; For encoder; For feature refinement module; It is a decoder; Let the input image tensor be denoted as; This is a fixed threshold for binarization.

5. The high-frequency skeleton-guided self-correcting Chinese calligraphy character generation method according to claim 1, characterized in that, The character recognition module employs a convolutional-recurrent hybrid architecture to achieve supervision through the following steps: The front-end extracts spatial features using a convolutional neural network, while the back-end models the temporal relationships of characters using a bidirectional long short-term memory network. A temporal classification loss function is then used to calculate the difference between the recognition result and the true label. The process is described as follows: ; in, and It is a two-way feature. For splicing operations, For activation function, and For weights and biases, Character probability distribution This represents the number of time steps in the sequence.

6. The high-frequency skeleton-guided self-correcting Chinese calligraphy character generation method according to claim 1, characterized in that, The multi-feature fusion module employs a three-level attention mechanism, specifically including: Level 1, Content Features and skeletal features Weighted fusion was performed to obtain preliminary fusion results. Φ ; The second level involves the preliminary fusion results. Φ High frequency characteristics By fusing through cross-attention, a second-level fusion result is obtained; The third level combines the results of the second level with stylistic features. The final fused feature is obtained by fusing through cross-attention and then through self-attention. The process is described as follows: ; ; in, (i=1, 2, 3) is the th Layer dot product attention operator; (i=1, 2, 3) is the th The layer's parameter set includes three learnable weight matrices; These are the weighting coefficients.

7. The high-frequency skeleton-guided self-correcting Chinese calligraphy character generation method according to claim 1, characterized in that, A joint loss function is used for optimization during the training of the self-correcting Chinese calligraphy character generation model. The joint loss function includes reconstruction loss, high-frequency contrastive learning loss, multi-scale structural similarity loss, and continuous temporal classification loss, wherein: Reconstruction losses This is used to guide the model to generate an image that is as similar as possible to the original image. The process is described as follows: ; in, This represents the total number of pixels in each image sample. and Representing the locations of the real and reconstructed images, respectively. Pixel intensity value at; High-frequency contrastive learning loss Instructing high-frequency style encoders Learning more features from high-frequency information to discriminate styles can be described as follows: ; Among them, Indicates batch size, It is a set of sample indexes. Includes and Positive samples of the same type; and These represent anchor point samples respectively. and positive samples eigenvectors, It's a temperature parameter. Including All samples outside; Multiscale structural similarity loss The process is described as follows: ; in Indicates the total number of scales. For the current scale; and These represent the mean values ​​of the generated image and the real image, respectively. and For the corresponding variance, This represents the covariance between the two. , It is a small constant used to avoid division by zero; and These are the weighting coefficients for the luminance and contrast components at different scales; Continuous time-series classification loss The process is described as follows: ; in, The final output sequence that needs to be predicted. For sequence length, For the model in the first Input features received at each time step The model at time step Predicted characters The conditional probability, This is a mapping operation; The final joint loss function is expressed as follows: ; in, and These are the weighting coefficients.