A character recognition processing method and system for a robot

By combining a lightweight CNN and CRNN model with depthwise separable convolutional layers, pseudo-random point selection for background color judgment, grayscale three-segment linear transformation, and clustered contour filtering, redundant images are eliminated. Logical verification is performed using a hierarchical dictionary, which solves the interference problem in character recognition in vertical fields and achieves high-accuracy character recognition.

CN121686477BActive Publication Date: 2026-06-30SAIZHI (HEFEI) INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SAIZHI (HEFEI) INFORMATION TECHNOLOGY CO LTD
Filing Date
2025-11-27
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing OCR technology is easily affected by other content in images when recognizing characters in vertical fields, resulting in a high recognition error rate. Furthermore, the lack of semantic-level verification leads to insufficient accuracy of the recognition results.

Method used

We employ lightweight CNN and CRNN models with separable depthwise convolutions for feature extraction and sequence modeling. By combining pseudo-random point selection with background color judgment, grayscale three-segment linear transformation, and cluster contour filtering, we eliminate redundant images and perform logical verification through a hierarchical dictionary to improve recognition accuracy.

Benefits of technology

It significantly reduces the character recognition error rate, improves recognition accuracy and anti-interference ability, and adapts to the character recognition needs of vertical industries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121686477B_ABST
    Figure CN121686477B_ABST
Patent Text Reader

Abstract

This application provides a character recognition processing method and system for robots, relating to the field of character recognition. It solves the technical problems of existing technologies that use single characters as recognition objects and are easily interfered with by other non-character elements in the image, resulting in a still relatively high character recognition error rate. The method includes: acquiring a target image of the document to be recognized; removing redundant images from the target image and partitioning it to obtain a Region of Interest (ROI) map; inputting the ROI map into a character recognition model to obtain the recognized characters; and performing logical verification on the recognized characters based on a hierarchical dictionary to obtain the recognized text; wherein the hierarchical dictionary is a preset content dictionary. This application's segmentation of the target image into ROI maps reduces the recognition of characters by redundant images, and the character recognition model captures contextual relationships, further reducing the likelihood of character misrecognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of character recognition, and in particular to a character recognition processing method and system for robots. Background Technology

[0002] Character recognition (OCR) is a technology that converts text in paper documents, photographs, or other optical images into editable, storeable, and processable text. OCR technology can identify characters from images (which can be scanned documents, photographs, or any image containing text), extract the text, and convert it into an editable text format. Existing OCR recognition solutions typically include image preprocessing, character feature extraction, model recognition, and result output. Their design goal is to adapt to the general recognition needs of various document types (such as books, contracts, webpage screenshots, etc.) and possess a certain degree of broad adaptability.

[0003] However, the unique features of characters in vertical domain recognition scenarios are significantly different from those of general documents. This is mainly because character information in vertical domains has strong standardization. Although the current method of modularizing images is used, the photovoltaic character recognition method still treats individual characters as recognition objects. Therefore, when recognizing characters, it is very easy to be interfered with by other content in the image. For example, if there are lines that pass through the font, or if the contrast between the background color of the image and the font color is not high enough, it will also cause the edge between the character and the background to be blurred. As a result, the character recognition error rate is still relatively high. Once a recognition error occurs, the character may not be usable in subsequent processing. Summary of the Invention

[0004] This application provides a character recognition processing method and system for robots, which solves the technical problems of existing technologies that use a single character as the recognition object when performing character recognition, and are easily interfered with by other non-characters in the image, resulting in a still high character recognition error rate.

[0005] To achieve the above objectives, this application adopts the following technical solution:

[0006] Firstly, a character recognition processing method for robots is provided, including:

[0007] Obtain the target image of the document to be identified, remove redundant images from the target image and divide it into regions of interest (ROI) to obtain the ROI map;

[0008] The ROI region map is input into the character recognition model to obtain the recognized characters. The character recognition model processes the data by using a depthwise separable convolutional lightweight CNN for feature extraction, a CRNN for sequence modeling, and CTC decoding. The depthwise separable convolutional lightweight CNN includes: an input layer, a standard convolutional layer with 3×3 kernels, three depthwise separable convolutional blocks, a microconvolutional layer, a batch normalization layer, an activation function layer, an average pooling layer, and a feature reshaping layer. The depthwise separable convolutional block consists of a depthwise convolutional layer with 3×3 kernels and a 1×1 point convolutional layer. The CRNN includes: two bidirectional LSTM layers and a fully connected layer. The bidirectional LSTM layers include: calculating the update gate, calculating the candidate cell state, updating the cell state, and calculating the output gate and hidden state.

[0009] Logical verification of the identified characters is performed based on a hierarchical dictionary to obtain the identified text; the hierarchical dictionary is a preset content dictionary.

[0010] Based on the above technical solutions, in the character recognition processing method for robots provided in this application, by removing non-character images from the target image and then segmenting the target image into ROI region maps, the recognition of characters by redundant images can be reduced. Furthermore, by recognizing the ROI region maps through a character recognition model, the relationship between preceding and following text can be captured, adapting to the coherence of the text, thereby further reducing the possibility of character misrecognition. Moreover, by establishing a hierarchical lexicon in a vertical field and performing logical verification through the hierarchical lexicon, the accuracy of recognition can be significantly improved.

[0011] In conjunction with the first aspect above, in one possible implementation, the step of removing redundant images from the target image and partitioning it includes:

[0012] By pseudo-randomly selecting several random points in the target image and calculating the average RGB channel values ​​of these random points, the background color of the document is determined using the average RGB channel values ​​of each random point.

[0013] The target image is converted to grayscale based on the document's background color, and then processed using a three-segment linear grayscale transform to obtain a corrected image. The formula for the three-segment linear grayscale transform is: ; The original grayscale value. The transformed grayscale value; , , , These are preset parameters;

[0014] The modified image is processed by iterative binarization to obtain a binary image; a horizontal structure kernel and a vertical structure kernel are constructed to perform morphological opening operations on the binary image to obtain a preprocessed image;

[0015] Contour detection and filtering are performed on the preprocessed image to obtain the region contour; and edge adjustment is performed on the region contour to obtain the ROI region.

[0016] In conjunction with the first aspect above, in one possible implementation, the iteration threshold is obtained as follows: An initial threshold T0 = 127 is set; based on the initial threshold T0, the corrected image is divided into a foreground image and a background image; then, the average grayscale value u1 of the foreground image and the average grayscale value u2 of the background image are calculated separately, and the result is obtained through the calculation formula... Calculate the iteration threshold ,like Stop iteration, otherwise let Repeat the above steps to obtain the iteration threshold; and when iterating, limit the maximum number of iterations to avoid an infinite loop.

[0017] In conjunction with the first aspect above, in one possible implementation, the contour detection and filtering of the preprocessed image includes:

[0018] S11: Perform contour detection on the preprocessed image to obtain several closed contours;

[0019] S12: Iterate through several closed contours to see if they contain other closed contours; if yes, remove the inner closed contour and jump to S13; otherwise, jump to S13.

[0020] S13: Obtain the bounding rectangles of several closed contours, calculate the minimum horizontal and vertical distances between several closed contours, determine several groups of closed contours through a clustering algorithm, and perform rectangular cutting on the clustered contours to obtain the region contours.

[0021] In conjunction with the first aspect above, in one possible implementation, the method of rectangular cut-out includes:

[0022] Establish a coordinate system with any point in the corrected image as the origin and pixels as the unit. Traverse the coordinates of the closed contours in the classification to find the coordinates with the maximum vertical coordinate value and the minimum horizontal coordinate value. Mark the point corresponding to the maximum horizontal coordinate value among the maximum vertical coordinate values ​​as the right vertex and the point corresponding to the minimum vertical coordinate value among the minimum horizontal coordinate values ​​as the left vertex. Determine the region contour based on the left and right vertices.

[0023] In this embodiment, the clustering algorithm can be the DBSCAN algorithm.

[0024] In conjunction with the first aspect above, in one possible implementation, the step of selecting the RGB values ​​of several random points in the target image through pseudo-randomness includes:

[0025] The target image is divided into several regions of equal area. Several identical pixels are randomly selected in each region and marked as initial pixels. The region shape is either a square or a regular hexagon.

[0026] The algorithm iterates through the initial pixel and checks whether the distance Li between the initial pixel and other initial pixels within a preset range is greater than a preset distance. If yes, the initial pixel is marked as a random point; otherwise, the position of the initial pixel is adjusted. The preset range is a range centered on a selected initial pixel with the area as its size, and the distance between pixels is in pixels.

[0027] The method for adjusting the position of the initial pixel is as follows: move the initial pixel towards the maximum interval distance Li. max The initial pixel is moved in the direction of the initial pixel until the interval distance Li is greater than the preset distance.

[0028] In conjunction with the first aspect above, in one possible implementation, the depthwise separable convolutional lightweight CNN includes: an input layer, a standard convolutional layer with 3×3 kernels, three depthwise separable convolutional blocks, a microconvolutional layer, a batch normalization layer, an activation function layer, an average pooling layer, and a feature reshaping layer; wherein, the depthwise separable convolutional block consists of a depthwise convolutional layer with 3×3 kernels and a 1×1 point convolutional layer;

[0029] It should be noted that the specific feature extraction steps are as follows: The ROI image is input from the input layer, and low-order features are initially extracted through a standard convolutional layer. Then, the low-order features are fused into mid-order features through a first depthwise separable convolutional block. The mediating features are aggregated through a second depthwise separable convolutional block to obtain high-order semantic features. Then, edge features of characters are extracted through a point convolutional layer to supplement the high-order semantic features. The semantic features are further deepened through a third depthwise separable convolutional block. Finally, the deepened semantic features are compressed to a higher dimension through an average pooling layer, and global features are fused to output a fixed-length feature map. Then, the 2D feature map is converted into 1D sequence features through a feature reshaping layer to meet the CRNN's requirement of "time step × feature dimension" input format.

[0030] In conjunction with the first aspect above, in one possible implementation, the formula for calculating the number of parameters of the depthwise separable convolutional lightweight CNN is as follows: ;in, For input channels, For output channels, The height of the convolution kernel. is the width of the convolution kernel.

[0031] It should be noted that, It is a depthwise convolution, with one convolution kernel corresponding to each input channel, used to capture features within a single channel. It is a point convolution used to fuse features from all channels.

[0032] In conjunction with the first aspect above, in one possible implementation, the formula for calculating the update gate is: ;in, To update the gate output, For activation function, This is the weight matrix. This represents the hidden state of the LSTM at the previous time step. Input features for the current time step (i.e., the output of a depthwise separable convolutional lightweight CNN). To concatenate the historical hidden states with the current input features into a single vector, To update the gate bias vector;

[0033] The formula for calculating the candidate cell type is: ;in, Candidate cell state, The hyperbolic tangent activation function is used. This is the candidate cell state weight matrix. This is the candidate cell state bias vector;

[0034] The formula for calculating the updated cell state is: ;in, This represents the current state of the cell. Retain weights for historical information. This represents the cell state at the previous moment. Retain weights for current information;

[0035] The output gate calculation formula is: ,in, For output gate output, This is the output gate weight matrix. To splice together the current cell state, historical hidden states, and current input features, This is the output gate bias vector;

[0036] The formula for calculating the hidden state is: ;in, The current state is hidden. The output gate controls the output of the cell state.

[0037] In conjunction with the first aspect above, in one possible implementation, the CTC processing method sequentially includes: constructing a medical character set and CTC decoding;

[0038] The CTC loss function during the training process is: Z; where... This represents the CTC loss amount. The number of training samples. Let i be the true label sequence of the i-th sample. The model output sequence for the i-th sample. For the output sequence Corresponding real label sequence The conditional probability, For logarithmic probability, It is the sum of the negative log-likelihoods of all samples.

[0039] In a second aspect, an electronic device is provided, comprising: a communication unit and a processing unit; the communication unit is used to acquire a target image of a document to be recognized; the processing unit is used to remove redundant images from the target image to obtain a Region of Interest (ROI) map; the redundant images are non-character images; the ROI map is input into a character recognition model to obtain recognized characters; and the recognized characters are logically verified based on a hierarchical dictionary to obtain recognized text.

[0040] Thirdly, this application provides a processing apparatus, comprising: a processor and a storage medium; the storage medium includes instructions, and the processor is configured to execute the instructions to implement the methods described in the first aspect and any possible implementation thereof. The electronic apparatus may be an electronic device or a chip within an electronic device.

[0041] Fourthly, this application provides a character recognition processing system for robots, including: a data acquisition module, a character recognition module, and a verification module; wherein, the data acquisition module is used to acquire the target image of the document to be recognized, remove redundant images in the target image and partition it to obtain a ROI region map;

[0042] The character recognition module is used to input the ROI region map into the character recognition model to obtain the recognized characters; the verification module is used to perform logical verification on the recognized characters based on the hierarchical dictionary to obtain the recognized text.

[0043] Fifthly, this application provides a computer-readable storage medium storing instructions that, when executed on a processing device, cause the processing device to perform the methods described in the first aspect and any possible implementation thereof.

[0044] In a sixth aspect, this application provides a computer program product containing instructions that, when executed on a processing device, cause the processing device to perform the methods described in the first aspect and any possible implementation thereof.

[0045] This application provides a character recognition processing method and system for robots. By using pseudo-random point selection and background color judgment, the accuracy of background color judgment can be guaranteed. In addition, grayscale three-segment linear transformation and cluster contour filtering can further extract ROI regions and remove interfering content such as tables in the image to improve the accuracy of subsequent character recognition. Moreover, when the character model is used for recognition, a depthwise separable convolutional lightweight CNN can effectively recognize dense small characters, and the text features between characters can be associated through CRNN to further improve the accuracy of character recognition.

[0046] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0047] Figure 1 A system architecture diagram of a character recognition processing system provided in this application embodiment;

[0048] Figure 2 A flowchart illustrating a character recognition processing method for robots provided in an embodiment of this application;

[0049] Figure 3 A schematic diagram illustrating the contour detection and filtering process provided in an embodiment of this application;

[0050] Figure 4 A flowchart illustrating the CNN feature extraction method provided in this application embodiment;

[0051] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0052] Figure 6 This is a schematic diagram of the hardware structure of a processing device provided in an embodiment of this application; Detailed Implementation

[0053] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.

[0054] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0055] The limitations of existing technologies lead to significant shortcomings in ordinary OCR solutions for invoice and receipt recognition: First, they are weak in resisting interference in scenarios such as obscured seals and complex layouts, easily resulting in missed or incorrect character recognition; second, their verification mechanisms are simplistic and cannot effectively correct errors such as "similar character confusion" (e.g., "8" and "B", "6" and "G") and logical inconsistencies in fields (e.g., mismatch between total price and tax and itemized amounts); third, their dynamic adaptability to scenarios is poor. When new types of vouchers or new interference scenarios appear, the recognition accuracy drops rapidly, requiring continuous manual sample training, resulting in high maintenance costs. These problems directly lead to insufficient accuracy in recognition results, requiring users to spend a significant amount of time manually proofreading, severely impacting the efficiency of the digital process and user experience. Therefore, there is an urgent need for an OCR technology solution that adapts to the characteristics of invoice and receipt scenarios and combines high-accuracy recognition with dynamic self-optimization capabilities.

[0056] The character recognition processing method for robots provided in this application embodiment can be applied to, for example... Figure 1 In the character recognition processing system 100 shown, such as Figure 1 As shown, the character recognition processing system includes: an image acquisition device 101, an edge computing device 102, and a business system device 103.

[0057] Among them, the image acquisition device 101 is used to be mounted on the robot to acquire target images of documents to be recognized (such as medical invoices).

[0058] Edge computing device 102 is used to receive images transmitted by device 101, execute the character recognition processing method of the present invention, and output the final recognized text.

[0059] The business system device 103 uses the structured recognition text sent by the edge computing device 102 to perform subsequent business processing, such as automatically entering it into the medical billing system or conducting financial audits.

[0060] To address the technical problems of high error rates, weak anti-interference capabilities, and lack of semantic-level verification in existing general-purpose OCR technologies for vertical fields, this application provides a character recognition processing method for robots. This method includes: accurately extracting character regions using innovative image preprocessing techniques; performing high-precision recognition using a lightweight hybrid model optimized for vertical fields; and finally, combining the recognition results with an industry knowledge base for logical verification and error correction. Based on this, efficient and accurate end-to-end character recognition is achieved on a robot embedded platform.

[0061] like Figure 2 As shown in the embodiments of this application, the robot character recognition processing method includes:

[0062] S201. Obtain the target image of the document to be recognized, remove redundant images from the target image, and obtain the ROI region map.

[0063] The redundant images are non-character images, such as trademarks and lines. The target image is a hospital bill taken by the robot (RGB format, 4096×3072, 250dpi). The redundant images include background shadows, table lines, irrelevant logos, etc., which need to be removed by "background color judgment, grayscale transformation, and outline filtering" to retain the character area (ROI).

[0064] In some implementations, redundant images in the target image are removed, including:

[0065] By pseudo-randomly selecting several random points in the target image and calculating the average RGB channel values ​​of these random points, the background color of the document is determined using the average RGB channel values ​​of each random point.

[0066] The target image is converted to grayscale based on the document's background color, and then processed using a three-segment linear grayscale transform to obtain a corrected image. The formula for the three-segment linear grayscale transform is: ; The original grayscale value. This represents the transformed grayscale value.

[0067] The modified image is processed by iterative threshold binarization to obtain a binary image; a horizontal structure kernel and a vertical structure kernel are constructed to perform morphological opening operation on the binary image to obtain a preprocessed image;

[0068] Contour detection and filtering are performed on the preprocessed image to obtain the region contour; and edge adjustment is performed on the region contour to obtain the ROI region.

[0069] It should be noted that, through grayscale analysis of 100,000 medical text samples (including medical insurance bills, medical records, and prescriptions), it was found that the grayscale distribution exhibits a "triple-peak clustering" characteristic:

[0070] Low grayscale range (0-90): mainly consists of light-colored characters (such as scanned, blurry drug names, handwritten strokes) and a small amount of noise, with an average grayscale of about 85;

[0071] The middle section (90-180): This is mainly the transition area between the characters and the background color (such as the edges of the characters and characters in a light background), and it is a key area for improving contrast.

[0072] High grayscale range (180-255): mainly background color (white / light blue / light green), average grayscale is about 200, no valid character information.

[0073] The grayscale three-segment linear transformation can expand the grayscale difference between the character and the background color, thus solving the problem of light-colored characters in medical text. Furthermore, iterative thresholding can convert the image to black characters and white background.

[0074] In this embodiment, since medical documents have white backgrounds (outpatient medical records), light blue backgrounds (inpatient bills), and light green backgrounds (examination reports), the grayscale three-segment linear transformation can expand the grayscale difference between the characters and the background color, further improving the contrast between the font and the background color.

[0075] In this embodiment, an initial threshold T0 = 127 is set. Based on the initial threshold T0, the corrected image is divided into a foreground image and a background image. Then, the average grayscale value u1 of the foreground image and the average grayscale value u2 of the background image are calculated separately. Calculate the iteration threshold ,like Stop iteration, otherwise let The above steps are restated to obtain the final threshold; and when iterating, the maximum number of iterations is limited to avoid an infinite loop.

[0076] It should be noted that segment nodes This refers to the highest grayscale threshold for light-colored characters. Statistics show that 99% of valid characters (including light-colored characters) have a grayscale value ≤ 90. Low grayscale areas exceeding 90 are mostly noise. The low grayscale range of 0-90 is designated as the "valid character area," and subsequent stretching can enhance the grayscale difference of light-colored characters, preventing noise from being misjudged as characters. (Segmentation node) This is the minimum grayscale threshold for medical background colors—statistics show that 98% of background colors (white / light blue / light green) have a grayscale value ≥180, while high grayscale areas below 180 are mostly "transition colors between character edges and background colors"; target grayscale. This refers to the "clear grayscale lower limit" for characters. When the grayscale value of a character drops below 60, the pixel integrity of the character after binarization is ≥95%; if it is below 50, it will cause character strokes to break; if it is above 70, the grayscale difference between the character and the background is insufficient; target grayscale. It is the "uninterrupted grayscale upper limit" of the background color. When the grayscale of the background color is ≥210, the purity of the background pixels after binarization is ≥98%. If it is higher than 220, it will cause the background color to be overexposed (close to 255), which will reduce the grayscale difference with the light-colored characters. If it is lower than 200, the grayscale difference between the background color and the character transition area is insufficient.

[0077] It should be noted that after acquiring the target image, it needs to be converted to RGB channel JPG format using OpenCV, with the resolution normalized to 200-300dpi (bilinear interpolation is used to enlarge the image below 200dpi, and mean downsampling is used above 300dpi) (to adapt to the input of the subsequent recognition network). A 5×5 Gaussian filter (σ=1.2) is used to filter out scanning particle noise and shooting compression noise, while preserving character edge features.

[0078] In conjunction with the first aspect mentioned above, one possible implementation involves selecting the RGB values ​​of several random points in the target image through pseudo-randomization, including:

[0079] The target image is divided into several regions of equal area. Several identical pixels are randomly selected in each region and marked as initial pixels. The region shape is either a square or a regular hexagon.

[0080] The algorithm iterates through the initial pixel and checks whether the distance Li between the initial pixel and other initial pixels within a preset range is greater than a preset distance. If yes, the initial pixel is marked as a random point; otherwise, the position of the initial pixel is adjusted. The preset range is a range centered on a selected initial pixel with the area as its size, and the distance between pixels is in pixels.

[0081] The method for adjusting the position of the initial pixel is as follows: move the initial pixel towards the maximum interval distance Li. max The initial pixel is moved in the direction of the initial pixel until the interval distance Li is greater than the preset distance.

[0082] By adjusting the intervals as described above to ensure that the selected points are not too dense and to avoid data redundancy, it is possible to avoid local reflections in the image during shooting. For example, it can prevent the characters in the reflective areas of the image from being faded and becoming unrecognizable during subsequent character processing, thus avoiding information loss.

[0083] In one possible implementation, combining Figure 2 ,like Figure 3As shown, the method for contour detection and filtering of preprocessed images provided in this application embodiment further includes the following steps S301 to S303:

[0084] S301. Perform contour detection on the preprocessed image to obtain several closed contours;

[0085] S302. Iterate through several closed contours to see if they contain other closed contours. If yes, remove the inner closed contour and jump to S303. If no, jump to S303.

[0086] S303. Obtain the bounding rectangles of several closed contours, calculate the minimum horizontal and vertical distances between several closed contours, determine several groups of closed contours through a clustering algorithm, and perform rectangular cutting on the clustered contours to obtain the region contours.

[0087] In this embodiment, the clustering algorithm can be the DBSCAN algorithm. Inner nested contours (such as character contours inside a seal) are removed to avoid invalid contours affecting ROI extraction; the DBSCAN clustering algorithm groups contours by character spacing to ensure that contours of the same text block are clustered together; adaptive grouping is achieved by calculating the minimum horizontal / vertical distance to adapt to different layouts of medical text (such as single-column prescriptions and multi-column expense lists), avoiding character omissions or redundancy due to layout differences.

[0088] The methods for rectangular subtraction mentioned above include:

[0089] Establish a coordinate system with any point in the corrected image as the origin and pixels as the unit. Traverse the coordinates of the closed contours in the classification to find the coordinates with the maximum vertical coordinate value and the minimum horizontal coordinate value. Mark the point corresponding to the maximum horizontal coordinate value among the maximum vertical coordinate values ​​as the right vertex and the point corresponding to the minimum vertical coordinate value among the minimum horizontal coordinate values ​​as the left vertex. Determine the region contour based on the left and right vertices.

[0090] Obtaining the region outline using the above method can avoid situations where characters are not completely within the ROI region due to positional offsets or tilts.

[0091] In this embodiment, the preset distance is set to half the side length of the square or regular hexagon.

[0092] In this embodiment, the ROI region is obtained by adjusting the edges of the region outline by increasing the width and height of the rectangle by 2 pixels.

[0093] S202. Input the ROI region map into the character recognition model to obtain the recognized characters.

[0094] The character recognition model consists of "depth-separable convolutional lightweight CNN + CRNN + CTC decoding"; the lightweight CNN extracts 35×1024 feature sequences, the improved CRNN (2-layer bidirectional LSTM) captures contextual associations, and CTC selects a decoding strategy based on the font type.

[0095] For example, the ROI corresponding to "nifedipine tablets 10mg / day" is input into the model, a lightweight CNN outputs a 35×1024 feature sequence, a CRNN fuses the forward ("nifedipine tablets → 10mg") and backward ("10mg → nifedipine tablets") context, and a CTC greedy decoder outputs the recognized character: "nifedipine tablets 10mg / day".

[0096] In this embodiment, the depthwise separable convolutional lightweight CNN includes: an input layer, a standard convolutional layer with 3×3 kernels, three depthwise separable convolutional blocks, a microconvolutional layer, a batch normalization layer, an activation function layer, an average pooling layer, and a feature reshaping layer; wherein, the depthwise separable convolutional block consists of a depthwise convolutional layer with 3×3 kernels and a 1×1 pointwise convolutional layer; the batch normalization layer uses BatchNorm2d, and the activation function layer uses the Leaky ReLU function.

[0097] In one possible implementation, combining Figure 2 like Figure 4 As shown in the embodiment of this application, the steps for extracting features using a depthwise separable convolutional lightweight CNN are as follows:

[0098] S401: Input the ROI image from the input layer;

[0099] For example, the input is a medical text ROI region map after redundancy removal, with a uniform format of 3×32×464 (C×H×W), that is, 3 channels (RGB), height 32 pixels, width 464 pixels, and pixel values ​​have been normalized to [0,1].

[0100] S402: Use standard convolutional layers to perform initial low-level feature extraction;

[0101] The low-level features include character textures and edges; the standard convolutional layer has 3 input channels, 32 output channels, a stride of 1, and padding of 1.

[0102] In a further implementation, the extraction operation logic is as follows: 3 input channels are convolved element-wise with 32 3×3 convolutional kernels, each convolutional kernel corresponds to one edge direction (such as horizontal, vertical, diagonal), and the output is a 32×32×464 feature map;

[0103] It should be noted that after the convolution operation, a batch normalization layer and an activation function layer are connected to perform batch normalization, accelerate the training convergence, and avoid the "death" of medical light-colored character features;

[0104] The standard convolutional layer can quickly capture low-level basic features such as the edges and textures of characters and filter out the remaining tiny redundancies.

[0105] S403: The low-level features are fused into intermediate-level features through the first depthwise separable convolutional block;

[0106] Among them, the intermediate features are the stroke segments and local contours of the characters, etc.; the input channels of the depth convolutional layer are 32, the output channels are 32, groups = 32, stride = 1, padding = 1; the input channels of the point convolutional layer are 32, the output channels are 64 (cross-channel fused features), stride = 1, padding = 0;

[0107] In a further implementation, the specific logic of the fusion is as follows: first, the local details of each channel are extracted through depth convolution (such as the horizontal and vertical strokes of the characters), and then the features of 32 channels are fused through a 1×1 point convolution to output a feature map of 64×32×464;

[0108] It should be noted that after the point convolution, BatchNorm2d and Leaky ReLU are connected to maintain the non-linear expression ability of the features;

[0109] S404: The intermediate features are aggregated through the second depthwise separable convolutional block to obtain high-order semantic features;

[0110] Among them, the high-order semantic features are mainly the components of the characters, such as the "stone" radical and the "xiao" part of "xiao"; the input channels of the depth convolutional layer are 64, the output channels are 64, groups = 64, stride = 2 (downsampling in the width direction, from 464→232), padding = 1; the input channels of the point convolutional layer are 64, the output channels are 128, stride = 1, padding = 0;

[0111] In a further implementation, the operation logic of the aggregation is as follows: the depth convolution compresses the width dimension by a stride of 2 (the height remains 32 unchanged) to reduce the subsequent calculation amount; the point convolution fuses the intermediate features of 64 channels into 128 high-order features and outputs a feature map of 128×32×232;

[0112] S405: The edge features of the characters are extracted through the micro convolutional layer to supplement the high-order semantic features, and then the detail feature discrimination is enhanced through the batch normalization layer and the activation function layer;

[0113] The microconvolutional layer has 128 input channels, 128 output channels, a stride of 1, and padding of 1 (without changing the feature map size: 32×232).

[0114] It should be noted that by using small-sized convolutional kernels to focus on local areas (3×3 pixels), detailed features such as edges and corners of small characters are extracted, which makes up for the "blurring effect" of deep convolution on small features; and after performing micro-convolution, BatchNorm2d and Leaky ReLU are applied to enhance the discriminability of detailed features.

[0115] S406: Semantic features are further enhanced through a third layer of depthwise separable convolutional blocks;

[0116] The deep convolutional layer has 128 input channels, 128 output channels, groups=128, stride=2, and padding=1; the point convolutional layer has 128 input channels, 256 output channels, stride=1, and padding=0.

[0117] It should be noted that depthwise convolution further compresses the width dimension, while pointwise convolution fuses 128 detailed enhanced features into 256 high-dimensional semantic features, outputting a 256×32×116 feature map.

[0118] S407: The enhanced semantic features are compressed to a high dimension through the average pooling layer, global features are fused, and a fixed-length feature map is output. Then, the 2D feature map is converted into 1D sequence features through the feature reshaping layer, which meets the CRNN's requirement for the "time step × feature dimension" input format.

[0119] The average pooling layer operates by performing global average pooling (averaging the 32 pixels in each channel) on a 256×32×116 feature map, compressing the width to 35 (to adapt to the time step of CRNN), and outputting a 256×1×35 feature map to reduce parameter redundancy, fuse global features of characters (such as the overall structure of "nifedipine tablets"), and improve the model's generalization ability.

[0120] The operation logic of the feature reshaping layer is as follows: the 256×1×35 feature map is transformed into 35×256×1 (time step × number of channels × height); then the 256×1 is flattened into 1024 dimensions (256×4, the feature dimensions are expanded and supplemented by the channel dimension), and finally the sequence features of 35×1024 (35 is the time step, and 1024 is the feature dimension of each time step) + font classification probability are output;

[0121] In conjunction with the first aspect mentioned above, in one possible implementation, the formula for calculating the number of parameters in a depthwise separable convolutional lightweight CNN is as follows: ;in, For input channels, For output channels, The height of the convolution kernel. is the width of the convolution kernel.

[0122] It should be noted that, It is a depthwise convolution, with one convolution kernel corresponding to each input channel, used to capture features within a single channel. It is a point convolution used to fuse features from all channels.

[0123] CRNN comprises: two bidirectional LSTM layers and a fully connected layer; the bidirectional LSTM layer comprises: calculating the update gate, calculating the candidate cell state, updating the cell state, calculating the output gate and the hidden state;

[0124] It should be noted that the first bidirectional LSTM primarily captures the sequential relationships between medical characters from "left to right" and "right to left" (e.g., the relationship between "E" and "10", and "10" and "9" in "E10.9"); the specific operational logic is as follows:

[0125] Forward LSTM: Processes sequences in time step 1→35 to capture “preceding text→following text” associations (e.g., “nifedipine tablets→10mg”).

[0126] Backward LSTM: Processes sequences in reverse order at time step 35→1 to capture "later text → earlier text" associations (e.g., "10mg → nifedipine tablets").

[0127] Feature fusion: The hidden states of the forward and backward LSTMs are concatenated (256+256=512 dimensions) to output 35×512 enhanced sequence features;

[0128] The second bidirectional LSTM takes the 35×512 features output by the first bidirectional LSTM as input, repeats the "forward + backward" modeling and feature fusion, and outputs 35×512 high-order sequence features (with tighter semantic association).

[0129] The aforementioned fully connected layer is used to map the 512-dimensional high-order sequence features to the medical character set dimension, providing a character probability distribution for decoding; and the output dimension is 6800 (medical character set size: 6763 Chinese characters + 10 digits + 26 letters + 1 whitespace character); the specific operation logic is to perform a linear transformation on the 512-dimensional features at each time step, output the original score (logits) of the 6800 characters corresponding to that time step, and finally output a 35×6800 character score matrix.

[0130] In conjunction with the first aspect mentioned above, in one possible implementation, the formula for calculating the update gate is: ;in, To update the gate output, For activation function, This is the weight matrix. This represents the hidden state of the LSTM at the previous time step. Input features for the current time step (i.e., the output of a depthwise separable convolutional lightweight CNN). To concatenate the historical hidden states with the current input features into a single vector, To update the gate bias vector;

[0131] The formula for calculating candidate cells is: ;in, Candidate cell state, The hyperbolic tangent activation function is used. This is the candidate cell state weight matrix. This is the candidate cell state bias vector;

[0132] The formula for calculating the updated cell state is: ;in, This represents the current state of the cell. Retain weights for historical information. This represents the cell state at the previous moment. Retain weights for current information;

[0133] The output gate calculation formula is: ,in, For output gate output, This is the output gate weight matrix. To splice together the current cell state, historical hidden states, and current input features, This is the output gate bias vector;

[0134] The formula for calculating the hidden state is: ;in, The current state is hidden. The output gate controls the output of the cell state.

[0135] CTC's processing methods include, in order: character probability normalization, font type adaptation decoding strategy, path filtering, and character sequence output.

[0136] Specifically, character probability normalization mainly involves applying the Softmax function to the 35×6800 score matrix, converting the scores of 6800 characters at each time step into probabilities of 0-1 (summing up to 1), and outputting a 35×6800 character probability matrix; this transforms the character score matrix into a probability distribution, facilitating subsequent path probability calculations.

[0137] Specifically, the font type adaptation decoding strategy is as follows: if the probability of printed fonts is ≥0.8, then greedy decoding is used; if the probability of handwritten fonts is ≥0.8, then beam search decoding is used.

[0138] Specifically, path filtering and character sequence output are used to filter invalid paths and output the final recognized characters. When using greedy decoding, it iterates through 35 time steps, selects the character with the highest probability in turn, removes consecutive repeated characters (such as "110mg" → "10mg") and whitespace characters "_", and directly outputs the character sequence. When using beam search decoding, it initializes 5 candidate beams (cumulative probability + current sequence), updates the beams at each time step and retains the Top-5, and finally selects the sequence with the highest cumulative probability, filtering out whitespace characters and consecutive repeated characters.

[0139] In conjunction with the first aspect above, in one possible implementation, the CTC loss function during the training process is: Z; where... This represents the CTC loss amount. The number of training samples. Let i be the true label sequence of the i-th sample. The model output sequence for the i-th sample. For the output sequence Corresponding real label sequence The conditional probability, For logarithmic probability, It is the sum of the negative log-likelihoods of all samples.

[0140] S203. Logical verification of the recognized characters is performed based on the hierarchical dictionary to obtain the recognized text.

[0141] The hierarchical lexicon includes drug categories (standard name of "nifedipine tablets", conventional dosage 5-20mg / day), coding categories ("E10.9" corresponds to "type 1 diabetes"), and logical rules (dosage ≤ 20mg / day, sum of itemized amounts = total amount). The verification process consists of three steps: "lexicon matching - semantic conflict detection - numerical logic verification".

[0142] For example, the recognition result "Diagnosis: E10.9, Drugs: Nifedipine tablets 10mg / day (85.5 yuan), Aspirin enteric-coated tablets 100mg / day (120 yuan), Total amount: 205.5 yuan" is verified as follows: ① The word matching "E10.9→Type 1 diabetes" and "Nifedipine tablets" are both valid; ② There is no semantic conflict (Nifedipine can be used for Type 1 diabetes); ③ Numerical verification: 85.5+120=205.5, which is consistent with the total amount, so the verification is successful.

[0143] The foregoing primarily describes the solutions of the embodiments of this application from the perspective of device implementation. It is understood that each device, such as an electronic device, includes at least one of the hardware structures and software modules corresponding to the execution of each function in order to achieve the aforementioned functions. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0144] This application embodiment can divide the electronic device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0145] When using integrated units, Figure 5 A possible structural schematic diagram of the electronic device (referred to as electronic device 50) involved in the above embodiments is shown. The electronic device 50 includes a processing unit 501 and a communication unit 502, and may also include a storage unit 503. Figure 5 The structural diagram shown can be used to illustrate the structure of the electronic device involved in the above embodiments.

[0146] when Figure 5 The schematic diagram shown is used to illustrate the structure of the electronic device involved in the above embodiments. The processing unit 501 is used to control and manage the operation of the electronic device, the communication unit 502 is used for the electronic device to communicate with other devices, and the storage unit 503 is used to store the program code and data of the electronic device.

[0147] For example, communication unit 502 is used to acquire the target image of the document to be recognized;

[0148] Processing unit 501 is used to remove redundant images from the target image to obtain a Region of Interest (ROI) map; the redundant images are non-character images; the ROI map is input into a character recognition model to obtain recognized characters; and the recognized characters are logically verified based on a hierarchical dictionary to obtain recognized text.

[0149] The processing unit 501 can be a processor or a controller, and the communication unit 502 can be a communication interface, transceiver, transceiver circuit, transceiver device, etc. The term "communication interface" is a general term and may include one or more interfaces. The storage unit 503 can be a memory. When the electronic device 50 is a chip, the processing unit 501 can be a processor or a controller, and the communication unit 502 can be an input interface and / or an output interface, pins, or circuits, etc. The storage unit 503 can be a storage unit within the chip (e.g., a register, cache, etc.) or a storage unit located outside the chip (e.g., read-only memory (ROM), random access memory (RAM, etc.).

[0150] The communication unit can also be called a transceiver unit. The antenna and control circuit with transceiver functions in the electronic device 50 can be considered as the communication unit 502 of the electronic device 50, and the processor with processing functions can be considered as the processing unit 501 of the electronic device 50. Optionally, the device in the communication unit 502 that implements the receiving function can be considered as a communication unit. The communication unit is used to execute the receiving steps in the embodiments of this application, and the communication unit can be a receiver, a receiver circuit, etc. The device in the communication unit 502 that implements the transmitting function can be considered as a transmitting unit. The transmitting unit is used to execute the transmitting steps in the embodiments of this application, and the transmitting unit can be a transmitter, a transmitter, a transmitting circuit, etc.

[0151] Figure 5 If the integrated units in the process are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. Storage media for storing computer software products include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0152] Figure 5 The units in the process can also be called modules; for example, a processing unit can be called a processing module.

[0153] This application also provides a hardware structure diagram of a processing device (referred to as processing device 60), see [link to diagram]. Figure 6The processing device 60 includes a processor 601, and optionally, a memory 602 connected to the processor 601.

[0154] In the first possible implementation, see Figure 6 The processing device 60 also includes a transceiver 603. The processor 601, memory 602, and transceiver 603 are connected via a bus. The transceiver 603 is used to communicate with other devices or communication networks. Optionally, the transceiver 603 may include a transmitter and a receiver. The device in the transceiver 603 that implements the receiving function can be considered as a receiver, which is used to perform the receiving steps in the embodiments of this application. The device in the transceiver 603 that implements the transmitting function can be considered as a transmitter, which is used to perform the transmitting steps in the embodiments of this application.

[0155] Based on the first possible implementation method Figure 6 The schematic diagram shown can be used to illustrate the structure of the processing device involved in the above embodiments.

[0156] in, Figure 6 Alternatively, the system chip in the processing device can be illustrated. In this case, the actions performed by the aforementioned processing device can be implemented by the system chip, and the specific actions performed can be found above, and will not be repeated here.

[0157] In implementation, each step of the method provided in this embodiment can be completed by integrated logic circuits in the processor hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.

[0158] The processor in this application may include, but is not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, etc., which are various computing devices that run software. Each computing device may include one or more cores for executing software instructions to perform calculations or processing. The processor may be a separate semiconductor chip or integrated with other circuits into a single semiconductor chip. For example, it may be integrated with other circuits (such as encoding / decoding circuits, hardware acceleration circuits, or various bus and interface circuits) to form a SoC (System-on-a-Chip), or it may be integrated as a built-in processor within an ASIC. The ASIC with the integrated processor may be packaged separately or together with other circuits. In addition to the cores for executing software instructions to perform calculations or processing, the processor may further include necessary hardware accelerators, such as field-programmable gate arrays (FPGAs), PLDs (programmable logic devices), or logic circuits that implement dedicated logic operations.

[0159] The memory in the embodiments of this application may include at least one of the following types: read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; or electrically erasable programmable-only memory (EEPROM). In some scenarios, the memory may also be a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto.

[0160] This application also provides a computer-readable storage medium including instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0161] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0162] This application also provides a chip including a processor and an interface circuit. The interface circuit is coupled to the processor. The processor is used to run computer programs or instructions to implement the above-described method. The interface circuit is used to communicate with other modules outside the chip.

[0163] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks (SSDs)).

[0164] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0165] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.

Claims

1. A character recognition processing method for a robot, characterized by, include: Obtain the target image of the document to be identified, remove redundant images from the target image and divide it into regions of interest (ROI) to obtain the ROI map; Input the ROI region map into the character recognition model to obtain the recognized characters; The character recognition model employs a depthwise separable convolutional lightweight CNN for feature extraction, a CRNN for sequence modeling, and CTC decoding. The depthwise separable convolutional lightweight CNN comprises: an input layer, a standard convolutional layer with 3×3 kernels, three depthwise separable convolutional blocks, a microconvolutional layer, a batch normalization layer, an activation function layer, an average pooling layer, and a feature reshaping layer. Each depthwise separable convolutional block consists of a depthwise convolutional layer with 3×3 kernels and a 1×1 pointwise convolutional layer. The CRNN comprises: two bidirectional LSTM layers and a fully connected layer. The bidirectional LSTM layers include: calculating the update gate, calculating the candidate cell state, updating the cell state, and calculating the output gate and hidden state. Logical verification of the identified characters is performed based on a hierarchical dictionary to obtain the identified text; the hierarchical dictionary is a preset content dictionary. The step of removing redundant images from the target image and partitioning it includes: By pseudo-randomly selecting several random points in the target image and calculating the average RGB channel values ​​of these random points, the background color of the document is determined using the average RGB channel values ​​of each random point. The target image is converted to grayscale based on the document's background color, and then processed using a three-segment linear grayscale transform to obtain a corrected image. The formula for the three-segment linear grayscale transform is: ; The original grayscale value. The transformed grayscale value; , , , These are preset parameters; The modified image is processed by iterative binarization to obtain a binary image; a horizontal structure kernel and a vertical structure kernel are constructed to perform morphological opening operations on the binary image to obtain a preprocessed image; Contour detection and filtering are performed on the preprocessed image to obtain region contours; and edge adjustment is performed on the region contours to obtain the Region of Interest (ROI). The step of selecting RGB values ​​of several random points in the target image through pseudo-randomization includes: The target image is divided into several regions of equal area. Several identical pixels are randomly selected in each region and marked as initial pixels. The region shape is either a square or a regular hexagon. The algorithm iterates through the initial pixel and checks whether the distance Li between the initial pixel and other initial pixels within a preset range is greater than a preset distance. If yes, the initial pixel is marked as a random point; otherwise, the position of the initial pixel is adjusted. The preset range is a range centered on a selected initial pixel with the area as its size, and the distance between pixels is in pixels. The adjusting manner of the position of the initial pixel point is moving the initial pixel point to the direction where the initial pixel point is located until the interval distance Li is greater than the preset distance. max the initial pixel point is located until the interval distance Li is greater than the preset distance.

2. The method of claim 1, wherein The iteration threshold is obtained as follows: An initial threshold T0 = 127 is set. Based on the initial threshold T0, the corrected image is divided into a foreground image and a background image. Then, the average grayscale value u1 of the foreground image and the average grayscale value u2 of the background image are calculated separately. The calculation is then performed using the formula... Calculate the iteration threshold ,like Stop iteration, otherwise let Then restate the above steps to obtain the iteration threshold.

3. The method of claim 1, wherein The process of contour detection and filtering of the preprocessed image includes: S11: Perform contour detection on the preprocessed image to obtain several closed contours; S12: Iterate through several closed contours to see if they contain other closed contours; if yes, remove the inner closed contour and jump to S13; otherwise, jump to S13. S13: Obtain the bounding rectangles of several closed contours, calculate the minimum horizontal and vertical distances between several closed contours, determine several groups of closed contours through a clustering algorithm, and perform rectangular cutting on the clustered contours to obtain the region contours.

4. The character recognition processing method for a robot according to claim 3, characterized by, The methods for rectangular cropping include: Establish a coordinate system with any point in the corrected image as the origin and pixels as the unit. Traverse the coordinates of the closed contours in the classification to find the coordinates with the maximum vertical coordinate value and the minimum horizontal coordinate value. Mark the point corresponding to the maximum horizontal coordinate value among the maximum vertical coordinate values ​​as the right vertex and the point corresponding to the minimum vertical coordinate value among the minimum horizontal coordinate values ​​as the left vertex. Determine the region contour based on the left and right vertices.

5. The method of claim 1, wherein The depthwise separable convolutional lightweight CNN includes: an input layer, a standard convolutional layer with 3×3 kernels, three depthwise separable convolutional blocks, a microconvolutional layer, a batch normalization layer, an activation function layer, an average pooling layer, and a feature reshaping layer; wherein, the depthwise separable convolutional block consists of a depthwise convolutional layer with 3×3 kernels and a 1×1 point convolutional layer.

6. The method of claim 1, wherein The formula for calculating the update gate is: ;in, To update the gate output, For activation function, This is the weight matrix. This represents the hidden state of the LSTM at the previous time step. Input features for the current time step. To concatenate the historical hidden states with the current input features into a single vector, To update the gate bias vector; The computational formula of the candidate cell-like body is: ; wherein, is a candidate cell state, is a hyperbolic tangent activation function, is a candidate cell state weight matrix, is a candidate cell state bias vector; The calculation formula for updating the cell state is: ; wherein, is the current time cell state, is a history information retention weight, is the previous time cell state, is a current information retention weight; The output gate calculation formula is: wherein, is an output of the output gate, is an output gate weight matrix, is a concatenation of a current cell state, a history hidden state, and a current input feature, is an output gate bias vector; The calculation formula of the hidden state is: ; wherein, The current moment hidden state, is the output of the output gate control cell state.

7. The method of claim 1, wherein The CTC loss function during the training process is: Z; where... This represents the CTC loss amount. The number of training samples. Let i be the true label sequence of the i-th sample. The model output sequence for the i-th sample. For the output sequence Corresponding to the actual label sequence The conditional probability, For logarithmic probability, It is the sum of the negative log-likelihoods of all samples.

8. A character recognition processing system for a robot, applied to the character recognition processing method for a robot according to claim 1, characterized by, The system includes: a communication unit and a processing unit; The communication unit is used to acquire the target image of the document to be identified; The processing unit is used to remove redundant images from the target image and partition it to obtain a Region of Interest (ROI) map; input the ROI map into a character recognition model to obtain recognized characters; and perform logical verification on the recognized characters based on a hierarchical dictionary to obtain recognized text.