Chinese recognition model training method and device, electronic equipment and storage medium
By dividing projection algorithms and binarization of interpretability models on handwritten Chinese images, the problem of low accuracy of handwritten Chinese recognition in deep learning models is solved, and higher recognition accuracy and more stable model performance is achieved.
Patent Information
- Application Number
- CN202411689796.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-02-28
AI Technical Summary
In the prior art, deep learning models have low recognition accuracy for handwritten Chinese, especially due to recognition errors caused by individual Chinese characters with individual strokes connected together.
By preprocessing the image using a preset projection algorithm, at least one first character tiles are divided and used to train the first recognition model to obtain the second recognition model. Then, the first character tile is binarized using the interpretability model and used to verify the second recognition model to obtain the target recognition model.
Effectively remove the excess parts of the connected Chinese characters, retaining only the main Chinese character area, improving the accuracy of the recognition model and reducing the impact of the recognition model network being affected by the negative region characteristics.
Smart Images

Figure CN119540980A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of text recognition processing, and in particular to a Chinese recognition model training method, device, electronic equipment and storage medium. Background Art
[0002] In the medical and financial fields, a large number of documents containing handwritten text are indispensable every day. With the popularization of office informatization, these documents also need to be synchronized to the office information system, and it is necessary to effectively recognize the text in these documents.
[0003] Currently, deep learning models are commonly used to perform text recognition on handwritten text files. However, the character levels of handwritten Chinese are relatively complex, and the different handwriting styles of different people may result in individual handwritten Chinese characters being connected together, resulting in low recognition accuracy of deep learning models. Summary of the invention
[0004] In view of the above, it is necessary to provide a Chinese recognition model training method, the purpose of which is to solve the technical problem of low recognition accuracy of handwritten Chinese by deep learning models in the prior art.
[0005] The Chinese recognition model training method provided by the present invention comprises:
[0006] Using a preset projection algorithm to divide the first text image after image preprocessing to obtain at least one first character block;
[0007] Using the first character block to train a first recognition model to obtain a second recognition model;
[0008] The first character image block is binarized using a preset interpretability model, and the second recognition model is verified using the binarized first character image block to obtain a target recognition model.
[0009] Optionally, before dividing the first text image after image preprocessing by using a preset projection algorithm, the method further includes:
[0010] Acquire a preset number of handwritten text images as a data set, and divide the data set into a training set and a test set according to a preset ratio;
[0011] The training set is subjected to image preprocessing to obtain the first text image.
[0012] Optionally, performing image preprocessing on the training set to obtain the first text image includes:
[0013] Perform image enhancement processing on each text image sample in the training set, convert the text image sample after the image enhancement processing into a grayscale image, and obtain the first text image.
[0014] Optionally, the using the first character block to train the first recognition model to obtain the second recognition model includes:
[0015] The single-layer convolutional neural network of the first recognition model is trained using the first character block as a training sample to obtain the second recognition model.
[0016] Optionally, after obtaining the second recognition model, the method further includes:
[0017] The second recognition model is tested according to the test set to obtain a first test result value.
[0018] Optionally, the using the binarized first character block to verify the second recognition model to obtain a target recognition model includes:
[0019] Performing morphological processing on the first character image block after the binarization processing to obtain a key area;
[0020] The second recognition model is verified using the key area to obtain the target recognition model.
[0021] Optionally, after verifying the second recognition model using the first character image block after the binarization process, the method further includes:
[0022] Testing the second recognition model according to the test set to obtain a second test result value;
[0023] If the second test result value is greater than the first test result value, the target recognition model is obtained.
[0024] In order to solve the above problems, the present invention also provides a Chinese recognition model training device, the device comprising:
[0025] A division module, used for dividing the first text image after image preprocessing by using a preset projection algorithm to obtain at least one first character block;
[0026] A training module, used for training a first recognition model using the first character block to obtain a second recognition model;
[0027] A verification module is used to perform binarization processing on the first character block using a preset interpretability model, and to verify the second recognition model using the binarized first character block to obtain a target recognition model.
[0028] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0029] at least one processor; and,
[0030] a memory communicatively connected to the at least one processor; wherein,
[0031] The memory stores a Chinese recognition model training program that can be executed by the at least one processor, and the Chinese recognition model training program is executed by the at least one processor so that the at least one processor can execute the above-mentioned Chinese recognition model training method.
[0032] In order to solve the above problems, the present invention also provides a computer-readable storage medium, on which a Chinese recognition model training program is stored. The Chinese recognition model training program can be executed by one or more processors to implement the above Chinese recognition model training method.
[0033] Compared with the prior art, the present invention uses a preset projection algorithm to divide the first text image after image preprocessing to obtain at least one first character block; and uses the first character block to train the first recognition model to obtain a second recognition model. The preset projection algorithm can divide Chinese characters with individual strokes connected together, effectively remove the redundant parts of the connected Chinese characters, and only retain the main Chinese character area, so that the recognition model can perform classification more accurately.
[0034] The first character block is binarized using a preset interpretability model, and the second recognition model is verified using the binarized first character block to obtain a target recognition model. The interpretability model is used to obtain the key areas in the recognition model network, and the influence of negative area features on the recognition model network is reduced, thereby improving the accuracy of the recognition model. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A flowchart of a Chinese recognition model training method provided by an embodiment of the present invention;
[0036] Figure 2 A schematic diagram of a module of a Chinese recognition model training device provided by an embodiment of the present invention;
[0037] Figure 3 A schematic diagram of the structure of an electronic device for implementing a Chinese recognition model training method provided by an embodiment of the present invention;
[0038] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0040] It should be noted that the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0041] With the rapid development of medical and financial fields, the present invention provides a Chinese recognition model training method, which can be applied in the medical and financial fields. After performing image preprocessing on the first text image, the key area in the recognition model network is obtained by using an interpretable model, thereby reducing the influence of negative area features on the recognition model network, thereby improving the accuracy of the recognition model.
[0042] The solution of the present invention is not limited by the original network, is applicable to all existing classification neural networks, and is not affected by the network structure.
[0043] Reference Figure 1 FIG. 1 is a flow chart of a Chinese recognition model training method provided by an embodiment of the present invention. The method is executed by an electronic device.
[0044] In this embodiment, the Chinese recognition model training method includes:
[0045] S1. Divide a first text image after image preprocessing by using a preset projection algorithm to obtain at least one first character block.
[0046] In this embodiment, the preset projection algorithm includes but is not limited to a vertical projection algorithm. The first text image is a handwritten text image selected from the SCUT-EPT data set, which is extracted from the test papers of 2986 volunteers and contains a total of 50,000 handwritten text images, belonging to 4250 categories (4033 common Chinese characters, 104 symbols and 113 rare characters). The text line of each handwritten text image has about 25 characters. At the same time, the handwritten text data piece in the data set is just similar to the handwritten text image of the application scenario of the present invention.
[0047] In other embodiments, the first text image may also obtain a file of user handwritten text, which is not limited here.
[0048] For example, the characters in the input first text image are converted to white and the background is converted to black using a vertical projection algorithm. That is, the first text image is regarded as a matrix composed of column vectors [x1, x2, x3, x4.......]. The number of white pixels in each column is counted, and it is used to determine whether it is a character area or a background area, and it is divided to obtain at least one first character block of the first text image.
[0049] In one embodiment, before dividing the first text image after image preprocessing by using a preset projection algorithm, the method further includes:
[0050] Acquire a preset number of handwritten text images as a data set, and divide the data set into a training set and a test set according to a preset ratio;
[0051] The training set is subjected to image preprocessing to obtain the first text image.
[0052] From the SCUT-EPT dataset, a preset number (e.g., 50,000) of handwritten text images are obtained as the dataset, and the dataset is divided into a training set and a test set according to a preset ratio (e.g., a ratio of 8:2), and then the training set is further preprocessed.
[0053] In one embodiment, it is characterized in that the step of performing image preprocessing on the training set to obtain the first text image comprises:
[0054] Perform image enhancement processing on each text image sample in the training set, convert the text image sample after the image enhancement processing into a grayscale image, and obtain the first text image.
[0055] In one embodiment, performing image enhancement processing on each text image sample in the training set includes:
[0056] The text contour and background contrast of each text image sample are increased by using a low-light image enhancement algorithm to obtain the text image sample after the image enhancement processing.
[0057] The low-light image enhancement algorithm includes but is not limited to the low-light image enhancement algorithm based on GAN and U-Net. The low-light image enhancement algorithm is used to process the low brightness, low contrast, noise, artifacts and other problems existing in each text image sample with insufficient lighting to improve the image quality.
[0058] In the process of image preprocessing of the text contour and background of each text image sample, image enhancement technology is applied to achieve image enhancement of low-light images, so that the contrast of the text contour and background of each text image sample is improved, which is convenient for subsequent feature extraction.
[0059] In one embodiment, after converting the text image sample after the image enhancement process into a grayscale image, the method further comprises:
[0060] The grayscale image is denoised using a preset mean filter to obtain the first text image.
[0061] The low-light image enhancement algorithm is used to increase the text contour and background contrast of each text image sample to obtain each text image sample after image enhancement processing.
[0062] The preset mean filter includes but is not limited to an arithmetic mean filter, a geometric mean filter, a harmonic mean filter and an inverse harmonic mean filter. The particle noise of the grayscale image is removed by using the nxn (e.g. 3x3) convolution kernel of the mean filter to retain most of the wavelet coefficients containing signals in the grayscale image, which can better maintain more image details in the grayscale image.
[0063] By performing image preprocessing on each text image sample, the problem in the prior art that many handwritten Chinese characters are similar in appearance and easy to be confused can be solved. The boundaries of each character in the first text image can be made clearer, which is beneficial to the feature extraction of the subsequent recognition model.
[0064] In one embodiment, the method of dividing the first text image after image preprocessing by using a preset projection algorithm to obtain at least one first character block includes:
[0065] Dividing the first text image to obtain at least one initial character block;
[0066] According to the height of the initial character block, removing punctuation characters from the initial character block;
[0067] The interpolation of the initial character image block after removing the punctuation characters is enlarged to a preset size to obtain the first character image block.
[0068] Using a preset projection algorithm (e.g., a vertical projection algorithm) to divide the characters of the first text image, to determine whether the first text image (grayscale image) is black characters on a white background or white characters on a black background, and thereby determine whether it is a character area or a background area, to obtain at least one initial character block;
[0069] According to the height of the initial character block, punctuation characters (such as a period, a question mark, an exclamation mark, a comma, etc.) in the initial character block are removed, and only characters of the first text image are retained;
[0070] The interpolation of the initial character image block after removing the punctuation characters is enlarged to a preset size (for example, 64×64 pixels) by an interpolation method to obtain a first character image block.
[0071] All initial character tiles are converted to a uniform size through interpolation, with the first character tile being 64x64 pixels, which helps reduce the training difficulty and training time of the subsequent recognition model.
[0072] In step S1, the Chinese characters whose individual strokes are connected together (not large overlapping areas) can be divided through a preset projection algorithm, and the redundant parts of the connected Chinese characters can be effectively removed, leaving only the main Chinese character area, so that the subsequent recognition model (neural network) can be classified more accurately.
[0073] S2. Use the first character block to train a first recognition model to obtain a second recognition model.
[0074] In this embodiment, the first recognition model includes but is not limited to the resnet50 network model. The resnet50 network model is a deep convolutional neural network that includes many convolutional layers and pooling layers.
[0075] In one embodiment, the step of training the first recognition model using the first character image block to obtain the second recognition model includes:
[0076] The single-layer convolutional neural network of the first recognition model is trained using the first character block as a training sample to obtain the second recognition model.
[0077] A single-layer convolutional neural network refers to a convolutional neural network in which both the convolution layer and the pooling layer have only one layer, and the second recognition model is a model obtained by training the single-layer convolutional neural network using the first character block as a training sample.
[0078] Among them, the input layer of the first recognition model is followed by a convolution layer, followed by a pooling layer, followed by a hidden layer, and followed by a classification layer, which are described in detail below:
[0079] The traditional convolutional neural network has unique convolutional layers and pooling layers. The convolutional layer is used to extract features. Combined with the error back propagation algorithm, it can adaptively distinguish between key features and non-key features in the first character block, avoiding the limitations of subjective feature selection and improving the generalization ability of the network. The pooling layer is used to screen the output features of the convolutional layer. In addition to reducing the processing difficulty of the first character block, the pooling process also enhances the noise resistance of the network of the first recognition model to the first character block.
[0080] If a complex deep convolutional neural network is used, for example, with more than a dozen or even dozens of convolutional layers, the result is that training is very time-consuming and requires hundreds of thousands or millions of training samples. The trained model is large and prone to underfitting, making it difficult to deploy on embedded computing devices.
[0081] In step S2, the single-layer convolutional neural network of the first recognition model is trained to obtain a second recognition model with a small size and a simple and practical structure, thereby avoiding the problem in the prior art that the above-mentioned recognition model (complex deep convolutional neural network) is prone to underfitting.
[0082] In one embodiment, after obtaining the second recognition model, the method further comprises:
[0083] The second recognition model is tested according to the test set to obtain a first test result value.
[0084] Usually at this stage, the accuracy of the first test result is not ideal, because the individual connected handwritten Chinese characters in the first text image are not accurately recognized, that is, the accuracy of the second recognition model at this time is low and difficult to meet the verification requirements.
[0085] S3. Use a preset interpretability model to binarize the first character image block, and use the binarized first character image block to verify the second recognition model to obtain a target recognition model.
[0086] In this embodiment, since the accuracy of the second recognition model is low, the present invention introduces a local interpretable model, uses the interpretable model to perform image binarization operations on the key areas and non-key areas of the first character block, and uses the binarized first character block as a verification set. The verification set is used to train the hyperparameters of the second recognition model to obtain the target recognition model, thereby improving the accuracy of the target recognition model.
[0087] By using the first character block after binarization processing as a verification set, that is, the verification set is not a verification set divided on the basis of the original data set, but the data is processed by image preprocessing and an interpretable model, the problem of low accuracy of the verification recognition model in the prior art, which is divided on the basis of the original data set, can be solved, so as to increase the recognition ability of the second recognition model.
[0088] In one embodiment, the binarization processing of the first character image block using a preset interpretability model includes:
[0089] The pixel values of the character area of the first character image block are marked as 0 and the pixel values of the background area are marked as 1 by using a preset interpretability model, so as to obtain the first character image block after the binarization processing.
[0090] The preset interpretability model includes but is not limited to the LIME model (Local Interpretable Model-agnostic Explanations), which has a network structure for handwritten Chinese recognition. The LIME model is a local interpretability model and is an interpretability method that is independent of the first recognition model and the second recognition model.
[0091] The first character block includes a character area and a background area, but the character area and the background area of the first character block at this stage are related. For the first recognition model and the second recognition model, it is impossible to determine which area of the first character block is the key area (character area), resulting in a low accuracy rate of the first test result value after training.
[0092] In order to solve the problem that the character area and background area of the first character block are related, the interpretable model is used to automatically divide the character area and background area of the first character block, and the pixel value of the character area of the first character block is marked as 0 and the pixel value of the background area is marked as 1 to obtain the first character block after binarization processing, so as to enhance the attention of the second recognition model and effectively identify the key areas.
[0093] In one embodiment, the step of verifying the second recognition model using the binarized first character image block to obtain a target recognition model includes:
[0094] Performing morphological processing on the first character image block after the binarization processing to obtain a key area;
[0095] The second recognition model is verified using the key area to obtain the target recognition model.
[0096] Morphological processing refers to filling the area with a black background where the pixel value of the first character block after binarization is 1, and filling the area with a white background where the pixel value of the first character block after binarization is 0 as the key area, so as to obtain a first character block that is either black or white. That is to say, obtaining the white key area is conducive to the network of the second recognition model to pay more attention to the outline of the text, so as to train the hyperparameters of the second recognition model, and can improve the accuracy of text recognition.
[0097] In one embodiment, after verifying the second recognition model using the first character image block after the binarization process, the method further includes:
[0098] Testing the second recognition model according to the test set to obtain a second test result value;
[0099] If the second test result value is greater than the first test result value, the target recognition model is obtained.
[0100] The first character block after binarization is used as a validation set, the hyper parameters of the second recognition model are trained with the validation set, and the second recognition model is tested according to the test set to obtain a second test result value;
[0101] If the second test result value is greater than the first test result value, it proves that the accuracy of the second recognition model has been improved, and the verified second recognition model is used as the target recognition model.
[0102] In step S3, there is no need to retrain the second recognition model. Instead, an independent interpretable model is used to obtain the key areas in the second recognition model network to verify the second recognition model, thereby improving the recognition accuracy of the recognition model.
[0103] In steps S1-S3, the present invention performs image preprocessing on the first text image and uses the interpretability model to obtain the key area in the recognition model network, thereby reducing the influence of the negative area features on the recognition model network, thereby improving the accuracy of the recognition model. The solution of the present invention is not limited by the original network, is applicable to any existing classification neural network, and is not affected by the network structure.
[0104] like Figure 2 , which is a module diagram of a Chinese recognition model training device provided by an embodiment of the present invention.
[0105] The Chinese recognition model training device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the Chinese recognition model training device 100 can include a division module 110, a training module 120, and a verification module 130. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0106] In this embodiment, the functions of each module / unit are as follows:
[0107] A division module 110 is used to divide the first text image after image preprocessing by using a preset projection algorithm to obtain at least one first character block;
[0108] A training module 120, configured to train a first recognition model using the first character image block to obtain a second recognition model;
[0109] The verification module 130 is used to perform binarization processing on the first character image block using a preset interpretability model, and to verify the second recognition model using the binarized first character image block to obtain a target recognition model.
[0110] In one embodiment, before dividing the first text image after image preprocessing by using a preset projection algorithm, the method further includes:
[0111] Acquire a preset number of handwritten text images as a data set, and divide the data set into a training set and a test set according to a preset ratio;
[0112] The training set is subjected to image preprocessing to obtain the first text image.
[0113] In one embodiment, performing image preprocessing on the training set to obtain the first text image includes:
[0114] Perform image enhancement processing on each text image sample in the training set, convert the text image sample after the image enhancement processing into a grayscale image, and obtain the first text image.
[0115] In one embodiment, the step of training the first recognition model using the first character image block to obtain the second recognition model includes:
[0116] The single-layer convolutional neural network of the first recognition model is trained using the first character block as a training sample to obtain the second recognition model.
[0117] In one embodiment, after obtaining the second recognition model, the method further comprises:
[0118] The second recognition model is tested according to the test set to obtain a first test result value.
[0119] In one embodiment, the step of verifying the second recognition model using the binarized first character image block to obtain a target recognition model includes:
[0120] Performing morphological processing on the first character image block after the binarization processing to obtain a key area;
[0121] The second recognition model is verified using the key area to obtain the target recognition model.
[0122] In one embodiment, after verifying the second recognition model using the first character image block after the binarization process, the method further includes:
[0123] Testing the second recognition model according to the test set to obtain a second test result value;
[0124] If the second test result value is greater than the first test result value, the target recognition model is obtained.
[0125] like Figure 3 , which is a schematic diagram of the structure of an electronic device for implementing a Chinese recognition model training method provided by an embodiment of the present invention.
[0126] In this embodiment, the electronic device 1 includes, but is not limited to, a memory 11, a processor 12, and a network interface 13, which can be interconnected and communicated via a system bus. The memory 11 stores a Chinese recognition model training program 10, and the Chinese recognition model training program 10 can be executed by the processor 12. Figure 3 Only the electronic device 1 having components 11-13 and the Chinese recognition model training program 10 is shown. It can be understood by those skilled in the art that Figure 3 The structure shown does not constitute a limitation on the electronic device 1 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0127] Among them, the memory 11 includes a memory and at least one type of readable storage medium. The memory provides a cache for the operation of the electronic device 1; the readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device 1; in other embodiments, the non-volatile storage medium may also be an external storage device of the electronic device 1, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. In this embodiment, the readable storage medium of the memory 11 is generally used to store an operating system and various application software installed on the electronic device 1, such as storing the code of the Chinese recognition model training program 10 in an embodiment of the present invention. In addition, the memory 11 may also be used to temporarily store various types of data that have been output or are to be output.
[0128] The processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 12 is generally used to control the overall operation of the electronic device 1, such as performing control and processing related to data interaction or communication with other devices. In this embodiment, the processor 12 is used to run the program code stored in the memory 11 or process data, such as running the Chinese recognition model training program 10.
[0129] The network interface 13 may include a wireless network interface or a wired network interface, and the network interface 13 is used to establish a communication connection between the electronic device 1 and a terminal (not shown in the figure).
[0130] Optionally, the electronic device 1 may further include a user interface, which may include a display (Display), an input unit such as a keyboard (Keyboard), and the optional user interface may also include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.
[0131] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0132] The Chinese recognition model training program 10 stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 12, it can achieve:
[0133] Using a preset projection algorithm to divide the first text image after image preprocessing to obtain at least one first character block;
[0134] Using the first character block to train a first recognition model to obtain a second recognition model;
[0135] The first character image block is binarized using a preset interpretability model, and the second recognition model is verified using the binarized first character image block to obtain a target recognition model.
[0136] Specifically, the specific implementation method of the processor 12 for the Chinese recognition model training program 10 can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0137] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable medium can be non-volatile or non-volatile. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0138] The computer-readable storage medium stores a Chinese recognition model training program 10, which can be executed by one or more processors. The specific implementation method of the computer-readable storage medium of the present invention is basically the same as the above-mentioned Chinese recognition model training method embodiments, and will not be repeated here.
[0139] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0140] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0141] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0142] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0143] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0144] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.
[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A Chinese recognition model training method, characterized in that: The method comprises: Using a preset projection algorithm to divide the first text image after image preprocessing to obtain at least one first character block; Using the first character block to train a first recognition model to obtain a second recognition model; The first character image block is binarized using a preset interpretability model, and the second recognition model is verified using the binarized first character image block to obtain a target recognition model.
2. The Chinese recognition model training method according to claim 1, characterized in that: Before dividing the first text image after image preprocessing by using a preset projection algorithm, the method further includes: Acquire a preset number of handwritten text images as a data set, and divide the data set into a training set and a test set according to a preset ratio; The training set is subjected to image preprocessing to obtain the first text image.
3. The Chinese recognition model training method as claimed in claim 2, characterized in that: The step of performing image preprocessing on the training set to obtain the first text image includes: Perform image enhancement processing on each text image sample in the training set, convert the text image sample after the image enhancement processing into a grayscale image, and obtain the first text image.
4. The Chinese recognition model training method according to claim 1, characterized in that: The step of training the first recognition model using the first character block to obtain the second recognition model includes: The single-layer convolutional neural network of the first recognition model is trained using the first character block as a training sample to obtain the second recognition model.
5. The Chinese recognition model training method according to claim 1, characterized in that: After obtaining the second recognition model, the method further includes: The second recognition model is tested according to the test set to obtain a first test result value.
6. The Chinese recognition model training method according to claim 1, characterized in that: The step of verifying the second recognition model by using the first character block after the binarization process to obtain a target recognition model includes: Performing morphological processing on the first character image block after the binarization processing to obtain a key area; The second recognition model is verified using the key area to obtain the target recognition model.
7. The Chinese recognition model training method according to claim 1 or 5, characterized in that: After verifying the second recognition model using the first character block after the binarization process, the method further includes: Testing the second recognition model according to the test set to obtain a second test result value; If the second test result value is greater than the first test result value, the target recognition model is obtained.
8. A Chinese recognition model training device, characterized in that: The device comprises: A division module, used for dividing the first text image after image preprocessing by using a preset projection algorithm to obtain at least one first character block; A training module, used for training a first recognition model using the first character block to obtain a second recognition model; A verification module is used to perform binarization processing on the first character block using a preset interpretability model, and to verify the second recognition model using the binarized first character block to obtain a target recognition model.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a Chinese recognition model training program that can be executed by the at least one processor, and the Chinese recognition model training program is executed by the at least one processor so that the at least one processor can execute the Chinese recognition model training method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a Chinese recognition model training program, and the Chinese recognition model training program can be executed by one or more processors to implement the Chinese recognition model training method as described in any one of claims 1 to 7.