CN115205420A - Method for generating ancient character fonts based on GAN network - Google Patents

Method for generating ancient character fonts based on GAN network Download PDF

Info

Publication number
CN115205420A
CN115205420A CN202210821980.6A CN202210821980A CN115205420A CN 115205420 A CN115205420 A CN 115205420A CN 202210821980 A CN202210821980 A CN 202210821980A CN 115205420 A CN115205420 A CN 115205420A
Authority
CN
China
Prior art keywords
font
data set
character
network
decoder
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210821980.6A
Other languages
Chinese (zh)
Inventor
孙金虎
李鹏
安宁
梁天冕
曹玉梅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shaanxi Normal University
Original Assignee
Shaanxi Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shaanxi Normal University filed Critical Shaanxi Normal University
Priority to CN202210821980.6A priority Critical patent/CN115205420A/en
Publication of CN115205420A publication Critical patent/CN115205420A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06T3/04

Abstract

The invention provides a method for generating ancient character fonts based on a GAN network, which comprises the following steps: s1: acquiring a font data set, wherein the font data set comprises two parts, the first part is a font library data set with different styles, and the second part is a character data set; s2: constructing a font style conversion network, and realizing the conversion of Chinese character font styles to obtain font images; s3: performing detail reconstruction on the font image by adopting end-to-end depth convolution through a detail reconstruction network model, and fusing Chinese character stroke semantics and a depth generation network; s4: the characteristics of different intermediate layers in a decoder are utilized to supplement confrontation training for a detail reconstruction network model; s5: sequentially inputting the font data set into a detail reconstruction network model after the countermeasure training, and inputting a corresponding complete target font through a generator; s6: and evaluating the font generation quality according to a model rating system.

Description

