Multichannel CNN with Attention for Text Classification

Zhenyu Liu, Haiwei Huang, Chaohong Lu, Shengfei LyuarXiv 2020

Abstract

This paper presents the Attention-based Multichannel Convolutional Neural Network (AMCNN), a hybrid deep learning architecture designed to integrate the sequential modeling capabilities of Recurrent Neural Networks (RNNs) with the local feature extraction strengths of Convolutional Neural Networks (CNNs). By introducing a novel dual-attention mechanism—incorporating both scalar and vectorial attention—the model generates multiple "channels" of text representations. This approach preserves word order and structural information while emphasizing salient features, leading to improved performance on standard sentiment and subjectivity classification benchmarks.

Introduction

In Natural Language Processing (NLP), researchers often face a trade-off between RNNs and CNNs. RNNs, such as LSTMs, excel at capturing long-term dependencies but can be biased toward the end of sequences and struggle with local n-gram extraction. Conversely, CNNs are adept at identifying local patterns through filters but are often limited by fixed filter widths and may miss broader global semantics. Furthermore, standard attention mechanisms typically collapse sequences into single weighted-sum vectors, discarding spatial information that CNNs could exploit. The AMCNN architecture bridges this gap by retaining the sequence's structural "shape" while highlighting its most critical components through multiple channels.

Methodology

The AMCNN architecture consists of four primary stages designed to create a robust, multichannel representation of text:

  1. Bi-directional LSTM Layer: Input text is processed in both forward and backward directions, ensuring each word representation incorporates global context from the entire sentence.
  2. Dual Attention Mechanism: The core innovation involves applying two types of attention to the Bi-LSTM outputs:
  3. Scalar Attention: Assigns weights to words based on their overall importance in the sentence.
  4. Vectorial Attention: Determines the relevance of specific dimensions within word embeddings, focusing on feature-level importance.
  5. Multichannel Generation: Instead of a single vector, the model produces multiple matrices (channels), each representing a different "view" of the sentence. This is analogous to RGB channels in image processing.
  6. CNN Layer: A standard CNN operates across these channels, extracting n-gram features from the attention-weighted matrices.
The overall architecture of the AMCNN model, illustrating the flow from Bi-LSTM to multichannel CNN.

Experimental Setup

The model was evaluated on five benchmark datasets: MR (movie reviews), Subj (subjectivity), MPQA (opinion polarity), SST-1 (fine-grained sentiment), and SST-2 (binary sentiment). These datasets cover a range of classification tasks to test the model's versatility.

Results and Discussion

The AMCNN model consistently outperformed traditional CNNs, LSTMs, and other hybrid models. A key finding was the optimal number of channels; the authors determined that AMCNN-3 (using 3 channels) generally provided the best balance between performance and complexity, as shown in the results table below.

Comparison of AMCNN performance against state-of-the-art baselines across five benchmark datasets.

On the MR dataset, AMCNN-3 achieved an accuracy of 82.57%, surpassing the standard multichannel CNN (81.1%). Visualization of the attention weights confirmed that different channels focus on distinct informative words, capturing diverse semantic perspectives of the same sentence. However, adding too many channels (e.g., 5 or 7) led to diminishing returns or overfitting.

Conclusion

AMCNN successfully combines the strengths of RNNs and CNNs through a dual-attention multichannel strategy. By treating attention as a form of "data perturbation" and preserving the matrix structure of text, the model achieves superior robustness and accuracy in text classification tasks. Future work may explore generative models for channel creation and architectures capable of handling variable-length inputs more efficiently.

Summary updated

BibTeX
@misc{liu2020multichannel,
  author = {Zhenyu Liu and Haiwei Huang and Chaohong Lu and Shengfei Lyu},
  title = {{Multichannel CNN with Attention for Text Classification}},
  year = {2020},
  eprint = {2006.16174},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.16174},
}
Figure