Image text recognition method, image text model training method, image text recognition device, image text model training equipment and medium

By enhancing the training data of the image text recognition model, the fluctuation of the recognition accuracy of traditional models under different image quality and background is solved, and the robustness and recognition accuracy of the model are improved.

CN119495101APending Publication Date: 2025-02-21WEIKUN (SHANGHAI) TECH SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411505977.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

When traditional image text recognition models process different image quality and background, the processing performance and recognition accuracy fluctuate greatly.

Method used

The text image training data is enhanced by ray, background and focal length enhancement through image processing tools to generate a more diverse training data set, and use this data set to train the image text recognition model until the loss function converges.

Benefits of technology

It improves the robustness and recognition accuracy of the image text recognition model, and enhances the performance of the model in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119495101A_ABST
    Figure CN119495101A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and discloses an image text recognition method, a model training method and device thereof, equipment and a medium. The model training method comprises the following steps: acquiring text image data, and screening the text image data according to a preset light data threshold range to obtain a text image data set; importing a text image in the text image data set to a preset image processing tool; performing light enhancement processing, background enhancement processing and focal length enhancement processing on the text image in sequence to obtain a processed training sample data set; training a pre-constructed image text recognition model by using the training sample data set, and optimizing through a loss function of the image text recognition model; the performance of the image text recognition model is verified through the preset verification data set, and the corresponding target image text recognition model is obtained, so that the diversity of the training data set is enhanced, and the robustness of the trained image text recognition model and the text recognition accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an image text recognition method and its model training method, device, equipment and medium. Background Art

[0002] The commonly used image text recognition methods are collectively referred to as optical character recognition (OCR). Machine learning and deep learning technologies are used to convert character images into editable text. Common methods include character recognition algorithms based on template matching, feature extraction, and recurrent neural networks. When traditional OCR technology processes scenes with uneven lighting and diverse backgrounds, if the image itself is of poor quality or the image background interferes with the image text to be recognized, it will not only take more processing time when performing image text recognition, but also reduce the accuracy of the image text recognition results. Summary of the invention

[0003] The main technical problem solved by the implementation methods of the present application is that the processing performance and recognition accuracy of the traditional image text recognition model fluctuate greatly when processing images of different image qualities and image backgrounds.

[0004] In order to solve the above technical problems, the first technical solution adopted in the implementation mode of the present application is: to provide an image text recognition model training method, including: obtaining text image data, screening the text image data according to at least one preset light data threshold range, and obtaining a text image data set; importing the text image in the text image data set into a preset image processing tool according to a preset position and a preset angle; performing light enhancement processing, background enhancement processing and focal length enhancement processing on the text image in sequence through the image processing tool to obtain a processed training sample data set; using the training sample data set to train a pre-constructed image text recognition model, and optimizing the loss function of the image text recognition model until the loss function converges; verifying whether the performance data of the image text recognition model is within the preset performance data range through a preset verification data set; if not within the range, retraining the image text recognition model until the performance data passes the verification, and obtaining the corresponding target image text recognition model.

[0005] Optionally, the step of performing the light enhancement processing on the text image by the image processing tool includes: setting a light source in the image processing tool, and adjusting the parameters of the light source to within a preset light source parameter range; setting light intensity parameters and light color parameters of the ambient light in the image processing tool to correspond to a preset ambient light intensity parameter range and ambient light color parameter range; rendering the text image at least once according to the set light source, the light intensity parameters and the light color parameters, wherein the parameters of the light source, and / or the ambient light, and / or the position of the text image, and / or the angle of the text image are adjusted according to preset rules each time the rendering is performed.

[0006] Optionally, the step of performing the background enhancement processing on the text image by the image processing tool includes: importing at least one preset background image element into the image processing tool; adjusting the relative position of the text image and the background image element so that the text in the text image is not obscured by the background image element; setting the rendering parameters of the image processing tool, and rendering the text image and the imported background image element through the rendering engine of the image processing tool.

[0007] Optionally, the step of performing the focus enhancement processing on the text image by the image processing tool includes: obtaining a preset focal length range; traversing the text image and randomly obtaining a target focal length value from the focal length range; adjusting a second camera parameter corresponding to the text image according to the target focal length value in the image processing tool; and rendering the text image according to the adjusted camera parameters in turn.

[0008] Optionally, after the step of importing at least one preset background image element, the method further includes: setting the texture of the background image element and the shape of the background image element.

[0009] Optionally, the pre-built image text recognition model includes a convolutional neural network and a recurrent neural network: the convolutional neural network uses multiple layers of convolutional layers and pooling layers to extract image features of text images in the training sample data set; the recurrent neural network maps the image feature sequence to a corresponding text character sequence.

[0010] To solve the above technical problems, the second technical solution adopted in the implementation mode of the present application is: to provide an image text recognition method, including: constructing an initial image text recognition model, training the initial image text recognition model by the image text recognition model training method as described above, and obtaining a target image text recognition model; receiving a picture to be recognized, sending the picture to be recognized to the target image text recognition model, and obtaining a corresponding image text recognition result.

[0011] To solve the above technical problems, the third technical solution adopted by the implementation mode of the present application is: to provide an image text recognition model training device, including: an image data acquisition module, used to acquire text image data, and screen the text image data according to at least one preset light data threshold range to obtain a text image data set; an image data import module, used to import the text image in the text image data set to a preset image processing tool according to a preset position and a preset angle; an image data processing module, used to perform light enhancement processing, background enhancement processing and focal length enhancement processing on the text image in sequence through the image processing tool to obtain a processed training sample data set; a recognition model training module, used to use the training sample data set to train a pre-constructed image text recognition model, and optimize the loss function of the image text recognition model until the loss function converges; a recognition model verification module, used to verify whether the performance data of the image text recognition model is within the preset performance data range through a preset verification data set; a recognition model optimization module, used to re-train the image text recognition model if it is not within the range, until the performance data passes the verification, and the corresponding target image text recognition model is obtained.

[0012] To solve the above technical problems, the fourth technical solution adopted in the implementation mode of the present application is: to provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image text recognition model training method as described above, or the image text recognition method as described above.

[0013] In order to solve the above technical problems, the fifth technical solution adopted in the implementation mode of the present application is: providing a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by an electronic device, the electronic device executes the image text recognition model training method as described above, or the image text recognition method as described above.

[0014] Different from the related art, the present application uses image processing tools to perform light enhancement, background enhancement and focus enhancement on text image training data, thereby enhancing the diversity of the training data set, thereby improving the robustness of the trained image text recognition model and the accuracy of text recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.

[0016] Figure 1 It is a schematic diagram of the operating environment of the image text recognition model training method provided in an embodiment of the present application.

[0017] Figure 2 It is a schematic diagram of the execution flow of the image text recognition model training method provided in an embodiment of the present application.

[0018] Figure 3 It is a schematic diagram of the execution flow of light enhancement processing in the image text recognition model training method provided in an embodiment of the present application.

[0019] Figure 4 It is a schematic diagram of the execution flow of background enhancement processing in the image text recognition model training method provided in an embodiment of the present application.

[0020] Figure 5 It is a schematic diagram of the execution flow of focal length enhancement processing in the image text recognition model training method provided in an embodiment of the present application.

[0021] Figure 6 It is a schematic diagram of the system structure of the image text recognition model training device provided in an embodiment of the present application.

[0022] Figure 7 It is a schematic diagram of the hardware structure of an electronic device for executing an image text recognition model training method or an image text recognition method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.

[0024] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device schematic diagram or the order in the flow chart.

[0025] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.

[0026] To facilitate understanding of this embodiment, firstly, a method for training an image text recognition model disclosed in the embodiment of this application is introduced in detail. Figure 1 , Figure 1 Schematic diagram of the operating environment of the image text recognition model training method provided in the embodiment of the present application, such as Figure 1 As shown, the execution subject of the image text recognition model training method provided in the embodiment of the present application is generally an electronic device with certain computing capabilities, such as a computer device. In some possible implementations, the image text recognition model training method can be implemented by a processor calling a computer-readable instruction stored in a memory. Among them, Figure 1 The computer device in the term can be a server. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. It can be understood that Figure 1 The number of computer devices in the figure is only for reference and can be expanded to any number according to actual needs.

[0027] Please continue reading Figure 2 , Figure 2 is a schematic diagram of the execution flow of the image text recognition model training method provided in the embodiment of the present application, such as Figure 2 As shown, the following steps are included:

[0028] S1. Acquire text image data, and filter the text image data according to at least one preset light data threshold range to obtain a text image data set.

[0029] As a preferred embodiment, before executing step S1, text images containing various normal light conditions can be collected as the original data set, wherein the judgment condition of normal light can be marked or identified by the naked eye, or screened from the dimensions of various image parameters such as the image clarity of the image through a preset image screening model, so that a text image that is not significantly disturbed by light during the shooting process, with uniform light and not too dark or too bright can be obtained. It should be noted that the collected text images should cover different fonts, different sizes, different text styles, etc., as well as accurate text labels. In order to ensure the diversity and representativeness of the data set, text images can also be collected from different sources, different scenes, and different devices.

[0030] S2. Importing the text image in the text image dataset into a preset image processing tool according to a preset position and a preset angle.

[0031] Among them, the text image is imported into the preset position in the image processing tool and adjusted to the preset angle in order to keep consistent with the rendering of the new text image by the subsequent image processing tool. The newly expanded enhanced text image can be used as training data for training the image text recognition model with higher data efficiency because the image parameters have been partially aligned in the previous stage.

[0032] S3. Use image processing tools to perform light enhancement processing, background enhancement processing and focus enhancement processing on the text image in sequence to obtain a processed training sample data set.

[0033] As a preferred implementation, please refer to Figure 3 , Figure 3 is a schematic diagram of the execution flow of light enhancement processing in the image text recognition model training method provided in the embodiment of the present application, such as Figure 3 As shown, it includes steps S311 to S313.

[0034] S311, setting a light source in an image processing tool, and adjusting parameters of the light source to within a preset light source parameter range.

[0035] Among them, different lighting conditions can be simulated by adjusting the properties of the light source and scene settings through the physical simulation and rendering technology of the image processing tool. For example, different types of light sources such as point light sources, parallel light sources or ambient light sources can be used. By adjusting parameters such as the position, intensity, color and angle of the light source, different lighting conditions can be simulated, and more text image sample data can be obtained, enriching the diversity of the training data set.

[0036] S312: setting the light intensity parameter and the light color parameter of the ambient light in the image processing tool to correspond to the preset ambient light intensity parameter range and the ambient light color parameter range.

[0037] For example, you can adjust the intensity of the ambient light to simulate a bright or dim environment, and by setting the color of the ambient light, you can simulate the color patterns of different light sources, such as blue skylight or yellow light.

[0038] S313, rendering the text image at least once according to the set light source, light intensity parameters and light color parameters, wherein the parameters of the light source, and / or ambient light, and / or the position of the text image, and / or the angle of the text image are adjusted according to preset rules each time the rendering is performed.

[0039] Among them, in order to generate diverse lighting-enhanced images, rendering can be performed multiple times. During each rendering, the parameters of the above-mentioned light source and environment can be adjusted, or the position and angle of the text image can be changed to obtain different lighting effects. Then, more lighting changes can be obtained by increasing the number of renderings, thereby further enriching the diversity of the training data.

[0040] As a preferred implementation, please refer to Figure 4 , Figure 4 is a schematic diagram of the execution flow of background enhancement processing in the image text recognition model training method provided in the embodiment of the present application, such as Figure 4 As shown, it includes steps S321 to S323.

[0041] S321. Import at least one preset background image element into an image processing tool.

[0042] For example, in the actual text image recognition process, there will be images with identifiable text with background elements such as tables, chairs, billboards, and buildings. Therefore, in the preparation stage for diversifying the training data, the above-mentioned image processing tools (for example, Blender) can be used to import various pre-prepared background elements such as tables and chairs into the above-mentioned image processing tools.

[0043] As another preferred embodiment, the texture of the background image element and the shape of the background image element can also be set. For example, after a table is imported into the above-mentioned image processing tool as a background element, different textures of the table are also set, such as mahogany texture, marble texture, glass texture, etc.

[0044] S322: Adjust the relative positions of the text image and the background image elements so that the text in the text image is not blocked by the background image elements.

[0045] In addition to ensuring that the text in the text image is not blocked by background elements, the text in the text image may also be moved to a suitable position, for example, the text in the text image may be moved to within the desktop area of ​​a table.

[0046] S323, setting rendering parameters of the image processing tool, and rendering the text image and the imported background image elements through the rendering engine of the image processing tool.

