Multimodal Side-Tuning for Document Classification

Stefano Pio Zingaro, Giuseppe Lisanti, Maurizio Gabbrielli · DOI

TL;DR

This paper adapts the "side-tuning" network adaptation framework to multimodal document classification, combining both visual layout and textual content. By training lightweight side networks alongside a frozen, pre-trained base model, the authors achieve state-of-the-art accuracy while completely avoiding catastrophic forgetting. The resulting architecture delivers competitive performance with a fraction of the parameters of traditional heavy deep learning models.

What Problem Does This Paper Address?

Document classification—sorting scanned papers into categories like "memo," "scientific report," or "resume"—is a massive operational bottleneck for industries like banking and administration. To do this accurately, algorithms must look at both the visual layout (images) and the actual words (text).

While deep learning has advanced this field, standard transfer learning approaches suffer from two major flaws:

  1. Catastrophic Forgetting: When a network pre-trained on a massive dataset (like ImageNet) is fine-tuned on a new task, it often abruptly loses its previously acquired general knowledge.
  2. Model Rigidity: Fine-tuning can be overly restrictive, making it difficult to gracefully integrate entirely new modalities (like switching from pure image processing to a mix of text and images).

Existing multimodal solutions often resort to training massive, resource-greedy networks from scratch or simply concatenating features, which can be computationally prohibitive for real-time applications.

Methods

The authors tackle these challenges by extending side-tuning—a technique originally designed for single-modality network adaptation—into a multimodal framework.

Instead of updating the weights of a pre-trained base model, side-tuning keeps the base model completely frozen. To adapt to the new task, a separate, lightweight "side network" is trained, and its outputs are fused with the base model's outputs.

Figure 1: Multimodal side-tuning classifier for hybrid text and image classification. Base model (a) and side model (b) reflects the same MobileNetV2 architecture, while (c) is a CNN inspired from sequence text classification task. The final merge architecture combines the output of the three networks into one new encoding as shown in (d).

As shown in Figure 1, the proposed architecture uses a tandem of networks:

  • Base Model (a): A frozen image classification network (MobileNetV2 or ResNet50) pre-trained on ImageNet.
  • Side Model 1 (b): An identical image network, but with unlocked, trainable weights to learn document-specific visual layouts.
  • Side Model 2 (c): A 1D Convolutional Neural Network (CNN) trained from scratch to handle textual features extracted via Optical Character Recognition (OCR) and embedded using FastText.

The final representation $R(x)$ is a linear combination of the three network encodings, controlled by alpha coefficients ($\alpha_0, \alpha_1, \alpha_2$) that sum to 1: $$R(x) = \alpha_0 B(x) + \alpha_1 S_1(x) + \alpha_2 S_2(x)$$

An adaptation layer is used to ensure the text network's output dimension matches the image networks' dimensions before they are combined and fed into the final classification layer.

Datasets

The framework was evaluated on two widely recognized public benchmarks:

  • Tobacco3482: A smaller dataset containing 3,482 greyscale document scans across 10 unevenly distributed categories. The text counterpart used was QS-OCR-Small.
  • RVL-CDIP: A large-scale dataset consisting of 399,828 images across 16 categories. The text counterpart used was QS-OCR-Large.

For both datasets, text versions were generated using the Tesseract OCR engine.

Key Insights and Ideas

  • Modality Blending via Coefficients: The alpha coefficients act as a dial. By adjusting them, the network can seamlessly shift from pure image feature extraction ($\alpha_0=1$) to image fine-tuning ($\alpha_1=1$) or text-only classification ($\alpha_2=1$).
  • Text-Centric Bias Boosts Accuracy: The authors observed that as the alpha configuration shifts to favor textual features ($\alpha_2 \ge 0.4$), classification accuracy steadily improves. This highlights that while layout is important, text content is often the deciding factor for ambiguous documents.
  • OCR Noise as Regularization: Rather than meticulously cleaning the OCR text, the authors left punctuation, digits, and OCR artifacts intact. This "noise" effectively acted as a regularization factor, preventing the text network from overfitting.

Key Results

The multimodal side-tuning approach demonstrated significant performance gains over single-modality baselines and competitive results against massive state-of-the-art models.

On the Tobacco3482 dataset, the multimodal side-tuning model achieved an overall accuracy of 90.5%, noticeably outperforming text-only and image fine-tuning baselines.

Table 1: Baseline models and multimodal overall accuracy for Tobacco3482 using Mo- bileNetV2 (visual features) and 1D CNN (textual features) architectures. Best result in bold.

On the massive RVL-CDIP dataset, the method achieved 92.2% accuracy using MobileNetV2 (~12M parameters) and 92.7% using ResNet50 (~57M parameters). This is remarkably close to the top-performing VGG16 + ULMFit model (93.6%), but that model requires a staggering 162M parameters.

In terms of processing speed, the entire GPU inference process takes about 1.2 seconds per document. Crucially, the deep learning model's forward pass takes a mere 28 milliseconds; the vast majority of the time (74.3%) is consumed by the Tesseract OCR engine extracting text.

Limitations and Future Work

The primary limitation of the current work is that the alpha coefficients ($\alpha_i$) must be tuned manually via grid search to find the optimal balance for a given dataset.

As a next step, the authors plan to investigate methods for automatically tuning these coefficients during the training process. Additionally, they aim to explore the integration of an ensemble of different text embeddings to further improve text-level comprehension.

Summary updated

Abstract

In this paper, we propose to exploit the side-tuning framework for multimodal document classification. Side-tuning is a methodology for network adaptation recently introduced to solve some of the problems related to previous approaches. Thanks to this technique it is actually possible to overcome model rigidity and catastrophic forgetting of transfer learning by fine-tuning. The proposed solution uses off-the-shelf deep learning architectures leveraging the side-tuning framework to combine a base model with a tandem of two side networks. We show that side-tuning can be successfully employed also when different data sources are considered, e.g. text and images in document classification. The experimental results show that this approach pushes further the limit for document classification accuracy with respect to the state of the art.
BibTeX
@inproceedings{zingaro2020multimodal,
  author = {Stefano Pio Zingaro and Giuseppe Lisanti and Maurizio Gabbrielli},
  title = {{Multimodal Side-Tuning for Document Classification}},
  booktitle = {ICPR},
  year = {2020},
}
Figure