IP Library › Granted Patent US 12,424,010
Granted Patent B2
US 12,424,010 · App. 18/168,759 · Granted Sep 23, 2025

Character recognition model training method and apparatus, character recognition method and apparatus, device and storage medium

Inventors: Pengyuan Lv (Beijing, CN); Chengquan Zhang (Beijing, CN); Shanshan Liu (Beijing, CN); Meina Qiao (Beijing, CN); Yangliu Xu (Beijing, CN); Liang Wu (Beijing, CN); Xiaoyan Wang (Beijing, CN); Kun Yao (Beijing, CN); Junyu Han (Beijing, CN); Errui Ding (Beijing, CN); Jingdong Wang (Beijing, CN); Tian Wu (Beijing, CN); Haifeng Wang (Beijing, CN)
Assignee: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
G06V30/19147G06F7/764G06F16/24G06F16/33G06F16/43G06F16/53G06F16/5846G06F16/73G06F16/83G06F18/21G06F18/213G06F18/2155G06F18/253G06F40/258G06F40/279G06N3/045G06N3/0455G06N3/0895G06N3/09G06V10/26G06V10/40G06V10/42G06V10/44G06V10/62G06V10/70G06V10/7715G06V10/7753G06V10/7784G06V10/7788G06V10/7792G06V10/80G06V10/806G06V20/46G06V20/695G06V20/70G06V30/00G06V30/10G06V30/148G06V30/15G06V30/18G06V30/18143G06V30/18152G06V30/19127G06V30/19167G06V30/24G06V30/242G06V30/245G06V30/333G06V40/1347G06V40/1353G06V40/1359G06V40/168G06V40/193G06V40/382G10L15/02G10L15/063G06F18/2163G06F18/2178G06F2218/08G06T2207/20021G06T2207/20081G06T2207/20112G06V2201/09
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,424,010
App. No.
18/168,759
Granted
Sep 23, 2025
Kind
B2
Abstract

The present disclosure provides a character recognition model training method and apparatus, a character recognition method and apparatus, a device and a medium, relating to the technical field of artificial intelligence, and specifically to the technical fields of deep learning, image processing and computer vision, which can be applied to scenarios such as character detection and recognition technology. The specific implementing solution is: partitioning an untagged training sample into at least two sub-sample images; dividing the at least two sub-sample images into a first training set and a second training set; where the first training set includes a first sub-sample image with a visible attribute, and the second training set includes a second sub-sample image with an invisible attribute; performing self-supervised training on a to-be-trained encoder by taking the second training set as a tag of the first training set, to obtain a target encoder.

Claims (83)

1. A character recognition method being applied to a server and comprising:

partitioning an untagged training sample into at least two sub-sample images;

dividing the at least two sub-sample images into a first training set and a second training set; wherein the first training set comprises a first sub-sample image with a visible attribute, and the second training set comprises a second sub-sample image with an invisible attribute; performing self-supervised training on a to-be-trained encoder by taking the second training set as a tag of the first training set, to obtain a target encoder;

wherein the performing the self-supervised training on the to-be-trained encoder by taking the second training set as the tag of the first training set, to obtain the target encoder comprises:

initializing the to-be-trained encoder to obtain a first encoder;

extracting, based on the first encoder, a first visual feature of the first sub-sample image in the first training set and a second visual feature of the second sub-sample image in the second training set;

performing mask query calculation on the first visual feature, to obtain a third visual feature; and

updating the first encoder according to a feature error between the third visual feature and the second visual feature until the feature error satisfies a first error condition, and determining a latest updated first encoder as the target encoder;

wherein the updating the first encoder according to the feature error between the third visual feature and the second visual feature until the feature error satisfies the first error condition, and the determining the latest updated first encoder as the target encoder comprise:

initializing a to-be-trained decoder to obtain a first decoder;

determining, based on the first decoder, an image error generated when image reconstruction is performed on the third visual feature;

determining the feature error between the third visual feature and the second visual feature; and

updating the first encoder based on the feature error and the image error and updating the first decoder based on the image error until the feature error satisfies the first error condition and the image error satisfies a second error condition, and determining a latest obtained first encoder as the target encoder;

receiving a to-be-recognized image sent by a terminal device, and performing, based on the target encoder and the updated first decoder, image features extraction on the to-be-recognized image to obtain a target text; and

sending the target text to the terminal device.

2. The method according to claim 1 , wherein the determining, based on the first decoder, the image error generated when the image reconstruction is performed on the third visual feature comprises:

performing decoding calculation processing on the third visual feature by using the first decoder, to obtain a first decoded feature; and

obtaining the image error according to an image reconstruction result of the first decoded feature.

3. The method according to claim 2 , wherein the obtaining the image error according to the image reconstruction result of the first decoded feature comprises:

performing image reconstruction processing on the first decoded feature, to obtain a first prediction result; and

performing image error calculation by using the second sub-sample image and the first prediction result, to obtain the image error.

4. The method according to claim 1 , further comprising:

dividing, based on a mask setting strategy, at least two query vectors into a first query vector and a second query vector; wherein the mask setting strategy comprises mask data generated based on a preset first mask ratio; the at least two query vectors are spatial transformation vectors corresponding to a basis character string;

the performing the mask query calculation on the first visual feature, to obtain the third visual feature comprises:

obtaining, based on feature prediction calculation of the second query vector and the first visual feature, a feature vector corresponding to an occurrence probability of the first visual feature in the second query vector; and

performing vector combination on the feature vector corresponding to the first visual feature, to obtain the third visual feature.

5. The method according to claim 1 , wherein the dividing the at least two sub-sample images into the first training set and the second training set comprises:

dividing the at least two sub-sample images into the first training set and the second training set by using a mask setting strategy.

6. A character recognition apparatus comprising:

at least one processor; and

a memory communicatively connected to the at least one processor; wherein,

the memory stores an instruction executable by the at least one processor, and the instruction is executed by the at least one processor to cause the at least one processor to perform the method according to claim 1 .

7. A non-transitory computer-readable storage medium storing a computer instruction, wherein the computer instruction is used to cause a computer to perform the method according to claim 1 .

8. A character recognition model training method comprising:

partitioning a synthetic sample into at least two sub-synthetic images, wherein the synthetic sample comprises a synthetic text tag;

dividing the at least two sub-synthetic images as a first synthetic set and a second synthetic set; wherein the first synthetic set comprises a first sub-synthetic image with a visible attribute, and the second synthetic set comprises a second sub-synthetic image with an invisible attribute; and

performing, based on the first synthetic set and the second synthetic set, supervised training on a to-be-trained decoder to obtain a target decoder corresponding to the to-be-trained decoder;

wherein the performing, based on the first synthetic set and the second synthetic set, the supervised training on the to-be-trained decoder to obtain the target decoder corresponding to the to-be-trained decoder comprises:

extracting, based on a target encoder, a first feature sequence of the first sub-synthetic image in the first synthetic set; wherein the target encoder is obtained by performing following steps:

partitioning an untagged training sample into at least two sub-sample images;

dividing the at least two sub-sample images into a first training set and a second training set; wherein the first training set comprises a first sub-sample image with a visible attribute, and the second training set comprises a second sub-sample image with an invisible attribute; and

performing self-supervised training on a to-be-trained encoder by taking the second training set as a tag of the first training set, to obtain the target encoder;

performing feature completion on the first feature sequence according to an image position, in the synthetic sample, of the second sub-synthetic image in the second synthetic set, to obtain a second feature sequence; and

training, by taking that a predictive text of the second feature sequence predicted by the to-be-trained decoder is the same as a synthetic text of the second sub-synthetic image in the synthetic text tag as a training objective, to obtain the target decoder corresponding to the to-be-trained decoder.

9. The method according to claim 8 , wherein the training, by taking that the predictive text of the second feature sequence predicted by the to-be-trained decoder is same as the synthetic text of the second sub-synthetic image in the synthetic text tag as the training objective, to obtain the target decoder corresponding to the to-be-trained decoder comprises:

initializing the to-be-trained decoder to obtain a second decoder;

determining the predictive text of the second feature sequence based on the second decoder;

performing text error calculation by using the predictive text and the synthetic text of the second sub-synthetic image in the synthetic text tag, to obtain a decoding error; and

updating the second decoder according to the decoding error until the decoding error satisfies a third error condition, and determining a latest obtained second decoder as the target decoder.

10. The method according to claim 9 , wherein the determining the predictive text of the second feature sequence based on the second decoder comprises:

acquiring, based on the second sub-synthetic image, a third query vector stored in a token form;

inputting the third query vector and the second feature sequence into the second decoder, to obtain a second decoded feature; and

obtaining the predictive text of the second feature sequence based on text recognition processing on the second decoded feature.

11. The method according to claim 10 , wherein the acquiring, based on the second sub-synthetic image, the third query vector stored in the token form comprises:

extracting a feature of the second sub-synthetic image; and

transforming, based on a token-generating algorithm, the feature of the second sub-synthetic image into the token form, to obtain the third query vector.

