Manuscript Offprint
arXiv:2610.34879LayoutMamba: Efficient Document Layout Analysis with Hybrid Mamba-Transformer Networks
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Document layout analysis (DLA) suffers from a long-standing dilemma: existing methods either capture rich local details at the cost of prohibitive computational overhead (e.g., Transformer-based approaches with quadratic complexity) or achieve efficient global modeling but sacrifice fine-grained structural awareness (e.g., state-space models). This fundamental trade-off has severely hindered the deployment of DLA systems in real-world, resource-constrained scenarios. To fundamentally resolve this conflict, we present LayoutMamba, a pioneering hybrid framework that synergistically combines the strengths of sparse-attention Transformers for localized feature extraction ( complexity) and the recurrent state-space mechanism of Mamba for dilution-free, long-range dependency modeling across the 2D document canvas. Our key insight is a two-stage paradigm: first, a lightweight Transformer encoder hierarchically distills salient local semantics; second, Mamba's state-space model propagates global contextual dependencies without attention dilution, enabling precise, efficient, and scalable layout understanding. Furthermore, we identify and address a critical yet overlooked issue in existing DLA benchmarks: the inherent low-overlap distribution bias of layout objects, which we mitigate through our novel Geometric Overlap Penalty Loss (GOPLoss), a dual-optimization objective that simultaneously minimizes redundant bounding box overlaps and encourages geometrically consistent predictions. Extensive experiments on two challenging benchmarks, PubLayNet and , demonstrate that LayoutMamba not only surpasses the state-of-the-art AP on PubLayNet with fewer parameters, but also maintains leading performance on , ranking top-3 among all published methods, achieving an unprecedented balance between accuracy, efficiency, and scalability. Our work pioneers a new cognition-inspired paradigm for document analysis, making substantial strides towards practical deployment in edge computing and resource-limited environments.
1 Introduction
The automated understanding of visually rich documents represents a pivotal challenge in artificial intelligence, underpinning digital transformation initiatives across diverse sectors. Documents, unlike natural images, possess a complex structure characterized by high-frequency textual details, graphical elements like tables and figures, and critical semantic information encoded within their spatial layout. Document Layout Analysis (DLA), the task of segmenting a document image into distinct semantic regions (e.g., paragraphs, tables, figures), serves as a fundamental prerequisite for downstream tasks such as information extraction and document retrieval. However, the vast heterogeneity in document types (from structured forms to research papers and invoices), intricate layouts, and variable scan quality pose significant hurdles.
Early endeavors in Document Layout Analysis (DLA) predominantly relied on conventional computer vision techniques, leveraging Convolutional Neural Network (CNN) architectures (LeCun et al., 1998; Ren et al., 2015; Liu et al., 2016; He et al., 2016; Oliveira & Viana, 2017; Chen et al., 2017; Huang et al., 2017; Hu et al., 2018; Redmon & Farhadi, 2018) to extract visual features, where layout elements were treated as objects to be detected or segmented. While this series of CNN-based methods, through continuous refinements, has achieved an excellent trade-off between accuracy and inference speed, they inherently suffer from a critical limitation: their propensity towards local feature extraction makes it arduous to directly capture long-range global contextual information, which is crucial for understanding complex document layouts. To mitigate this shortcoming, researchers in the document analysis community have subsequently introduced Transformer-based architectures, notably the Vision Transformer (ViT) paradigm (Gupta et al., 2021; Huang et al., 2022; Da et al., 2023; Chai et al., 2023; Shehzadi et al., 2023; Gu et al., 2023; Wang et al., 2024b; Shehzadi et al., 2024), capitalizing on the powerful global modeling capability of self-attention mechanisms. These Transformer-based models have showcased remarkable potential in various computer vision applications. For instance, DiT (Li et al., 2022a) has demonstrated the effectiveness of large-scale unsupervised pre-training in the context of document visual self-supervised learning, while VGT (Da et al., 2023) proposed a Vision Grid Transformer to enhance layout representation learning through a more structured, grid-like modeling of visual dependencies. Despite their superior modeling capabilities, these Transformer-based approaches are fundamentally constrained by the intrinsic quadratic computational complexity of self-attention (scaling with the square of the number of image patches or text tokens), which imposes a severe scalability bottleneck when processing high-resolution documents or text-dense layouts commonly encountered in real-world scenarios. Although techniques such as key-value caching (KV caching) can optimize computations for previously processed tokens to reduce inference latency, the quadratic complexity persists during both the training phase and when handling new inputs, remaining a core limitation. More recent efforts (Fang et al., 2022; Ullah et al., 2023; Li et al., 2022b) have thus begun to rethink the architectural paradigm, pivoting towards designing hybrid structures that synergistically combine the strengths of CNNs and Transformers while alleviating the complexity overhead. Very recently, State Space Models (SSMs) (Gu & Dao, 2023; Liu et al., 2024; Zhu et al., 2024b), and particularly the newly proposed Mamba architecture, have unveiled immense potential in this regard. By virtue of their ability to model long-range dependencies with linear or near-linear computational complexity, SSMs/Mamba offer a fresh, highly promising perspective for surmounting the aforementioned challenges.
Motivated by the complementary virtues of Transformer architectures in learning rich, nuanced feature representations and Mamba's unparalleled efficiency in modeling long-range dependencies, we formulate a central hypothesis that drives this work: a carefully crafted hybrid model, synergistically integrating the self-attention mechanism of Transformers with the state-space modeling prowess of Mamba, can yield a substantially more potent yet computationally efficient framework for Document Layout Analysis (DLA). To this end, we propose DocuMambaFormer, a novel hybrid network architecture that judiciously combines the architectural strengths of both paradigms in a non-trivial manner. Our key insight is that Mamba blocks, with their inherent ability to model long-range spatial interactions through linear state-space transformations, are ideally suited for capturing the global structural coherence across document layouts—effectively discerning relationships between spatially distant elements (e.g., headers, footers, and body text regions) without incurring the quadratic complexity overhead of self-attention. Conversely, we posit that Transformer blocks retain a unique advantage in fine-grained local feature refinement and intricate cross-modal fusion (e.g., integrating visual cues from layout structures with textual semantics), where their dense, token-level attention interactions prove indispensable. This deliberate division of labor fosters a symbiotic relationship between the two modules, potentially unlocking superior modeling capabilities for complex, multi-entity document layouts while simultaneously mitigating the notorious computational bottlenecks associated with pure Transformer-based models.
To rigorously validate the efficacy of our proposed hybrid architecture, we conduct comprehensive experiments on not only well-established but also particularly challenging DLA benchmarks, chosen for their diversity and representativeness. Specifically, we evaluate our model on the widely adopted PubLayNet dataset (Zhong et al., 2019), which primarily comprises scientific articles with relatively standardized layouts, and more critically, on the recently introduced (Da et al., 2023), a significantly more demanding benchmark explicitly designed to overcome the homogeneity and simplicity limitations of prior datasets. encompasses a remarkably diverse set of 12 distinct document types (ranging from academic papers and financial reports to magazines and patents) and 27 fine-grained layout categories, thereby offering a far more realistic and challenging testbed for evaluating the generalizability and robustness of DLA models. Our empirical results compellingly demonstrate that LayoutMamba consistently sets a new state-of-the-art performance on both PubLayNet and , with particularly pronounced gains observed on the more complex and heterogeneous benchmark. These findings strongly corroborate our central hypothesis, affirming the substantial benefits of integrating State Space Model (SSM) principles into traditional Transformer-dominated document layout analysis frameworks.
The principal contributions of this work are succinctly summarized as follows:
-
We introduce LayoutMamba, the hybrid Transformer-Mamba architecture specifically tailored for document analysis tasks, which achieves a remarkable parameter-performance Pareto improvement: our model not only matches the accuracy of prior state-of-the-art Transformer-based methods but does so with a substantial 30% reduction in model parameters. This pioneering work effectively opens up an alternative, more efficient paradigm to the long-standing Transformer-dominated landscape in document understanding.
-
We propose a novel Geometric Overlap Penalty (GOP) loss function, meticulously designed for document object detection scenarios, which explicitly imposes geometric constraints to minimize bounding box overlaps through an innovative combination of Intersection-over-Union (IoU) regularization and spatial repulsion terms. Our ablation studies confirm that GOP loss consistently yields more precise layout element localization and better overall detection accuracy.
-
Through extensive experiments on two major, highly representative benchmarks, we demonstrate that our method not only establishes new state-of-the-art results in document layout analysis but also achieves a remarkable parameter compression compared to competitive Transformer-based baselines, thereby validating the efficiency and effectiveness of our hybrid Mamba-Transformer design.
Recently, Mamba-YOLO (Wang et al., 2024c) has been proposed as the first approach to integrate State Space Models (SSMs) into object detection frameworks, effectively mitigating the computational burden imposed by the quadratic complexity of self-attention mechanisms. Beyond merely optimizing the core of the SSM, this work introduces task-specific adaptations to leverage the strengths of YOLO for object detection. In particular, the incorporation of the LSBlock and RGBBlock modules enables more precise capture of local dependencies within images, thereby significantly enhancing the model's robustness. However, the challenge of effectively fusing global and local feature representations, while preserving efficiency to further boost detection performance—remains an open question in the field.
In the visual domain, state space models (SSMs) (Gu & Dao, 2023) have been explored for their linear complexity with respect to input size, addressing the computational inefficiencies faced by Transformers in long sequence state space modeling. Vision Mamba (Zhu et al., 2024a) introduced a pure visual backbone network model based on selective state space models, incorporating cross-scan modules to enable 2D selective scanning of images, thus enhancing visual processing capabilities while maintaining linear complexity without sacrificing global receptive fields. MambaVision (Hatamizadeh & Kautz, 2024) utilized a hierarchical architecture, fusing Mamba and Transformer modules in the final two stages, replacing causal convolutions with regular convolutions and adding a symmetric branch. Inspired by these advancements, we propose the LayoutMamba architecture, which synergistically integrates Mamba and Transformer modules. Our approach emphasizes efficient inference and enhances global receptive field effects for document analysis, demonstrating significant potential in improving the accuracy and efficiency of layout recognition tasks.
3 Methodology
3.1 Preliminary: SSMs and Mamba
The classical State Space Model (SSM) defines a linear time-invariant dynamical system that processes sequential data by maintaining a latent state representation. Given an input sequence , the model updates a hidden state to capture temporal dependencies and produces an output . The standard formulation is given as:
where is the state matrix, and represent the input and output projection matrix, respectively.
Despite its efficiency and strong inductive bias, the linear nature of classical SSMs limits their capacity to model complex, long-range dependencies inherent in real-world sequences. To address this, Mamba (Gu & Dao, 2023) introduces an enhanced formulation known as the input-dependent selective state space model (S6), which significantly improves the expressiveness of SSMs by incorporating nonlinearity, discretization, and adaptive temporal dynamics.
Specifically, S6 augments the conventional SSM with a learnable time-step parameter and employs a zero-order hold (ZOH) mechanism to discretize the continuous dynamics. This enables the model to perform input-conditioned selective scanning, dynamically modulating the state update path based on the current input. Such design introduces input-adaptive recurrence and nonlinearity into the state evolution, thereby enhancing the model's ability to capture both local and global contextual dependencies across varying temporal resolutions.
3.2 The Overview of the LayoutMamba
In this section, we introduce the Vision Residual State-Space Block (VRSSBlock), the core building module of our proposed architecture. As illustrated in Fig. 1, the VRSSBlock seamlessly integrates the strengths of structured state space models (SSMs) for efficient long-range dependency modeling, residual learning for stabilized deep network training, and gated MLP variants for enhanced feature transformation. This synergistic design enables VRSSBlock to capture both global spatial contexts and local channel-wise nuances, achieving superior representation power at a competitive computational cost.
The overall workflow of VRSSBlock can be decoupled into three successive stages: (i) Dimensionality Alignment and Projection, (ii) Global Spatial Information Aggregation via SS2D, and (iii) Channel-wise Feature Refinement through Residual Gated Block. Mathematically, given an input feature tensor from the -th layer, the VRSSBlock transforms it into an enriched representation through the following pipeline.
Stage 1: Dimensionality Alignment and Projection. To facilitate a unified feature space for subsequent transformations, we first employ a projection convolution module to map the input into a higher-dimensional space , where is the hidden dimension, typically for simplicity, but can be adjusted for model scaling. This stage is formulated as:
where denotes the nonlinear SiLU activation function (Ramachandran et al., 2017), and is a convolution with learnable weights to adjust the channel dimension from to . The BatchNorm layer ensures stabilized feature distributions, mitigating internal covariate shift. This projection step is crucial as it preconditions the feature space for the more complex transformations to follow.
In parallel, to preserve the original input information and facilitate residual learning (He et al., 2016), we introduce a shortcut connection that optionally adapts the channel dimension of via:
Here, is another convolution to align the channel dimension from to , ensuring that the residual addition is well-defined. This design echoes the philosophy of ResNet and its variants (Xie et al., 2016; Liu et al., 2022), where the identity mapping serves as a gradient highway, significantly easing the optimization of deep networks.
Stage 2: Global Spatial Information Aggregation via SS2D. Following the feature projection, the intermediate representation is fed into a Local Spatial Block (LSBlock) for preliminary spatial context aggregation:
The LSBlock, similar to the local feature enhancers used in (Liu et al., 2022), aims to capture short-to-medium range spatial dependencies. Subsequently, we apply Layer Normalization to stabilize the feature distribution, followed by the core SS2D module (Liu et al., 2024; Gu & Dao, 2023), for efficient long-range spatial modeling:
The SS2D operator is the cornerstone of our global context modeling, which leverages structured state space models (SSMs) to efficiently process 2D inputs. SS2D comprises three key steps:
Scan Expansion: The input feature map is systematically decomposed into multiple 1D sequences along four symmetric directions (top-down, bottom-up, left-right, right-left), effectively capturing spatial anisotropies.
S6 Block: Each sequence is processed by a state space model parameterized by matrices , , , and , discretizing the continuous SSM dynamics:
(8) where and are discretization results with step size .
Scan Merge: The directional sequences are re-assembled, aggregating global information into . The output of SS2D is then combined with the LSBlock output via a residual connection, enhanced by DropPath for regularization:
This formulation ensures that the network retains the original feature representation while injecting global spatial awareness.
Stage 3: Channel-wise Feature Refinement via Residual Gated Block. Building upon the gated MLP designs introduced in (Wang et al., 2024c), we employ the Residual Gated (RG) Block to enhance feature expressiveness in our model. The RG Block operates on as follows:
Internally, the RG Block splits the normalized input into two branches: and , responsible for local and global feature modulation, respectively. The local branch undergoes a depthwise convolution-based Position Encoding Module (PEM), formulated as:
where is the GELU activation function, denotes depthwise separable convolution, and represents element-wise addition. Meanwhile, the global branch is transformed via a linear layer :
The gated fusion mechanism then combines these branches:
where denotes element-wise multiplication. Finally, another linear layer projects the fused representation, and a residual connection is added:
This gating mechanism selectively amplifies salient features while suppressing less informative ones, enriching the channel-wise contextual understanding.
Final Residual Aggregation. The ultimate output of VRSSBlock is obtained by merging the RG Block output with the initial shortcut connection :
This outer residual connection closes the loop, ensuring that VRSSBlock learns residual refinements rather than complete transformations, drastically improving trainability and generalization.

Figure 1: Comprehensive overview of the proposed efficient document layout analysis framework leveraging hybrid Mamba-Transformer architectures.
3.3 Multi-Head Attention
To further enhance the representational capacity of our VRSS Block outputs, we employ a standard multi-head attention mechanism formulated as:
where denote the query, key, and value projections, is the number of attention heads, is the dimension of each head, is the batch size, and is the sequence length.
This attention operation allows the model to dynamically aggregate information across the sequence dimension, facilitating more expressive feature representations. The multi-head outputs are subsequently concatenated and linearly projected to yield the final output.
3.4 Geometric Overlap Penalty Loss
In traditional object detection tasks, scenarios involving dense prediction boxes are commonly observed (Li et al., 2017; Ling et al., 2023; Yang et al., 2019a; Zhou et al., 2019). This phenomenon similarly exists in document layout analysis tasks, yet datasets in this domain exhibit unique characteristics: although containing numerous densely arranged bounding boxes, they rarely present inter-box overlaps. This distinctive property stems from the nature of document data, as such overlaps would generally correspond to content superposition that substantially impairs document readability. Given this property, this study proposes Geometric Overlap Penalty Loss (GOPLoss) that explicitly penalizes the degree of overlap between predicted boxes. The mathematical formulation of GOPLoss is defined as:
where denotes the total number of predicted boxes, represents the -th predicted box, and calculates the intersection over union between two boxes. This loss function normalizes the sum of IoU values across all box pairs using as the denominator, aiming to eliminate scale variations caused by different numbers of predictions and enable the model to focus on relative overlap degrees rather than absolute quantities.
Regarding computational efficiency, while the algorithm complexity is , the practical computation overhead remains negligible due to the typically small number of surviving predictions after Non-Maximum Suppression (NMS) (Felzenszwalb et al., 2009).
It should be noted that GOPLoss functions as an unsupervised regularization term that operates independently of ground truth labels. Therefore, it must be incorporated as an auxiliary component within the total loss function. This study adopts a multi-task weighted optimization strategy, with the composite loss function defined as:
where , with , denote the weights of the loss, , , and correspond to bounding box regression loss, category classification loss, and Distribution Focal Loss respectively, while denotes the geometric overlap penalty loss. Through this weighted configuration, the model simultaneously optimizes fundamental detection objectives while explicitly constraining spatial independence among predictions, thereby adapting to the low-overlap characteristics inherent in document layout analysis tasks.
4 Experiments
4.1 Dataset
PubLayNet is a document layout analysis dataset from IBM, comprising 360K PDF documents from PubMed XML files. It annotates five layout categories (text, title, list, figure, table) with bounding boxes. The dataset contains 335,703 training, 11,245 validation, and 11,405 test images. We train on the training set and report results on the validation set.
(Da et al., 2023), from Alibaba, is designed for real-world document layout analysis. It encompasses 12 document types and 27 fine-grained layout categories (DocTitle, ListText, LetterHead, Question, RegionList, TableName, FigureName, etc.), with 8,868 training and 2,224 validation images. The dataset features documents with skewness, blur, and diverse layout structures, making it more challenging than PubLayNet for evaluating model robustness.
Table 1: Document Layout Detection mAP @ IoU [0.50:0.95] on PubLayNet validation set.
| Models | Year | #Param | Text | Title | List | Table | Figure | mAP |
|---|---|---|---|---|---|---|---|---|
| VSR (Zhang et al., 2021) | 2021 | - | 0.967 | 0.931 | 0.947 | 0.974 | 0.964 | 0.957 |
| TRDLU (Yang & Hsu, 2022) | 2022 | - | 0.958 | 0.921 | 0.975 | 0.976 | 0.966 | 0.959 |
| DiT-L (Li et al., 2022a) | 2022 | 304M | 0.944 | 0.893 | 0.960 | 0.978 | 0.972 | 0.949 |
| UDoc (Gu et al., 2023) | 2022 | 272M | 0.939 | 0.885 | 0.937 | 0.973 | 0.964 | 0.939 |
| VGT (Da et al., 2023) | 2023 | 174M | 0.950 | 0.939 | 0.968 | 0.981 | 0.971 | 0.962 |
| DETR (Shehzadi et al., 2023) | 2023 | - | 0.947 | 0.918 | 0.964 | 0.981 | 0.975 | 0.957 |
| DoPTA-HR (SR et al., 2024) | 2024 | 85M | 0.944 | 0.895 | 0.957 | 0.977 | 0.970 | 0.949 |
| LayoutMamba-T | 2025 | 6.9M | 0.955 | 0.883 | 0.961 | 0.985 | 0.983 | 0.953 |
| LayoutMamba-B | 2025 | 22M | 0.953 | 0.902 | 0.963 | 0.986 | 0.984 | 0.957 |
| LayoutMamba-L | 2025 | 67M | 0.957 | 0.934 | 0.965 | 0.985 | 0.985 | 0.963 |
4.2 Implementation Details
Model Architecture & Fine-tuning. Our LayoutMamba model utilizes the previously described Mamba-Transformer hybrid backbone for feature extraction, synergistically combining the linear-complexity advantages of Mamba with the dense attention capabilities of Transformer. To effectively integrate multi-scale features, we adopt the PAFPN (Path Aggregation Feature Pyramid Network) (Liu et al., 2018) as our neck module, which facilitates direct interaction between non-adjacent feature levels through progressive fusion of adjacent stage features. This design choice is motivated by PAFPN's proven efficacy in enhancing object detection performance through richer feature representations.
Optimization Strategy. For model optimization, we employ the SGD optimizer with a linear warmup strategy for the first 3 epochs (initial learning rate of 0.1), followed by training at a learning rate of 0.01. On PubLayNet, we train LayoutMamba for 300 epochs with a batch size of 128 distributed across NVIDIA A100 GPUs, leveraging data parallelism to accelerate training. Given the relatively smaller scale of , we train our model for 300 epochs on a single A100 GPU with a batch size of 16, keeping all other training hyperparameters identical to those used for PubLayNet. This consistency ensures a fair comparison across datasets.
4.3 Comparison to Existing Approaches
We conducted extensive experiments on PubLayNet, comparing LayoutMamba with state-of-the-art vision Transformer backbones for document layout analysis, as summarized in Table 1, where LayoutMamba achieves significant improvements, particularly in challenging categories such as “list,” “table,” and “figure.” LayoutMamba-T attains a comparable mAP of 95.1 to the larger DoPTA-HR model while reducing parameters from 85M to 6.9M, and LayoutMamba-L achieves a state-of-the-art mAP of 96.3, highlighting the effectiveness of our hybrid architecture. On the more challenging dataset (Table 2), characterized by diverse real-world scenarios, finer-grained categories, and data imbalance leading to lower mAP scores, LayoutMamba shows strong resilience; LayoutMamba-T outperforms LayoutLMv3-Base by 5.8% mAP despite the latter having nearly more parameters, and achieves state-of-the-art results in key categories including DocTitle (88.2% AP), Paratext (85.1% AP), and RegionKV (84.5% AP).
4.4 Ablation Studies
To rigorously validate the architectural efficacy and design rationale of our proposed framework, we conduct a series of systematic ablation experiments on the challenging document layout detection task, utilizing the validation set. Our investigation centers on two pivotal components that underpin the superior
Table 2: Document Layout Detection mAP @ IoU [0.50:0.95] on validation set.
| Models | #Param | DocTitle | ListText | LetterHead | Question | RegionList | TableName | FigureName | Footer | Number |
|---|---|---|---|---|---|---|---|---|---|---|
| DiT-B (Li et al., 2022a) | 87M | 73.1 | 70.6 | 82.2 | 55.0 | 80.1 | 68.4 | 51.8 | 81.2 | 83.2 |
| LayoutLMv3-Base (Huang et al., 2022) | 133M | 66.8 | 56.5 | 78.5 | 39.3 | 72.1 | 64.3 | 32.1 | 72.2 | 82.1 |
| VGT (Da et al., 2023) | 174M | 72.6 | 71.3 | 82.3 | 63.9 | 80.2 | 68.4 | 46.6 | 79.7 | 83.2 |
| DoPTA-HR (SR et al., 2024) | 85M | 73.11 | 72.46 | 82.07 | 77.42 | 79.32 | 67.08 | 56.86 | 77.88 | 83.15 |
| LayoutMamba-T | 6.9M | 74.2 | 69.5 | 85.3 | 68.8 | 82.1 | 61.7 | 49.5 | 77.2 | 81.4 |
| LayoutMamba-B | 22M | 74.6 | 72 | 83.9 | 64.9 | 82.4 | 65.2 | 52 | 78.5 | 81.5 |
| LayoutMamba-L | 67M | 75.4 | 73.9 | 83.9 | 67.7 | 82.7 | 65.3 | 50 | 79.6 | 82.4 |
| Models | #Param | ParaTitle | RegionTitle | LetterDear | OtherText | Abstract | Table | Equation | PageHeader | Catalog |
|---|---|---|---|---|---|---|---|---|---|---|
| DiT-B (Li et al., 2022a) | 87M | 63.2 | 67.5 | 74.5 | 59.2 | 73.8 | 86.2 | 9.2 | 56.5 | 44.8 |
| LayoutLMv3-Base (Huang et al., 2022) | 133M | 55.6 | 59.5 | 70.8 | 50.8 | 68.2 | 80.6 | 7.3 | 53.1 | 37.3 |
| VGT (Da et al., 2023) | 174M | 63.0 | 67.2 | 76.7 | 60.0 | 80.4 | 86.0 | 19.9 | 56.9 | 40.9 |
| DoPTA-HR (SR et al., 2024) | 85M | 64.07 | 65.17 | 72.7 | 61.25 | 78.25 | 86.9 | 32.26 | 58.22 | 60.98 |
| LayoutMamba-T | 6.9M | 61.2 | 65.6 | 70.5 | 57.1 | 75.4 | 87.6 | 9.32 | 55.3 | 32.2 |
| LayoutMamba-B | 22M | 62.6 | 67.4 | 72.4 | 58.4 | 74.9 | 86.9 | 26.1 | 57.2 | 35.3 |
| LayoutMamba-L | 67M | 64.1 | 66.5 | 71.1 | 59.5 | 74.8 | 89.9 | 25.9 | 51.9 | 38.9 |
| Models | #Param | ParaText | Date | LetterSign | RegionKV | Author | Figure | Reference | PageFooter | PageNumber | mAP |
|---|---|---|---|---|---|---|---|---|---|---|---|
| DiT-B (Li et al., 2022a) | 87M | 86.4 | 69.7 | 71.6 | 68.8 | 66.0 | 77.2 | 83.4 | 65.5 | 58.3 | 67.7 |
| LayoutLMv3-Base (Huang et al., 2022) | 133M | 81.6 | 62.5 | 60.4 | 59.4 | 59.3 | 72.2 | 74.9 | 62.1 | 52.8 | 60.5 |
| VGT (Da et al., 2023) | 174M | 86.2 | 71.3 | 75.5 | 70.1 | 67.6 | 76.7 | 85.6 | 66.5 | 58.7 | 68.8 |
| DoPTA-HR (SR et al., 2024) | 85M | 85.75 | 71.4 | 76.31 | 70.3 | 70.66 | 75.73 | 84.45 | 65.82 | 60.64 | 70.72 |
| LayoutMamba-T | 6.9M | 87.8 | 64.7 | 71.3 | 68.2 | 63.5 | 75.4 | 85.6 | 61.3 | 48.7 | 66.3 |
| LayoutMamba-B | 22M | 88.5 | 68.5 | 70.6 | 70.7 | 64.1 | 76.1 | 85 | 62.1 | 52.1 | 67.9 |
| LayoutMamba-L | 67M | 89.1 | 71.3 | 72.2 | 71.2 | 65.6 | 76.4 | 86.7 | 62.9 | 54.6 | 69.4 |
Table 3: Document Layout Detection mAP @ IoU [0.50:0.95] on validation set with different GOPLoss weight.
| GOPLoss Weight | 0.0 | 1.0 | 3.0 | 5.0 | 7.5 |
|---|---|---|---|---|---|
| mAP | 57.9 | 58.2 | 58.2 | 58.4 | 57.6 |
performance of our model: (1) the evolutionary advancements in the state-space block, where our novel Vision Residual State-Space Block (VRSSBlock) extends the foundational VSSBlock design with strategic architectural refinements, and (2) the synergistic integration of multi-head attention, which further amplifies the model's contextual reasoning capabilities.
Our reference baseline employs the original VSSBlock paradigm, leveraging a structured state space module for long-range dependency modeling and lightweight local convolutions for fine-grained feature extraction. As quantitatively summarized in Table 4, this baseline configuration comprises 5.8M parameters and achieves a mean Average Precision (mAP) of 60.7% at stringent IoU thresholds [0.50,0.95], establishing a competitive yet improvable foundation for subsequent ablative analysis.
Impact of VRSSBlock Evolution. The VRSSBlock refines the VSSBlock architecture by integrating residual learning, gated MLP modules, and a novel SS2D operator, leading to enhanced feature transformation. More specifically, the VRSSBlock fuses a dedicated projection module, a global spatial information aggregator that leverages structured state space models, and a residual gated block for channel-wise refinement. When we replace VSSBlock with VRSSBlock (without adding multi-head attention), the parameter count increases modestly to 6.2M, but we observe a performance gain of approximately 0.5% mAP (from 60.7% to 61.2%). This improvement demonstrates that the architectural evolution embedded in VRSSBlock contributes to more effective spatial and contextual feature modeling.
Impact of Multi-Head Attention. To further bolster the model's representational prowess, we strategically integrate a canonical multi-head attention module downstream of the VRSSBlock output. Here, query
Table 4: Document Layout Detection mAP @ IoU [0.50:0.95] on validation set.
| VRSSBlock | Attention | #Param | mAP |
|---|---|---|---|
| 5.8 | 60.7 | ||
| ✓ | 6.2 | 61.2 | |
| ✓ | ✓ | 6.9 | 63.3 |