[0047] As another preferred implementation, during the text image data enhancement process, the change in shooting with different cameras can be simulated by adjusting the focal length. Figure 5 , Figure 5 is a schematic diagram of the execution flow of focal length enhancement processing in the image text recognition model training method provided in the embodiment of the present application, such as Figure 5 As shown, it includes steps S331 to S334.

[0048] S331. Obtain a preset focal length range.

[0049] The focal length range may cover different shooting scenarios and camera settings. For example, a minimum focal length and a maximum focal length may be defined, or discrete focal length values ​​may be specified.

[0050] S332, traverse the text image and randomly obtain a target focal length value from the focal length range.

[0051] Among them, for each image, a focal length value is randomly obtained from the focal length range, which can simulate the focal length changes when shooting with different cameras, thereby enriching the diversity of focal length changes in the text image sample data.

[0052] S333: In the image processing tool, adjust a second camera parameter corresponding to the text image according to the target focal length value.

[0053] For example, adjusting the second camera parameter may be adjusting the aperture, white balance, exposure compensation, and other parameters of the camera, so that the adjusted image is correctly focused.

[0054] S334, rendering the text image in sequence according to the adjusted camera parameters.

[0055] Among them, after adjusting the camera parameters, batch rendering can be used to quickly generate a large number of enhanced images with different focal lengths, which further improves the speed of enhancing text image data and improves the training efficiency of the above-mentioned image text recognition model.

[0056] S4. Use the training sample data set to train the pre-built image text recognition model, and optimize the loss function of the image text recognition model until the loss function converges.

[0057] As an optional implementation, the above-mentioned pre-built image text recognition model includes a convolutional neural network and a recurrent neural network. The convolutional neural network uses multiple layers of convolutional layers and pooling layers to extract image features of text images in the above-mentioned training sample data set, and the recurrent neural network maps the image feature sequence to the corresponding text character sequence, for example, using a long short-term memory network (Long Short-Term Memory, LSTM) or a gated recurrent unit (Gated Recurrent Unit, GRU) to process sequence data.

[0058] S5. Verify whether the performance data of the image text recognition model is within a preset performance data range through a preset verification data set.

[0059] The validation data set is mainly used to verify the recognition performance and generalization ability of the trained image text recognition model on unseen text images. For example, performance indicator data may include but are not limited to: accuracy, mean square error, logarithmic loss, etc.

[0060] S6. If it is not within the range, the image text recognition model is retrained until the performance data passes the verification and the corresponding target image text recognition model is obtained.

[0061] Based on the above-mentioned image text recognition model training method, another embodiment of the present application provides an image text recognition method, including: first, constructing an initial image text recognition model, training the initial image text recognition model through the above-mentioned image text recognition model training method, and obtaining a target image text recognition model. Then, receiving a picture to be recognized, sending the picture to be recognized to the target image text recognition model, and obtaining a corresponding image text recognition result. Because the above-mentioned image text recognition model training method is used for training, the above-mentioned target image text recognition model can have stronger robustness, recognize image texts in more scenarios, and have a higher recognition accuracy.

[0062] The image text recognition model training method provided in the embodiment of the present application uses image processing tools to perform light enhancement, background enhancement, and focus enhancement on text image training data, thereby enhancing the diversity of the training data set, thereby improving the robustness of the trained image text recognition model and the accuracy of text recognition.

[0063] Please continue reading Figure 6 , Figure 6 is a schematic diagram of the system structure of the image text recognition model training device provided in the embodiment of the present application, such as Figure 6As shown, the device 60 includes: an image data acquisition module 61, an image data import module 62, an image data processing module 63, a recognition model training module 64, a recognition model verification module 65 and a recognition model optimization module 66.

[0064] The image data acquisition module 61 is used to acquire text image data, and filter the text image data according to at least one preset light data threshold range to obtain a text image data set;

[0065] The image data import module 62 is used to import the text image in the text image data set into a preset image processing tool according to a preset position and a preset angle;

[0066] The image data processing module 63 is used to perform light enhancement processing, background enhancement processing and focus enhancement processing on the text image in sequence through the image processing tool to obtain a processed training sample data set;

