Optical character recognition method based on convolutional neural networks deep learning modelTechnical field
The present invention relates to computer vision, pattern-recognition, the technical fields such as natural scene feature recognition, especially a kind of basesIn the optical character recognition method of convolutional neural networks deep learning model.
Background technology
Optical character identification is because it in real-life practicability has obtained the extensive concern of domestic and foreign scholars, base at presentIt is concentrated mainly on scanned document character recognition in the application of optical character identification.Optical character identification streetscape identifier identify,The foreground of being widely applied also is used in bank's ID card information identification, classroom blackboard-writing identification etc..Optical character identification has heightThe advantages of effect property and convenience.There is a large amount of research effort just constantly promoting the development of field of optical character recognition at present.
A usual character recognition system is acquired by character, Character segmentation, feature extraction, several step structures such as characteristic matchingAt.Wherein feature extraction has most important influence for the accuracy of character recognition.When the feature using most identificationWhen matching is compared to character, better discrimination can be usually obtained, it is on the contrary then will be greatly reduced character recognition systemAccuracy.And the research of character recognition is also concentrated mainly in the method for character feature extraction, it is based on convolutional neural networksDeep learning method in detection feature automatically and extract characteristic aspect and have big advantage.
In recent years, the deep learning model based on convolutional neural networks is prominent in numerous computer vision problems because of itGo out performance and obtains great concern.Its basic thought is to carry an original image automatically behind multilayer convolution sum pondTake wherein most representational feature.Deep learning is all obtained in character recognition, image classification, natural language processing etc. in fieldsObtained howling success.And with the development of technology, how to learn to suitable for particular problem (such as be used for image classification, characterIdentification) model become scholars' focus of attention.
Using the method for deep learning, a weight matrix with identification can be obtained by study and is biased towardsAmount.Weight vector and biasing constitute a grader, and classification knot will be can be obtained after character input grader to be testedFruit.Research under this theoretical frame is mainly concentrated in so that the model learnt has differentiation performance more outstanding.
However, in character recognition problem under practical application scene, it is not usually to mark that we, which can be obtained character picture,Accurate character picture.Due to intensity of illumination, the factors such as placement position, character picture usually has a degree of rotation or torsionIt is bent.If the character picture of standard is directly used in above-mentioned model, is had in the model acquired and greatly represent judgement indexWeaker requires character picture very stringent information, then the recognition correct rate of model can substantially reduce.And if it is intended to obtainingObtain good recognition effect, it usually needs the additional capacity for increasing character training set is to expand its coverage area.
For deep learning model have the characteristics that good ability in feature extraction this, it is proposed that existing optics wordSymbol identification model is improved, and learns a grader under deep learning frame to complete the identification to character.In this way in realityIt, can be in a unification from the identification of the input character picture of non-standard (including but not limited to) to the end under the application environment of borderFrame in be resolved.
Invention content
(1) technical problems to be solved
The problem of for input picture in character recognition problem under actual environment may be non-standard image, the present invention proposeCharacter feature extraction and character recognition are placed on by a kind of optical character recognition method based on neural network deep learning modelIt is resolved under one unified frame so that it is correct that the interaction of above-mentioned two step improves final character recognition jointlyRate.
(2) technical solution
A kind of technical solution of optical character recognition method based on neural network deep learning model proposed by the present inventionIt is as follows:
Step S1 collects the Chinese character of common different fonts, 10 Arabic numerals and 26 English alphabets and generates figureThe data set of piece format.
Step S2, training set and test set sample to acquisition suitably carry out slight rotation and distortion.
Step S3, each layer weight matrix parameter W and biasing b of the grader of Optimization Learning training set, passes through stochastic gradientThe optimal way of descent method (SGD) minimizes object function, study optimum classifier parameter W and b.
Step S4 carries out a propagated forward, calculates the probability value of its affiliated each classification, obtains the classification of test characterAs a result.
Beneficial effects of the present invention:The present invention is directed to the character recognition problem under actual application environment, can directly inputNon-standard character image carries out character recognition.It is placed on a unified model frame by expressing character feature, with character recognitionIt is solved under frame, it is hereby achieved that higher discrimination, enhances the robustness of algorithm.
Description of the drawings
Fig. 1 is the system flow chart of the optical character recognition method based on neural network deep learning model.
Specific implementation mode
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with specific example, and with reference to detailedThin attached drawing, the present invention is described in more detail.But described embodiment is intended merely to facilitate the understanding of the present invention, and rightIt does not play any restriction effect.
Fig. 1 is flow chart of the method for the present invention, as shown in Figure 1, proposed by the present invention a kind of based on neural network depthThe optical character recognition method for practising model includes following steps:
Step S1 collects the Chinese character of common different fonts, 26 English alphabets of 10 Arabic numerals and English alphabetAnd generate the data set of picture format.
Step S2, training set and test set sample to acquisition suitably carry out slight rotation and distortion.
Step S3, each layer weight matrix parameter W of the grader of Optimization Learning training set, passes through stochastic gradient descent method(SGD) optimal way minimizes object function, study optimum classifier parameter W and b.
S31 initializes weights square for multiple convolution kernels of each convolutional layer in training set by Gaussian ProfileBattle array.Next, entering alternately error propagated forward and gradient back-propagation process, each of which volume is provided simultaneously by SGD algorithmsThe weights of product core.S32 and S33 is recycled until restraining or reaching iterations requirement.
This is the object function of a typical classification problem, and the optimization for completing this object function can be in the hope of one groupSorting parameter W and b.
S32, the value of propagated forward counting loss function:
S33, the Grad of backpropagation counting loss function pair parameters.
Wherein, f is hidden layer.
Step S4 carries out a propagated forward, calculates the probability value of its affiliated each classification.
Wherein, s=g (xi;W, b).
Case study on implementation:
For the specific implementation mode and verification effectiveness of the invention that the present invention will be described in detail, we propose the present inventionMethod be applied to the database that forms of picture generated by Chinese characters in common use, 10 Arabic numerals and 26 letters.The dataLibrary is included in the image that rotation in various degree and distortion obtain.In our embodiment, we extract every in image firstA character.Using the single character after extraction as the input feature vector of training and test.
According to the step S3 in the technical detail introduced before, we first carry out all training set data input modelsTraining, wherein training parameter W are set as Gaussian Profile, mean value 0, standard deviation 0.01.Next according to step S31, S32 andS33 completes the training to model.Grader is inputted to obtain final classification results by step S4 to new test image.
Particular embodiments described above has carried out further in detail the purpose of the present invention, technical solution and advantageous effectIt describes in detail bright, it should be understood that the above is only a specific embodiment of the present invention, is not intended to restrict the invention, it is allWithin the spirit and principles in the present invention, any modification, equivalent substitution, improvement and etc. done should be included in the guarantor of the present inventionWithin the scope of shield.