(a) Model with

(b) Model with
Figure 2: Visual comparison of detection results under different GOPLoss weights.
(Q), key (K), and value (V) projections are dynamically derived from the VRSSBlock-processed features, enabling adaptive recalibration across spatial and channel dimensions. This attentive contextualization augments global receptive field modeling by disambiguating salient regions via learned attention weights and harmonizing local and global feature hierarchies. The combined VRSSBlock + Attention configuration incurs a further parameter growth to 6.9M (+9.7% vs. VRSSBlock-only), yet yields a decisive performance leap of +2.1% mAP (from 61.2% to 63.3%). This super-additive gain underscores that attention synergizes with VRSSBlock's structured state space modeling, creating an irreducible performance ceiling that neither component could attain in isolation.
Geometric Overlap Penalty Loss. To systematically evaluate the impact of GOPLoss weight on the performance of the document layout analysis model, we designed a set of experiments on the benchmark dataset. Based on the trade-off between training efficiency and computational cost, the experiment set the training period to 100 epochs. We selected GOPLoss weights for a systematic ablation study, aiming to explore the optimal weight configuration and its regulatory mechanism on the detection performance of different layout categories.
The experimental results are shown in Table 3. They indicate that GOPLoss can effectively enhance the model's ability to model complex layouts through geometric constraint optimization. However, fine-tuned weight adjustment is required to achieve a multi-objective optimization balance. When , the model achieves the optimal overall performance (mAP = 58.4), which is 0.5 percentage points higher than the baseline model ( , mAP = 57.9), verifying the promoting effect of moderate geometric constraints on global detection performance. However, when increases to 7.5, the mAP significantly drops to 57.6. It is speculated that excessive geometric regularization causes the model to deviate from the optimization direction of the basic detection task. This phenomenon reveals that there is a critical threshold for GOPLoss weight. Beyond this threshold, competitive suppression will occur between geometric constraints and semantic feature learning.
To delve deeper into the optimization mechanism of the GOPLoss, a visual comparative analysis was conducted on the models with and (as shown in Fig. 2). The experimental results revealed that upon the introduction of GOPLoss, the overlap of target boxes within dense text regions diminished. This phenomenon suggests that geometric constraints effectively mitigated the redundant prediction issue of adjacent detection boxes. Concurrently, the number of detection boxes generated by the model decreased, which is advantageous for enhancing the inference speed. This outcome can be ascribed to the model's adaptive suppression of low-confidence redundant predictions.
5 Conclusion
We propose a hybrid architecture combining Vision Transformers and State Space Models (Mamba) for Document Layout Analysis (DLA). Our approach uses sparse attention for local feature extraction and Mamba's linear complexity for global context modeling, achieving state-of-the-art results on PubLayNet and benchmarks with fewer parameters. We introduce a Geometric Overlap Penalty Loss to address low-overlap bias in layout predictions. Our method demonstrates Mamba's potential for efficient multimodal document understanding.
References
Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European conference on computer vision, pp. 213–229. Springer, 2020.
Shang Chai, Liansheng Zhuang, and Fengying Yan. Layoutdm: Transformer-based diffusion model for layout generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 18349–18358, 2023.
Kai Chen, Mathias Seuret, Jean Hennebert, and Rolf Ingold. Convolutional neural networks for page segmentation of historical document images. In 2017 14th IAPR International Conference on Document Analysis and Recognition (ICDAR), volume 1, pp. 965–970. IEEE, 2017.
Cheng Da, Chuwei Luo, Qi Zheng, and Cong Yao. Vision grid transformer for document layout analysis. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 19462–19472, 2023.
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
Jinsheng Fang, Hanjiang Lin, Xinyu Chen, and Kun Zeng. A hybrid network of cnn and transformer for lightweight image super-resolution. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 1103–1112, 2022.
Pedro F Felzenszwalb, Ross B Girshick, David McAllester, and Deva Ramanan. Object detection with discriminatively trained part-based models. IEEE transactions on pattern analysis and machine intelligence, 32(9):1627–1645, 2009.
Albert Gu and Tri Dao. Mamba: Linear-time sequence modeling with selective state spaces. arXiv preprint arXiv:2312.00752, 2023.
Jiuxiang Gu, Ani Nenkova Nenkova, Nikolaos Barmpalios, Vlad Ion Morariu, Tong Sun, Rajiv Bhawanji Jain, Jason Wen Yong Kuen, and Handong Zhao. Unified pretraining framework for document understanding, May 18 2023. US Patent App. 17/528,061.
Kamal Gupta, Justin Lazarow, Alessandro Achille, Larry S Davis, Vijay Mahadevan, and Abhinav Shrivastava. Layouttransformer: Layout generation and completion with self-attention. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1004–1014, 2021.
Ali Hatamizadeh and Jan Kautz. Mambavision: A hybrid mamba-transformer vision backbone. ArXiv, abs/2407.08083, 2024. URL https://api.semanticscholar.org/CorpusID:271097462.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7132–7141, 2018.
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4700–4708, 2017.
Yupan Huang, Tengchao Lv, Lei Cui, Yutong Lu, and Furu Wei. Layoutlmv3: Pre-training for document ai with unified text and image masking. In Proceedings of the 30th ACM international conference on multimedia, pp. 4083–4091, 2022.
Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
Jianan Li, Xiaodan Liang, ShengMei Shen, Tingfa Xu, Jiashi Feng, and Shuicheng Yan. Scale-aware fast r-cnn for pedestrian detection. IEEE transactions on Multimedia, 20(4):985–996, 2017.
Junlong Li, Yiheng Xu, Tengchao Lv, Lei Cui, Cha Zhang, and Furu Wei. Dit: Self-supervised pre-training for document image transformer. In Proceedings of the 30th ACM international conference on multimedia, pp. 3530–3539, 2022a.
Yanyu Li, Geng Yuan, Yang Wen, Ju Hu, Georgios Evangelidis, Sergey Tulyakov, Yanzhi Wang, and Jian Ren. Efficientformer: Vision transformers at mobilenet speed. Advances in Neural Information Processing Systems, 35:12934–12949, 2022b.
Qin Ling, Nor Ashidi Mat Isa, and Mohd Shahrimie Mohd Asaari. Precise detection for dense pcb components based on modified yolov8. IEEE Access, 11:116545–116560, 2023.
Shu Liu, Lu Qi, Haifang Qin, Jianping Shi, and Jiaya Jia. Path aggregation network for instance segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8759–8768, 2018.
Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11–14, 2016, Proceedings, Part I 14, pp. 21–37. Springer, 2016.
Yue Liu, Yunjie Tian, Yuzhong Zhao, Hongtian Yu, Lingxi Xie, Yaowei Wang, Qixiang Ye, Jianbin Jiao, and Yunfan Liu. Vmamba: Visual state space model. Advances in neural information processing systems, 37:103031–103063, 2024.
Zhuang Liu, Hanzi Mao, Chaozheng Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 11966–11976, 2022. URL https://api.semanticscholar.org/CorpusID:245837420.
Dario Augusto Borges Oliveira and Matheus Palhares Viana. Fast cnn-based document layout analysis. In 2017 IEEE International Conference on Computer Vision Workshops (ICCVW), pp. 1173–1180. IEEE, 2017.
Prajit Ramachandran, Barret Zoph, and Quoc V. Le. Swish: a self-gated activation function. arXiv: Neural and Evolutionary Computing, 2017. URL https://api.semanticscholar.org/CorpusID:196158220.
Joseph Redmon and Ali Farhadi. Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018.
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. Advances in neural information processing systems, 28, 2015.
Tahira Shehzadi, Khurram Azeem Hashmi, Didier Stricker, Marcus Liwicki, and Muhammad Zeshan Afzal. Bridging the performance gap between detr and r-cnn for graphical object detection in document images. arXiv preprint arXiv:2306.13526, 2023.
Tahira Shehzadi, Didier Stricker, and Muhammad Zeshan Afzal. A hybrid approach for document layout analysis in document images. In International Conference on Document Analysis and Recognition, pp. 21–39. Springer, 2024.
Nikitha SR, Tarun Ram Menta, and Mausoom Sarkar. Dopta: Improving document layout analysis using patch-text alignment. arXiv preprint arXiv:2412.12902, 2024.
Waseem Ullah, Tanveer Hussain, Fath U Min Ullah, Mi Young Lee, and Sung Wook Baik. Transcnn: Hybrid cnn and transformer mechanism for surveillance anomaly detection. Engineering Applications of Artificial Intelligence, 123:106173, 2023.
Ao Wang, Hui Chen, Lihao Liu, Kai Chen, Zijia Lin, Jungong Han, et al. Yolov10: Real-time end-to-end object detection. Advances in Neural Information Processing Systems, 37:107984–108011, 2024a.
Chien-Yao Wang, Alexey Bochkovskiy, and Hong-Yuan Mark Liao. Yolov7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 7464–7475, 2023.
Jiawei Wang, Kai Hu, and Qiang Huo. Dlaformer: An end-to-end transformer for document layout analysis. In International Conference on Document Analysis and Recognition, pp. 40–57. Springer, 2024b.
Zeyu Wang, Chen Li, Huiying Xu, Xinzhong Zhu, and Hongbo Li. Mamba yolo: A simple baseline for object detection with state space model, 2024c. URL https://arxiv.org/abs/2406.05835.
Saining Xie, Ross B. Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 5987–5995, 2016. URL https://api.semanticscholar.org/CorpusID:8485068.
Huichen Yang and William Hsu. Transformer-based approach for document layout understanding. In 2022 IEEE International Conference on Image Processing (ICIP), pp. 4043–4047. IEEE, 2022.
Xue Yang, Jirui Yang, Junchi Yan, Yue Zhang, Tengfei Zhang, Zhi Guo, Xian Sun, and Kun Fu. Scrdet: Towards more robust detection for small, cluttered and rotated objects. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 8232–8241, 2019a.
Ze Yang, Shaohui Liu, Han Hu, Liwei Wang, and Stephen Lin. Reppoints: Point set representation for object detection. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9657–9666, 2019b.
Peng Zhang, Can Li, Liang Qiao, Zhanzhan Cheng, Shiliang Pu, Yi Niu, and Fei Wu. Vsr: a unified framework for document layout analysis combining vision, semantics and relations. In Document Analysis and Recognition–ICDAR 2021: 16th International Conference, Lausanne, Switzerland, September 5–10, 2021, Proceedings, Part I 16, pp. 115–130. Springer, 2021.
Xu Zhong, Jianbin Tang, and Antonio Jimeno Yepes. Publaynet: largest dataset ever for document layout analysis. In 2019 International conference on document analysis and recognition (ICDAR), pp. 1015–1022. IEEE, 2019.
Xingyi Zhou, Dequan Wang, and Philipp Krähenbühl. Objects as points. arXiv preprint arXiv:1904.07850, 2019.
Lianghui Zhu, Bencheng Liao, Qian Zhang, Xinlong Wang, Wenyu Liu, and Xinggang Wang. Vision mamba: Efficient visual representation learning with bidirectional state space model. ArXiv, abs/2401.09417, 2024a. URL https://api.semanticscholar.org/CorpusID:267028142.
Lianghui Zhu, Bencheng Liao, Qian Zhang, Xinlong Wang, Wenyu Liu, and Xinggang Wang. Vision mamba: Efficient visual representation learning with bidirectional state space model, 2024b. URL https://arxiv.org/abs/2401.09417.