CN110321788A - Training data processing method, device, equipment and computer readable storage medium - Google Patents

Training data processing method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN110321788A
CN110321788A CN201910415398.8A CN201910415398A CN110321788A CN 110321788 A CN110321788 A CN 110321788A CN 201910415398 A CN201910415398 A CN 201910415398A CN 110321788 A CN110321788 A CN 110321788A
Authority
CN
China
Prior art keywords
character
text
handwritten
training
image sample
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910415398.8A
Other languages
Chinese (zh)
Inventor
周罡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910415398.8A priority Critical patent/CN110321788A/en
Publication of CN110321788A publication Critical patent/CN110321788A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/63Scene text, e.g. street names
    • 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

Landscapes

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

Abstract

The invention belongs to technical field of image processing, a kind of training data processing method, device, equipment and computer readable storage medium are provided, this method comprises: obtaining handwritten text page image sample, and individual character mark is carried out to the line of text to be extracted in the handwritten text page image sample, obtain the markup information of each character in line of text to be extracted;According to the markup information of each character, rectangle frame region belonging to each character is defined from the handwritten text page image sample;To in the handwritten text page image sample, the region in addition to the rectangle frame region defined carries out covering treatment;According to the markup information of each character, region belonging to the line of text to be extracted is marked off from the handwritten text page image sample after covering treatment, and is cut, the handwriting text lines image for training handwritten word identification model is obtained.The present invention is able to ascend the accuracy of handwriting text lines image, suitable for training handwritten word identification model.

Description

Training data processing method, device, equipment and computer readable storage medium
Technical field
The present invention relates to technical field of image processing more particularly to a kind of training data processing method, device, equipment and meters Calculation machine readable storage medium storing program for executing.
Background technique
Currently, for training the training sample of handwritten word identification model to be made of handwriting text lines image, hand-written text Current row image need to be obtained by cutting handwritten text page image, however the case where inevitably tilting of artificially writing, handwritten text Each line of text in page image can't be on horizontal line, influence when directly cutting vulnerable to uplink and downlink adjacent thereto, The single line of text directly cut may be mingled with the character of uplink and downlink adjacent thereto, or showing there are character missing As being not used to train handwritten word identification model.
Summary of the invention
The main purpose of the present invention is to provide a kind of training data processing method, device, equipment and computer-readable deposit Storage media, it is intended to which the line of text for solving directly to cut from handwritten text page image is not used to train handwritten word identification mould The technical issues of type.
To achieve the above object, the present invention provides a kind of training data processing method, the training data processing method packet Include following steps:
Handwritten text page image sample is obtained, and the line of text to be extracted in the handwritten text page image sample is carried out Individual character mark, obtains the markup information of each character in line of text to be extracted;
According to the markup information of each character, each character institute is defined from the handwritten text page image sample The rectangle frame region of category;
To in the handwritten text page image sample, the region in addition to the rectangle frame region defined is carried out at covering Reason;
According to the markup information of each character, institute is marked off from the handwritten text page image sample after covering treatment Region belonging to line of text to be extracted is stated, and is cut, the handwriting text lines figure for training handwritten word identification model is obtained Picture.
Optionally, the markup information of each character includes upper left point coordinate, width value and the height value of each character,
The markup information according to each character defines each word from the handwritten text page image sample Symbol belonging to rectangle frame region the step of include:
According to the upper left point coordinate, the width value and the height value of each character, each character is calculated Lower-right most point coordinate;
According to the upper left point coordinate of each character and the lower-right most point coordinate, rectangle belonging to each character is defined Frame region.
Optionally, the markup information according to each character, from the handwritten text page image sample after covering treatment The step of marking off region belonging to the line of text to be extracted, includes: in example
The upper left point coordinate of each character is compared, to be determined from the upper left point coordinate of each character Minimum abscissa value and maximum ordinate value out;
The lower-right most point coordinate of each character is compared, with true from the lower-right most point coordinate value of each character Make maximum abscissa value and minimum ordinate value;
According to the minimum abscissa value, the maximum ordinate value, the maximum abscissa value and the minimum vertical seat Scale value determines region belonging to the line of text to be extracted, and marks off from the handwritten text page image sample after covering treatment Region belonging to the line of text to be extracted.
Optionally, the region in the handwritten text page image sample, in addition to the rectangle frame region defined Carry out covering treatment the step of include:
In the handwritten text page image sample, by the region in addition to the rectangle frame region defined, it is filled with institute State the background colour of handwritten text page image sample.
In addition, to achieve the above object, it is described to write the present invention also provides a kind of construction method of handwritten word identification model The construction method of identification model the following steps are included:
A handwriting text lines image is chosen from default handwriting text lines image to be stored as base-line data, it is described Default handwriting text lines image is obtained by training data processing method as described above;
When detecting the instruction of trained handwritten word identification model, according to the scene of described instruction carrying to the baseline of storage Data carry out the conversion process of different modes respectively, obtain several training datas;
According to obtained several training datas, the training set for training handwritten word identification model is constructed;
Trained handwritten word identification model is obtained using the training set training convolutional Recognition with Recurrent Neural Network model of building.
Optionally, the mode of the conversion process includes brightness regulation, rotation, translation, scaling, background colour change, inverse One of processing and increase background are a variety of.
Optionally, the training set training convolutional Recognition with Recurrent Neural Network model using building obtains trained handwritten word The step of identification model includes:
The parameter of loop initialization neural network model;
The training set of building is loaded onto convolution loop neural network model, according to formulaObtain the forward direction output of convolution loop neural network model, wherein a (t, u) indicates t moment The forward direction output of u-th of handwritten word,Indicate that t moment output is the probability in space, l'uIndicate the overall length of handwritten word and space Degree, a (t-1, i) indicate the forward direction output of i-th of handwritten word of t-1 moment;And
According to formulaObtain the backward output of convolution loop neural network model, wherein b (t, u) indicates the backward output of u-th of handwritten word of t moment,The probability that the expression t+1 moment exports as space, b (t+1, I) the backward output of i-th of handwritten word of t+1 moment is indicated;
The parameter that convolution loop neural network model is updated according to forward direction output and backward output, obtains trained Handwritten word identification model.
In addition, to achieve the above object, the present invention also provides training data processing unit, the training data processing unit Include:
Individual character labeling module, for obtaining handwritten text page image sample, and in the handwritten text page image sample Line of text to be extracted carry out individual character mark, obtain the markup information of each character in line of text to be extracted;
Module is defined, for the markup information according to each character, the circle from the handwritten text page image sample Make rectangle frame region belonging to each character;
Overlay module, for the area in the handwritten text page image sample, in addition to the rectangle frame region defined Domain carries out covering treatment;
Division module, for the markup information according to each character, from the handwritten text page image after covering treatment Region belonging to the line of text to be extracted is marked off in sample, and is cut, and is obtained for training handwritten word identification model Handwriting text lines image.
In addition, to achieve the above object, the present invention also provides a kind of training data processing equipment, the training data processing Equipment includes processor, memory and is stored on the memory and at the training data that can be executed by the processor Program is managed, wherein realizing such as above-mentioned training data processing side when the training data processing routine is executed by the processor The step of method.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium Training data processing routine is stored on storage medium, wherein realizing when the training data processing routine is executed by processor Such as the step of above-mentioned training data processing method.
The present invention provides a kind of training data processing method, obtains handwritten text page image sample, and to the hand-written text Line of text to be extracted in this page of image sample carries out individual character mark, obtains the mark letter of each character in line of text to be extracted Breath;According to the markup information of each character, defined belonging to each character from the handwritten text page image sample Rectangle frame region;To in the handwritten text page image sample, the region in addition to the rectangle frame region defined is covered Processing;According to the markup information of each character, marked off from the handwritten text page image sample after covering treatment described Region belonging to line of text to be extracted, and cut, obtain the handwriting text lines image for training handwritten word identification model. The present invention is by carrying out region segmentation and covering treatment to handwriting text lines image sample, to mark off line of text institute to be extracted The region of category, then cut, compared to the mode directly cut, the obtained handwriting text lines image of the present invention, not by The phenomenon that influence of uplink and downlink adjacent thereto will not be mingled with the character of uplink and downlink adjacent thereto, and also there is no character missings, The accuracy of handwriting text lines image is effectively increased, suitable for training handwritten word identification model.
Detailed description of the invention
Fig. 1 is the hardware structural diagram of training data processing equipment involved in the embodiment of the present invention;
Fig. 2 is the flow diagram of training data processing method first embodiment of the present invention;
Fig. 3 is the example handwritten page of text image sample that training data processing method first embodiment of the present invention is related to;
Fig. 4 is the covering treatment effect diagram that training data processing method first embodiment of the present invention is related to;
Fig. 5 is the example handwritten line of text image that training data processing method first embodiment of the present invention is cut;
Fig. 6 is the functional block diagram of training data processing unit first embodiment of the present invention;
Fig. 7 is the flow diagram of the construction method first embodiment of handwritten word identification model of the present invention;
Fig. 8 is the example base-line data that the construction method first embodiment of handwritten word identification model of the present invention is related to;
Fig. 9 is the inverse treatment effect signal that the construction method first embodiment of handwritten word identification model of the present invention is related to Figure.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present embodiments relate to training data processing method be mainly used in training data processing equipment, the training number It can be that personal computer (personal computer, PC), server etc. are having data processing function to be set according to processing equipment It is standby.
Referring to Fig.1, Fig. 1 is the hardware configuration signal of training data processing equipment involved in the embodiment of the present invention Figure.In the embodiment of the present invention, training data processing equipment may include (such as the central processing unit Central of processor 1001 Processing Unit, CPU), communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein, Communication bus 1002 is for realizing the connection communication between these components;User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard);Network interface 1004 optionally may include that the wired of standard connects Mouth, wireless interface (such as Wireless Fidelity WIreless-FIdelity, WI-FI interface);Memory 1005 can be high speed and deposit at random Access to memory (random access memory, RAM), is also possible to stable memory (non-volatile memory), Such as magnetic disk storage, memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.This field Technical staff is appreciated that hardware configuration shown in Fig. 1 and does not constitute a limitation of the invention, and may include more than illustrating Or less component, perhaps combine certain components or different component layouts.
With continued reference to Fig. 1, the memory 1005 in Fig. 1 as a kind of computer storage medium may include operating system, Network communication module and training data processing routine.In Fig. 1, processor 1001, which can call, to be stored in memory 1005 Training data processing routine, and the training data processing method of various embodiments of the present invention offer is provided.
The embodiment of the invention provides a kind of training data processing methods.
It is the flow diagram of training data processing method first embodiment of the present invention referring to Fig. 2, Fig. 2.
In the present embodiment, the training data processing method the following steps are included:
Step S10 obtains handwritten text page image sample, and to the text to be extracted in the handwritten text page image sample Current row carries out individual character mark, obtains the markup information of each character in line of text to be extracted;
Training data processing method in the present embodiment can be by the equipment having data processing function such as PC or server It realizes, the present embodiment is illustrated by taking server as an example.In the present embodiment, it need to be pre-configured with line of text extraction in the server Tool, line of text extracting tool are extracted from handwritten text page image sample mainly for the treatment of handwritten text page image sample Out for training the handwriting text lines image of handwritten word identification model.
Firstly, server obtains handwritten text page image sample, then by line of text extracting tool to hand-written page of text Line of text to be extracted in image sample carries out individual character mark, and individual character mark includes that classification annotation and position mark.Wherein, classify Mark is which word each character is in mark line of text to be extracted, by every in the available line of text to be extracted of classification annotation The label word of one character;Position mark is the upper left point coordinate of each character and its width value and height in mark line of text to be extracted Angle value, by position mark the upper left point coordinate (xi, yi) of each character in available line of text to be extracted, width value wi and Upper left point coordinate, width value and height value are defined as position by height value hi (i indicates i-th of character in line of text to be extracted) Confidence breath.So, by hand-written page of text image sample line of text to be extracted carry out individual character mark, can obtain to Extract the markup information (including label word and location information) of each character in line of text.
Step S20 is defined every according to the markup information of each character from the handwritten text page image sample Rectangle frame region belonging to one character;
Later, according to the markup information of character each in line of text to be extracted, defined from handwritten text page sample to Extract rectangle frame region belonging to each character in line of text.That is, being sat according to the upper left point of character each in line of text to be extracted (xi, yi), width value wi and height value hi are marked, the lower-right most point coordinate for obtaining each character in line of text to be extracted is calculated separately (Xi, Yi), wherein Xi=xi+wi, Yi=yi+hi.In this way, can be according to the upper left of character each in line of text to be extracted Point coordinate (xi, yi) and lower-right most point coordinate (Xi, Yi), define rectangle frame region belonging to each character, effect can join According to the example of Fig. 3.
Step S30, in the handwritten text page image sample, the region in addition to the rectangle frame region defined is carried out Covering treatment;
After defining rectangle frame region belonging to each character, in handwritten text page image sample, defined to removing Region except rectangle frame region out carries out covering treatment.Specifically, boundary will can be removed in handwritten text page image sample Area filling except the rectangle frame region made is the background colour of handwritten text page image sample (except the rectangle frame area defined The text in region except domain is also capped), for example in the example of Fig. 3, the background colour of handwritten text page image sample is white Color, then can be white by the area filling in addition to the rectangle frame region defined, as shown in Figure 4.
Step S40, according to the markup information of each character, from the handwritten text page image sample after covering treatment Region belonging to the line of text to be extracted is marked off, and is cut, is obtained for training the hand-written of handwritten word identification model Line of text image.
Later, according to the markup information of character each in line of text to be extracted, from the handwritten text page figure after covering treatment Region belonging to line of text to be extracted is marked off in decent example.Specifically, by the upper left point of character each in line of text to be extracted Coordinate (xi, yi) is compared, and determines the maximum value ymax in minimum value xmin, yi in xi, by the bottom right of each character Point coordinate (Xi, Yi) be compared, determine the minimum value Ymin in maximum value Xmax, Yi in Xi, then according to xmin, Ymax, Xmax and Ymin tetra- values determine the cut-off rule of line of text to be extracted, can determine that text to be extracted according to the cut-off rule Rectangle frame region belonging to current row, cuts rectangle frame region belonging to line of text to be extracted, can be obtained for training The handwriting text lines image of handwritten word identification model, effect can refer to the example of Fig. 5, from figure 5 it can be seen that by above-mentioned The handwriting text lines image that mode obtains, is not influenced by uplink and downlink adjacent thereto, is not also mingled with adjacent thereto upper The phenomenon that character of downlink, also there is no character missings, effectively increase the accuracy of handwriting text lines image.
The present embodiment provides a kind of training data processing method, handwritten text page image sample is obtained, and to described hand-written Line of text to be extracted in page of text image sample carries out individual character mark, obtains the mark letter of each character in line of text to be extracted Breath;According to the markup information of each character, defined belonging to each character from the handwritten text page image sample Rectangle frame region;To in the handwritten text page image sample, the region in addition to the rectangle frame region defined is covered Processing;According to the markup information of each character, marked off from the handwritten text page image sample after covering treatment described Region belonging to line of text to be extracted, and cut, obtain the handwriting text lines image for training handwritten word identification model. The present embodiment is by carrying out region segmentation and covering treatment to handwriting text lines image sample, to mark off line of text to be extracted Affiliated region, then cut, compared to the mode directly cut, the obtained handwriting text lines image of the present embodiment does not have Having is influenced by uplink and downlink adjacent thereto, and the character of uplink and downlink adjacent thereto will not be mingled with, and also there is no character missings Phenomenon effectively increases the accuracy of handwriting text lines image, suitable for training handwritten word identification model.
In addition, the embodiment of the present invention also provides a kind of training data processing unit.
Referring to figure, Fig. 6 is the functional block diagram of training data processing unit first embodiment of the present invention.
In the present embodiment, the training data processing unit includes:
Individual character labeling module 10, for obtaining handwritten text page image sample, and to the handwritten text page image sample In line of text to be extracted carry out individual character mark, obtain the markup information of each character in line of text to be extracted;
Module 20 is defined, for the markup information according to each character, from the handwritten text page image sample Define rectangle frame region belonging to each character;
Overlay module 30, for in the handwritten text page image sample, in addition to the rectangle frame region defined Region carries out covering treatment;
Division module 40, for the markup information according to each character, from the handwritten text page figure after covering treatment Region belonging to the line of text to be extracted is marked off in decent example, and is cut, and is obtained for training handwritten word to identify mould The handwriting text lines image of type.
Wherein, each virtual functions module of above-mentioned training data processing unit is stored in the processing of training data shown in Fig. 1 and sets It is functional for realizing the institute of training data processing routine in standby memory 1005;When each module is executed by processor 1001, Compared to the mode directly cut, the obtained handwriting text lines image of the present embodiment, not by uplink and downlink adjacent thereto The phenomenon that influencing, the character of uplink and downlink adjacent thereto will not be mingled with, also lacking there is no character, effectively increase handwritten text The accuracy of row image, suitable for training handwritten word identification model.
Further, the module 20 that defines includes:
Computing unit is calculated for the upper left point coordinate, the width value and the height value according to each character Obtain the lower-right most point coordinate of each character;
Unit is defined, for defining each word according to the upper left point coordinate of a character and the lower-right most point coordinate Rectangle frame region belonging to symbol.
Further, the division module 40 includes:
First determination unit, for the upper left point coordinate of each character to be compared, with from the institute of each character It states in the point coordinate of upper left and determines minimum abscissa value and maximum ordinate value;
Second determination unit, for the lower-right most point coordinate of each character to be compared, with from the institute of each character It states and determines maximum abscissa value and minimum ordinate value in lower-right most point coordinate value;
Division unit, for according to the minimum abscissa value, the maximum ordinate value, the maximum abscissa value and The minimum ordinate value determines region belonging to the line of text to be extracted, and from the handwritten text page image after covering treatment Region belonging to the line of text to be extracted is marked off in sample.
Further, the overlay module 30 further include:
Fills unit is used in the handwritten text page image sample, will be in addition to the rectangle frame region defined Region is filled with the background colour of the handwritten text page image sample.
Wherein, the function of modules is realized and above-mentioned training data processing method reality in above-mentioned training data processing unit It is corresponding to apply each step in example, function and realization process no longer repeat one by one here.
In addition, the embodiment of the present invention also provides a kind of computer readable storage medium.
Training data processing routine is stored on computer readable storage medium of the present invention, wherein the training data is handled When program is executed by processor, realize such as the step of above-mentioned training data processing method.
Wherein, training data processing routine, which is performed realized method, can refer to training data processing method of the present invention Each embodiment, details are not described herein again.
The present embodiments relate to the construction method of handwritten word identification model be mainly used in handwritten word identification model Equipment is constructed, the building equipment of the handwritten word identification model can be personal computer (personal computer, PC), clothes The equipment having data processing function such as business device.
The hardware configuration of the building equipment of handwritten word identification model involved in the embodiment of the present invention may include place It manages device (such as central processing unit Central Processing Unit, CPU), communication bus, user interface, network interface is deposited Reservoir.Wherein, communication bus is for realizing the connection communication between these components;User interface may include display screen (Display), input unit such as keyboard (Keyboard);Network interface optionally may include the wireline interface of standard, nothing Line interface (such as Wireless Fidelity WIreless-FIdelity, WI-FI interface);Memory can be high-speed random access memory (random access memory, RAM) is also possible to stable memory (non-volatile memory), such as disk Memory, memory optionally can also be the storage device independently of aforementioned processor.It will be understood by those skilled in the art that Above-mentioned hardware configuration does not constitute a limitation of the invention simultaneously, may include components more more or fewer than diagram, or combine certain A little components or different component layouts.
A kind of memory as computer storage medium may include operating system, network communication module and handwritten word The construction procedures of identification model.Processor can call the construction procedures of the handwritten word identification model stored in memory, and hold The construction method for the handwritten word identification model that row various embodiments of the present invention provide.
Further, propose that the first of the construction method of handwritten word identification model of the present invention implements based on first embodiment Example.
It is the flow diagram of the construction method first embodiment of handwritten word identification model of the present invention referring to Fig. 7, Fig. 7.
In the present embodiment, the handwritten word identification model construction method the following steps are included:
Step S50 chooses a handwriting text lines image from default handwriting text lines image and carries out as base-line data Storage;
After obtaining several handwriting text lines images by first embodiment, in the present embodiment, in order to be not take up server Memory space, only arbitrarily choose a handwriting text lines image from obtained handwriting text lines image and deposited as base-line data It is stored in the storage system of server.
Step S60, when detecting the instruction of trained handwritten word identification model, the scene carried according to described instruction is to depositing The base-line data of storage carries out the conversion process of different modes respectively, obtains several training datas;
Since in practice, trained handwritten word identification model needs to identify the handwritten word line of text figure under different scenes Picture, then for training the training sample of handwritten word identification model just to need comprising the handwritten word line of text image under different scenes. In the present embodiment, when server detects the instruction of trained handwritten word identification model, then according to the field carried in the instruction Scape carries out the conversion process of different modes to base-line data respectively, to construct training set on the basis of base-line data, meets The demand of training handwritten word identification model.Specifically, when server detects the instruction of trained handwritten word identification model, then root According to the scene carried in the instruction, correspondingly, base-line data is carried out respectively within the storage system brightness regulation, rotation, translation, One of modes such as scaling, the processing of background colour change, inverse and increase background or a variety of processing, such as the base-line data of Fig. 8 Example can carry out the processing that brightness is dimmed plus scaled to it, obtain first part of training data, can also carry out brightness tune to it The processing that dark padding translates downwards, obtains second part of training data, can also be converted its background colour such as will be white It is transformed to green and blue respectively, obtains third part training data and the 4th part of training data, it can also be carried out at inverse Reason, for example the color of character is adjusted to white, background color tone as black (effect can refer to Fig. 9), obtain the 5th part of trained number According to, etc., in this way, obtaining several training datas.
Step S70 constructs the training set for training handwritten word identification model according to obtained several training datas.
Later, training set can be formed according to obtained several training datas.
Step S80 obtains trained handwritten word using the training set training convolutional Recognition with Recurrent Neural Network model of building and knows Other model.
Further, using the training set training handwritten word identification model of building, specifically, handwritten word identification model is volume Product Recognition with Recurrent Neural Network model-CRNN (Convolutional-Recurrent Neural Networks) model, first initially Change the parameter of convolution loop neural network model, wherein the parameter includes weighted value and weighting value, then by the training set of building It is loaded onto convolution loop neural network model and is trained, obtain the forward direction output of convolution loop neural network model and backward (forward direction exports the probability for referring to u-th of the handwritten word exported sequentially in time, and backward output is defeated according to time opposite sequence for output The probability of u-th of handwritten word out), it can be according to formulaObtain convolution loop neural network mould The forward direction of type exports, wherein and a (t, u) indicates the forward direction output of u-th of handwritten word of t moment,Indicate that t moment output is The probability in space, l'uIndicate that the total length of handwritten word and space, a (t-1, i) indicate that the forward direction of i-th of handwritten word of t-1 moment is defeated Out;And according to formulaObtain the backward output of convolution loop neural network model, wherein b (t, u) indicates the backward output of u-th of handwritten word of t moment,The probability that the expression t+1 moment exports as space, b (t+1, I) it indicates the backward output of i-th of handwritten word of t+1 moment, later, calculates target output, base to output and backward output based on preceding Building loss function is exported in the target, further according to the loss function, using the backpropagation based on continuous time sorting algorithm Algorithm updates parameter, to obtain trained handwritten word identification model.
The present embodiment from several handwriting text lines images by choosing a handwriting text lines image as base-line data It is stored in the storage system of server, then base-line data is carried out according to the actual scene of training handwritten word identification model each The conversion process of kind different modes, can meet the needs of trained handwritten word identification model, in this way, just not needing in server A large amount of training data is stored in advance in storage system, memory space is greatly saved, while saving a large amount of training numbers of maintenance According to required cost.
In addition, the embodiment of the present invention also provides a kind of construction device of handwritten word identification model.
In the present embodiment, the construction device device of the handwritten word identification model includes:
Memory module, for choosing a handwriting text lines image from default handwriting text lines image as base-line data It is stored, the default handwriting text lines image is obtained by training data processing method as described above;
Conversion process module, for being carried according to described instruction when detecting the instruction of trained handwritten word identification model Scene carry out the conversion process of different modes respectively to the base-line data of storage, obtain several training datas;
Module is constructed, for constructing the training for training handwritten word identification model according to obtained several training datas Collection;
Training module, it is trained hand-written for being obtained using the training set training convolutional Recognition with Recurrent Neural Network model of building Word identification model.
Wherein, each virtual functions module of the construction device of above-mentioned handwritten word identification model is stored in handwritten word shown in Fig. 1 In the memory 1005 of the building equipment of identification model, the institute for realizing the construction procedures of handwritten word identification model is functional; When each module is executed by processor 1001, can meet the needs of trained handwritten word identification model.
Further, the training module includes:
Initialization unit, for initializing the parameter of convolution loop neural network model;
Forward direction exports acquiring unit, for the training set of building to be loaded onto convolution loop neural network model, according to FormulaObtain the forward direction output of convolution loop neural network model, wherein a (t, u) indicates t The forward direction of u-th of handwritten word of moment exports,Indicate that t moment output is the probability in space, l'uIndicate handwritten word and space Total length, a (t-1, i) indicate the forward direction output of i-th of handwritten word of t-1 moment;And
Backward output acquiring unit, for according to formulaObtain convolution loop neural network The backward output of model, wherein b (t, u) indicates the backward output of u-th of handwritten word of t moment,Indicate that the t+1 moment is defeated It is out the probability in space, b (t+1, i) indicates the backward output of i-th of handwritten word of t+1 moment;
Updating unit, for updating the ginseng of convolution loop neural network model according to forward direction output and backward output Number, obtains trained handwritten word identification model.
In addition, the embodiment of the present invention also provides a kind of computer readable storage medium.
The construction procedures of handwritten word identification model are stored on computer readable storage medium of the present invention, wherein described hand-written When the construction procedures of word identification model are executed by processor, the step of the construction method such as above-mentioned handwritten word identification model is realized Suddenly.
Wherein, the construction procedures of handwritten word identification model, which are performed realized method, can refer to handwritten word knowledge of the present invention Each embodiment of the construction method of other model, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of training data processing method, which is characterized in that the training data processing method the following steps are included:
Handwritten text page image sample is obtained, and individual character is carried out to the line of text to be extracted in the handwritten text page image sample Mark, obtains the markup information of each character in line of text to be extracted;
According to the markup information of each character, defined belonging to each character from the handwritten text page image sample Rectangle frame region;
To in the handwritten text page image sample, the region in addition to the rectangle frame region defined carries out covering treatment;
According to the markup information of each character, marked off from the handwritten text page image sample after covering treatment it is described to Region belonging to line of text is extracted, and is cut, the handwriting text lines image for training handwritten word identification model is obtained.
2. training data processing method as described in claim 1, which is characterized in that the markup information of each character includes Upper left point coordinate, width value and the height value of each character,
The markup information according to each character defines each character institute from the handwritten text page image sample The step of rectangle frame region of category includes:
According to the upper left point coordinate, the width value and the height value of each character, the right side of each character is calculated Lower coordinate;
According to the upper left point coordinate of each character and the lower-right most point coordinate, rectangle frame area belonging to each character is defined Domain.
3. training data processing method as claimed in claim 2, which is characterized in that the mark according to each character Information, the step of marking off region belonging to the line of text to be extracted from the handwritten text page image sample after covering treatment Include:
The upper left point coordinate of each character is compared, to be determined most from the upper left point coordinate of each character Small abscissa value and maximum ordinate value;
The lower-right most point coordinate of each character is compared, to be determined from the lower-right most point coordinate value of each character Maximum abscissa value and minimum ordinate value;
According to the minimum abscissa value, the maximum ordinate value, the maximum abscissa value and the minimum ordinate value It determines region belonging to the line of text to be extracted, and marks off from the handwritten text page image sample after covering treatment described Region belonging to line of text to be extracted.
4. training data processing method as described in claim 1, which is characterized in that described to the handwritten text page image sample In example, the step of region in addition to the rectangle frame region defined carries out covering treatment, includes:
In the handwritten text page image sample, by the region in addition to the rectangle frame region defined, it is filled with the hand Write the background colour of page of text image sample.
5. a kind of construction method of handwritten word identification model, which is characterized in that the construction method of the identification model of writing includes Following steps:
A handwriting text lines image is chosen from default handwriting text lines image to be stored as base-line data, it is described default Handwriting text lines image is obtained by training data processing method described in claim 1;
When detecting the instruction of trained handwritten word identification model, according to the scene of described instruction carrying to the base-line data of storage The conversion process for carrying out different modes respectively, obtains several training datas;
According to obtained several training datas, the training set for training handwritten word identification model is constructed;
Trained handwritten word identification model is obtained using the training set training convolutional Recognition with Recurrent Neural Network model of building.
6. the construction method of handwritten word identification model as claimed in claim 5, which is characterized in that the mode of the conversion process Including brightness regulation, rotation, translation, scaling, background colour change, inverse processing and increase one of background or a variety of.
7. the construction method of handwritten word identification model as claimed in claim 5, which is characterized in that the training using building Collecting the step of training convolution loop neural network model obtains trained handwritten word identification model includes:
Initialize the parameter of convolution loop neural network model;
The training set of building is loaded onto convolution loop neural network model, according to formulaIt obtains The forward direction of convolution loop neural network model is taken to export, wherein a (t, u) indicates the forward direction output of u-th of handwritten word of t moment,Indicate that t moment output is the probability in space, l'uIndicate that the total length of handwritten word and space, a (t-1, i) indicate the t-1 moment The forward direction output of i-th of handwritten word;And
According to formulaObtain the backward output of convolution loop neural network model, wherein b (t, u) Indicate the backward output of u-th of handwritten word of t moment,Indicate that the t+1 moment exports the probability for space, b (t+1, i) is indicated The backward output of i-th of handwritten word of t+1 moment;
The parameter that convolution loop neural network model is updated according to forward direction output and backward output, obtains trained hand-written Word identification model.
8. a kind of training data processing unit, which is characterized in that the training data processing unit includes:
Individual character labeling module, for obtaining handwritten text page image sample, and in the handwritten text page image sample to It extracts line of text and carries out individual character mark, obtain the markup information of each character in line of text to be extracted;
Module is defined, for the markup information according to each character, is defined from the handwritten text page image sample Rectangle frame region belonging to each character;
Overlay module, for in the handwritten text page image sample, region in addition to the rectangle frame region defined into Row covering treatment;
Division module, for the markup information according to each character, from the handwritten text page image sample after covering treatment In mark off region belonging to the line of text to be extracted, and cut, obtain the hand for training handwritten word identification model Write line of text image.
9. a kind of training data processing equipment, which is characterized in that the training data processing equipment include processor, memory, And it is stored in the training data processing routine that can be executed on the memory and by the processor, wherein the training data When processing routine is executed by the processor, training data processing method according to any one of claims 1 to 4 is realized Step.
10. a kind of computer readable storage medium, which is characterized in that be stored with trained number on the computer readable storage medium According to processing routine, wherein realizing such as any one of claims 1 to 4 when the training data processing routine is executed by processor The step of described training data processing method.
CN201910415398.8A 2019-05-17 2019-05-17 Training data processing method, device, equipment and computer readable storage medium Pending CN110321788A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910415398.8A CN110321788A (en) 2019-05-17 2019-05-17 Training data processing method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910415398.8A CN110321788A (en) 2019-05-17 2019-05-17 Training data processing method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110321788A true CN110321788A (en) 2019-10-11

