TL;DR
This paper introduces GraphKD, a novel graph-based knowledge distillation framework for document object detection (DOD). GraphKD effectively transfers knowledge from large, complex teacher models to smaller, efficient student models by representing document structures as graphs, enabling deployment on resource-constrained devices.
What Problem Does This Paper Address?
Document object detection (DOD) is crucial for automating document understanding tasks, but state-of-the-art models are often computationally expensive and memory-intensive, making them unsuitable for edge devices. While knowledge distillation (KD) offers a solution by training smaller models to mimic larger ones, existing KD methods struggle with the complex spatial relationships and imbalanced distributions of objects in document images. Specifically, they often fail to capture fine-grained information or align features across different network architectures. This paper aims to bridge this gap by proposing a KD method that leverages structured graph representations to better capture document layouts and relationships, enabling efficient and accurate DOD on resource-limited platforms.
Methods
The core of GraphKD is a structured instance graph construction.
- Nodes: Each node represents a "Region of Interest" (RoI) pooled feature from proposals generated by a Region Proposal Network (RPN). These nodes are categorized as "text" or "non-text" based on feature covariance.
- Edges: Edges connect nodes and represent the similarity between instances in the embedding space, calculated using cosine similarity.
- Adaptive Node Sampling: To combat the "text bias" (where a large number of text elements can overwhelm the learning process), an adaptive sampling strategy is employed. This strategy prunes less informative text-associated edges and prioritizes non-text nodes.
- Graph Distillation Loss: The knowledge transfer is achieved through a graph distillation loss that comprises node and edge components. This loss uses Mahalanobis distance for edge-to-edge distillation to handle outliers and cosine similarity for node-to-node distillation.
- Heterogeneous Distillation: A key advantage is that GraphKD supports heterogeneous distillation, allowing knowledge transfer between models with different architectures (e.g., Transformers to CNNs), which is a significant limitation of many existing KD methods.
Datasets
The authors evaluated GraphKD on four benchmark datasets:
- PubLayNet: A large dataset for document layout analysis.
- PRIMA: A dataset for historical document analysis.
- Historical Japanese (HJ): Another dataset for historical documents.
- DoclayNet: A dataset for document layout segmentation.
Key Insights and Ideas
- Graph Representation for Document Structure: Representing document elements and their relationships as a graph is a powerful way to capture the complex spatial and hierarchical information inherent in document layouts, which is crucial for accurate object detection.
- Mitigating Text Bias: The proposed adaptive node sampling strategy is essential for overcoming the dominance of text elements in document images, allowing the model to focus on important non-textual objects.
- Heterogeneous Distillation is Achievable: GraphKD demonstrates that it's possible to effectively distill knowledge between vastly different network architectures (like Transformers and CNNs) by using a structured graph representation, overcoming a major hurdle in current KD research.
- Importance of Both Node and Edge Information: The study highlights that both the features of individual instances (nodes) and the relationships between them (edges) are critical for effective knowledge transfer in document object detection.
Key Results
- GraphKD achieves competitive results on benchmark datasets, often outperforming existing methods in terms of efficiency (fewer parameters) while maintaining high accuracy.
- For instance, on PubLayNet, GraphKD reduced model parameters by 323.5M compared to LayoutLMv3 while achieving a performance gap of only ~7% AP.
- The framework demonstrates strong performance in heterogeneous distillation scenarios, such as distilling from ResNet50 to MobileNetv2, outperforming larger models like LayoutLMv3 on specific classes.
- Ablation studies showed that incorporating edge information improved AP by ~3%, while focusing on non-text features increased AP by ~4%, and combining both yielded the best results.
Limitations and Future Work
- Transformer to CNN Distillation Challenges: While GraphKD supports heterogeneous distillation, the paper notes that distilling from Transformer backbones to CNNs (like ResNet) still presents a significant performance gap. This is attributed to feature misalignment between self-attention mechanisms in Transformers and convolutional layers in CNNs, making shared RPN and node indexing difficult.
- Transformer Integration: The authors acknowledge that they are unable to effectively incorporate Transformers as a backbone for cross-architecture distillation due to their different data handling mechanisms. This is identified as a future research direction.
- Performance Trade-off: While GraphKD significantly reduces model parameters, there's a performance trade-off compared to larger, state-of-the-art transformer-based models. The goal is to minimize this gap while maximizing efficiency.
Summary updated