CN112580650B - Font classification prediction method and system - Google Patents
Font classification prediction method and system Download PDFInfo
- Publication number
- CN112580650B CN112580650B CN202011529220.5A CN202011529220A CN112580650B CN 112580650 B CN112580650 B CN 112580650B CN 202011529220 A CN202011529220 A CN 202011529220A CN 112580650 B CN112580650 B CN 112580650B
- Authority
- CN
- China
- Prior art keywords
- network
- samples
- sample
- types
- font classification
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
- G06V10/267—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/243—Classification techniques relating to the number of classes
- G06F18/2431—Multiple classes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/14—Image acquisition
- G06V30/148—Segmentation of character regions
- G06V30/153—Segmentation of character regions using recognition of characters or words
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/28—Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet
- G06V30/287—Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet of Kanji, Hiragana or Katakana characters
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computational Linguistics (AREA)
- Multimedia (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Mathematical Physics (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Controls And Circuits For Display Device (AREA)
- Character Discrimination (AREA)
Abstract
The invention discloses a font classification prediction method and a system, wherein the method comprises the following steps: s1, data set preparation, namely collecting and converting samples of multiple fonts, obtaining a single character picture through a character segmentation network, and determining the minimum external rectangle of each character as a single standard sample; s2, sampling data, namely selecting 1 type of the N types of samples as a reference sample set, calculating the similarity between the rest N-1 types of sample sets and the reference sample set through template matching, selecting the previous M samples as a batch size, and performing cyclic sampling training; s3, determining a network structure, network parameters and a loss function, and inputting samples into a network for training; and S4, verifying and testing the network model to obtain a prediction classification result. The method has the advantages of wide application prospect and stronger network generalization capability.
Description
Technical Field
The invention relates to the technical field of font classification, in particular to a font classification prediction method and system.
Background
At present, because the classification standard of Chinese fonts has no system and few application scenes, the font classification technology at the present stage mainly uses a deep learning algorithm to solve the problem of ancient font classification, but in the prior art, the problems that samples corresponding to the fonts are not wide enough, difficult to obtain and have no practical application background exist, and therefore, the technology has an improvement space.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, one objective of the present invention is to provide a font classification prediction method, which has the advantages of wide application prospect and strong network generalization capability.
The invention also provides a system with the font classification prediction method.
The font classification predicting method provided by the embodiment of the invention comprises the following steps of:
s1, data set preparation, namely collecting and converting samples of various fonts, obtaining a single character picture through a character segmentation network, and determining the minimum circumscribed rectangle of each character as a single standard sample;
s2, performing data sampling on the N types of samples, namely selecting 1 type of the N types of samples as a reference sample, calculating the similarity between the residual N-1 types of sample sets and the reference sample set through template matching, selecting the first M samples as one batch size, and performing cyclic sampling training;
s3, determining a network structure, network parameters and a loss function, and inputting samples to perform network training;
and S4, network verification and test are carried out, and a prediction classification result is obtained.
The font classification prediction method has the advantages of wide application prospect and stronger network generalization capability.
According to the method for predicting the font classification in one embodiment of the present invention, in step S1, the plurality of fonts includes: song style, song-imitating style, regular style and black body.
According to the font classification predicting method of one embodiment of the present invention, in step S2, the data sampling mode for the N-type samples is an online sampling mode.
According to the font classification prediction method of one embodiment of the present invention, in step S3, the network structure adopts a convolutional neural network, and the convolutional neural network is composed of convolutional layers, pooling layers and full-link layers.
According to the font classification prediction method provided by the embodiment of the invention, a deep learning algorithm is adopted to train the convolutional neural network.
According to the font classification prediction method of one embodiment of the present invention, in step S3, the loss function is an L2-softmax loss function, and the formula of the loss function is as follows:
wherein f (x) i ) The following constraints are satisfied for the feature vectors output by the network:
the parameter alpha has two setting modes, wherein the alpha is set as a fixed value in the training process, and the parameter alpha is obtained through training.
According to a second aspect of the present invention, there is provided a font classification predicting system using the font classification predicting method according to any one of the first aspects, the font classification predicting system comprising:
the data collection module is used for collecting and converting samples of various fonts and obtaining a single character sample through a character segmentation network;
the data sampling module can perform data sampling on the N types of samples, select 1 type of the N types of samples as a reference sample, calculate the similarity between the N-1 type of samples and the reference sample through template matching, select the first M samples as one batch size, and perform cyclic sampling training;
a network structure module that can implement constraints of network parameters and loss functions, into which sample parameters can be input;
and the network verification and test module can perform network verification and test on the sample parameters to obtain a prediction result.
The system for predicting font classification according to the second aspect of the present invention has the same advantages as the foregoing method for predicting font classification compared with the prior art, and is not described herein again.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow diagram of a font classification prediction method according to an embodiment of the invention;
fig. 2 is a schematic structural diagram of a font classification prediction system according to an embodiment of the present invention.
Reference numerals are as follows:
100-a font classification prediction system, 1-a data collection module, 2-a data sampling module, 3-a network structure module and 4-a network verification and test module.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, it is to be understood that the terms "central," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," and the like are used in the orientations and positional relationships indicated in the drawings for convenience in describing the invention and to simplify the description, and are not intended to indicate or imply that the referenced device or element must have a particular orientation, be constructed and operated in a particular orientation, and are not to be considered limiting of the invention.
A font classification prediction method according to an embodiment of the present invention is described below with reference to fig. 1 and 2. As shown in fig. 1, a font classification predicting method according to an embodiment of the present invention may include the following steps:
s1, data set preparation, namely collecting and converting samples of various fonts, obtaining a single character picture through a character segmentation network, and determining a minimum external connection corresponding area of the fonts;
s2, carrying out data sampling on the N samples, namely selecting 1 of the N samples as a reference sample, calculating the similarity between the N-1 samples and the reference sample through template matching, and carrying out sample matching to obtain sample parameters; for example, in one specific embodiment, the number of a batch is set to 200, and each type of sample is 50, i.e. four types of samples. Further, one of the samples is randomly selected as a reference sample, and the similarity between the reference sample and the other three types of samples is calculated through template matching. Further, the first M samples are selected as a batch size and sent to network training, and compared with the traditional random sampling, the sampling mode in the step S2 can improve the classification accuracy of the words with smaller font style difference.
S3, determining a network structure, network parameters and a loss function, and inputting sample parameters;
and S4, carrying out network verification and test on the sample parameters to obtain a prediction result.
The font classification prediction method has wide application prospect; and auxiliary sampling is performed through a template matching algorithm, so that the generalization capability of the network is favorably improved.
According to the font classification predicting method of one embodiment of the present invention, in step S1, the plurality of fonts may include: song style, song-imitating style, regular style and black body. Further, in the process of data set preparation, it is first required to ensure that the number of samples in each class is substantially the same in proportion; secondly, shooting the screenshot of the document or various printed documents to form a photo; thirdly, obtaining a single character picture through a character segmentation network; and finally, obtaining the area corresponding to the minimum external connection of the font.
Note that the types of fonts are not limited to the above four types.
According to the font classification predicting method of an embodiment of the present invention, in step S2, the manner of performing data sampling on the N types of samples includes: in the online sampling manner, it should be noted that a manner of sampling while training may also be adopted to perform data sampling on the N-type samples.
Further, in a specific embodiment, the online sampling method comprises the following specific processes: first, the batch size of the network training is determined, e.g., batch size =200 may be set; secondly, randomly selecting 20 samples in one type of font, and matching the top 10 samples closest to the remaining types of fonts with each sample by using a template matching algorithm; and finally, finishing sampling when the total number reaches 300, randomly selecting 200 samples as a batch size, and inputting the batch size into a network for training.
According to the font classification predicting method of one embodiment of the present invention, in step S3, the network structure adopts a convolutional neural network. Specifically, the convolutional neural network is composed of a convolutional layer, a pooling layer, and a fully-connected layer, and specifically, the convolutional layer may be provided in plurality.
According to the font classification prediction method provided by the embodiment of the invention, a deep learning algorithm is adopted to train the convolutional neural network.
According to the font classification prediction method of one embodiment of the present invention, in step S3, the loss function is an L2-softmax loss function, and specifically, the formula of the loss function is as follows:
wherein f (x) i ) The following constraints are satisfied for the feature vectors output by the network:
the parameter alpha has two setting modes, wherein the alpha is set as a fixed value in the training process, and the parameter alpha is obtained through training.
The minimum value of α is:
where C is the number of categories classified.
Furthermore, in the prior art, softmax loss is mostly adopted for visual classification tasks, but because softmax loss can only ensure that the learned font features are separable, it cannot ensure that the learned features of the characters with smaller font style difference are far enough and the features of different characters under the same font are close enough; that is, since the Chinese character is composed of a plurality of different radicals according to different rules, the difference of characteristic distinctiveness of different characters among a plurality of fonts is large. In the font classification prediction method provided by the embodiment of the invention, the L2-softmax is used as the loss function, so that the learned features can be normalized before classification, and the distinguishing degree of the features is enhanced through constraint, so that the classification accuracy is improved.
In conclusion, the font classification prediction method has wide application prospect; and auxiliary sampling is performed through a template matching algorithm, so that the generalization capability of the network is favorably improved.
The font classification predicting system 100 according to the second aspect of the present invention is configured to employ the font classification predicting method according to any one of the first aspect, and further, as shown in fig. 2, the font classification predicting system 100 may include:
the data acquisition module 1 is further used for acquiring and converting samples of various fonts, obtaining a single character picture through a character segmentation network, and determining a minimum external connection corresponding area of the fonts; in the description of the present invention, "a plurality" means two or more.
The data sampling module 2 is used for further performing data sampling on the N types of samples, selecting 1 type of the N types of samples as a reference sample, calculating the similarity between the N-1 type of samples and the reference sample through template matching, selecting the first M samples as a batch size, and performing cyclic sampling training;
a network structure module 3, further, the network structure module 3 can realize the constraint of network parameters and loss functions, further, the sample parameters can be input into the network structure module 3;
and the network verification and test module 4, further, the network verification and test module 4 can perform network verification and test on the sample parameters to obtain a prediction result.
In summary, the font classification prediction system 100 according to the second aspect of the present invention has the advantages of wider application prospect and stronger network generalization capability.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples" or the like mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims (6)
1. A font classification prediction method is characterized by comprising the following steps:
s1, data set preparation, namely collecting and converting samples of various fonts, obtaining a single character picture through a character segmentation network, and determining the minimum circumscribed rectangle of each character as a single standard sample;
s2, carrying out data sampling on the N types of samples, selecting 1 type of the N types of samples as a reference sample, calculating the similarity of the rest N-1 types of sample sets and the reference sample set through template matching, selecting the first M samples with the highest similarity in each sample set in the N-1 types of sample sets as a batch size, and circularly carrying out sampling in the step S2;
s3, determining a network structure, network parameters and a loss function, and inputting a sample to perform network training;
s4, network verification and test are carried out, and a prediction classification result is obtained;
in step S3, the loss function is an L2-softmax loss function, and the formula of the loss function is as follows:
2. The font classification predicting method according to claim 1, wherein in step S1, the plurality of fonts include: song style, imitation Song style, regular script and black body.
3. The font classification prediction method according to claim 1, characterized in that in step S2, the data sampling mode for the N-type samples is an online sampling mode.
4. The font classification predicting method according to claim 1, wherein in step S3, the network structure employs a convolutional neural network, and the convolutional neural network is composed of a convolutional layer, a pooling layer, and a fully-connected layer.
5. The font classification prediction method according to claim 4, characterized in that a deep learning algorithm is used to train the convolutional neural network.
6. A font classification prediction system, characterized in that the font classification prediction method according to any one of claims 1 to 5 is used, the system comprising:
the data acquisition module is used for collecting and converting samples of various fonts, obtaining a single character picture through a character segmentation network, and determining the minimum external rectangle of each character as a single standard sample;
the data sampling module can perform data sampling on the N types of samples, select 1 type of the N types of samples as a reference sample, calculate the similarity between the N-1 type of samples and the reference sample through template matching, select the first M samples with the highest similarity in each sample set of the N-1 type of samples as a batch size, and perform sampling in the step S2 in a circulating manner;
the network structure module consists of a plurality of convolution layers, a pooling layer and a full-connection layer, can realize the constraint of network parameters and loss functions, and can input sample parameters into the network structure module;
the network verification and test module can perform network verification and test on the sample parameters to obtain a prediction result;
wherein the loss function is an L2-softmax loss function, and the formula of the loss function is as follows:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011529220.5A CN112580650B (en) | 2020-12-22 | 2020-12-22 | Font classification prediction method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011529220.5A CN112580650B (en) | 2020-12-22 | 2020-12-22 | Font classification prediction method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112580650A CN112580650A (en) | 2021-03-30 |
CN112580650B true CN112580650B (en) | 2023-04-07 |
Family
ID=75139027
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011529220.5A Active CN112580650B (en) | 2020-12-22 | 2020-12-22 | Font classification prediction method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112580650B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5644656A (en) * | 1994-06-07 | 1997-07-01 | Massachusetts Institute Of Technology | Method and apparatus for automated text recognition |
CN106650721A (en) * | 2016-12-28 | 2017-05-10 | 吴晓军 | Industrial character identification method based on convolution neural network |
CN108664996A (en) * | 2018-04-19 | 2018-10-16 | 厦门大学 | A kind of ancient writing recognition methods and system based on deep learning |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11720790B2 (en) * | 2019-05-22 | 2023-08-08 | Electronics And Telecommunications Research Institute | Method of training image deep learning model and device thereof |
-
2020
- 2020-12-22 CN CN202011529220.5A patent/CN112580650B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5644656A (en) * | 1994-06-07 | 1997-07-01 | Massachusetts Institute Of Technology | Method and apparatus for automated text recognition |
CN106650721A (en) * | 2016-12-28 | 2017-05-10 | 吴晓军 | Industrial character identification method based on convolution neural network |
CN108664996A (en) * | 2018-04-19 | 2018-10-16 | 厦门大学 | A kind of ancient writing recognition methods and system based on deep learning |
Non-Patent Citations (2)
Title |
---|
Adaptive text recognition through visual matching;Chunhan Zhang et al.;《arXiv[cs.CV]》;20200914;第1-28页 * |
车牌字符识别算法研究;张倩蓓;《中国优秀博硕士学位论文全文数据库(硕士)工程科技Ⅱ辑》;20190815(第8期);第C034-169页 * |
Also Published As
Publication number | Publication date |
---|---|
CN112580650A (en) | 2021-03-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110443143B (en) | Multi-branch convolutional neural network fused remote sensing image scene classification method | |
CN107330127B (en) | Similar text detection method based on text picture retrieval | |
CN109063724B (en) | Enhanced generation type countermeasure network and target sample identification method | |
CN109671070B (en) | Target detection method based on feature weighting and feature correlation fusion | |
CN109800811A (en) | A kind of small sample image-recognizing method based on deep learning | |
CN108229588B (en) | Machine learning identification method based on deep learning | |
US20200134382A1 (en) | Neural network training utilizing specialized loss functions | |
CN107220641A (en) | A kind of multi-language text sorting technique based on deep learning | |
CN114241273A (en) | Multi-modal image processing method and system based on Transformer network and hypersphere space learning | |
CN110114776A (en) | Use the system and method for the character recognition of full convolutional neural networks | |
CN109344856B (en) | Offline signature identification method based on multilayer discriminant feature learning | |
CN111652273B (en) | Deep learning-based RGB-D image classification method | |
CN113128369A (en) | Lightweight network facial expression recognition method fusing balance loss | |
CN110110845B (en) | Learning method based on parallel multi-level width neural network | |
CN103366151B (en) | Hand-written character recognition method and equipment | |
CN107967497A (en) | Manuscripted Characters Identification Method based on convolutional neural networks and extreme learning machine | |
CN110414587A (en) | Depth convolutional neural networks training method and system based on progressive learning | |
CN110363830B (en) | Element image generation method, device and system | |
CN115270752A (en) | Template sentence evaluation method based on multilevel comparison learning | |
CN109766918A (en) | Conspicuousness object detecting method based on the fusion of multi-level contextual information | |
CN106355210A (en) | Method for expressing infrared image features of insulators on basis of depth neuron response modes | |
CN112580650B (en) | Font classification prediction method and system | |
CN113344110A (en) | Fuzzy image classification method based on super-resolution reconstruction | |
Zheng et al. | Segmentation-free multi-font printed Manchu word recognition using deep convolutional features and data augmentation | |
CN113065520A (en) | Multi-modal data-oriented remote sensing image classification method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 230088 21 / F, building A1, phase I, Zhongan chuanggu Science Park, No. 900, Wangjiang West Road, high tech Zone, Hefei, Anhui Applicant after: HEFEI HIGH DIMENSIONAL DATA TECHNOLOGY Co.,Ltd. Address before: 230088 9 / F, block C, building J2, phase II, innovation industrial park, 2800 innovation Avenue, hi tech Zone, Hefei City, Anhui Province Applicant before: HEFEI HIGH DIMENSIONAL DATA TECHNOLOGY Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |