A method, system, medium and program product for recognizing Chinese and English mass fonts

By collecting multi-source font samples to generate realistic samples and performing image enhancement, a depthwise separable convolutional network and a scene-scale continuum are constructed. This solves the problem of insufficient support for multiple fonts in existing font recognition systems, and achieves high-accuracy recognition of massive fonts and cross-scene adaptability.

CN120853189BActive Publication Date: 2026-02-10XIAMEN XIANGLIAN TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510851560.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2026-02-10
Estimated Expiration
2045-06-24

AI Technical Summary

Technical Problem

Existing font recognition systems lack support for a variety of fonts, especially emerging creative fonts, which have low recognition accuracy and are difficult to meet the needs of practical applications. In particular, the recognition effect is poor when dealing with blurry or edge-marked fonts.

Method used

By collecting multi-source font samples for text image synthesis, realistic font samples are generated and image enhancement processing is performed. A depthwise separable convolutional feature extraction network is constructed, and the discriminative scores of multi-scale feature maps are combined for weighted fusion to establish a scene scale continuum to characterize the gradual change of font features with scene changes.

Benefits of technology

It improves the recognition accuracy of massive fonts, enhances the model's adaptability to complex scenes, and ensures the stability and accuracy of recognition results in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120853189B_ABST
    Figure CN120853189B_ABST
Patent Text Reader

Abstract

An English-Chinese massive font recognition method, system, medium and program product, in the method, a realistic font sample is generated; the realistic font sample is subjected to image enhancement processing to obtain a training font sample; the training font sample is labeled and divided into a training data set according to a preset proportion; a feature extraction network is constructed by using a deep separable convolution; the feature extraction network is trained by using the training data set; a font image to be recognized is input into the feature extraction network to obtain a plurality of scale feature maps; a discriminative score of the plurality of scale feature maps is calculated, the plurality of scale feature maps are weighted and fused according to the discriminative score, and a fused feature map is obtained; font classification is performed based on the fused feature map, and font category information and a similarity value corresponding to the font image to be recognized are obtained. The present application extracts multi-scale features by using a deep separable convolution and performs feature fusion based on a discriminative score, thereby improving the recognition accuracy of massive fonts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of font recognition, and in particular relates to a method, system, medium and program product for recognizing massive amounts of Chinese and English fonts. Background Technology

[0002] With the development of digital media and the design industry, font recognition technology plays an important role in creative design, copyright protection, and other fields. A single language contains a wide variety of fonts with significant differences. Existing font recognition systems, regardless of whether they support Chinese or English, support too few fonts, lack a rich and diverse range of fonts, only support traditional calligraphic fonts, cannot accurately recognize a large number of fonts, and cannot keep up with the real-time innovation of original designers. Furthermore, their recognition of emerging creative fonts is lagging and has low accuracy.

[0003] In related technologies, text image synthesis techniques can be used to expand the training samples, and ResNet50 deep neural networks can be combined for font feature extraction and classification. This method increases the size of the training set by synthesizing sample data and utilizes the deep convolutional structure of ResNet50 to learn the feature representation of fonts, thereby improving the performance of font recognition to a certain extent.

[0004] However, due to the large computational cost of standard convolutional structures and the difficulty in focusing on local details, the recognition performance is poor in complex scenarios such as different fonts with similar glyphs and artistic creative fonts. In particular, the recognition accuracy is low when dealing with blurry or edge fonts, which makes it difficult to meet the needs of practical applications. Summary of the Invention

[0005] This application provides a method, system, medium, and program product for recognizing massive amounts of Chinese and English fonts. It improves the recognition accuracy of massive amounts of fonts by extracting multi-scale features through depthwise separable convolution and performing feature fusion based on discriminative scores.

[0006] Firstly, this application provides a method for recognizing massive amounts of Chinese and English fonts by collecting multi-source font samples and using text-image synthesis operations on the multi-source font samples to generate realistic font samples;

[0007] Image enhancement processing is performed on the simulated font samples to obtain training font samples;

[0008] The training font samples are labeled and the training dataset is divided according to a preset ratio;

[0009] A feature extraction network is constructed using depthwise separable convolutions. The feature extraction network includes multi-scale input channels, where each scale input channel includes a 3×3 depthwise convolutional layer and a 1×1 pointwise convolutional layer.

[0010] Train the feature extraction network using the training dataset;

[0011] The font image to be recognized is input into the trained feature extraction network to obtain feature maps at multiple scales.

[0012] Calculate the discriminant scores of feature maps at multiple scales, and then perform weighted fusion of feature maps at multiple scales based on the discriminant scores to obtain a fused feature map;

[0013] Font classification is performed based on fused feature maps to obtain font category information and similarity values ​​corresponding to the font images to be identified.

[0014] By employing the above technical solutions, realistic font samples are generated through the collection of multi-source font samples and text-image synthesis, increasing the diversity and realism of the training data and improving the model's adaptability to font variations in real-world scenarios. Image enhancement processing of the realistic font samples further expands the training dataset, enabling the model to learn more font variations. A feature extraction network is constructed using depthwise separable convolutions. Spatial features are extracted through 3×3 deep convolutional layers, and features are combined through 1×1 pointwise convolutional layers, reducing computation and parameter count while maintaining feature extraction capabilities. The multi-scale input channel design allows the network to simultaneously acquire local detail features and global structural features of the font image, improving the completeness of feature representation. Calculating the discriminative scores of feature maps at multiple scales and performing weighted fusion highlights the contribution of highly discriminative feature maps and suppresses the influence of less discriminative feature maps, resulting in a final fused feature map with stronger font category discrimination capabilities and improved accuracy in recognizing massive amounts of fonts.

[0015] In conjunction with some embodiments of the first aspect, in some embodiments, image enhancement processing is performed on the simulated font samples to obtain training font samples, specifically including:

[0016] The realistic font sample is blurred, scaled, and its brightness and contrast are adjusted to obtain a primary enhanced sample.

