AOGNets: Compositional Grammatical Architectures for Deep Learning

Xilai Li, Xi Song, Tianfu Wu

Abstract

Modern deep neural networks (DNNs) often rely on heuristically designed architectures that lack explicit hierarchical structure. This paper introduces AOGNets, a novel class of deep learning architectures that utilize AND-OR Grammars (AOG) as a structural backbone. By treating feature map channels as elements of a grammatical "sentence," AOGNets unify compositional rules with discriminative learning. Our results demonstrate that AOGNets achieve state-of-the-art performance on ImageNet and MS-COCO while offering enhanced interpretability and adversarial robustness compared to standard ResNet and ResNeXt architectures.

Introduction

Despite the transformative success of Deep Neural Networks (DNNs) in computer vision, many researchers have noted that these architectures often lack principled structural levels. Pioneers like Geoffrey Hinton have argued that the heuristic stacking of layers—while effective—does not fully capture the hierarchical compositionality inherent in the physical world.

In contrast, formal Grammar Models, historically used in linguistics and early computer vision, excel at representing hierarchical composition and reconfigurability. However, they traditionally lacked the raw discriminative power of deep learning. AOGNets bridge this gap by integrating the principled, hierarchical structure of grammars into the high-performance framework of DNNs. This approach allows for a unified design space where common architectural motifs, such as skip connections and feature concatenation, emerge naturally as grammatical operations.

The AOG Building Block

The core innovation of AOGNets is the AOG building block, which replaces standard residual or inception blocks. This block operates on a feature map by splitting its channels into $N$ groups, effectively treating them as a "sentence" of $N$ words. The block then "parses" this sentence using two primary types of grammar:

  1. Phrase Structure Grammar (Vertical): This defines how parts compose into wholes. AND-nodes perform composition via concatenation, while OR-nodes represent alternative ways to compose parts via summation.
  2. Dependency Grammar (Lateral): This introduces horizontal connections between nodes of the same type, facilitating feature reuse and improving information flow across the hierarchy.
The AOG building block structure, illustrating the hierarchical composition of feature maps through AND, OR, and Terminal nodes.

Every node in this grammatical graph performs a standard neural operation (e.g., Conv-BN-ReLU). To maintain computational efficiency, the authors employ a pruning algorithm to remove "syntactically symmetric" nodes, ensuring the parameter count remains manageable without sacrificing representational power.

Network Architecture and Implementation

AOGNets are constructed by stacking these AOG building blocks into stages, similar to the macro-architecture of ResNets. A typical AOGNet begins with a "stem" (initial convolution and pooling), followed by several stages of AOG blocks, and concludes with global mean pooling and a softmax layer for classification.

An overview of the AOGNet architecture, showing the sequential arrangement of AOG building blocks for image classification tasks.

This modular design allows AOGNets to scale effectively. For instance, an AOGNet with 40.3M parameters can outperform much larger models like ResNet-152 (60.2M parameters) by leveraging the efficiency of its grammatical structure.

Experimental Results

Large-Scale Image Classification

On the ImageNet-1K dataset, AOGNets demonstrate significant performance gains. An AOGNet-40M achieved 80.18% top-1 accuracy, surpassing ResNeXt-101 (79.6%, 83.9M params) despite having less than half the parameters. Even at the mobile scale, an AOGNet-4M outperformed specialized architectures like MobileNetV2 and auto-searched models like NASNet-C.

Object Detection and Segmentation

When integrated as backbones for Mask R-CNN on the MS-COCO dataset, AOGNets consistently outperformed ResNet and ResNeXt counterparts. This suggests that the hierarchical features learned by the grammar are particularly well-suited for tasks requiring precise localization and part-based reasoning.

Interpretability and Robustness

Beyond raw accuracy, AOGNets offer two critical advantages:

  • Intrinsic Interpretability: Using "network dissection" techniques, the researchers found that AOGNets develop clearer and more unique "detectors" for specific parts and textures. The hierarchical structure forces the network to learn more meaningful, compositional features.
  • Adversarial Resilience: AOGNets showed superior "out-of-the-box" robustness against adversarial attacks like FGSM. This suggests that the principled composition of features leads to a more stable and less easily fooled vision system.

Discussion and Future Work

AOGNets provide a mathematical framework that unifies diverse architectural innovations—like summation and concatenation—under a single grammatical umbrella. While the current implementation uses a binary splitting rule, future work may explore $k$-branch splitting or the addition of top-down feedback connections to further mimic biological vision systems.

Although the Directed Acyclic Graph (DAG) structure of an AOG block is more complex to implement than linear stacks, the gains in efficiency, interpretability, and robustness make it a compelling alternative for next-generation deep learning research.

Summary updated

BibTeX
@inproceedings{li2019aognets,
  author = {Xilai Li and Xi Song and Tianfu Wu},
  title = {{AOGNets: Compositional Grammatical Architectures for Deep Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.00638},
}
Figure