Method for generating ancient character fonts based on GAN network
Technical Field
The invention relates to the technical field of GAN network models, in particular to a method for generating ancient character fonts based on a GAN network.
Background
The characters are used as important carriers of human civilization, are cultural symbols, are important marks of human civilization progress, and are also important ways for information record storage and transmission development from ancient times to modern times. Unlike other characters such as english, chinese characters are the only characters that are widely used at present and expressed in a two-dimensional form. Ancient Chinese characters are part of Chinese culture and are carriers of Chinese civilization, and fonts are carriers of the ancient Chinese characters, and the shape, proportion, details and style of each character are changed according to different application scenes. The font can not only enhance readability, understandability and credibility, but also increase aesthetic feeling. The different fonts present different forms, and the visual aesthetic feeling and the spreading value can be added to the fonts while a new expression mode is added to the vision.
In the field of artificial intelligence computer vision, application and development of deep learning have achieved great achievements. With continuous temperature rise of artificial intelligence, continuous development of artificial intelligence technology not only improves productivity, but also creates new products to enter people's lives. The ancient Chinese character font generation problem is more and more concerned because the ancient Chinese character font generation has relatively small field and lower cost hardware. In the process of designing the fonts, the problems of slow design process, time consumption and labor consumption of the ancient traditional Chinese characters are solved by using an artificial intelligence mode. By means of the operation of the generating model and the computer, the styles of fewer font samples are learned through the generating model, and other fonts with consistent styles are generated according to the styles of the few font samples, so that repetitive work is greatly reduced, and the efficiency of font design is improved.
The method based on deep learning can be regarded as an image-to-image conversion problem, and the calligraphy image can be directly generated from the standard font image based on the deep neural network model, and the generated font usually contains fuzzy and ghost pseudo images. These methods often produce unreasonable strokes and incorrectly structured results for characters with complex structures and cursive handwriting styles. Because of the huge number and complex structure of the ancient Chinese characters, establishing a set of complete personalized Chinese characters is still a difficult task till now.
Disclosure of Invention
Technical problem to be solved
In view of the technical problems, the invention provides an ancient character font generation method based on a GAN network, which fuses Chinese character stroke semantics and a deep generation network to enable a font generated by a model to have more reasonable strokes.
(II) technical scheme
The invention provides a method for generating ancient character fonts based on a GAN network, which comprises the following steps:
s1: acquiring a font data set, wherein the font data set comprises two parts, the first part is a font library data set with different styles, and the second part is a character data set;
s2: constructing a font style conversion network, and realizing the conversion of Chinese character font styles to obtain font images;
s3: performing detail reconstruction on the font image by adopting end-to-end depth convolution through a detail reconstruction network model, and fusing Chinese character stroke semantics and a depth generation network;
s4: the characteristics of different intermediate layers in a decoder are utilized to supplement countermeasure training for the detail reconstruction network model;
s5: sequentially inputting the font data set into a detail reconstruction network model after the confrontation training, and inputting a corresponding complete target font through a generator;
s6: and evaluating the font generation quality according to a model rating system.
In some embodiments of the present invention, the method for acquiring font data set in step S1 is:
s11: randomly selecting a plurality of Chinese character libraries with different handwriting styles and design styles;
s12: dividing a character data set into two parts, wherein the first part is a character set selected according to the use frequency, and then selecting a plurality of characters to supplement the character set;
s13: and selecting characters with complex font structures containing all 33 stroke types as a second part to obtain an optimal input character set.
In some embodiments of the present invention, the font style conversion in step S2 is to form a font style conversion network through a font image generator G and a font image discriminator D; the font image generator G comprises an encoder and a decoder, and the encoder and the decoder are of a U-Net structure with jump connection.
In some embodiments of the present invention, in step S5, the font data sets are sequentially input into the detail reconstruction network model after the countermeasure training, and the corresponding complete target font is input through the generator; an encoder and a decoder framework are used as generators, the size of a font image is 255 x 255, the encoder comprises 5 down-sampling layers, each layer adopts a convolution layer with convolution kernel of 5 x 5 and step length of 2 and a ReLU activation function, and feature vectors are obtained through encoding; processing the classified strokes by using one-hot codes to obtain class labels, establishing corresponding output channels for each class, forming mapping through spatial feature transformation, and obtaining stroke semantic feature embedded vectors through mapping transformation; connecting the stroke semantic feature embedding vector with the feature vector; and (3) sending the connected vectors to a decoder, wherein the decoder comprises 5 upsampling layers, and each layer adopts a deconvolution layer with a convolution kernel of 5 multiplied by 5 and a step length of 2 and a ReLU activation function to finally obtain an output font image.
(III) advantageous effects
According to the technical scheme, the invention has at least one of the following beneficial effects:
(1) The Chinese character stroke semantics and the depth generation network are fused, so that the font generated by the model has more reasonable strokes.
(2) The invention utilizes the characteristics extracted from different middle layers in the decoder to bring supplementary confrontation training for the model, and prompts the generator to easily find detailed local differences for better optimizing the generator.
(3) The invention inputs the font data set into the detail reconstruction network model after the countertraining, and can further improve the quality of the generated image.
Drawings
FIG. 1 is a flow diagram of font generation of the present invention.
Fig. 2 is a diagram of a font style conversion network architecture according to the present invention.
Detailed Description
The invention provides a method for generating ancient character fonts based on a GAN network, which is combined with a specific embodiment and attached drawings to further explain the invention in detail in order to make the purposes, technical schemes and advantages of the invention more clear and clearer.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
Examples
As shown in fig. 1, the present invention provides a GAN network-based method for generating ancient text fonts, which comprises the following steps:
s1: acquiring a font data set, wherein the font data set comprises two parts, the first part is a font library data set with different styles, and the second part is a character data set;
s2: constructing a font style conversion network, and realizing the conversion of Chinese character font styles to obtain font images;
s3: performing detail reconstruction on the font image by adopting end-to-end depth convolution through a detail reconstruction network model, and fusing Chinese character stroke semantics and a depth generation network;
s4: the characteristics of different intermediate layers in a decoder are utilized to supplement countermeasure training for the detail reconstruction network model;
s5: sequentially inputting the font data set into a detail reconstruction network model after the countermeasure training, and inputting a corresponding complete target font through a generator;
s6: and evaluating the font generation quality according to a model rating system.
The method for acquiring the font data set in the step S1 includes: s11: randomly selecting a plurality of Chinese character libraries with different handwriting styles and design styles; s12: dividing a character data set into two parts, wherein the first part is a character set selected according to the use frequency, and then selecting a plurality of characters to supplement the character set; s13: and selecting a character with a complex font structure containing all 33 types of strokes as a second part to obtain an optimal input character set.
As shown in fig. 2, the font style conversion in step S2 is to form a font style conversion network through a font image generator G and a font image discriminator D; the font image generator G comprises an encoder and a decoder, and the encoder and the decoder are in a U-Net structure with jump connection. In the step S5, the font data sets are sequentially input into the detail reconstruction network model after the confrontation training, and the corresponding complete target font is input through the generator; the method comprises the steps that a decoder and a decoder framework are used as generators, the size of a font image is 255 x 255, the encoder comprises 5 down-sampling layers, each layer adopts a convolution layer with a convolution kernel of 5 x 5 and a step length of 2 and a ReLU activation function, and feature vectors are obtained through encoding; processing the classified strokes by using one-hot codes to obtain class labels, establishing corresponding output channels for each class, forming mapping through spatial feature transformation, and obtaining stroke semantic feature embedded vectors through mapping transformation; connecting the stroke semantic feature embedding vector with the feature vector; and (3) sending the connected vectors to a decoder, wherein the decoder comprises 5 upsampling layers, and each layer adopts a deconvolution layer with a convolution kernel of 5 multiplied by 5 and a step length of 2 and a ReLU activation function to finally obtain an output font image.
So far, the present embodiment has been described in detail with reference to the accompanying drawings. From the above description, those skilled in the art should clearly recognize the present invention.
It is to be understood that the implementations not shown or described in the drawings or in the text of this specification are in a form known to those skilled in the art and are not described in detail. Furthermore, the above definitions of the various elements and methods are not limited to the specific structures, shapes, or configurations shown in the examples.
It is also noted that the illustrations herein may provide examples of parameters that include particular values, but that these parameters need not be exactly equal to the corresponding values, but may be approximated to the corresponding values within acceptable error tolerances or design constraints. Further, unless steps are specifically described or must occur in sequence, the order of the steps is not limited to that listed above and may be changed or rearranged as desired by the desired design. The embodiments described above may be mixed and matched with each other or with other embodiments based on design and reliability considerations, i.e., technical features in different embodiments may be freely combined to form further embodiments.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the present invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (4)

1. A method for generating ancient character fonts based on a GAN network is characterized by comprising the following steps:
s1: acquiring a font data set, wherein the font data set comprises two parts, the first part is a font library data set with different styles, and the second part is a character data set;
s2: constructing a font style conversion network, and realizing the conversion of Chinese character font styles to obtain font images;
s3: performing detail reconstruction on the font image by adopting end-to-end depth convolution through a detail reconstruction network model, and fusing Chinese character stroke semantics and a depth generation network;
s4: the characteristics of different intermediate layers in a decoder are utilized to supplement countermeasure training for the detail reconstruction network model;
s5: sequentially inputting the font data set into a detail reconstruction network model after the confrontation training, and inputting a corresponding complete target font through a generator;
s6: and evaluating the font generation quality according to a model rating system.
2. The GAN network-based ancient character font generation method according to claim 1, wherein the method for acquiring the font data set in the step S1 is as follows:
s11: randomly selecting a plurality of Chinese character libraries with different handwriting styles and design styles;
s12: dividing a character data set into two parts, wherein the first part is a character set selected according to the use frequency, and then selecting a plurality of characters to supplement the character set;
s13: and selecting characters with complex font structures containing all 33 stroke types as a second part to obtain an optimal input character set.
3. The GAN network-based ancient character font generation method according to claim 1, wherein the font style conversion in step S2 is a font style conversion network formed by a font image generator G and a font image discriminator D; the font image generator G comprises an encoder and a decoder, and the encoder and the decoder are in a U-Net structure with jump connection.
4. The GAN network-based ancient character font generation method according to claim 1, wherein the font data sets are sequentially input into the detail reconstruction network model after the countermeasure training in the step S5, and the corresponding complete target font is input through the generator; an encoder and a decoder framework are used as generators, a font image is input by the encoder, the size of the font image is 255 × 255, the encoder comprises 5 down-sampling layers, each layer adopts a convolution layer with convolution kernel of 5 × 5 and step length of 2 and a ReLU activation function, and feature vectors are obtained through encoding; processing the classified strokes by using one-hot coding to process class labels, establishing a corresponding output channel for each class, forming mapping through spatial feature transformation, and obtaining stroke semantic feature embedded vectors through mapping transformation; connecting the stroke semantic feature embedding vector with the feature vector; and (3) sending the connected vectors to a decoder, wherein the decoder comprises 5 upsampling layers, and each layer adopts a deconvolution layer with a convolution kernel of 5 multiplied by 5 and a step length of 2 and a ReLU activation function to finally obtain an output font image.
CN202210821980.6A 2022-07-13 2022-07-13 Method for generating ancient character fonts based on GAN network Pending CN115205420A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210821980.6A CN115205420A (en) 2022-07-13 2022-07-13 Method for generating ancient character fonts based on GAN network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210821980.6A CN115205420A (en) 2022-07-13 2022-07-13 Method for generating ancient character fonts based on GAN network

Publications (1)

Publication Number Publication Date
CN115205420A true CN115205420A (en) 2022-10-18

Family

ID=83580362

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210821980.6A Pending CN115205420A (en) 2022-07-13 2022-07-13 Method for generating ancient character fonts based on GAN network

Country Status (1)

Country Link
CN (1) CN115205420A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117079263A (en) * 2023-10-16 2023-11-17 内江师范学院 Method, device, equipment and medium for extracting stele characters

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117079263A (en) * 2023-10-16 2023-11-17 内江师范学院 Method, device, equipment and medium for extracting stele characters
CN117079263B (en) * 2023-10-16 2024-01-02 内江师范学院 Method, device, equipment and medium for extracting stele characters

Similar Documents

Publication Publication Date Title
Xu et al. Pad-net: Multi-tasks guided prediction-and-distillation network for simultaneous depth estimation and scene parsing
Lopes et al. A learned representation for scalable vector graphics
Li et al. Layoutgan: Synthesizing graphic layouts with vector-wireframe adversarial networks
CN110533737A (en) The method generated based on structure guidance Chinese character style
CN112163401B (en) Compression and excitation-based Chinese character font generation method of GAN network
CN110428428A (en) A kind of image, semantic dividing method, electronic equipment and readable storage medium storing program for executing
CN110209789A (en) A kind of multi-modal dialog system and method for user's attention guidance
Phan et al. Flexyfont: Learning transferring rules for flexible typeface synthesis
Heyrani Nobari et al. Creativegan: Editing generative adversarial networks for creative design synthesis
Tian et al. Triple attention network for video segmentation
CN113255457A (en) Animation character facial expression generation method and system based on facial expression recognition
He et al. Diff-font: Diffusion model for robust one-shot font generation
Hung et al. Micrography QR codes
CN112036137A (en) Deep learning-based multi-style calligraphy digital ink simulation method and system
Balashova et al. Learning A Stroke‐Based Representation for Fonts
CN115205420A (en) Method for generating ancient character fonts based on GAN network
CN113963232A (en) Network graph data extraction method based on attention learning
Guan et al. Self-supervised character-to-character distillation for text recognition
Cai et al. Leveraging large language models for scalable vector graphics-driven image understanding
CN112508031A (en) Unsupervised remote sensing image semantic segmentation method and model from virtual to reality
Ueno et al. Continuous and Gradual Style Changes of Graphic Designs with Generative Model
CN114943204A (en) Chinese character font synthesis method based on generation countermeasure network
CN111476868B (en) Animation generation model training and animation generation method and device based on deep learning
CN112732259A (en) Front-end interactive page conversion method, device and medium based on artificial intelligence
Dang et al. Scene text segmentation via multi-task cascade transformer with paired data synthesis

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination