Text recognition method, device, computer readable medium and electronic device

By identifying the background image and combining the deep learning model for text recognition, the problem of low recognition accuracy caused by unclear prospects and background differences in the prior art is solved, and higher text recognition accuracy and lower the noise effect.

CN111753836BActive Publication Date: 2025-01-03BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910797941.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-27
Publication Date
2025-01-03
Estimated Expiration
2039-08-27

AI Technical Summary

Technical Problem

When processing images, existing text recognition methods cannot effectively distinguish the foreground and background, resulting in low recognition accuracy, or introduce noise when removing background information, reducing recognition accuracy.

Method used

By identifying the background image of the image to be identified, mask features are obtained, and combining the mask features and image features, character recognition is used using a deep learning model, different weights are set to enhance image features and weaken background features, and convolutional processing is performed to determine the image Characters contained in.

Benefits of technology

It reduces background interference, improves the representation of foreground features, enhances the accuracy of character recognition, reduces the impact of noise, and improves the overall recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111753836B_ABST
    Figure CN111753836B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide a text recognition method, a text recognition device, a computer-readable medium, and an electronic device, which relate to the field of image processing technology. The text recognition method comprises: recognizing the background image of the image to be recognized and obtaining a mask image; recognizing the characters contained in the image to be recognized based on the mask image and the image to be recognized; and outputting the characters contained in the image to be recognized as computer-readable text. The technical solution of the embodiments of the present disclosure recognizes the characters contained in the image to be recognized by combining with the features of the background image, thereby improving the recognition accuracy of the text.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Optical character recognition (OCR) refers to the process in which electronic devices (such as scanners and digital cameras) convert text on paper or other printed materials into image information through optical input methods such as scanning, and then translate the image into computer text using character recognition methods.

[0003] With the continuous development of deep learning technology, the accuracy of text recognition has been greatly improved after the adoption of deep learning technology in the field of text recognition. Existing text recognition methods are mainly divided into two categories. One is to extract the features of the original image for training, so that the trained model can recognize the text contained in the image. This method does not distinguish between the foreground and background of the image. If there are lines and other information in the background that are easily confused with the text, the recognition accuracy will be greatly reduced. The other method preprocesses the original image and leaves only the foreground area of ​​the image, thereby recognizing the text contained in the foreground area. However, this method is not accurate in locating the foreground and background in the original image, and the obtained foreground area carries more noise information, resulting in low recognition accuracy.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the embodiments of the present disclosure is to provide a text recognition method, a text recognition device, a computer-readable medium and an electronic device, thereby overcoming the problem of low accuracy of text recognition at least to a certain extent.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to a first aspect of an embodiment of the present disclosure, a text recognition method is provided, comprising: identifying a background image of an image to be recognized to obtain mask features; identifying characters contained in the image to be recognized based on the mask features and the image to be recognized; and outputting the characters contained in the image to be recognized as computer-readable text.

[0008] In an exemplary embodiment of the present disclosure, the identifying the background image of the image to be identified and obtaining the mask feature includes: determining the probability that a pixel point of the image to be identified belongs to the background image, obtaining a first eigenvalue, and the mask feature includes the first eigenvalue.

[0009] In an exemplary embodiment of the present disclosure, the identifying the background image of the image to be identified and obtaining the mask feature includes: binarizing the image to be identified according to the first feature value, and determining that the binarized image to be identified is the mask feature.

[0010] In an exemplary embodiment of the present disclosure, combining the mask feature with the image to be recognized to identify the characters contained in the image to be recognized includes: determining a first weight of the mask feature, determining a second weight of the image to be recognized, wherein the first weight is less than the second weight; training a deep learning model based on the first weight and the second weight to use the trained deep learning model to recognize the characters contained in the image to be recognized.

[0011] In an exemplary embodiment of the present disclosure, the combining of the mask features with the image to be recognized to recognize the characters contained in the image to be recognized includes: performing a first convolution process on the image to be recognized to obtain a feature map after the convolution process; and performing a second convolution process on the mask features and the feature map based on the first weight and the second weight to determine the characters contained in the image to be recognized.

[0012] In an exemplary embodiment of the present disclosure, determining the probability that a pixel point of the image to be identified belongs to a background image includes: processing the image to be identified by an image segmentation algorithm to determine the probability that each pixel point of the image to be identified belongs to the background image.

[0013] In an exemplary embodiment of the present disclosure, the mask image is consistent in size with the image to be recognized.

[0014] According to a second aspect of an embodiment of the present disclosure, there is provided a text recognition device, comprising:

[0015] An image segmentation unit is used to identify the background image of the image to be identified and obtain mask features; a feature combination unit is used to identify the characters contained in the image to be identified based on the mask features and the image to be identified; a text output unit is used to output the characters contained in the image to be identified as computer-readable text.

[0016] According to a third aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the text recognition method as described in the first aspect of the above embodiment is implemented.

[0017] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the text recognition method as described in the first aspect of the above embodiment.

[0018] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0019] In the technical solutions provided by some embodiments of the present disclosure, on the one hand, by identifying the background image of the image to be identified, the mask features are obtained, which facilitates the determination of the influence of the background image, thereby reducing the interference of the background image, making the feature representation of the foreground part of the image to be identified containing characters stronger and easier to identify. On the other hand, when identifying the characters contained in the image to be identified, the mask features and the image to be identified are combined, so that the background image can serve as a reference, thereby improving the accuracy of recognition.

[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0022] Figure 1 A system architecture diagram for implementing the text recognition method of the embodiment of the present disclosure is schematically shown;

[0023] Figure 2 A flowchart of a text recognition method according to an embodiment of the present disclosure is schematically shown;

[0024] Figure 3 A flowchart of a text recognition method according to another embodiment of the present disclosure is schematically shown;

[0025] Figure 4 A flowchart of a text recognition method according to another embodiment of the present disclosure is schematically shown;

[0026] Figure 5 A block diagram schematically shows a text recognition device according to an embodiment of the present disclosure;

[0027] Figure 6A schematic diagram of the structure of an electronic device suitable for implementing the text recognition method of an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0028] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.

[0029] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.

[0030] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0031] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0032] The inventors have discovered that the method of performing text recognition based on directly extracting image features from the original image treats the foreground and background in the image equally, so that the background plays the same important role as the foreground in the extracted features. In particular, when elements similar to the foreground, such as lines, appear in the background, the recognition accuracy will be greatly reduced. In the method of performing text recognition based on foreground feature extraction, the background information is completely removed, and the background will not participate in feature recognition at all. However, due to inaccurate extraction of the foreground, noise is introduced, resulting in low recognition accuracy.

[0033] Based on this, in an exemplary embodiment of the present disclosure, a system architecture for implementing a text recognition method is first provided. Figure 1As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0034] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send request instructions, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0035] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0036] The server 105 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 101, 102, and 103. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.

[0037] It should be noted that the text recognition method provided in the embodiment of the present disclosure is generally executed by the server 105 , and accordingly, the report generating apparatus is generally disposed in the terminal device 101 .

[0038] Based on the above system architecture 100, an exemplary embodiment of the present disclosure proposes a text recognition method, such as Figure 2 As shown, the method may include the following steps:

[0039] Step S210, identifying the background image in the image to be identified and obtaining mask features;

[0040] Step S220, combining the mask feature with the image to be recognized, and recognizing characters contained in the image to be recognized;

[0041] Step S230: output the characters contained in the image to be recognized as computer-readable text.

[0042] exist Figure 2In the technical solution provided by the illustrated embodiment, on the one hand, by identifying the background image of the image to be identified and obtaining the mask feature, it is possible to easily determine the influence of the background image, thereby reducing the interference of the background image, making the feature representation of the foreground part of the image to be identified containing the characters stronger and easier to identify. On the other hand, when identifying the characters contained in the image to be identified, the mask feature and the image to be identified are combined, so that the background image can serve as a reference, thereby improving the accuracy of recognition.

[0043] The following Figure 2 The specific implementation of each step in the illustrated embodiment is described in detail.

[0044] First, in step S210, a background image in the image to be identified is identified to obtain mask features.

[0045] The image to be identified may include image data obtained by an optical device, such as a scanner, a digital camera, etc. Alternatively, the image to be identified is obtained by processing video data, such as converting video data by a MATLAB tool to obtain multiple frames of images, etc. Of course, the image to be identified may also include data obtained in other ways, such as images designed by an image production tool, etc.

[0046] The image to be recognized may include various objects, such as people, scenery, characters, etc. Among them, characters can be used as objects to be recognized, and the area containing characters can be used as the foreground area, while the area outside the characters can be used as the background area. Recognizing the characters contained in the image can convert the characters into editable text, which is convenient for people to operate. Characters can include letters, numbers, words, and other shapes with specific meanings.

[0047] The background image in the image to be identified can be identified through the machine learning model, thereby obtaining the mask feature. For example, the image to be identified is input into the R-FCN model (Region-based, Fully Convolutional Networks, which is a region-based fully convolutional network that can be used for target detection) to obtain the background image of the image to be identified. Alternatively, edge detection can be performed on the image to be identified to detect the outline of the characters in the image to be identified, so as to locate and separate the characters and obtain the background image of the image to be identified. The separated background image can be a mask feature. Alternatively, the image of the identified foreground part is covered, and the covered image is the mask feature.

[0048] Optionally, the mask feature may be obtained in the following manner: the probability that each pixel of the image to be identified belongs to the background image is determined as a first feature value, and the first feature value is the mask feature.

[0049] The image to be identified is input into the machine learning model, which can identify each pixel in the image to be identified and predict the probability that each pixel belongs to the background image. When training the model, a large number of sample images can be obtained, and the foreground and background parts in the sample images are marked respectively. The marked sample images are used to train the model, so that the trained model can identify the foreground image and background image in the image. When identifying the background image in the image to be identified, the model will analyze each pixel in the image to be identified separately, predict the probability that the pixel belongs to the background image, and then output the prediction result.

[0050] Exemplarily, the image to be identified can be processed by an image segmentation algorithm to determine the probability that each pixel of the image to be identified belongs to the background image. The image segmentation algorithm may include FCN (Fully Convolutional Networks), Mask R-CNN (Mask Region-CNN, which can be used for target detection and mask segmentation), etc., and may also include other methods, such as Mask Text Spotter (Mask Text Detection, which can be used to detect and identify text of any shape), etc.

[0051] The first eigenvalue may refer to the probability that a pixel in the image to be identified belongs to the background image. After determining the probability that each pixel in the image to be identified belongs to the background image, the mask feature can be obtained. In other words, the mask feature contains multiple first eigenvalues, each of which represents the probability that a pixel in the image to be identified is the background image.

[0052] In an exemplary embodiment, the mask feature may include a feature image. Specifically, the pixels of the image to be identified correspond to the first feature value, that is, each pixel corresponds to a first feature value. Then the first feature value can be regarded as the pixel value of the pixel, so that the mask feature is converted into a mask image. The pixels of the mask image correspond to the pixels of the image to be identified, and the pixel value of the pixel of the mask image is the probability that the pixel at the corresponding position in the image to be identified belongs to the background image. The probability can be a number between 0 and 1, such as 0, 1, 0.5, etc., so the pixel value of each pixel of the mask image is a number between 0 and 1, and the pixel value of each pixel of the image to be identified can include values ​​of three dimensions of RGB.

[0053] Optionally, the first eigenvalue may be used to binarize the image to be identified to obtain a binarized mask image, that is, the first eigenvalue is converted to 0 or 255. If the first eigenvalue is greater than or equal to a preset threshold, the first eigenvalue is converted to 255; if the first eigenvalue is less than the preset threshold, the first eigenvalue is converted to 0.

[0054] In summary, the mask feature may include the probability that each pixel in the image to be identified belongs to the background image. Further, the background image in the image to be identified is determined by the probability that each pixel belongs to the background image, and the mask feature may also include the background image. Moreover, the image to be identified may be binarized according to the probability that each pixel belongs to the background image, thereby obtaining a binarized image, and the mask feature may also include the binarized image. For example, the pixel with a probability exceeding 0.5 is set to 255, and the pixel with a probability not exceeding 0.5 is set to 0, thereby obtaining a mask feature of the same size as the image to be identified. Therefore, the size of the mask image may be consistent with the image to be identified. Alternatively, the mask image may only include the probability data of some pixels in the image to be identified. For example, the image to be identified is divided into a foreground image and a background image by the probability that the pixel in the image to be identified belongs to the background image, and the probability of the pixel belonging to the background image is only taken as the first probability value to obtain the mask feature.

[0055] Then, in step S220, the mask features are combined with the image to be recognized to recognize the characters contained in the image to be recognized.

[0056] In this example embodiment, the characters contained in the image to be recognized can be recognized by the machine learning model. The mask features and the image features of the image to be recognized are simultaneously input into the trained machine learning model to obtain the characters contained in the image to be recognized. In the model training process, a sample image can be first obtained, and each sample image is processed as described in the above step S210 to determine the mask features of each sample image, and then the RGB pixel values ​​of the sample image and the feature values ​​contained in the mask features are used as inputs to the model. In other words, the sample image can contain three-channel features, and the mask features can be single-channel features, thereby forming four-channel features, which increases the feature dimension observable by the machine learning model and can improve the recognition accuracy of the machine learning model.

[0057] Different weights can be set for the image features and mask features of the image to be identified, thereby enhancing the image features of the image to be identified and weakening the mask features.

[0058] like Figure 3 As shown, step S220 may specifically include the following steps:

[0059] Step S301, determining a first weight of a mask feature and determining a second weight of an image to be identified, wherein the first weight is smaller than the second weight;

[0060] Step S302: training a deep learning model based on the first weight and the second weight, so as to recognize characters contained in the image to be recognized by using the trained deep learning model.

[0061] In this exemplary embodiment, the deep learning model is trained by a sample image, and the image features and mask features of the sample image are first obtained. When training the deep learning model, the mask features of the sample image are used as the input of the model, and the first input is mapped to the next layer with a first weight, and the image features of the sample image are used as another input and mapped to the next layer with a second weight, so that when the deep learning model extracts image features, it can learn the background features of the sample image on the basis of learning the complete image features of the sample image, so as to better distinguish the characters contained in the image and improve the recognition accuracy.

[0062] The first weight is less than the second weight. In the training process of the deep learning model, the first weight and the second weight can be taken multiple times, and the optimal values ​​of the first weight and the second weight can be determined by the recognition effect of the model on the characters.

[0063] Exemplarily, a convolutional neural network algorithm may be used to train the deep learning model. Figure 4 As shown, step S220 may specifically include the following steps:

[0064] Step S401, performing a first convolution process on the image to be recognized to obtain a feature map after the convolution process;

[0065] Step S402: Based on the first weight and the second weight, perform a second convolution process on the mask feature and the feature map to determine the characters contained in the image to be recognized.

[0066] The mask features and the image features can be convolved after adding corresponding weights to determine the characters contained in the image to be identified. Specifically, the image features of the image to be identified are first convolved, and multiple feature maps of the image features are obtained after the first convolution, and then the mask features and the multiple feature maps are convolved for the second time. In the second convolution, the mask features and the feature maps obtained by the first convolution are multiplied by their weights, i.e., the first weight and the second weight. After the second convolution, a feature representation of the mask features and the feature map is obtained, and the feature representation can be convolved again, and the features of the characters are finally obtained after multiple convolutions. Exemplarily, the image to be identified can be convolved by a machine learning model to obtain the characters contained in the image to be identified. The image to be identified is input into the machine learning model, which can be a convolutional neural network model, so that after the image to be identified is input into the model, the image to be identified can be convolved multiple times, and in one of the convolution layers, multiple feature maps obtained in the previous convolution layer can be convolved together with the mask features in the next convolution layer, so that the original image features of the image to be identified are learned first, and the mask features can enhance or weaken the image features learned first. Since the feature value in the mask feature is the probability that the pixel belongs to the foreground image, it has an enhancing effect on the pixel features with a larger probability, and a weakening effect on the pixel features with a smaller probability, that is, the representation power of the foreground features is enhanced, while the representation power of the background features is weakened. Through the contrast between the foreground and the background, the learning of the model has a focus, and the features of the characters in the foreground image can be quickly observed, thereby recognizing the characters.

[0067] In an exemplary embodiment, the machine learning model may include an input layer, a convolution layer, an activation layer, a pooling layer, and an output layer. The mask features and the image features of the image to be identified are input into the input layer together, and the image features of the image to be identified may be input of three RGB channels, thereby forming a four-channel input with the mask features. When the convolution layer convolves the input features, the image features of the image to be identified are convolved with a first weight, and the mask features are convolved with a second weight. For example, the output of the convolution layer may be y=k1f(x)1+k2f(x)2, wherein k1 is the first weight, f(x)1 is the image feature of the image to be identified, k2 is the second weight, and f(x)2 is the mask feature. After multiple convolution layers, the final convolution output result is obtained. In addition, the input features may also be processed with an activation function, which may include a ReLU function or other custom functions. The pooling layer may compress the features, extract the main features, and reduce the features input to the output layer. The output layer may include a fully connected layer, that is, all the features input to the layer are summed and output. The machine learning model can be used to obtain the characters contained in the image to be identified. The image to be identified can contain multiple characters, that is, a string. Therefore, after identifying the image to be identified and finding the characters contained in it, the RNN (Recurrent neural network) model can also be used to identify the order of the characters and determine the correct string. Alternatively, other algorithms can also be used to identify strings, such as CTC (Connectionist Temporal Classification), which can align sequences of multiple characters.

[0068] In step S230, the characters contained in the image to be recognized are output as computer-readable text.

[0069] After identifying the characters contained in the image to be identified, the characters can be output as editable text, such as a doc file, a txt file, etc., or they can be output as computer-readable text in other forms, such as providing an interface in which the characters contained in the image to be identified are displayed in a text box. Computer-readable text is different from images, and users can edit computer-readable text, such as copying, adding, etc., so that the information contained in the image can be used more flexibly.

[0070] Furthermore, the exemplary embodiments of the present disclosure also provide a text recognition device for implementing the above text recognition method. Figure 5 As shown, the text recognition device 500 may include an image segmentation unit 510, a feature combination unit 520, and a text output unit 530. Specifically:

[0071] The image segmentation unit 510 is used to identify the background image in the image to be identified and obtain the mask feature; the feature combination unit 520 is used to combine the mask feature with the image to be identified and identify the characters contained in the image to be identified; the text output unit 530 is used to output the characters contained in the image to be identified as computer-readable text.

[0072] In an exemplary embodiment of the present disclosure, the image segmentation unit 510 may also be used to: determine the probability that a pixel of the image to be identified belongs to a background image, obtain a first eigenvalue, and the mask feature includes the first eigenvalue.

[0073] In an exemplary embodiment of the present disclosure, the image segmentation unit 510 may also be used to: binarize the image to be identified according to the first feature value, and determine that the binarized image to be identified is a mask feature.

[0074] In an exemplary embodiment of the present disclosure, the feature combination unit 520 may include: a weight determination unit, used to determine a first weight of the mask feature, and to determine a second weight of the image to be identified, wherein the first weight is less than the second weight; and a model training unit, used to train a deep learning model based on the first weight and the second weight, so as to use the trained deep learning model to identify the characters contained in the image to be identified.

[0075] In an exemplary embodiment of the present disclosure, the feature combination unit 520 may also include: a first convolution processing unit, used to perform a first convolution processing on the image to be identified to obtain a feature map after the convolution processing; a second convolution processing unit, used to perform a second convolution processing on the mask feature and the feature map based on the first weight and the second weight to determine the characters contained in the image to be identified.

[0076] In an exemplary embodiment of the present disclosure, the image segmentation unit 510 is further configured to: process the image to be identified by using an image segmentation algorithm to determine the probability that each pixel of the image to be identified belongs to the background image.

[0077] In an exemplary embodiment of the present disclosure, the mask image is consistent in size with the image to be recognized.

[0078] The specific details of each module / unit in the above device have been described in detail in the embodiment of the method part, so they will not be repeated here.

[0079] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0080] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification.

[0081] The program product may be in a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0082] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0083] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0084] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0085] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0086] Exemplary embodiments of the present disclosure also provide an electronic device capable of implementing the above method.

[0087] Reference below Figure 6 The electronic device 600 provided by an embodiment of the present disclosure is described. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0088] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610).

[0089] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 610 can perform the following steps: Figure 2 As shown in: Step S210, identifying the background image in the image to be identified and obtaining mask features; Step S220, combining the mask features with the image to be identified and identifying the characters contained in the image to be identified; Step S230, outputting the characters contained in the image to be identified as computer-readable text.

[0090] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .

[0091] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0092] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0093] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0094] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0095] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0096] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A method for character recognition, characterized in that: include: Identify the background image in the image to be identified and obtain the mask feature; Determine a first weight of the mask feature, and determine a second weight of the image to be identified, wherein the first weight is less than the second weight; Using the four-channel features formed by the RGB three-channel features of the image to be identified and the mask features as input to the machine learning model, performing a first convolution process on the RGB three-channel features of the image to be identified through the machine learning model, and obtaining a feature map after the convolution process; Convolving the mask feature with the first weight through the machine learning model and convolving the feature map with the second weight through the machine learning model to obtain a feature representation; wherein the output of the convolution layer of the machine learning model includes the sum of the result of convolving the mask feature with the first weight and the result of convolving the feature map with the second weight; Performing multiple convolutions on the feature representation through the machine learning model to determine the characters contained in the image to be recognized; The characters contained in the image to be recognized are output as computer-readable text.

2. The method according to claim 1, characterized in that The step of identifying the background image of the image to be identified and obtaining the mask feature comprises: The probability that a pixel of the image to be identified belongs to a background image is determined to obtain a first eigenvalue, and the mask feature includes the first eigenvalue.

3. The method according to claim 2, characterized in that The step of identifying the background image of the image to be identified and obtaining the mask feature comprises: The image to be identified is binarized according to the first feature value, and the binarized image to be identified is determined as a mask feature.

4. The method according to claim 2, characterized in that: The determining the probability that the pixel point of the image to be identified belongs to the background image includes: The image to be identified is processed by an image segmentation algorithm to determine the probability that each pixel of the image to be identified belongs to the background image.

5. A text recognition device, characterized in that: include: An image segmentation unit, used for identifying a background image in an image to be identified and obtaining mask features; A feature combination unit, used to determine a first weight of the mask feature and a second weight of the image to be identified, wherein the first weight is less than the second weight; using a four-channel feature formed by the RGB three-channel feature of the image to be identified and the mask feature as an input of a machine learning model, performing a first convolution process on the RGB three-channel feature of the image to be identified through the machine learning model, and obtaining a feature map after the convolution process; convolving the mask feature with the first weight through the machine learning model and convolving the feature map with the second weight through the machine learning model to obtain a feature representation; wherein the output of the convolution layer of the machine learning model includes the sum of the result of convolving the mask feature with the first weight and the result of convolving the feature map with the second weight; performing multiple convolutions on the feature representation through the machine learning model to determine the characters contained in the image to be identified; The text output unit is used to output the characters contained in the image to be recognized as computer-readable text.

6. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the text recognition method according to any one of claims 1 to 4 is implemented.

7. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the text recognition method as described in any one of claims 1 to 4.