[0017] Rotate and flip the primary augmented sample to obtain the orientation-enhanced sample;

[0018] Gaussian noise and salt-and-pepper noise are added to the direction-enhanced samples to obtain training font samples.

[0019] By adopting the above technical solution, the simulated font samples are subjected to image enhancement processing such as blurring, scaling, brightness and contrast adjustment, rotation, flipping, and the addition of Gaussian noise and salt-and-pepper noise. This systematically simulates various image quality degradation and deformation situations that may occur in real application scenarios, enhances the robustness of the model to various image quality problems, and improves the adaptability of the font recognition algorithm in complex real-world environments.

[0020] In conjunction with some embodiments of the first aspect, in some embodiments, discriminative scores of feature maps at multiple scales are calculated, specifically including:

[0021] Calculate the intra-class distance between samples of the same font category and the inter-class distance between samples of different font categories in the feature map of each scale.

[0022] Fisher's discriminant coefficients for each scale feature map are calculated based on intra-class distance and inter-class distance.

[0023] The Fisher discriminant coefficients are normalized to obtain the discriminant score of each scale feature map;

[0024] The feature maps at each scale are weighted based on the discriminant scores to obtain weighted feature maps;

[0025] The weighted feature maps are concatenated along the channel dimension to obtain the fused feature map.

[0026] By employing the aforementioned technical solution, the effectiveness of feature maps in distinguishing font categories can be quantitatively evaluated by calculating the intra-class distance between samples of the same font category and the inter-class distance between samples of different font categories in the feature maps at each scale. The Fisher discriminant coefficients, calculated based on intra-class and inter-class distances, reflect the discriminative power of the feature maps; a larger Fisher discriminant coefficient indicates that the feature map at that scale has smaller intra-class differences and larger inter-class differences. Normalizing the Fisher discriminant coefficients yields a discriminative score, which is then used to weight the feature maps, giving feature maps with stronger discriminative power greater weight during the fusion process. The fused feature map, obtained by concatenating the weighted feature maps along the channel dimension, retains the most discriminative information from each scale's feature map, improving the discriminative power of feature representation and increasing the accuracy of font recognition.

[0027] In conjunction with some embodiments of the first aspect, in some embodiments, after obtaining the font category information and similarity value corresponding to the font image to be identified, the method further includes:

[0028] Based on the principles of font design, a scene-scale continuum is constructed, which represents the gradual change pattern of font features as the scene changes.

[0029] Locate the feature projection points of the font image to be recognized in the scene scale continuum to establish a feature invariant curve;

[0030] The consistency of font category information is verified based on the feature constancy curve to obtain cross-scene recognition results;

[0031] Map all font samples corresponding to font category information to a scene scale continuum to obtain a family of sample feature curves;

[0032] Based on the similarity between the feature invariance curve and the family of sample feature curves, the similarity value is corrected to obtain scene-adaptive font matching results.

[0033] By employing the aforementioned technical solution and constructing a scene-scale continuum based on font design principles, a mathematical descriptive model of font feature variations with different scenes was established. Feature projection points of the font image to be recognized were located within the scene-scale continuum, and feature constancy curves were established to obtain the variation patterns of font features under different scenes. The consistency of font category information was verified based on the feature constancy curves, ensuring the stability of the recognition results across various scenes. All font samples corresponding to the font category information were mapped to the scene-scale continuum to obtain a family of sample feature curves, establishing a correspondence between font features and scene changes. The similarity value was corrected based on the similarity between the feature constancy curves and the family of sample feature curves, improving the adaptability of the font matching results to scene changes and enabling the font recognition system to maintain high recognition accuracy in different application scenarios.

[0034] In conjunction with some embodiments of the first aspect, in some embodiments, a scene-scale continuum is constructed based on font design principles, specifically including:

[0035] Extract font design parameters from multiple scenarios. Font design parameters include glyph outline, stroke thickness, and spacing.

[0036] A scene feature vector is constructed based on the font design parameters. The scene feature vector represents the visual characteristics of the font in a specific scene.

[0037] A scene-scale continuum is established based on scene feature vectors. The scene-scale continuum represents the gradual change pattern of font features as the scene changes.

[0038] By employing the aforementioned technical solution, scene feature vectors are constructed by extracting font design parameters such as character outlines, stroke thickness, and spacing from multiple scenarios. A scene-scale continuum is then established based on these feature vectors, enabling the system to characterize the visual feature changes of fonts in different scenarios. This makes the system's font feature modeling more consistent with human visual perception and accurately reflects the gradual changes in font characteristics across different scenes. Because the scene-scale continuum contains core font design parameters, the system can more precisely analyze the feature change trends of fonts in different scenarios, improving the completeness and accuracy of feature representation.

[0039] In conjunction with some embodiments of the first aspect, in some embodiments, the feature projection points of the font image to be recognized are located in the scene-scale continuum to establish a feature constancy curve, specifically including:

[0040] Obtain the scene feature vector of the font image to be recognized;

[0041] Projecting the scene feature vectors onto the scene scale continuum yields the feature projection points;

[0042] A feature constancy curve is established based on the feature projection points. The feature constancy curve represents the feature variation law of the font image to be identified in different scenes.

[0043] By adopting the above technical solution, the feature constancy curve records the feature change patterns of the font to be recognized in different scenarios, enabling the system to accurately grasp the dynamic evolution of font features with changing scenarios, thus enhancing the system's robust representation of font features. Because the feature constancy curve contains complete feature change information, the system can more accurately determine the feature consistency of the font to be recognized in different scenarios, improving the stability and reliability of feature representation.

[0044] In conjunction with some embodiments of the first aspect, in some embodiments, the consistency of font category information is verified based on the feature constancy curve to obtain cross-scene recognition results, specifically including:

[0045] The standard font corresponding to the font category information is feature-mapped in the scene scale continuum to obtain the standard feature constancy curve;

[0046] Calculate the feature distance between the standard feature constancy curve and the feature constancy curve of the font image to be recognized;

[0047] When the feature distance is less than a preset threshold, the consistency of the font category information is confirmed as valid; when the feature distance is not less than the preset threshold, the consistency of the font category information is confirmed as invalid.

[0048] Generate cross-scene recognition results based on the consistency of font category information.

[0049] By employing the aforementioned technical solution, and calculating the feature distance between the standard feature constancy curve and the feature constancy curve of the font to be identified, and judging the consistency of font category information based on a preset threshold, the system achieves a cross-scene font recognition mechanism. This feature distance-based verification method considers the feature variation law of the font across the entire scene scale continuum, enabling the system to accurately assess the similarity between the font to be identified and the standard font in different scenes. Due to the use of a holistic comparison method based on feature constancy curves, the system can reduce feature matching errors in a single scene and improve the accuracy of cross-scene recognition.

[0050] Secondly, embodiments of this application provide a Chinese and English massive font recognition system, which includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and one or more processors call the computer instructions to cause the system to perform the method described in the first aspect and any possible implementation of the first aspect.

[0051] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a system, cause the system to perform the method described in the first aspect and any possible implementation thereof.

[0052] Fourthly, embodiments of this application provide a computer program product that, when run on a system, causes the system to execute the method described in any possible implementation of the first aspect.

[0053] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0054] 1. This application provides a method for recognizing massive amounts of Chinese and English fonts. By collecting multi-source font samples and performing text-image synthesis to generate realistic font samples, the diversity and realism of the training data are increased, improving the model's adaptability to font variations in real-world scenarios. Image enhancement processing of the realistic font samples further expands the training dataset, enabling the model to learn more font variations. A feature extraction network is constructed using depthwise separable convolutions. Spatial features are extracted through 3×3 deep convolutional layers, and features are combined through 1×1 pointwise convolutional layers, reducing computation and parameter count while maintaining feature extraction capabilities. The multi-scale input channel design allows the network to simultaneously acquire local detail features and global structural features of the font image, improving the completeness of feature representation. The method of calculating the discriminative scores of feature maps at multiple scales and performing weighted fusion highlights the contribution of highly discriminative feature maps and suppresses the influence of less discriminative feature maps, resulting in a final fused feature map with stronger font category discrimination capabilities, thus improving the recognition accuracy for massive amounts of fonts.

[0055] 2. This application provides a method for recognizing massive amounts of Chinese and English fonts. By constructing a scene-scale continuum based on font design principles, a mathematical description model of font features changing with the scene is established. Feature projection points of the font image to be recognized are located in the scene-scale continuum, and feature constancy curves are established to obtain the variation patterns of font features under different scenes. The consistency of font category information is verified based on the feature constancy curves, ensuring the stability of the recognition results under different scenes. All font samples corresponding to the font category information are mapped to the scene-scale continuum to obtain a family of sample feature curves, establishing a correspondence between font features and scene changes. The similarity value is corrected based on the similarity between the feature constancy curves and the family of sample feature curves, improving the adaptability of the font matching results to scene changes, enabling the font recognition system to maintain a high recognition accuracy in different application scenarios. Attached Figure Description

[0056] Figure 1 This is a flowchart illustrating a method for recognizing a large number of Chinese and English fonts in an embodiment of this application.

[0057] Figure 2 This is a flowchart illustrating a font feature modeling and matching method based on a scene scale continuum in an embodiment of this application.

[0058] Figure 3 This is a schematic diagram of the physical device structure of a Chinese and English massive font recognition system provided in the embodiments of this application. Detailed Implementation

[0059] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.

[0060] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0061] The following example is used in conjunction with Figure 1 The present application describes a method for recognizing massive amounts of Chinese and English fonts in its embodiments:

[0062] Please see Figure 1 This is a flowchart illustrating a method for recognizing massive amounts of Chinese and English fonts in an embodiment of this application.

[0063] S101. Collect multi-source font samples and use text image synthesis operation on the multi-source font samples to generate realistic font samples;

[0064] The system first needs to collect multi-source font samples as training data. These samples can come from various sources, such as publicly available font libraries online, commercial font libraries, and handwritten font datasets. These samples should cover as many different font styles, sizes, and weights as possible to ensure the trained model has good generalization ability. After collecting a sufficient number of font samples, the system needs to preprocess them, converting them into a uniform format and size to facilitate subsequent training and processing.

[0065] After obtaining a sufficient number of font samples, the system needs to use text image synthesis to generate realistic font samples. Text image synthesis refers to combining font samples with various background images to generate text images that look like they are from real-world scenes. The purpose of this step is to make the training data more closely resemble real-world application scenarios and improve the model's practicality. Specifically, the system can randomly select some background images, such as paper, wood, or metal plates, and then overlay the font samples onto the background images with a certain degree of transparency, adding some random geometric transformations, such as rotation, scaling, and translation, to increase the diversity of the data.

[0066] During the generation of realistic font samples, some problems may arise, such as excessive color differences between the background image and the font sample, and difficulty in distinguishing the superimposed font samples. To address these issues, the system can employ image processing techniques such as color conversion and contrast adjustment to adjust the colors of the background image to a range close to that of the font sample, and appropriately increase the contrast of the font sample to ensure that the synthesized image is clearly distinguishable. Simultaneously, the system can dynamically adjust the transparency and geometric transformation parameters of the superimposed image based on the characteristics of the font sample, such as stroke thickness and font size, to obtain more natural and realistic font samples.

[0067] S102. Perform image enhancement processing on the simulated font samples to obtain training font samples;

[0068] The system performs image enhancement processing on the simulated font samples to obtain training font samples. Specifically, this includes: blurring, scaling, and adjusting the brightness and contrast of the simulated font samples to obtain primary enhanced samples; rotating and flipping the primary enhanced samples to obtain directional enhanced samples; and adding Gaussian noise and salt-and-pepper noise to the directional enhanced samples to obtain training font samples.