Family

ID=68113215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910415398.8A Pending CN110321788A (en) 2019-05-17 2019-05-17 Training data processing method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110321788A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866501A (en) * 2019-11-19 2020-03-06 中国建设银行股份有限公司 Training data generation method, data identification method and computer storage medium
CN111144270A (en) * 2019-12-23 2020-05-12 智慧神州(北京)科技有限公司 Evaluation method and evaluation device for handwritten text neatness based on neural network
CN111476324A (en) * 2020-06-28 2020-07-31 平安国际智慧城市科技股份有限公司 Traffic data labeling method, device, equipment and medium based on artificial intelligence
CN112052852A (en) * 2020-09-09 2020-12-08 国家气象信息中心 Character recognition method of handwritten meteorological archive data based on deep learning
CN112784845A (en) * 2021-01-12 2021-05-11 安徽淘云科技有限公司 Handwritten character detection method, electronic equipment and storage device
CN113537222A (en) * 2020-04-17 2021-10-22 阿里巴巴集团控股有限公司 Data processing method, device and storage medium
CN114120305A (en) * 2021-11-26 2022-03-01 北京百度网讯科技有限公司 Training method of text classification model, and recognition method and device of text content
WO2023001112A1 (en) * 2021-07-19 2023-01-26 维沃移动通信有限公司 Text beautification method and apparatus, and readable storage medium and electronic device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016154466A1 (en) * 2015-03-25 2016-09-29 Alibaba Group Holding Limited Method and apparatus for generating text line classifier
CN107403130A (en) * 2017-04-19 2017-11-28 北京粉笔未来科技有限公司 A kind of character identifying method and character recognition device
CN108304814A (en) * 2018-02-08 2018-07-20 海南云江科技有限公司 A kind of construction method and computing device of literal type detection model
CN108345833A (en) * 2018-01-11 2018-07-31 深圳中兴网信科技有限公司 The recognition methods of mathematical formulae and system and computer equipment
CN108710866A (en) * 2018-06-04 2018-10-26 平安科技(深圳)有限公司 Chinese mold training method, Chinese characters recognition method, device, equipment and medium
CN109241904A (en) * 2018-08-31 2019-01-18 平安科技(深圳)有限公司 Text region model training, character recognition method, device, equipment and medium
CN109598272A (en) * 2019-01-11 2019-04-09 北京字节跳动网络技术有限公司 Recognition methods, device, equipment and the medium of character row image

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016154466A1 (en) * 2015-03-25 2016-09-29 Alibaba Group Holding Limited Method and apparatus for generating text line classifier
CN107403130A (en) * 2017-04-19 2017-11-28 北京粉笔未来科技有限公司 A kind of character identifying method and character recognition device
CN108345833A (en) * 2018-01-11 2018-07-31 深圳中兴网信科技有限公司 The recognition methods of mathematical formulae and system and computer equipment
CN108304814A (en) * 2018-02-08 2018-07-20 海南云江科技有限公司 A kind of construction method and computing device of literal type detection model
CN108710866A (en) * 2018-06-04 2018-10-26 平安科技(深圳)有限公司 Chinese mold training method, Chinese characters recognition method, device, equipment and medium
CN109241904A (en) * 2018-08-31 2019-01-18 平安科技(深圳)有限公司 Text region model training, character recognition method, device, equipment and medium
CN109598272A (en) * 2019-01-11 2019-04-09 北京字节跳动网络技术有限公司 Recognition methods, device, equipment and the medium of character row image

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866501A (en) * 2019-11-19 2020-03-06 中国建设银行股份有限公司 Training data generation method, data identification method and computer storage medium
CN110866501B (en) * 2019-11-19 2022-04-29 中国建设银行股份有限公司 Training data generation method, data identification method and computer storage medium
CN111144270A (en) * 2019-12-23 2020-05-12 智慧神州(北京)科技有限公司 Evaluation method and evaluation device for handwritten text neatness based on neural network
CN111144270B (en) * 2019-12-23 2023-05-05 智慧神州(北京)科技有限公司 Neural network-based handwritten text integrity evaluation method and evaluation device
CN113537222A (en) * 2020-04-17 2021-10-22 阿里巴巴集团控股有限公司 Data processing method, device and storage medium
CN111476324A (en) * 2020-06-28 2020-07-31 平安国际智慧城市科技股份有限公司 Traffic data labeling method, device, equipment and medium based on artificial intelligence
CN112052852A (en) * 2020-09-09 2020-12-08 国家气象信息中心 Character recognition method of handwritten meteorological archive data based on deep learning
CN112052852B (en) * 2020-09-09 2023-12-29 国家气象信息中心 Character recognition method of handwriting meteorological archive data based on deep learning
CN112784845A (en) * 2021-01-12 2021-05-11 安徽淘云科技有限公司 Handwritten character detection method, electronic equipment and storage device
WO2023001112A1 (en) * 2021-07-19 2023-01-26 维沃移动通信有限公司 Text beautification method and apparatus, and readable storage medium and electronic device
CN114120305A (en) * 2021-11-26 2022-03-01 北京百度网讯科技有限公司 Training method of text classification model, and recognition method and device of text content

