IP Library Granted Patent US 12,437,571
Granted Patent B2
US 12,437,571 · App. 17/077,568 · Granted Oct 7, 2025

Document information extraction without additional annotations

Inventors: Shachar Klaiman (Heidelberg, DE); Marius Lehne (Berlin, DE)
Assignee: SAP SE
G06V30/414G06F18/217G06F18/251G06N3/045G06N3/08G06V30/10
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,437,571
App. No.
17/077,568
Granted
Oct 7, 2025
Kind
B2
Abstract

Disclosed herein are system, method, and computer program product embodiments for document information extraction without additional annotations. An embodiment operates by receiving an input representing a document and a key. The embodiment processes the input using a convolutional neural network to obtain a feature map. The embodiment combines the feature map with positional information to obtain a spatial-aware feature map. The embodiment then repeatedly performs the following decoding process: generate attention weights, generate a context vector based on the spatial-aware feature map and the generated attention weights using an attention layer, process the context vector, the key, and an input vector using a recurrent neural network (RNN) to obtain a RNN state, and generate an output vector based on the RNN state and the context vector using a projection layer. The embodiment then extracts a field based on the result of the decoding process.

Claims (84)

1. A computer implemented method for extracting a field from a document, comprising:

receiving, by at least one processor, the document and a key, wherein the key specifies the field to extract from the document, the key is in textual format, the field is a plurality of characters, and the document is an image representing a plurality of fields;

processing, by a convolutional neural network (CNN) of an encoder, the document, thereby obtaining a feature map;

combining, by the encoder, the feature map with positional information for each feature in the feature map, thereby obtaining a spatial-aware feature map;

processing, using a recurrent neural network (RNN) of a decoder, the spatial-aware feature map and the key, thereby extracting the field in the document corresponding to the key, wherein the processing the spatial-aware feature map and the key comprises:

initializing, a first RNN state associated with the RNN of the decoder, a first set of attention weights for an attention layer, and a first output vector;

generating a second set of attention weights for the attention layer based on the spatial-aware feature map, the key, the first RNN state associated with the RNN, the first set of attention weights for the attention layer, and the first output vector;

generating a context vector based on the spatial-aware feature map and the second set of attention weights using the attention layer;

processing the context vector, the key, and an input vector using the RNN to obtain a second RNN state associated with the RNN;

generating a second output vector based on the second RNN state and the context vector using a projection layer;

storing the second output vector in a list of output vectors;

repeating, until the second output vector corresponds to an end token, the generating the second set of attention weights, the generating the context vector, the processing the context vector, the generating the second output vector, and the storing the second output vector with the second set of attention weights set to a value of the first set of attention weights, the second RNN state set to a value of the first RNN state, the second output vector set to a value of the first output vector, and the second output vector set to a value of the input vector; and

extracting only the field from the document based on the list of output vectors, wherein each output vector of the list of output vectors is derived from the key.

2. The method of claim 1 , further comprising:

generating the positional information for each feature in the feature map as a set of one-hot vectors.

3. The method of claim 1 , further comprising:

generating the positional information for each feature in the feature map as a set of scalar values.

4. The method of claim 1 , further comprising:

generating the positional information for each feature in the feature map as a fixed length vector, wherein the fixed length vector is generated by training the attention layer, the RNN, and the projection layer.

5. The method of claim 1 , wherein the attention layer is a sum-attention layer, and the RNN is a long short-term memory (LSTM).

6. The method of claim 1 , further comprising:

encoding, by the at least one processor, the key using a one-hot vector or a fixed length vector, wherein the fixed length vector is generated by training the attention layer, the RNN, and the projection layer.

7. The method of claim 1 , further comprising:

initializing a set of weights of the CNN with a set of weights of a pre-trained optical character recognition (OCR) model;

initializing the RNN and the projection layer with values sampled from a random distribution;

training the attention layer, the RNN, and the projection layer based on the set of weights of the CNN being fixed;

detecting an increase in performance of the attention layer, the RNN, and the projection layer above a threshold value; and

in response to the detecting, training the CNN, the attention layer, the RNN, and the projection layer until a loss on a validation set stops decreasing.

8. A system, comprising:

a memory; and

at least one processor coupled to the memory and configured to:

receive a document and a key, wherein the key specifies a field to extract from the document, the key is in textual format, the field is a plurality of characters, and the document is an image representing a plurality of fields;

process, by a convolutional neural network (CNN) of an encoder, the document, thereby obtaining a feature map;

combine, by the encoder, the feature map with positional information for each feature in the feature map, thereby obtaining a spatial-aware feature map;

process, using a recurrent neural network (RNN) of a decoder, the spatial-aware feature map and the key, thereby extracting the field in the document corresponding to the key, wherein the processing the spatial-aware feature map and the key comprises:

initializing a first RNN state associated with the RNN of the decoder, a first set of attention weights for an attention layer, and a first output vector;

generating a second set of attention weights for the attention layer based on the spatial-aware feature map, the key, the first RNN state associated with the RNN, the first set of attention weights for the attention layer, and the first output vector;

generating a context vector based on the spatial-aware feature map and the second set of attention weights using the attention layer;

processing the context vector, the key, and an input vector using the RNN to obtain a second RNN state associated with the RNN;

generating a second output vector based on the second RNN state and the context vector using a projection layer;

storing the second output vector in a list of output vectors;

repeating, until the second output vector corresponds to an end token, the generate the second set of attention weights, the generate the context vector, the process the context vector, the generate the second output vector, and the store the second output vector with the second set of attention weights set to a value of the first set of attention weights, the second RNN state set to a value of the first RNN state, the second output vector set to a value of the first output vector, and the second output vector set to a value of the input; and

extracting only the field from the document based on the list of output vectors, wherein each output vector of the list of output vectors is derived from the key.

9. The system of claim 8 , the at least one processor further configured to:

generate the positional information for each feature in the feature map as a set of one-hot vectors.

10. The system of claim 8 , the at least one processor further configured to:

generate the positional information for each feature in the feature map as a set of scalar values.

11. The system of claim 8 , the at least one processor further configured to:

generate the positional information for each feature in the feature map as a fixed length vector, wherein the fixed length vector is generated by training the attention layer, the RNN, and the projection layer.

12. The system of claim 8 , wherein the attention layer is a sum-attention layer, and the RNN is a long short-term memory (LSTM).

13. The system of claim 8 , the at least one processor further configured to:

encode the key using a one-hot vector or a fixed length vector, wherein the fixed length vector is generated by training the attention layer, the RNN, and the projection layer.

14. The system of claim 8 , the at least one processor further configured to:

initialize a set of weights of the CNN with a set of weights of a pre-trained optical character recognition (OCR) model;

initialize the RNN and the projection layer with values sampled from a random distribution;

train the attention layer, the RNN, and the projection layer based on the set of weights of the CNN being fixed;

detect an increase in performance of the attention layer, the RNN, and the projection layer above a threshold value; and

in response to detection of the increase in performance of the attention layer, train the CNN, the attention layer, the RNN, and the projection layer until a loss on a validation set stops decreasing.

15. A non-transitory computer-readable device having instructions stored thereon that, when executed by at least one computing device, cause the at least one computing device to perform operations comprising:

receiving a document and a key, wherein the key specifies a field to extract from the document, the key is in textual format, the field is a plurality of characters, and the document is an image representing a plurality of fields;

processing, by a convolutional neural network (CNN) of an encoder, the document, thereby obtaining a feature map;

combining, by the encoder, the feature map with positional information for each feature in the feature map, thereby obtaining a spatial-aware feature map;

processing, using a recurrent neural network (RNN) of a decoder, the spatial-aware feature map and the key, thereby extracting the field in the document corresponding to the key, wherein the processing the spatial-aware feature map and the key comprises:

initializing a first RNN state associated with the RNN of the decoder, a first set of attention weights for an attention layer, and a first output vector;

generating a second set of attention weights for the attention layer based on the spatial-aware feature map, the key, the first RNN state associated with the RNN, the first set of attention weights for the attention layer, and the first output vector;

generating a context vector based on the spatial-aware feature map and the second set of attention weights using the attention layer;

processing the context vector, the key, and an input vector using the RNN to obtain a second RNN state associated with the RNN;

generating a second output vector based on the second RNN state and the context vector using a projection layer;

storing the second output vector in a list of output vectors;

repeating, until the second output vector corresponds to an end token, the generating the second set of attention weights, the generating the context vector, the processing the context vector, the generating the second output vector, and the storing the second output vector with the second set of attention weights set to a value of the first set of attention weights, the second RNN state set to a value of the first RNN state, the second output vector set to a value of the first output vector, and the second output vector set to a value of the input vector; and

extracting only the field from the document based on the list of output vectors, wherein each output vector of the list of output vectors is derived from the key.

16. The non-transitory computer-readable device of claim 15 , the operations further comprising:

generating the positional information for each feature in the feature map as a set of one-hot vectors.

17. The non-transitory computer-readable device of claim 15 , the operations further comprising:

generating the positional information for each feature in the feature map as a set of scalar values.

18. The non-transitory computer-readable device of claim 15 , the operations further comprising:

generating the positional information for each feature in the feature map as a fixed length vector, wherein the fixed length vector is generated by training the attention layer, the RNN, and the projection layer.