[0067] The recognition model training module 64 is used to train the pre-built image text recognition model using the training sample data set, and optimize the loss function of the image text recognition model until the loss function converges;

[0068] The recognition model verification module 65 is used to verify whether the performance data of the image text recognition model is within the preset performance data range through a preset verification data set;

[0069] The recognition model optimization module 66 is used to retrain the image text recognition model if it is not within the range until the performance data passes the verification and the corresponding target image text recognition model is obtained.

[0070] As an optional embodiment, the image data processing module 63 also includes a light enhancement processing unit, which is used to set a light source in the image processing tool and adjust the parameters of the light source to within a preset light source parameter range; set the light intensity parameters and light color parameters of the ambient light in the image processing tool to correspond to the preset ambient light intensity parameter range and ambient light color parameter range; render the text image at least once according to the set light source, the light intensity parameters and the light color parameters, wherein the parameters of the light source, and / or the ambient light, and / or the position of the text image, and / or the angle of the text image are adjusted according to preset rules each time the rendering is performed.

[0071] As an optional embodiment, the image data processing module 63 also includes a background enhancement processing unit, which is used to import at least one preset background image element into the image processing tool; adjust the relative position of the text image and the background image element so that the text in the text image is not obscured by the background image element; set the rendering parameters of the image processing tool, and render the text image and the imported background image element through the rendering engine of the image processing tool.

[0072] As an optional implementation, the image data processing module 63 also includes a focal length enhancement processing unit, which is used to obtain a preset focal length range; traverse the text image and randomly obtain a target focal length value from the focal length range; adjust the second camera parameter corresponding to the text image according to the target focal length value in the image processing tool; and render the text image according to the adjusted camera parameters in turn.

[0073] As an optional implementation manner, the background enhancement processing unit is further used to set the texture of the background image element and the shape of the background image element.

[0074] As an optional implementation, the pre-built image text recognition model in the recognition model training module 64 includes a convolutional neural network and a recurrent neural network; the convolutional neural network uses multiple layers of convolutional layers and pooling layers to extract image features of text images in the training sample data set; and the recurrent neural network maps the image feature sequence to a corresponding text character sequence.

[0075] It should be noted that the above-mentioned image text recognition model training device can execute the image text recognition model training method provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the image text recognition model training device, please refer to the image text recognition model training method provided in the embodiment of the present application.

[0076] Please continue reading Figure 7 , Figure 7 is a hardware structure diagram of an electronic device 700 for executing an image text recognition model training method or an image text recognition method provided in an embodiment of the present application, such as Figure 7 As shown, the electronic device 700 includes:

[0077] One or more processors 710 and memory 720, Figure 7 A processor 710 is taken as an example.

[0078] The processor 710 and the memory 720 may be connected via a bus or other means. Figure 7The example of connecting through bus is taken in the following.

[0079] The memory 720, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the image text recognition model training method or the image text recognition method in the embodiment of the present application. The processor 710 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 720, that is, the image text recognition model training method or the image text recognition method in the above method embodiment is implemented.

[0080] The memory 720 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the image text recognition model training method device, etc. In addition, the memory 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 720 may optionally include a memory remotely arranged relative to the processor 710, and these remote memories may be connected to the image text recognition model training method device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0081] The one or more modules are stored in the memory 720, and when executed by the one or more processors 710, perform the image text recognition model training method or image text recognition method in any of the above method embodiments, for example, perform the above described Figure 2 Steps S1 to S6 of the method, Figure 3 Steps S311 to S313 of the method, Figure 4 Steps S321 to S323 of the method, Figure 5 Steps S331 to S334 of the method are implemented Figure 6 The functions of modules 61-66 in.

[0082] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.

[0083] The embodiment of the present application provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, such as Figure 7A processor 710 in the embodiment may enable the one or more processors to execute the image text recognition model training method or the image text recognition method in any of the above method embodiments, for example, to execute the above described Figure 2 Steps S1 to S6 of the method, Figure 3 Steps S311 to S313 of the method, Figure 4 Steps S321 to S323 of the method, Figure 5 Steps S331 to S334 of the method are implemented Figure 6 The functions of modules 61-66 in.