Similar Documents

Publication Publication Date Title
CN110321788A (en) Training data processing method, device, equipment and computer readable storage medium
CN106778928B (en) Image processing method and device
CN107403130A (en) A kind of character identifying method and character recognition device
CN104463101B (en) Answer recognition methods and system for character property examination question
CN110780873B (en) Interface color adaptation method, device, computer equipment and storage medium
CN110414519A (en) A kind of recognition methods of picture character and its identification device
CN107808132A (en) A kind of scene image classification method for merging topic model
CN109448001B (en) Automatic picture clipping method
CN107993238A (en) A kind of head-and-shoulder area image partition method and device based on attention model
CN108229519A (en) The method, apparatus and system of image classification
CN109214327A (en) A kind of anti-face identification method based on PSO
CN110969129A (en) End-to-end tax bill text detection and identification method
CN106778852A (en) A kind of picture material recognition methods for correcting erroneous judgement
CN113223025B (en) Image processing method and device, and neural network training method and device
JP2005151282A (en) Apparatus and method of image processing, and program
CN109829071A (en) Face image searching method, server, computer equipment and storage medium
CN109064525A (en) A kind of picture format conversion method, device, equipment and storage medium
CN107689070A (en) Chart data structuring extracting method, electronic equipment and computer-readable recording medium
CN112487981A (en) MA-YOLO dynamic gesture rapid recognition method based on two-way segmentation
CN109920018A (en) Black-and-white photograph color recovery method, device and storage medium neural network based
CN113838158B (en) Image and video reconstruction method and device, terminal equipment and storage medium
CN112949649B (en) Text image identification method and device and computing equipment
US20210264191A1 (en) Method and device for picture generation, electronic device, and storage medium
CN106682670A (en) Method and system for identifying station caption
CN107122785A (en) Text identification method for establishing model and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination