WO2019232844A1 - 手写模型训练方法、手写字识别方法、装置、设备及介质 - Google Patents

手写模型训练方法、手写字识别方法、装置、设备及介质 Download PDF

Info

Publication number
WO2019232844A1
WO2019232844A1 PCT/CN2018/094173 CN2018094173W WO2019232844A1 WO 2019232844 A1 WO2019232844 A1 WO 2019232844A1 CN 2018094173 W CN2018094173 W CN 2018094173W WO 2019232844 A1 WO2019232844 A1 WO 2019232844A1
Authority
WO
WIPO (PCT)
Prior art keywords
chinese
chinese character
training
recognition model
sample
Prior art date
Application number
PCT/CN2018/094173
Other languages
English (en)
French (fr)
Inventor
孙强
周罡
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019232844A1 publication Critical patent/WO2019232844A1/zh

Links

Images

Classifications

    • 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/32Digital ink
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • 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
    • 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
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Definitions

  • the present application relates to the field of Chinese character recognition, and in particular, to a handwriting model training method, handwriting recognition method, device, device, and medium.
  • Traditional handwriting recognition methods mostly include binarization processing, character segmentation, feature extraction, and support vector machine recognition.
  • the traditional handwriting recognition methods are used to identify the more sloppy non-standard characters (handwritten Chinese characters). The degree is not high, which makes its recognition effect unsatisfactory.
  • Traditional handwriting recognition methods can only recognize standard characters to a large extent, and the accuracy rate is low when identifying various handwritings in real life.
  • the embodiments of the present application provide a handwriting model training method, a device, a device, and a medium to solve the problem that the current accuracy of handwriting recognition is not high.
  • a handwriting model training method includes:
  • Obtaining a normal Chinese character training sample inputting the normal Chinese character training sample into a bidirectional long-term and short-term memory neural network for training, and using a particle swarm algorithm to update network parameters of the bidirectional long-term and short-term memory neural network to obtain a normal Chinese character recognition model;
  • non-standard Chinese character training samples input the non-standard Chinese character training samples into the standard Chinese character recognition model for training, use particle swarm algorithm to update network parameters of the standard Chinese character recognition model, and obtain adjusted Chinese handwriting Word recognition model
  • the error word training sample is input to the adjusted Chinese handwriting recognition model for training, and a particle swarm algorithm is used to update and adjust network parameters of the Chinese handwriting recognition model to obtain a target Chinese handwriting recognition model.
  • a handwriting model training device includes:
  • a specification Chinese character recognition model acquisition module is used to obtain a specification Chinese character training sample, input the specification Chinese character training sample into a two-way long-term short-term memory neural network for training, and use a particle swarm algorithm to update the network of the two-way long-term short-term memory neural network. Parameters to obtain the standard Chinese character recognition model;
  • Adjust the Chinese handwriting recognition model acquisition module to obtain non-standard Chinese character training samples, input the non-standard Chinese character training samples into the standard Chinese character recognition model for training, and update the standard Chinese with a particle swarm algorithm Network parameters of the word recognition model to obtain and adjust the Chinese handwriting recognition model;
  • Error word training sample acquisition module which is used to obtain a sample of Chinese characters to be tested, and use the adjusted Chinese handwriting recognition model to identify the sample of Chinese characters to be tested, obtain error words that do not match the recognition result with the real result, and put all the errors Words as training samples for wrong words;
  • a target Chinese handwriting recognition model acquisition module is configured to input the error character training sample into the adjusted Chinese handwriting recognition model for training, and use a particle swarm algorithm to update and adjust network parameters of the Chinese handwriting recognition model to obtain the target Chinese Handwriting recognition model.
  • a computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor.
  • the processor executes the computer-readable instructions, the following steps are implemented:
  • Obtaining a normal Chinese character training sample inputting the normal Chinese character training sample into a bidirectional long-term and short-term memory neural network for training, and using a particle swarm algorithm to update network parameters of the bidirectional long-term and short-term memory neural network to obtain a normal Chinese character recognition model;
  • non-standard Chinese character training samples input the non-standard Chinese character training samples into the standard Chinese character recognition model for training, use particle swarm algorithm to update network parameters of the standard Chinese character recognition model, and obtain adjusted Chinese handwriting Word recognition model
  • the error word training sample is input to the adjusted Chinese handwriting recognition model for training, and a particle swarm algorithm is used to update and adjust network parameters of the Chinese handwriting recognition model to obtain a target Chinese handwriting recognition model.
  • One or more non-volatile readable storage media storing computer-readable instructions, which when executed by one or more processors, cause the one or more processors to perform the following steps:
  • Obtaining a normal Chinese character training sample inputting the normal Chinese character training sample into a bidirectional long-term and short-term memory neural network for training, and using a particle swarm algorithm to update network parameters of the bidirectional long-term and short-term memory neural network to obtain a normal Chinese character recognition model;
  • non-standard Chinese character training samples input the non-standard Chinese character training samples into the standard Chinese character recognition model for training, use particle swarm algorithm to update network parameters of the standard Chinese character recognition model, and obtain adjusted Chinese handwriting Word recognition model
  • the error word training sample is input to the adjusted Chinese handwriting recognition model for training, and a particle swarm algorithm is used to update and adjust network parameters of the Chinese handwriting recognition model to obtain a target Chinese handwriting recognition model.
  • the embodiments of the present application further provide a handwriting recognition method, device, device, and medium to solve the problem that the current handwriting recognition accuracy is not high.
  • a handwriting recognition method includes:
  • a target probability output value is obtained according to the output value and a preset Chinese semantic thesaurus, and a recognition result of the Chinese character to be recognized is obtained based on the target probability output value.
  • An embodiment of the present application provides a handwriting recognition device, including:
  • An output value acquisition module configured to acquire Chinese characters to be identified, identify the Chinese characters to be identified using a target Chinese handwriting recognition model, and obtain output values of the Chinese characters to be identified in the target Chinese handwriting recognition model;
  • the target Chinese handwriting recognition model is obtained by using the handwriting model training method;
  • a recognition result obtaining module is configured to obtain a target probability output value according to the output value and a preset Chinese semantic lexicon, and obtain a recognition result of the Chinese character to be recognized based on the target probability output value.
  • a computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor.
  • the processor executes the computer-readable instructions, the following steps are implemented:
  • a target probability output value is obtained according to the output value and a preset Chinese semantic thesaurus, and a recognition result of the Chinese character to be recognized is obtained based on the target probability output value.
  • One or more non-volatile readable storage media storing computer-readable instructions, which when executed by one or more processors, cause the one or more processors to perform the following steps:
  • a target probability output value is obtained according to the output value and a preset Chinese semantic thesaurus, and a recognition result of the Chinese character to be recognized is obtained based on the target probability output value.
  • FIG. 1 is an application environment diagram of a handwriting model training method according to an embodiment of the present application
  • FIG. 2 is a flowchart of a handwriting model training method according to an embodiment of the present application
  • FIG. 3 is a specific flowchart of step S10 in FIG. 2;
  • step S10 in FIG. 2 is another specific flowchart of step S10 in FIG. 2;
  • FIG. 5 is a specific flowchart of step S30 in FIG. 2;
  • FIG. 6 is a schematic diagram of a handwriting model training device according to an embodiment of the present application.
  • FIG. 7 is a flowchart of a handwriting recognition method according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a handwriting recognition device according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a computer device in an embodiment of the present application.
  • FIG. 1 illustrates an application environment of a handwriting model training method provided by an embodiment of the present application.
  • the application environment of the handwriting model training method includes a server and a client, wherein the server and the client are connected through a network, and the client is a device that can interact with the user, including, but not limited to, a computer and a smart phone.
  • the server can be implemented with an independent server or a server cluster consisting of multiple servers.
  • the handwriting model training method provided in the embodiment of the present application is applied to a server.
  • FIG. 2 shows a flowchart of a handwriting model training method according to an embodiment of the present application.
  • the handwriting model training method includes the following steps:
  • S10 Obtain a standard Chinese character training sample, input the standard Chinese character training sample into a two-way long and short-term memory neural network for training, and use a particle swarm algorithm to update the network parameters of the two-way long and short-term memory neural network to obtain a standard Chinese character recognition model.
  • the standard Chinese character training samples refer to training samples obtained according to standard standard characters (such as characters belonging to the fonts such as Kai, Song, or Lishu, and the general font selection is Kai or Song).
  • Bi-directional Long-Short-Term Memory (BILSTM) is a time-recursive neural network that is used to train sequence-specific data from two directions: sequence forward and sequence reverse.
  • the bidirectional long-term and short-term memory neural network can not only correlate pre-order data, but also post-order data. Therefore, it is possible to learn sequence-related deep features of the data according to the sequence context.
  • a recognition model corresponding to the data can be obtained.
  • PSO Particle Swarm Optimization
  • a training sample of standard Chinese characters is obtained, and the training sample is obtained from a standard standard word that belongs to a Chinese font such as Kai, Song, or Lishu.
  • a standard standard word that belongs to a Chinese font such as Kai, Song, or Lishu.
  • Song is used as an example for description.
  • the standard word here refers to the characters that belong to the current mainstream fonts in Chinese fonts, such as the default font Songti in the input method of computer equipment, and the commonly used characters in the mainstream fonts of Lintong. Chinese characters that are less commonly used, such as cursive characters and young round characters, are not included in the scope of this standard.
  • the normal Chinese character training samples are input to the bidirectional long-term and short-term memory neural network for training, and the particle swarm algorithm is used to update the network parameters of the bidirectional long-term and short-term memory neural network to obtain the normal Chinese character recognition model.
  • the standard Chinese character recognition model learns the deep features of standard Chinese character training samples during the training process, which enables the model to accurately recognize standard standard characters and has the ability to recognize standard standard characters.
  • S20 Obtain non-standard Chinese character training samples, input the non-standard Chinese character training samples into the standard Chinese character recognition model for training, use particle swarm algorithm to update the network parameters of the standard Chinese character recognition model, and obtain the adjusted Chinese handwriting recognition model.
  • the non-standard Chinese character training sample refers to a training sample obtained based on handwritten Chinese characters.
  • the handwritten Chinese characters may specifically be characters obtained by handwriting according to the font form of standard normal characters corresponding to the fonts such as Kai, Song, or Lishu. Understandably, the difference between this non-standard Chinese character training sample and the normal Chinese character training sample is that the non-standard Chinese character training sample is obtained by handwriting Chinese characters. Since it is handwritten, it certainly contains a variety of different fonts. form.
  • the server obtains a non-standardized Chinese character training sample, and the training sample contains the characteristics of handwritten Chinese characters.
  • the non-standardized Chinese character training sample is inputted into the standard Chinese character recognition model for training and adjustment, and a particle swarm algorithm is used. Update the network parameters of the character recognition model in the specification to obtain and adjust the Chinese handwriting recognition model.
  • the standard Chinese character recognition model has the ability to recognize Chinese characters in the standard specification, but it does not have high recognition accuracy when recognizing handwritten Chinese characters. Therefore, in this embodiment, non-standard Chinese character training samples are used for training, so that the standard Chinese handwriting recognition model can adjust the parameters in the model based on the existing standard characters of the recognition standard to obtain and adjust the Chinese handwriting recognition model.
  • the adjusted Chinese handwriting recognition model learns the deep features of handwritten Chinese characters on the basis of the original recognition of standard and standardized characters, so that the adjusted Chinese handwriting recognition model combines the deep features of standard and handwritten Chinese characters, and can simultaneously regulate the standard specifications. Characters and handwritten Chinese characters are effectively recognized, and recognition results with higher accuracy are obtained.
  • bidirectional long-term and short-term memory neural networks perform character recognition, they are judged based on the pixel distribution of the characters.
  • this difference is compared with other non-corresponding standard characters.
  • the difference is much smaller, for example, there is a difference in pixel distribution between the "I” of handwritten Chinese characters and the "I” of standard canonical characters, but this difference is compared with the handwritten Chinese characters "you" and the standard canonical characters "I”
  • the difference is significantly smaller. It can be considered that even if there is a certain difference between the handwritten Chinese characters and the corresponding standard standard words, this difference is much smaller than the non-corresponding standard standard words.
  • the adjusted Chinese handwriting recognition model is trained by a two-way long-term and short-term memory neural network.
  • the model combines standard canonical characters and deep features of handwritten Chinese characters, and can effectively recognize handwritten Chinese characters based on the deep features.
  • step S10 is performed first and then step S20 is performed.
  • step S20 is performed.
  • training the bidirectional long-term and short-term memory neural network using the standard Chinese training samples can make the obtained standard Chinese character recognition model have better recognition ability, and make it have accurate recognition results for standard standard words.
  • the fine-tuning of step S20 is performed, so that the adjusted Chinese handwriting recognition model obtained by training can effectively recognize handwritten Chinese characters based on the deep features of the learned handwritten Chinese characters, and make them handwritten. Chinese character recognition has more accurate recognition results.
  • step S20 is performed first or only step S20, because there are various forms of handwritten Chinese characters, the features learned by directly using handwritten Chinese characters training do not reflect the characteristics of handwritten Chinese characters well, which will make the model at the beginning Studying is "bad", which makes it difficult to make accurate recognition results for handwritten Chinese character recognition.
  • each person's handwritten Chinese characters are different, most of them are similar to standard Chinese characters (such as handwritten Chinese characters imitating standard Chinese characters). Therefore, at the beginning, model training based on standard and standardized words is more in line with the objective situation, and it is more effective than model training directly on handwritten Chinese characters. You can make corresponding adjustments under the "good” model to obtain the recognition rate of handwritten Chinese characters Highly adjusted Chinese handwriting recognition model.
  • the Chinese characters to be tested refer to the training samples obtained for testing according to the standard Chinese characters and handwritten Chinese characters.
  • the standard Chinese characters used in this step are the same as the standard Chinese characters used for training in step S10 (because For example, each character corresponding to a font such as Kai font, Song font is uniquely determined); the handwritten Chinese character used may be different from the handwritten Chinese character used for training in step S20 (Chinese characters written by different people are incomplete) Similarly, each character corresponding to handwritten Chinese characters can correspond to multiple font forms. In order to distinguish it from the non-standard Chinese character training samples used for training in step S20 and avoid the situation of model training overfitting, this step is generally used Handwritten Chinese characters different from step S20).
  • the trained adjusted Chinese handwriting recognition model is used to identify a sample of Chinese characters to be tested.
  • the sample of Chinese characters to be tested includes standard canonical characters and their pre-set label values (that is, real results), and handwriting. Chinese characters and their preset label values.
  • standard and handwritten Chinese characters can be input to the Chinese handwriting recognition model in a mixed manner.
  • the adjusted Chinese handwriting recognition model is used to recognize the text samples in the test, the corresponding recognition results will be obtained, and all error words that do not match the recognition result with the label value (real result) will be used as the error word training samples.
  • the error word training sample reflects that the Chinese character handwriting recognition model still has insufficient recognition accuracy. In order to further update and optimize the Chinese handwriting recognition model based on the error word training sample.
  • the network parameters are first updated with the standard Chinese character training samples, and then the non-standard Chinese character training samples are used to update
  • the acquired adjusted Chinese handwriting recognition model will over-learn the characteristics of non-standard Chinese character training samples, so that the obtained adjusted Chinese handwriting recognition model will train non-standard Chinese character training samples (including handwritten Chinese characters).
  • step S30 uses the Chinese character samples to be tested to adjust Chinese handwriting recognition model for recognition can largely eliminate over-learning of non-standard Chinese character training samples used in training. That is, by adjusting the Chinese handwriting recognition model to identify the samples of the text to be tested to find the error caused by over-learning, the error can be specifically reflected by the error word, so the Chinese handwriting can be further updated and optimized based on the error word. Network parameters of the word recognition model.
  • S40 Input the training samples of the wrong characters into the adjusted Chinese handwriting recognition model for training, and use the particle swarm algorithm to update and adjust the network parameters of the Chinese handwriting recognition model to obtain the target Chinese handwriting recognition model.
  • an error character training sample is input to the adjusted Chinese handwriting recognition model for training, and the error word training sample reflects the characteristics of the non-standard Chinese character training sample due to excessive learning during training and adjustment of the Chinese handwriting recognition model. , Resulting in an inaccurate recognition problem when adjusting the Chinese handwriting recognition model to recognize handwritten Chinese characters other than non-standard Chinese character training samples.
  • the reason that the standard Chinese character training samples are used first and then the non-standard Chinese character training samples are used to train the model will excessively weaken the characteristics of the standard word that was originally learned, which will affect the initial establishment of the model to recognize the standard word. frame".
  • the use of error word training samples can well solve the problems of over-learning and over-weakening.
  • the particle swarm algorithm is used for training using the error word training samples, and the network parameters of the Chinese handwriting recognition model are updated and adjusted according to the algorithm to obtain the target Chinese handwriting recognition model.
  • the target Chinese handwriting recognition model refers to the final Trained models that can be used to recognize Chinese handwriting.
  • the two-way long-term and short-term memory neural network used in the training of the above models can combine the sequence characteristics of Chinese characters and learn the deep features of Chinese characters from the perspective of the sequence's forward and reverse. Chinese handwriting for recognition.
  • the normalized Chinese character training model is used to train and obtain the normalized Chinese character recognition model, and then the non-standardized Chinese character is used to update the standardized Chinese character recognition model to make the adjusted Chinese handwriting recognition model obtained after the update.
  • the deep features of handwritten Chinese characters are learned through training and updating, so that the adjusted Chinese handwriting recognition model can better recognize handwritten Chinese characters.
  • adjust the Chinese handwriting recognition model to identify the text samples to be tested, obtain the wrong words that do not match the recognition results, and input all the wrong words as training examples of the wrong words into the adjusted Chinese handwriting recognition model for training updates. Get the target Chinese handwriting recognition model.
  • the use of error word training samples can largely eliminate the adverse effects caused by over-learning and over-weakening during the original training process, and can further optimize the recognition accuracy.
  • the network parameter update of each model uses the particle swarm algorithm. This algorithm can perform global random optimization. In the initial stage of training, it can find the convergence field of the optimal solution, and then converge in the convergence field of the optimal solution.
  • the optimal solution is to find the minimum value of the error function to effectively update the network parameters of the bidirectional long-term and short-term memory neural network.
  • step S10 obtaining a training sample of standard Chinese characters includes the following steps:
  • S101 Obtain a pixel value feature matrix of each Chinese character in a training sample of Chinese characters to be processed, normalize each pixel value in the pixel value feature matrix, and obtain a normalized pixel value feature matrix of each Chinese character.
  • the formula for normalization processing is MaxValue is the maximum pixel value in the pixel value feature matrix of each Chinese character, MinValue is the minimum pixel value in the pixel value feature matrix of each Chinese character, x is the pixel value before normalization, and y is the normalization The pixel value after the transformation.
  • the Chinese character training samples to be processed refer to the initially acquired, unprocessed training samples.
  • a pixel value feature matrix of each Chinese character in the Chinese character training sample to be processed is obtained.
  • Each pixel value feature matrix represents the feature of the corresponding word.
  • the pixel value is used to represent the feature of the word. Since the word is based on Two-dimensional representation (generally a word is represented by an m ⁇ n image), so pixel values can be represented by a matrix, that is, a pixel value feature matrix is formed.
  • the computer device can recognize the form of the pixel value characteristic matrix and read the value in the pixel value characteristic matrix.
  • the server uses the formula of normalization processing to normalize each pixel value in the feature matrix to obtain the normalized pixel value feature.
  • the normalized processing method can be used to compress each pixel value feature matrix within the same range, speed up the calculation related to the pixel value feature matrix, and help improve the text recognition model in the training specification. Training efficiency.
  • S102 Divide the pixel values in the normalized pixel value feature matrix of each Chinese character into two types of pixel values, establish a binary pixel value feature matrix of each Chinese character based on the two types of pixel values, and divide each Chinese character The combination of the binarized pixel feature matrix is used as the standard Chinese character training sample.
  • the pixel values in the normalized pixel value feature matrix are divided into two types of pixel values.
  • the two types of pixel values refer to that the pixel values include only the pixel value A or the pixel value B.
  • a pixel value greater than or equal to 0.5 in the normalized pixel feature matrix can be taken as 1
  • a pixel value less than 0.5 can be taken as 0 to establish a corresponding binarized pixel value feature matrix
  • the binarized pixel feature The original in the matrix contains only 0 or 1.
  • the Chinese character combination corresponding to the binarized pixel value feature matrix is used as a standard Chinese character training sample.
  • the feature representation of words can be further simplified by establishing a binary pixel value feature matrix, and each Chinese character can be represented and distinguished by using only a matrix of 0 and 1, which can improve the computer's processing of the features of the word The speed of the matrix further improves the training efficiency of the text recognition model in the training specification.
  • Steps S101-S102 normalize the Chinese character training samples to be processed and divide the two types of values, obtain the binary pixel value feature matrix of each Chinese character, and binarize the pixel value features of each Chinese character
  • the words corresponding to the matrix are used as training samples for Chinese characters in the specification, which can significantly shorten the time for training the character recognition model in the specification.
  • step S10 training samples of standard Chinese characters are input to a two-way long-term and short-term memory neural network for training, and a particle swarm algorithm is used to update network parameters of the two-way long-and-short-term memory neural network to obtain
  • the text recognition model in the specification includes the following steps:
  • S111 The normal Chinese character training samples are input into the bidirectional long-term and short-term memory neural network in sequence and forward, and the positive output F o is obtained .
  • the normal Chinese character training samples are input into the bidirectional long-term and short-term memory neural network in sequence and obtained.
  • the reverse output B o is obtained by adding the forward output and the reverse output to obtain the forward output T o .
  • the bidirectional long-short-term memory neural network model includes an input layer, an output layer, and a hidden layer.
  • Hidden layers include input gates, forget gates, output gates, neuron states, and hidden layer outputs.
  • the forget gate determines the information to be discarded in the neuron state.
  • the input gate determines the information to be added to the neuron.
  • the output gate determines the information to be output in the neuron.
  • the state of the neuron determines the information discarded, added, and output by each gate, which is specifically expressed as the weight of the connection with each gate.
  • the hidden layer output determines the connection weight of the next layer (hidden layer or output layer) connected to the hidden layer.
  • the network parameters of the bidirectional long-term and short-term memory neural network model refer to the weights and biases of the connections between neurons in the neural network model.
  • the network parameters determine the nature of the network, so that the network has a sequence memory function.
  • Input bidirectional long-term and short-term memory The data of the neural network is calculated and processed to obtain corresponding output.
  • the network parameters mentioned in this embodiment take weight values as an example.
  • the offset is updated and adjusted in the same manner as the method of updating weights, and the bias is not described in detail again.
  • the training samples of standard Chinese characters are input to the bidirectional long-term and short-term memory neural network for training.
  • the training samples of standard Chinese characters are processed in the bidirectional long-term and short-term memory neural network through response processing of network parameters, and the output values of each layer of the network are calculated respectively.
  • neuron states also known as cell states
  • Through specially set neurons according to the neuron records and indicates the hidden layer to which the neuron belongs. State) output and hidden layer output.
  • three kinds of activation functions f (sigmoid), g (tanh), and h (softmax) are used when calculating the output.
  • the activation function can be used to transform the weight results into classification results, and it can add some non-linear factors to the neural network, so that the neural network can better solve more complex problems.
  • the data received and processed by the neurons in the bidirectional long-term short-term memory neural network includes: the input standard Chinese character training samples: X, neuron state: S.
  • the parameters mentioned below include: the input of the neuron is represented by a, and the output is represented by b.
  • the subscripts l, ⁇ , and w denote input gates, forget gates, and output gates, respectively.
  • t stands for time.
  • the weights of the neurons connected to the input gate, forget gate, and output gate are recorded as w cl , w c ⁇ , and w c ⁇ , respectively .
  • S c represents the state of the neuron.
  • I is the number of neurons in the input layer
  • H is the number of neurons in the hidden layer
  • C is the number of neurons corresponding to the state of the neuron (i is the i-th neuron in the input layer, and h is the hidden layer Hth neuron
  • c represents the neuron corresponding to the state of the cth neuron).
  • the input gate receives the input samples at the current time (the input specification Chinese character training samples)
  • the output value b t-1 h at the previous moment and the neuron state S t-1 c at the previous moment are connected by the input specification Chinese character training sample and the input gate weight w il , and the output value at the previous moment and
  • Oblivion gate receives samples at current moment
  • the output value b t-1 h at the previous moment and the state data S t-1 c at the previous moment are connected by inputting the weights w i ⁇ of the training sample of the Chinese character in the specification and the forget gate, and connecting the output value at the previous moment with The weight of the forgetting gate w h ⁇ and the weight of the connecting neuron and the forgetting gate w c ⁇ , according to the formula Calculate the output of the forget gate Apply activation function f to By formula A 0-1 interval scalar is obtained. This scalar controls the proportion of the past information that the neuron has forgotten according to the comprehensive judgment of the current state and the past state.
  • Neurons receive samples at the current moment
  • Item in Indicates the status of the hidden layer, which is needed when updating network parameters.
  • Output gate receives samples at the current moment The output value b t-1 h at the previous moment and the state of the neuron at the current moment
  • the output value b t-1 h at the previous moment and the state of the neuron at the current moment By connecting the input text training samples in the specification with the weights w iw of the output gates, the output values at the last moment and the weights w hw of the output gates, and the weights w cw connecting the neurons and the output gates, according to the formula Calculate the output of the output gate Apply activation function f to Formula by Get a scalar in the range 0-1.
  • Hidden layer output Output based on output gate processed with activation function And the neuron state can be obtained and expressed by the formula: Calculated.
  • the output of each layer of the long-term and short-term memory neural network model can be obtained from the above calculation of the text training samples in the specification between the layers.
  • the output values include forward output and reverse output, which are represented by F o and B o (F o is Forward output, and B o is Backward output).
  • the samples are forwardly input to the bidirectional long-term and short-term memory neural network according to the sequence, and the positive output F o is obtained .
  • the normal Chinese character training samples are input to the two-way long-term and short-term memory neural network in order, and the reverse output B o is obtained .
  • the sequence forward indicates from the first column to the N-th column
  • the sequence reverse indicates that from the N-th column to the first column.
  • the output value of the output layer before adding the output T o i.e. Total output
  • the forward output shows the output of the input standard Chinese text training samples after the response processing of the network parameters, and the errors caused during the training process can be measured according to the forward output and the real results in order to update the network parameters according to the errors.
  • S112 Construct an error function according to the forward output and the real result.
  • the expression of the error function is Among them, N represents the total number of samples of the text training samples in the specification, x i represents the forward output of the i-th training sample, and y i represents the real result of the i-th training sample corresponding to x i .
  • the real result is the objective fact (also called the label value), which is used to calculate the error from the forward output.
  • the bidirectional long-short-term memory neural network processes an error in the forward output obtained from processing the Chinese character training samples in the specification and the real result
  • a corresponding error function can be constructed according to the error in order to use the error function.
  • Train the bidirectional long-term and short-term memory neural network and update the network parameters so that the updated network parameters can obtain the same or similar forward output as the real result when processing the input training samples.
  • an appropriate error function can be constructed according to the actual situation.
  • the error function constructed in this embodiment is Can better reflect the error between the forward output and the true result.
  • a particle swarm algorithm is used to update the network parameters of the bidirectional long-term and short-term memory neural network to obtain a standard Chinese character recognition model.
  • the particle swarm algorithm includes a particle position update formula (Equation 1) and particle velocity position update.
  • Equation 1 particle position update formula
  • Formula (Formula 2) the particle swarm algorithm is as follows:
  • V i + 1 w ⁇ V i + c1 ⁇ rand () ⁇ (pbest i -X i ) + c2 ⁇ rand () ⁇ (gbest-X i ) ------- (Formula 1)
  • c1 ⁇ rand () controls the step size of the particle to the optimal position.
  • c2 ⁇ rand () controls the step size of the particle to the optimal position for all particles;
  • w is the inertia bias; when the value of w is large, the particle swarm exhibits a strong ability of global optimization; when the value of w is small, the particle swarm performs It has a strong local optimization ability, which is very suitable for network training.
  • w is generally set to be large to ensure that it has a sufficiently large global optimization capability; in the convergence phase of training, w is generally set to be small to ensure that it can converge to the optimal solution.
  • the first term on the right side of the formula represents the original velocity term; the second term on the right side of the formula represents the "cognitive" part, which is mainly based on the historical optimal position of the particle and considering the effect on the position of the new particle. The process of self-thinking; the third term on the right side of the formula is the "social" part, which mainly considers the impact on the position of new particles based on the optimal position of all particles.
  • the whole formula (1) reflects a process of information sharing. If there is no first part, the update of the particle velocity depends only on the optimal position experienced by the particle and all particles, and the particle has strong convergence.
  • the first term on the right side of the formula ensures that the particle swarm has a certain global optimization ability and has the function of escaping the extreme value. On the contrary, if the part is small, the particle swarm will quickly converge.
  • the second term on the right side of the formula and the third term on the right side guarantee the local convergence of the particle swarm.
  • the particle swarm optimization algorithm is a global random optimization algorithm. Using this calculation formula, the convergence field of the optimal solution can be found in the initial stage of training, and then the convergence is performed in the convergence field of the optimal solution to obtain the optimal solution (i.e. Find the minimum of the error function).
  • the process of using the particle swarm algorithm to update the network parameters of the two-way long-term and short-term memory neural network specifically includes the following steps:
  • Steps S111-S113 can construct an error function according to the forward output obtained from the standard Chinese character training samples in a bidirectional long-term short-term memory neural network And according to the error function.
  • a normal Chinese character recognition model can be obtained. This model learns the deep features of the normal Chinese character training samples and can accurately identify the standard normal characters.
  • steps S20 and S40 of updating the network parameters by using the particle swarm algorithm refer to step S113. To avoid repetition, details are not described herein.
  • step S30 the Chinese handwriting recognition model is adjusted to identify the text samples to be tested, to obtain error words whose recognition results do not match the true results, and to use all the error words as training samples for the error words. , Including the following steps:
  • S31 Input the Chinese character sample to be tested into the adjusted Chinese handwriting recognition model, and obtain the output value of each character in the Chinese character sample to be tested in the adjusted Chinese handwriting recognition model.
  • the Chinese handwriting recognition model is adjusted to recognize the text samples to be tested, and the text samples to be tested include several Chinese characters.
  • the Chinese character library there are about 3,000 commonly used Chinese characters.
  • the probability value of the similarity between each character in the Chinese character library and the input Chinese character sample to be tested should be set.
  • the probability The value is the output value of each character in the text sample to be tested in the adjusted Chinese handwriting recognition model, which can be achieved by the softmax function. To put it simply, when the "I" character is input, the output value (represented by probability) corresponding to each character in the Chinese character library will be obtained in the adjustment of the Chinese handwriting recognition model, such as corresponding to the "I" in the Chinese character library.
  • the output value of is 99.5%, and the output values of the remaining words add up to 0.5%.
  • S32 Select the maximum output value among the output values corresponding to each word, and obtain the recognition result of each word according to the maximum output value.
  • a maximum output value among all output values corresponding to each word is selected, and a recognition result of the word can be obtained according to the maximum output value.
  • the output value directly reflects the similarity between the words in the input Chinese character sample to be tested and each character in the Chinese character library, and the maximum output value indicates that the sample of the character to be tested is closest to a word in the Chinese character library.
  • the recognition result of the word can be obtained. For example, the recognition result of the last output of the word "I" is "I".
  • the obtained recognition result is compared with a real result (objective fact), and an error word that does not match the recognition result with the real result is used as an error word training sample.
  • the recognition result is only the result recognized by the text training sample in the test under adjustment of the Chinese handwriting recognition model, and may be different from the real result, reflecting that the model still has accuracy in recognition. Shortcomings, and these shortcomings can be optimized by training samples of wrong words to achieve more accurate recognition results.
  • Steps S31-S33 adjust the output value of the Chinese handwriting recognition model according to each word in the text sample to be tested, and select the maximum output value that can reflect the degree of similarity between words from the output value; and then obtain the recognition result by the maximum output value According to the recognition results, the training samples of the wrong words are obtained, which provides an important technical premise for the subsequent use of the training samples of the wrong words to further optimize the recognition accuracy.
  • the handwriting model training method before step S10, that is, before the step of obtaining the text training samples in the specification, the handwriting model training method further includes the following steps: initializing a two-way long-term short-term memory neural network.
  • initializing a bidirectional long-term and short-term memory neural network initializes network parameters of the network, and assigns initial values to the network parameters. If the initialized weights are in a relatively flat area of the error surface, the convergence speed of bidirectional long-term short-term memory neural network model training may be abnormally slow.
  • the network parameters can be initialized to be uniformly distributed in a relatively small interval with a zero mean, such as in an interval such as [-0.30, + 0.30].
  • Reasonably initializing the bidirectional long-term and short-term memory neural network can make the network more flexible in the initial stage. It can effectively adjust the network during the training process. It can quickly and effectively find the minimum value of the error function, which is beneficial to the bidirectional length.
  • the update and adjustment of the memory neural network makes the model obtained based on the bidirectional long-term and short-term memory neural network for model training have accurate recognition effect when performing Chinese handwriting recognition.
  • the network parameters of the bidirectional long-term and short-term memory neural network are initialized and uniformly distributed in a relatively small interval with a zero mean, such as [-0.30, +0.30], using This initialization method can quickly and efficiently find the minimum value of the error function, which is conducive to the update and adjustment of the bidirectional long-term and short-term memory neural network.
  • a zero mean such as [-0.30, +0.30]
  • the network parameters are updated to obtain the normal Chinese character recognition model.
  • the model learns the deep features of the normal Chinese character training samples and can accurately identify the standard normal characters.
  • the non-standard Chinese characters are adjusted to update the standard Chinese character recognition model, so that the adjusted Chinese handwriting recognition model obtained after the update can learn non-standard Chinese by training and updating under the premise that it has the ability to recognize standard Chinese handwriting
  • the deep features of characters make it possible to adjust the Chinese handwriting recognition model to better recognize non-standard Chinese handwriting.
  • each model is trained using a bidirectional long-term and short-term memory neural network.
  • the neural network can combine the sequence characteristics of the word from the perspective of the sequence forward and the sequence reverse Starting, learn the deep features of the words and realize the function of recognizing different Chinese handwriting.
  • Each model uses the particle swarm algorithm when updating network parameters.
  • This algorithm can perform global random optimization, and can Find the convergence field of the optimal solution, and then converge in the convergence field of the optimal solution to get the optimal solution, find the minimum value of the error function, and update the network parameters.
  • the particle swarm algorithm can significantly improve the efficiency of model training, and effectively update network parameters, and improve the recognition accuracy of the obtained model.
  • FIG. 6 shows a principle block diagram of a handwriting model training device corresponding to the handwriting model training method in the embodiment.
  • the handwriting model training device includes a standard Chinese character recognition model acquisition module 10, an adjusted Chinese handwriting recognition model acquisition module 20, an error character training sample acquisition module 30, and a target Chinese handwriting recognition model acquisition module 40.
  • the implementation functions of the standard Chinese character recognition model acquisition module 10, adjusted Chinese handwriting recognition model acquisition module 20, error character training sample acquisition module 30, and target Chinese handwriting recognition model acquisition module 40 correspond to the handwriting model training method in the embodiment.
  • the steps correspond one by one. In order to avoid redundant description, this embodiment is not detailed one by one.
  • the standard Chinese character recognition model acquisition module 10 is used to obtain the standard Chinese character training samples, input the standard Chinese character training samples to the bidirectional long-term and short-term memory neural network for training, and use particle swarm algorithm to update the network parameters of the bidirectional long-term and short-term memory neural network. To get the standard Chinese character recognition model.
  • Adjust the Chinese handwriting recognition model acquisition module 20 to obtain non-standard Chinese character training samples, input non-standard Chinese character training samples into the standard Chinese character recognition model for training, and use particle swarm algorithm to update the network of the standard Chinese character recognition model Parameters to get adjusted Chinese handwriting recognition model.
  • Error word training sample acquisition module 30 which is used to obtain samples of the Chinese characters to be tested, adjust the Chinese handwriting recognition model to identify the samples of the Chinese characters to be tested, obtain error words that do not match the actual results, and train all error words as error words sample.
  • Target Chinese handwriting recognition model acquisition module 40 which is used to input the training samples of the wrong characters into the adjusted Chinese handwriting recognition model for training, and uses particle swarm algorithm to update and adjust the network parameters of the Chinese handwriting recognition model to obtain the target Chinese handwriting recognition model.
  • the standard Chinese character recognition model acquisition module 10 includes a normalized pixel value feature matrix acquisition unit 101, a standard Chinese character training sample acquisition unit 102, a forward output acquisition unit 111, an error function construction unit 112, and a standard Chinese character recognition model. Acquisition unit 113.
  • the normalized pixel value feature matrix obtaining unit 101 is configured to obtain a pixel value feature matrix of each Chinese character in a Chinese character training sample to be processed, and normalize each pixel value in the pixel value feature matrix to obtain each The normalized pixel value feature matrix of Chinese characters, where the formula for normalization processing is MaxValue is the maximum pixel value in the pixel value feature matrix of each Chinese character, MinValue is the minimum pixel value in the pixel value feature matrix of each Chinese character, x is the pixel value before normalization, and y is the normalization The pixel value after the transformation.
  • the standard Chinese character training sample obtaining unit 102 is configured to divide the pixel values in the normalized pixel value feature matrix of each Chinese character into two types of pixel values, and establish a binary pixel of each Chinese character based on the two types of pixel values. Value feature matrix, using the binarized pixel feature matrix of each Chinese character as the standard Chinese character training sample.
  • a forward output obtaining unit 111 is configured to input the normalized Chinese character training samples into the bidirectional long-term and short-term memory neural network in sequence and forward, and obtain the forward output F o , and input the normalized Chinese character training samples into the bidirectional length and inverse according to the sequence.
  • the reverse output B o is obtained , the forward output and the reverse output are added, and the forward output T o is obtained .
  • the error function constructing unit 112 is configured to construct an error function according to the forward output and the real result.
  • the expression of the error function is Among them, N represents the total number of training samples, x i represents the forward output of the i-th training sample, and y i represents the real result of the i-th training sample corresponding to x i .
  • the specification Chinese character recognition model acquisition unit 113 is configured to update the network parameters of the bidirectional long-term and short-term memory neural network by using a particle swarm algorithm based on the error function to obtain the specification Chinese character recognition model.
  • the error word training sample acquisition module 30 includes a model output value acquisition unit 31, a model recognition result acquisition unit 32, and an error word training sample acquisition unit 33.
  • the model output value acquiring unit 31 is configured to input a sample of the Chinese character to be tested into the adjusted Chinese handwriting recognition model, and obtain an output value of each character in the sample of the Chinese character to be tested in the adjusted Chinese handwriting recognition model.
  • the model recognition result obtaining unit 32 is configured to select a maximum output value among output values corresponding to each word, and obtain a recognition result of each word according to the maximum output value.
  • the error word training sample acquisition unit 33 is configured to obtain error words that do not match the recognition result according to the recognition result, and use all the error words as the error word training samples.
  • the handwriting model training device further includes an initialization module 50 for initializing a bidirectional long-term and short-term memory neural network.
  • FIG. 7 shows a flowchart of the handwriting recognition method in this embodiment.
  • the handwriting recognition method can be applied to computer equipment configured by banks, investment and insurance institutions, and is used to recognize handwritten Chinese characters to achieve the purpose of artificial intelligence. As shown in FIG. 7, the handwriting recognition method includes the following steps:
  • S50 Obtain the Chinese characters to be recognized, use the target Chinese handwriting recognition model to identify the Chinese characters to be recognized, and obtain the output values of the Chinese characters to be recognized in the target Chinese handwriting recognition model.
  • the target Chinese handwriting recognition model is trained using the handwriting model described above. Method.
  • the Chinese characters to be identified refer to Chinese characters to be identified.
  • the Chinese characters to be recognized are input, and the Chinese characters to be recognized are input into the target Chinese handwriting recognition model for recognition, and the output values of the Chinese characters to be recognized in the target Chinese handwriting recognition model are obtained, and one Chinese character to be identified corresponds to There are more than three thousand (the specific number is based on the Chinese character library) output value, and the recognition result of the Chinese character to be recognized can be determined based on the output value.
  • the Chinese characters to be recognized are specifically represented by a binary pixel value feature matrix that can be directly recognized by a computer.
  • S60 Obtain a target probability output value according to the output value and a preset Chinese semantic lexicon, and obtain a recognition result of the Chinese character to be recognized based on the target probability output value.
  • the preset Chinese semantic lexicon refers to a preset lexicon that describes the semantic relationship between Chinese words based on the word frequency. For example, in the Chinese semantic thesaurus, for the word “X Yang”, the probability of "Sun” appearing is 30.5%, the probability of "Dayang” appearing is 0.5%, and the rest such as “Sun” The sum of the probabilities of the two words of "Xyang” is 69%.
  • the target probability output value is a probability value obtained by combining the output value and a preset Chinese semantic lexicon to obtain the recognition result of the Chinese character to be recognized.
  • using the output value and the preset Chinese semantic thesaurus to obtain the target probability output value includes the following steps: (1) selecting the maximum value of the output value corresponding to each character in the Chinese character to be recognized as the first probability value, according to the first A probability value obtains a preliminary recognition result of the Chinese characters to be recognized. (2) Obtain the leftward semantic probability value and the rightward semantic probability value of the word to be recognized according to the preliminary recognition result and the Chinese semantic thesaurus. Understandably, for a text, the words in the text have a sequence, such as "red X Yang", for the "X" word, there are two words “red X” and "left X”. X Yang "corresponds to the probability value, that is, the left-side semantic probability value and the right-side semantic probability value.
  • the first 5 probability values represent the most likely 5 words (recognition results), and only the 5 words combined with the Chinese semantic thesaurus to calculate the target Probability output value, there are only five target probability output values, which can greatly improve the efficiency of recognition.
  • the output value and the preset Chinese semantic thesaurus accurate recognition results can be obtained. Understandably, for the recognition of a single character (non-text), the corresponding recognition result can be directly obtained according to the maximum value in the output value, without the need to add recognition based on Chinese semantics.
  • the target Chinese handwriting recognition model is used to recognize the Chinese characters to be recognized, and the output value and the preset Chinese semantic thesaurus are used to obtain the recognition results of the Chinese characters to be recognized.
  • the target Chinese handwriting recognition model itself has high recognition accuracy, combined with the Chinese semantic thesaurus to further improve the accuracy of Chinese handwriting recognition.
  • the Chinese characters to be recognized are input into the target Chinese handwriting recognition model for recognition, and the recognition result is obtained by combining with a preset Chinese semantic thesaurus.
  • the target Chinese handwriting recognition model is used to recognize Chinese handwriting, accurate recognition results can be obtained.
  • FIG. 8 shows a schematic block diagram of a handwriting recognition device corresponding to the handwriting recognition method in the embodiment.
  • the handwriting recognition device includes an output value acquisition module 60 and a recognition result acquisition module 70.
  • the implementation functions of the output value acquisition module 60 and the recognition result acquisition module 70 correspond to the steps corresponding to the handwriting recognition method in the embodiment. To avoid redundant description, this embodiment does not detail them one by one.
  • the handwriting recognition device includes an output value acquisition module 60 for obtaining the Chinese characters to be recognized, using the target Chinese handwriting recognition model to identify the Chinese characters to be recognized, and obtaining the output values of the Chinese characters to be recognized in the target Chinese handwriting recognition model;
  • the Chinese handwriting recognition model is obtained by using the handwriting model training method.
  • the recognition result obtaining module 70 is configured to obtain a target probability output value according to the output value and a preset Chinese semantic lexicon, and obtain a recognition result of the Chinese character to be recognized based on the target probability output value.
  • This embodiment provides one or more non-volatile readable storage media storing computer-readable instructions.
  • the computer-readable instructions are executed by one or more processors, the one or more processors are executed.
  • the handwriting model training method in the embodiment is implemented at this time. To avoid repetition, details are not repeated here.
  • the functions of each module / unit of the handwriting model training device in the embodiment are implemented when the one or more processors are executed. To avoid repetition, here No longer.
  • the functions of each step in the handwriting recognition method in the embodiment are implemented when the one or more processors are executed. One by one.
  • the functions of each module / unit in the handwriting recognition device in the embodiment are implemented when the one or more processors are executed. To avoid repetition, this I will not repeat them one by one.
  • FIG. 9 is a schematic diagram of a computer device according to an embodiment of the present application.
  • the computer device 80 of this embodiment includes a processor 81, a memory 82, and computer-readable instructions 83 stored in the memory 82 and executable on the processor 81.
  • the computer-readable instructions 83 are processed.
  • the device 81 implements the handwriting model training method in the embodiment when executed. To avoid repetition, details are not described here one by one.
  • the computer-readable instructions 83 are executed by the processor 81, the functions of each model / unit in the handwriting model training device in the embodiment are implemented. To avoid repetition, details are not described here one by one.
  • the computer-readable instructions 83 are executed by the processor 81, the functions of the steps in the handwriting recognition method in the embodiment are implemented. To avoid repetition, details are not described here one by one.
  • the computer-readable instructions 83 are executed by the processor 81, the functions of each module / unit in the handwriting recognition device in the embodiment are realized. To avoid repetition, we will not repeat them here.
  • the computer device 80 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the computer equipment may include, but is not limited to, a processor 81 and a memory 82.
  • FIG. 9 is only an example of the computer device 80 and does not constitute a limitation on the computer device 80. It may include more or fewer components than shown in the figure, or combine some components or different components.
  • computer equipment may also include input and output equipment, network access equipment, and buses.
  • the so-called processor 81 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 82 may be an internal storage unit of the computer device 80, such as a hard disk or a memory of the computer device 80.
  • the memory 82 may also be an external storage device of the computer device 80, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, and a flash memory card (Flash) provided on the computer device 80. Card) and so on.
  • the memory 82 may also include both an internal storage unit of the computer device 80 and an external storage device.
  • the memory 82 is used to store computer-readable instructions 83 and other programs and data required by the computer device.
  • the memory 82 may also be used to temporarily store data that has been or will be output.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Character Discrimination (AREA)

