CN113496263A - Character recognition method and device and character recognition chip - Google Patents
Character recognition method and device and character recognition chip Download PDFInfo
- Publication number
- CN113496263A CN113496263A CN202010191338.5A CN202010191338A CN113496263A CN 113496263 A CN113496263 A CN 113496263A CN 202010191338 A CN202010191338 A CN 202010191338A CN 113496263 A CN113496263 A CN 113496263A
- Authority
- CN
- China
- Prior art keywords
- neural network
- character
- convolutional neural
- feature matrix
- character recognition
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Character Discrimination (AREA)
Abstract
The embodiment of the application provides a character recognition method, a device and a character recognition chip, comprising the following steps: acquiring track data of the character to be recognized, wherein the track data is used for indicating a writing track of the character to be recognized; acquiring a character feature matrix of the character to be recognized according to the track data; inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the convolutional neural network comprises at least one convolutional layer, and a convolutional core in the convolutional layer is used for performing gradient calculation with a corresponding region in the feature matrix input into the convolutional layer. According to the scheme, abundant features can be extracted from the character feature matrix, the generalization capability of the convolutional neural network is stronger, and the adaptability of the scheme to fresh samples is better, so that the identification accuracy is improved, and the user experience is improved.
Description
Technical Field
The embodiment of the application relates to the technical field of character recognition, in particular to a character recognition method, character recognition equipment and a character recognition chip.
Background
Character recognition is an important field in computer vision, and in the related art, characters in handwritten characters can be recognized through a trained neural network.
In the above scheme, although the characters in the handwritten characters can be recognized, the trained neural network often contains a large amount of information, so that less information is extracted from the handwritten characters during recognition, the recognition accuracy of the trained neural network on character recognition is reduced, and the user experience is damaged.
Disclosure of Invention
In view of this, embodiments of the present invention provide a character recognition method, a device and a character recognition chip, so as to overcome the defects in the prior art that when characters in handwritten characters are recognized, less information is extracted from the handwritten characters, and the recognition accuracy of character recognition is low.
The embodiment of the application provides a character recognition method, which comprises the following steps:
acquiring track data of the character to be recognized, wherein the track data is used for indicating a writing track of the character to be recognized;
acquiring a character feature matrix of the character to be recognized according to the track data;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the convolutional neural network comprises at least one convolutional layer, and a convolutional core in the convolutional layer is used for performing gradient calculation with a corresponding region in the feature matrix input into the convolutional layer.
Optionally, in an embodiment of the present application, the weight of a specified point in the convolution kernel is a maximum weight, and the weights of other points in the convolution kernel are inversely related to the close distance from the specified point to the specified point.
Optionally, in an embodiment of the present application, the convolution kernels in the convolutional layer are used for performing gradient calculation in a specified direction with the corresponding region in the feature matrix of the input convolutional layer, and the specified direction includes a vertical gradient, a horizontal gradient, an upper-right gradient, and an upper-left gradient.
Optionally, in an embodiment of the present application, the method further includes:
selecting a plurality of sampling points on the writing track according to the track data;
acquiring a direction vector between each sampling point and an adjacent sampling point;
generating a direction characteristic matrix, wherein the direction characteristic matrix comprises the direction vector sum of the direction vectors of the plurality of sampling points in a plurality of directions, or the direction characteristic matrix comprises the direction type number sum of the direction vectors of the plurality of sampling points;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the character recognition result comprises the following steps:
inputting the character feature matrix into a convolutional neural network, enabling the input of a full connection layer in the convolutional neural network to comprise a direction feature matrix, and acquiring a character recognition result according to the output of the convolutional neural network.
Optionally, in an embodiment of the present application, the method further includes:
acquiring a contour feature matrix of the writing track according to the track data, wherein the contour feature matrix comprises an area between the writing track and an upper boundary of the image, an area between the writing track and a lower boundary of the image, an area between the writing track and a left boundary of the image, and an area between the writing track and a right boundary of the image;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the character recognition result comprises the following steps:
inputting the character feature matrix into a convolutional neural network, enabling the input of a full connection layer in the convolutional neural network to comprise a contour feature matrix, and acquiring a character recognition result according to the output of the convolutional neural network.
Optionally, in an embodiment of the present application, the method further includes:
acquiring the area characteristic of the writing track according to the track data, wherein the area characteristic is the difference between a first point sum and a second point sum, the first point sum is the sum of the points of the upper half track point and the right half track point in the writing track, and the second point sum is the sum of the points of the lower half track point and the left half track point in the writing track;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the character recognition result comprises the following steps:
inputting the character feature matrix into a convolutional neural network, enabling the input of a full connection layer in the convolutional neural network to comprise an area feature, and acquiring a character recognition result according to the output of the convolutional neural network.
Optionally, in an embodiment of the present application, the method further includes:
acquiring a square grid layout characteristic matrix of the writing track according to the track data, wherein the square grid layout characteristic matrix comprises the number of points of pixels of the writing track in each area after the writing track is divided into a plurality of areas;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the character recognition result comprises the following steps:
inputting the character feature matrix into a convolutional neural network, enabling the input of a full connection layer in the convolutional neural network to comprise a square grid layout feature matrix, and acquiring a character recognition result according to the output of the convolutional neural network.
Optionally, in an embodiment of the present application, the method further includes:
acquiring an aspect ratio characteristic of the writing track according to the track data, wherein the aspect ratio characteristic is the length of the minimum circumscribed rectangle of the writing track divided by the width of the minimum circumscribed rectangle of the writing track;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the character recognition result comprises the following steps:
inputting the character feature matrix into a convolutional neural network, enabling the input of a full connection layer in the convolutional neural network to comprise the aspect ratio feature, and acquiring a character recognition result according to the output of the convolutional neural network.
An embodiment of the present application provides a character recognition apparatus, including: the device comprises a track data acquisition module, a character matrix acquisition module and a character recognition module;
the track data acquisition module is used for acquiring track data of the characters to be recognized, and the track data is used for indicating the writing track of the characters to be recognized;
the character matrix acquisition module is used for acquiring a character feature matrix of the character to be recognized according to the track data;
and the character recognition module is used for inputting the character characteristic matrix into a convolutional neural network and acquiring a character recognition result according to the output of the convolutional neural network, wherein the convolutional neural network comprises at least one convolutional layer, and a convolutional core in the convolutional layer is used for performing gradient calculation with a corresponding region in the characteristic matrix input into the convolutional layer.
The embodiment of the application provides a character recognition chip, and the character recognition chip calls a stored program to realize the following method:
acquiring track data of the character to be recognized, wherein the track data is used for indicating a writing track of the character to be recognized;
acquiring a character feature matrix of the character to be recognized according to the track data;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the convolutional neural network comprises at least one convolutional layer, and a convolutional core in the convolutional layer is used for performing gradient calculation with a corresponding region in the feature matrix input into the convolutional layer.
In the embodiment of the application, the track data of the character to be recognized is acquired, the character feature matrix of the character to be recognized is acquired according to the track data, the character feature matrix is input into the convolutional neural network, and the character recognition result is acquired according to the output of the convolutional neural network.
Drawings
Some specific embodiments of the present application will be described in detail hereinafter by way of illustration and not limitation with reference to the accompanying drawings. The same reference numbers in the drawings identify the same or similar elements or components. Those skilled in the art will appreciate that the drawings are not necessarily drawn to scale. In the drawings:
fig. 1 is a schematic flow chart of a character recognition method provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a convolutional neural network provided in an embodiment of the present application;
FIG. 3 is a schematic flow chart of a character recognition method provided by an embodiment of the present application;
FIG. 4 is a schematic flow chart of a character recognition method provided by an embodiment of the present application;
FIG. 5 is a schematic flow chart of a character recognition method provided by an embodiment of the present application;
FIG. 6 is a schematic flow chart of a character recognition method provided by an embodiment of the present application;
FIG. 7 is a schematic flow chart of a character recognition method provided by an embodiment of the present application;
FIG. 8 is a schematic block diagram of a convolutional neural network provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a character recognition apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following further describes specific implementation of the embodiments of the present invention with reference to the drawings.
Example one
Fig. 1 shows a schematic flowchart of a character recognition method provided in an embodiment of the present application, where fig. 1 is a flowchart of a character recognition method provided in an embodiment of the present application. The character recognition method comprises the following steps:
101. and acquiring track data of the character to be recognized.
Wherein the trajectory data is used to indicate a composition trajectory of the character to be recognized.
102. And acquiring a character feature matrix of the character to be recognized according to the track data.
The character feature matrix of the character to be recognized is obtained according to the trajectory data, which can be understood as generating a standard image of the trajectory according to the trajectory data, preprocessing the image (for example, converting the image into a gray image), and then extracting features of the preprocessed image to obtain the character feature matrix of the character to be recognized.
103. And inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network.
The convolutional neural network comprises at least one convolutional layer, and the convolutional core in the convolutional layer is used for carrying out gradient calculation with the corresponding region in the characteristic matrix of the input convolutional layer.
Specifically, the weight of a specified point in the convolution kernel may be specified as a maximum weight, and the weights of other points in the convolution kernel are inversely related to the close distance from the specified point to the specified point.
For example, the weight W of a point with coordinates (x, y) may be givenyxSet as the point weight W with the maximum weight and the coordinates of (i, j)ijCan pass throughAnd obtaining, wherein y, i is a row coordinate, and x, j is a column coordinate.
In addition, the weight of the point in the convolution kernel can be obtained by other methods, for example, the weight of the convolution kernel is normalized.
Specifically, the convolution kernel in the convolutional layer is used for performing gradient calculation in a specified direction with a corresponding region in the feature matrix of the input convolutional layer, and the specified direction includes a vertical gradient, a horizontal gradient, an upper right gradient and an upper left gradient. By adjusting the designated direction, gradient convolution kernels in different directions can be obtained.
The following is an example in which the gradient convolution kernel is 3 × 3, and the feature matrix of the input convolution layer is 5 × 6:
the gradient convolution kernel is:
W00 | W01 | W02 |
W10 | W11 | W12 |
W20 | W21 | W22 |
the feature matrix of the input convolutional layer is:
A00 | A01 | A02 | A03 | A04 | A05 |
A10 | A11 | A12 | A13 | A14 | A15 |
A20 | A21 | A22 | A23 | A24 | A25 |
A30 | A31 | A32 | A33 | A34 | A35 |
A40 | A41 | A42 | A43 | A44 | A45 |
the matrix obtained after convolution is:
B00 | B01 | B02 |
B10 | B11 | B12 |
B20 | B21 | B22 |
If the designated direction is the vertical direction, the direction can be changedAnd performing convolution.
If the designated direction is the upper left direction or the lower right direction, the direction may be changedAnd performing convolution.
If the designated direction is a lower left direction or an upper right direction, the direction may be changedAnd performing convolution.
Illustratively, a convolutional neural network includes only one convolutional layer, but may also include a plurality of convolutional layers, for example, a convolutional neural network may include an input layer, a first convolutional layer, a first max pooling layer, a second convolutional layer, a second max pooling layer, a fully-connected layer, as shown in fig. 2, fig. 2 is a schematic structural diagram of a convolutional neural network provided in an embodiment of the present application, the method comprises the steps of inputting a first convolution layer which is a 32 x 32 character feature matrix 201, wherein the first convolution layer comprises 4 5 x 5 gradient convolution kernels which are respectively a vertical gradient convolution kernel with the designated direction being a vertical direction, a horizontal gradient convolution kernel with the designated direction being a horizontal direction, an upper right gradient convolution kernel with the designated direction being an upper right direction and an upper left gradient convolution kernel with the designated direction being a horizontal direction, and extracting 4-direction gradient feature matrices according to the gradient convolution kernels to obtain 4 28 feature matrices 202. Pooling was then performed by the first largest pooling layer, resulting in 4 feature matrices of 14 x 14 203. The second convolutional layer also includes 4 gradient convolution kernels of 5 × 5 (same as the first convolutional layer), and 4 direction gradient feature maps are extracted from the second convolutional layer for the 4 feature matrices of 14 × 14, respectively, to obtain 16 feature matrices 204 of 10 × 10. Pooling was then performed by the second largest pooling layer, resulting in 16 feature matrices 205 of 5 x 5. The feature matrix 205 is input to the fully connected layer 206 to obtain an output 207 from which the character recognition result can be obtained.
In the embodiment of the application, the track data of the character to be recognized is acquired, the character feature matrix of the character to be recognized is acquired according to the track data, the character feature matrix is input into the convolutional neural network, and the character recognition result is acquired according to the output of the convolutional neural network.
Optionally, as shown in fig. 3, fig. 3 is a schematic flowchart of a character recognition method provided in an embodiment of the present application. In one embodiment of the present application, the method may further include steps 104 to 106:
in step 104, a plurality of sampling points are selected on the composition trace according to the trace data.
In step 105, a direction vector between each sampling point and an adjacent sampling point is obtained.
In step 106, a directional feature matrix is generated.
Step 103 may be implemented by step 1031:
in step 1031, the character feature matrix is input to the convolutional neural network, the input of the full connection layer in the convolutional neural network includes the direction feature matrix, and the character recognition result is obtained according to the output of the convolutional neural network.
The input of the fully-connected layer in the convolutional neural network includes a directional feature matrix, which can be understood as combining the feature matrix output by the largest pooling layer or convolutional layer on the layer above the fully-connected network with the directional feature matrix to form the input of the fully-connected layer.
The direction feature matrix may include a direction vector sum of direction vectors of the plurality of sampling points in a plurality of directions, or the direction feature matrix includes a direction type number sum of the direction vectors of the plurality of sampling points, and the input of the fully-connected layer in the convolutional neural network includes the direction feature matrix.
Illustratively, the directional feature matrix may include a directional vector sum of directional vectors of the plurality of sampling points in 8 directions or 4 directions. Wherein 8 directions are up-down, left-right, left-up, right-up, left-down and right-down 8 directions, and 4 directions are up-down, left-right and 4 directions.
The direction to which the current direction vector belongs is judged, and the judgment can be carried out according to the size of an included angle between the current direction vector and the direction, and the direction with the smallest included angle with the current direction vector is the direction of the current direction vector.
For example, taking an example that 3 sampling points are selected on a written track according to track data, a direction feature matrix includes a direction vector sum of direction vectors of the 3 sampling points in 8 directions, the x direction and the y direction of the direction vector sum in 8 directions are both 0 initially, coordinates of the 3 sampling points are (0,10), (10,10), (20,20), a direction vector (10, 0) is obtained by subtracting a 1 st point coordinate from a 2 nd point coordinate, the direction vector belongs to a horizontal right direction, therefore, the x direction in the horizontal right direction is added with 10, and the y direction is added with 0. The 3 rd point coordinate minus the second point coordinate yields a vector (10,10) belonging to the upper right direction, thus adding 10 to the x-direction of the upper right direction and adding 10 to the y-direction of the upper right direction.
The method comprises the steps of selecting a plurality of sampling points on a written track according to track data, obtaining a direction vector between each sampling point and an adjacent sampling point, generating a direction characteristic matrix, enabling the input of a full-connection layer in the convolutional neural network to comprise the direction characteristic matrix, enriching the types of the characteristics of the full-connection network in the convolutional neural network, enabling the generalization capability of the convolutional neural network to be stronger, even if the adaptability of the convolutional neural network to fresh samples is better, improving the identification accuracy and improving the user experience.
Optionally, as shown in fig. 4, fig. 4 is a schematic flowchart of a character recognition method provided in an embodiment of the present application. In an embodiment of the present application, the method may further include step 107:
in step 107, a profile feature matrix of the written track is obtained from the track data.
The outline characteristic matrix comprises an area between a writing track and an upper boundary of the image, an area between the writing track and a lower boundary of the image, an area between the writing track and a left boundary of the image and an area between the writing track and a right boundary of the image.
in step 1032, the character feature matrix is input into the convolutional neural network, the input of the full-link layer in the convolutional neural network comprises the contour feature matrix, and a character recognition result is obtained according to the output of the convolutional neural network.
The input of the fully-connected layer in the convolutional neural network includes a profile feature matrix, which can be understood as a feature matrix output by the maximum pooling layer or convolutional layer on the layer above the fully-connected network and the profile feature matrix are combined to form the input of the fully-connected layer.
By acquiring the contour feature matrix for writing the track according to the track data and enabling the input of the full-connection layer in the convolutional neural network to comprise the contour feature matrix, the types of the features of the full-connection network in the convolutional neural network can be enriched, the generalization capability of the convolutional neural network is enabled to be stronger, even if the adaptability of the convolutional neural network to a fresh sample is better, the identification accuracy is improved, and the user experience is improved.
Optionally, as shown in fig. 5, fig. 5 is a schematic flowchart of a character recognition method provided in an embodiment of the present application, and in an embodiment of the present application, the method further includes step 108:
in step 108, area features of the written track are obtained from the track data.
The area characteristic is the first point number sum and the second point number sum, the first point number sum is the point number sum of the upper half track point and the right half track point in the writing track, and the second point number sum is the point number sum of the lower half track point and the left half track point in the writing track.
in step 1033, the character feature matrix is input to the convolutional neural network, and the input of the fully-connected layer in the convolutional neural network includes the area feature, and the character recognition result is obtained according to the output of the convolutional neural network.
The input of the fully-connected layer in the convolutional neural network includes an area characteristic, which can be understood as an input of the fully-connected layer formed by combining a characteristic matrix output by a maximum pooling layer or a convolutional layer on a layer above the fully-connected network with the area characteristic.
The area characteristic of the written track is obtained according to the track data, and the input of the full-connection layer in the convolutional neural network comprises the area characteristic, so that the types of the characteristics of the full-connection network in the convolutional neural network can be enriched, the generalization capability of the convolutional neural network is stronger, even if the adaptability of the convolutional neural network to a fresh sample is better, the identification accuracy is improved, and the user experience is improved.
Optionally, as shown in fig. 6, fig. 6 is a schematic flowchart of a character recognition method provided in an embodiment of the present application, and in an embodiment of the present application, the method further includes step 109:
in step 109, a grid layout feature matrix for the written track is obtained from the track data.
The grid layout feature matrix comprises the number of points of pixels of the writing track in each area after the writing track is divided into a plurality of areas.
in step 1034, the character feature matrix is input into the convolutional neural network, the input of the fully-connected layer in the convolutional neural network comprises the square grid layout feature matrix, and the character recognition result is obtained according to the output of the convolutional neural network.
The input of the fully-connected layer in the convolutional neural network includes a square grid layout feature matrix, which can be understood as combining the feature matrix output by the largest pooling layer or convolutional layer on the layer above the fully-connected network with the square grid layout feature matrix to form the input of the fully-connected layer.
By acquiring the grid layout characteristic matrix for writing the track according to the track data and enabling the input of the full-connection layer in the convolutional neural network to comprise the grid layout characteristic matrix, the types of the characteristics of the full-connection network in the convolutional neural network can be enriched, the generalization capability of the convolutional neural network is stronger, even if the adaptability of the convolutional neural network to a fresh sample is better, the identification accuracy is improved, and the user experience is improved.
Optionally, as shown in fig. 7, fig. 7 is a schematic flowchart of a character recognition method provided in an embodiment of the present application, and in an embodiment of the present application, the method further includes step 110:
in step 110, an aspect ratio feature of the written track is obtained from the track data.
Wherein the aspect ratio is characterized by a length of a smallest circumscribed rectangle of the composition trace divided by a width of the smallest circumscribed rectangle of the composition trace.
in step 1035, the character feature matrix is input into the convolutional neural network, and the input of the fully-connected layer in the convolutional neural network comprises the aspect ratio feature, and the character recognition result is obtained according to the output of the convolutional neural network.
The input of the fully-connected layer in the convolutional neural network includes an aspect ratio feature, which can be understood as combining a feature matrix output from the largest pooling layer or convolutional layer on the layer above the fully-connected network with the aspect ratio feature to form the input of the fully-connected layer.
By acquiring the aspect ratio characteristic of the written track according to the track data and enabling the input of the full-connection layer in the convolutional neural network to comprise the aspect ratio characteristic, the types of the characteristics of the full-connection network in the convolutional neural network can be enriched, the generalization capability of the convolutional neural network is enabled to be stronger, even if the adaptability of the convolutional neural network to a fresh sample is better, the identification accuracy is improved, and the user experience is improved.
Exemplarily, as shown in fig. 8, fig. 8 is a schematic structural diagram of a convolutional neural network provided in an embodiment of the present application, where the convolutional neural network includes an input layer, a first convolutional layer, a first max-pooling layer, a second convolutional layer, a second max-pooling layer, a first fully-connected layer, a second fully-connected layer, and a fully-connected hidden layer, the method comprises the steps of inputting a character feature matrix 301 of 32 × 32 of a first convolution layer, wherein the first convolution layer comprises 4 gradient convolution kernels of 5 × 5, namely a vertical gradient convolution kernel with the designated direction being the vertical direction, a horizontal gradient convolution kernel with the designated direction being the horizontal direction, an upper right gradient convolution kernel with the designated direction being the upper right direction and an upper left gradient convolution kernel with the designated direction being the horizontal direction, and extracting 4-direction gradient feature matrices according to the gradient convolution kernels to obtain 4 feature matrices 302 of 28 × 28. Pooling was then performed by the first largest pooling layer, resulting in 4 feature matrices 303 of 14 x 14. The second convolutional layer also includes 4 gradient convolution kernels of 5 × 5 (same as the first convolutional layer), and 4 direction gradient feature maps are extracted from the second convolutional layer for the 4 feature matrices of 14 × 14, respectively, to obtain 16 feature matrices 304 of 10 × 10. Pooling was then performed by the second largest pooling layer, resulting in 16 feature matrices 305 of 5 x 5. Inputting the feature matrix 305 into the first fully-connected layer to obtain an output 306 of 1 × 100, combining the output 306 with a 1 × 35 feature 307 composed of a direction feature matrix, a profile feature matrix, an area feature, a grid layout feature matrix and an aspect ratio feature, using the feature composing 1 × 135 as the input of the second fully-connected layer connected with the first fully-connected layer to obtain an output 308 of 1 × 50 of the second fully-connected layer, using the output as the input of the fully-connected hidden layer to obtain an output 309 of 1 × 10, and comparing the output with a reference value to obtain a character recognition result.
Example II,
An embodiment of the present application provides a character recognition apparatus, as shown in fig. 9, fig. 9 is a schematic structural diagram of the character recognition apparatus provided in the embodiment of the present application, where the character recognition apparatus 40 includes: a trajectory data acquisition module 401, a character matrix acquisition module 402 and a character recognition module 403.
The track data acquiring module 401 is configured to acquire track data of a character to be recognized, where the track data is used to indicate a writing track of the character to be recognized.
A character matrix obtaining module 402, configured to obtain a character feature matrix of the character to be recognized according to the trajectory data.
The character recognition module 403 is configured to input the character feature matrix into a convolutional neural network, and obtain a character recognition result according to an output of the convolutional neural network, where the convolutional neural network includes at least one convolutional layer, and a convolutional core in the convolutional layer is used for performing gradient and calculation with a corresponding region in the feature matrix of the input convolutional layer.
Example III,
Based on the character recognition method of the sensor described in the foregoing embodiment, an embodiment of the present application provides an electronic device for executing the learned route planning method described in the foregoing embodiment, and as shown in fig. 10, the electronic device 50 includes: at least one processor (processor)502, memory 504, bus 506, and communication Interface 508.
Wherein:
the processor 502, communication interface 508, and memory 504 communicate with each other via a communication bus 506.
A communication interface 508 for communicating with other devices.
The processor 502 is configured to execute the program 510, and may specifically perform relevant steps in the methods described in the first to fourth embodiments.
In particular, program 510 may include program code that includes computer operating instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The electronic device comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
The memory 504 is used for storing the program 510. Memory 504 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Example four,
The embodiment of the application provides a character recognition chip, and the character recognition chip calls a stored program to realize the following method:
acquiring track data of the character to be recognized, wherein the track data is used for indicating a writing track of the character to be recognized;
acquiring a character feature matrix of the character to be recognized according to the track data;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the convolutional neural network comprises at least one convolutional layer, and a convolutional core in the convolutional layer is used for performing gradient calculation with a corresponding region in the feature matrix input into the convolutional layer.
The character recognition device of the embodiments of the present application exists in various forms, including but not limited to:
(1) a mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices can display and play multimedia content. This type of device comprises: audio, video players (e.g., ipods), handheld game consoles, electronic books, and smart toys and portable car navigation devices.
(4) And other electronic equipment with data interaction function.
Thus, particular embodiments of the present subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may be advantageous.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are 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 disc read only memory (CD-ROM), Digital Versatile Discs (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 that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular transactions or implement particular abstract data types. The application may also be practiced in distributed computing environments where transactions are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (10)
1. A character recognition method, comprising:
acquiring track data of the character to be recognized, wherein the track data is used for indicating a writing track of the character to be recognized;
acquiring a character feature matrix of the character to be recognized according to the track data;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the convolutional neural network comprises at least one convolutional layer, and a convolutional core in the convolutional layer is used for performing gradient calculation with a corresponding region in the feature matrix input into the convolutional layer.
2. The character recognition method of claim 1, wherein the weight of a specified point in the convolution kernel is the maximum weight, and the weights of other points in the convolution kernel are inversely related to the close distance from the point to the specified point.
3. The character recognition method according to claim 1, wherein the convolution kernels in the convolutional layers are used for performing gradient sum calculation in a specified direction with the corresponding region in the feature matrix input to the convolutional layers, and the specified direction includes a vertical gradient, a horizontal gradient, an upper-right gradient, and an upper-left gradient.
4. The character recognition method according to any one of claims 1 to 3, characterized in that the method further comprises:
selecting a plurality of sampling points on the composition track according to the track data;
acquiring a direction vector between each sampling point and an adjacent sampling point;
generating a direction feature matrix, wherein the direction feature matrix comprises the direction vector sum of the direction vectors of the plurality of sampling points in a plurality of directions, or the direction feature matrix comprises the direction type number sum of the direction vectors of the plurality of sampling points;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, including:
inputting the character feature matrix into a convolutional neural network, enabling the input of a full connection layer in the convolutional neural network to comprise the direction feature matrix, and acquiring a character recognition result according to the output of the convolutional neural network.
5. The character recognition method according to any one of claims 1 to 3, characterized in that the method further comprises:
acquiring a contour feature matrix of the composition track according to the track data, wherein the contour feature matrix comprises an area between the composition track and an upper boundary of an image, an area between the composition track and a lower boundary of the image, an area between the composition track and a left boundary of the image, and an area between the composition track and a right boundary of the image;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, including:
inputting the character feature matrix into a convolutional neural network, enabling the input of a full connection layer in the convolutional neural network to comprise the outline feature matrix, and acquiring a character recognition result according to the output of the convolutional neural network.
6. The character recognition method according to any one of claims 1 to 3, characterized in that the method further comprises:
acquiring the area characteristic of the writing track according to the track data, wherein the area characteristic is the difference between a first point sum and a second point sum, the first point sum is the sum of the points of the track points of the upper half part and the track points of the right half part in the writing track, and the second point sum is the sum of the points of the track points of the lower half part and the track points of the left half part in the writing track;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, including:
inputting the character feature matrix into a convolutional neural network, enabling the input of a full connection layer in the convolutional neural network to comprise the area feature, and acquiring a character recognition result according to the output of the convolutional neural network.
7. The character recognition method according to any one of claims 1 to 3, characterized in that the method further comprises:
acquiring a check layout feature matrix of the writing track according to the track data, wherein the check layout feature matrix comprises the number of points of pixels of the writing track in each area after the writing track is divided into a plurality of areas;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, including:
inputting the character feature matrix into a convolutional neural network, enabling the input of a full connection layer in the convolutional neural network to comprise the square grid layout feature matrix, and obtaining a character recognition result according to the output of the convolutional neural network.
8. The character recognition method according to any one of claims 1 to 3, characterized in that the method further comprises:
acquiring an aspect ratio feature of the composition track according to the track data, wherein the aspect ratio feature is the length of the minimum circumscribed rectangle of the composition track divided by the width of the minimum circumscribed rectangle of the composition track;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, including:
inputting the character feature matrix into a convolutional neural network, enabling the input of a full connection layer in the convolutional neural network to comprise the aspect ratio feature, and acquiring a character recognition result according to the output of the convolutional neural network.
9. A character recognition apparatus characterized by comprising: the device comprises a track data acquisition module, a character matrix acquisition module and a character recognition module;
the track data acquisition module is used for acquiring track data of the character to be recognized, and the track data is used for indicating a writing track of the character to be recognized;
the character matrix acquisition module is used for acquiring a character feature matrix of the character to be recognized according to the track data;
and the character recognition module is used for inputting the character characteristic matrix into a convolutional neural network and acquiring a character recognition result according to the output of the convolutional neural network, wherein the convolutional neural network comprises at least one convolutional layer, and a convolutional core in the convolutional layer is used for performing gradient calculation with a corresponding region in the characteristic matrix input into the convolutional layer.
10. A character recognition chip is characterized in that the character recognition chip calls a stored program to realize the following method:
acquiring track data of the character to be recognized, wherein the track data is used for indicating a writing track of the character to be recognized;
acquiring a character feature matrix of the character to be recognized according to the track data;
inputting the character feature matrix into a convolutional neural network, and acquiring a character recognition result according to the output of the convolutional neural network, wherein the convolutional neural network comprises at least one convolutional layer, and a convolutional core in the convolutional layer is used for performing gradient calculation with a corresponding region in the feature matrix input into the convolutional layer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010191338.5A CN113496263B (en) | 2020-03-18 | 2020-03-18 | Character recognition method, device and character recognition chip |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010191338.5A CN113496263B (en) | 2020-03-18 | 2020-03-18 | Character recognition method, device and character recognition chip |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113496263A true CN113496263A (en) | 2021-10-12 |
CN113496263B CN113496263B (en) | 2022-05-17 |
Family
ID=77992936
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010191338.5A Active CN113496263B (en) | 2020-03-18 | 2020-03-18 | Character recognition method, device and character recognition chip |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113496263B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116612483A (en) * | 2023-07-19 | 2023-08-18 | 广州宏途数字科技有限公司 | Recognition method and device for handwriting vector of intelligent pen |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976354A (en) * | 2010-11-10 | 2011-02-16 | 广东开心信息技术有限公司 | Method and device for judging standardization of writing Chinese characters |
CN106384094A (en) * | 2016-09-18 | 2017-02-08 | 北京大学 | Chinese word stock automatic generation method based on writing style modeling |
CN109254711A (en) * | 2018-09-29 | 2019-01-22 | 联想(北京)有限公司 | Information processing method and electronic equipment |
-
2020
- 2020-03-18 CN CN202010191338.5A patent/CN113496263B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976354A (en) * | 2010-11-10 | 2011-02-16 | 广东开心信息技术有限公司 | Method and device for judging standardization of writing Chinese characters |
CN106384094A (en) * | 2016-09-18 | 2017-02-08 | 北京大学 | Chinese word stock automatic generation method based on writing style modeling |
CN109254711A (en) * | 2018-09-29 | 2019-01-22 | 联想(北京)有限公司 | Information processing method and electronic equipment |
Non-Patent Citations (2)
Title |
---|
ZECHENG XIE ET AL.: "Learning Spatial-Semantic Context with Fully Convolutional Recurrent Network for Online Handwritten Chinese Text Recognition", 《IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE》 * |
张瑞: "基于卷积神经网络的Logo检测与识别研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116612483A (en) * | 2023-07-19 | 2023-08-18 | 广州宏途数字科技有限公司 | Recognition method and device for handwriting vector of intelligent pen |
CN116612483B (en) * | 2023-07-19 | 2023-09-29 | 广州宏途数字科技有限公司 | Recognition method and device for handwriting vector of intelligent pen |
Also Published As
Publication number | Publication date |
---|---|
CN113496263B (en) | 2022-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108170667B (en) | Word vector processing method, device and equipment | |
CN111860502B (en) | Picture form identification method and device, electronic equipment and storage medium | |
CN108345580B (en) | Word vector processing method and device | |
WO2020051114A1 (en) | Information detection method, apparatus and device | |
US11551027B2 (en) | Object detection based on a feature map of a convolutional neural network | |
CN111507250B (en) | Image recognition method, device and storage medium | |
CN112528976A (en) | Text detection model generation method and text detection method | |
CN111415373A (en) | Target tracking and segmenting method, system and medium based on twin convolutional network | |
CN112347512A (en) | Image processing method, device, equipment and storage medium | |
CN112163577A (en) | Character recognition method and device in game picture, electronic equipment and storage medium | |
CN116205290A (en) | Knowledge distillation method and device based on intermediate feature knowledge fusion | |
CN113496263B (en) | Character recognition method, device and character recognition chip | |
CN111192279B (en) | Object segmentation method based on edge detection, electronic terminal and storage medium | |
CN112749576B (en) | Image recognition method and device, computing equipment and computer storage medium | |
CN115830633B (en) | Pedestrian re-recognition method and system based on multi-task learning residual neural network | |
CN113298188A (en) | Character recognition and neural network training method and device | |
CN117894036A (en) | Pedestrian target detection method, device, equipment and medium based on edge equipment | |
CN110222576B (en) | Boxing action recognition method and device and electronic equipment | |
CN109741420B (en) | Region filling method and device, electronic equipment and storage medium | |
CN115346028B (en) | Virtual environment theme processing method and device | |
CN111862159A (en) | Improved target tracking and segmentation method, system and medium for twin convolutional network | |
CN111652053A (en) | Employee attendance checking method, device and medium | |
CN116110110A (en) | Fake image detection method, terminal and storage medium based on face key points | |
CN115393868A (en) | Text detection method and device, electronic equipment and storage medium | |
CN112115952B (en) | Image classification method, device and medium based on full convolution neural network |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |