Abstract
Model interpretability and robustness are becoming increasingly critical today for the safe and practical deployment of deep learning (DL) models in industrial settings. As DL-backed automated document processing systems become increasingly common in business workflows, there is a pressing need today to enhance interpretability and robustness for the task of document image classification, an integral component of such systems. Surprisingly, while much research has been devoted to improving the performance of deep models for this task, little attention has been given to their interpretability and robustness. In this paper, we aim to improve upon both aspects and introduce DocXClassifier, an inherently interpretable deep document classifier that not only achieves significant performance improvements over existing approaches in image-based document classification, but also holds the capability to simultaneously generate feature importance maps while making its predictions. Our approach attains state-of-the-art performance in image-based classification on two popular document datasets, RVL-CDIP and Tobacco3482, with top-1 classification accuracies of 94.17% and 95.57%, respectively. Additionally, it sets a new record for the highest image-based classification accuracy on Tobacco3482 without transfer learning from RVL-CDIP, at 90.14%. In addition, our proposed training strategy demonstrates superior robustness compared to existing approaches, significantly outperforming them on 19 out of 21 different types of novel data distortions, while achieving comparable results on the remaining two. By combining robustness with interpretability, DocXClassifier presents a promising step towards the practical deployment of DL models for document classification tasks.
Introduction
Deep learning has revolutionized automated document processing, yet two major hurdles—opacity and fragility—hinder its deployment in high-stakes industrial environments. Most high-performing models operate as "black boxes," providing classifications without explaining the underlying logic. This lack of transparency makes diagnosing failures or biases difficult. Furthermore, while these models excel on clean datasets, they often fail when encountering real-world "out-of-distribution" data, such as blurry captures or scanned noise. DocXClassifier addresses these issues by introducing an inherently interpretable architecture that is significantly more resilient to data corruption.
Methodology
DocXClassifier is built upon the ConvNeXt architecture, integrating modern convolutional design with successes from Vision Transformers. The primary innovation is the Attention-Based Pooling mechanism, which replaces standard Global Average Pooling.
In this setup, a trainable "class token" interacts with the final feature map via scaled dot-product attention. This allows the model to spatially weigh the importance of different document regions during the forward pass. Consequently, the model generates faithful feature importance maps simultaneously with its predictions, providing "interpretability by design" without the need for computationally expensive post-hoc methods like Grad-CAM.
Robust Training Strategy
To enhance resilience against real-world distortions, a two-stage training strategy was employed using a suite of aggressive data augmentations:
- RandAugment: Applies random color, brightness, and geometric transformations.
- RandomErasing: Simulates occlusions by masking image parts.
- Mixup & CutMix: Blends or patches images from different classes to encourage generalized feature learning.
Experimental Results
The model was evaluated on the RVL-CDIP (400,000 images) and Tobacco3482 benchmarks. For robustness testing, "Distorted" variants (RVL-CDIP-D and Tobacco3482-D) featuring 21 types of novel distortions were used.
DocXClassifier-XL achieved state-of-the-art performance with 94.17% accuracy on RVL-CDIP and 95.57% on Tobacco3482. Notably, the model demonstrated superior robustness, outperforming existing methods on 19 out of 21 distortion types, particularly noise and blur. The "Base" variant maintains high efficiency, processing images in approximately 6.5 ms, making it viable for real-time industrial applications.
Discussion and Conclusion
A key finding of this work is that the perceived trade-off between robustness and accuracy is not absolute; the robust training recipe actually improved performance on clean benchmarks. While the model shows some sensitivity to extreme contrast changes and potential overfitting on smaller datasets in its largest configuration, its ability to provide smooth, logical explanations (e.g., highlighting headers or specific document sections) marks a significant step forward. DocXClassifier offers a robust, interpretable, and high-performance solution for practical document classification tasks.
Summary updated