A method for generating artistic fonts based on semantic input

Through natural language processing and deep learning models, combined with semantic-visual element mapping knowledge base, the problem of semantic transformation and artistic consideration in semantic-driven art font generation is solved, and efficient and high-quality art font generation is achieved.

CN119444925BActive Publication Date: 2025-04-04GUANGZHOU COLLEGE OF COMMERCE +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510024738.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-04-04
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

It is difficult for the existing technology to accurately transform abstract semantic concepts into concrete visual elements, and in the automatic generation of semantic-driven artistic fonts, how to take into account the harmony of visual elements and the artistic nature of the overall style is a difficult problem.

Method used

Semantic analysis is carried out through natural language processing technology, semantic vector representation is constructed, and relevant visual elements are retrieved in the pre-constructed semantic-visual element mapping knowledge base. Then artistic processing and layout combination are carried out, deep learning models are used to evaluate semantic accuracy and artistic quality, and finally generate artistic fonts that meet the requirements through iterative optimization.

Benefits of technology

It realizes the abstract semantic concept as input to automatically generate concrete artistic fonts that take into account harmony and artistic nature, improving the efficiency and quality of font design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444925B_ABST
    Figure CN119444925B_ABST
Patent Text Reader

Abstract

The present application provides an artistic font generation method based on semantic input, comprising obtaining text data of artistic font generation requirements, performing word segmentation processing on the text by using Jieba word segmentation to obtain a keyword list; performing semantic expansion on each keyword in the keyword list according to a pre-constructed HowNet knowledge base to obtain synonyms, hypernyms and hyponyms of the keyword; performing word frequency statistics and TF-IDF weight calculation on the expanded keyword list to screen out the core semantic concepts of the keyword artistic font generation requirements with the highest weight; calculating the semantic similarity between the core semantic concepts to construct a semantic similarity matrix; using the screened core semantic concepts as nodes and the semantic similarity as the weight of the edge to construct a semantic network map; performing K-means clustering analysis on the semantic concept vectors, aggregating concepts with high semantic similarity into clusters according to the clustering results, and constructing a semantic vector representation model of the artistic font generation requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of information technology, and in particular to a method for generating artistic fonts based on semantic input. Background Art

[0002] In the method of generating artistic fonts based on semantic input, a core technical problem is how to accurately transform abstract semantic concepts into specific visual elements. The semantics required for the generation of artistic fonts are complex and multifaceted. How to extract its core semantics and find the most appropriate visual expression is a major challenge. This requires the construction of a graphic element library containing rich semantic associations. However, the relationship between semantics and elements is often a complex many-to-many relationship network. How to establish an efficient and accurate mapping mechanism in this network is the key. In addition, artistic fonts must take into account the harmony of the combination of visual elements and the artistry of the overall style, which further increases the difficulty of automatic generation. Simple element stacking cannot form a unique artistic style. How to organize elements artistically under semantic drive so that the generated font can accurately convey semantics and have artistic appeal is a technical problem that needs to be overcome urgently. These problems are closely linked, which brings many technical difficulties to the semantic-driven automatic generation technology of artistic fonts, and requires researchers to conduct in-depth exploration and innovation in semantic understanding, element mapping, artistic organization, etc. Summary of the invention

[0003] The present invention provides a method for generating an artistic font based on semantic input, which mainly includes:

[0004] Obtaining inputted artistic font generation requirements, performing semantic analysis on the artistic font generation requirements using natural language processing technology, extracting core semantic concepts and keywords, and constructing an artistic font semantic vector representation;

[0005] According to the semantic vector, searching for the visual element combination with the highest correlation with the semantic vector in a pre-built semantic-visual element mapping knowledge base to obtain a candidate visual representation form;

[0006] Perform artistic processing on candidate visual element combinations, and generate visual elements with both original semantics and unique artistic style through graphic transformation and color adjustment operations;

[0007] Arrange and combine the artistically processed visual elements according to the preset layout rules, adopt the rule-based reasoning method, comprehensively consider the semantic relevance and visual harmony factors between the elements, and generate preliminary artistic fonts with overall consistency and artistic sense;

[0008] Using a deep learning model to evaluate the semantic accuracy and artistry of the preliminary artistic font, if the evaluation score meets the requirements, the artistic font is output as a candidate result;

[0009] All candidate artistic fonts are comprehensively ranked, and the artistic font with the highest comprehensive score is selected as the final generation result, and the final display effect is generated through visualization technology.

[0010] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:

[0011] The present invention discloses a method for generating an artistic font based on semantic input. The method first performs semantic analysis on the input artistic font generation requirements, extracts core concepts and keywords, and constructs a semantic vector. Then, relevant visual elements are retrieved from a preset semantic-visual element mapping library, artistically processed, and visual elements with a unique style are generated. These elements are then arranged and combined according to layout rules to generate a preliminary artistic font. Subsequently, a deep learning model is used to evaluate the semantic accuracy and artistry of the font, and candidate fonts that meet the requirements are generated through iterative optimization. Finally, the candidate fonts are comprehensively sorted, and the optimal result is selected for output. The present invention also provides a user interaction interface to continuously optimize the font generation model based on feedback. The method realizes the automatic generation of a concrete artistic font that takes into account harmony and artistry using an abstract semantic concept as input, thereby improving the efficiency and quality of font design. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 The flowchart of the present invention is the generation of artistic fonts based on semantic input.

[0013] Figure 2 A schematic diagram of the generation of artistic fonts based on semantic input according to the present invention.

[0014] Figure 3 This is another schematic diagram of the generation of artistic fonts based on semantic input according to the present invention. DETAILED DESCRIPTION

[0015] The technical scheme of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0016] like Figure 1-3 In this embodiment, the generation of artistic fonts based on semantic input may specifically include:

[0017] Step S101, obtaining input artistic font generation requirements, using natural language processing technology to perform semantic analysis on the artistic font generation requirements, extracting core semantic concepts and keywords, and constructing an artistic font semantic vector representation.