[0084] The present application provides a computer program product, wherein the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by the electronic device, the electronic device is enabled to execute the image text recognition model training method or the image text recognition method in any of the above method embodiments, for example, to execute the above described Figure 2 Steps S1 to S6 of the method, Figure 3 Steps S311 to S313 of the method, Figure 4 Steps S321 to S323 of the method, Figure 5 Steps S331 to S334 of the method are implemented Figure 6 The functions of modules 61-66 in.

[0085] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units 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.

[0086] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for training an image text recognition model, characterized in that: include: Acquire text image data, and filter the text image data according to at least one preset light data threshold range to obtain a text image data set; Importing the text image in the text image data set into a preset image processing tool according to a preset position and a preset angle; By using the image processing tool, the text image is sequentially subjected to light enhancement processing, background enhancement processing and focus enhancement processing to obtain a processed training sample data set; Using the training sample data set to train a pre-built image text recognition model, and optimizing the loss function of the image text recognition model until the loss function converges; Verifying whether the performance data of the image text recognition model is within a preset performance data range through a preset verification data set; If it is not within the range, the image text recognition model is retrained until the performance data passes the verification and the corresponding target image text recognition model is obtained.

2. The image text recognition model training method according to claim 1, characterized in that: The step of the image processing tool performing the light enhancement processing on the text image comprises: Setting a light source in the image processing tool and adjusting the parameters of the light source to within a preset light source parameter range; Setting the light intensity parameter and the light color parameter of the ambient light in the image processing tool to correspond to a preset ambient light intensity parameter range and an ambient light color parameter range; The text image is rendered at least once according to the set light source, the light intensity parameters and the light color parameters, wherein the parameters of the light source, and / or the ambient light, and / or the position of the text image, and / or the angle of the text image are adjusted according to preset rules each time the rendering is performed.

3. The image text recognition model training method according to claim 1, characterized in that: The step of the image processing tool performing the background enhancement processing on the text image comprises: Importing at least one preset background image element into the image processing tool; Adjusting the relative positions of the text image and the background image element so that the text in the text image is not blocked by the background image element; The rendering parameters of the image processing tool are set, and the text image and the imported background image elements are rendered by the rendering engine of the image processing tool.

4. The image text recognition model training method according to claim 1, characterized in that: The step of the image processing tool performing the focus enhancement processing on the text image comprises: Get the preset focal length range; Traversing the text image, and randomly obtaining a target focal length value from the focal length range; In the image processing tool, adjusting a second camera parameter corresponding to the text image according to the target focal length value; The text images are rendered in sequence according to the adjusted camera parameters.

5. The image text recognition model training method according to claim 3 is characterized in that: After the step of importing at least one preset background image element, the method further includes: Set the texture of the background image element and the shape of the background image element.

6. The image text recognition model training method according to claim 1, characterized in that: The pre-built image text recognition model includes a convolutional neural network and a recurrent neural network; The convolutional neural network uses multiple convolutional layers and pooling layers to extract image features of text images in the training sample data set; The recurrent neural network maps the image feature sequence to a corresponding text character sequence.

7. A method for image text recognition, characterized in that: include: Constructing an initial image text recognition model, and training the initial image text recognition model by the image text recognition model training method according to any one of claims 1 to 6 to obtain a target image text recognition model; Receive the image to be recognized, send the image to be recognized to the target image text recognition model, and obtain the corresponding image text recognition result.

8. An image text recognition model training device, characterized in that: include: An image data acquisition module, used to acquire text image data, and filter the text image data according to at least one preset light data threshold range to obtain a text image data set; An image data import module, used to import the text image in the text image data set into a preset image processing tool according to a preset position and a preset angle; An image data processing module, used to perform light enhancement processing, background enhancement processing and focus enhancement processing on the text image in sequence through the image processing tool to obtain a processed training sample data set; A recognition model training module, used to train a pre-built image text recognition model using the training sample data set, and optimize the loss function of the image text recognition model until the loss function converges; A recognition model verification module, used to verify whether the performance data of the image text recognition model is within a preset performance data range through a preset verification data set; The recognition model optimization module is used to retrain the image text recognition model if it is not within the range until the performance data passes the verification and the corresponding target image text recognition model is obtained.

9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image text recognition model training method described in any one of claims 1-6, or the image text recognition method described in claim 7.

10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by an electronic device, the electronic device executes the image text recognition model training method described in any one of claims 1 to 7, or the image text recognition method described in claim 7.