[0069] After generating realistic font samples, the system needs to perform further image enhancement processing to obtain the final font samples used for training. The purpose of image enhancement processing is to introduce some random variations and noise while maintaining the basic features of the font samples, thereby increasing the diversity and robustness of the training data. This step can effectively improve the model's ability to recognize fonts in various complex scenes.

[0070] Specifically, image enhancement processing can be divided into several steps. First, the system performs operations such as blurring, scaling, and brightness and contrast adjustment on the simulated font samples to obtain primary enhanced samples. Blurring can simulate out-of-focus and motion blur in real-world scenes; scaling can simulate font images at different resolutions; brightness and contrast adjustment can simulate font images under different lighting conditions. These operations make the training data closer to real-world application scenarios. Next, the system rotates and flips the primary enhanced samples to obtain orientation-enhanced samples. This step can simulate changes in the font image in different directions, further increasing the diversity of the data. Finally, the system adds Gaussian noise and salt-and-pepper noise to the orientation-enhanced samples to obtain the final training font samples. Gaussian noise and salt-and-pepper noise are two common types of image noise, simulating random interference and impulse interference encountered by the image during transmission, respectively.

[0071] S103. Label the training font samples and divide the training dataset according to a preset ratio;

[0072] After obtaining the training font samples, the system needs to label them and divide the training dataset according to a preset ratio. Labeling refers to assigning a corresponding font category label to each font sample, such as SimSun, Heiti, Arial, etc. This step is a necessary prerequisite for training the font recognition model, because the model needs to know the font category to which each sample belongs in order to learn the distinguishing features between different fonts.

[0073] Splitting the training dataset refers to dividing the entire annotated font sample set into training, validation, and test sets according to a certain ratio. The training set is used to train the model, the validation set is used to evaluate the model's performance and adjust hyperparameters during training, and the test set is used to evaluate the model's final performance after training. The split ratio can be set according to specific circumstances; generally, the training set has the largest proportion, while the validation and test sets have relatively smaller proportions. A common split ratio is 7:2:1, meaning 70% of the samples are used for training, 20% for validation, and 10% for testing.

[0074] During the labeling and classification of training font samples, some problems may arise, such as labeling errors and imbalanced sample distribution. To address these issues, the system can employ data cleaning and balancing techniques. For example, the system can randomly sample labeled samples for manual review to identify and correct potential labeling errors. Regarding imbalanced sample distribution, the system can use oversampling or undersampling to ensure a relatively balanced number of samples across font categories, preventing the model from overfitting to categories with a larger sample size. Simultaneously, the system can utilize data augmentation techniques, such as the image enhancement processing mentioned in the previous step, to further expand the training dataset while maintaining the labels, thereby improving the model's generalization ability.

[0075] S104. A feature extraction network is constructed using depthwise separable convolutions. The feature extraction network includes multi-scale input channels.

[0076] The system uses depthwise separable convolutions to construct a feature extraction network. The feature extraction network includes multi-scale input channels, where each scale input channel includes a 3×3 depthwise convolutional layer and a 1×1 pointwise convolutional layer.

[0077] After partitioning the training dataset, the system needs to build a feature extraction network to automatically extract the features required for recognition from font images. Traditional convolutional neural networks often require a large number of convolutional kernels when extracting features, resulting in high computational costs and making them unsuitable for deployment on resource-constrained devices. To address this issue, the system employs depthwise separable convolutions to construct the feature extraction network.

[0078] Depthwise separable convolution is an efficient convolutional technique that breaks down traditional convolution operations into two steps: depthwise convolution and pointwise convolution. Depthwise convolution performs independent convolution operations on each channel of the input, while pointwise convolution linearly combines the outputs of the depthwise convolution. Compared to traditional convolution, depthwise separable convolution significantly reduces the number of network parameters and computational cost while maintaining high feature extraction capabilities.

[0079] To further improve the performance of the feature extraction network, the system also introduces a multi-scale input channel design. Specifically, the feature extraction network includes multiple parallel input channels, each receiving font images at different scales as input. For example, three input channels can be set to receive font images at their original size, magnified by 1.5 times, and magnified by 2 times, respectively. Multi-scale input enables the network to capture features of font images at different scales, improving the richness and robustness of feature representation. In each scale input channel, the system uses 3×3 depthwise convolutional layers and 1×1 pointwise convolutional layers, progressively extracting high-level font features through the stacking of multiple convolutions.

[0080] S105. Train the feature extraction network using the training dataset;

[0081] After constructing the feature extraction network, the system needs to train the network using a training dataset to optimize its parameters, enabling it to accurately extract the features required for recognition from font images. The training process typically employs supervised learning, using labeled font samples as input and adjusting the network parameters by comparing the network's predictions with the actual labels to minimize prediction error.

[0082] Specifically, the training process can be divided into the following steps: First, the training font samples are randomly divided into several batches, each batch containing a certain number of samples. Then, for each batch, it is input into a feature extraction network, and after multiple convolutions and activation functions, a feature vector is obtained. Next, the feature vector is input into a classifier (such as a fully connected layer + Softmax function) to obtain a predicted font category probability distribution. Finally, the predicted probability distribution is compared with the true category labels, the cross-entropy loss function is calculated, and the gradient of the loss function with respect to the network parameters is calculated using the backpropagation algorithm. The network parameters are updated based on the gradient. This process is iterated until the network's performance on the validation set no longer improves.

[0083] S106. Input the font image to be recognized into the trained feature extraction network to obtain feature maps at multiple scales;

[0084] After the feature extraction network is trained, the system can use it to extract features from the font image to be recognized. Specifically, the font image to be recognized is input into the trained feature extraction network, and after multiple layers of convolution and pooling operations, a set of feature maps is obtained. Because the feature extraction network adopts a multi-scale input channel design, the final feature map also includes multiple scales, with each scale corresponding to one input channel.

[0085] Feature maps at different scales represent the feature information of a font image at different scales. For example, smaller-scale feature maps can capture local details of a font image, such as the shape and thickness of strokes; larger-scale feature maps can capture global structural features of a font image, such as the overall appearance and layout of characters. By fusing feature maps of different scales, the system can obtain a comprehensive and rich representation of font features, which helps to improve the accuracy of subsequent font recognition.

[0086] Several issues may arise during the extraction of multi-scale feature maps, such as significant semantic differences between feature maps at different scales and excessively high dimensionality of the feature maps. To address these issues, the system can employ feature fusion and dimensionality reduction techniques. For example, an attention mechanism can be used to adaptively adjust the importance of feature maps at different scales by learning a weight matrix, making their semantics more consistent. Dimensionality reduction techniques such as Principal Component Analysis (PCA) and Independent Component Analysis (ICA) can be used to reduce the dimensionality of feature maps while preserving key feature information, thereby lowering the computational complexity of subsequent processing. Furthermore, the system can incorporate prior knowledge, such as the structural characteristics of fonts and the rules governing stroke combinations, to guide the feature extraction network in extracting more targeted features useful for font recognition, improving the discriminativeness and compactness of the feature representation.

[0087] S107. Calculate the discriminant scores of feature maps at multiple scales, and perform weighted fusion of feature maps at multiple scales based on the discriminant scores to obtain a fused feature map.

[0088] The system calculates the discriminant scores of feature maps at multiple scales and then performs weighted fusion of the feature maps at multiple scales based on the discriminant scores to obtain a fused feature map. Specifically, it calculates the intra-class distance between samples of the same font category and the inter-class distance between samples of different font categories in each feature map at each scale; it calculates the Fisher discriminant coefficient for each feature map based on the intra-class and inter-class distances; it normalizes the Fisher discriminant coefficients to obtain the discriminant score for each feature map at each scale; it then weights each feature map at each scale based on the discriminant scores to obtain a weighted feature map; finally, it concatenates the weighted feature maps along the channel dimension to obtain the fused feature map.

[0089] After obtaining feature maps at multiple scales, the system needs to fuse them to obtain a unified and more discriminative font feature representation. However, feature maps at different scales may contribute differently to font recognition, and simply concatenating or averaging them may not fully leverage the advantages of each scale's features. Therefore, the system adopts a weighted fusion strategy based on discriminative scores.

[0090] Specifically, the system first calculates the intra-class distance between samples of the same font category and the inter-class distance between samples of different font categories in each scale feature map. The intra-class distance reflects the compactness of features within the same font category, while the inter-class distance reflects the separation of features between samples of different font categories. An ideal feature representation should minimize the intra-class distance and maximize the inter-class distance. Based on this principle, the system uses Fisher discriminant analysis to calculate the Fisher discriminant coefficient for each scale feature map, which serves as its discriminant score. The larger the Fisher discriminant coefficient, the stronger the discriminative power of the feature map at that scale, and the greater its contribution to font recognition.

[0091] After calculating the discriminative scores of feature maps at each scale, the system normalizes these scores so that their sum equals 1, obtaining the weight coefficient for each scale feature map. Then, each scale feature map is multiplied by its corresponding weight coefficient to obtain a weighted feature map. Finally, all weighted feature maps are concatenated along the channel dimension to obtain the final fused feature map. This weighted fusion method adaptively adjusts the importance of feature maps at different scales, allowing more discriminative feature maps to occupy a larger proportion in the fused feature representation, thus improving the performance of font recognition.

[0092] Several issues may arise during the fusion of multi-scale feature maps, such as significant differences in the distribution of feature maps at different scales and inaccurate discriminant score estimation. To address these issues, the system can employ feature normalization and adaptive weight learning techniques. For example, before calculating intra-class and inter-class distances, batch normalization can be performed on feature maps at each scale to ensure a more consistent distribution. The calculation of Fisher discriminant coefficients can be embedded into the network training process, adaptively adjusting the weight coefficients of each scale feature map through end-to-end learning to better match the font recognition task. Simultaneously, the system can introduce regularization terms, such as L1 norm and L2 norm, to constrain the weight coefficients, preventing overfitting and instability in weight estimation.

[0093] S108. Based on the fused feature map, perform font classification to obtain the font category information and similarity value corresponding to the font image to be identified.

[0094] After obtaining the fused feature map, the system needs to perform font classification based on it to determine the font category to which the font image to be identified belongs. Simultaneously, to provide richer recognition results, the system also calculates the similarity value between the font image to be identified and each font category, representing the degree of matching between them.

[0095] Specifically, font classification can be achieved by feeding a classifier after fusing the feature maps. Common classifiers include fully connected layers with a softmax function, support vector machines (SVM), and k-nearest neighbors (KNN). Taking a fully connected layer with a softmax function as an example, the system can input the fused feature map into one or more fully connected layers for further transformation and extraction of the features. Finally, the softmax function maps these features to a probability distribution, representing the probability that the font image to be identified belongs to each font category. The font category with the highest probability value is the recognition result.

[0096] To calculate the similarity between the font image to be identified and each font category, the system can use metrics such as cosine similarity and Euclidean distance. For example, the fused feature map can be viewed as a high-dimensional vector, and the cosine similarity between it and the average feature vector of each font category can be calculated, resulting in a similarity value between -1 and 1. The higher the similarity value, the closer the font image to be identified is to that font category. These similarity values ​​can serve as auxiliary information for the recognition results, helping users better understand and interpret the results.

[0097] In the above embodiments, by collecting multi-source font samples and performing text image synthesis to generate realistic font samples, the diversity and realism of the training data are increased, improving the model's adaptability to font changes in real-world scenarios. The training font samples obtained by image enhancement processing of the realistic font samples further expand the scale of the training dataset, enabling the model to learn more font variations. A feature extraction network is constructed using depthwise separable convolutions. Spatial features are extracted through 3×3 deep convolutional layers, and features are combined through 1×1 pointwise convolutional layers, reducing computation and parameter count while maintaining feature extraction capabilities. The design of multi-scale input channels allows the network to simultaneously acquire local detail features and global structural features of the font image, improving the completeness of feature representation. The method of calculating the discriminative scores of feature maps at multiple scales and performing weighted fusion highlights the contribution of feature maps with strong discriminative power and suppresses the influence of feature maps with weaker discriminative power, resulting in a final fused feature map with stronger font category discrimination capabilities and improving the recognition accuracy for massive amounts of fonts.

[0098] The above embodiments achieve efficient recognition of massive fonts by employing techniques such as multi-source font sample acquisition, image enhancement processing, depthwise separable convolutional feature extraction networks, and multi-scale feature fusion. However, in practical applications, the visual features of fonts change with the application scenario, and relying solely on the above feature extraction and classification methods may be insufficient to guarantee the accuracy of cross-scenario recognition. To further improve the system's recognition performance in different scenarios, this application also proposes a font feature modeling and matching method based on a scene-scale continuum. This method constructs a scene-scale continuum to characterize the gradual change of font features with scene variations and uses feature constancy curves to verify the consistency of recognition results, thereby achieving scene-adaptive expression and matching of font features.

[0099] The following is combined with Figure 2 This application describes a font feature modeling and matching method based on a scene scale continuum in its embodiments:

[0100] Please see Figure 2 This is a flowchart illustrating a font feature modeling and matching method based on a scene scale continuum in an embodiment of this application.

[0101] S201. Constructing a scene scale continuum based on font design principles;

[0102] The system constructs a scene-scale continuum based on font design principles. The scene-scale continuum represents the gradual change of font features with scene variations. Specifically, it includes: extracting font design parameters under multiple scenes, including glyph outline, stroke thickness, and spacing; constructing scene feature vectors based on font design parameters, which represent the visual features of the font in a specific scene; and establishing a scene-scale continuum based on the scene feature vectors, which represents the gradual change of font features with scene variations.

[0103] To achieve scene-adaptive representation and matching of font features, the system first needs to construct a scene-scale continuum to characterize the gradual changes in font features across different scenes. The construction of the scene-scale continuum is based on font design principles and fully considers the visual feature changes of fonts in different scenes. The purpose of this step is to establish a continuous, multi-dimensional feature space within which font features can be smoothly mapped and transformed, laying the foundation for subsequent feature matching and recognition.

[0104] Specifically, the construction of the scene-scale continuum involves the following steps: First, the system needs to extract font design parameters for multiple typical scenarios. These parameters include glyph outlines, stroke thickness, and stroke spacing, which are key factors determining the visual characteristics of the font. By analyzing and measuring font samples in different scenarios, the system can obtain a set of font design parameters covering various scenarios. Then, the system constructs scene feature vectors based on the font design parameters. A scene feature vector is a high-dimensional numerical representation, with each dimension corresponding to a font design parameter, the value of which reflects the visual characteristics of the font in a specific scenario. By mapping font design parameters to scene feature vectors, the system can unify font features from different scenarios into a common representation space. Finally, the system establishes a scene-scale continuum based on the scene feature vectors. The scene-scale continuum is a continuous, multi-dimensional feature space where each point corresponds to a scene feature vector, and the feature changes between adjacent points are smooth and gradual. By performing interpolation and fitting operations on the scene feature vectors, the system can construct a continuum covering all scenarios, representing the gradual change in font features with varying scenarios.

[0105] S202. Locate the feature projection points of the font image to be recognized in the scene scale continuum to establish a feature invariance curve.

[0106] The system locates the feature projection points of the font image to be recognized in the scene-scale continuum to establish a feature invariance curve. Specifically, this includes: obtaining the scene feature vector of the font image to be recognized; projecting the scene feature vector into the scene-scale continuum to obtain the feature projection points; and establishing a feature invariance curve based on the feature projection points. The feature invariance curve characterizes the feature variation law of the font image to be recognized under different scenes.

[0107] After constructing the scene-scale continuum, the system needs to map the font image to be recognized onto this continuum to establish its feature constancy curve. The feature constancy curve characterizes the feature variation pattern of the font image under different scenes and is crucial for cross-scene recognition and matching. The purpose of this step is to find the position of the font image to be recognized in the scene-scale continuum and describe its trajectory in the continuum, providing a basis for subsequent feature matching and consistency verification.

[0108] Specifically, establishing a feature constancy curve involves the following steps: First, the system needs to obtain the scene feature vector of the font image to be recognized. This can be achieved by performing the same feature extraction and representation process on the font image as in the scene-scale continuum construction process, i.e., extracting font design parameters and mapping them to high-dimensional numerical vectors. Then, the system projects the scene feature vector onto the scene-scale continuum to obtain feature projection points. These projection points represent the position of the font image to be recognized within the scene-scale continuum, and the surrounding points represent font samples with similar visual features. Finally, the system establishes a feature constancy curve based on the feature projection points. The feature constancy curve is a trajectory passing through the feature projection points, representing the changing trend of the font image to be recognized within the scene-scale continuum. By performing interpolation and fitting operations on the feature projection points, the system can obtain a continuous and smooth curve that describes the feature evolution of the font image under different scenes.

[0109] In establishing feature constancy curves, some problems may arise, such as inaccurate feature projection and unstable curve fitting. To address these issues, the system can employ optimization measures. For example, during feature projection, the system can use manifold learning algorithms such as Local Linear Embedding (LLE) and t-SNE to map high-dimensional scene feature vectors into a low-dimensional embedding space, reducing computational complexity while preserving the local structure and topological relationships of the features. During curve fitting, the system can use kernel-based nonlinear regression methods, such as Support Vector Regression (SVR) and Gaussian Process Regression (GPR), to improve the robustness and generalization ability of curve fitting by introducing kernel tricks and prior distributions. Simultaneously, the system can utilize prior knowledge of font design, such as the continuity of character structure and the smoothness of stroke shapes, to constrain and regularize the feature constancy curve, making it more consistent with the rules of font visual perception and improving the reliability of cross-scene recognition.

[0110] S203. Verify the consistency of font category information based on the feature constancy curve to obtain cross-scene recognition results;

[0111] The system verifies the consistency of font category information based on feature constancy curves to obtain cross-scene recognition results. Specifically, this includes: mapping the standard font corresponding to the font category information to a scene-scale continuum to obtain a standard feature constancy curve; calculating the feature distance between the standard feature constancy curve and the feature constancy curve of the font image to be recognized; confirming the consistency of font category information as valid when the feature distance is less than a preset threshold; confirming the consistency of font category information as invalid when the feature distance is not less than the preset threshold; and generating cross-scene recognition results based on the consistency of font category information.

[0112] After establishing the feature constancy curve of the font image to be recognized, the system needs to verify the consistency of font category information based on this curve to obtain recognition results across different scenarios. Font category information refers to the candidate font categories obtained in the previous font recognition steps. Verifying its consistency aims to determine whether the category is still applicable in different scenarios, thereby improving the reliability and robustness of the recognition results. This step is crucial for achieving scene-adaptive font recognition. By comparing the feature constancy curve with the feature variation patterns of standard fonts, recognition errors caused by scene changes can be effectively reduced.

[0113] Specifically, the process of verifying the consistency of font category information includes the following steps: First, the system needs to perform feature mapping on the standard font corresponding to the font category information within the scene-scale continuum to obtain a standard feature constancy curve. The standard font refers to a typical representative of the font category, and its feature variation patterns can serve as a reference standard for judging consistency. By performing the same feature extraction and projection operations on the standard font as on the font image to be identified, the system can obtain a curve reflecting the feature variation trend of the font category under different scenes. Then, the system calculates the feature distance between the standard feature constancy curve and the feature constancy curve of the font image to be identified. The feature distance refers to the geometric distance between the two curves in the scene-scale continuum, which can be calculated using metrics such as Euclidean distance and geodesic distance. The smaller the feature distance, the more similar the shapes and trends of the two curves are, and the higher the consistency of the font category information. Finally, the system judges the consistency of the font category information based on the relationship between the feature distance and a preset threshold. If the feature distance is less than a preset threshold, it indicates that the feature variation patterns of the font image to be identified and the standard font are basically consistent in different scenarios, and the font category information is reliable. Conversely, if the feature distance is greater than or equal to the preset threshold, it indicates that there are significant differences in the feature variation patterns between the two, and the font category information is unreliable. Based on the consistent verification results, the system can generate cross-scenario recognition results, that is, based on the original font category information, it combines scene adaptability for correction and adjustment.

[0114] S204. Map all font samples corresponding to the font category information to the scene scale continuum to obtain a family of sample feature curves.

[0115] After verifying the consistency of font category information, the system needs to further evaluate the similarity between the font image to be identified and font samples within that category to obtain more refined and accurate matching results. To this end, the system needs to map all font samples corresponding to the font category information to a scene-scale continuum, obtaining a family of sample feature curves. This family of feature curves reflects the internal variation patterns of the font category under different scenes and forms the basis for similarity calculation and matching optimization. The purpose of this step is to improve the accuracy and reliability of font matching by comprehensively considering the diversity and differences within font categories.

[0116] Specifically, the process of constructing a family of sample feature curves is similar to the previous process of constructing standard feature constancy curves, except that it requires batch processing of all font samples corresponding to the font category. First, the system needs to acquire all font samples corresponding to the font category information; these samples should cover as many variations as possible in style, glyph, and size of the font. Then, the system extracts features and constructs scene feature vectors for each font sample, obtaining a set of high-dimensional numerical representations. Next, the system projects these scene feature vectors onto a scene-scale continuum, obtaining a set of feature projection points distributed in the continuum. Finally, the system performs interpolation and fitting operations on these feature projection points to obtain a family of sample feature curves reflecting the internal variation patterns of the font category. Each curve corresponds to a font sample, and the shape and trend of the curve reflect the feature variation trend of that sample under different scenes.

[0117] S205. Based on the similarity between the feature constant curve and the family of sample feature curves, the similarity value is corrected to obtain the scene-adaptive font matching result.

[0118] After obtaining the feature constancy curve of the font image to be identified and the family of sample feature curves corresponding to the font category, the system needs to compare their similarity and correct the original similarity value to obtain a scene-adaptive font matching result. The scene-adaptive font matching result comprehensively considers the feature variation patterns of fonts in different scenes, and can more accurately and reliably reflect the visual similarity between the font image to be identified and the font category. This step is the final step of the entire scene-adaptive font recognition method. Through similarity correction and matching optimization, the performance of font recognition and retrieval can be effectively improved.

[0119] Specifically, the scene-adaptive font matching process includes the following steps: First, the system needs to calculate the similarity between the feature constancy curve of the font image to be identified and the family of sample feature curves corresponding to the font category. Similarity can be calculated using various metrics, such as Euclidean distance, cosine similarity, geodesic distance, etc., or specific metric functions, such as Fréchet distance and Hausdorff distance, can be used, taking into account the characteristics of the scene scale continuum. The system calculates the similarity between each curve in the family of sample feature curves and the feature constancy curve, obtaining a set of similarity values. Then, the system corrects the original font matching results based on the similarity values. The original font matching results refer to the matching metrics obtained in the previous recognition steps by comparing the feature similarity between the font image to be identified and the font category samples. The system weights and fuses these matching metrics with the similarity values ​​to obtain the corrected matching metrics. The fusion weights can be adaptively adjusted based on factors such as scene complexity and prior probability of the font category to balance the contribution of scene adaptability and the original matching results. Finally, based on the corrected matching metrics, the system re-sorts and filters the font category samples to obtain scene-adaptive font matching results. The matching results are presented in the form of a sorted list, with each item in the list including the name of the font category sample, the matching metric, scene adaptability, and other information for user reference and selection.