[0018] The input text data of artistic font generation requirements is obtained, and the text is segmented using Jieba word segmentation to obtain a keyword list of artistic font generation requirements. According to the pre-built HowNet knowledge base, each keyword in the keyword list is semantically expanded to obtain semantically related words such as synonyms, hypernyms and hyponyms of the keywords to enrich the semantic information of the keywords. The word frequency statistics and TF-IDF weight calculation are performed on the expanded keyword list, and several keywords with the highest weights are selected according to the word frequency and weight value as the core semantic concepts of artistic font generation requirements. The semantic similarity between the core semantic concepts is calculated to construct a semantic similarity matrix. The selected core semantic concepts are used as nodes, and the semantic similarity is used as the weight of the edge to construct a semantic network map of artistic font generation requirements to reveal the semantic connection between concepts. The Word2Vec algorithm is used, and the nodes in the semantic network map are used as training samples. The word vector representation of each node is learned through the Skip-gram model, and the word vector of the node is used as the semantic vector representation of the corresponding core semantic concept by averaging or weighted averaging. K-means clustering analysis is performed on the semantic concept vectors. Based on the clustering results, concepts with high semantic similarity are clustered into clusters to form higher-level semantic categories, thus realizing the semantic abstraction of artistic font generation requirements. Based on the clustering results, the center vector of each semantic category is selected as the representative vector of the category, and together with the semantic concept vectors within the category, a semantic vector representation model of artistic font generation requirements is constructed. The semantic similarity between artistic font generation requirements is calculated using the constructed semantic network graph and semantic vector representation model, realizing the clustering, classification, and recommendation of artistic font generation requirements. Key concept retrieval and semantic reasoning are performed in the semantic network graph to explore the semantic associations and evolution laws of artistic font generation requirements.

[0019] Specifically, first, obtain the text data of the artistic font generation requirements input by the user. For example, the user inputs "design a festive Spring Festival poster font". Next, use Jieba word segmentation to segment the text and obtain a keyword list for the artistic font generation requirements. Segmenting "design a festive Spring Festival poster font" can obtain keywords such as "design", "a", "festive", "of", "Spring Festival", "poster", and "font". After word segmentation, semantic expansion is performed on each keyword in the keyword list based on the pre-built HowNet knowledge base. The HowNet knowledge base is a very large semantic knowledge base that contains semantic relationships between words. For example, the synonyms of "festive" can be "joy" and "lively", the hypernym of "Spring Festival" can be "festival", and the hyponym of "font" can be "Kaiti" and "Songti". Through semantic expansion, the semantic information of the keywords is enriched. Then, the expanded keyword list is subjected to word frequency statistics and TF-IDF weight calculation. Word frequency statistics is to calculate the number of times each keyword appears, and TF-IDF weight comprehensively considers word frequency and inverse document frequency, reflecting the importance of a word in the text. Assuming that the words "festive", "Spring Festival" and "poster" have the highest weights, they can be used as the core semantic concepts required for artistic font generation. The reason for this is that words with high weights can better represent the core content of user needs. The next step is to calculate the semantic similarity between the core semantic concepts and construct a semantic similarity matrix. The word vector can be used to calculate the similarity between "festive" and "Spring Festival". For example, the calculated similarity is 0.8. In this way, there is a similarity value between every two concepts, forming a matrix. This matrix reflects the closeness between the concepts. Then, the selected core semantic concepts are used as nodes, and the semantic similarity is used as the weight of the edge to construct the semantic network map required for artistic font generation. In the map, "festive", "Spring Festival" and "poster" are nodes, and the lines between them represent semantic associations, and the numbers on the lines are semantic similarities. Through the semantic network map, the semantic connection between these concepts can be intuitively seen. For example, "festive" and "Spring Festival" are connected by an edge with a weight of 0.8, indicating that they have a strong semantic association. Next, the Word2Vec algorithm is used to learn the word vector representation of each node using the nodes in the semantic network graph as training samples. A word vector is a set of numbers that represent the semantics of a word. Word2Vec can convert concepts such as "festive", "Spring Festival", and "poster" into vectors through training, and obtain the semantic vector representation of each core semantic concept by averaging or weighted averaging. This can convert abstract semantic concepts into numerical forms that can be processed by computers. Then, K-means clustering analysis is performed on the semantic concept vectors.Through clustering, semantically similar concepts can be grouped into one category. For example, "festive" and "lively" may be clustered into one category, representing "festive atmosphere"; "Spring Festival" and "Lantern Festival" may be clustered into another category, representing "traditional festivals". Clustering realizes the semantic abstraction of artistic font generation requirements. The reason for this is that clustering can help discover hidden semantic categories and better understand user needs. After that, according to the clustering results, the central vector of each semantic category is selected as the representative vector of the category. Assuming that the central vector of the "festive atmosphere" class is "joy" and the central vector of the "traditional festival" class is "Spring Festival", then these two vectors represent these two semantic categories respectively. Then, the central vector and the semantic concept vector within the category are combined to construct a semantic vector representation model for artistic font generation requirements. This model contains richer and higher-level semantic information. Next, the constructed semantic network graph and semantic vector representation model are used to calculate the semantic similarity between different artistic font generation requirements. For example, if the user enters "design a lively National Day poster font", the semantic similarity between it and the previous "design a festive Spring Festival poster font" can be calculated. This makes it possible to realize applications such as clustering, classification, and recommendation of artistic font generation requirements. Users' requirements can be classified according to similarity, or similar font designs can be recommended to users. Finally, key concepts are retrieved and semantic reasoning is performed in the semantic network graph to explore the semantic associations and evolution laws of artistic font generation requirements. For example, it was found that over a period of time, the concept of "national tide" frequently appeared in users' artistic font generation requirements, and was closely linked to concepts such as "traditional culture" and "retro". This shows that the demand for font design in the "national tide" style is growing, and the design direction and recommendation strategy can be adjusted accordingly.

[0020] Step S102 : searching, according to the semantic vector, a pre-built semantic-visual element mapping knowledge base for a visual element combination with the highest correlation with the semantic vector to obtain a candidate visual representation form.

[0021] For a given semantic vector, the combination of visual elements with the highest correlation with the semantic vector is retrieved in the pre-built semantic-visual element mapping knowledge base as a candidate visual representation. During the retrieval process, the cosine similarity algorithm is used to calculate the correlation score between the semantic vector and each visual element combination in the knowledge base, and the visual element combination with the highest score is selected according to the sorting of the correlation score. In order to improve the efficiency and accuracy of retrieval, the semantic-visual element mapping knowledge base is pre-constructed and optimized by inverted index. When matching and calculating the correlation score, multiple attribute dimensions of the semantic vector and the visual element are comprehensively considered, including semantic similarity, consistency of emotional tendency, scene fit, etc., and the comprehensive correlation score is obtained by weighted summation. In order to enrich the visual representation, it supports the dynamic generation of visual element combinations according to the semantic vector, and adopts the image synthesis technology based on the generative adversarial network (GAN) to generate novel visual presentations with high matching degree with the semantic vector using the visual elements in the knowledge base as materials. In the case where the semantic vector has a low match with the existing visual element combinations in the knowledge base, new visual elements related to the semantic vector are obtained from the Internet through crawler technology, and the semantic-visual mapping relationship is updated through manual annotation to continuously expand and optimize the knowledge base. According to the relevance ranking of candidate visual representations, combined with business scenario requirements and user personalized preferences, the top 1-3 visual element combinations are adaptively selected as the final visual presentation solution through rule engine and user portrait analysis.

[0022] Specifically, for a given semantic vector of an artistic font, a search is performed in a pre-built semantic-visual element mapping knowledge base to obtain the visual element combination with the highest correlation with the semantic vector as a candidate visual representation. Assume that there is a semantic vector representing "Festive Spring Festival Poster Font", which contains core semantic concepts such as "festive", "Spring Festival", "poster", and "font". During the retrieval process, the cosine similarity algorithm is used to calculate the correlation score between the semantic vector and each visual element combination in the knowledge base. Cosine similarity measures the similarity between two vectors by calculating the cosine value of the angle between them. For example, there is a visual element combination A in the knowledge base, which contains elements such as a red background, a golden font, and a lantern pattern, and its corresponding semantic vector is [0.8, 0.7, 0.6, 0.9]. By calculating the cosine similarity between the "Festive Spring Festival Poster Font" vector and A, a correlation score of 0.85 is obtained. According to the correlation score sorting, the visual element combination with the highest score is selected. Assuming that in the knowledge base, combination A has the highest score, it will be selected as a candidate visual representation. In order to improve the efficiency and accuracy of retrieval, the semantic-visual element mapping knowledge base is pre-built and optimized by inverted index. The inverted index is similar to the index mechanism in the search engine, which can quickly locate the visual element combination containing a specific semantic concept. When matching and calculating the relevance score, multiple attribute dimensions of the semantic vector and the visual element are comprehensively considered, including semantic similarity, emotional tendency consistency, scene fit, etc. For example, semantic similarity can be measured by the distance between word vectors, emotional tendency consistency can be judged by sentiment analysis tools, and scene fit can be evaluated by scene classification models. Assuming that the semantic similarity score of the "Festive Spring Festival Poster Font" vector and combination A is 0.8, the emotional tendency consistency score is 0.9, and the scene fit score is 0.7, the comprehensive relevance score of 0.85 is obtained by weighted summation. In order to enrich the visual expression, it supports the dynamic generation of visual element combinations according to the semantic vector, and adopts the image synthesis technology based on the generative adversarial network (GAN). GAN consists of two parts: the generator and the discriminator. The generator is responsible for generating images, and the discriminator is responsible for judging the authenticity of the image. Assume that a new poster image is generated through GAN using visual elements such as red background, golden font, and lantern pattern in the knowledge base. This image is highly matched with the semantic vector of "Festive Spring Festival Poster Font" in terms of visuality. In the case where the semantic vector has a low matching degree with the existing visual element combination in the knowledge base, new visual elements related to the semantic vector are obtained from the Internet through crawler technology. For example, crawl the Spring Festival poster designs on major design websites, extract the visual elements therein, such as new color matching, pattern design, etc., and use manual annotation to update the semantic-visual mapping relationship, and continuously expand and optimize the knowledge base.According to the relevance ranking of candidate visual representations, combined with business scenario requirements and user personalized preferences, the top 1-3 visual element combinations are adaptively selected as the final visual presentation solution through rule engine and user portrait analysis. Assuming that the business scenario is an e-commerce platform promotion, and the user portrait shows that the target user prefers bright colors and traditional elements, then the highest-ranked combination A (red background, gold font, lantern pattern) will be selected. Through the above steps, not only the automatic conversion from semantic vectors to visual representations is achieved, but also the richness and personalization of visual presentation are improved through multi-dimensional attribute matching and dynamic generation technology, ultimately achieving the purpose of improving user experience and meeting business needs.

[0023] Step S103, artistically processing the candidate visual element combination, through graphic transformation and color adjustment operations, to generate a visual element with both original semantics and unique artistic style.

[0024] Obtain candidate visual element combinations, and select visual element combinations that meet the style characteristics according to preset artistic style parameters. For each selected visual element combination, determine the corresponding graphic transformation method and color adjustment parameters. For each visual element, use the determined graphic transformation method to process and obtain the transformed visual element. Common graphic transformation methods include translation, rotation, scaling, shearing, etc., and one or more transformation methods can be selected and superimposed according to the needs of the artistic style. For each transformed visual element, use the determined color adjustment parameters to process and obtain the color-adjusted visual element. The color adjustment parameters include brightness, contrast, saturation, etc., and the color style of the visual element can be changed by adjusting these parameters. Combine all the color-adjusted visual elements, and generate an artistically processed visual element combination through an image synthesis algorithm such as Poisson fusion. Use the pre-trained VGG network to extract the features of the artistically processed visual element combination, compare it with the features of the preset artistic style image, and calculate the feature similarity. If the similarity is higher than the preset threshold, it is considered that the visual element combination has the preset artistic style features and is output as a candidate result. For the candidate results, use a semantic segmentation model such as FCN to perform semantic analysis on them. Compare the segmentation result with the semantic segmentation result of the original visual element, and calculate the degree of semantic information retention. If the degree of retention is higher than the preset threshold, the candidate result is considered to have retained the original semantic information. From all candidate results that have both artistic style and semantic information, select the visual element combination with the highest degree of semantic information retention and the most obvious style characteristics as the final artistic processing result. Based on the final artistic visual element combination, use an image stylization transfer model such as CycleGAN to merge the content features of the original visual elements with the style features of the artistic visual element combination, generate a new visual element with both the original semantic content and artistic style, and output the final result.

[0025] Specifically, assume that the preset art style is "modern simplicity", which emphasizes simple lines and bright colors. First, from the visual element combinations retrieved from the knowledge base, select those with simple geometric shapes and bright colors. For example, combination B contains a white background, black sans serif fonts, and abstract geometric patterns, and its style characteristics are highly consistent with "modern simplicity". For each selected visual element combination, determine the corresponding graphic transformation method and color adjustment parameters. Taking combination B as an example, in order to enhance its modern sense, the graphic transformation method of translation and rotation can be used. Suppose that the font is translated 5 pixels to the right and rotated 15 degrees to make it more dynamic. In terms of color adjustment parameters, the background brightness can be increased by 20%, the contrast can be increased by 10%, and the font saturation can be reduced by 15% to highlight the simple and bright visual effect. Next, for each visual element, a determined graphic transformation method is used for processing. Taking the black sans serif font as an example, through translation and rotation operations, the font visually presents a dynamic sense of advancement, which enhances the overall modern atmosphere. For abstract geometric patterns, scaling and shearing transformations can be used to make them more three-dimensional and layered. The transformed visual elements also need to be color adjusted. Assume that the original brightness value of the background is 80, which is increased to 96 after adjustment; the contrast is increased from 50 to 60; and the saturation of the font is reduced from 90 to 75. These adjustments make the overall visual effect more harmonious and meet the requirements of the "modern simplicity" style. Combine all the color-adjusted visual elements and generate an artistically processed combination of visual elements through image synthesis algorithms such as Poisson fusion. Poisson fusion can smoothly blend the edges of different elements to make the overall image look more natural. For example, the translated and rotated fonts are fused with the background with adjusted brightness and contrast, and the generated image is visually seamless and has a strong sense of integrity. The pre-trained VGG network is used to extract the features of the artistically processed combination of visual elements, compare them with the features of the preset artistic style image, and calculate the feature similarity. Assume that the feature vectors extracted by the VGG network are [0.7, 0.8, 0.6] and [0.75, 0.82, 0.65] respectively. The cosine similarity calculation results in a similarity of 0.95, which is higher than the preset threshold of 0.9, indicating that the visual element combination has the preset artistic style characteristics. For the candidate results, a semantic segmentation model such as FCN is used to perform semantic analysis. Assume that the semantic segmentation results of the original visual elements show that the font area accounts for 30% and the background accounts for 70%; the segmentation results after artistic processing are that the font area accounts for 28% and the background accounts for 72%. By calculating the degree of semantic information retention, the retention degree is 95%, which is higher than the preset threshold of 90%, indicating that the candidate result retains the original semantic information. From all the candidate results with both artistic style and semantic information, select the visual element combination with the highest degree of semantic information retention and the most obvious style characteristics as the final artistic processing result.Assume that among multiple candidate results, combination B not only has the highest score in style features, but also has the highest semantic information retention, so it is selected as the final result. According to the final combination of artistic visual elements, an image stylization transfer model such as CycleGAN is used to merge the content features of the original visual elements with the style features of the combination of artistic visual elements. CycleGAN can transfer style features to the original image while keeping the content features unchanged through a bidirectional generative adversarial network. For example, the original Spring Festival poster font content is merged with the "modern simplicity" style, and the generated new visual elements not only retain the festive atmosphere of the Spring Festival, but also have the aesthetic characteristics of modern simplicity. Through the above steps, not only the precise matching of artistic styles is achieved, but also the effective retention of semantic information is ensured, and the final generated visual elements achieve a high degree of unity in style and content. This processing method not only enhances the aesthetic value of visual elements, but also enhances their applicability in specific application scenarios, such as in modern home design, fashion advertising and other fields, which can better attract the attention of target users and improve the overall visual effect and user experience.

[0026] Step S104, arranging and combining the artistically processed visual elements according to preset layout rules, using a rule-based reasoning method, comprehensively considering the semantic relevance and visual harmony factors between the elements, and generating a preliminary artistic font with overall consistency and artistic sense.

[0027] Obtain a set of visual elements that have been artistically processed, analyze the visual elements, and extract the key features of the elements, such as shape, texture, color, etc. According to the semantic attributes of the elements, a semantic association map is constructed, and the semantic relevance between the elements is calculated through the connection relationship of the element nodes in the map. Elements whose semantic relevance exceeds the preset threshold are classified into the same combination. For each combination, according to the preset layout rules, a rule-based reasoning method is used, and the decision tree algorithm is used to extract key features from the combined visual elements. Elements with similar features are classified into one category through the K-means clustering algorithm to obtain several visually harmonious element subsets. For each element subset, according to the layout rules, a genetic algorithm is used to arrange and combine the elements under the condition of satisfying the overall consistency constraint, and several candidate font layout schemes are obtained. According to the preset aesthetic evaluation rules, the support vector machine algorithm is used to score the candidate font layout schemes, and the visual harmony, artistic sense and other factors of the layout are comprehensively considered to select the scheme with the highest score as the preliminary artistic font. The preliminary artistic fonts are converted into vector path format, the outline of the font is smoothed, and a deformable font model is generated through the Bezier curve fitting algorithm to further enhance the artistic expression of the font. For the generated artistic fonts, the VGG-19 model based on the convolutional neural network is used to extract style features from a large number of artworks, and the similarity of style features is calculated through the Gram matrix. The texture and color of the font are artistically rendered to obtain the final artistic font.

