A character recognition method and device
Convolution processing and similarity calculation of the target image through the convolution neural network model solves the problems of low accuracy, complex process and time-consuming character recognition in the existing technology, and simplifies the process, shortens time consumption and improves the accuracy rate. effect.
Patent Information
- Application Number
- CN202010230663.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-27
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2040-03-27
AI Technical Summary
In the prior art, character recognition has low accuracy, complex process, long time, and can only recognize a single character.
The convolutional neural network model is used to convolutionize the target image, obtain feature vectors, and use the branch network of the output layer to perform similarity calculations to identify the target characters in the target image, including single characters and combined characters.
It simplifies the character recognition process, shortens recognition time and improves recognition accuracy, and can recognize single characters and combined characters at the same time.
Smart Images

Figure CN113449760B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a character recognition method and device. Background Art
[0002] Character recognition is a technology that converts the characters of various bills, newspapers, books, manuscripts and other printed materials into image information through optical input methods such as scanning, and then uses character recognition technology to convert the image information into a technology that can be input and used by the computer.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] 1. Using traditional image processing and recognition methods other than CNN (Convolutional Neural Network), the character recognition accuracy is low;
[0005] 2. The existing method using CNN has a complex character recognition process, low character recognition accuracy, a long recognition time, and can only recognize a single character during direct recognition. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides a character recognition method and device, which can simplify the character recognition process, shorten the character recognition time, improve the recognition accuracy, and simultaneously recognize single characters and combined characters.
[0007] To achieve the above object, according to a first aspect of an embodiment of the present invention, a character recognition method and device are provided, including:
[0008] Use the convolutional neural network model to perform convolution processing on the target image to obtain the feature vector of the target image;
[0009] The similarity is calculated between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image to identify the target character in the target image, wherein the feature character includes a single character and a combined character.
[0010] Furthermore, the output layer of the convolutional neural network model corresponds to at least one branch network, and each branch network corresponds to a feature vector of a feature character.
[0011] Furthermore, the step of calculating the similarity between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image includes: calculating the similarity between the feature vector of the feature character corresponding to each branch network of the output layer and the feature vector of the target image respectively.
[0012] Furthermore, after the step of calculating the similarity between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image, the character recognition method also includes: normalizing the similarity calculation result according to a similarity threshold to complete the recognition of the target character in the target image according to the normalized result.
[0013] Furthermore, before the step of performing convolution processing on the target image using the convolutional neural network model, the character recognition method further includes:
[0014] Set corresponding weight coefficients for the feature characters corresponding to each branch network of the output layer of the convolutional neural network model;
[0015] The convolutional neural network model is trained using the training set so that the convolutional neural network model converges.
[0016] Furthermore, before the step of training the convolutional neural network model using the training set, the character recognition method also includes: determining the total output loss of the output layer according to the weight coefficient and recognition deviation of the feature character corresponding to each branch network, so as to adjust the weight coefficient of the feature character corresponding to each branch network according to the total output loss and the training results.
[0017] Furthermore, the training set is divided into multiple training subsets according to the difficulty level, and the step of using the training set to train the convolutional neural network model includes: training the convolutional neural network model using the training subsets in order of difficulty level from small to large, wherein the difficulty level is determined according to the size and clarity of the image characters in the training subsets.
[0018] According to a second aspect of an embodiment of the present invention, there is provided a character recognition device, comprising:
[0019] A convolution processing module is used to perform convolution processing on the target image using a convolutional neural network model to obtain a feature vector of the target image;
[0020] The recognition module is used to calculate the similarity between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image to recognize the target character in the target image, wherein the feature character includes a single character and a combined character.
[0021] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, including:
[0022] one or more processors;
[0023] a storage device for storing one or more programs,
[0024] When one or more programs are executed by one or more processors, the one or more processors implement any of the above-mentioned character recognition methods.
[0025] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored. When the program is executed by a processor, any of the above-mentioned character recognition methods is implemented.
[0026] An embodiment of the above invention has the following advantages or beneficial effects: because a convolutional neural network model is used to perform convolution processing on the target image to obtain a feature vector of the target image; the feature vector of the feature character corresponding to the output layer of the convolutional neural network model is used to perform similarity calculation with the feature vector of the target image to identify the target character in the target image, wherein the feature character includes a single character and a combined character. The technical problems of the prior art such as complex character recognition process, low recognition accuracy, long time consumption, and only being able to recognize a single character during direct recognition are overcome, thereby achieving the technical effect of simplifying the character recognition process, shortening the character recognition time, and improving the recognition accuracy while simultaneously recognizing a single character and a combined character.
[0027] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0029] Figure 1 is a schematic diagram of the main process of the character recognition method provided according to the first embodiment of the present invention;
[0030] Figure 2a is a schematic diagram of the main process of the character recognition method provided according to the second embodiment of the present invention;
[0031] Figure 2b yes Figure 2a A structural diagram of a convolutional neural network provided by the method shown;
[0032] Figure 2c yes Figure 2a A schematic diagram of characteristic characters corresponding to each branch network provided by the method shown;
[0033] Figure 2d yes Figure 2a A schematic diagram of a convolutional neural network level-by-level training provided by the method shown;
[0034] Figure 3 is a schematic diagram of main modules of a character recognition device provided according to an embodiment of the present invention;
[0035] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0036] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0038] Figure 1 Schematic diagram of the main process of the character recognition method provided according to the first embodiment of the present invention; Figure 1 As shown, the character recognition method provided by the embodiment of the present invention mainly includes:
[0039] Step S101, using a convolutional neural network model to perform convolution processing on the target image to obtain a feature vector of the target image.
[0040] Through the above settings, the existing convolutional neural network model can be used to perform convolution processing on the target image to obtain the feature vector of the target image for subsequent character recognition. There is no need to locate and cut the characters, which saves computing resources and avoids the impact of errors caused by character detection (including positioning and cutting processes) on subsequent character recognition, while achieving the effect of streamlining the character recognition process.
[0041] Specifically, according to an embodiment of the present invention, the output layer of the convolutional neural network model corresponds to at least one branch network, and each branch network corresponds to a feature vector of a feature character.
[0042] Through the above settings, the output layer of the existing convolutional neural network model is improved so that the output layer includes at least one branch network, each branch network can recognize characteristic characters, and achieve the effect of simultaneously recognizing multiple characters. In order to improve the accuracy of character recognition, each branch network only corresponds to the feature vector of one characteristic character, so as to calculate the similarity with the feature vector of the target image and recognize the corresponding character.
[0043] Further, according to an embodiment of the present invention, before the step of performing convolution processing on the target image using the convolutional neural network model, the character recognition method further includes:
[0044] Set corresponding weight coefficients for the feature characters corresponding to each branch network of the output layer of the convolutional neural network model;
[0045] The convolutional neural network model is trained using the training set so that the convolutional neural network model converges.
[0046] In order to realize the recognition of characteristic characters, each branch network needs to set a corresponding weight coefficient for its corresponding characteristic character, thereby shortening the recognition time and improving the recognition accuracy. At the same time, the improved convolutional neural network model needs to be trained to make the model converge.
[0047] Specifically, according to an embodiment of the present invention, before the above-mentioned step of training the convolutional neural network model using the training set, the character recognition method also includes: determining the total output loss of the output layer according to the weight coefficient and recognition deviation of the feature character corresponding to each branch network, so as to adjust the weight coefficient of the feature character corresponding to each branch network according to the total output loss and the training results.
[0048] If each branch network sets the weight coefficients of all characters (including feature characters) to the same value, it means that the branch network pays equal attention to all characters, resulting in the recognition accuracy of each character relying on the character data itself, making it difficult to achieve accurate recognition. By configuring different weight coefficients, the attention of each branch network to different feature characters is balanced, so that the feature characters corresponding to the branch network have a higher recognition accuracy.
[0049] Further, according to an embodiment of the present invention, the above-mentioned training set is divided into multiple training subsets according to difficulty levels, and the step of training the convolutional neural network model using the training set includes: training the convolutional neural network model using the training subsets in order from small to large difficulty levels, wherein the difficulty level is determined according to the size and clarity of the image characters in the training subsets.
[0050] Since there are many branch networks for recognition operations and there are large differences between different branches, it is difficult to learn effective rules through training when using conventional back-propagation algorithm training, and the convolutional neural network model is also difficult to converge. Through the above settings, according to the difficulty of the training subset, the improved convolutional neural network model is trained step by step, which can effectively ensure the convergence of the improved convolutional neural network model and further improve the accuracy of subsequent character recognition through the convolutional neural network model.
[0051] Step S102, using the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image to perform similarity calculation to identify the target character in the target image, wherein the feature character includes a single character and a combined character.
[0052] Through the above settings, the characteristic characters corresponding to the output layer can be single characters or combined characters, and both can be recognized by the above method.
[0053] Specifically, according to an embodiment of the present invention, the step of calculating the similarity between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image includes: calculating the similarity between the feature vector of the feature character corresponding to each branch network of the output layer and the feature vector of the target image respectively.
[0054] The feature vectors of the feature characters corresponding to each branch network are respectively calculated with the feature vectors of the target image for similarity calculation, so that multiple feature characters can be recognized simultaneously from the output layer, which simplifies the character recognition process and shortens the recognition time.
[0055] Further, according to an embodiment of the present invention, after the step of calculating the similarity between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image, the character recognition method also includes: normalizing the similarity calculation result according to a similarity threshold to complete the recognition of the target character in the target image according to the normalized result.
[0056] After similarity calculation, different similarity calculation results of multiple characters can be obtained, and then combined with the similarity threshold for judgment, it is determined that the characters corresponding to the similarity calculation results greater than or equal to the similarity threshold have higher significance and are the target characters, thereby completing the recognition of the target characters in the target image.
[0057] According to the technical solution of the embodiment of the present invention, a convolutional neural network model is used to perform convolution processing on the target image to obtain a feature vector of the target image; the feature vector of the feature character corresponding to the output layer of the convolutional neural network model is used to calculate the similarity with the feature vector of the target image to identify the target character in the target image, wherein the feature character includes a single character and a combined character. Therefore, the technical problems existing in the prior art of complex character recognition process, low recognition accuracy, long time consumption, and only single character recognition during direct recognition are overcome, thereby achieving the technical effect of simplifying the character recognition process, shortening the character recognition time consumption, and improving the recognition accuracy while simultaneously recognizing a single character and a combined character.
[0058] Figure 2a is a schematic diagram of the main process of the character recognition method provided according to the second embodiment of the present invention; Figure 2a As shown, the character recognition method provided by the embodiment of the present invention mainly includes:
[0059] Step S201, setting corresponding weight coefficients for feature characters corresponding to each branch network of the output layer of the convolutional neural network model.
[0060] According to an embodiment of the present invention, the framework structure of the existing convolutional neural network model can be adopted (its structure diagram is as shown in FIG. Figure 2b As shown in the figure, where I is the neural network input layer, F is the feature layer, and O is the output layer), the target image is convoluted, and only the output layer (O layer) is improved, so that the output layer includes at least one branch network, and each branch network can recognize the feature character, achieving the effect of recognizing multiple characters at the same time. In order to improve the accuracy of character recognition, each branch network only corresponds to the feature vector of a feature character, so as to calculate the similarity with the feature vector of the target image and recognize the corresponding character.
[0061] The characteristic characters corresponding to each branch network of the output layer can be a single character or a combination of characters. After configuring the corresponding characteristic characters for each branch network (for example Figure 2c As shown, the characteristic characters corresponding to the branch network can be single characters such as A, B, C..., x, y, z..., 0, 1, 2..., spring, rich, year..., or combined characters such as 6.18, 1111, 520, etc.), and it is necessary to set a corresponding weight coefficient for the characteristic characters corresponding to each branch network so that the characteristic characters have significance in the recognition of the branch network. Then the target character is recognized through subsequent similarity calculation.
[0062] According to an embodiment of the present invention, if each branch network sets the weight coefficients of all characters (including feature characters) to the same value, it means that the branch network has the same attention to all characters, resulting in the recognition accuracy of each character relying on the character data itself, making it difficult to achieve accurate recognition. By configuring different weight coefficients, the attention of each branch network to different feature characters is balanced, so that the feature characters corresponding to the branch network have a higher recognition accuracy.
[0063] Step S202, determining the total output loss of the output layer according to the weight coefficient and recognition deviation of the feature character corresponding to each branch network.
[0064] Specifically, the output loss may be determined according to an aggregation loss algorithm, and the output loss of each branch network may be calculated separately.
[0065] L all =a A l A +a B l B +a C l C +…+a 1111 l 1111 +a520 l 520 +…
[0066] Among them, a i (i = A, B, C…, representing each characteristic character) represents the weight coefficient of each characteristic character, l i represents the recognition error of each characteristic character, and L all represents the total output loss of the convolutional neural network model.
[0067] Step S203: Train the convolutional neural network model sequentially using the training subsets in ascending order of difficulty level.
[0068] The training set is divided into multiple training subsets according to the difficulty level. The difficulty level of the training subsets is determined based on the size and clarity of the image characters. The full training set is {S}, which is divided into multiple training subsets {S1, S2, …, Sn}. There can be overlapping parts among the multiple training subsets, and the difficulty levels among different training subsets are: S1 < S2 < … < Sn. As Figure 2d shown, during training, all the training subsets are placed into a first-in-first-out (FIFO) queue. The FIFO queue mechanism first uses the data in training subset S1 for training, and then uses S2 until all the training subsets are trained.
[0069] Step S204: Determine whether the convolutional neural network model has converged based on the total output loss and the training results. If so, execute Step S205; if not, go to Step S206.
[0070] Step S205: Perform convolutional processing on the target image using the convolutional neural network model to obtain the feature vector of the target image.
[0071] Through the above settings, an existing convolutional neural network model can be used to perform convolutional processing on the target image to obtain the feature vector of the target image for subsequent character recognition, without the need for the processes of character localization and cutting, saving computing resources, avoiding the influence of errors caused by character detection (including the processes of localization and cutting) on subsequent character recognition, and achieving the effect of streamlining the character recognition process.
[0072] Step S206: Adjust the weight coefficients of the characteristic characters corresponding to the branch network.
[0073] By adjusting the weight coefficients, the saliency of the characteristic characters corresponding to the branch network is enhanced, and its recognition effect is enhanced.
[0074] Step S207: Calculate the similarity between the feature vectors of the characteristic characters corresponding to each branch network of the output layer and the feature vector of the target image respectively.
[0075] The feature vectors of the feature characters corresponding to each branch network are respectively calculated with the feature vectors of the target image for similarity calculation, so that multiple feature characters can be recognized simultaneously from the output layer, which simplifies the character recognition process and shortens the recognition time.
[0076] Step S208 , normalizing the similarity calculation result according to the similarity threshold value, so as to complete the recognition of the target character in the target image according to the normalized result.
[0077] After similarity calculation, different similarity calculation results of multiple characters can be obtained, and then combined with the similarity threshold for judgment, it is determined that the characters corresponding to the similarity calculation results greater than or equal to the similarity threshold have higher significance and are the target characters, thereby completing the recognition of the target characters in the target image.
[0078] According to the technical solution of the embodiment of the present invention, a convolutional neural network model is used to perform convolution processing on the target image to obtain a feature vector of the target image; the feature vector of the feature character corresponding to the output layer of the convolutional neural network model is used to calculate the similarity with the feature vector of the target image to identify the target character in the target image, wherein the feature character includes a single character and a combined character. Therefore, the technical problems existing in the prior art of complex character recognition process, low recognition accuracy, long time consumption, and only single character recognition during direct recognition are overcome, thereby achieving the technical effect of simplifying the character recognition process, shortening the character recognition time consumption, and improving the recognition accuracy while simultaneously recognizing a single character and a combined character.
[0079] Figure 3 is a schematic diagram of the main modules of the character recognition device provided according to an embodiment of the present invention; Figure 3 As shown, the character recognition device 300 provided in the embodiment of the present invention mainly includes:
[0080] The convolution processing module 301 is used to perform convolution processing on the target image using a convolutional neural network model to obtain a feature vector of the target image.
[0081] Through the above settings, the existing convolutional neural network model can be used to perform convolution processing on the target image to obtain the feature vector of the target image for subsequent character recognition. There is no need to locate and cut the characters, which saves computing resources and avoids the impact of errors caused by character detection (including positioning and cutting processes) on subsequent character recognition, while achieving the effect of streamlining the character recognition process.
[0082] Specifically, according to an embodiment of the present invention, the output layer of the convolutional neural network model corresponds to at least one branch network, and each branch network corresponds to a feature vector of a feature character.
[0083] Through the above settings, the output layer of the existing convolutional neural network model is improved so that the output layer includes at least one branch network, each branch network can recognize characteristic characters, and achieve the effect of simultaneously recognizing multiple characters. In order to improve the accuracy of character recognition, each branch network only corresponds to the feature vector of one characteristic character, so as to calculate the similarity with the feature vector of the target image and recognize the corresponding character.
[0084] Further, according to an embodiment of the present invention, the character recognition device 300 further includes a convolutional neural network model training module. Before the step of performing convolution processing on the target image using the convolutional neural network model, the convolutional neural network model training module is used to:
[0085] Set corresponding weight coefficients for the feature characters corresponding to each branch network of the output layer of the convolutional neural network model;
[0086] The convolutional neural network model is trained using the training set so that the convolutional neural network model converges.
[0087] In order to realize the recognition of characteristic characters, each branch network needs to set a corresponding weight coefficient for its corresponding characteristic character, thereby shortening the recognition time and improving the recognition accuracy. At the same time, the improved convolutional neural network model needs to be trained to make the model converge.
[0088] Specifically, according to an embodiment of the present invention, the above-mentioned character recognition device 300 also includes a weight coefficient adjustment module. Before the above-mentioned step of training the convolutional neural network model using the training set, the above-mentioned weight coefficient adjustment module is used to: determine the total output loss of the output layer according to the weight coefficient and recognition deviation of the feature character corresponding to each branch network, so as to adjust the weight coefficient of the feature character corresponding to each branch network according to the total output loss and the training results.
[0089] If each branch network sets the weight coefficients of all characters (including feature characters) to the same value, it means that the branch network pays equal attention to all characters, resulting in the recognition accuracy of each character relying on the character data itself, making it difficult to achieve accurate recognition. By configuring different weight coefficients, the attention of each branch network to different feature characters is balanced, so that the feature characters corresponding to the branch network have a higher recognition accuracy.
[0090] Further, according to an embodiment of the present invention, the above-mentioned training set is divided into multiple training subsets according to difficulty levels, and the above-mentioned convolutional neural network model training module is also used to: train the convolutional neural network model in sequence using the training subsets in order of difficulty level from small to large, wherein the difficulty level is determined according to the size and clarity of the image characters in the training subset.
[0091] Since there are many branch networks for recognition operations and there are large differences between different branches, it is difficult to learn effective rules through training when using conventional back-propagation algorithm training, and the convolutional neural network model is also difficult to converge. Through the above settings, according to the difficulty of the training subset, the improved convolutional neural network model is trained step by step, which can effectively ensure the convergence of the improved convolutional neural network model and further improve the accuracy of subsequent character recognition through the convolutional neural network model.
[0092] The recognition module 302 is used to calculate the similarity between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image to recognize the target character in the target image, wherein the feature character includes a single character and a combined character.
[0093] Through the above settings, the characteristic characters corresponding to the output layer can be single characters or combined characters, and both can be recognized by the above method.
[0094] Specifically, according to an embodiment of the present invention, the recognition module 302 is further used to: use the feature vectors of the feature characters corresponding to each branch network of the output layer to perform similarity calculations with the feature vectors of the target image respectively.
[0095] The feature vectors of the feature characters corresponding to each branch network are respectively calculated with the feature vectors of the target image for similarity calculation, so that multiple feature characters can be recognized simultaneously from the output layer, which simplifies the character recognition process and shortens the recognition time.
[0096] Further, according to an embodiment of the present invention, the above-mentioned character recognition device 300 also includes a normalization processing module. After the step of calculating the similarity between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image, the above-mentioned normalization processing module is used to: normalize the similarity calculation result according to the similarity threshold, so as to complete the recognition of the target character in the target image according to the normalization result.
[0097] After similarity calculation, different similarity calculation results of multiple characters can be obtained, and then combined with the similarity threshold for judgment, it is determined that the characters corresponding to the similarity calculation results greater than or equal to the similarity threshold have higher significance and are the target characters, thereby completing the recognition of the target characters in the target image.
[0098] According to the technical solution of the embodiment of the present invention, a convolutional neural network model is used to perform convolution processing on the target image to obtain a feature vector of the target image; the feature vector of the feature character corresponding to the output layer of the convolutional neural network model is used to calculate the similarity with the feature vector of the target image to identify the target character in the target image, wherein the feature character includes a single character and a combined character. Therefore, the technical problems existing in the prior art of complex character recognition process, low recognition accuracy, long time consumption, and only single character recognition during direct recognition are overcome, thereby achieving the technical effect of simplifying the character recognition process, shortening the character recognition time consumption, and improving the recognition accuracy while simultaneously recognizing a single character and a combined character.
[0099] Figure 4 An exemplary system architecture 400 is shown to which the character recognition method or the character recognition device according to the embodiment of the present invention can be applied.
[0100] like Figure 4 As shown, the system architecture 400 may include terminal devices 401, 402, 403, a network 404 and a server 405 (this architecture is only an example, and the components included in the specific architecture may be adjusted according to the specific application). The network 404 is used to provide a medium for a communication link between the terminal devices 401, 402, 403 and the server 405. The network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0101] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0102] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0103] The server 405 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0104] It should be noted that the character recognition method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the character recognition device is generally disposed in the server 405 .
[0105] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0106] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0107] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0108] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0109] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0110] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0111] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0112] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be arranged in a processor. For example, they may be described as: a processor including a convolution processing module and a recognition module. The names of these modules do not constitute limitations on the modules themselves in certain cases. For example, the convolution processing module may also be described as "a module for performing convolution processing on a target image using a convolutional neural network model to obtain a feature vector of the target image".
[0113] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: performing convolution processing on the target image using a convolutional neural network model to obtain a feature vector of the target image; performing similarity calculation between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image to identify the target character in the target image, wherein the feature character includes a single character and a combined character.
[0114] According to the technical solution of the embodiment of the present invention, a convolutional neural network model is used to perform convolution processing on the target image to obtain a feature vector of the target image; the feature vector of the feature character corresponding to the output layer of the convolutional neural network model is used to calculate the similarity with the feature vector of the target image to identify the target character in the target image, wherein the feature character includes a single character and a combined character. Therefore, the technical problems existing in the prior art of complex character recognition process, low recognition accuracy, long time consumption, and only single character recognition during direct recognition are overcome, thereby achieving the technical effect of simplifying the character recognition process, shortening the character recognition time consumption, and improving the recognition accuracy while simultaneously recognizing a single character and a combined character.
[0115] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A character recognition method, characterized in that: include: Performing convolution processing on the target image using a convolutional neural network model to obtain a feature vector of the target image; The output layer of the convolutional neural network model corresponds to at least one branch network, and each branch network corresponds to a feature vector of a feature character; Calculating similarity between a feature vector of a feature character corresponding to an output layer of the convolutional neural network model and a feature vector of the target image to identify a target character in the target image, wherein the feature character includes a single character and a combined character; The step of calculating the similarity between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image includes: calculating the similarity between the feature vector of the feature character corresponding to each branch network of the output layer and the feature vector of the target image respectively.
2. The character recognition method according to claim 1, characterized in that: After the step of calculating the similarity between the feature vector of the feature character corresponding to the output layer of the convolutional neural network model and the feature vector of the target image, the character recognition method further includes: normalizing the similarity calculation result according to a similarity threshold to complete the recognition of the target character in the target image according to the normalized result.
3. The character recognition method according to claim 1, characterized in that: Before the step of performing convolution processing on the target image using the convolutional neural network model, the character recognition method further includes: Setting corresponding weight coefficients for characteristic characters corresponding to each branch network of the output layer of the convolutional neural network model; The convolutional neural network model is trained using a training set so that the convolutional neural network model reaches convergence.
4. The character recognition method according to claim 3, characterized in that: Before the step of training the convolutional neural network model using the training set, the character recognition method also includes: determining the total output loss of the output layer according to the weight coefficient and recognition deviation of the feature character corresponding to each branch network, so as to adjust the weight coefficient of the feature character corresponding to each branch network according to the total output loss and the training results.
5. The character recognition method according to claim 3, characterized in that: The training set is divided into a plurality of training subsets according to difficulty levels, and the step of using the training set to train the convolutional neural network model comprises: using the training subsets to train the convolutional neural network model in order of difficulty levels from small to large, wherein the difficulty level is determined according to the size and clarity of the image characters in the training subsets.
6. A character recognition device, characterized in that: include: A convolution processing module, used to perform convolution processing on a target image using a convolutional neural network model to obtain a feature vector of the target image; The output layer of the convolutional neural network model corresponds to at least one branch network, and each branch network corresponds to a feature vector of a feature character; A recognition module, used to calculate similarity between a feature vector of a feature character corresponding to an output layer of the convolutional neural network model and a feature vector of the target image, so as to recognize a target character in the target image, wherein the feature character includes a single character and a combined character; The recognition module is also used to calculate similarities between the feature vectors of the feature characters corresponding to each branch network of the output layer and the feature vectors of the target image.
7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Character recognition method and device
CN105528610A
License plate recognition method and device
CN107784303A