A character recognition method, apparatus, electronic device, and storage medium
By optimizing the convolutional modules and downsampling factor of the ResNet residual network and adjusting the number of channels, the problem of low accuracy in small-sized text recognition in industrial scenarios was solved, achieving fast and high-precision text recognition.
Patent Information
- Application Number
- CN202210724298.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2042-06-23
AI Technical Summary
Existing OCR recognition algorithms have low accuracy in recognizing small text in industrial scenarios. They are limited by complex environmental factors such as small text size, many font types, unclear printing, and dim lighting, resulting in a high recognition error rate.
By acquiring the pixel values and the proportion of useful information in the image to be recognized, the convolutional modules and downsampling factor of the ResNet residual network are optimized, the number of channels in the convolutional modules is adjusted, and the target text recognition model is optimized to adapt to small-sized text recognition.
It achieves fast and high-precision recognition of small-sized text, meeting the recognition needs of industrial scenarios and reducing the consumption of computing resources.
Smart Images

Figure CN115171131B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition technology, and in particular to a text recognition method, apparatus, electronic device and storage medium. Background Technology
[0002] Currently, Optical Character Recognition (OCR) consists of two parts: a detection algorithm and a recognition algorithm. The detection algorithm monitors the presence and location of text, while the recognition algorithm identifies the detected text. Common recognition algorithms (such as the frequently used CRNN) have relatively simple text recognition processes, and in scenarios involving documents or invoices, they exhibit relatively stable performance. However, in industrial settings, recognition algorithms are limited by their capabilities. Their feature extraction ability is severely restricted in complex environments. For example, text printed on a 2mm-sized component may present challenges such as extremely small font sizes, diverse font types, unclear printing, inverted text orientation, and dim lighting, leading to a very high error rate for the recognition algorithm. Summary of the Invention
[0003] This application provides a character recognition method, device, electronic device, and storage medium that can ensure reasonable consumption of computing resources and meet the requirements for fast and high-precision recognition of small-sized characters.
[0004] Firstly, this application provides a character recognition method, which includes:
[0005] Acquire the image to be identified, and determine the first pixel value of the image to be identified and the proportion of useful information in the image to be identified;
[0006] The overall downsampling factor and the number of channels in the convolution module are determined based on the first pixel value and the percentage.
[0007] The original character recognition model is optimized based on the overall downsampling factor and the number of channels in the convolution module to obtain the target character recognition model;
[0008] The image to be recognized is input into the target character recognition model to identify the target character in the image, wherein the size of the target character does not exceed a preset size.
[0009] Secondly, this application provides a character recognition device, which includes:
[0010] An information determination module is used to acquire an image to be identified and determine the first pixel value of the image to be identified and the proportion of useful information in the image to be identified;
[0011] The parameter determination module is used to determine the overall downsampling factor and the number of channels of the convolution module based on the first pixel value and the proportion.
[0012] The model optimization module is used to optimize the original character recognition model based on the overall downsampling factor and the number of channels of the convolution module to obtain the target character recognition model.
[0013] The text recognition module is used to input the image to be recognized into the target text recognition model, so as to use the target text recognition model to recognize the target text in the image to be recognized, wherein the size of the target text does not exceed a preset size.
[0014] Thirdly, this application provides an electronic device comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, which is then executed by the at least one processor to enable the at least one processor to perform the character recognition method described in any embodiment of this application.
[0018] Fourthly, this application provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the character recognition method described in any embodiment of this application.
[0019] This application provides a text recognition method, apparatus, electronic device, and storage medium. The method includes: acquiring an image to be recognized and determining a first pixel value and the proportion of useful information in the image; determining an overall downsampling factor and the number of channels in a convolutional module based on the first pixel value and the proportion; optimizing an original text recognition model based on the overall downsampling factor and the number of channels in the convolutional module to obtain a target text recognition model; inputting the image to be recognized into the target text recognition model to recognize the target text in the image, wherein the size of the target text does not exceed a preset size. This application optimizes the configuration of the ResNet residual network to obtain the original text recognition model, ensuring reasonable consumption of computing resources; by determining the optimization parameters of the original text recognition model through the first pixel value and the proportion of useful information in the image, the optimized target text recognition model can improve text recognition accuracy and meet the requirements of fast and high-precision recognition of small-sized text.
[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a first flowchart illustrating a character recognition method provided in an embodiment of this application;
[0023] Figure 2 This is a schematic diagram of the second process of a character recognition method provided in an embodiment of this application;
[0024] Figure 3 This is a schematic diagram of the structure of a character recognition device provided in an embodiment of this application;
[0025] Figure 4 This is a block diagram of an electronic device used to implement a text recognition method according to an embodiment of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0027] It should be noted that the terms "first," "second," "target," and "original," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprising," "having," and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] Before introducing the embodiments of this application, it is necessary to briefly introduce the application scenario of the text recognition method of this application. The text recognition method of this application is for recognizing small-sized text. Existing text recognition technologies can only recognize text with a size of 224mm*224mm or larger, while this application recognizes text with a size of 50mm*50mm or smaller.
[0029] Figure 1 This is a schematic diagram of the first process of a character recognition method provided in an embodiment of this application. This embodiment is applicable to the recognition of small-sized characters. The character recognition method provided in this embodiment can be executed by the character recognition device provided in this embodiment. This device can be implemented by software and / or hardware and integrated into the electronic device executing this method.
[0030] See Figure 1 The method in this embodiment includes, but is not limited to, the following steps:
[0031] S110. Obtain the image to be recognized, and determine the first pixel value of the image to be recognized and the proportion of useful information in the image to be recognized.
[0032] In this embodiment, the image to be recognized can be an existing image containing text. In an industrial setting, the image to be recognized can be an image containing text captured on components using a camera at the industrial production site. After acquiring the image to be recognized, a pixel acquisition method is used to determine the first pixel value of the image. For example, the pixel acquisition method can be the `imread` function in MATLAB, the `cvLoadImage` function in OpenCV, or other functions. The useful information in the image to be recognized refers to the text portion of the image. The process of determining the proportion of useful information can be as follows: first, acquire the size information of the image to be recognized, denoted as the first size; then, acquire the size information of the region where the text portion is located, denoted as the second size; finally, calculate the ratio between the first size and the second size to obtain the proportion of useful information.
[0033] In one possible embodiment, the first pixel value can be a preset fixed pixel value, such as 128px*128px; if the pixel value of the obtained image to be recognized is greater than the first pixel value, then pixel reduction processing is performed to reduce it to the first pixel value.
[0034] S120. Determine the overall downsampling factor and the number of channels in the convolution module based on the first pixel value and its proportion.
[0035] In this embodiment, because the target text in the image to be recognized is too small, in order to ensure feature extraction and clear and accurate recognition of the target text even in images with extremely small pixels, it is necessary to determine the overall downsampling factor and the number of channels in the convolutional module based on the first pixel value of the image to be recognized and the proportion of the target text in the image to be recognized. The overall downsampling factor refers to the sum of downsampling factors throughout the entire process of text recognition of the image to be recognized. The entire process of text recognition of the image to be recognized may include multiple downsampling layers, and the sum of the downsampling factors of the multiple downsampling layers is the overall downsampling factor.
[0036] Furthermore, the original text recognition model includes multiple convolutional modules. The number of channels of each convolutional module is determined based on the first pixel value and its proportion. This includes: determining the number of channels of the first convolutional module based on the first pixel value and its proportion; and obtaining the number of channels of the remaining convolutional modules based on the number of channels of the first convolutional module and a preset multiplier. The remaining convolutional modules are those other than the first convolutional module. The preset multiplier can be 2, and this application does not limit it.
[0037] S130. Optimize the original character recognition model based on the overall downsampling factor and the number of channels in the convolution module to obtain the target character recognition model.
[0038] In this embodiment, the original text recognition model is determined based on a ResNet residual network. Since many current OCR recognition algorithms have low accuracy in recognizing extremely small targets, and real-world scenarios present problems such as text wear and low lighting, this application optimizes the ResNet residual network structure. This optimization can be achieved by modifying the various modules within the ResNet residual network to obtain the original text recognition model used in this application. For example, the upsampling layer and feature fusion layer can be removed from the ResNet residual network. The advantage of this approach is that it ensures reasonable consumption of computational resources, ensuring that the recognition time for each image does not exceed 30ms, thus meeting the requirement for rapid image recognition.
[0039] Furthermore, the original text recognition model includes a first downsampling layer, a max pooling layer, and a second downsampling layer. The second downsampling layer is configured after a designated convolutional module among multiple convolutional modules, while the first downsampling layer and the max pooling layer are configured before the multiple convolutional modules.
[0040] Preferably, the second downsampling layer is configured with the third convolutional module.
[0041] S140. Input the image to be recognized into the target character recognition model so as to use the target character recognition model to recognize the target character in the image to be recognized.
[0042] In this embodiment of the application, after optimizing the original text recognition model to obtain the target text recognition model through the above-mentioned S130 step, the image to be recognized is input into the target text recognition model, the feature data of the image to be recognized is extracted, and then the feature data is classified and recognized to obtain the target text in the image to be recognized. The size of the target text does not exceed the preset size, which can be a 50mm*50mm character.
[0043] The technical solution provided in this embodiment acquires an image to be recognized and determines the first pixel value and the proportion of useful information in the image. Based on the first pixel value and the proportion, it determines the overall downsampling factor and the number of channels in the convolutional module. The original text recognition model is then optimized based on the overall downsampling factor and the number of channels in the convolutional module to obtain a target text recognition model. The image to be recognized is then input into the target text recognition model to identify the target text in the image. This application optimizes the ResNet residual network to obtain the original text recognition model, ensuring reasonable consumption of computational resources. By determining the optimization parameters for the original text recognition model based on the first pixel value and the proportion of useful information in the image, the optimized target text recognition model can improve text recognition accuracy and meet the requirements for fast and high-precision recognition of small-sized text.
[0044] The text recognition method provided by the embodiments of the present invention is further described below. Figure 2 This is a schematic diagram of the second process of a character recognition method provided in an embodiment of this application. This embodiment is an optimization based on the above embodiment, specifically an optimization that provides a detailed explanation of the optimization process of the original character recognition model and the character recognition process in the image to be recognized.
[0045] See Figure 2 The method in this embodiment includes, but is not limited to, the following steps:
[0046] S210. Obtain the image to be recognized, and determine the first pixel value of the image to be recognized and the proportion of useful information in the image to be recognized.
[0047] For details regarding this step, please refer to [link / reference]. Figure 1 Step S110 of the embodiment will not be described again here.
[0048] S220. Determine the overall downsampling factor and the number of channels in the convolution module based on the first pixel value and its proportion.
[0049] In this embodiment, the original text recognition model includes multiple convolutional modules. The number of convolutional modules can be increased. As the number of convolutional modules increases, the width and depth of the neural network also increase, resulting in better performance, but also increasing computational power consumption. Preferably, the number of convolutional modules can be four, and the number of iterations for each convolutional module can be four, thereby increasing the depth of the neural network. The number of channels in the first convolutional module can be 64. When the preset multiplier is 2, the number of channels in the multiple convolutional modules are 64, 128, 256, and 512, respectively. By adjusting the number of channels in the multiple convolutional modules, the network width is gradually increased. In addition, since the ResNet residual network can hardly recognize very small images, the overall downsampling factor of the original text recognition model is adjusted to ensure that features can be extracted.
[0050] Preferably, the overall downsampling factor is determined by the first pixel value and the proportion, for example, it can be 6 times.
[0051] S230. Based on the overall downsampling factor, determine the first sampling parameter of the first downsampling layer, the second sampling parameter of the max pooling layer, and the third sampling parameter of the second downsampling layer.
[0052] In this embodiment, the original character recognition model includes a first downsampling layer, a max pooling layer, and a second downsampling layer. After determining the overall downsampling factor through the above steps, the first sampling parameter of the first downsampling layer, the second sampling parameter of the max pooling layer, and the third sampling parameter of the second downsampling layer are determined respectively. For example, when the overall downsampling factor is 6 times, the first sampling parameter, the second sampling parameter, and the third sampling parameter can all be 2 times.
[0053] S240. Optimize the original character recognition model based on the first sampling parameter, the second sampling parameter, the third sampling parameter, and the number of channels corresponding to multiple convolutional modules to obtain the target character recognition model.
[0054] In the embodiments of this application, the optimized target text recognition model has better versatility and performs well in special scenarios such as blurred images, missing characters, and low light conditions in actual projects.
[0055] The target character recognition model includes an optimized first downsampling layer, a max pooling layer, a second downsampling layer, multiple convolutional modules, an average pooling layer, and a fully connected layer.
[0056] In an alternative embodiment, to address the feature loss of small-sized text after downsampling, in practical use, more modules can be added to the later stages of the network module, such as adding an upsampling layer and a feature concatenation layer, to form a U-shaped structure similar to U-Net, thereby fusing image features at multiple scales.
[0057] S250. The resolution of the image to be identified is adjusted by using a first downsampling layer and / or a max pooling layer to obtain an image with the second pixel value.
[0058] In this embodiment, the image to be identified is used as input and fed into a first downsampling module and / or a max-pooling layer to change the resolution of the image to be identified, resulting in an image with a second pixel value. This setup can increase the feature perception capability of the multi-scale neural network, thereby improving the subsequent image feature parsing capability.
[0059] S260. Input the image of the second pixel value into multiple convolutional modules for feature extraction to obtain the feature map of the image to be recognized.
[0060] In this embodiment, feature maps of the image to be recognized are extracted using a convolutional module composed of a general network structure, which includes Conv convolutional layers, ReLU activation functions, and Max pooling layers. Compared to the ResNet residual network, optimizing its network dimensions and the resolution of the image to be recognized can improve the recognition performance for extremely small images.
[0061] S270. Input the feature map into the average pooling layer and the fully connected layer to identify the target text in the image to be identified.
[0062] In this embodiment, after feature extraction of the image to be recognized is completed, the feature map is input into an average pooling layer to ensure the invariance of its unique recognizable features and reduce the parameters to 512*1*1. After passing through the average pooling layer, the network enters a fully connected layer and finally outputs the target text in the image to be recognized. The convolution kernel of the average pooling layer is 1*1.
[0063] The technical solution provided in this embodiment involves acquiring an image to be recognized and determining the first pixel value and the proportion of useful information in the image; determining the overall downsampling factor and the number of channels in the convolutional modules based on the first pixel value and the proportion; determining the first sampling parameter of the first downsampling layer, the second sampling parameter of the max pooling layer, and the third sampling parameter of the second downsampling layer based on the overall downsampling factor; optimizing the original text recognition model based on the first sampling parameter, the second sampling parameter, the third sampling parameter, and the number of channels corresponding to multiple convolutional modules to obtain a target text recognition model; adjusting the resolution of the image to be recognized using the first downsampling layer and / or the max pooling layer to obtain an image with the second pixel value; inputting the image with the second pixel value into multiple convolutional modules for feature extraction to obtain a feature map of the image to be recognized; and inputting the feature map into an average pooling layer and a fully connected layer to recognize the target text in the image to be recognized. This application optimizes the configuration of the ResNet residual network to obtain the original text recognition model, which can ensure reasonable consumption of computing resources. The optimization parameters of the original text recognition model are determined by the first pixel value of the image to be recognized and the proportion of useful information, so that the optimized target text recognition model can improve the text recognition accuracy and meet the requirements of fast and high-precision recognition of small-sized text.
[0064] Figure 3 This is a schematic diagram of the structure of a character recognition device provided in an embodiment of this application, as shown below. Figure 3 As shown, the device 300 may include:
[0065] The information determination module 310 is used to acquire the image to be identified and determine the first pixel value of the image to be identified and the proportion of useful information in the image to be identified;
[0066] The parameter determination module 320 is used to determine the overall downsampling factor and the number of channels of the convolution module based on the first pixel value and the proportion.
[0067] The model optimization module 330 is used to optimize the original character recognition model based on the overall downsampling factor and the number of channels of the convolution module to obtain the target character recognition model;
[0068] The text recognition module 340 is used to input the image to be recognized into the target text recognition model, so as to use the target text recognition model to recognize the target text in the image to be recognized, wherein the size of the target text does not exceed a preset size.
[0069] Optionally, the original text recognition model includes multiple convolutional modules.
[0070] Furthermore, the parameter determination module 320 mentioned above may include a sampling parameter determination unit and a channel number determination unit;
[0071] The channel number determining unit is used to determine the number of channels of the first convolutional module among the plurality of convolutional modules based on the first pixel value and the proportion; and to obtain the number of channels of the remaining convolutional modules among the plurality of convolutional modules based on the number of channels of the first convolutional module and a preset multiple, wherein the remaining convolutional modules are the convolutional modules other than the first convolutional module among the plurality of convolutional modules.
[0072] Optionally, the original text recognition model includes a first downsampling layer, a max pooling layer, and a second downsampling layer, wherein the second downsampling layer is configured after a designated convolutional module among the plurality of convolutional modules, and the first downsampling layer and the max pooling layer are configured before the plurality of convolutional modules.
[0073] The sampling parameter determination unit is used to determine, after determining the overall downsampling factor based on the first pixel value and the proportion, the first sampling parameter of the first downsampling layer, the second sampling parameter of the max pooling layer, and the third sampling parameter of the second downsampling layer based on the overall downsampling factor.
[0074] Furthermore, the aforementioned text recognition module 340 can also be specifically used for: adjusting the resolution of the image to be recognized using the first downsampling layer and / or the max pooling layer to obtain an image with a second pixel value; inputting the image with the second pixel value into the plurality of convolutional modules for feature extraction to obtain a feature map of the image to be recognized; inputting the feature map into an average pooling layer and a fully connected layer to recognize the target text in the image to be recognized, wherein the convolutional kernel of the average pooling layer is 1*1.
[0075] Optionally, the number of the plurality of convolutional modules is 4, the number of loops of each convolutional module is 4, and the number of channels of the plurality of convolutional modules is 64, 128, 256, and 512 respectively.
[0076] Optionally, the original character recognition model is determined based on a ResNet residual network.
[0077] The text recognition device provided in this embodiment can be applied to the text recognition method provided in any of the above embodiments, and has the corresponding functions and beneficial effects.
[0078] Figure 4This is a block diagram of an electronic device used to implement a display method according to an embodiment of this application. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0079] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0080] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0081] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as character recognition methods.
[0082] In some embodiments, the character recognition method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the character recognition method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the character recognition method by any other suitable means (e.g., by means of firmware).
[0083] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0084] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0085] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0086] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0087] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0088] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0089] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0090] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A character recognition method characterized by comprising: The method comprises: acquiring a to-be-recognized image, and determining a first pixel value of the to-be-recognized image and a proportion of useful information in the to-be-recognized image; wherein the useful information in the to-be-recognized image refers to a text part in the to-be-recognized image; determining a total down-sampling multiple and a channel number of a convolution module according to the first pixel value and the proportion; optimizing an original text recognition model according to the total down-sampling multiple and the channel number of the convolution module to obtain a target text recognition model; wherein the original text recognition model comprises a first down-sampling layer, a max-pooling layer and a second down-sampling layer, and the original text recognition model is obtained by removing an up-sampling layer and a feature fusion layer from a ResNet residual network; inputting the to-be-recognized image into the target text recognition model to recognize target text in the to-be-recognized image by using the target text recognition model, wherein a size of the target text does not exceed a preset size, and the preset size is 50mm*50mm of text. The original text recognition model comprises a plurality of convolution modules, and the channel number of the convolution module is determined according to the first pixel value and the proportion, comprising: determining a channel number of a first convolution module in the plurality of convolution modules according to the first pixel value and the proportion; obtaining channel numbers of remaining convolution modules in the plurality of convolution modules according to the channel number of the first convolution module and a preset multiple, wherein the remaining convolution modules are convolution modules other than the first convolution module in the plurality of convolution modules. After the total down-sampling multiple is determined according to the first pixel value and the proportion, the method further comprises: determining a first sampling parameter of the first down-sampling layer, a second sampling parameter of the max-pooling layer and a third sampling parameter of the second down-sampling layer based on the total down-sampling multiple.
2. The character recognition method according to claim 1, wherein The second down-sampling layer is arranged after a designated convolution module in the plurality of convolution modules, and the first down-sampling layer and the max-pooling layer are arranged before the plurality of convolution modules.
3. The character recognition method of claim 2, wherein, The inputting of the to-be-recognized image into the target text recognition model to recognize target text in the to-be-recognized image by using the target text recognition model comprises: adjusting a resolution of the to-be-recognized image by using the first down-sampling layer and / or the max-pooling layer to obtain an image with a second pixel value; inputting the image with the second pixel value into the plurality of convolution modules for feature extraction to obtain a feature map of the to-be-recognized image; inputting the feature map into an average pooling layer and a fully connected layer to recognize target text in the to-be-recognized image, wherein a convolution kernel of the average pooling layer is 1*1.
4. The character recognition method of claim 1, wherein, The number of the plurality of convolution modules is four, the number of cycles of each convolution module is four, and the channel numbers of the plurality of convolution modules are 64, 128, 256 and 512 in sequence.
5. A character recognition apparatus characterized by comprising: The device comprises: an information determination module configured to acquire a to-be-recognized image, and determine a first pixel value of the to-be-recognized image and a proportion of useful information in the to-be-recognized image; wherein the useful information in the to-be-recognized image refers to a text part in the to-be-recognized image; The parameter determination module is configured to determine a total down-sampling multiple and a channel number of a convolution module according to the first pixel value and the proportion; The model optimization module is configured to optimize an original character recognition model according to the total down-sampling multiple and the channel number of the convolution module to obtain a target character recognition model; wherein the original character recognition model comprises a first down-sampling layer, a max-pooling layer and a second down-sampling layer, and the original character recognition model is obtained by removing an up-sampling layer and a feature fusion layer from a ResNet residual network; The character recognition module is configured to input the image to be recognized into the target character recognition model to recognize target characters in the image to be recognized by using the target character recognition model, wherein a size of the target characters does not exceed a preset size, and the preset size is 50mm*50mm. The original character recognition model comprises a plurality of convolution modules, and the parameter determination module comprises a sampling parameter determination unit and a channel number determination unit. The channel number determination unit is configured to determine a channel number of a first convolution module in the plurality of convolution modules according to the first pixel value and the proportion, and determine channel numbers of remaining convolution modules in the plurality of convolution modules according to the channel number of the first convolution module and a preset multiple, wherein the remaining convolution modules are convolution modules other than the first convolution module in the plurality of convolution modules. The sampling parameter determination unit is configured to determine a first sampling parameter of the first down-sampling layer, a second sampling parameter of the max-pooling layer and a third sampling parameter of the second down-sampling layer based on the total down-sampling multiple after determining the total down-sampling multiple according to the first pixel value and the proportion.
6. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the character recognition method in any one of claims 1 to 4.
7. A computer readable storage medium characterized by The computer readable storage medium stores computer instructions for enabling the processor to execute the character recognition method in any one of claims 1 to 4 when executed.
Citation Information
Patent Citations
Scene text recognition method based on man-machine cooperation
CN110796143A
Image feature detection method, system, device and medium
CN111582353A
Marine organism detection method and system and equipment
CN113963251A