[0028] Specifically, to obtain a set of visual elements that have been artistically processed, each element must first be analyzed in detail. For example, suppose there is a set of visual elements that includes a circular pattern, a wavy texture, and a gradient color. The key features of the circular pattern include its geometric shape and boundary smoothness; the features of the wavy texture involve the periodicity and fluctuation amplitude of the texture; and the features of the gradient color include the range of color changes and the smoothness of the transition. According to the semantic attributes of the elements, a semantic association map is constructed. Assume that the circular pattern semantically represents "perfection", the wavy texture represents "dynamics", and the gradient color represents "change". The semantic relevance between the elements is calculated through the node connection relationship in the map. For example, the circular pattern and the gradient color both have the attribute of "continuity" semantically, so their semantic relevance is high. The threshold is set to 0.7, and the elements with a relevance exceeding this threshold are classified as the same combination. For each combination, a rule-based reasoning method is used according to the preset layout rules. Assume that the layout rules require the elements to be visually balanced and symmetrical. Using the decision tree algorithm, key features such as the diameter of the circular pattern and the frequency of the wavy texture are extracted from the combined visual elements. Elements with similar characteristics are grouped into one category using the K-means clustering algorithm. For example, circular patterns with similar diameters and wave textures with similar frequencies are grouped into the same category, resulting in several visually harmonious element subsets. For each element subset, a genetic algorithm is used to perform permutations and combinations according to the layout rules. Assume that the overall consistency constraint requires that the spacing between elements does not exceed 10 pixels and that the color transition needs to be smooth. The genetic algorithm optimizes the permutations and combinations of elements through continuous iterations to obtain several candidate font layout schemes. For example, in one scheme, the circular pattern is centered, the wave texture surrounds it, and the gradient color diffuses from the center to the surroundings. According to the preset aesthetic evaluation rules, the support vector machine algorithm is used to score the candidate font layout schemes. Assume that the aesthetic evaluation rules include visual balance, color harmony, and artistic sense. The support vector machine algorithm learns from the training set, scores each indicator of each scheme, and selects the scheme with the highest score as the preliminary art font after comprehensive consideration. For example, a scheme is selected as the preliminary art font because it has a high score in visual balance and color harmony. The preliminary art font is converted into a vector path format, and the font appearance contour is smoothed. Through the Bezier curve fitting algorithm, a deformable font model is generated. For example, the border of the circular pattern becomes smoother after the Bezier curve fitting, which improves the artistic expression of the font. For the generated artistic font, the VGG-19 model based on the convolutional neural network is used to extract style features from a large number of artworks. Assuming that the "Post-Impressionism" style features are extracted from Van Gogh's works, the similarity of the style features is calculated through the Gram matrix. The texture and color of the font are artistically rendered. For example, the lines of the wavy texture are adjusted to the rough style commonly seen in Van Gogh's works, and the gradient colors are integrated with the bright tones unique to Van Gogh.Through the above steps, the final generated artistic font is not only visually harmonious and unified, but also has a unique artistic style. Constructing a semantic association map helps to understand the intrinsic connection between elements. The rule-based reasoning method and genetic algorithm ensure the rationality and aesthetics of the layout, and the scoring mechanism of the support vector machine algorithm ensures the high quality of the final solution. The application of Bezier curve fitting and VGG-19 model further enhances the artistic expression and unique style of the font. This processing method not only enhances the visual effect, but also meets the needs of specific business scenarios. For example, in brand promotion, the use of artistic fonts with a "post-impressionist" style can attract the attention of target users and enhance the brand image.

[0029] Step S105 uses a deep learning model to evaluate the semantic accuracy and artistry of the preliminary artistic font. If the evaluation score meets the requirements, the artistic font is output as a candidate result.

[0030] Obtain a large number of artistic font samples of different styles and construct an artistic font dataset. Using the samples in the dataset, through preprocessing operations such as data enhancement and annotation, establish a training set and a test set containing font images and corresponding labels. Select convolutional neural network (CNN) as the basic architecture of the deep learning model, and design and train a multi-task CNN model for the artistic font evaluation task. The input of the model is the artistic font image, and the output is two indicators: semantic accuracy score and artistic score. During the training process, by adjusting the model structure and hyperparameters, the performance of the model on the training set and test set is continuously improved until the expected evaluation performance is achieved. Use the pre-trained CNN model to evaluate the newly generated artistic font samples. Input the artistic font image to be evaluated into the model to obtain its semantic accuracy score and artistic score. Determine whether the semantic accuracy score of the current font is higher than the preset semantic accuracy threshold, and whether the artistic score is higher than the preset artistic threshold. If both indicators meet the requirements, the font is output as a candidate result; otherwise, enter the next step of optimization. For artistic fonts that do not meet the evaluation standards, analyze their shortcomings in semantic accuracy and artistry. According to the feedback information of the CNN model, the visual elements of the font, such as strokes, structure, and texture, are optimized and adjusted in a targeted manner. The visual effect of the font can be optimized by changing the font generation algorithm or parameters, such as stroke thickness, spacing, curvature, etc. The optimized and adjusted artistic font is re-input into the CNN model for evaluation to obtain its semantic accuracy score and artistic score. The iterative process of evaluation and optimization is repeated until the evaluation index of the font meets the preset threshold requirements or reaches the preset maximum number of iterations. In the process of iterative optimization, the best result of each round of evaluation is recorded as the current best candidate font. When the iterative process is completed, the best candidate font is used as the output result of generating the artistic font. Through the above steps, the deep learning model is used to evaluate and optimize the artistic font, and the semantic accuracy and artistry of the font are continuously iterated to improve, and finally a high-quality artistic font that meets the requirements is generated.

