ForCenNet: Foreground-Centric Document Rectification
- ForCenNet is a document rectification model that treats readable foreground elements as key geometric references to recover undistorted layouts.
- It utilizes a foreground-centric label generation method and a mask-guided transformer decoder to enhance structure preservation and mitigate background clutter.
- Incorporating a curvature consistency loss, the method preserves fine geometric details, yielding improved performance on benchmarks like DocUNet, DIR300, WarpDoc, and DocReal.
Searching arXiv for the specified papers and related terminology. Foreground-Centric Network (ForCenNet) is a document image rectification model that treats foreground elements as primary geometric evidence for recovering an undistorted document from a photographed, warped input. In its 2025 formulation, ForCenNet combines a foreground-centric label generation method, a foreground-centric mask mechanism, and a curvature consistency loss to estimate a backward mapping that removes geometric distortion. The model is reported to achieve new state-of-the-art on four real-world benchmarks—DocUNet, DIR300, WarpDoc, and DocReal—while explicitly targeting layout elements such as text lines and table borders rather than treating dewarping as a purely texture- or appearance-driven problem (Cai et al., 26 Jul 2025).
1. Definition and research context
ForCenNet is defined around the premise that foreground elements in document images provide “essential geometric references and layout information” for document image correction. In this setting, foreground does not denote only glyph interiors; the supplied formulation includes all readable regions, specifically “text, table lines, graphics,” and also extracts explicit line elements from OCR boxes and graphical line detectors for supervision (Cai et al., 26 Jul 2025).
The network’s focus distinguishes it from document rectification pipelines that regress deformation fields without an explicit mechanism for separating readable structure from background clutter. A common misconception is that ForCenNet is simply a generic transformer dewarper with an added segmentation branch. The reported design is stronger than that description: the predicted mask is converted into a soft foreground prior and injected into the decoder’s self-attention so that similarity inside the readable foreground is boosted during backward-map prediction (Cai et al., 26 Jul 2025).
Within the broader literature represented here, foreground-centric modeling predates the document-rectification instantiation. In video surveillance, the MV-FCN foreground inference network uses multi-view receptive fields and residual feature concatenation for pixel-wise FG region identification (Akilan, 2018). In unsupervised video object segmentation, F2Net is described as a “ForCenNet instantiation” in which a predicted object center acts as a spatial prior for appearance matching and dynamic fusion (Liu et al., 2020). This suggests a broader foreground-centric design pattern: foreground localization or emphasis is treated as an intermediate structural prior rather than only as a final segmentation output.
2. Synthetic supervision through foreground-centric label generation
ForCenNet addresses the cost of manual warping-field annotation by synthesizing training pairs from undistorted images in three stages. First, a character-level foreground/background segmentation step fine-tunes Hi-SAM to produce a binary mask from each undistorted image . The mask is specified to cover all readable regions (Cai et al., 26 Jul 2025).
Second, the pipeline extracts line elements. Text lines are obtained from OCR bounding boxes by taking their mid-lines as “text-line” elements. Table and other straight graphical lines are detected with Canny and LSD (Line Segment Detector), followed by filtering by slope and proximity. These operations define a set of line elements associated with the undistorted image (Cai et al., 26 Jul 2025).
Third, distortion fields are generated. Random backward mapping fields are drawn from DOC3D, and corresponding forward maps are derived. After slight cropping and random overlap-patch augmentation, is applied to
to produce the distorted image , the warped mask , and warped line elements . The training ground-truth is the original 0 (Cai et al., 26 Jul 2025).
This supervision strategy matters because the synthesized labels are not limited to a binary foreground mask. They include warped line structures whose geometry is later used by the curvature consistency loss. A plausible implication is that the method ties geometric correction more directly to document layout regularity than approaches trained only on dense warping targets.
3. Architecture and mask-guided rectification
ForCenNet consists of a convolutional stem, a transformer encoder, a foreground segmentation head, a mask-guided transformer decoder, and a lightweight upsampler for the final backward map. The distorted image 1 is processed by a convolutional stem with large-kernel and residual blocks, downsampling 2 to produce
3
A 3-layer Efficient Transformer encoder with overlapping patch embeddings and spatial-pooling window attention then yields multi-scale feature maps 4 (Cai et al., 26 Jul 2025).
The foreground segmentation module predicts a 2-channel logit map
5
supervised by
6
The logits are converted into a soft foreground mask through temperature-scaled softmax: 7 This 8 is then used to modulate decoder self-attention, while cross-attention to encoder features remains standard. The decoder is 3-layer, and each layer uses masked self-attention with 9 together with cross-attention to one of the encoder features 0. A lightweight upsampler refines the predicted backward map to full 1 resolution (Cai et al., 26 Jul 2025).
The architectural point is not merely multi-task learning. The mask is an internal control signal that biases token interactions toward readable structure. In that respect, ForCenNet is closer in spirit to explicitly foreground-guided models than to rectifiers that treat all pixels uniformly. F2Net provides an instructive parallel: it predicts an object center and uses a Gaussian spatial prior to re-weight dense correspondences before fusion, again making foreground emphasis part of the inference mechanism rather than only part of the output space (Liu et al., 2020).
4. Curvature consistency loss
ForCenNet introduces a curvature consistency loss to preserve geometric consistency on fine line elements such as table borders. Along each undistorted line 2, the method samples a sequence of control points
3
with the supplied description giving “e.g. one point every 4 pixels” (Cai et al., 26 Jul 2025).
Each control point is projected through both the predicted and ground-truth backward maps by bilinear interpolation over surrounding pixels: 4 For the resulting control sequence 5, derivatives are approximated by central differences, with forward/backward differences at endpoints, and the discrete curvature is computed as
6
where 7 prevents division by zero. The curvature consistency loss is then
8
This term compares the curvature induced by the predicted deformation with that induced by the ground-truth deformation on corresponding line elements (Cai et al., 26 Jul 2025).
Its role is narrower and more geometric than a generic smoothness prior. The reported target is fine structural fidelity, particularly on “detailed foreground labels” such as text lines and table borders. That focus is consistent with the qualitative claim that the method “effectively undistorts layout elements, such as text lines and table borders” (Cai et al., 26 Jul 2025).
5. Training protocol and benchmark performance
Two training variants are reported. ForCenNet (Dir+DocUNet) uses 365 undistorted images from DocUNet and DIR300. ForCenNet-DOC3D uses all undistorted images from DOC3D. In both cases, each undistorted image is paired with 1,000 random 9 samples, and the warped results are composited on random MS-COCO backgrounds to improve realism; cropping and random overlap further diversify deformations. All training crops are resized to 0 (Cai et al., 26 Jul 2025).
Optimization uses AdamW with decoupled weight decay, batch size 32 on 2×A100 GPUs, and a One-Cycle learning rate schedule with maximum learning rate 1, 10% warm-up, and 30 total epochs until convergence (Cai et al., 26 Jul 2025).
Evaluation is carried out on DocUNet, DIR300, WarpDoc, and DocReal using MS-SSIM, LD, AD, ED, and CER where reported.
| Benchmark | Reported ForCenNet result | Variant |
|---|---|---|
| DocUNet | MS-SSIM 0.582, LD 4.82, AD 0.19, ED 571.40, CER 0.136 | Dir+DocUNet |
| DIR300 | MS-SSIM 0.713, LD 4.65, AD 0.123, ED 390.61, CER 0.138 | ForCenNet |
| WarpDoc | MS-SSIM 0.54, LD 8.10, AD 0.18, ED 899.67 | ForCenNet |
| DocReal | MS-SSIM 0.595, LD 6.95, AD 0.17, ED 753.12 | ForCenNet |
For comparison, the DOC3D-trained variant reports on DocUNet: MS-SSIM 0.579, LD 4.91, AD 0.19, ED 592.37, CER 0.158; and on DIR300: 0.709, 4.73, 0.136, 449.12, 0.153 (Cai et al., 26 Jul 2025).
The reported interpretation is that ForCenNet achieves new state-of-the-art on the four real-world benchmarks and shows “best generalization” on DocReal. Since the cross-domain results are highlighted separately, a plausible implication is that the foreground-centric prior is intended not only to fit synthetic warp patterns but also to stabilize transfer to real photographed documents.
6. Qualitative behavior, ablations, limitations, and relation to prior foreground modeling
The qualitative analysis emphasizes layout regularity. Text-line regions are reported to show “straighter, more uniformly spaced lines,” while table borders and drawings exhibit “dramatically reduced curvature artifacts, recovering true orthogonality.” In addition, Tesseract recall of text and LDS line-detector recall both improve by more than 15% after dewarping (Cai et al., 26 Jul 2025).
The ablation studies isolate three components: dataset scale, the mask-guided decoder (MGD), and the curvature loss (CL). Increasing the number of deformation samples per image from 1 to 1,000 on 65 images raises MS-SSIM from 0.449 to 0.571, lowers LD from 10.75 to 4.95, and lowers CER from 0.291 to 0.141; beyond approximately 1,000 samples per image, returns diminish. For architectural supervision, the configuration with neither MGD nor CL reports MS-SSIM 0.530, LD 7.06, CER 0.198; only MGD gives 0.565, 5.10, 0.169; only CL gives 0.558, 5.44, 0.173; and both together give 0.571, 4.95, 0.141. Replacing the jointly trained mask head with a frozen external segmenter causes MS-SSIM to fall from 0.571 to 0.468 and CER to rise from 0.141 to 0.212 (Cai et al., 26 Jul 2025).
These results address another common misunderstanding: a foreground mask is not treated as an interchangeable preprocessing artifact. The reported degradation with a frozen external segmenter indicates that the paper’s formulation depends on a differentiable, jointly optimized segmentation signal rather than on a static mask source (Cai et al., 26 Jul 2025).
The stated limitations are also specific. Label-generation bias arises because incomplete sampling of 2 introduces minor SSIM/IoU offsets; a 40% sampling ratio is chosen to balance bias and cost. Rare fonts and extreme creases can still confuse the mask head and slightly degrade deformation estimation. Future directions include joint scan enhancement, extending foreground types to photographs and stamps, refining the transformer backbone for higher resolution, and exploring unsupervised adaptation to unseen deformation distributions (Cai et al., 26 Jul 2025).
In relation to earlier foreground-driven architectures, ForCenNet extends a theme already visible in other domains. MV-FCN for video surveillance uses multi-view receptive fields and residual feature connections to improve pixel-wise foreground identification when training samples are limited (Akilan, 2018). F2Net for unsupervised video object segmentation explicitly predicts a foreground center and uses it as a spatial guidance prior for inter-frame and intra-frame correspondence, then dynamically fuses semantic, intra-frame, and inter-frame streams (Liu et al., 2020). ForCenNet differs in task and mechanism, but it shares the central methodological claim that explicit modeling of foreground structure can materially improve dense prediction.