Character recognition allows automatically recognizing an unknown character based on a trained recognition model with little or no human intervention. A number of character recognition algorithms have been developed and employed in real-world applications including, for example, optical character recognition applications for translating scanned images of handwritten, typewritten and/or printed documents.
Recent developments of mobile device technology open up a new opportunity for character recognition. Due to a small form factor of mobile devices, the mobile devices usually do not include a keyboard for user input. Even if a keyboard is provided by a mobile device, the keyboard tends to be very small and inconvenient to use, especially when a large amount of words or characters are needed to be input. Given this situation, character recognition has been considered as a plausible solution to this input problem. A user may input characters through a touch screen or a tablet of a mobile device and a recognition application of the mobile device may then recognize or translate the inputted characters based on a character recognition model. The use of character recognition not only saves the user from inputting the characters through a tiny keyboard, if any exists, but also reduces errors incurred because of mistakenly touching a wrong button on the keyboard due to a small size of the keyboard.
Although character recognition is welcome as a solution that is superior over a tiny keyboard, adopting character recognition in a mobile device is not without a problem. Generally, an accuracy of existing character recognition relies heavily on whether a character to be recognized is received in a predefined orientation, for example, in an upright position. The accuracy of the existing character recognition is sharply deteriorated as the character to be recognized deviates from the predefined orientation. In other words, the existing character recognition is not invariant to an orientation of a character to be recognized.
This summary introduces simplified concepts of character recognition, which are further described below in the Detailed Description. This summary is not intended to identify essential features of the claimed subject matter, nor is it intended for use in limiting the scope of the claimed subject matter.
This application describes example embodiments of character recognition. In one embodiment, a plurality of training characters, e.g., East Asian characters such as Chinese characters, Japanese characters, Korean character, etc., may be received. In one embodiment, prior to extracting features of each training character, each training character may first be rotated to a normalized orientation. By way of example and not limitation, each character may be rotated based on information of at least two points, e.g., a starting point and an ending point, of each stroke of the respective character. In some embodiments, after the plurality of training characters have been rotated, features of each training character may be extracted and used for training a recognition model. In one embodiment, upon training the recognition model, parameters of the recognition model may further be compressed or reduced. For example, parameters of the recognition model may be quantized. Additionally or alternatively, a tree may be constructed to facilitate recognition of an incoming character using the trained recognition model at run time.
In some embodiments, once a recognition model exists, a new unknown character may be received. The new unknown character may include one or more strokes. In one embodiment, prior to recognizing the new unknown character using the trained recognition model, the new unknown character may be rotated to a normalized orientation, for example, based on at least two points (e.g., a starting point and an ending point) of each stroke of the new unknown character. After the new unknown character is rotated to the normalized orientation, the rotated character may be recognized using the trained recognition model.
The detailed description is set forth with reference to the accompanying figures. In the figures, the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. The use of the same reference numbers in different figures indicates similar or identical items.
As noted above, a recognition accuracy of existing character recognition models depends heavily on whether a given character is received in a predetermined orientation. Any deviation of the given character from the predetermined orientation deteriorates the recognition accuracy of the character recognition models and renders the models error-prone. Often, users will input handwritten characters at angles that deviate from the predetermined orientation. This is particularly true when inputting characters via a touch screen of a mobile device, which may not be held at an anticipated orientation.
This disclosure describes a character recognition system, which rotates an incoming character to a normalized orientation prior to recognizing or translating the incoming character using a pre-trained recognition model. The normalized orientation need not necessarily correspond to a vertical or horizontal orientation of the character.
Generally, during a training stage of character recognition, the described system may receive training data, for example, a plurality of textual characters. The plurality of textual characters may include, but are not limited to, East Asian characters (such as Chinese characters, Korean characters, Japanese characters, etc.) and Middle East characters (such as Hebrew characters, Greek characters, Arabic characters, etc.). In one embodiment, the described system may pre-process each character by rotating each character to a respective normalized orientation (or by a respective angle of rotation) that is characteristic of relationship between at least two points (for example, a starting point and an ending point) of one or more strokes of a respective character. By way of example and not limitation, the described system may rotate a character to align a line from a weighted sum of coordinates of starting points of one or more strokes of the character to a weighted sum of coordinates of ending points of the one or more strokes of the character (or vice versa) with a predetermined normalized direction. In one embodiment, the one or more strokes of the character may include, for example, each stroke of the character, a subset of strokes of the character having properties (e.g., lengths) greater than or equal to a predetermined threshold, etc.
Upon rotating the plurality of characters, the described system may extract features from the plurality of rotated characters. Further, the described system may construct a recognition model (or classifier) based on the extracted features. In some embodiments, the described system may further refine the recognition model. For example, the described system may refine the recognition model with an objective function using an optimization algorithm (for example, resilient propagation (Rprop) algorithm, etc.). Additionally or alternatively, the described system may compress parameters of the recognition model using a technique such as split vector quantization (VQ) technique. Additionally or alternatively, in one embodiment, the described system may construct a tree, such as a two-level fast-match tree, for use to speed up recognition of an incoming or unknown character at run time using the recognition model.
In some embodiments, during a recognition stage, the described system may receive an incoming character, for example, that is inputted by a user. By way of example and not limitation, the described system may receive the incoming character inputted by the user through a touch screen or a tablet of a device that is written with a finger, a digital pen, a mouse, or the like. Additionally or alternatively, the described system may receive the incoming character from a document to be recognized or translated.
In response to receiving the incoming character, the described system may pre-process the incoming character, for example, by rotating the incoming character based on information of relationship between at least two points (for example, a starting point and an ending point) of one or more strokes of the incoming character as described above. Upon rotating the incoming character, the described system may extract features from the incoming character and recognize or translate the incoming character based on the extracted features and the pre-trained recognition model. In one embodiment, the described system may speed up recognition of the incoming character using the constructed two-level fast-match tree, for example. Upon successfully recognizing or translating the incoming character, the described system may provide a recognition result to the device which may display the recognition result to the user through a display (e.g., the touch screen) thereof or transmit the recognition result to an application therein for further manipulation. In some instances, the described system may perform recognition of an incoming character or part of a text at runtime substantially contemporaneously with the user inputting the incoming character or the text, while in other instances, the described system may perform recognition of an incoming character or part of a text after the user has entered the incoming character or the text.
The described system rotates an incoming character by an angle that is characteristic of one or more strokes of the incoming character, and transforms the incoming character to a normalized orientation for facilitating recognition of the incoming character. By rotating the incoming character to a normalized orientation prior to recognition, the described system allows character recognition to be less sensitive or more invariant to a received orientation of the incoming character, and thus increases a recognition accuracy of the character recognition model.
While in the examples described herein, the character recognition system rotates a character, extracts features from the character, recognizes the character, constructs a recognition model, refines the recognition model, compresses parameters of the recognition model, and constructs a search tree, and in other embodiments, these functions may be performed by multiple separate systems or services. For example, in one embodiment, a pre-processing service may pre-process the character, while a training service may train a recognition model, while a separate service may refine and/or compress the recognition model, and yet another service may recognize characters based on the recognition model.
The application describes multiple and varied implementations and embodiments. The following section describes an example environment that is suitable for practicing various implementations. Next, the application describes example systems, devices, and processes for implementing a character recognition system.
Although the character recognition system 102 in
The client device 104 may be implemented as any of a variety of conventional computing devices including, for example, a notebook or portable computer, a handheld device, a netbook, an Internet appliance, a portable reading device, an electronic book reader device, a tablet or slate computer, a game console, a mobile device (e.g., a mobile phone, a personal digital assistant, a smart phone, etc.), a media player, etc. or a combination thereof.
The network 108 may be a wireless or a wired network, or a combination thereof. The network 108 may be a collection of individual networks interconnected with each other and functioning as a single large network (e.g., the Internet or an intranet). Examples of such individual networks include, but are not limited to, telephone networks, cable networks, Local Area Networks (LANs), Wide Area Networks (WANs), and Metropolitan Area Networks (MANs). Further, the individual networks may be wireless or wired networks, or a combination thereof.
In one embodiment, the device 104 includes one or more processors 110 coupled to memory 112. The memory 112 includes one or more applications 114 (e.g., a character recognition application, a writing application, etc.) and other program data 116. The memory 112 may be coupled to, associated with, and/or accessible to other devices, such as network servers, routers, the server 106, and/or other client devices (not shown).
A user 118 of the client device 104 may want to input a character to the client device 104. For example, the user may employ a writing application of the client device 104 to write a character using a finger, a digital pen, a stylus, a mouse or the like on a touch screen, a tablet or other display of the client device 104. The writing application in this example may comprise a front-end application that may obtain a recognition result of the written character by communicating character data with the character recognition system 102 as a backend.
In response to receiving the character data from the writing application, the character recognition system 102 may recognize the character using a pre-trained recognition model included therein and return a recognition result to the writing application. For example, the character recognition system 102 may return a recognized textual result (e.g., in a specified font) to the writing application. In some embodiments, the character recognition system 102 or another system or application of the client device 104 or the server 106 may also translate the character from one language into another (e.g., Chinese to English).
In other embodiments, in which the client device 104 has sufficient processing capabilities, the character recognition may be implemented entirely by character recognition functionality (e.g., the functions of the character recognition system 102) at the client device 104.
The memory 206 may include computer-readable media in the form of volatile memory, such as Random Access Memory (RAM) and/or non-volatile memory, such as read only memory (ROM) or flash RAM. The memory 206 is an example of computer-readable media. Computer-readable media includes at least two types of computer-readable media, namely computer storage media and communications media.
Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, phase change memory (PRAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information for access by a computing device.
In contrast, communication media may embody computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave, or other transmission mechanism. As defined herein, computer storage media does not include communication media.
The memory 206 may include program modules 210 and program data 212. In one embodiment, the program modules 210 may include an acquisition module 214. The acquisition module 214 may obtain or retrieve data for training a recognition model from, for example, a character database 216 included in the character recognition system 102. Additionally or alternatively, the acquisition module 214 may obtain or retrieve training data from the client device 104 and/or server 106. In one embodiment, the training data may include, but is not limited to, previously scanned or captured copies of handwritten characters (of a particular user such as the user 118 or a plurality of users) that have been written with a finger, a stylus, etc., on a touch screen or tablet, for example, and typed characters, etc. In some embodiments, the training data may further include information about a writing trajectory of each stroke of each character. By way of example and not limitation, the trajectory information of a character may include, for example, temporal (e.g., timestamp) and spatial (e.g., coordinates) information of writing each stroke of the character. Additionally or alternatively, the training characters may include textual characters of a linguistic language including, for example, East Asian characters (e.g., Chinese characters, Korean characters, Japanese character, etc.), Middle East characters (such as Arabic characters, Hebrew characters, etc.), etc. In one embodiment, a character of the training characters or a character to be recognized may include L strokes, with a kth stroke of the character represented as a sequence of points Pk=(P1k, P2k, . . . , Pnk, . . . , PN
In response to obtaining the training data, the character recognition system 102 may further include a pre-processing module 218 to pre-process the training data to facilitate subsequent training of a recognition model. In one embodiment, the pre-processing module 218 may rotate a character of the training data by an angle (or to an orientation) that is characteristic of information of one or more strokes of the character.
In one embodiment, the pre-processing module 218 may rotate the character based on information of one or more points of one or more strokes of the character. In one embodiment, the one or more points may include, but are not limited to, a starting point, an ending point, a middle point, etc. Furthermore, the one or more strokes of the character may include, for example, all strokes of the character, a subset of strokes of the character having properties (e.g., lengths, etc.) greater than or equal to a predetermined threshold, etc. Additionally or alternatively, the one or more strokes of the character may include a predetermined number (or percentage) of the strokes of the character having properties (such as lengths, etc.) to be the highest in rank, and/or a first stroke and a last stroke of the character, etc.
Additionally or alternatively, the one or more strokes of the character may include, for example, remaining strokes of the character after ignoring strokes that are very likely prone to errors. For example, the pre-processing module 218 may ignore a stroke of the character if the stroke has a very short length, for example, less than a predetermined threshold or as compared to the rest of the strokes of the character (such as an average length of the strokes of the character).
By way of example and not limitation, upon receiving a given character (a training character or a character to be recognized), the pre-processing module 218 may compute a weighted sum for each of the one or more points of the one or more strokes of the character. The weighted sum may include, but is not limited to, a simple arithmetic sum, a sum weighted with respective lengths of associated one or more strokes (e.g., a weight coefficient is directly proportional to a length of associated stroke, etc.), etc. In one embodiment, as shown in
k=1
L
P
1
k (1)
Ē=Σ
k=1
L
P
N
K (2)
with (xS, yS) and (xE, yE) representing coordinates of
In one embodiment, the pre-processing module 218 may rotate or transform the character to cause a direction from
(xnk)new=xnk sin θ−ynk cos θ (3)
(ynk)new=ynk sin θ+xnk COS θ (4)
where θrepresents the direction from
Given the above rotation invariant transformation, the pre-processing module 218 may rotate or transform each training character in the training data to transform each character to a respective normalized orientation to facilitate a rotation-free or orientation-free recognition of a recognition model trained by the character recognition system 102 thereafter.
Additionally or alternatively, in some embodiments, the pre-processing module 218 may rotate the character based on directions (or vectors) of the one or more strokes of the character. For example, the pre-processing module 218 may compute a vector sum of the directions from starting points to ending points (or vice versa) of the one or more strokes of the character. The pre-processing module 218 may then rotate the character to align the vector sum to a predetermined direction, e.g., vertically downward or upwards, horizontally from left to right or from right or left, or in a predetermined angle from horizontal, etc.
Additionally or alternatively, in at least one embodiment, the pre-processing module 218 may further scale each character to a predetermined size. In one embodiment, the pre-processing module 218 may rescale a character based on a distance between the weighted sum of the starting points of the one or more strokes of the character and the weighted sum of the ending points of the one or more strokes of the character. For example, the pre-processing module 218 may scale a character to cause the distance between the weighted sum of the starting points of the one or more strokes of the character and the weighted sum of the ending points of the one or more strokes of the character to have a predetermined length. In some embodiments, the pre-processing module 218 may alternatively rescale the character to cause the vector sum of the directions from respective starting points to respective ending points (or vice versa) of the one or more strokes of the character to have a predetermined magnitude. Additionally or alternatively, the pre-processing module 218 may rescale the character using one or more conventional scaling methods.
In some embodiments, the pre-processing module 218 may further filter noises in the training characters. The noises in the training characters may include, but are not limited to, a noise due to scanning of the training characters, a noise due to reduction in resolution of images of the training characters, etc. In one embodiment, the pre-processing module 218 may filter the noises in the training characters using a low-pass filter.
Upon pre-processing the training characters (e.g., rotating the training characters to respective normalized directions or orientations), the character recognition system 102 may further include a feature extraction module 220 to extract features or feature vectors from each training character of the training data. In one embodiment, the feature extraction module 220 may extract directional features (such as north, east, south, west, etc.) of a (rotated) training character by analyzing trajectories of the strokes of the training character. In some embodiments, the feature extraction module 220 may employ a feature extraction algorithm as described in Z. L. Bai et al., “A Study on the Use of 8-Directional Features for Online Handwritten Chinese Character Recognition,” Proceedings of the Eighth International Conference on Document Analysis and Recognition, 2005. Additionally or alternatively, the feature extraction module 220 may extract the features of each training character using one or more conventional feature extraction algorithms including, for example, wavelet transform, Gabor filtering, gradient features, etc.
In one embodiment, upon extracting the features of each training character, the character recognition system 102 may further include a dimension reduction module 222 to reduce the number of dimensions of the extracted features to obtain lower-dimensional features. In one embodiment, the dimension reduction module 222 may reduce the number of dimensions of the extracted features using one or more dimensionality reduction algorithms including, for example, linear discriminant analysis (LDA), principal component analysis (PCA), independent component analysis (ICA), singular value decomposition (SVD), factor analysis (FA), etc.
In some embodiments, the character recognition system 102 may further include a training module 224. The training module 224 may train a recognition model based on the extracted features of the training characters. By way of example and not limitation, the recognition model may include a multi-prototype based classifier including a plurality of character classes denoted as {Ci|i=1, . . . , M}, where M represents the number of character classes. In one embodiment, the training module 224 may construct multi-prototype based classifier or the plurality of character classes using, for example, a clustering algorithm. Examples of the clustering algorithm may include, but are not limited to, Linde-Buzo-Gray (LBG) clustering algorithm, self-organizing map (SOM) algorithm, k-means clustering algorithm, hierarchical clustering algorithm, density based clustering algorithm, distribution-based clustering algorithm, etc.
In one embodiment, given a set of training features (i.e., the extracted features of the training characters), X={xrεRD|r=1, . . . , R} with respective labels L={ir=1, . . . , R}, where D represents the number of dimensions of the training features and R represents the number of training features, the training module 224 may represent each class Ci by Ki prototypes, with λi={mik εRD|k=1, . . . Ki}, where mik represents the kth prototype of the ith class Ci. With Λ={λi} denoting a set of prototypes of the multi-prototype based classifier (or recognition model), the training module 224 may estimate or refine the set of prototypes, Λ, by minimizing an objective function using an optimization algorithm, for example.
By way of example and not limitation, the training module 224 may employ a sample-separation-margin (SSM) based minimum classification error (MCE) objective function. For example, the training module 224 may employ the following objective function for estimating the set of prototypes in the recognition model:
In Equation (7), α (e.g., 7, etc.) and β (e.g., 0, etc.) represent two control parameters, and d(xr, ir; Λ) represents a misclassification measure defined by the SSM as described in the following:
where
{circumflex over (k)}=arg mink∥xr−mi
q=arg maxiε
=arg mink∥xr−mqk∥2 (11)
and r is a hypothesis space for the rth sample, excluding the true label ir.
In one embodiment, the training module 224 may optimize or minimize the objective function using a Quickprop or modified Quickprop procedure as described in Y. Q. Wang et al., “A Study of Designing Compact Recognizers of Handwritten Chinese Characters Using Multiple-Prototype Based Classifier,” Proc. ICPR 2010, pp. 1872-1875. In some embodiments, the training module 224 may optimize or minimize the objective function using an improved resilient propagation (Rprop) algorithm. By way of example and not limitation, the training module 224 may optimize or minimize the objective function using the following procedures:
At iteration t=0, the training module 224 may define an increase factor, η+ (e.g., 1.1, 1.2, etc.) and a decrease factor, η− (e.g., 0.1, 0.5, etc.). In one embodiment, the training module 224 may define the increase factor and the decrease factor with a relationship, for example, 0<η−<1<η+. In some embodiments, the training module 224 may further compute a derivative of l(X, L; Λ) defined in Equation (7) with respect to each mikd and update prototype parameters indicated as follows:
mikd is the dth element of mik, mikd(t)=mikd. Δikd(t)=Δ0, an initial step size (e.g., 0.01, 0.05, etc.) with Δmax (such as 50, 40, etc.) and Δmin (such as 0, 1, etc.) being an upper bound and a lower bound of allowable step size respectively. Furthermore,
is defined as:
At iteration t=t+1, a parameter, S, is defined as follows:
In one embodiment, the training module 224 may employ one or more improved versions of Rprop algorithms to significantly improve a learning speed of the recognition model. For example, the training module 224 may employ the following one or more improved versions of Rprop algorithms for updating parameters of the recognition model (or the prototypes):
Rprop−:
Rprop+:
iRprop−:
iRprop+:
In one embodiment, the training module 224 may repeat the above iteration for a predetermined number of times, (TR−1) times, e.g., 100, 200, etc. Furthermore, the training module 224 may compute the derivative of the above objective function as follows:
In some embodiments, upon refining or optimizing the recognition model, the training module 224 may compress the parameters of the recognition model. In one embodiment, the training module 224 may compress the parameters of the recognition model using a parameter compression algorithm or a parameter quantization algorithm, such as a split vector quantization (VQ) algorithm.
Additionally or alternatively, the training module 224 may construct a search tree to speed up recognition of incoming characters. In one embodiment, the training module 224 may construct a two-level fast-match tree by clustering the prototypes of all classes into a plurality of groups (e.g., G groups) using a clustering algorithm such as a k-means clustering algorithm. In some embodiments, the training module 224 may compute a centroid of each group as a sample mean of prototypes belonging to that group. Each group may include a bucket including one or more character classes with respective prototypes belonging to that group. In one embodiment, the training module 224 may classify a training character (or features of the training character) into a particular group if a distance (e.g., an Euclidean distance) between the training character (or features of the training character) and the centroid of that particular group is minimum among the plurality of groups. The training module 224 may then add a character class associated with that training character into the bucket of that particular group if the character class has not been added thereto. In some instances, the training module 224 may further sort the plurality of groups and/or the one or more character classes in respective buckets in a descending order, for example, based on respective number of training characters associated with the one or more character classes encountered in respective buckets of the groups.
In one embodiment, the character recognition system 102 may further include a model database 226 to store the trained recognition model. For example, the model database 226 may store a plurality of trained recognition models for a plurality of different linguistic characters such as East Asian characters including, for example, Chinese characters, Japanese characters, Korean characters, etc. In some embodiments, the character recognition system 102 may further include a search tree database 228 to store information of a search tree for the trained recognition model obtained by the character recognition system 102.
In some embodiments, the character recognition system 102 may further include a receiving module 230 to receive an incoming or unknown character inputted by the user 118 through the client device 104, for example. Additionally, in some embodiments, the receiving module 230 may further receive information associated with the incoming character. By way of example and not limitation, the receiving module 230 may receive information of a linguistic language to which the incoming character belongs. For example, the receiving module 230 may receive information of a linguistic language used by an application of the client device 104 from which the incoming or unknown character is received, and infer that this linguistic language is the same linguistic language to which the incoming character belongs. Additionally or alternatively, the receiving module 230 may receive the information of the linguistic language to which the incoming character belongs from the user 118. For example, the user 118 may indicate to the character recognition system 102 that the user 118 is writing a character of a particular linguistic language through an application of the client device 104. In one embodiment, in response to receiving the incoming character, the receiving module 230 may transfer the incoming character to the pre-processing module 218 to pre-process the incoming character. The pre-processing module 218 may pre-process the incoming character in the same manner as processing a training character during a training stage.
In one embodiment, upon pre-processing the incoming character, the pre-processing module 218 may transmit the pre-processed character to the feature extraction module 220 to extract features from the pre-processed character as described in the foregoing embodiments. Upon extracting the features of the pre-processed character, the character recognition system 102 may further include a recognition module 232 to recognize the incoming character based on the trained recognition model. In some embodiments, the recognition module 232 may compare the features of the incoming character with the recognition model. Using a multi-prototype based classifier as a pre-trained recognition model as an example. The recognition module 232 may compare the features of the incoming character with each class of the multi-prototype based classifier by evaluating, for example, an Euclidean distance based discriminant function for each class Ci as follows:
g
i(x; λi)=−mink∥x−mik∥2 (42)
In one embodiment, the recognition module 232 may select a class having the minimum Euclidean distance with the features of the incoming character or a class having the maximum discriminant function score as a recognized class, r(x; Λ), of the incoming character, i.e.,
r(x; Λ)=arg maxigi(x; λi) (43)
In alternative embodiments, the recognition module 232 may employ the pre-constructed search tree to speed up recognition of the incoming character. By way of example and not limitation, upon obtaining the extracted features of the incoming character, the recognition module 232 may compare the extracted features with centroids of the plurality of groups associated with the search tree (e.g., the two-level fast-match tree). The recognition module 232 may then sort or rank the plurality of groups in an ascending order of Euclidean distances between the extracted features of the incoming character and the centroids of the plurality of groups, having a rank to be higher for smaller Euclidean distance. Upon obtained a sorted list of the plurality of groups, the recognition module 232 may select the highest ranked group or a predetermined number (e.g., 2, 5, 10, etc.) of highest ranked groups in the sorted list, and compare the extracted features of the incoming character with character classes, Ci, that are included in the highest ranked group or the predetermined number (e.g., 2, 5, 10, etc.) of highest ranked groups in the sorted list. In one embodiment, the recognition module 232 may select a character class that has a minimum Euclidean distance with the extracted features of the incoming character as a recognized class for the incoming character from among these selected character classes, Ci.
In some embodiments, the recognition module 232 may select more than one character classes as recognized classes for the incoming character. By way of example and not limitation, the recognition module 232 may select a predetermined number of character classes (e.g., the first few character classes having the smallest Euclidean distances from the extracted features of the incoming character) from the trained recognition model as recognized classes for the incoming character. In one embodiment, the recognition module 232 may further include a confidence score for each selected character class, which may be in terms of a reciprocal of respective Euclidean distance with the features of the incoming character, for example.
In response to recognizing the incoming character, the character recognition system 102 may include a sending module 234 to send a recognition result to the client device 104 which may display the recognition result to the user 118 or transmit the recognition result to an application, such as the writing application, of the client device 104 for further manipulation. In one embodiment, the recognition result may include, for example, a translation result of a typed and clear character representing a recognized class of the incoming character if a single character class is selected as the recognized class for the incoming character. In some embodiments, the recognition result may include, a translation result of a plurality of typed and clear characters representing a plurality of recognized classes of the incoming character if more than one classes are selected as the recognized classes for the incoming character. In one embodiment, the plurality of typed and clear characters representing the plurality of recognized classes of the incoming character may be arranged in a descending order of respective confidence scores. In some embodiments, the recognition result may further include respective confidence scores for the recognized classes to allow the client device 104 for displaying to the user 118, for example.
In response to receiving the recognition result, the client device 104 may display the recognition result to the user 118 through a display or a touch screen thereof. In one embodiment, the client device 104 may further allow the user 118 to accept or reject the recognition result. Additionally or alternatively, in an event that more than one typed characters representing more than one recognized character classes are displayed, the client device 104 may further allow the user 118 to select a correct character class from the typed characters. In some embodiments, the client device 104 may send information of this selection or information of user acceptance or rejection of the recognition result to the character recognition system 102 for future re-training or refining of the trained recognition model stored in the character recognition system 102. In one embodiment, the character recognition system 102 may store this information in other program data 236 for future re-training and/or refining of the trained recognition model.
Although the foregoing embodiments describe the training characters and/or the incoming (or unknown) character to be online handwritten characters, i.e., characters having trajectory information (such as coordinates of starting points and ending points, or coordinates of sequences of points, for example) of strokes, the present disclosure is not limited thereto. In one embodiment, the character recognition system 102 may further be used for recognizing an incoming handwritten character (or typed characters) that include no trajectory information (such as coordinates of starting points and ending points, for example) of strokes thereof. In one embodiment, the character recognition system 102 may adopt one or more heuristic strategies or assumptions to determine trajectory information of each stroke of an incoming or unknown character. For example, the character recognition system 102 may adopt one or more conventional ways of writing characters in a particular linguistic language to aid in determining the trajectory information of each stroke of the incoming or unknown character. By way of example and not limitation, the character recognition system 102 may adopt the one or more conventional ways of writing characters to be writing in a direction from left to right and writing in a direction from top to bottom. Once the character recognition system 102 partitions an incoming character into a plurality of strokes, the character recognition system 102 may apply these one or more heuristic strategies to determine, for example, a starting point and an ending point of each stroke of the incoming character. The character recognition system 102 may then pre-process the character, extract features from the character, and recognize the character as described in the foregoing embodiments.
Methods 400 and 500 are described in the general context of computer-executable instructions. Generally, computer-executable instructions can include routines, programs, objects, components, data structures, procedures, modules, functions, and the like that perform particular functions or implement particular abstract data types. The methods can also be practiced in a distributed computing environment where functions are performed by remote processing devices that are linked through a communication network. In a distributed computing environment, computer-executable instructions may be located in local and/or remote computer storage media, including memory storage devices.
The exemplary methods are illustrated as a collection of blocks in a logical flow graph representing a sequence of operations that can be implemented in hardware, software, firmware, or a combination thereof. The order in which the methods are described is not intended to be construed as a limitation, and any number of the described method blocks can be combined in any order to implement the method, or alternate methods. Additionally, individual blocks may be omitted from the method without departing from the spirit and scope of the subject matter described herein. In the context of software, the blocks represent computer instructions that, when executed by one or more processors, perform the recited operations. In the context of hardware, some or all of the blocks may represent application specific integrated circuits (ASICs) or other physical components that perform the recited operations.
Referring back to
At block 404, in response to receiving the training data, the character recognition system 102 may pre-process the training data. In one embodiment, the character recognition system 102 may rotate each training character to a respective normalized orientation and/or rescale each training character to a predetermined size. For example, the character recognition system 102 may rotate a training character based on relationship between at least two points (such as a starting point and an ending point) of one or more strokes of the training character. In some embodiments, the character recognition system 102 may additionally or alternatively rescale the training character based on another relationship between at least two points of one or more strokes of the training character, e.g., a distance between a weighted sum of coordinates of starting points and a weighted sum of coordinates of ending points of one or more strokes of the character. Additionally or alternatively, the character recognition system 102 may filter noise in the training character (e.g., noises introduced in scanning the training character and/or saving the training character in a compressed or lower resolution image) based on a low-pass filter, for example.
At block 406, upon pre-processing the training characters, the character recognition system 102 may extract features from the training characters. In some embodiments, the recognition system 102 may further compress the dimension (or reduce a number of dimensions) of the features using one or more dimensionality reduction methods.
At block 408, in response to obtaining the features of the training characters, the character recognition system 102 may construct a recognition model using, for example, a clustering algorithm (e.g., LBG clustering algorithm) to obtain a multi-prototype based classifier. The character recognition system 102 may train the recognition model using a predetermined training algorithm. By way of example and not limitation, the character recognition system 102 may define an objective function using the sample-separation-margin based minimum classification error technique and optimize or minimize the defined objective function using one or more improved Rprop (i.e., Rprop−, Rprop+, iRpro− and iRprop+) algorithms.
At block 410, upon obtaining a recognition model, the character recognition system 102 may compress parameters of the recognition model, for example, using the split vector quantization technique.
At block 412, the character recognition system 102 may construct a search tree (e.g., a two-level fast-match tree) to group character classes of the recognition model into a plurality of groups to speed up recognition of incoming or unknown characters at run time.
Referring back to
At block 504, in response to receiving the incoming character, the character recognition system 102 may pre-process the incoming character. For example, the character recognition system 102 may rotate and rescale the incoming character. In some embodiments, the character recognition system 102 may further filter noises from the incoming character.
At block 506, upon pre-processing the incoming character, the character recognition system 102 may recognize the incoming character using a pre-trained recognition model. In one embodiment, the character recognition system 102 may select one or more character classes of the pre-trained recognition model as one or more recognized classes for the incoming character based on respective confidence scores obtained from the pre-trained recognition model.
At block 508, upon obtaining the one or more recognized classes for the incoming character, the character recognition system 102 may send a recognition or translation result to the client device 104. In one embodiment, the character recognition system 102 may send information of the best recognized class to the client device 104. In some embodiments, the character recognition system 102 may send information of a predetermined number of best-matched (i.e., having highest confidence scores) recognized classes to the client device 104. In one embodiment, the information sent may include, but is not limited to, a typed and clear character for each recognized class sent. Additionally, in one embodiment, the information sent may further include a confidence score for each recognized class sent.
At block 510, the character recognition system 102 may wait for another incoming character or a feedback regarding the recognition result from the client device 104. In one embodiment, the feedback may include, but is limited to, a user acceptance or rejection of the recognition result that is sent from the client device 104 with or without knowledge of the user 118. Additionally or alternatively, in some embodiments, the feedback may include information of a selection of one of the sent characters of recognized classes by the user 118.
Although the above acts are described to be performed by the character recognition system 102, one or more acts that are performed by the character recognition system 102 may be performed by the client device 104 or other software or hardware of the client device 104 and/or any other computing device (e.g., the server 106), and vice versa. For example, the client device 104 may include mechanism and/or processing capability to rotate a character and extract features from the rotated character. The client device 104 may then send these extracted features to the character recognition system 102 for character recognition.
Furthermore, the client device 104 and the character recognition system 102 may cooperate to complete an act that is described to be performed by the character recognition system 102. For example, the client device 104 may continuously send character data or extracted features of the character data to the character recognition system 102 through the network 108. The character recognition system 102 may iteratively recognize the character data or the extracted features of the character data using the pre-trained recognition model. The character recognition system 102 may continuously send a recognition or translation result of the character data to the client device 104 to allow the user 118 of the client device 104 to provide feedback about the recognition or translation result.
Any of the acts of any of the methods described herein may be implemented at least partially by a processor or other electronic device based on instructions stored on one or more computer-readable media. By way of example and not limitation, any of the acts of any of the methods described herein may be implemented under control of one or more processors configured with executable instructions that may be stored on one or more computer-readable media such as one or more computer storage media.
Although the invention has been described in language specific to structural features and/or methodological acts, it is to be understood that the invention is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as exemplary forms of implementing the invention.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/CN2012/072891 | 3/23/2012 | WO | 00 | 7/24/2012 |