[0031] Specifically, a large number of artistic font samples of different styles are obtained to construct an artistic font dataset. For example, samples including Songti, Kaiti, Heiti and various handwritten fonts are collected from major artistic font libraries and design platforms to ensure that the samples cover a variety of styles such as classical, modern, simple, and complex. The number and diversity of samples are expanded through data enhancement techniques such as rotation, scaling, and color transformation. Each sample is labeled, and the annotation content includes the style category, stroke characteristics, structural characteristics, etc. of the font to form detailed label information. Using the samples in the dataset, through preprocessing operations such as data enhancement and labeling, a training set and a test set containing font images and corresponding labels are established. For example, the collected artistic font samples are divided into training sets and test sets in a ratio of 8:2 to ensure that the samples of each style category are evenly distributed in the two sets. Data enhancement operations can include rotating the font image by ±15 degrees, scaling to a range of 80%-120%, and performing grayscale transformation to enhance the generalization ability of the model. Convolutional neural network (CNN) is selected as the basic architecture of the deep learning model, and a multi-task CNN model is designed and trained for the artistic font evaluation task. The input of the model is an artistic font image, and the output is two indicators: semantic accuracy score and artistic score. For example, a CNN model containing multiple convolutional layers, pooling layers and fully connected layers is designed, where the convolutional layer is used to extract local features of the font image, the pooling layer is used to reduce the feature dimension, and the fully connected layer is used to integrate features and perform classification and scoring. Multi-task learning can be achieved by setting two different output layers at the top layer of the model, which are used for the evaluation of semantic accuracy and artistic quality respectively. During the training process, the performance of the model on the training set and test set is continuously improved by adjusting the model structure and hyperparameters until the expected evaluation performance is achieved. For example, the model structure can be optimized by increasing the number of convolutional layers, adjusting the size of the convolution kernel, using different activation functions, etc. The adjustment of hyperparameters can include learning rate, batch size, regularization parameters, etc., and the optimal hyperparameter combination can be selected by cross-validation and other methods. Use the pre-trained CNN model to evaluate the newly generated artistic font samples. Input the artistic font image to be evaluated into the model to obtain its semantic accuracy score and artistic quality score. For example, suppose a newly generated artistic font sample gets a semantic accuracy score of 0.85 and an artistry score of 0.78 in the model evaluation. The preset semantic accuracy threshold is 0.80 and the artistry threshold is 0.75, so the font meets the evaluation criteria and can be output as a candidate result. For artistic fonts that do not meet the evaluation criteria, analyze their deficiencies in semantic accuracy and artistry. For example, the semantic accuracy score of a font sample is 0.72 and the artistry score is 0.68, which does not meet the preset threshold. By analyzing the feature map output by the model, it is found that the strokes of the font are uneven, the structure is loose, and the texture is not delicate enough.According to the feedback information of the CNN model, the visual elements of the font, such as strokes, structure, and texture, are optimized and adjusted in a targeted manner. The visual effect of the font can be optimized by changing the font generation algorithm or parameters, such as adjusting the stroke thickness, spacing, curvature, etc. The optimized and adjusted artistic font is re-input into the CNN model for evaluation to obtain its semantic accuracy score and artistic score. For example, after optimization and adjustment, the semantic accuracy score of the font sample is increased to 0.82, and the artistic score is increased to 0.76, which meets the preset threshold requirements. Repeat the iterative process of evaluation and optimization until the evaluation index of the font meets the preset threshold requirements or reaches the preset maximum number of iterations. In the process of iterative optimization, the best result of each round of evaluation is recorded as the current best candidate font. For example, after 5 rounds of iterative optimization, the semantic accuracy score of a font sample is stable at above 0.85, and the artistic score is stable at above 0.80, and the sample is used as the best candidate font. When the iterative process is completed, the best candidate font finally obtained is used as the output result of generating the artistic font. Through the above steps, the deep learning model is used to evaluate and optimize the artistic fonts, and the semantic accuracy and artistry of the fonts are continuously iterated to improve, and finally generate high-quality artistic fonts that meet the requirements. For example, the generated artistic fonts are not only highly aesthetic and artistic in visual terms, but also can accurately convey their semantic information. They are suitable for a variety of application scenarios such as book cover design and advertising, which improves the richness and personalization of visual presentation and meets the needs of specific business scenarios. The purpose of building an artistic font dataset is to provide rich training samples to ensure that the model can learn the characteristics of fonts of different styles. Data enhancement and annotation operations are to enhance the generalization ability and accuracy of the model. CNN is selected as the basic architecture because it has significant advantages in image feature extraction. The design of multi-task learning enables the model to simultaneously evaluate the semantic accuracy and artistry of the font, which improves the comprehensiveness of the evaluation. By adjusting the model structure and hyperparameters, the performance of the model can be continuously optimized to ensure that it performs well on both the training set and the test set. Using the pre-trained model for evaluation, font samples that meet the standards can be quickly screened out. The optimization and adjustment of samples that do not meet the standards is a targeted improvement based on model feedback, which improves the visual effect of the font. The iterative optimization process ensures that the final font meets high standards in both semantic accuracy and artistic quality, meeting the needs of practical applications.

[0032] Step S106, comprehensively sorting all candidate artistic fonts, selecting the artistic font with the highest comprehensive score as the final generation result, and generating the final display effect through visualization technology.

[0033] According to the preset rules, multiple candidate art font samples and their feature parameters are obtained. The support vector machine algorithm is used to comprehensively score the multi-dimensional feature parameters of the candidate font samples to obtain the comprehensive score of each font. The candidate fonts are sorted from high to low according to the comprehensive score, and the font with the highest score is selected as the final generated font. The final selected art font is rendered by graphics rendering technology such as OpenGL to generate display effect pictures of various styles. A user interaction interface is constructed using graphical user interface development tools such as Qt, providing a variety of display effect pictures for users to choose from, and collecting user preference feedback on different font effects. According to user feedback data, the gradient descent method is used to dynamically adjust the feature weights of the font scoring model, and the font scoring algorithm is continuously optimized by minimizing the difference between the user feedback results and the model prediction results. The optimized font scoring model is applied to the candidate font samples newly obtained from the online font library to generate an art font display effect that is more in line with the user's aesthetic preferences.

[0034] Specifically, multiple candidate art font samples and their feature parameters are obtained according to preset rules. The preset rules may include the style, stroke features, structural features, etc. of the font. For example, assuming that an art font suitable for modern advertising design needs to be generated, the preset rules may require the font to have simple strokes, high recognition and modern feel. Through these rules, several candidate font samples are screened from the existing art font library, and their feature parameters, such as stroke thickness, glyph structure, center of gravity position, etc., are extracted. The support vector machine (SVM) algorithm is used to comprehensively score the multidimensional feature parameters of the candidate font samples. Assuming that there are five candidate font samples, each sample has five feature parameters (such as stroke thickness, glyph structure, center of gravity position, curvature, and texture density), the SVM algorithm will calculate the comprehensive score of each sample based on these feature parameters. For example, the feature parameters of sample A are (0.8, 0.7, 0.9, 0.6, 0.8), and the comprehensive score calculated by the SVM model is 0.85. The candidate fonts are sorted from high to low according to the comprehensive score, and the font with the highest score is selected as the final generated font. Assume that after SVM scoring, the scores of the five candidate fonts are 0.85, 0.78, 0.82, 0.75, and 0.80 respectively, then the sample A (0.85) with the highest score will be selected as the final generated art font. The final selected art font is rendered by graphics rendering technology such as OpenGL to generate display effect pictures of various styles. OpenGL is a widely used graphics rendering library that can achieve high-quality 3D rendering effects. For example, OpenGL can be used to render the selected art font with different materials, lighting, and shadow effects to generate display pictures of various styles such as metal texture, glass texture, and ink effect. Assuming that the final generated art font is "modern minimalist style", OpenGL can be used to render a "modern minimalist metal font" with metal texture and a "modern minimalist glass font" with glass texture. Use graphical user interface development tools such as Qt to build a user interaction interface, provide a variety of display effect pictures for users to choose, and collect user preference feedback on different font effects. Qt is a cross-platform C++ graphical user interface library that can quickly build beautiful and feature-rich user interfaces. For example, a font selection interface can be designed to display artistic fonts with a variety of rendering effects. Users can click to select their favorite font effect and submit feedback. Suppose the user prefers the "modern minimalist metal font" with a metal texture in the selection interface, this preference data will be recorded. Based on the user feedback data, the gradient descent method is used to dynamically adjust the feature weights of the font scoring model. The gradient descent method is a commonly used optimization algorithm that minimizes the loss function by continuously adjusting the model parameters. Assuming that user feedback shows that metal-textured fonts are more popular, the gradient descent method can be used to adjust the feature weights related to metal texture in the SVM model so that it occupies a higher proportion in the comprehensive score.For example, the original weight of the metal texture feature is 0.2. After adjustment by the gradient descent method, the weight is increased to 0.3, so that the model is more inclined to select fonts with metal texture. The optimized font scoring model is applied to the candidate font samples newly obtained from the online font library to generate an artistic font display effect that is more in line with the user's aesthetic preferences. Assume that five new candidate font samples are obtained from the online font library, and these samples are scored using the optimized SVM model, and the font that best meets the user's preferences is selected based on the scoring results. For example, the new sample B obtains a high score of 0.88 in the optimized model, which exceeds the previous sample A (0.85), then sample B will be selected as the new final generated font. Through this series of steps, not only can artistic fonts that meet the preset rules be generated, but the font scoring model can also be continuously optimized based on user feedback, so that the generated fonts are more in line with the user's aesthetic preferences. The formulation of the preset rules ensures the basic style and quality of the font, the comprehensive scoring of the SVM algorithm provides a scientific evaluation basis, the rendering technology of OpenGL improves the visual effect of the font, the user interface of Qt achieves good user interaction, and the dynamic adjustment of the gradient descent method enables the model to continuously adapt to user needs. Each link supports each other and together constitutes an efficient artistic font generation and optimization system.

[0035] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for generating an artistic font based on semantic input, comprising: Obtaining inputted artistic font generation requirements, performing semantic analysis on the artistic font generation requirements using natural language processing technology, extracting core semantic concepts and keywords, and constructing an artistic font semantic vector representation; It also includes: obtaining input text data of artistic font generation requirements, using Jieba word segmentation to segment the text, and obtaining a keyword list of artistic font generation requirements; according to the pre-built HowNet knowledge base, semantically expanding each keyword in the keyword list to obtain synonyms, hypernyms and hyponyms of the keywords; performing word frequency statistics and TF-IDF weight calculation on the expanded keyword list, screening out the keywords with the highest weight as the core semantic concepts of artistic font generation requirements; calculating the semantic similarity between the core semantic concepts and constructing a semantic similarity matrix; using the screened core semantic concepts as nodes and the semantic similarity as the weight of the edge to construct a semantic network map of artistic font generation requirements; using the Word2Vec algorithm, using the nodes in the semantic network map as training samples, learning the word vector representation of each node through the Skip-gram model, and using the word vector of the node as the semantic vector representation of the corresponding core semantic concept; performing K-means clustering analysis on the semantic concept vectors, clustering concepts with high semantic similarity into clusters according to the clustering results, and constructing a semantic vector representation model of artistic font generation requirements; According to the semantic vector, searching for the visual element combination with the highest correlation with the semantic vector in a pre-built semantic-visual element mapping knowledge base to obtain a candidate visual element combination; Performing artistic processing on the candidate visual element combination, and generating visual elements with both original semantics and unique artistic style through graphic transformation and color adjustment operations; which also includes: obtaining a candidate visual element combination, and screening out a visual element combination that meets the style characteristics according to preset artistic style parameters; determining the corresponding graphic transformation method and color adjustment parameters for each screened visual element combination; processing each visual element using a determined graphic transformation method to obtain a transformed visual element; processing each transformed visual element using a determined color adjustment parameter to obtain a color-adjusted visual element; combining all color-adjusted visual elements, and generating an artistically processed visual element combination using an image synthesis algorithm; extracting features of the artistically processed visual element combination using a pre-trained VGG network, comparing it with features of a preset artistic style image, and calculating feature similarity; performing semantic analysis on the candidate results using a semantic segmentation model, and calculating the degree of semantic information retention; selecting a visual element combination with the highest degree of semantic information retention and the most obvious style features from all candidate results with both artistic style and semantic information; Arranging and combining the artistically processed visual elements according to preset layout rules, using a rule-based reasoning method, comprehensively considering the semantic relevance and visual harmony factors between the elements, and generating a preliminary artistic font with overall consistency and artistic sense; Using a deep learning model to evaluate the semantic accuracy and artistry of the preliminary artistic font, if the evaluation score meets the requirements, the artistic font is output as a candidate result; All candidate artistic fonts are comprehensively ranked, and the artistic font with the highest comprehensive score is selected as the final generation result, and the final display effect is generated through visualization technology.

2. The method according to claim 1, characterized in that The step of retrieving, according to the semantic vector, a visual element combination with the highest correlation with the semantic vector in a pre-built semantic-visual element mapping knowledge base to obtain a candidate visual element combination includes: For a given semantic vector, search the pre-built semantic-visual element mapping knowledge base, use the cosine similarity algorithm to calculate the correlation score between the semantic vector and each visual element combination in the knowledge base, sort them according to the correlation score, and select the visual element combination with the highest score; The semantic similarity, emotional consistency, and scene fit between the semantic vector and the visual element are comprehensively considered to obtain a comprehensive relevance score. Adopting the image synthesis technology based on the generative adversarial network (GAN) to generate novel visual presentations with high matching degree with the semantic vector; If the semantic vector matches the existing visual element combination in the knowledge base poorly, new visual elements related to the semantic vector are obtained from the Internet, and the semantic-visual mapping relationship is updated by manual annotation; The candidate visual element combinations are sorted by their relevance, combined with business scenario requirements and user personalized preferences, and the highest-ranked visual element combination is adaptively selected.

3. The method according to claim 1, characterized in that The process of arranging and combining the artistically processed visual elements according to preset layout rules, adopting a rule-based reasoning method, and comprehensively considering the semantic relevance and visual harmony factors between the elements to generate a preliminary artistic font with overall consistency and artistic sense includes: Obtaining a set of artistically processed visual elements and extracting key features of the elements, wherein the key features include shape, texture, and color; According to the semantic attributes of the elements, a semantic association graph is constructed to calculate the semantic relevance between the elements; Grouping elements whose semantic relevance exceeds a preset threshold into the same group; According to the preset layout rules, the decision tree algorithm is used to extract key features from the combined visual elements, and the elements with similar features are grouped into one category through the K-means clustering algorithm to obtain several visually harmonious element subsets; According to the layout rules, a genetic algorithm is used to arrange and combine the elements under the condition of satisfying the overall consistency constraint, and several candidate font layout schemes are obtained; According to the preset aesthetic evaluation rules, the support vector machine algorithm is used to score the candidate font layout schemes, and the scheme with the highest score is selected as the preliminary artistic font; The preliminary artistic font is converted into a vector path format, the outline of the font appearance is smoothed, and a deformable font model is generated.

4. The method according to claim 1, characterized in that The using of the deep learning model to evaluate the semantic accuracy and artistry of the preliminary artistic font, and if the evaluation score meets the requirements, outputting the artistic font as a candidate result, includes: Obtain a large number of artistic font samples of different styles and build an artistic font dataset; Using the samples in the dataset, we build a training set and a test set containing font images and corresponding labels. Select convolutional neural network (CNN) as the basic architecture of the deep learning model, design and train a multi-task CNN model; Input the artistic font image to be evaluated into the model to obtain its semantic accuracy score and artistic score; Determine whether the semantic accuracy score of the current font is higher than a preset semantic accuracy threshold, and whether the artistic score is higher than a preset artistic threshold; If both indicators meet the requirements, the font is output as a candidate result; If the evaluation criteria are not met, the visual elements of the font are optimized and adjusted in a targeted manner according to the feedback information of the CNN model, and the visual elements include the strokes, structure, and texture of the font; The optimized and adjusted artistic fonts are re-input into the CNN model for evaluation until the evaluation indicators of the fonts meet the preset threshold requirements.

5. The method according to claim 1, characterized in that The method of comprehensively ranking all candidate art fonts, selecting the art font with the highest comprehensive score as the final generation result, and generating the final display effect through visualization technology includes: Acquire multiple candidate artistic font samples and their characteristic parameters according to preset rules; The support vector machine algorithm is used to comprehensively score the multi-dimensional feature parameters of candidate font samples; Sort candidate fonts from high to low according to their comprehensive scores, and select the font with the highest score as the final generated font; The final selected artistic fonts are rendered through OpenGL graphics rendering technology to generate display effect images of various styles; Use Qt graphical user interface development tools to build a user interaction interface, provide a variety of display effect pictures for users to choose from, and collect user feedback on different font effects; Based on user feedback data, the feature weights of the font scoring model are dynamically adjusted using the gradient descent method; The optimized font scoring model is applied to candidate font samples newly acquired from the online font library to generate artistic font display effects that are more in line with user aesthetic preferences.

Citation Information

Patent Citations

  • Artificial intelligence-based aided design drawing method and system

    CN111125403A

  • Semantic image synthesis for generating substantially photorealistic images using neural networks

    CN111489412A