Abstract

本申请公开了一种手写模型训练方法、手写字识别方法、装置、设备及介质。该手写模型训练方法包括:获取规范中文字训练样本,将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型;获取并采用非规范中文字训练样本,训练获取调整中文手写字识别模型;获取并采用待测试中文字样本得到出错字训练样本;基于粒子群算法,采用出错字训练样本更新中文手写字识别模型的网络参数,获取目标中文手写字识别模型。采用该手写模型训练方法,能够得到识别手写字识别率高的目标中文手写字识别模型。

Description

手写模型训练方法、手写字识别方法、装置、设备及介质
本申请以2018年6月4日提交的申请号为201810564091.X,名称为“手写模型训练方法、手写字识别方法、装置、设备及介质”的中国专利申请为基础,并要求其优先权。
技术领域
本申请涉及中文字识别领域,尤其涉及一种手写模型训练方法、手写字识别方法、装置、设备及介质。
背景技术
传统手写字识别方法大多包括二值化处理、字符分割、特征提取和支持向量机等步骤进行识别,采用传统手写字识别方法在识别较为潦草的非规范字(手写中文字)时,识别的精确度不高,使得其识别效果不理想。传统手写字识别方法很大程度上只能识别规范字,对实际生活中各种各样的手写字进行识别时,准确率较低。
发明内容
本申请实施例提供一种手写模型训练方法、装置、设备及介质,以解决当前手写字识别准确率不高的问题。
一种手写模型训练方法,包括:
获取规范中文字训练样本,将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型;
获取非规范中文字训练样本,将所述非规范中文字训练样本输入到所述规范中文字识别模型中进行训练,采用粒子群算法更新所述规范中文字识别模型的网络参数,获取调整中文手写字识别模型;
获取待测试中文字样本,采用所述调整中文手写字识别模型识别所述待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本;
将所述出错字训练样本输入到所述调整中文手写字识别模型中进行训练,采用粒子群算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型。
一种手写模型训练装置,包括:
规范中文字识别模型获取模块,用于获取规范中文字训练样本,将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型;
调整中文手写字识别模型获取模块,用于获取非规范中文字训练样本,将所述非规范中文字训练样本输入到所述规范中文字识别模型中进行训练,采用粒子群算法更新所述规范中文字识别模型的网络参数,获取调整中文手写字识别模型;
出错字训练样本获取模块,用于获取待测试中文字样本,采用所述调整中文手写字识别模型识别所述待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本;
目标中文手写字识别模型获取模块,用于将所述出错字训练样本输入到所述调整中文手写字识别模型中进行训练,采用粒子群算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
获取规范中文字训练样本,将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型;
获取非规范中文字训练样本,将所述非规范中文字训练样本输入到所述规范中文字识别模型中进行训练,采用粒子群算法更新所述规范中文字识别模型的网络参数,获取调整中文手写字识别模型;
获取待测试中文字样本,采用所述调整中文手写字识别模型识别所述待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本;
将所述出错字训练样本输入到所述调整中文手写字识别模型中进行训练,采用粒子群算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型。
一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
获取规范中文字训练样本,将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型;
获取非规范中文字训练样本,将所述非规范中文字训练样本输入到所述规范中文字识别模型中进行训练,采用粒子群算法更新所述规范中文字识别模型的网络参数,获取调整中文手写字识别模型;
获取待测试中文字样本,采用所述调整中文手写字识别模型识别所述待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本;
将所述出错字训练样本输入到所述调整中文手写字识别模型中进行训练,采用粒子群算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型。
本申请实施例还提供一种手写字识别方法、装置、设备及介质,以解决当前手写字识别准确率不高的问题。
一种手写字识别方法,包括:
获取待识别中文字,采用目标中文手写字识别模型识别所述待识别中文字,获取所述待识别中文字在所述目标中文手写字识别模型中的输出值;所述目标中文手写字识别模型是采用所述手写模型训练方法获取到的;
根据所述输出值和预设的中文语义词库获取目标概率输出值,基于所述目标概率输出值获取所述待识别中文字的识别结果。
本申请实施例提供一种手写字识别装置,包括:
输出值获取模块,用于获取待识别中文字,采用目标中文手写字识别模型识别所述待识别中文字,获取所述待识别中文字在所述目标中文手写字识别模型中的输出值;所述目标中文手写字识别模型是采用所述手写模型训练方法获取到的;
识别结果获取模块,用于根据所述输出值和预设的中文语义词库获取目标概率输出值,基于所述目标概率输出值获取所述待识别中文字的识别结果。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
获取待识别中文字,采用目标中文手写字识别模型识别所述待识别中文字,获取所述待识别中文字在所述目标中文手写字识别模型中的输出值;所述目标中文手写字识别模型是采用上述手写模型训练方法获取到的;
根据所述输出值和预设的中文语义词库获取目标概率输出值,基于所述目标概率输出值获取所述待识别中文字的识别结果。
一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
获取待识别中文字,采用目标中文手写字识别模型识别所述待识别中文字,获取所述待识别中文字在所述目标中文手写字识别模型中的输出值;所述目标中文手写字识别模型是采用上述手写模型训练方法获取到的;
根据所述输出值和预设的中文语义词库获取目标概率输出值,基于所述目标概率输出值获取所述待识别中文字的识别结果。
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例中手写模型训练方法的一应用环境图;
图2是本申请一实施例中手写模型训练方法的一流程图;
图3是图2中步骤S10的一具体流程图;
图4是图2中步骤S10的另一具体流程图;
图5是图2中步骤S30的一具体流程图;
图6是本申请一实施例中手写模型训练装置的一示意图;
图7是本申请一实施例中手写字识别方法的一流程图;
图8是本申请一实施例中手写字识别装置的一示意图;
图9是本申请一实施例中计算机设备的一示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
图1示出本申请实施例提供的手写模型训练方法的应用环境。该手写模型训练方法的应用环境包括服务端和客户端,其中,服务端和客户端之间通过网络进行连接,客户端是可与用户进行人机交互的设备,包括但不限于电脑、智能手机和平板等设备,服务端具体可以用独立的服务器或者多个服务器组成的服务器集群实现。本申请实施例提供的手写模型训练方法应用于服务端。
如图2所示,图2示出本申请实施例中手写模型训练方法的一流程图,该手写模型训练方法包括如下步骤:
S10:获取规范中文字训练样本,将规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型。
其中,规范中文字训练样本是指根据标准规范字(如属于楷体、宋体或隶书等字体的字,一般字体选择楷体或者宋体)所获取的训练样本。双向长短时记忆神经网络(Bi-directional Long Short-Term Memory,简称BILSTM)是一种时间递归神经网络,用于从序列正向和序列反向两个方向训练具有序列特点的数据。双向长短时记忆神经网络不仅能够关联前序数据,还能关联后序数据,因此可以根据序列的前后关系学习数据的与序列相关的深层特征。将该具有序列特点的数据在双向长短时记忆神经网络模型训练,能够获取与该数据相对应的识别模型。粒子群算法(Particle Swarm Optimization,简称PSO)是一种全局随机寻优算法,在训练的初始阶段能找到最优解的收敛领域,然后在最优解的收敛领域中再进行收敛,得到最优解,即找到误差函数的极小值,实现对网络参数的有效更新。
本实施例中,获取规范中文字训练样本,该训练样本是由属于楷体、宋体或隶书等中文字体的标准规范字获取而来,本实施例中以宋体为例进行说明。可以理解地,这里的标准规范字是指属于目前中文字体中主流字体的字,如计算机设备的输入法中的默认字体宋体的字,常用于临摹的主流字体楷体的字等;而像日常生活中比较少使用的中文字体的字如草书的字、幼圆的字,则不列入该标准规范字的范围。在获取规范中文字训练样本后,将规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型。该规范中文字识别模型在训练过程中学习了规范中文字训练样本的深层特征,使得该模型能够对标准规范字进行精确的识别,具备对标准规范字的识别能力。需要说明的是,无论规范中文字训练样本采用的是楷体、宋体或隶书等其他中文字体对应的标准规范字,由于这些标准规范字在字体识别的层面上差别并不大,因此该规范中文字识别模型可以对楷体、宋体或隶书等字体对应的标准规范字进行精确的识别,得到较准确的识别结果。
S20:获取非规范中文字训练样本,将非规范中文字训练样本输入到规范中文字识别模型中进行训练,采用粒子群算法更新规范中文字识别模型的网络参数,获取调整中文手写字识别模型。
其中,非规范中文字训练样本是指根据手写中文字所获取的训练样本,该手写中文字具体可以是按照楷体、宋体或隶书等字体对应的标准规范字的字体形态通过手写方式得到的字。可以理解地,该非规范中文字训练样本与规范中文字训练样本的区别在于非规范中文字训练样本是由手写中文字所获取的,既然是手写的,当然就包含各种各样不同的字体形态。
本实施例中,服务端获取非规范中文字训练样本,该训练样本包含有手写中文字的特征,将非规范中文字训练样本输入到规范中文字识别模型中进行训练并调整,采用粒子群算法更新规范中文字识别模型的网络参数,获取调整中文手写字识别模型。可以理解地,规范中文字识别模型具备识别标准规范中文字的能力,但是在对手写中文字进行识别时并没有较高的识别精确度。因此本实施例采用非规范中文字训练样本进行训练,让规范中文手写字识别模型在已有识别标准规范字的基础上,对模型中的参数进行调整,获取调整中文手写字识别模型。该调整中文手写字识别模型在原本识别标准规范字的基础上学习手写中文字的深层特征,使得该调整中文手写字识别模型结合了标准规范字和手写中文字的深层特征,能够同时对标准规范字和手写中文字进行有效的识别,得到准确率较高的识别结果。
双向长短时记忆神经网络在进行字识别时,是根据字的像素分布进行判断的,在实际生活中的手写中文字与标准规范字存在差别,但是这种差别相比与其他不对应标准规范字的差别小很多的,例如,手写中文字的“我”和标准规范字的“我”在像素分布上存在差别,但是这种差别相比于手写中文字“你”和标准规范字“我”之间的差别明显小很多。可以这样认为,即使手写中文字与相对应的标准规范字之间存在一定的差别,但是这种差别与不相对应的标准规范字的差别小得多,因此,可以通过最相似(即差别最小)的原则确定识别结果。调整中文手写字识别模型是由双向长短时记忆神经网络训练而来的,该模型结合标准规范字和手写中文字的深层特征,能够根据该深层特征对手写中文字进行有效的识别。
需要说明的是,本实施例的步骤S10和步骤S20的顺序是不可调换的,先执行步骤S10再执行步骤S20。先采用规范中文训练样本训练双向长短时记忆神经网络可以使获取的规范中文字识别模型拥有较好的识别能力,使其对标准规范字有精确的识别结果。在拥有良好的识别能力的基础上再进行步骤S20的微调,使得训练获取的调整中文手写字识别模型能够根据学习到的手写中文字的深层特征对手写中文字进行有效的识别,使其对手写中文字识别有较精确的识别结果。若先执行步骤S20或只执行步骤S20,由于手写中文字有各种各样的形态,直接采用手写中文字训练学习到的特征并不能较好地反映手写中文字的特征,会使一开始模型就学“坏”,导致后来再怎么进行调整也难以使得对手写中文字识别有精确的识别结果。虽然每个人的手写中文字都不一样,但是极大部分都是与标准规范字相似(如手写中文字模仿标准规范字)。因此,一开始根据标准规范字进行模型训练更符合客观情况,要比直接对手写中文字进行模型训练的效果更好,可以在“好”的模型下进行相应的调整,获取手写中文字识别率高的调整中文手写字识别模型。
S30:获取待测试中文字样本,采用调整中文手写字识别模型识别待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有出错字作为出错字训练样本。
其中,待测试中文字样本是指根据标准规范字和手写中文字所获取的用于测试的训练样本,该步骤采用的标准规范字和步骤S10中用于训练的标准规范字是相同的(因为如楷体、宋体等字体所对应的每个字都是唯一确定的);采用的手写中文字与和步骤S20中用于训练的手写中文字可以是不同的(不同人手写的中文字是不完全相同的,手写中文字所对应的每个字可以对应多种字体形态,为了与步骤S20用于训练的非规范中文字训练样本区分开来,避免模型训练过拟合的情况,一般该步骤采用与步骤S20不同的手写中文字)。
本实施例中,将训练好的调整中文手写字识别模型用来识别待测试中文字样本,该待测试中文字样本包括标准规范字和其预先设置好的标签值(即真实结果),以及手写中文字和其预先设置好的标签值。训练时标准规范字和手写中文字可以是采用混合的方式输入到调整中文手写字识别模型。在采用调整中文手写字识别模型对待测试中文字样本进行识别时,将获取到相应的识别结果,把识别结果与标签值(真实结果)不相符的所有出错字作为出错字训练样本。该出错字训练样本反映调整中文字手写识别模型仍然存在识别精度不足的问题,以便后续根据该出错字训练样本进一步更新、优化调整中文手写字识别模型。
由于调整中文手写字识别模型的识别精度实际上受到规范中文字训练样本和非规范中文字训练样 本的共同影响,在先采用规范中文字训练样本更新网络参数,再采用非规范中文字训练样本更新网络参数的前提下,会导致获取到的调整中文手写字识别模型过度学习非规范中文字训练样本的特征,使得获取的调整中文手写字识别模型对非规范中文字训练样本(包括手写中文字)拥有非常高的识别精度,但却过度学习该非规范中文字样本的特征,影响除该非规范中文字训练样本以外的手写中文字的识别精度,因此,步骤S30采用待测试中文字样本对调整中文手写字识别模型进行识别,能够很大程度上消除训练时采用的非规范中文字训练样本的过度学习。即通过调整中文手写字识别模型识别待测试中文字样本,以找出由于过度学习而产生的误差,该误差具体可以通过出错字反映出来,因此能够根据该出错字进一步地更新、优化调整中文手写字识别模型的网络参数。
S40:将出错字训练样本输入到调整中文手写字识别模型中进行训练,采用粒子群算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型。
本实施例中,将出错字训练样本输入到调整中文手写字识别模型中进行训练,该出错字训练样本反映了在训练调整中文手写字识别模型时,由于过度学习非规范中文字训练样本的特征,导致调整中文手写字识别模型在识别非规范中文字训练样本以外的手写中文字时出现的识别不精确的问题。并且,由于先采用规范中文字训练样本再采用非规范中文字训练样本训练模型的原因,会过度削弱原先学习的标准规范字的特征,这会影响模型初始搭建的对标准规范字进行识别的“框架”。利用出错字训练样本可以很好地解决过度学习和过度削弱的问题,可以根据出错字训练样本反映的识别精确度上的问题,在很大程度上消除原本训练过程中产生的过度学习和过度削弱带来的不利影响。具体地,采用出错字训练样本进行训练时采用的是粒子群算法,根据该算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型,该目标中文手写字识别模型是指最终训练出来的可用于识别中文手写字的模型。
可以理解地,上述训练各个模型采用的双向长短时记忆神经网络能够结合中文字具有的序列特点,从序列的正向和序列的反向的角度出发,学习中文字的深层特征,实现对不同的中文手写字进行识别的功能。
步骤S10-S40中,采用规范中文字训练样本训练并获取规范中文字识别模型,再通过非规范中文字对规范中文字识别模型进行调整性的更新,使得更新后获取的调整中文手写字识别模型在具备识别标准规范字能力的前提下,通过训练更新的方式学习手写中文字的深层特征,使得调整中文手写字识别模型能够较好地识别手写中文字。然后采用调整中文手写字识别模型识别待测试中文字样本,获取识别结果与真实结果不相符的出错字,并将所有出错字作为出错字训练样本输入到调整中文手写字识别模型中进行训练更新,获取目标中文手写字识别模型。采用出错字训练样本可以在很大程度上消除原本训练过程中产生的过度学习和过度削弱带来的不利影响,能够进一步优化识别准确率。各模型进行网络参数更新采用的是粒子群算法,该算法能够进行全局随机寻优,在训练的初始阶段能找到最优解的收敛领域,然后在最优解的收敛领域中再进行收敛,得到最优解,求出误差函数的极小值,以对双向长短时记忆神经网络进行有效的网络参数更新。
在一实施例中,如图3所示,步骤S10中,获取规范中文字训练样本,具体包括如下步骤:
S101:获取待处理中文字训练样本中每个中文字的像素值特征矩阵,将像素值特征矩阵中每个像素值进行归一化处理,获取每个中文字的归一化像素值特征矩阵,其中,归一化处理的公式为
Figure PCTCN2018094173-appb-000001
MaxValue为每个中文字的像素值特征矩阵中像素值的最大值,MinValue为每个中文字的像素值特征矩阵中像素值的最小值,x为归一化前的像素值,y为归一化后的像素值。
其中,待处理中文字训练样本是指初始获取的,未经处理的训练样本。
本实施例中,获取待处理中文字训练样本中每个中文字的像素值特征矩阵,每个像素值特征矩阵代表着对应字的特征,在这里用像素值代表字的特征,由于字是基于二维表示的(一般一个字用一张m×n的图像表示),故像素值可以采用矩阵表示,即形成像素值特征矩阵。计算机设备能够识别像素值特征矩阵的形式,读取像素值特征矩阵中的数值。服务端获取像素值特征矩阵后,采用归一化处理的公式对特征矩阵中的每个像素值进行归一化处理,获取归一化像素值特征。本实施例中,采用归一化处理方式能够将每个像素值特征矩阵都压缩在同一个范围区间内,能够加快与该像素值特征矩阵相关的计算, 有助于提高训练规范中文字识别模型的训练效率。
S102:将每个中文字的归一化像素值特征矩阵中的像素值划分为两类像素值,基于两类像素值建立每个中文字的二值化像素值特征矩阵,将每个中文字的二值化像素特征矩阵组合作为规范中文字训练样本。
本实施例中,将归一化像素值特征矩阵中的像素值划分为两类像素值,该两类像素值是指像素值中只包含像素值A或者像素值B。具体地,可以将归一化像素特征矩阵中大于或等于0.5的像素值取为1,将小于0.5的像素值取为0,建立相应的二值化像素值特征矩阵,该二值化像素特征矩阵中的原始只包含0或1。在建立二值化像素值特征矩阵后,将二值化像素值特征矩阵对应的中文字组合作为规范中文字训练样本。例如,在一张包含字的图像中,包含字像素的部分和空白像素的部分。字上的像素值一般颜色会比较深,二值化像素值特征矩阵中的“1”代表字像素的部分,而“0”则代表图像中空白像素的部分。可以理解地,通过建立二值化像素值特征矩阵可以进一步简化对字的特征表示,仅采用0和1的矩阵就可以将每个中文字表示并区别开来,能够提高计算机处理关于字的特征矩阵的速度,进一步提高训练规范中文字识别模型的训练效率。
步骤S101-S102对待处理中文字训练样本进行归一化处理并进行二类值的划分,获取每个中文字的二值化像素值特征矩阵,并将每个中文字的二值化像素值特征矩阵对应的字作为规范中文字训练样本,能够显著缩短训练规范中文字识别模型的时长。
可以理解地,输入到双向长短时记忆神经网络进行训练的实际上是每个中文字对应的不同的二值化像素特征矩阵,每个中文字的二值化像素特征矩阵代表着每一个对应的中文字。中文字在空间分别上是有序列特征的,该特征同样能够在二值化像素特征矩阵中体现出来,因此,采用双向长短时记忆神经网络能够对每个中文字的二值化像素特征矩阵从序列前后相关性的角度出发,训练并学习中文字的深层特征。
在一实施例中,如图4所示,步骤S10中,将规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型,具体包括如下步骤:
S111:将规范中文字训练样本按序列正向输入到双向长短时记忆神经网络中,获取正向输出F o,将规范中文字训练样本按序列反向输入到双向长短时记忆神经网络中,获取反向输出B o,将正向输出和反向输出相加,获取前向输出T o,公式表示为T o=F o+B o
其中,双向长短时记忆神经网络模型包括输入层、输出层和隐藏层。隐藏层包括输入门、遗忘门、输出门、神经元状态和隐藏层输出。遗忘门决定了在神经元状态中所要丢弃的信息。输入门决定了在神经元中所要增加的信息。输出门决定了在神经元中所要输出的信息。神经元状态决定了各个门丢弃、增加和输出的信息,具体表示为与各个门之间连接的权值。隐藏层输出决定了与该隐藏层连接的下一层(隐藏层或输出层)的连接权值。双向长短时记忆神经网络模型的网络参数是指神经网络模型中神经元之间连接的权值和偏置,网络参数决定了网络的性质,使得网络具有序列上的记忆功能,输入双向长短时记忆神经网络的数据经过网络参数的计算处理得到相应的输出。本实施例提及的网络参数以权值为例,偏置在更新调整的阶段与更新权值的方法相同,不再对偏置进行赘述。
本实施例中,将规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,规范中文字训练样本在双向长短时记忆神经网络经过网络参数的响应处理,分别计算网络各层的输出值,包括计算规范中文字训练样本在隐藏层的输入门、遗忘门、输出门、神经元状态(又称细胞状态,通过专门设置的神经元,根据该神经元记录并表示该神经元所属隐藏层的状态)的输出以及隐藏层输出。其中,计算输出时采用的具体有三种激活函数f(sigmoid)、g(tanh)和h(softmax)。采用激活函数能够将权值结果转化成分类结果,能够给神经网络加入一些非线性因素,使得神经网络可以更好地解决较为复杂的问题。
双向长短时记忆神经网络中神经元所接收和处理的数据包括:输入的规范中文字训练样本:X, 神经元状态:S。此外,以下提及的参数还包括:神经元的输入用a表示,输出用b表示。下标l、φ和w分别表示输入门、遗忘门和输出门。t代表时刻。神经元跟输入门、遗忘门和输出门连接的权值分别记做w cl、w 和w 。S c表示神经元状态。I表示输入层的神经元的个数,H是隐藏层神经元的个数,C是神经元状态所对应的神经元的个数(i表示输入层的第i个神经元,h表示隐藏层的第h个神经元,c表示第c个神经元状态所对应的神经元)。
输入门接收当前时刻的输入样本(输入的规范中文字训练样本)
Figure PCTCN2018094173-appb-000002
上一时刻的输出值b t-1 h以及上一时刻神经元状态S t-1 c,通过连接输入的规范中文字训练样本与输入门的权值w il、连接上一时刻的输出值与输入门的权值w hl和连接神经元与输入门的权值w cl,根据公式
Figure PCTCN2018094173-appb-000003
计算得到输入门的输出
Figure PCTCN2018094173-appb-000004
将激活函数f作用于
Figure PCTCN2018094173-appb-000005
由公式
Figure PCTCN2018094173-appb-000006
得到一个0-1区间的标量。此标量控制了神经元根据当前状态和过去状态的综合判断所接收当前信息的比例。
遗忘门接收当前时刻的样本
Figure PCTCN2018094173-appb-000007
上一时刻的输出值b t-1 h以及上一时刻的状态数据S t-1 c,通过连接输入的规范中文字训练样本与遗忘门的权值w 、连接上一时刻的输出值与遗忘门的权值w 和连接神经元与遗忘门的权值w ,根据公式
Figure PCTCN2018094173-appb-000008
计算得到遗忘门的输出
Figure PCTCN2018094173-appb-000009
将激活函数f作用于
Figure PCTCN2018094173-appb-000010
由公式
Figure PCTCN2018094173-appb-000011
得到一个0-1区间的标量,此标量控制了神经元根据当前状态和过去状态的综合判断所遗忘过去信息的比例。
神经元接收当前时刻的样本
Figure PCTCN2018094173-appb-000012
上一时刻的输出值b t-1 h以及上一时刻的状态数据S t-1 c、连接神经元与输入的规范中文字训练样本的权值w ic、连接神经元与上一时刻的输出值的权值w hc,以及输入门、遗忘门的输出标量,根据式
Figure PCTCN2018094173-appb-000013
Figure PCTCN2018094173-appb-000014
计算当前时刻的神经元状态
Figure PCTCN2018094173-appb-000015
其中,式
Figure PCTCN2018094173-appb-000016
中的项
Figure PCTCN2018094173-appb-000017
表示隐藏层状态,在更新网络参数的时候需要用到。
输出门接收当前时刻的样本
Figure PCTCN2018094173-appb-000018
上一时刻的输出值b t-1 h以及当前时刻的神经元状态
Figure PCTCN2018094173-appb-000019
通过连接输入的规范中文字训练样本与输出门的权值w iw、连接上一时刻的输出值与输出门的权值w hw以及连接神经元与输出门的权值w cw,根据公式
Figure PCTCN2018094173-appb-000020
计算输出门的输出
Figure PCTCN2018094173-appb-000021
将 激活函数f作用于
Figure PCTCN2018094173-appb-000022
上由公式
Figure PCTCN2018094173-appb-000023
得到一个0-1区间的标量。
隐藏层输出
Figure PCTCN2018094173-appb-000024
根据采用激活函数处理后的输出门的输出
Figure PCTCN2018094173-appb-000025
和神经元状态可以求得,用公式表示为
Figure PCTCN2018094173-appb-000026
计算得出。由上述对规范中文字训练样本在各层间的计算可获取长短时记忆神经网络模型各层的输出值。
根据以上的计算处理过程,我们可以一层层地计算双向长短时记忆神经网络中每一层的输出,并获得最后输出层的输出值。由于该神经网络是双向的,因此输出值包括正向输出和反向输出,分别用F o和B o表示(F o即Forward output,B o即Backward output),具体地,将规范中文字训练样本按序列正向输入到双向长短时记忆神经网络中,获取正向输出F o,将规范中文字训练样本按序列反向输入到双向长短时记忆神经网络中,获取反向输出B o。可以理解地,假设特征矩阵有N列,则序列正向表示从第1列到第N列,序列反向表示从第N列到第1列。输出层的输出值即前向输出T o(即Total output),将正向输出和反向输出相加即可获取前向输出T o,用公式表示为T o=F o+B o。该前向输出展现了输入的规范中文字训练样本经过网络参数的响应处理后得到的输出,可以根据该前向输出与真实结果衡量训练过程中造成的误差,以便根据误差更新网络参数。
S112:根据前向输出和真实结果构建误差函数,误差函数的表达式为
Figure PCTCN2018094173-appb-000027
其中,N表示规范中文字训练样本的样本总数,x i表示第i个训练样本的前向输出,y i表示与x i相对应的第i个训练样本的真实结果。
其中,真实结果即客观事实(又称为标签值),用于计算与前向输出的误差。
本实施例中,由于双向长短时记忆神经网络对规范中文字训练样本进行处理后得到的前向输出与真实结果是存在误差的,那么可以根据该误差构建对应的误差函数,以便利用该误差函数训练双向长短时记忆神经网络,更新网络参数,以使更新后的网络参数在处理输入的训练样本是能够得到与真实结果相同或更相似的前向输出。具体地,可以根据实际情况构建合适的误差函数,本实施例构建的误差函数为
Figure PCTCN2018094173-appb-000028
能够较好地反映前向输出和真实结果之间的误差。
S113:根据误差函数,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型,其中,粒子群算法的公式包括粒子位置更新公式V i+1=w×V i+c1×rand()×(pbest i-X i)+c2×rand()×(gbest-X i)和粒子速度位置更新公式X i+1=X i+V i,X i=(x i1,x i2,...,x in)为第i个粒子的位置,n表示规范中文字训练样本的样本维度,X i+1为第i+1个粒子的位置,V i=(v i1,v i2,...,v in)为第i个粒子的速度,V i+1为第i+1个粒子的速度,pbest i=(pbest i1,pbest i2,...,pbest in)表示第i个粒子对应的局部极值, gbest=(gbest 1,gbest 2,...,gbest n)表示最优极值,w为惯性偏置,c1为第一学习因子,c2为第二学习因子,rand()为[0,1]中的任意随机值。
在一实施例中,根据误差函数,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型,该粒子群算法包括粒子位置更新公式(公式1)和粒子速度位置更新公式(公式2),粒子群算法如下所示:
V i+1=w×V i+c1×rand()×(pbest i-X i)+c2×rand()×(gbest-X i)-------(公式1)
X i+1=X i+V i-------(公式2)
其中,规范中文字训练样本的样本维度(即样本对应的二值化像素值特征矩阵的矩阵维度)为n,X i=(x i1,x i2,...,x in)为第i个粒子的位置,X i+1为第i+1个粒子的位置,x in表示第i个粒子的位置中第n维度的位置分量;V i=(v i1,v i2,...,v in)为第i个粒子的速度,V i+1为第i+1个粒子的速度,v in表示第i个粒子的速度中第n维度的速度分量;pbest i=(pbest i1,pbest i2,...,pbest in)为第i个粒子对应的局部极值;gbest=(gbest 1,gbest 2,...,gbest n)为最优极值(又称全局极值),w为惯性偏置,c1为第一学习因子,c2为第二学习因子,c1,c2一般设为常数2,rand()为[0,1]中的任意随机值。
可以理解地,c1×rand()控制粒子向该粒子经历最优位置的步长。c2×rand()控制粒子向所有粒子经历最优位置的步长;w为惯性偏置,当w值大时,粒子群表现出很强的全局寻优能力;当w值小时,粒子群表现出很强的局部寻优能力,该特点非常适合于网络训练的。通常在网络训练的初始阶段,w一般设置比较大,以保证具有足够大的全局寻优能力;在训练的收敛阶段,w一般设置比较小,以保证能够收敛到最优解。
在公式(1)中,公式右边第一项表示原速度项;公式右边第二项表示“认知”部分,主要是根据该粒子的历史最优位置,考虑对新粒子位置的影响,是一个自身思考的过程;公式右边第三项是“社会”部分,主要是根据所有粒子最优位置,考虑对新粒子位置的影响。整个公式(1)反映的是一个信息共享的过程。如果没有第一部分,则粒子速度的更新,只取决于该粒子和所有粒子所经历最优位置,则粒子具有很强的收敛性。公式右边第一项保证了粒子群有一定的全局寻优能力,具有逃离极值作用,反而,如果该部分很小时,则粒子群会迅速收敛。公式右边第二项和公式右边第三项则保证了粒子群的局部收敛性。该粒子群算法是一种全局随机寻优算法,采用该计算公式在训练的初始阶段能找到最优解的收敛领域,然后在最优解的收敛领域中再进行收敛,得到最优解(即求出误差函数的极小值)。
采用粒子群算法更新双向长短时记忆神经网络的网络参数的过程具体包括如下步骤:
(1)初始化粒子位置X和粒子速度V,并设置粒子位置最大值X max和最小值X min,粒子速度最大值V max和最小值V min,惯性权值w,第一学习因子c1,第二学习因子c2,训练最大次数α,停止迭代阈值ε。
(2)对于每个粒子pbest:利用误差函数计算粒子适应值(即寻找更优解),若粒子寻找到更优解,则更新pbest;否则,pbest保持不变。
(3)将局部极值pbest中适应值最小的粒子与全局极值gbest的粒子适应值相比较,选择适应值最小的粒子更新gbest的值。
(4)根据公式(1)更新粒子群的粒子位置X和粒子速度V。
判断pbest中的速度是否超出[V min,V max],如果超出速度的范围,则相应设置为速度的最小值 和/或最大值。
判断pbest中的速度是否超出[X min,X max],如果超出位置的范围,则设置为位置的最小值和/或最大值,同时更新惯性权值w,更新w的公式为
Figure PCTCN2018094173-appb-000029
β是指当前训练次数。
(5)判断是否达到训练最大次数α或误差小于停止迭代阈值ε,若是,则终止;若否,则转向(2)继续运行,直至达到要求。
步骤S111-S113能够根据规范中文字训练样本在双向长短时记忆神经网络得到的前向输出构建误差函数
Figure PCTCN2018094173-appb-000030
并根据该误差函数。采用粒子群算法更新网络参数,能够获取规范中文字识别模型,该模型学习了规范中文字训练样本的深层特征,能够精确地识别标准规范字。
步骤S20和S40采用粒子群算法更新网络参数的步骤参考本步骤S113,为避免重复,在此不一一赘述。
在一实施例中,如图5所示,步骤S30中,采用调整中文手写字识别模型识别待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有出错字作为出错字训练样本,具体包括如下步骤:
S31:将待测试中文字样本输入到调整中文手写字识别模型,获取待测试中文字样本中每一个字在调整中文手写字识别模型中的输出值。
本实施例中,采用调整中文手写字识别模型对待测试中文字样本进行识别,待测试中文字样本中包含若干中文字。在中文字库中,常用的中文字大概有三千多个,在调整中文手写字识别模型的输出层应设置中文字库中每一个字与输入的待测试中文字样本相似程度的概率值,该概率值为待测试中文字样本中每一个字在调整中文手写字识别模型中的输出值,具体可以是通过softmax函数实现。简单地说,当输入“我”字时,在调整中文手写字识别模型中将会获取其与中文字库中每一个字对应的输出值(用概率表示),如与中文字库中“我”对应的输出值为99.5%,其余字的输出值加起来为0.5%。通过设置待测试中文字样本,在经过调整中文手写字识别模型识别后的与中文字库中每一个字对应的输出值,可以根据该输出值得到合理的识别结果。
S32:选取每一个字对应的输出值中的最大输出值,根据最大输出值获取每一个字的识别结果。
本实施例中,选择每一个字对应的所有输出值中的最大输出值,根据该最大输出值即可获取该字的识别结果。可以理解地,输出值直接反映了输入的待测试中文字样本中的字与中文字库中每一个字的相似程度,而最大输出值则表明待测试字样本最接近中文字库中的某个字,则可以根据该最大输出值对应的字即为该字的识别结果,如输入“我”字最后输出的识别结果为“我”。
S33:根据识别结果,获取识别结果与真实结果不符的出错字,把所有出错字作为出错字训练样本。
本实施例中,将得到的识别结果与真实结果(客观事实)作比较,将比较识别结果与真实结果不符的出错字作为出错字训练样本。可以理解地,该识别结果只是待测试中文字训练样本在调整中文手写字识别模型识别出来的结果,与真实结果相比有可能是不相同的,反映了该模型在识别的精确度上仍有不足,而这些不足可以通过出错字训练样本进行优化,以达到更精确的识别效果。
步骤S31-S33根据待测试中文字样本中每一个字在调整中文手写字识别模型中的输出值,从输出值中选择能够反映字间相似程度的最大输出值;再通过最大输出值得到识别结果,并根据识别结果得到出错字训练样本,为后续利用出错字训练样本进一步优化识别精确度提供了重要的技术前提。
在一实施例中,在步骤S10之前,即在获取规范中文字训练样本的步骤之前,该手写模型训练方法还包括如下步骤:初始化双向长短时记忆神经网络。
在一实施例中,初始化双向长短时记忆神经网络即初始化该网络的网络参数,赋予网络参数初始值。若初始化的权值处在误差曲面的一个相对平缓的区域时,双向长短时记忆神经网络模型训练的收敛速度可能会异常缓慢。可以将网络参数初始化在一个具有0均值的相对小的区间内均匀分布,比如[-0.30,+0.30]这样的区间内。合理地初始化双向长短时记忆神经网络可以使网络在初期有较灵活的调整能力,可以在训练过程中对网络进行有效的调整,能够快速有效地找到误差函数的极小值,有利于双向长短时 记忆神经网络的更新和调整,使得基于双向长短时记忆神经网络进行模型训练获取的模型在进行中文手写字识别时具备精确的识别效果。
本实施例所提供的手写模型训练方法中,将双向长短时记忆神经网络的网络参数初始化在一个具有0均值的相对小的区间内均匀分布,比如[-0.30,+0.30]这样的区间,采用该初始化的方式能够快速有效地找到误差函数的极小值,有利于双向长短时记忆神经网络的更新和调整。对待处理中文字训练样本进行归一化处理并进行二类值的划分,获取每个字的二值化像素值特征矩阵,并将特征矩阵对应的字作为规范中文字训练样本,能够显著缩短训练规范中文字识别模型的时长。根据规范中文字训练样本在双向长短时记忆神经网络得到的前向输出构建误差函数
Figure PCTCN2018094173-appb-000031
并根据该误差函数反传更新网络参数,能够获取规范中文字识别模型,该模型学习了规范中文字训练样本的深层特征,能够精确地识别标准规范字。接着通过非规范中文字对规范中文字识别模型进行调整性的更新,使得更新后获取的调整中文手写字识别模型在具备识别规范中文手写字能力的前提下,通过训练更新的方式学习非规范中文字的深层特征,使得调整中文手写字识别模型能够较好地识别非规范中文手写字。接着,根据待测试中文字样本中每一个字在调整中文手写字识别模型中的输出值,从输出值中选择能够反映字间相似程度的最大输出值,利用最大输出值得到识别结果,并根据识别结果得到出错字训练样本,并将所有出错字作为出错字训练样本输入到调整中文手写字识别模型中进行训练更新,获取目标中文手写字识别模型。采用出错字训练样本可以在很大程度上消除原本训练过程中产生的过度学习和过度削弱带来的不利影响,能够进一步优化识别准确率。此外,本实施例所提供的手写模型训练方法中,训练各个模型采用的是双向长短时记忆神经网络,该神经网络能够结合字具有的序列特点,从序列的正向和序列的反向的角度出发,学习字的深层特征,实现对不同的中文手写字进行识别的功能;各个模型在进行网络参数更新时采用的是粒子群算法,该算法能够进行全局随机寻优,在训练的初始阶段能找到最优解的收敛领域,然后在最优解的收敛领域中再进行收敛,得到最优解,求出误差函数的极小值,更新网络参数。该粒子群算法能够明显提高模型训练的效率,并且有效地对网络参数进行更新,提高所获取的模型的识别准确率。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
图6示出与实施例中手写模型训练方法一一对应的手写模型训练装置的原理框图。如图6所示,该手写模型训练装置包括规范中文字识别模型获取模块10、调整中文手写字识别模型获取模块20、出错字训练样本获取模块30和目标中文手写字识别模型获取模块40。其中,规范中文字识别模型获取模块10、调整中文手写字识别模型获取模块20、出错字训练样本获取模块30和目标中文手写字识别模型获取模块40的实现功能与实施例中手写模型训练方法对应的步骤一一对应,为避免赘述,本实施例不一一详述。
规范中文字识别模型获取模块10,用于获取规范中文字训练样本,将规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型。
调整中文手写字识别模型获取模块20,用于获取非规范中文字训练样本,将非规范中文字训练样本输入到规范中文字识别模型中进行训练,采用粒子群算法更新规范中文字识别模型的网络参数,获取调整中文手写字识别模型。
出错字训练样本获取模块30,用于获取待测试中文字样本,采用调整中文手写字识别模型识别待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有出错字作为出错字训练样本。
目标中文手写字识别模型获取模块40,用于将出错字训练样本输入到调整中文手写字识别模型中进行训练,采用粒子群算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型。
优选地,规范中文字识别模型获取模块10包括归一化像素值特征矩阵获取单元101、规范中文字训练样本获取单元102、前向输出获取单元111、误差函数构建单元112和规范中文字识别模型获取单元113。
归一化像素值特征矩阵获取单元101,用于获取待处理中文字训练样本中每个中文字的像素值特征矩阵,将像素值特征矩阵中每个像素值进行归一化处理,获取每个中文字的归一化像素值特征矩阵,其中,归一化处理的公式为
Figure PCTCN2018094173-appb-000032
MaxValue为每个中文字的像素值特征矩阵中像素值的最大值,MinValue为每个中文字的像素值特征矩阵中像素值的最小值,x为归一化前的像素值,y为归一化后的像素值。
规范中文字训练样本获取单元102,用于将每个中文字的归一化像素值特征矩阵中的像素值划分为两类像素值,基于两类像素值建立每个中文字的二值化像素值特征矩阵,将每个中文字的二值化像素特征矩阵组合作为规范中文字训练样本。
前向输出获取单元111,用于将规范中文字训练样本按序列正向输入到双向长短时记忆神经网络中,获取正向输出F o,将规范中文字训练样本按序列反向输入到双向长短时记忆神经网络中,获取反向输出B o,将正向输出和反向输出相加,获取前向输出T o,公式表示为T o=F o+B o
误差函数构建单元112,用于根据前向输出和真实结果构建误差函数,误差函数的表达式为
Figure PCTCN2018094173-appb-000033
其中,N表示训练样本总数,x i表示第i个训练样本的前向输出,y i表示与x i相对应的第i个训练样本的真实结果。
规范中文字识别模型获取单元113,用于根据误差函数,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型,其中,粒子群算法的公式包括粒子位置更新公式V i+1=w×V i+c1×rand()×(pbest i-X i)+c2×rand()×(gbest-X i)和粒子速度位置更新公式X i+1=X i+V i,X i=(x i1,x i2,...,x in)为第i个粒子的位置,n表示规范中文字训练样本的样本维度,X i+1为第i+1个粒子的位置,V i=(v i1,v i2,...,v in)为第i个粒子的速度,V i+1为第i+1个粒子的速度,pbest i=(pbest i1,pbest i2,...,pbest in)表示第i个粒子对应的局部极值,gbest=(gbest 1,gbest 2,...,gbest n)表示最优极值,w为惯性偏置,c1为第一学习因子,c2为第二学习因子,rand()为[0,1]中的任意随机值。
优选地,出错字训练样本获取模块30包括模型输出值获取单元31、模型识别结果获取单元32和出错字训练样本获取单元33。
模型输出值获取单元31,用于将待测试中文字样本输入到调整中文手写字识别模型,获取待测试中文字样本中每一个字在调整中文手写字识别模型中的输出值。
模型识别结果获取单元32,用于选取每一个字对应的输出值中的最大输出值,根据最大输出值获取每一个字的识别结果。
出错字训练样本获取单元33,用于根据识别结果,获取识别结果与真实结果不符的出错字,把所有出错字作为出错字训练样本。
优选地,该手写模型训练装置还包括初始化模块50,用于初始化双向长短时记忆神经网络。
图7示出本实施例中手写字识别方法的一流程图。该手写字识别方法可应用在银行、投资和保险等机构配置的计算机设备,用于对手写中文字进行识别,达到人工智能目的。如图7所示,该手写字识别方法包括如下步骤:
S50:获取待识别中文字,采用目标中文手写字识别模型识别待识别中文字,获取待识别中文字在目标中文手写字识别模型中的输出值,目标中文手写字识别模型是采用上述手写模型训练方法获取到 的。
其中,待识别中文字是指要进行识别的中文字。
本实施例中,获取待识别中文字将待识别中文字输入到目标中文手写字识别模型中进行识别,获取待识别中文字在目标中文手写字识别模型中的输出值,一个待识别中文字对应有三千多个(具体数量以中文字库为准)输出值,可以基于该输出值确定该待识别中文字的识别结果。具体地,待识别中文字具体是采用计算机能够直接识别的二值化像素值特征矩阵表示。
S60:根据输出值和预设的中文语义词库获取目标概率输出值,基于目标概率输出值获取待识别中文字的识别结果。
其中,预设的中文语义词库是指预先设置好的基于词频的描述中文词语间语义关系的词库。例如,在该中文语义词库中对于“X阳”这两个字的词,“太阳”出现的概率为30.5%,“大阳”出现的概率为0.5%,剩余的如“骄阳”等“X阳”的两个字的词出现的概率之和为69%。目标概率输出值是结合输出值和预设的中文语义词库,得到的用于获取待识别中文字的识别结果的概率值。
具体地,采用输出值和预设的中文语义词库获取目标概率输出值包括如下步骤:(1)选取待识别中文字中每一个字对应的输出值中最大值作为第一概率值,根据第一概率值获取待识别中文字初步的识别结果。(2)根据该初步的识别结果和中文语义词库获取待识别字的向左语义概率值和向右语义概率值。可以理解地,对于一文本,该文本中的字是有先后顺序的,如“红X阳”,则对于“X”字而言,有向左向右两个方向词语“红X”和“X阳”对应的概率值,即向左语义概率值和向右语义概率值。(3)分别设置待识别中文字中每一个字对应的输出值的权值、向左语义概率值的权值和向右语义概率值的权值。具体地,可以赋予待识别中文字中每一个字对应的输出值0.4的权值,赋予向左语义概率值0.3的权值,赋予0.3向右语义概率值的权值。(4)根据上述设置的各个权值分别乘以各自对应的概率值得到各个加权运算后的概率值,将各个加权运算后的概率值相加得到目标概率输出值(目标概率输出值有多个,具体个数可以按中文字库为准),并选取目标概率输出值中最大值对应的字作为待识别中文字的识别结果。实际上,可以先选取输出值中,数值最大的前5个概率值,该前5个概率值代表最有可能的5个字(识别结果),只对这5字结合中文语义词库算出目标概率输出值,则目标概率输出值就只有5个,可以大大提高识别的效率。通过结合输出值和预设的中文语义词库,可以得到精确的识别结果。可以理解地,对于单个字(非文本)的识别,则可以根据输出值中最大值直接得到相应的识别结果即可,而不必加入基于中文语义的识别。
步骤S50-S60,采用目标中文手写字识别模型识别待识别中文字,结合输出值和预设的中文语义词库获取待识别中文字的识别结果。采用该目标中文手写字识别模型本身拥有较高的识别精确度,再结合中文语义词库进一步提高中文手写的识别准确率。
本申请实施例所提供的手写字识别方法中,将待识别中文字输入到目标中文手写字识别模型中进行识别,并结合预设的中文语义词库获取识别结果。采用该目标中文手写字识别模型对中文手写字进行识别时,可以得到精确的识别结果。
图8示出与实施例中手写字识别方法一一对应的手写字识别装置的原理框图。如图8所示,该手写字识别装置包括输出值获取模块60和识别结果获取模块70。其中,输出值获取模块60和识别结果获取模块70的实现功能与实施例中手写字识别方法对应的步骤一一对应,为避免赘述,本实施例不一一详述。
手写字识别装置包括输出值获取模块60,用于获取待识别中文字,采用目标中文手写字识别模型识别待识别中文字,获取待识别中文字在目标中文手写字识别模型中的输出值;目标中文手写字识别模型是采用手写模型训练方法获取到的。
识别结果获取模块70,用于根据输出值和预设的中文语义词库获取目标概率输出值,基于目标概率输出值获取待识别中文字的识别结果。
本实施例提供一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行时实现实施例中手写模型训练方法,为避免重复,这里不再赘述。或者,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行时实现实施例中手写模型训练装置的各模块/单元的功能,为避免重复,这里不再赘述。或 者,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行时实现实施例中手写字识别方法中各步骤的功能,为避免重复,此处不一一赘述。或者,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行时实现实施例中手写字识别装置中各模块/单元的功能,为避免重复,此处不一一赘述。
图9是本申请一实施例提供的计算机设备的示意图。如图9所示,该实施例的计算机设备80包括:处理器81、存储器82以及存储在存储器82中并可在处理器81上运行的计算机可读指令83,该计算机可读指令83被处理器81执行时实现实施例中的手写模型训练方法,为避免重复,此处不一一赘述。或者,该计算机可读指令83被处理器81执行时实现实施例中手写模型训练装置中各模型/单元的功能,为避免重复,此处不一一赘述。或者,该计算机可读指令83被处理器81执行时实现实施例中手写字识别方法中各步骤的功能,为避免重复,此处不一一赘述。或者,该计算机可读指令83被处理器81执行时实现实施例中手写字识别装置中各模块/单元的功能。为避免重复,此处不一一赘述。
计算机设备80可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。计算机设备可包括,但不仅限于,处理器81、存储器82。本领域技术人员可以理解,图9仅仅是计算机设备80的示例,并不构成对计算机设备80的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如计算机设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器81可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器82可以是计算机设备80的内部存储单元,例如计算机设备80的硬盘或内存。存储器82也可以是计算机设备80的外部存储设备,例如计算机设备80上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器82还可以既包括计算机设备80的内部存储单元也包括外部存储设备。存储器82用于存储计算机可读指令83以及计算机设备所需的其他程序和数据。存储器82还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种手写模型训练方法,其特征在于,包括:
    获取规范中文字训练样本,将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型;
    获取非规范中文字训练样本,将所述非规范中文字训练样本输入到所述规范中文字识别模型中进行训练,采用粒子群算法更新所述规范中文字识别模型的网络参数,获取调整中文手写字识别模型;
    获取待测试中文字样本,采用所述调整中文手写字识别模型识别所述待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本;
    将所述出错字训练样本输入到所述调整中文手写字识别模型中进行训练,采用粒子群算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型。
  2. 根据权利要求1所述的手写模型训练方法,其特征在于,所述获取规范中文字训练样本,包括:
    获取待处理中文字训练样本中每个中文字的像素值特征矩阵,将所述像素值特征矩阵中每个像素值进行归一化处理,获取每个中文字的归一化像素值特征矩阵,其中,归一化处理的公式为
    Figure PCTCN2018094173-appb-100001
    MaxValue为每个中文字的像素值特征矩阵中像素值的最大值,MinValue为每个中文字的像素值特征矩阵中像素值的最小值,x为归一化前的像素值,y为归一化后的像素值;
    将每个中文字的归一化像素值特征矩阵中的像素值划分为两类像素值,基于所述两类像素值建立每个中文字的二值化像素值特征矩阵,将每个中文字的二值化像素特征矩阵组合作为规范中文字训练样本。
  3. 根据权利要求1所述的手写模型训练方法,其特征在于,所述将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型,包括:
    将所述规范中文字训练样本按序列正向输入到双向长短时记忆神经网络中,获取正向输出F o,将所述规范中文字训练样本按序列反向输入到双向长短时记忆神经网络中,获取反向输出B o,将所述正向输出和所述反向输出相加,获取前向输出T o,公式表示为T o=F o+B o
    根据所述前向输出和真实结果构建误差函数,所述误差函数的表达式为
    Figure PCTCN2018094173-appb-100002
    其中,N表示训练样本总数,x i表示第i个训练样本的前向输出,y i表示与x i相对应的第i个训练样本的真实结果;
    根据所述误差函数,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型,其中,粒子群算法的公式包括粒子位置更新公式V i+1=w×V i+c1×rand()×(pbest i-X i)+c2×rand()×(gbest-X i)和粒子速度位置更新公式X i+1=X i+V i,X i=(x i1,x i2,...,x in)为第i个粒子的位置,n表示所述规范中文字训练样本的样本维度,X i+1为第i+1个粒子的位置,V i=(v i1,v i2,...,v in)为第i个粒子的速度,n表示规范中文字训练样本的样本维度,V i+1为第i+1个粒子的速度,pbest i=(pbest i1,pbest i2,...,pbest in)表示第i个粒子对 应的局部极值,gbest=(gbest 1,gbest 2,...,gbest n)表示最优极值,w为惯性偏置,c1为第一学习因子,c2为第二学习因子,rand()为[0,1]中的任意随机值。
  4. 根据权利要求1所述的手写模型训练方法,其特征在于,所述采用调整中文手写字识别模型识别待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本,包括:
    将待测试中文字样本输入到调整中文手写字识别模型,获取所述待测试中文字样本中每一个字在所述调整中文手写字识别模型中的输出值;
    选取每一个所述字对应的输出值中的最大输出值,根据所述最大输出值获取每一个所述字的识别结果;
    根据识别结果,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本。
  5. 根据权利要求1所述的手写模型训练方法,其特征在于,在所述获取规范中文字训练样本的步骤之前,所述手写模型训练方法还包括:
    初始化双向长短时记忆神经网络。
  6. 一种手写字识别方法,其特征在于,包括:
    获取待识别中文字,采用目标中文手写字识别模型识别所述待识别中文字,获取所述待识别中文字在所述目标中文手写字识别模型中的输出值;所述目标中文手写字识别模型是采用权利要求1-5任一项所述手写模型训练方法获取到的;
    根据所述输出值和预设的中文语义词库获取目标概率输出值,基于所述目标概率输出值获取所述待识别中文字的识别结果。
  7. 一种手写模型训练装置,其特征在于,包括:
    规范中文字识别模型获取模块,用于获取规范中文字训练样本,将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型;
    调整中文手写字识别模型获取模块,用于获取非规范中文字训练样本,将所述非规范中文字训练样本输入到所述规范中文字识别模型中进行训练,采用粒子群算法更新所述规范中文字识别模型的网络参数,获取调整中文手写字识别模型;
    出错字训练样本获取模块,用于获取待测试中文字样本,采用所述调整中文手写字识别模型识别所述待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本;
    目标中文手写字识别模型获取模块,用于将所述出错字训练样本输入到所述调整中文手写字识别模型中进行训练,采用粒子群算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型。
  8. 一种手写字识别装置,其特征在于,包括:
    输出值获取模块,用于获取待识别中文字,采用目标中文手写字识别模型识别所述待识别中文字,获取所述待识别中文字在所述目标中文手写字识别模型中的输出值;所述目标中文手写字识别模型是采用权利要求1-5任一项所述手写模型训练方法获取到的;
    识别结果获取模块,用于根据所述输出值和预设的中文语义词库获取目标概率输出值,基于所述目标概率输出值获取所述待识别中文字的识别结果。
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:
    获取规范中文字训练样本,将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型;
    获取非规范中文字训练样本,将所述非规范中文字训练样本输入到所述规范中文字识别模型中进行训练,采用粒子群算法更新所述规范中文字识别模型的网络参数,获取调整中文手写字识别模型;
    获取待测试中文字样本,采用所述调整中文手写字识别模型识别所述待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本;
    将所述出错字训练样本输入到所述调整中文手写字识别模型中进行训练,采用粒子群算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型。
  10. 根据权利要求9所述的计算机设备,其特征在于,所述获取规范中文字训练样本,包括:
    获取待处理中文字训练样本中每个中文字的像素值特征矩阵,将所述像素值特征矩阵中每个像素值进行归一化处理,获取每个中文字的归一化像素值特征矩阵,其中,归一化处理的公式为
    Figure PCTCN2018094173-appb-100003
    MaxValue为每个中文字的像素值特征矩阵中像素值的最大值,MinValue为每个中文字的像素值特征矩阵中像素值的最小值,x为归一化前的像素值,y为归一化后的像素值;
    将每个中文字的归一化像素值特征矩阵中的像素值划分为两类像素值,基于所述两类像素值建立每个中文字的二值化像素值特征矩阵,将每个中文字的二值化像素特征矩阵组合作为规范中文字训练样本。
  11. 根据权利要求9所述的计算机设备,其特征在于,所述将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型,包括:
    将所述规范中文字训练样本按序列正向输入到双向长短时记忆神经网络中,获取正向输出F o,将所述规范中文字训练样本按序列反向输入到双向长短时记忆神经网络中,获取反向输出B o,将所述正向输出和所述反向输出相加,获取前向输出T o,公式表示为T o=F o+B o
    根据所述前向输出和真实结果构建误差函数,所述误差函数的表达式为
    Figure PCTCN2018094173-appb-100004
    其中,N表示训练样本总数,x i表示第i个训练样本的前向输出,y i表示与x i相对应的第i个训练样本的真实结果;
    根据所述误差函数,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型,其中,粒子群算法的公式包括粒子位置更新公式V i+1=w×V i+c1×rand()×(pbest i-X i)+c2×rand()×(gbest-X i)和粒子速度位置更新公式X i+1=X i+V i,X i=(x i1,x i2,...,x in)为第i个粒子的位置,n表示所述规范中文字训练样本的样本维度,X i+1为第i+1个粒子的位置,V i=(v i1,v i2,...,v in)为第i个粒子的速度,n表示规范中文字训练样本的样本维度,V i+1为第i+1个粒子的速度,pbest i=(pbest i1,pbest i2,...,pbest in)表示第i个粒子对应的局部极值,gbest=(gbest 1,gbest 2,...,gbest n)表示最优极值,w为惯性偏置,c1为第一学习因子,c2为第二学习因子,rand()为[0,1]中的任意随机值。
  12. 根据权利要求9所述的计算机设备,其特征在于,所述采用调整中文手写字识别模型识别待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本,包括:
    将待测试中文字样本输入到调整中文手写字识别模型,获取所述待测试中文字样本中每一个字在所述调整中文手写字识别模型中的输出值;
    选取每一个所述字对应的输出值中的最大输出值,根据所述最大输出值获取每一个所述字的识别结果;
    根据识别结果,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本。
  13. 根据权利要求9所述的计算机设备,其特征在于,在所述获取规范中文字训练样本的步骤之前,所述处理器执行所述计算机可读指令时还实现如下步骤:
    初始化双向长短时记忆神经网络。
  14. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:
    获取待识别中文字,采用目标中文手写字识别模型识别所述待识别中文字,获取所述待识别中文字在所述目标中文手写字识别模型中的输出值;所述目标中文手写字识别模型是采用权利要求1-5任一项所述手写模型训练方法获取到的;
    根据所述输出值和预设的中文语义词库获取目标概率输出值,基于所述目标概率输出值获取所述待识别中文字的识别结果。
  15. 一个或多个存储有计算机可读指令的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
    获取规范中文字训练样本,将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型;
    获取非规范中文字训练样本,将所述非规范中文字训练样本输入到所述规范中文字识别模型中进行训练,采用粒子群算法更新所述规范中文字识别模型的网络参数,获取调整中文手写字识别模型;
    获取待测试中文字样本,采用所述调整中文手写字识别模型识别所述待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本;
    将所述出错字训练样本输入到所述调整中文手写字识别模型中进行训练,采用粒子群算法更新调整中文手写字识别模型的网络参数,获取目标中文手写字识别模型。
  16. 根据权利要求15所述的非易失性可读存储介质,其特征在于,所述获取规范中文字训练样本,包括:
    获取待处理中文字训练样本中每个中文字的像素值特征矩阵,将所述像素值特征矩阵中每个像素值进行归一化处理,获取每个中文字的归一化像素值特征矩阵,其中,归一化处理的公式为
    Figure PCTCN2018094173-appb-100005
    MaxValue为每个中文字的像素值特征矩阵中像素值的最大值,MinValue为每个中文字的像素值特征矩阵中像素值的最小值,x为归一化前的像素值,y为归一化后的像素值;
    将每个中文字的归一化像素值特征矩阵中的像素值划分为两类像素值,基于所述两类像素值建立每个中文字的二值化像素值特征矩阵,将每个中文字的二值化像素特征矩阵组合作为规范中文字训练样本。
  17. 根据权利要求15所述的非易失性可读存储介质,其特征在于,所述将所述规范中文字训练样本输入到双向长短时记忆神经网络中进行训练,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型,包括:
    将所述规范中文字训练样本按序列正向输入到双向长短时记忆神经网络中,获取正向输出F o,将所述规范中文字训练样本按序列反向输入到双向长短时记忆神经网络中,获取反向输出B o,将所述正向输出和所述反向输出相加,获取前向输出T o,公式表示为T o=F o+B o
    根据所述前向输出和真实结果构建误差函数,所述误差函数的表达式为
    Figure PCTCN2018094173-appb-100006
    其中,N表示训练样本总数,x i表示第i个训练样本的前向输出,y i表示与x i相对应的第i个训练样本的真 实结果;
    根据所述误差函数,采用粒子群算法更新双向长短时记忆神经网络的网络参数,获取规范中文字识别模型,其中,粒子群算法的公式包括粒子位置更新公式V i+1=w×V i+c1×rand()×(pbest i-X i)+c2×rand()×(gbest-X i)和粒子速度位置更新公式X i+1=X i+V i,X i=(x i1,x i2,...,x in)为第i个粒子的位置,n表示所述规范中文字训练样本的样本维度,X i+1为第i+1个粒子的位置,V i=(v i1,v i2,...,v in)为第i个粒子的速度,n表示规范中文字训练样本的样本维度,V i+1为第i+1个粒子的速度,pbest i=(pbest i1,pbest i2,...,pbest in)表示第i个粒子对应的局部极值,gbest=(gbest 1,gbest 2,...,gbest n)表示最优极值,w为惯性偏置,c1为第一学习因子,c2为第二学习因子,rand()为[0,1]中的任意随机值。
  18. 根据权利要求15所述的非易失性可读存储介质,其特征在于,所述采用调整中文手写字识别模型识别待测试中文字样本,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本,包括:
    将待测试中文字样本输入到调整中文手写字识别模型,获取所述待测试中文字样本中每一个字在所述调整中文手写字识别模型中的输出值;
    选取每一个所述字对应的输出值中的最大输出值,根据所述最大输出值获取每一个所述字的识别结果;
    根据识别结果,获取识别结果与真实结果不符的出错字,把所有所述出错字作为出错字训练样本。
  19. 根据权利要求15所述的非易失性可读存储介质,其特征在于,在所述获取规范中文字训练样本的步骤之前,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:
    初始化双向长短时记忆神经网络。
  20. 一个或多个存储有计算机可读指令的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
    获取待识别中文字,采用目标中文手写字识别模型识别所述待识别中文字,获取所述待识别中文字在所述目标中文手写字识别模型中的输出值;所述目标中文手写字识别模型是采用权利要求1-5任一项所述手写模型训练方法获取到的;
    根据所述输出值和预设的中文语义词库获取目标概率输出值,基于所述目标概率输出值获取所述待识别中文字的识别结果。
PCT/CN2018/094173 2018-06-04 2018-07-03 手写模型训练方法、手写字识别方法、装置、设备及介质 WO2019232844A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810564091.XA CN108985151B (zh) 2018-06-04 2018-06-04 手写模型训练方法、手写字识别方法、装置、设备及介质
CN201810564091.X 2018-06-04

Publications (1)

Publication Number Publication Date
WO2019232844A1 true WO2019232844A1 (zh) 2019-12-12

Family

ID=64539993

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/094173 WO2019232844A1 (zh) 2018-06-04 2018-07-03 手写模型训练方法、手写字识别方法、装置、设备及介质

Country Status (2)

Country Link
CN (1) CN108985151B (zh)
WO (1) WO2019232844A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111860828A (zh) * 2020-06-15 2020-10-30 北京仿真中心 一种神经网络的训练方法、存储介质和设备
CN112784845A (zh) * 2021-01-12 2021-05-11 安徽淘云科技有限公司 手写文字检测方法以及电子设备、存储装置
CN115482440A (zh) * 2022-11-09 2022-12-16 荣耀终端有限公司 样本数据获取方法、模型训练方法、电子设备及介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100239168A1 (en) * 2009-03-20 2010-09-23 Microsoft Corporation Semi-tied covariance modelling for handwriting recognition
US8369611B2 (en) * 2010-04-22 2013-02-05 Microsoft Corporation Compact handwriting recognition
CN107844740A (zh) * 2017-09-05 2018-03-27 中国地质调查局西安地质调查中心 一种脱机手写、印刷汉字识别方法及***

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101373519B (zh) * 2007-08-20 2011-01-19 富士通株式会社 字符识别装置和方法
CN106407874A (zh) * 2016-03-25 2017-02-15 东南大学 基于笔迹坐标序列的手写识别方法
CN106408039A (zh) * 2016-09-14 2017-02-15 华南理工大学 一种基于形变方法进行数据扩展的脱机手写汉字识别方法
CN107316054A (zh) * 2017-05-26 2017-11-03 昆山遥矽微电子科技有限公司 基于卷积神经网络和支持向量机的非标准字符识别方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100239168A1 (en) * 2009-03-20 2010-09-23 Microsoft Corporation Semi-tied covariance modelling for handwriting recognition
US8369611B2 (en) * 2010-04-22 2013-02-05 Microsoft Corporation Compact handwriting recognition
CN107844740A (zh) * 2017-09-05 2018-03-27 中国地质调查局西安地质调查中心 一种脱机手写、印刷汉字识别方法及***

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111860828A (zh) * 2020-06-15 2020-10-30 北京仿真中心 一种神经网络的训练方法、存储介质和设备
CN111860828B (zh) * 2020-06-15 2023-11-28 北京仿真中心 一种神经网络的训练方法、存储介质和设备
CN112784845A (zh) * 2021-01-12 2021-05-11 安徽淘云科技有限公司 手写文字检测方法以及电子设备、存储装置
CN115482440A (zh) * 2022-11-09 2022-12-16 荣耀终端有限公司 样本数据获取方法、模型训练方法、电子设备及介质
CN115482440B (zh) * 2022-11-09 2023-04-28 荣耀终端有限公司 样本数据获取方法、模型训练方法、电子设备及介质

