DocEnTr
A vision transformer encoder-decoder that reconstructs clean document images from degraded ones.
Documents and OCR · 350 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Documents and OCR
- Parameters
- 68.5M
- Operations
- 350
- Framework
- PyTorch
- Recurrent
- No
- Published
- ICPR 2022
- Cited by
- 74 (as of 28 October 2026)
- Authors
- Mohamed Ali Souibgui, Sanket Biswas, Sana Khamekhem Jemni and others
- Source
- GitHub: dali92002/DocEnTR
- License
- CC-BY-NC-4.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m16175
- Graph hash
- df170d7a7b31b8d06dc7faec0aafc435c1759558fe03d5503b651add47100b7a
- Skeleton hash
- 46ec80118a2c6819fe4197db8ce42ba7869fb31a4c3872035a38edf53fac60d4
- Architecture hash
- ed283a9625bb0e7163a5dc50b8ef568623acd615423f7a34f1f13f6bc3206aad
- Diagram SHA-256
- 2e0fd4460b0c6b1acb874bee1b25465b8bccd0f0d13b2822a7372352313bd534
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
DocEnTr cleans up degraded document images, machine-printed and handwritten alike, with an encoder-decoder built from vision transformers. The encoder works directly on pixel patches and their positions with no convolutional layers, and the decoder reconstructs a clean image from the encoded patches.
The input image is split into patches, which are linearly embedded and given position information before a standard Transformer encoder turns them into latent representations. A second Transformer acts as the decoder, and its output is linearly projected to the pixels of each output patch. Training uses a mean squared error loss between the model's output and the patches of the ground truth clean image.
The paper defines Small, Base and Large variants and lists Base with 12 layers, dimension 768 and 8 attention heads, reporting 68M parameters for it. On the DIBCO 2017 dataset the authors found that a larger model gave better results in all metrics at a higher computational cost, and they recommend the Base model for binarization.
Key idea. The paper presents an encoder-decoder built from vision transformers that enhances degraded document images end to end, with no convolutional layers in the encoder.
- DocEnTr
- document enhancement transformer
- document image enhancement
- document binarization
- document denoising
- degraded documents
- DIBCO
- vision transformer
- handwritten documents
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{souibgui2022docentrendtoenddocumentimage,
title={DocEnTr: An End-to-End Document Image Enhancement Transformer},
author={Mohamed Ali Souibgui and Sanket Biswas and Sana Khamekhem Jemni and Yousri Kessentini and Alicia Fornés and Josep Lladós and Umapada Pal},
year={2022},
eprint={2201.10252},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2201.10252},
}