CN112580650A - Font classification prediction method and system - Google Patents

Font classification prediction method and system Download PDF

Info

Publication number
CN112580650A
CN112580650A CN202011529220.5A CN202011529220A CN112580650A CN 112580650 A CN112580650 A CN 112580650A CN 202011529220 A CN202011529220 A CN 202011529220A CN 112580650 A CN112580650 A CN 112580650A
Authority
CN
China
Prior art keywords
network
samples
font classification
training
types
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.)
Granted
Application number
CN202011529220.5A
Other languages
Chinese (zh)
Other versions
CN112580650B (en
Inventor
田辉
刘其开
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei High Dimensional Data Technology Co ltd
Original Assignee
Hefei High Dimensional Data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei High Dimensional Data Technology Co ltd filed Critical Hefei High Dimensional Data Technology Co ltd
Priority to CN202011529220.5A priority Critical patent/CN112580650B/en
Publication of CN112580650A publication Critical patent/CN112580650A/en
Application granted granted Critical
Publication of CN112580650B publication Critical patent/CN112580650B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation 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/267Segmentation 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2431Multiple classes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/28Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet
    • G06V30/287Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet of Kanji, Hiragana or Katakana characters
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy 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 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, sampling data, namely selecting 1 type of the N types of samples as a reference sample set, 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 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

Font classification prediction method and system
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, carrying out data sampling on the N types of samples, namely selecting 1 type in 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 carrying out 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 to obtain a prediction classification result.
The font classification prediction method has the advantages of wide application prospect and stronger network generalization capability.
According to the font classification predicting method of an embodiment of the present invention, in step S1, the plurality of fonts include: song style, Song-imitating style, regular style and black body.
According to the font classification predicting method of an 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 predicting 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 a convolutional layer, a pooling layer and a full link layer.
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 predicting 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:
Figure BDA0002851713270000021
wherein f (x)i) The following constraints are satisfied for the feature vectors output by the network:
Figure BDA0002851713270000022
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:
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 prediction 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 the 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 the network training, and compared with the conventional random sampling, the sampling method in 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, performing 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 an 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.
In step S2, the method for predicting font classification according to an embodiment of the present invention includes the following steps: 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 includes the following specific steps: first, the batch size of the network training is determined, for example, the batch size may be set to 200; secondly, randomly selecting 20 samples in one type of font, and matching the first 10 samples which are closest to the remaining types of fonts on each sample by utilizing 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 employs a convolutional neural network. Specifically, the convolutional neural network is composed of convolutional layers, pooling layers, and fully-connected layers, and specifically, the convolutional layers 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, specifically, the formula of the loss function is as follows:
Figure BDA0002851713270000041
wherein f (x)i) The following constraints are satisfied for the feature vectors output by the network:
Figure BDA0002851713270000042
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:
Figure BDA0002851713270000051
where C is the number of categories classified.
Further, in the prior art, softmax loss is mostly adopted in the visual classification task, but softmax loss can only ensure that the learned font features are separable, and 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, L2-softmax is used as a 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 (7)

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 between the residual N-1 type of sample set and the reference sample set through template matching, selecting the first M samples as one batch size, and carrying out 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 to obtain a prediction classification result.
2. The font classification predicting method according to claim 1, wherein in step S1, the plurality of fonts include: song style, Song-imitating style, regular style and black body.
3. The font classification predicting method according to claim 1, wherein 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 full link 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. The font classification predicting method according to claim 1, wherein in step S3, the loss function is an L2-softmax loss function, and the formula of the loss function is as follows:
Figure FDA0002851713260000011
wherein f (x)i) The following constraints are satisfied for the feature vectors output by the network:
Figure FDA0002851713260000012
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.
7. A font classification prediction system, characterized in that the font classification prediction method according to any one of claims 1 to 6 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 circumscribed 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 as one batch size, and perform cyclic sampling training;
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;
and the network verification and test module can perform network verification and test on the sample parameters to obtain a prediction result.
CN202011529220.5A 2020-12-22 2020-12-22 Font classification prediction method and system Active CN112580650B (en)

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 true CN112580650A (en) 2021-03-30
CN112580650B 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 (4)

* Cited by examiner, † Cited by third party
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
US20200372350A1 (en) * 2019-05-22 2020-11-26 Electronics And Telecommunications Research Institute Method of training image deep learning model and device thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
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
US20200372350A1 (en) * 2019-05-22 2020-11-26 Electronics And Telecommunications Research Institute Method of training image deep learning model and device thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHUNHAN ZHANG ET AL.: "Adaptive text recognition through visual matching", 《ARXIV[CS.CV]》 *
张倩蓓: "车牌字符识别算法研究", 《中国优秀博硕士学位论文全文数据库(硕士)工程科技Ⅱ辑》 *

Also Published As

Publication number Publication date
CN112580650B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN113297975B (en) Table structure identification method and device, storage medium and electronic equipment
CN110443818B (en) Graffiti-based weak supervision semantic segmentation method and system
CN107330127B (en) Similar text detection method based on text picture retrieval
CN111582225B (en) Remote sensing image scene classification method and device
CN108229588B (en) Machine learning identification method based on deep learning
CN102147858B (en) License plate character identification method
CN107292225B (en) Face recognition method
CN114241273A (en) Multi-modal image processing method and system based on Transformer network and hypersphere space learning
CN111652273B (en) Deep learning-based RGB-D image classification method
CN107220641A (en) A kind of multi-language text sorting technique based on deep learning
CN111325237B (en) Image recognition method based on attention interaction mechanism
CN113642574A (en) Small sample target detection method based on feature weighting and network fine tuning
CN113128369A (en) Lightweight network facial expression recognition method fusing balance loss
CN106228166A (en) The recognition methods of character picture
CN110414587A (en) Depth convolutional neural networks training method and system based on progressive learning
CN114510594A (en) Traditional pattern subgraph retrieval method based on self-attention mechanism
CN115937873A (en) Online handwriting verification system and method based on recognizable single character
CN114926693A (en) SAR image small sample identification method and device based on weighted distance
CN111339932B (en) Palm print image preprocessing method and system
CN108229692B (en) Machine learning identification method based on dual contrast learning
Javed et al. Deep multiresolution cellular communities for semantic segmentation of multi-gigapixel histology images
CN113065520A (en) Multi-modal data-oriented remote sensing image classification method
CN112580650B (en) Font classification prediction method and system
Zheng et al. Segmentation-free multi-font printed Manchu word recognition using deep convolutional features and data augmentation
CN114387524B (en) Image identification method and system for small sample learning based on multilevel second-order representation

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

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.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant