CN110659639B - Chinese character recognition method and device, computer readable medium and electronic equipment - Google Patents

Chinese character recognition method and device, computer readable medium and electronic equipment Download PDF

Info

Publication number
CN110659639B
CN110659639B CN201910905543.0A CN201910905543A CN110659639B CN 110659639 B CN110659639 B CN 110659639B CN 201910905543 A CN201910905543 A CN 201910905543A CN 110659639 B CN110659639 B CN 110659639B
Authority
CN
China
Prior art keywords
chinese character
feature vector
coding sequence
chinese
module
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.)
Active
Application number
CN201910905543.0A
Other languages
Chinese (zh)
Other versions
CN110659639A (en
Inventor
周多友
王长虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910905543.0A priority Critical patent/CN110659639B/en
Publication of CN110659639A publication Critical patent/CN110659639A/en
Application granted granted Critical
Publication of CN110659639B publication Critical patent/CN110659639B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/28Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet
    • G06V30/287Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet of Kanji, Hiragana or Katakana characters

Abstract

The disclosure relates to a Chinese character recognition method, a Chinese character recognition device, a computer readable medium and an electronic device. The method comprises the following steps: receiving an image to be identified sent by a client; determining a feature vector group of a character row to be recognized in an image to be recognized, wherein the dimension of each feature vector in the feature vector group is the sum of the number of components contained in all Chinese characters in a Chinese character information base and the number of structural relations among the components; converting non-zero elements in the feature vector group into 0 or 1 to obtain a new feature vector group; and acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group, and sending the at least one Chinese character to the client. Thus, the dimensions of the feature vectors are relatively low. Therefore, the calculation workload when the feature vector group is determined can be reduced, and the time length for acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group is also greatly shortened, so that the Chinese character recognition efficiency is improved. In addition, the purpose of saving storage space can be achieved.

Description

Chinese character recognition method and device, computer readable medium and electronic equipment
Technical Field
The present disclosure relates to the field of image character recognition, and in particular, to a method and an apparatus for recognizing a chinese character, a computer-readable medium, and an electronic device.
Background
At present, the encoding of the chinese characters mostly adopts a one-hot code (one-hot code) mode, so that 7445 chinese characters and graphic characters exist in a chinese character information base, and the dimension for representing the encoding of each chinese character and graphic character is seven thousand or more, which is a very large and bloated encoding mode. When the coding mode is adopted for Chinese character recognition, the coding dimension is high, the Chinese character recognition process is time-consuming, and a large storage space is required to be occupied.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a method for identifying chinese characters, comprising: receiving an image to be identified sent by a client; determining a feature vector group of a character row to be recognized in the image to be recognized, wherein the dimension of each feature vector in the feature vector group is the sum of the number of components contained in all Chinese characters in a Chinese character information base and the number of structural relations among the components, each element in the feature vector is a probability value corresponding to the components contained in all the Chinese characters or the structural relations among the components, and the components comprise components and radicals; converting non-zero elements in the feature vector group into 0 or 1 according to a preset rule to obtain a new feature vector group; and acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group.
In a second aspect, the present disclosure provides a chinese character recognition apparatus, comprising: the receiving module is used for receiving the image to be identified sent by the client; the first determining module is used for determining a feature vector group of a character row to be recognized in the image to be recognized received by the receiving module, wherein the dimension of each feature vector in the feature vector group is the sum of the number of components contained in all Chinese characters in a Chinese character information base and the number of structural relations among the components, each element in the feature vector is a probability value corresponding to the components contained in all the Chinese characters or the structural relations among the components, and the components comprise components and radicals; the conversion module is used for converting the nonzero elements in the feature vector group obtained by the first determination module into 0 or 1 according to a preset rule to obtain a new feature vector group; and the first acquisition module is used for acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group obtained by the conversion module.
In a third aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which, when executed by a processing apparatus, performs the steps of the method provided by the first aspect of the present disclosure.
In a fourth aspect, the present disclosure provides an electronic device comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to implement the steps of the method provided by the first aspect of the present disclosure.
In the technical scheme, after the image to be identified is obtained from the client, firstly, a characteristic vector group of a character row to be identified in the image to be identified is determined; next, converting each nonzero element in the feature vector group into 0 or 1 according to a preset rule to obtain a new feature vector group; and finally, acquiring at least one Chinese character in the character line to be recognized according to the new feature vector group. The sum of the number of the components contained in all Chinese characters in the Chinese character information base and the structural relationship number among the components is far smaller than the total number of the Chinese characters in the Chinese character information base, so that the dimensionality of each feature vector is relatively low. Therefore, the calculation workload when the feature vector group is determined can be reduced, and the time length for acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group is also greatly shortened, so that the Chinese character recognition efficiency is improved. In addition, the purpose of saving storage space can be achieved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:
FIG. 1 is a schematic diagram illustrating one implementation environment in accordance with an example embodiment.
FIG. 2 is a flow chart illustrating a method of Chinese character recognition according to an exemplary embodiment.
FIG. 3 is a flow chart illustrating a method of encoding Chinese characters in accordance with an exemplary embodiment.
FIG. 4 is a flow chart illustrating a method of encoding Chinese characters according to another exemplary embodiment.
FIG. 5 is a flow chart illustrating a method of obtaining a predictive neural network model in accordance with an exemplary embodiment.
Fig. 6 is a flow chart illustrating a method of obtaining a new set of feature vectors in accordance with an example embodiment.
FIG. 7 is a flow diagram illustrating a method of obtaining at least one Chinese character included in a row of Chinese characters to be identified in accordance with an exemplary embodiment.
FIG. 8 is a flow chart illustrating a method of Chinese character recognition according to another exemplary embodiment.
FIG. 9 is a block diagram illustrating a Chinese character recognition apparatus according to an exemplary embodiment.
FIG. 10 is a block diagram illustrating a model training apparatus in accordance with an exemplary embodiment.
Fig. 11 is a block diagram illustrating a chinese character recognition apparatus according to another exemplary embodiment.
Fig. 12 is a block diagram illustrating an encoding apparatus according to an example embodiment.
Fig. 13 is a block diagram illustrating an encoding apparatus according to another exemplary embodiment.
FIG. 14 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
FIG. 1 is a schematic diagram illustrating one implementation environment in accordance with an example embodiment. As shown in fig. 1, the implementation environment may include a server 100 and at least one client 200.
In the present disclosure, the server 100 is in communication connection with each client 200, wherein the two may communicate via a 2G network, a 3G network, a 4G network, bluetooth, WIFI, etc. to complete data transmission. When the client 200 needs to perform chinese character recognition on any one or more images, the one or more images to be recognized may be sent to the server 100; the server 100 receives the image to be recognized and performs chinese character recognition thereon. In addition, the client 200 may be, for example, a smart phone, a tablet computer, or the like, and is not particularly limited in this disclosure.
Specifically, the server 100 may implement chinese character recognition through steps 201 to 204 shown in fig. 2.
In step 201, an image to be recognized sent by a client is received.
In the present disclosure, when the client 200 needs to perform chinese character recognition on any one or more images, the one or more images to be recognized may be sent to the server 100; the server 100 receives the image to be recognized.
In step 202, a feature vector of a text line to be recognized in an image to be recognized is determined.
In the present disclosure, the text line refers to a pixel region corresponding to a line of text. After the image to be recognized is obtained in step 201, binarization processing may be performed on the image to be recognized first to obtain each connected domain of the image to be recognized; then, filtering the connected domain which does not meet the first statistical characteristic, wherein the first statistical characteristic is a statistical characteristic which belongs to the character connected domain and is obtained by performing statistical learning on the description characteristic of the connected domain extracted from the marked sample; and finally, extracting character lines in the image to be recognized, namely the character lines to be recognized, from each filtered connected domain.
In addition, the dimension of each feature vector in the feature vector group is the sum of the number of components contained in all Chinese characters in the Chinese character information base and the structural relationship number among the components, and each element in the feature vector is a probability value corresponding to the components contained in all Chinese characters in the Chinese character information base or the structural relationship among the components, wherein the components comprise components and radicals, and the structural relationship among the components morphologically classifies the structure of the Chinese characters into an upper-lower structure, a left-middle-right structure and other structures (for example, an upper-middle-lower structure, a left-middle-right structure, a full-enclosure structure, a half-enclosure structure, a penetration structure, a triangle structure, a single-body structure and the like).
For example, if the number of components included in all the chinese characters in the chinese character information library is 300 and the structural relationship between the included components is 50, the dimension of each feature vector in the feature vector group is 350.
Also, in the present disclosure, after the text line to be recognized is extracted, the feature vector group of the text line to be recognized may be determined in various ways. In one embodiment, the minimum screenshot of each Chinese character included in the character row to be recognized can be obtained (wherein the minimum screenshot includes the current Chinese character, the Chinese character can be completely displayed, and the screenshot with the minimum area convenient for further recognition); then, for each minimum screenshot, identifying each minimum screenshot by a different identification method (e.g., OCR) to obtain a feature vector corresponding to each minimum screenshot, thereby obtaining a feature vector group.
In another embodiment, the character line to be recognized may be input into a preset neural network model, so as to obtain a feature vector group of the character line to be recognized.
In the present disclosure, the preset neural network model is constructed according to codes corresponding to each chinese character in a chinese character information base, where the codes can represent components included in the corresponding chinese character and structural relationships between the components.
In one embodiment, the code corresponding to each chinese character in the chinese character information base may be determined through steps 301 to 303 shown in fig. 3.
In step 301, for each chinese character in the chinese character information base, the components included in the chinese character and the structural relationship between the components are obtained.
In step 302, for each component, the element value in the first code sequence corresponding to the component is modified to a first bit value, resulting in a second code sequence.
In this disclosure, the first coding sequence may be a binary bit sequence in which each element value is a second bit value, and each component or structural relationship among components in the component structure set corresponds to each element in the first coding sequence one to one (that is, the length of the first coding sequence is equal to the number of elements included in the component structure set), where the component structure set may be a set formed by components and structural relationships among components included in all chinese characters in the chinese character information library.
The first bit value is 1, and the second bit value is 0; alternatively, the first bit value is 0 and the second bit value is 1.
Illustratively, if 300 parts are included in all the chinese characters in the chinese character information library and 50 structural relationships are included in the chinese characters, the length of the first coding sequence is 350, where the 300 parts and 50 structural relationships are respectively in one-to-one correspondence with 350 elements in the first coding sequence.
In step 303, for each structural relationship between the components, the element value corresponding to the structural relationship between the components in the second coding sequence is modified into the first bit value, so as to obtain the code corresponding to the chinese character.
The following illustrates how each chinese character in the chinese character information base is encoded through the above steps 301 to 303.
Illustratively, the chinese character is "part", and the parts included in the chinese character obtained in step 301 are "vertical", "oral" and "", where the structural relationship of each part is left-right structure + top-bottom structure; then, element values corresponding to three parts of 'vertical', 'mouth', '' in the first coding sequence are modified into a first bit value (for example, 1) respectively, and a second coding sequence is obtained; next, the element values corresponding to the "left-right structure" and the "top-bottom structure" in the second coding sequence are modified to the first bit value (for example, 1), whereby the code corresponding to the "part" of the chinese character can be obtained.
Further, for example, the chinese character is "middle", the component included in the chinese character is "middle" obtained in step 301, and the component structure relationship is a single-body structure; then, modifying the element value corresponding to the component "middle" in the first code sequence into a first bit value (for example, 1) to obtain a second code sequence; next, the element value corresponding to the "one-body structure" in the second coding sequence is modified to the first bit value (for example, 1), so that the code corresponding to the "middle" Chinese character can be obtained.
In another embodiment, firstly, aiming at each Chinese character in a Chinese character information base, acquiring components contained in the Chinese character and structural relations among the components; then, aiming at the structural relationship among the components, modifying the element value corresponding to the structural relationship among the components in the first coding sequence into a first bit value to obtain a second coding sequence; finally, aiming at each part, modifying the element value corresponding to the part in the second coding sequence into a first bit value to obtain the code corresponding to the Chinese character.
In another embodiment, the code corresponding to each Chinese character in the Chinese character information base can be determined through steps 401 to 404 shown in FIG. 4.
In step 401, for each chinese character in the chinese character information base, the components included in the chinese character and the structural relationship between the components are obtained.
In step 402, for each part, the element value corresponding to the part in the third encoded sequence is modified to a first bit value, resulting in a fourth encoded sequence.
In this disclosure, the third coding sequence is a binary bit sequence in which each element value is a second bit value, and each component in the component set corresponds to each element in the third coding sequence one to one, where the component set is a set formed by components included in all chinese characters in the chinese character information base.
Illustratively, if there are 300 parts included in all the chinese characters in the chinese character information library, the length of the third encoding sequence is 300, where the 300 parts are respectively in one-to-one correspondence with 300 elements in the third encoding sequence.
In step 403, for each structural relationship between the components, the element value corresponding to the structural relationship between the components in the fifth coding sequence is modified into the first bit value, so as to obtain a sixth coding sequence.
In this disclosure, the fifth coding sequence is a binary bit sequence in which each element value is a second bit value, and the structural relationships among the parts in the structural set correspond to the elements in the fifth coding sequence one to one, where the structural set is a set formed by the structural relationships among the parts included in all the chinese characters in the chinese character information base.
Illustratively, 50 structural relationships among components included in all the chinese characters in the chinese character information library are present, and the length of the fifth encoding sequence is 50, where the 50 structural relationships among the components respectively correspond to 50 elements in the fifth encoding sequence one to one.
In step 404, the fourth coding sequence and the sixth coding sequence are spliced to obtain a code corresponding to the Chinese character.
In the present disclosure, after the fourth coding sequence is obtained in step 402 and the sixth coding sequence is obtained in step 403, the sixth coding sequence may be spliced to the tail of the fourth coding sequence, or the fourth coding sequence may be spliced to the tail of the sixth coding sequence, so as to obtain the code corresponding to the chinese character.
Note that, the step 403 may be executed before the step 402, may be executed after the step 402, may be executed simultaneously with the step 402, and is not particularly limited in the present disclosure.
The following illustrates how each Chinese character in the Chinese character information base is encoded through the above steps 401 to 404.
Illustratively, the chinese character is "part", and the parts included in the chinese character obtained in step 401 are "vertical", "oral" and "", where the structural relationship of each part is left-right structure + top-bottom structure; then, element values corresponding to three components of "vertical", "horizontal", "" in the third code sequence are modified to a first bit value (for example, 1) to obtain a fourth code sequence, and element values corresponding to "left and right structures" and "upper and lower structures" in the fifth code sequence are modified to a first bit value (for example, 1) to obtain a sixth code sequence; finally, the fourth coding sequence and the sixth coding sequence are spliced, and therefore codes corresponding to the parts of the Chinese characters can be obtained.
Further, for example, the chinese character is "middle", the component included in the chinese character is "middle" obtained in step 401, and the component structure relationship is a single-body structure; then, modifying the element value corresponding to the part of 'middle' in the third coding sequence into a first bit value (for example, 1) to obtain a fourth coding sequence, and modifying the element value corresponding to the 'individual body structure' in the fifth coding sequence into the first bit value (for example, 1) to obtain a fourth six coding sequence; finally, the fourth coding sequence and the sixth coding sequence are spliced, and therefore the corresponding code of the Chinese character 'middle' can be obtained.
In addition, the structural relationship between the components may have a plurality of different division rules, for example: "Xie Ji", can be defined as the independent structure, also can be defined as the upper and lower structure; "escape" may be defined as an upper-lower structure, a left-right structure, or the like.
In addition, the preset neural network model may be a convolutional neural network model, or may be a model combining the convolutional neural network model and a cyclic neural network model, and this is not specifically limited in this disclosure. In addition, the preset neural network model may be obtained through steps 501 to 503 shown in fig. 5.
In step 501, a plurality of training sample images are acquired.
In the present disclosure, each training sample image includes at least one chinese character. Also, the training sample image may be acquired in a variety of ways.
In one embodiment, the Chinese characters included in each training sample image may be manually marked by acquiring a plurality of training sample images through manual marking, that is, by acquiring a plurality of training sample images through shooting and the like.
However, because the training process typically requires a large number of training sample images, the manner of manual labeling tends to be inefficient and labor-intensive. Therefore, to improve efficiency and reduce labor costs, in another embodiment, one or more hanzi images may be extracted from a hanzi information base, and training sample images may be generated from the one or more hanzi images, wherein each hanzi image may include one or more hanzi.
In step 502, the lines of text in the plurality of training sample images are input into the initial neural network model to obtain an output result of the initial neural network model.
In the present disclosure, the initial neural network model has at least one convolutional layer, and the number of convolutional kernels of the at least one convolutional layer is determined according to the length of the code, wherein the at least one layer includes a last layer (i.e., the number of convolutional kernels of the last convolutional layer of the initial neural network model is determined according to the length of the code), the length of the code is equal to the dimension of the feature vector, and each element of the feature vector corresponds to each bit in the code.
In particular, the initial neural network model may include at least one convolutional layer, at least one pooling layer, and at least one fully-connected layer. The convolutional layer can be used for scanning a training sample image according to the size and the step length of the convolutional kernel so as to perform feature extraction and feature mapping on a character line in the training sample image; the pooling layer can be used for compressing the feature map after convolution, and comprises the steps of reducing the feature map, simplifying the network computation complexity, compressing the feature and extracting main features; the full connection layer can be used for connecting all the characteristics, and re-fitting the characteristics to reduce the loss of characteristic information. The number of layers of the initial neural network model, the node structure in the layers, and the convolution kernel used for performing the convolution operation may be constructed in accordance with the coding. For example, parameters such as the number of nodes and the number of convolution kernels in the output layer may be set with reference to the length of the above-described code. For example, the number of nodes of the last layer of the initial neural network model may be set to correspond to the length of the code.
After the training sample images are obtained in step 501, the character lines in the training sample images may be used as training data of the initial neural network model, and the feature vector groups (i.e., codes of at least one chinese character corresponding to the training sample images) corresponding to the character lines in the training sample images and having correct recognition may be used as label data, so as to train the initial neural network model. The initial neural network model is trained to obtain relevant parameters in the initial neural network model, such as the size of a convolution kernel, the moving step size of the convolution kernel, and the like.
In step 503, the initial neural network model is trained according to the comparison result between the output result and the labeled data, so as to obtain a preset neural network model.
After the output result of the initial neural network model is obtained in step 502, the output result may be compared with the labeled data, for example, the similarity between the two is measured by cosine distance or euclidean distance, the network convergence degree is measured by using the difference between the output result and the labeled result, when the difference is greater than or equal to a preset difference threshold value or the training frequency does not meet the training frequency requirement, the model is repeatedly trained until the difference is less than the preset difference threshold value or the training frequency meets the training frequency requirement, and the training is stopped, so as to obtain the preset neural network model. The preset difference threshold may be a value set by a user, or may be a default empirical value, and is not specifically limited in this disclosure.
Returning to fig. 2, in step 203, according to a preset rule, the non-zero elements in the feature vector group are converted into 0 or 1, so as to obtain a new feature vector group.
In the present disclosure, after the feature vector group of the text line to be recognized is obtained through the preset neural network model, the non-zero elements in the feature vector group may be converted into 0 or 1 according to the preset rule, so as to obtain a new feature vector group.
In particular, in one embodiment, the conversion of the non-zero elements in the feature vector group may be achieved according to the alignment between each non-zero element and the average of all non-zero elements in the feature vector group. Specifically, for each non-zero element in the feature vector group, if the non-zero element is greater than the average value, the non-zero element may be set to 1; if the nonzero element is less than or equal to the average value, the nonzero element may be set to 0.
In another embodiment, the conversion of the non-zero elements in the feature vector group may be implemented according to the comparison result between the non-zero elements and a preset threshold. Specifically, this can be realized by step 2031 to step 2033 shown in fig. 6.
In step 2031, for each non-zero element in the feature vector group, it is determined whether the non-zero element is greater than a preset threshold.
In the present disclosure, for each non-zero element in the feature vector group, if the non-zero element is greater than a preset threshold, the non-zero element may be set to 1, that is, the following step 2032 is performed; if the non-zero element is less than or equal to the predetermined threshold, the non-zero element may be set to 0, i.e., the following step 2033 is performed.
In step 2032, the non-zero element is set to 1.
In step 2033, the non-zero element is set to 0.
Illustratively, the feature vector includes three non-zero elements, i.e., 0.9, 0.71, and 0.3, and the preset threshold is 0.7, then 0.9 and 0.71 in the feature vector may be respectively set to 1 and 0.3 may be set to 0, so that a new feature vector including two non-zero elements (both 1) may be obtained.
The preset threshold may be a value set by a user or a default empirical value (for example, 0.7), and is not particularly limited in the present disclosure.
In step 204, at least one Chinese character included in the Chinese character row to be recognized is obtained according to the new feature vector group.
In the present disclosure, at least one chinese character included in the chinese character row to be recognized may be acquired in various ways according to the new feature vector group. In one embodiment, at least one Chinese character included in the row of Chinese characters to be recognized may be obtained through steps 2041 and 2042 shown in FIG. 7.
In step 2041, for each new feature vector in the new feature vector group, a target code that completely matches the new feature vector is determined from the codes corresponding to each chinese character in the chinese character information base.
In step 2042, the Chinese character corresponding to the target code is determined as the target Chinese character, and at least one Chinese character included in the Chinese character row to be recognized is obtained.
In the present disclosure, for each new feature vector, the new feature vector may be respectively matched with codes corresponding to each Chinese character in the Chinese character information base, and a code completely matched with the new feature vector is determined as a target code; then, accessing a corresponding storage module (storing codes corresponding to all Chinese characters) in a Chinese character information base to obtain Chinese characters corresponding to the target codes, namely target Chinese characters; finally, the target Chinese characters corresponding to the feature vectors can be arranged according to the sequence of the corresponding pixel points in the character row to be recognized, so that at least one Chinese character in the character row to be recognized is obtained.
In another embodiment, for each new feature vector in the new feature vector group, first determining the number of element values in the new feature vector as 1 to obtain a target number; then, screening out codes with the element value of 1 and the number of the element values of 1 being the target number from the codes corresponding to the Chinese characters to obtain at least one reference code; then, respectively matching the new eigenvectors with each reference code, and determining the reference code completely matched with the new eigenvectors as a target code; then, accessing a corresponding storage module (storing codes corresponding to all Chinese characters) in a Chinese character information base to obtain Chinese characters corresponding to the target codes, namely target Chinese characters; finally, the target Chinese characters corresponding to the feature vectors can be arranged according to the sequence of the corresponding pixel points in the character row to be recognized, so that at least one Chinese character included in the character row to be recognized is obtained
In addition, if there is no code that completely matches the new feature vector in the code corresponding to each chinese character in the chinese character information library, it can be determined that the feature vector corresponds to a non-chinese character (e.g., a space, a punctuation mark, etc.).
In the technical scheme, after the image to be identified is obtained from the client, firstly, a characteristic vector group of a character row to be identified in the image to be identified is determined; next, converting each nonzero element in the feature vector group into 0 or 1 according to a preset rule to obtain a new feature vector group; and finally, acquiring at least one Chinese character in the character line to be recognized according to the new feature vector group. The sum of the number of the components contained in all Chinese characters in the Chinese character information base and the structural relationship number among the components is far smaller than the total number of the Chinese characters in the Chinese character information base, so that the dimensionality of each feature vector is relatively low. Therefore, the calculation workload when the feature vector group is determined can be reduced, and the time length for acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group is also greatly shortened, so that the Chinese character recognition efficiency is improved. In addition, the purpose of saving storage space can be achieved.
FIG. 8 is a flow chart illustrating a method of Chinese character recognition according to another exemplary embodiment. As shown in fig. 8, the method may further include the following step 205.
In step 205, at least one Chinese character is sent to the client for presentation by the client.
After at least one Chinese character included in the Chinese character row to be recognized is obtained in step 204, the obtained at least one Chinese character may be sent to a client side to be displayed by the client side. Therefore, the user can directly obtain the character string corresponding to the image to be recognized through the client, and the method is convenient and quick.
FIG. 9 is a block diagram illustrating a Chinese character recognition apparatus according to an exemplary embodiment. Referring to fig. 9, the apparatus 900 includes: a receiving module 901, configured to receive an image to be identified sent by a client; a first determining module 902, configured to determine a feature vector group of a text line to be recognized in the image to be recognized, where a dimension of each feature vector in the feature vector group is a sum of a number of components included in all chinese characters in a chinese character information base and a number of structural relationships between the components, each element in the feature vector is a probability value corresponding to the components included in all chinese characters or the structural relationships between the components, and each component includes a radical and a radical; a converting module 903, configured to convert, according to a preset rule, a non-zero element in the feature vector group obtained by the first determining module 902 into 0 or 1, so as to obtain a new feature vector group; a first obtaining module 904, configured to obtain at least one chinese character included in the chinese character row to be recognized according to the new feature vector group obtained by the converting module 903.
Optionally, the conversion module 903 comprises: a first conversion sub-module, configured to, for each non-zero element in the feature vector group obtained by the first determining module 902, set the non-zero element to 1 if the non-zero element is greater than a preset threshold; and the second conversion submodule is used for setting the non-zero element to 0 if the non-zero element is less than or equal to the preset threshold value.
Optionally, the first obtaining module 904 includes: a first determining sub-module, configured to determine, for each new feature vector in the new feature vector group obtained by the conversion module 903, a target code that is completely matched with the new feature vector from codes corresponding to each Chinese character in the Chinese character information base; and the second determining submodule is used for determining the Chinese character corresponding to the target code determined by the first determining submodule as a target Chinese character to obtain at least one Chinese character in the Chinese character row to be recognized.
Optionally, the conversion module 903 comprises: a first conversion sub-module, configured to, for each non-zero element in the feature vector group obtained by the first determining module 902, set the non-zero element to 1 if the non-zero element is greater than a preset threshold; and the second conversion submodule is used for setting the non-zero element to 0 if the non-zero element is less than or equal to the preset threshold value.
Optionally, the first obtaining module 904 includes: a first determining sub-module, configured to determine, for each new feature vector in the new feature vector group obtained by the conversion module 903, a target code that is completely matched with the new feature vector from codes corresponding to each Chinese character in the Chinese character information base; and the second determining submodule is used for determining the Chinese character corresponding to the target code determined by the first determining submodule as a target Chinese character to obtain at least one Chinese character in the Chinese character row to be recognized.
Optionally, the first determining module 902 is configured to: inputting the character row to be recognized in the image to be recognized received by the receiving module 901 into a preset neural network model to obtain a feature vector group of the character row to be recognized, wherein the preset neural network model is constructed according to codes corresponding to each Chinese character in a Chinese character information base.
FIG. 10 is a block diagram illustrating a model training apparatus in accordance with an exemplary embodiment. Referring to fig. 10, the apparatus 1000 includes: a second obtaining module 1001, configured to obtain a plurality of training sample images; a third obtaining module 1002, configured to input the text lines in the multiple training sample images obtained by the second obtaining module 1001 into an initial neural network model to obtain an output result of the initial neural network model, where the number of convolution kernels in at least one layer in the initial neural network model is determined according to the length of the code, where the at least one layer includes a last layer, and the length is equal to the dimension; a training module 1003, configured to train the initial neural network model according to a comparison result between the output result obtained by the third obtaining module 1002 and the labeled data, so as to obtain a preset neural network model, where the labeled data are feature vector groups that are correctly identified and respectively correspond to the multiple training sample images.
It should be noted that the model training apparatus 1000 may be independent from the chinese character recognition apparatus 10000, or may be integrated into the chinese character recognition apparatus 900, and is not particularly limited in this disclosure.
Fig. 11 is a block diagram illustrating a chinese character recognition apparatus according to another exemplary embodiment. Referring to fig. 11, the apparatus 900 may further include: a sending module 905, configured to send the at least one chinese character obtained by the first obtaining module 904 to the client, so that the client displays the at least one chinese character
Fig. 12 is a block diagram illustrating an encoding apparatus according to an example embodiment. Referring to fig. 12, the apparatus 1200 includes: a fourth obtaining module 1201, configured to obtain, for each chinese character in the chinese character information base, a component included in the chinese character and a structural relationship between the components; a second determining module 1202, configured to modify, for each component obtained by the fourth obtaining module 1201, an element value corresponding to the component in a first coding sequence into a first bit value to obtain a second coding sequence, where the first coding sequence is a binary bit sequence in which each element value is a second bit value, and each component or structural relationships among components in a component structure set correspond to each element in the first coding sequence one to one, and the component structure set is a set formed by components and structural relationships among components included in all chinese characters in the chinese character information base; a third determining module 1203, configured to modify, for each inter-component structural relationship obtained by the fourth obtaining module 1201, an element value, corresponding to the inter-component structural relationship, in the second coding sequence obtained by the second determining module to the first bit value, so as to obtain a code corresponding to the chinese character.
Fig. 13 is a block diagram illustrating an encoding apparatus according to another exemplary embodiment. Referring to fig. 13, the apparatus 1200 includes: a fourth obtaining module 1201, configured to obtain, for each chinese character in the chinese character information base, a component included in the chinese character and a structural relationship between the components; a fourth determining module 1204, configured to modify, for each component obtained by the fourth obtaining module 1201, an element value corresponding to the component in a third coding sequence into a first bit value, so as to obtain a fourth coding sequence, where the third coding sequence is a binary bit sequence in which each element value is a second bit value, each component in a component set corresponds to each element in the third coding sequence one to one, and the component set is a set formed by components included in all chinese characters in the chinese character information base; a fifth determining module 1205, configured to modify, for each inter-component structural relationship obtained by the fourth obtaining module 1201, an element value corresponding to the inter-component structural relationship in a fifth coding sequence into the first bit value, so as to obtain a sixth coding sequence, where the fifth coding sequence is a binary bit sequence in which each element value is the second bit value, structural relationships among components in a structure set correspond to elements in the fifth coding sequence one to one, and the structure set is a set formed by the inter-component structural relationships included in all chinese characters in the chinese character information base; a splicing module 1206, configured to splice the fourth coding sequence obtained by the fourth determining module 1204 and the sixth coding sequence obtained by the fifth determining module 1205 to obtain a code corresponding to the chinese character.
Note that the encoding device 1200 may be independent from the chinese character recognition device 900, or may be integrated into the chinese character recognition device 900, and is not particularly limited in this disclosure.
The present disclosure also provides a computer readable medium having stored thereon a computer program which, when executed by a processing device, implements the steps of the above-mentioned chinese character recognition method provided by the present disclosure.
Referring now to FIG. 14, a schematic diagram of an electronic device (e.g., server 100 of FIG. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 14 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 14, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 14 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving an image to be identified sent by a client; determining a feature vector group of a character row to be recognized in the image to be recognized, wherein the dimension of each feature vector in the feature vector group is the sum of the number of components contained in all Chinese characters in a Chinese character information base and the number of structural relations among the components, each element in the feature vector is a probability value corresponding to the components contained in all the Chinese characters or the structural relations among the components, and the components comprise components and radicals; converting non-zero elements in the feature vector group into 0 or 1 according to a preset rule to obtain a new feature vector group; and acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of the module does not in some cases form a limitation on the module itself, for example, the first obtaining module may also be described as "a module for obtaining at least one chinese character included in the row of chinese characters to be recognized".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Example 1 provides a chinese character recognition method according to one or more embodiments of the present disclosure, including: receiving an image to be identified sent by a client; determining a feature vector group of a character row to be recognized in the image to be recognized, wherein the dimension of each feature vector in the feature vector group is the sum of the number of components contained in all Chinese characters in a Chinese character information base and the number of structural relations among the components, each element in the feature vector is a probability value corresponding to the components contained in all the Chinese characters or the structural relations among the components, and the components comprise components and radicals; converting non-zero elements in the feature vector group into 0 or 1 according to a preset rule to obtain a new feature vector group; and acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group.
Example 2 provides the method of example 1, the converting non-zero elements in the set of feature vectors to 0 or 1 according to a preset rule, including: for each non-zero element in the feature vector group, if the non-zero element is greater than a preset threshold, setting the non-zero element to 1; and if the nonzero element is less than or equal to the preset threshold value, setting the nonzero element to be 0.
Example 3 provides the method of example 1, the obtaining at least one chinese character included in the row of chinese characters to be recognized according to the new feature vector group, including: aiming at each new feature vector in the new feature vector group, determining a target code completely matched with the new feature vector from codes corresponding to all Chinese characters in the Chinese character information base; and determining the Chinese character corresponding to the target code as a target Chinese character to obtain at least one Chinese character in the Chinese character row to be recognized.
Example 4 provides the method of example 1, the determining the set of feature vectors for the line of text to be recognized in the image to be recognized, including: and inputting the character row to be recognized in the image to be recognized into a preset neural network model to obtain a characteristic vector group of the character row to be recognized, wherein the preset neural network model is constructed according to codes corresponding to all Chinese characters in the Chinese character information base.
Example 5 provides the method of example 4, and the preset neural network model is constructed according to a code corresponding to each chinese character in a chinese character information base by: acquiring a plurality of training sample images; inputting character lines in the training sample images into an initial neural network model to obtain an output result of the initial neural network model, wherein the initial neural network model is provided with at least one convolution layer, the number of convolution kernels of the at least one convolution layer is determined according to the length of the code, the at least one convolution layer comprises a last layer, the convolution layer is used for scanning the training sample images according to the size and the step length of the convolution kernels so as to perform feature extraction and feature mapping on the character lines in the training sample images, and the length is equal to the dimension; and training the initial neural network model according to the comparison result of the output result and the marked data to obtain a preset neural network model, wherein the marked data are feature vector groups which are correctly identified and respectively correspond to the character rows in the training sample images.
Example 6 provides the method of example 1, further comprising, in accordance with one or more embodiments of the present disclosure: and sending the at least one Chinese character to the client side to be displayed by the client side.
Example 7 provides the method of any one of examples 1-6, wherein the code corresponding to each chinese character in the chinese character information library is determined by: aiming at each Chinese character in the Chinese character information base, acquiring components contained in the Chinese character and structural relations among the components; modifying element values corresponding to the parts in a first coding sequence into first bit values aiming at each part to obtain a second coding sequence, wherein the first coding sequence is a binary bit sequence with each element value being a second bit value, each part or structural relations among the parts in a part structure set respectively correspond to each element in the first coding sequence one by one, and the part structure set is a set formed by the parts and the structural relations among the parts contained in all Chinese characters in the Chinese character information base; and modifying the element values corresponding to the structural relationship among the parts in the second coding sequence into the first bit values aiming at the structural relationship among the parts to obtain the codes corresponding to the Chinese characters.
Example 8 provides the method of any one of examples 1-6, wherein the code corresponding to each chinese character in the chinese character information library is determined by: aiming at each Chinese character in the Chinese character information base, acquiring components contained in the Chinese character and structural relations among the components; modifying element values corresponding to the parts in a third coding sequence into first bit values aiming at each part to obtain a fourth coding sequence, wherein the third coding sequence is a binary bit sequence with each element value being a second bit value, each part in a part set is respectively in one-to-one correspondence with each element in the third coding sequence, and the part set is a set formed by parts contained in all Chinese characters in the Chinese character information base; modifying element values in a fifth coding sequence corresponding to the structural relationship among the parts into the first bit values according to the structural relationship among the parts to obtain a sixth coding sequence, wherein the fifth coding sequence is a binary bit sequence with all the element values being the second bit values, the structural relationship among the parts in a structural set respectively corresponds to all the elements in the fifth coding sequence one by one, and the structural set is a set formed by the structural relationship among the parts contained in all the Chinese characters in the Chinese character information base; and splicing the fourth coding sequence and the sixth coding sequence to obtain the codes corresponding to the Chinese characters.
Example 9 provides, in accordance with one or more embodiments of the present disclosure, a chinese character recognition apparatus, including: the receiving module is used for receiving the image to be identified sent by the client; the first determining module is used for determining a feature vector group of a character row to be recognized in the image to be recognized received by the receiving module, wherein the dimension of each feature vector in the feature vector group is the sum of the number of components contained in all Chinese characters in a Chinese character information base and the number of structural relations among the components, each element in the feature vector is a probability value corresponding to the components contained in all the Chinese characters or the structural relations among the components, and the components comprise components and radicals; the conversion module is used for converting the nonzero elements in the feature vector group obtained by the first determination module into 0 or 1 according to a preset rule to obtain a new feature vector group; and the first acquisition module is used for acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group obtained by the conversion module.
Example 10 provides the apparatus of example 9, the conversion module comprising, in accordance with one or more embodiments of the present disclosure: a first converter module, configured to, for each non-zero element in the feature vector group obtained by the first determination module, set the non-zero element to 1 if the non-zero element is greater than a preset threshold; and the second conversion submodule is used for setting the non-zero element to 0 if the non-zero element is less than or equal to the preset threshold value.
Example 11 provides the apparatus of example 9, the first obtaining module comprising: the first determining submodule is used for determining a target code which is completely matched with the new feature vector from codes corresponding to all Chinese characters in the Chinese character information base aiming at each new feature vector in the new feature vector group obtained by the conversion module; and the second determining submodule is used for determining the Chinese character corresponding to the target code determined by the first determining submodule as a target Chinese character to obtain at least one Chinese character in the Chinese character row to be recognized.
Example 12 provides the apparatus of example 9, the first determination module to: and inputting the character row to be recognized in the image to be recognized received by the receiving module into a preset neural network model to obtain a characteristic vector group of the character row to be recognized, wherein the preset neural network model is constructed according to codes corresponding to all Chinese characters in a Chinese character information base.
Example 13 provides the apparatus of example 12, the preset neural network model is constructed by a model training apparatus according to a code corresponding to each chinese character in a chinese character information base, wherein the model training apparatus includes: the second acquisition module is used for acquiring a plurality of training sample images; a third obtaining module, configured to input text rows in the training sample images obtained by the second obtaining module into an initial neural network model to obtain an output result of the initial neural network model, where the initial neural network model has at least one convolutional layer, the number of convolutional kernels of the at least one convolutional layer is determined according to the length of the code, the at least one layer includes a last layer, the convolutional layer is configured to scan the training sample image according to the size and step length of the convolutional kernels to perform feature extraction and feature mapping on the text rows in the training sample image, and the length is equal to the dimension; and the training module is used for training the initial neural network model according to the comparison result of the output result and the marking data acquired by the third acquisition module to acquire a preset neural network model, wherein the marking data are feature vector groups which are respectively corresponding to the character rows in the training sample images and correctly identified.
Example 14 provides the apparatus of example 9, in accordance with one or more embodiments of the present disclosure, further comprising: and the sending module is used for sending the at least one Chinese character acquired by the first acquiring module to the client side so as to be displayed by the client side.
Example 15 provides the apparatus of any one of examples 9-14, the encoding device determining a code corresponding to each chinese character in the chinese character information library, wherein the encoding device includes: the fourth acquisition module is used for acquiring components contained in the Chinese characters and structural relations among the components aiming at each Chinese character in the Chinese character information base; a second determining module, configured to modify, for each component obtained by the fourth obtaining module, an element value corresponding to the component in a first coding sequence into a first bit value to obtain a second coding sequence, where the first coding sequence is a binary bit sequence in which each element value is a second bit value, and each component or structural relationships among components in a component structure set correspond to each element in the first coding sequence one to one, and the component structure set is a set formed by components and structural relationships among components included in all chinese characters in the chinese character information base; and a third determining module, configured to modify, for each inter-component structural relationship obtained by the fourth obtaining module, an element value corresponding to the inter-component structural relationship in the second coding sequence obtained by the second determining module to the first bit value, so as to obtain a code corresponding to the chinese character.
Example 16 provides the apparatus of any one of examples 9-14, the encoding device determining a code corresponding to each chinese character in the chinese character information library, wherein the encoding device includes: the fourth acquisition module is used for acquiring components contained in the Chinese characters and structural relations among the components aiming at each Chinese character in the Chinese character information base; a fourth determining module, configured to modify, for each component obtained by the fourth obtaining module, an element value corresponding to the component in a third coding sequence to a first bit value to obtain a fourth coding sequence, where the third coding sequence is a binary bit sequence in which each element value is a second bit value, each component in a component set corresponds to each element in the third coding sequence one to one, and the component set is a set formed by components included in all chinese characters in the chinese character information base; a fifth determining module, configured to modify, for each inter-component structural relationship obtained by the fourth obtaining module, an element value corresponding to the inter-component structural relationship in a fifth coding sequence to the first bit value to obtain a sixth coding sequence, where the fifth coding sequence is a binary bit sequence in which each element value is the second bit value, structural relationships among components in a structure set are respectively in one-to-one correspondence with each element in the fifth coding sequence, and the structure set is a set formed by the structural relationships among components included in all chinese characters in the chinese character information base; and the splicing module is used for splicing the fourth coding sequence obtained by the fourth determining module and the sixth coding sequence obtained by the fifth determining module to obtain the codes corresponding to the Chinese characters.
Example 17 provides a computer readable medium having stored thereon a computer program that, when executed by a processing apparatus, performs the steps of the method of any of examples 1-8, in accordance with one or more embodiments of the present disclosure.
Example 18 provides, in accordance with one or more embodiments of the present disclosure, an electronic device, comprising: a storage device having a computer program stored thereon; processing means for executing the computer program in the storage means to carry out the steps of the method of any of examples 1-8.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims (18)

1. A Chinese character recognition method is characterized by comprising the following steps:
receiving an image to be identified sent by a client;
determining a feature vector group of a character row to be recognized in the image to be recognized, wherein the dimension of each feature vector in the feature vector group is the sum of the number of components contained in all Chinese characters in a Chinese character information base and the number of structural relations among the components, each element in the feature vector is a probability value corresponding to the components contained in all the Chinese characters or the structural relations among the components, and the components comprise components and radicals;
converting non-zero elements in the feature vector group into 0 or 1 according to a preset rule to obtain a new feature vector group;
and acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group.
2. The method according to claim 1, wherein the converting the non-zero elements in the feature vector group into 0 or 1 according to a preset rule comprises:
for each non-zero element in the feature vector group, if the non-zero element is greater than a preset threshold, setting the non-zero element to 1;
and if the nonzero element is less than or equal to the preset threshold value, setting the nonzero element to be 0.
3. The method according to claim 1, wherein said obtaining at least one chinese character included in the row of chinese characters to be recognized according to the new set of feature vectors comprises:
aiming at each new feature vector in the new feature vector group, determining a target code matched with the new feature vector from codes corresponding to all Chinese characters in the Chinese character information base;
and determining the Chinese character corresponding to the target code as a target Chinese character to obtain at least one Chinese character in the Chinese character row to be recognized.
4. The method of claim 1, wherein the determining the set of feature vectors for the line of text to be recognized in the image to be recognized comprises:
and inputting the character row to be recognized in the image to be recognized into a preset neural network model to obtain a characteristic vector group of the character row to be recognized, wherein the preset neural network model is constructed according to codes corresponding to all Chinese characters in the Chinese character information base.
5. The method of claim 4, wherein the preset neural network model is constructed according to the codes corresponding to the Chinese characters in the Chinese character information base by the following steps:
acquiring a plurality of training sample images;
inputting character lines in the training sample images into an initial neural network model to obtain an output result of the initial neural network model, wherein the initial neural network model is provided with at least one convolution layer, the number of convolution kernels of the at least one convolution layer is determined according to the length of the code, the at least one convolution layer comprises a last layer, the convolution layer is used for scanning the training sample images according to the size and the step length of the convolution kernels so as to perform feature extraction and feature mapping on the character lines in the training sample images, and the length is equal to the dimension;
and training the initial neural network model according to the comparison result of the output result and the marked data to obtain a preset neural network model, wherein the marked data are feature vector groups which are correctly identified and respectively correspond to the character rows in the training sample images.
6. The method of claim 1, further comprising:
and sending the at least one Chinese character to the client side to be displayed by the client side.
7. The method of any one of claims 1-6, wherein the code corresponding to each Chinese character in the Chinese character information base is determined by:
aiming at each Chinese character in the Chinese character information base, acquiring components contained in the Chinese character and structural relations among the components;
modifying element values corresponding to the parts in a first coding sequence into first bit values aiming at each part to obtain a second coding sequence, wherein the first coding sequence is a binary bit sequence with each element value being a second bit value, each part or structural relations among the parts in a part structure set respectively correspond to each element in the first coding sequence one by one, and the part structure set is a set formed by the parts and the structural relations among the parts contained in all Chinese characters in the Chinese character information base;
and modifying the element values corresponding to the structural relationship among the parts in the second coding sequence into the first bit values aiming at the structural relationship among the parts to obtain the codes corresponding to the Chinese characters.
8. The method of any one of claims 1-6, wherein the code corresponding to each Chinese character in the Chinese character information base is determined by:
aiming at each Chinese character in the Chinese character information base, acquiring components contained in the Chinese character and structural relations among the components;
modifying element values corresponding to the parts in a third coding sequence into first bit values aiming at each part to obtain a fourth coding sequence, wherein the third coding sequence is a binary bit sequence with each element value being a second bit value, each part in a part set is respectively in one-to-one correspondence with each element in the third coding sequence, and the part set is a set formed by parts contained in all Chinese characters in the Chinese character information base;
modifying element values in a fifth coding sequence corresponding to the structural relationship among the parts into the first bit values according to the structural relationship among the parts to obtain a sixth coding sequence, wherein the fifth coding sequence is a binary bit sequence with all the element values being the second bit values, the structural relationship among the parts in a structural set respectively corresponds to all the elements in the fifth coding sequence one by one, and the structural set is a set formed by the structural relationship among the parts contained in all the Chinese characters in the Chinese character information base;
and splicing the fourth coding sequence and the sixth coding sequence to obtain the codes corresponding to the Chinese characters.
9. A chinese character recognition apparatus, comprising:
the receiving module is used for receiving the image to be identified sent by the client;
the first determining module is used for determining a feature vector group of a character row to be recognized in the image to be recognized received by the receiving module, wherein the dimension of each feature vector in the feature vector group is the sum of the number of components contained in all Chinese characters in a Chinese character information base and the number of structural relations among the components, each element in the feature vector is a probability value corresponding to the components contained in all the Chinese characters or the structural relations among the components, and the components comprise components and radicals;
the conversion module is used for converting the nonzero elements in the feature vector group obtained by the first determination module into 0 or 1 according to a preset rule to obtain a new feature vector group;
and the first acquisition module is used for acquiring at least one Chinese character in the Chinese character row to be recognized according to the new feature vector group obtained by the conversion module.
10. The apparatus of claim 9, wherein the conversion module comprises:
a first converter module, configured to, for each non-zero element in the feature vector group obtained by the first determination module, set the non-zero element to 1 if the non-zero element is greater than a preset threshold;
and the second conversion submodule is used for setting the non-zero element to 0 if the non-zero element is less than or equal to the preset threshold value.
11. The apparatus of claim 9, wherein the first obtaining module comprises:
the first determining submodule is used for determining a target code which is completely matched with the new feature vector from codes corresponding to all Chinese characters in the Chinese character information base aiming at each new feature vector in the new feature vector group obtained by the conversion module;
and the second determining submodule is used for determining the Chinese character corresponding to the target code determined by the first determining submodule as a target Chinese character to obtain at least one Chinese character in the Chinese character row to be recognized.
12. The apparatus of claim 9, wherein the first determining module is configured to: and inputting the character row to be recognized in the image to be recognized received by the receiving module into a preset neural network model to obtain a characteristic vector group of the character row to be recognized, wherein the preset neural network model is constructed according to codes corresponding to all Chinese characters in a Chinese character information base.
13. The apparatus of claim 12, wherein the predetermined neural network model is constructed by a model training apparatus according to codes corresponding to each chinese character in a chinese character information library, wherein the model training apparatus comprises:
the second acquisition module is used for acquiring a plurality of training sample images;
a third obtaining module, configured to input text rows in the training sample images obtained by the second obtaining module into an initial neural network model to obtain an output result of the initial neural network model, where the initial neural network model has at least one convolutional layer, the number of convolutional kernels of the at least one convolutional layer is determined according to the length of the code, the at least one layer includes a last layer, the convolutional layer is configured to scan the training sample image according to the size and step length of the convolutional kernels to perform feature extraction and feature mapping on the text rows in the training sample image, and the length is equal to the dimension;
and the training module is used for training the initial neural network model according to the comparison result of the output result and the marking data acquired by the third acquisition module to acquire a preset neural network model, wherein the marking data are feature vector groups which are respectively corresponding to the character rows in the training sample images and correctly identified.
14. The apparatus of claim 9, further comprising:
and the sending module is used for sending the at least one Chinese character acquired by the first acquiring module to the client side so as to be displayed by the client side.
15. The apparatus according to any one of claims 9-14, wherein the code corresponding to each chinese character in the chinese character information library is determined by a coding apparatus, wherein the coding apparatus comprises:
the fourth acquisition module is used for acquiring components contained in the Chinese characters and structural relations among the components aiming at each Chinese character in the Chinese character information base;
a second determining module, configured to modify, for each component obtained by the fourth obtaining module, an element value corresponding to the component in a first coding sequence into a first bit value to obtain a second coding sequence, where the first coding sequence is a binary bit sequence in which each element value is a second bit value, and each component or structural relationships among components in a component structure set correspond to each element in the first coding sequence one to one, and the component structure set is a set formed by components and structural relationships among components included in all chinese characters in the chinese character information base;
and a third determining module, configured to modify, for each inter-component structural relationship obtained by the fourth obtaining module, an element value corresponding to the inter-component structural relationship in the second coding sequence obtained by the second determining module to the first bit value, so as to obtain a code corresponding to the chinese character.
16. The apparatus according to any one of claims 9-14, wherein the code corresponding to each chinese character in the chinese character information library is determined by a coding apparatus, wherein the coding apparatus comprises:
the fourth acquisition module is used for acquiring components contained in the Chinese characters and structural relations among the components aiming at each Chinese character in the Chinese character information base;
a fourth determining module, configured to modify, for each component obtained by the fourth obtaining module, an element value corresponding to the component in a third coding sequence to a first bit value to obtain a fourth coding sequence, where the third coding sequence is a binary bit sequence in which each element value is a second bit value, each component in a component set corresponds to each element in the third coding sequence one to one, and the component set is a set formed by components included in all chinese characters in the chinese character information base;
a fifth determining module, configured to modify, for each inter-component structural relationship obtained by the fourth obtaining module, an element value corresponding to the inter-component structural relationship in a fifth coding sequence to the first bit value to obtain a sixth coding sequence, where the fifth coding sequence is a binary bit sequence in which each element value is the second bit value, structural relationships among components in a structure set are respectively in one-to-one correspondence with each element in the fifth coding sequence, and the structure set is a set formed by the structural relationships among components included in all chinese characters in the chinese character information base;
and the splicing module is used for splicing the fourth coding sequence obtained by the fourth determining module and the sixth coding sequence obtained by the fifth determining module to obtain the codes corresponding to the Chinese characters.
17. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, carries out the steps of the method of any one of claims 1 to 8.
18. An electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to carry out the steps of the method according to any one of claims 1 to 8.
CN201910905543.0A 2019-09-24 2019-09-24 Chinese character recognition method and device, computer readable medium and electronic equipment Active CN110659639B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910905543.0A CN110659639B (en) 2019-09-24 2019-09-24 Chinese character recognition method and device, computer readable medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910905543.0A CN110659639B (en) 2019-09-24 2019-09-24 Chinese character recognition method and device, computer readable medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110659639A CN110659639A (en) 2020-01-07
CN110659639B true CN110659639B (en) 2021-11-05

Family

ID=69038825

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910905543.0A Active CN110659639B (en) 2019-09-24 2019-09-24 Chinese character recognition method and device, computer readable medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110659639B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111275046B (en) * 2020-01-10 2024-04-16 鼎富智能科技有限公司 Character image recognition method and device, electronic equipment and storage medium
CN113554033B (en) * 2021-09-18 2021-12-10 深圳市一号互联科技有限公司 Text recognition method, device and system of intelligent text robot
CN113554012B (en) * 2021-09-22 2022-01-11 江西博微新技术有限公司 Primitive model classification method, system, equipment and storage medium in three-dimensional engineering
CN117218667B (en) * 2023-11-07 2024-03-08 华侨大学 Chinese character recognition method and system based on character roots

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105654130A (en) * 2015-12-30 2016-06-08 成都数联铭品科技有限公司 Recurrent neural network-based complex image character sequence recognition system
CN105678293A (en) * 2015-12-30 2016-06-15 成都数联铭品科技有限公司 Complex image and text sequence identification method based on CNN-RNN
CN107067031A (en) * 2017-03-29 2017-08-18 西北大学 A kind of calligraphy posture automatic identifying method based on Wi Fi signals
CN108345581A (en) * 2017-01-24 2018-07-31 北京搜狗科技发展有限公司 A kind of information identifying method, device and terminal device
CN109871544A (en) * 2019-03-25 2019-06-11 平安科技(深圳)有限公司 Entity recognition method, device, equipment and storage medium based on Chinese case history
CN110162784A (en) * 2019-04-19 2019-08-23 平安科技(深圳)有限公司 Entity recognition method, device, equipment and the storage medium of Chinese case history

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106527759B (en) * 2012-07-13 2019-07-26 上海触乐信息科技有限公司 The system and method for portable terminal taxi operation auxiliary information input control function

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105654130A (en) * 2015-12-30 2016-06-08 成都数联铭品科技有限公司 Recurrent neural network-based complex image character sequence recognition system
CN105678293A (en) * 2015-12-30 2016-06-15 成都数联铭品科技有限公司 Complex image and text sequence identification method based on CNN-RNN
CN108345581A (en) * 2017-01-24 2018-07-31 北京搜狗科技发展有限公司 A kind of information identifying method, device and terminal device
CN107067031A (en) * 2017-03-29 2017-08-18 西北大学 A kind of calligraphy posture automatic identifying method based on Wi Fi signals
CN109871544A (en) * 2019-03-25 2019-06-11 平安科技(深圳)有限公司 Entity recognition method, device, equipment and storage medium based on Chinese case history
CN110162784A (en) * 2019-04-19 2019-08-23 平安科技(深圳)有限公司 Entity recognition method, device, equipment and the storage medium of Chinese case history

Also Published As

Publication number Publication date
CN110659639A (en) 2020-01-07

Similar Documents

Publication Publication Date Title
CN110659639B (en) Chinese character recognition method and device, computer readable medium and electronic equipment
CN110826567B (en) Optical character recognition method, device, equipment and storage medium
CN110413812B (en) Neural network model training method and device, electronic equipment and storage medium
CN112883968B (en) Image character recognition method, device, medium and electronic equipment
CN113313064A (en) Character recognition method and device, readable medium and electronic equipment
CN113033580B (en) Image processing method, device, storage medium and electronic equipment
CN112883967B (en) Image character recognition method, device, medium and electronic equipment
CN112364829B (en) Face recognition method, device, equipment and storage medium
CN113449070A (en) Multimodal data retrieval method, device, medium and electronic equipment
CN110674813B (en) Chinese character recognition method and device, computer readable medium and electronic equipment
CN109816023B (en) Method and device for generating picture label model
CN114067327A (en) Text recognition method and device, readable medium and electronic equipment
CN112883966B (en) Image character recognition method, device, medium and electronic equipment
CN114494709A (en) Feature extraction model generation method, image feature extraction method and device
CN112800961B (en) Stroke writing sequence detection method, device, medium and electronic equipment
CN113407665A (en) Text comparison method, device, medium and electronic equipment
CN111898338A (en) Text generation method and device and electronic equipment
CN110765304A (en) Image processing method, image processing device, electronic equipment and computer readable medium
CN114612909A (en) Character recognition method and device, readable medium and electronic equipment
CN115937888A (en) Document comparison method, device, equipment and medium
CN114495080A (en) Font identification method and device, readable medium and electronic equipment
CN114463768A (en) Form recognition method and device, readable medium and electronic equipment
CN114495081A (en) Text recognition method and device, readable medium and electronic equipment
CN114495112A (en) Method and device for processing text in image, readable medium and electronic equipment
CN114862720A (en) Canvas restoration method and device, electronic equipment and computer readable medium

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