19. The non-transitory computer-readable device of claim 15 , wherein the attention layer is a sum-attention layer, and the RNN is a long short-term memory (LSTM).

20. The non-transitory computer-readable device of claim 15 , the operations further comprising:

initializing a set of weights of the CNN with a set of weights of a pre-trained optical character recognition (OCR) model;

initializing the RNN and the projection layer with values sampled from a random distribution;

training the attention layer, the RNN, and the projection layer based on the set of weights of the CNN being fixed;

detecting an increase in performance of the attention layer, the RNN, and the projection layer above a threshold value; and

in response to the detecting, training the CNN, the attention layer, the RNN, and the projection layer until a loss on a validation set stops decreasing.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 22, 2020
From: KLAIMAN, SHACHAR; LEHNE, MARIUS
To: SAP SE
Reel/Frame 054142/0075 →
Continuity (1)
Related Publication 20220129671A1 · Apr 28, 2022
References Cited (19)
US 10671878B1 · Sarshogh · 2020 [cited by examiner]
US 11475688B2 · Enomoto · 2022 [cited by examiner]
US 11995908B2 · Kosaka · 2024 [cited by examiner]
Zuo, Ling-Qun, et al. “Natural scene text recognition based on encoder-decoder framework.” IEEE Access 7 (Year: 2019). [cited by examiner]
Shi, Baoguang, et al. “Aster: An attentional scene text recognizer with flexible rectification.” IEEE transactions on pattern analysis and machine intelligence 41.9 (Year: 2018). [cited by examiner]
Zhang P et al., TRIE: end-to-end text reading and information extraction for document understanding. In Proceedings of the 28th ACM International Conference on Multimedia Oct. 12 (Year: 2020). [cited by examiner]
Clément Sage et al., End-to-End Extraction of Structured Information from Business Documents with Pointer-Generator Networks. EMNLP 2020 Workshop on Structured Prediction for NLP, Nov. 2020, Punta Cana Dominican Republi… [cited by examiner]
Denk, Timo I., Supervisors Dr Christian Reisswig, and PD Dr Markus Reischl. “Wordgrid: Extending Chargrid with Word-level Information.” (Year: 2019). [cited by examiner]
Zuo, Ling-Oun, et al. “Natural scene text recognition based on encoder-decoder framework.” IEEE Access 7 (Year: 2019). [cited by examiner]
Shi, Baoguang, et al. “Aster: An attentional scene text recognizer with flexible rectification.” IEEE transactions on pattern analysis and machine intelligence 41.9 (Year: 2019). [cited by examiner]
Liu, Wei, et al., “SAFE: scale aware feature encoder for scene text recognition.” Computer Vision—ACCV 2018: 14th Asian Conference on Computer Vision, Perth, Australia, Dec. 2-6, 2018, Revised Selected Papers, Part II 1… [cited by examiner]
Wojna, Zbigniew, et al. “Attention-based extraction of structured information from street view imagery.” 2017 14th IAPR international conference on document analysis and recognition (ICDAR). vol. 1. IEEE (Year: 2017). [cited by examiner]
Bahdanau, D. et al., “Neural Machine Translation by Jointly Learning to Align and Translate,” Published as a conference paper at ICLR 2015, 15 pages, retrieved from https://arxiv.org/pdf/1409.0473.pdf, May 19, 2016. [cited by applicant]
Hochreiter, S. and Schmidhuber, J., “Long Short-Term Memory,” Neural Computation 9(8), pp. 1735-1780, 1997. [cited by applicant]
Katti, A. R. et al., “Chargrid: Towards Understanding 2D Documents,” Published as a conference paper at EMNLP 2018, 11 pages, retrieved from https://arxiv.org/pdf/1809.08799.pdf, Sep. 24, 2018. [cited by applicant]
Reisswig, C. et al., “Chargrid-OCR: End-to-end Trainable Optical Character Recognition for Printed Documents using Instance Segmentation,” 10 pages, retrieved from https://arxiv.org/pdf/1909.04469.pdf, Feb. 27, 2020. [cited by applicant]
Sutskever, I. et al., :“Sequence to Sequence Learning with Neural Networks,” Advances in Neural Information Processing Systems 27, 9 pages, 2014. [cited by applicant]
Vaswani, A. et al., “Attention Is All You Need,” 31st Conference on Neural Information Processing Systems (NIPS 2017), 11 pages, 2017. [cited by applicant]
Wojna, Z. et al., “Attention-based Extraction of Structured Information from Street View Imagery,” 14th IAPR International Conference on Document Analysis and Recognition (ICDAR), 7 pages, retrieved from https://arxiv.o… [cited by applicant]