[0120] In the above embodiments, a scene-scale continuum was constructed based on font design principles, establishing a mathematical description model of font features changing with the scene. Feature projection points of the font image to be recognized were located in the scene-scale continuum, and feature constancy curves were established to obtain the variation patterns of font features under different scenes. The consistency of font category information was verified based on the feature constancy curves, ensuring the stability of the recognition results under different scenes. All font samples corresponding to the font category information were mapped to the scene-scale continuum to obtain a family of sample feature curves, establishing a correspondence between font features and scene changes. The similarity value was corrected based on the similarity between the feature constancy curves and the family of sample feature curves, improving the adaptability of the font matching results to scene changes and enabling the font recognition system to maintain a high recognition accuracy in different application scenarios.

[0121] The system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference needed]. Figure 3 This is a schematic diagram of the physical device structure of a Chinese and English massive font recognition system provided in an embodiment of this application.

[0122] It should be noted that, Figure 3 The structure of the system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0123] like Figure 3 As shown, the system includes a Central Processing Unit (CPU) 301, which can perform various appropriate actions and processes based on a program stored in Read-Only Memory (ROM) 302 or a program loaded from storage portion 308 into Random Access Memory (RAM) 303, such as executing the methods described in the above embodiments. The RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An Input / Output (I / O) interface 305 is also connected to the bus 304.

[0124] The following components are connected to I / O interface 305: input section 306 including a camera, infrared sensor, etc.; output section 307 including a liquid crystal display (LCD) and speakers, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card and a modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.

[0125] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the various functions defined in the present invention.

[0126] It should be noted that the computer-readable medium shown in the embodiments of the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. The transmitted data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.

[0127] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0128] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the system described in the above embodiments; or it may exist independently and not assembled into the system. The storage medium carries one or more computer programs that, when executed by a processor of a system, cause the system to implement the methods provided in the above embodiments.

[0129] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0130] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0131] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0132] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for recognizing massive amounts of Chinese and English fonts, characterized in that, include: Collect multi-source font samples and use text image synthesis operation on the multi-source font samples to generate realistic font samples; The simulated font samples are subjected to image enhancement processing to obtain training font samples; The training font samples are labeled and the training dataset is divided according to a preset ratio; A feature extraction network is constructed using depthwise separable convolutions. The feature extraction network includes multi-scale input channels, wherein each scale input channel includes a 3×3 depthwise convolutional layer and a 1×1 pointwise convolutional layer. The feature extraction network is trained using the training dataset; The font image to be recognized is input into the trained feature extraction network to obtain feature maps at multiple scales. Calculate the discriminant scores of the feature maps at multiple scales, and then perform weighted fusion of the feature maps at multiple scales based on the discriminant scores to obtain a fused feature map; Based on the fused feature map, font classification is performed to obtain the font category information and similarity value corresponding to the font image to be identified; A scene-scale continuum is constructed based on font design principles. This scene-scale continuum represents the gradual change of font features with scene variations. Specifically, it includes: extracting font design parameters for multiple scenes, including glyph outline, stroke thickness, and spacing; constructing scene feature vectors based on the font design parameters, which represent the visual features of the font in a specific scene; and establishing a scene-scale continuum based on the scene feature vectors, which represents the gradual change of font features with scene variations. Locating feature projection points of the font image to be identified in the scene scale continuum to establish a feature constant curve specifically includes: obtaining the scene feature vector of the font image to be identified; projecting the scene feature vector onto the scene scale continuum to obtain feature projection points; and establishing a feature constant curve based on the feature projection points, wherein the feature constant curve characterizes the feature variation law of the font image to be identified under different scenes. The consistency of the font category information is verified based on the feature constancy curve to obtain cross-scene recognition results; Map all font samples corresponding to the font category information to the scene scale continuum to obtain a family of sample feature curves; Based on the similarity between the feature constant curve and the family of sample feature curves, the similarity value is corrected to obtain a scene-adaptive font matching result.

2. The method according to claim 1, characterized in that, The step of performing image enhancement processing on the simulated font samples to obtain training font samples specifically includes: The simulated font sample is blurred, scaled, and its brightness and contrast are adjusted to obtain a primary enhanced sample. The primary enhanced sample is rotated and flipped to obtain the orientation-enhanced sample; Gaussian noise and salt-and-pepper noise are added to the enhanced samples in the stated direction to obtain training font samples.

3. The method according to claim 1, characterized in that, The calculation of the discriminative score of the multiple scale feature maps specifically includes: Calculate the intra-class distance between samples of the same font category and the inter-class distance between samples of different font categories in the feature map of each scale. The Fisher discriminant coefficients of each scale feature map are calculated based on the intra-class distance and the inter-class distance. The Fisher discriminant coefficients are normalized to obtain the discriminant score of each scale feature map; Each scale feature map is weighted based on the discriminant score to obtain a weighted feature map; The weighted feature maps are concatenated along the channel dimension to obtain a fused feature map.

4. The method according to claim 1, characterized in that, The step of verifying the consistency of the font category information based on the feature constancy curve to obtain cross-scene recognition results specifically includes: The standard font corresponding to the font category information is feature-mapped in the scene scale continuum to obtain the standard feature constancy curve; Calculate the feature distance between the standard feature constancy curve and the feature constancy curve of the font image to be identified; When the feature distance is less than a preset threshold, the consistency of the font category information is confirmed as valid; when the feature distance is not less than the preset threshold, the consistency of the font category information is confirmed as invalid. Based on the consistency of the font category information, cross-scene recognition results are generated.

5. A massive Chinese and English font recognition system, characterized in that, The system includes: One or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the system to perform the method as described in any one of claims 1-4.

6. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the system, the system performs the method as described in any one of claims 1-4.

7. A computer program product, characterized in that, When the computer program product is run on the system, it causes the system to perform the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Scene text detection method and system based on multi-scale feature pyramid

    CN113673506A

  • Gesture recognition method and device, medium, equipment and vehicle

    CN119007281A

  • Font recognition and font similarity learning using a deep neural network

    US9501724B1