12. The method according to claim 8 , wherein the performing the feature completion on the first feature sequence according to the image position, in the synthetic sample, of the second sub-synthetic image in the second synthetic set, to obtain the second feature sequence comprises:

determining, according to the image position of the second sub-synthetic image in the synthetic sample, a sequence position of the second sub-synthetic image in a synthetic sequence corresponding to the synthetic sample; and

inserting a completion vector in the sequence position in the first feature sequence, to obtain the second feature sequence.

13. The method according to claim 8 , wherein the dividing the at least two sub-synthetic images as the first synthetic set and the second synthetic set comprises:

dividing, based on a mask synthesis strategy, the at least two sub-synthetic images as the first synthetic set and the second synthetic set; wherein the mask synthesis strategy comprises mask data generated based on a preset second mask ratio.

14. A character recognition apparatus comprising:

at least one processor; and

a memory communicatively connected to the at least one processor; wherein,

the memory stores an instruction executable by the at least one processor, and the instruction is executed by the at least one processor to cause the at least one processor to perform the method according to claim 8 .

15. A non-transitory computer-readable storage medium storing a computer instruction, wherein the computer instruction is used to cause a computer to perform the method according to claim 8 .

16. A character recognition method comprising:

determining a target encoder and a target decoder; wherein the target encoder is obtained by performing following steps:

partitioning an untagged training sample into at least two sub-sample images;

dividing the at least two sub-sample images into a first training set and a second training set; wherein the first training set comprises a first sub-sample image with a visible attribute, and the second training set comprises a second sub-sample image with an invisible attribute; and

performing self-supervised training on a to-be-trained encoder by taking the second training set as a tag of the first training set, to obtain the target encoder;

wherein the target decoder is obtained by performing following steps:

partitioning a synthetic sample into at least two sub-synthetic images, wherein the synthetic sample comprises a synthetic text tag;

dividing the at least two sub-synthetic images as a first synthetic set and a second synthetic set; wherein the first synthetic set comprises a first sub-synthetic image with a visible attribute, and the second synthetic set comprises a second sub-synthetic image with an invisible attribute; and

performing, based on the first synthetic set and the second synthetic set, supervised training on a to-be-trained decoder to obtain the target decoder corresponding to the to-be-trained decoder;

partitioning a to-be-recognized image into at least two sub-images;

extracting image features of the sub-images based on the target encoder, to obtain the image features corresponding to the at least two sub-images respectively;

performing, based on the target decoder and at least two query vectors, decoding calculation on the image features corresponding to the at least two sub-images respectively, to obtain a decoded feature sequence corresponding to the at least two sub-images; and

obtaining a target text of the to-be-recognized image according to the decoded feature sequence.

17. A character recognition apparatus comprising:

at least one processor; and

a memory communicatively connected to the at least one processor; wherein,

the memory stores an instruction executable by the at least one processor, and the instruction is executed by the at least one processor to cause the at least one processor to perform the method according to claim 16 .

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 14, 2023
From: LV, PENGYUAN; ZHANG, CHENGQUAN; LIU, SHANSHAN; QIAO, MEINA; XU, YANGLIU; WU, LIANG; WANG, XIAOYAN; YAO, KUN; HAN, JUNYU; DING, ERRUI; WANG, JINGDONG; WU, TIAN; WANG, HAIFENG
To: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
Reel/Frame 062690/0861 →
Priority Claims (1)
CN 202210983230.9 · Aug 16, 2022 · national
Continuity (1)
Related Publication 20230215203A1 · Jul 6, 2023
References Cited (42)
US 20200020098A1 · Odry · 2020 [cited by examiner]
US 20200372225A1 · Xu et al. · 2020 [cited by applicant]
US 20210150757A1 · Mustikovela · 2021 [cited by examiner]
US 20210232773A1 · Wang · 2021 [cited by examiner]
US 20220300735A1 · Kelly · 2022 [cited by examiner]
CN 105325003A · 2016 [cited by applicant]
CN 112529150A · 2021 [cited by applicant]
CN 113657399A · 2021 [cited by applicant]
CN 114418069A · 2022 [cited by applicant]
CN 114445812A · 2022 [cited by applicant]
CN 114445831A · 2022 [cited by applicant]
CN 114462489A · 2022 [cited by applicant]
CN 114495102A · 2022 [cited by applicant]
CN 114529904A · 2022 [cited by examiner]
CN 114549904A · 2022 [cited by examiner]
CN 114565751A · 2022 [cited by examiner]
CN 114596566A · 2022 [cited by examiner]
CN 114724133A · 2022 [cited by applicant]
CN 114821045A · 2022 [cited by applicant]
CN 115511969A · 2022 [cited by examiner]
EP 3598339A1 · 2020 [cited by applicant]
Lin et al., Sketch-BERT: Learning Sketch Bidirectional Encoder Representation from Transformers by Self-supervised Learning of Sketch Gestalt, May 19, 2020 [retrieved Mar. 13, 2025], Cornell University:arXiv, version [v… [cited by examiner]
Gong et al., Pay Better Attention to Attention: Head Selection in Multilingual and Multi-Domain Sequence Modeling, Jun. 21, 2021 [ retrived Mar. 10, 2025], Cornell University:arXiv, version [v1], 15 pages. https://doi.o… [cited by examiner]
Suzuki,Clustering as Attention: Unified Image Segmentation with Hierarchical Clustering, Oct. 11, 2022 [retrieved Mar. 10, 2025], version [v3], 16 pages. https://doi.org/10.48550/arXiv.2205.099449 (Year: 2022). [cited by examiner]
Zhang, Using Structural Regularities for a Procedural Reconstruction of Urban Environments From Satellite Imagery [dissertation], May 2022 [retrieved Mar. 13, 2025], Purdue University, 155 pages. (Year: 2022). [cited by examiner]
Coquenet, Towards End-to-end Handwritten Document Recognition, Oct. 20, 2022 [retrieved Mar. 13, 2025], Cornell University: arXiv, version [v2], pp. 183. (Year: 2022). [cited by examiner]
Google Translate machine translation of CN 114565751 A to Cao, OCR Recognition Model Training Method, OCR Recognition Method And Related Device, translated Mar. 10, 2025, 24 pages. (Year: 2025). [cited by examiner]
Search machine translation of CN 113592769 A to Zhou, Image Processing And Data Rendering Method, Device And Medium, translated Mar. 10, 2025, 44 pages. (Year: 2025). [cited by examiner]
Search machine translation of CN 114596566 A to Jiang, Method And Related Device Recognition Text, translated Mar. 5, 2025, 28 pages. (Year: 2025). [cited by examiner]
Search machine translation of CN 114529904 A to Wang et al., Scene Text Recognition System Based On Consistency Regular Training, translated Mar. 5, 2025, 7 pages. (Year: 2025). [cited by examiner]
Search machine translation of CN 114549904 A to Guo et al., Visual Processing And Model Training Method, Device, Storage Medium And Program Product, translated Mar. 13, 2025, 19 pages. (Year: 2025). [cited by examiner]
Dong et al., Multi-Fact Correction in Abstractive Text Summarization, Oct. 6, 2020 [retrieved Jul. 25, 2025], Cornell University: arXiv, version [v1], 12 pages. https://doi.org/10.48550/arXiv.2010.02443 (Year: 2020). [cited by examiner]
Fang et al., ABINet++: Autonomous, Bidirectional and Iterative Language Modeling for Scene Text Spotting, Nov. 23, 2022 (first instance of public dissemination) [retrieved Jul. 25, 2025], IEEE Transactions on Pattern An… [cited by examiner]
[item V continued] DOI: 10.1109/TPAMI.2022.3223908 (Year: 2022). [cited by examiner]
Fan et al., Reconstruction-Aware Prior Distillation for Semi-supervised Point Cloud Completion, Apr. 21, 2022 [retrieved Jul. 25, 2025], Cornell University: arXiv, version [v2], 14 pages. https://doi.org/10.48550/arXiv.… [cited by examiner]
Notice of Reasons for Refusal of corresponding Japanese Application No. 2023-025380, dated Dec. 19, 2023, 10 pages. [cited by applicant]
Lyu et al., “MaskOCR: Text Recognition with Masked Encoder-Decoder Pretraining”, Jun. 1, 2022, 13 pages. [cited by applicant]
Office Action of corresponding Chinese Application No. 202210983230.9, dated Mar. 10, 2023, 8 pages. [cited by applicant]
Appalaraju et al., “DocFormer: End-to-End Transformer for Document Understanding”, dated Sep. 20, 2021, 22 pages. [cited by applicant]
Notice of registration of corresponding Chinese Application No. 202210983230.9, dated May 25, 2023, 11 pages. [cited by applicant]
Yuxuan Li, “Research on Automatic Generation of Weibo Short Text Based on User Intention”, Master Thesis, Inner Mongolia University of Science and Technology, dated Jun. 5, 2021, 63 pages. [cited by applicant]
Cheng Peng, “Soft sensor of industrial data based on pre-training”, Master's degree thesis, Zhejiang University, dated Mar. 2022, 77 pages. [cited by applicant]
Cited By (1)
US 12,731,381