Also Published As

Publication number Publication date
CN108985151B (zh) 2023-04-07
CN108985151A (zh) 2018-12-11

Similar Documents

Publication Publication Date Title
WO2019232847A1 (zh) 手写模型训练方法、手写字识别方法、装置、设备及介质
WO2019232854A1 (zh) 手写模型训练方法、手写字识别方法、装置、设备及介质
CN109359608B (zh) 一种基于深度学习模型的人脸识别方法
US11893781B2 (en) Dual deep learning architecture for machine-learning systems
WO2019232861A1 (zh) 手写模型训练方法、文本识别方法、装置、设备及介质
WO2020155518A1 (zh) 物体检测方法、装置、计算机设备及存储介质
WO2019232869A1 (zh) 手写模型训练方法、文本识别方法、装置、设备及介质
WO2019232857A1 (zh) 手写模型训练方法、手写字识别方法、装置、设备及介质
JP2022141931A (ja) 生体検出モデルのトレーニング方法及び装置、生体検出の方法及び装置、電子機器、記憶媒体、並びにコンピュータプログラム
CN110866530A (zh) 一种字符图像识别方法、装置及电子设备
WO2019232855A1 (zh) 手写模型训练方法、手写字识别方法、装置、设备及介质
WO2019232844A1 (zh) 手写模型训练方法、手写字识别方法、装置、设备及介质
CN114186063B (zh) 跨域文本情绪分类模型的训练方法和分类方法
WO2021190046A1 (zh) 手势识别模型的训练方法、手势识别方法及装置
CN112560710B (zh) 一种用于构建指静脉识别***的方法及指静脉识别***
WO2019232859A1 (zh) 手写模型训练方法、手写字识别方法、装置、设备及介质
CN111079930B (zh) 数据集质量参数的确定方法、装置及电子设备
CN110175500B (zh) 指静脉比对方法、装置、计算机设备及存储介质
WO2019232856A1 (zh) 手写模型训练方法、手写字识别方法、装置、设备及介质
US11609936B2 (en) Graph data processing method, device, and computer program product
Li et al. A pre-training strategy for convolutional neural network applied to Chinese digital gesture recognition
Wu A method of character verification code recognition in network based on artificial intelligence technology
WO2020155484A1 (zh) 基于支持向量机的文字识别方法、装置和计算机设备
Tang et al. Learning Hough regression models via bridge partial least squares for object detection
Dhamija et al. An approach to enhance performance of age invariant face recognition

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18921403

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11/03/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18921403

Country of ref document: EP

Kind code of ref document: A1