Error-Correcting Output Codes with Ensemble Diversity for Robust Learning in Neural Networks

Yang Song, Qiyu Kang, Wee Peng Tay

Introduction

Deep Neural Networks (DNNs) have demonstrated remarkable performance across various domains but remain susceptible to adversarial examples. These are inputs modified by small, often imperceptible perturbations that cause models to misclassify with high confidence. A significant challenge in defending against these attacks is their "transferability": an adversarial example designed to fool one model often succeeds against others that have learned similar features.

To address this, researchers have introduced the Error-Correcting Neural Network (ECNN). This framework revitalizes the classical concept of Error-Correcting Output Codes (ECOC) by integrating it with deep learning and a novel diversity-promoting training strategy. The goal is to create an ensemble of sub-classifiers that are not only redundant but also sufficiently diverse to resist coordinated adversarial attacks.

The ECNN Framework

The ECNN architecture is structured as an end-to-end system comprising an Encoder and a Decoder.

The ECNN architecture featuring an ensemble encoder and a correlation-based decoder.

Code Matrix Design

Unlike standard models that use one-hot encoding, ECNN assigns each class a unique binary "codeword." The code matrix is designed using simulated annealing to optimize two primary metrics:

  • Row Distance (Hamming Distance): Maximizing the distance between codewords ensures that the system can recover the correct class even if several binary classifiers are compromised.
  • Column Distance (Variation of Information): Maximizing the "information distance" between the tasks assigned to each classifier ensures they focus on independent features, reducing the likelihood of simultaneous failure.

Joint Training and Continuous Relaxation

Traditional ECOC methods often train classifiers independently. In contrast, ECNN employs joint training with a unified loss function. To ensure the system is differentiable for backpropagation, the decoder uses a tanh scaling of logits and a softmax correlation to map outputs back to class codewords. Furthermore, the architecture utilizes parameter sharing in the initial feature extraction layers, which acts as a regularizer and prevents the model from learning redundant features.

Key Insights: Diversity as Defense

A central finding of this research is that error correction alone is insufficient for robustness; ensemble diversity is critical. By using a diversity-promoting regularizer (controlled by a hyperparameter $\gamma$), the model encourages sub-classifiers to remain independent.

Heatmaps illustrating the impact of the diversity-promoting regularizer on ensemble independence.

The "negotiation" between sub-models during joint training allows them to specialize in different aspects of the input data. This prevents an attacker from finding a single perturbation that consistently fools the entire ensemble.

Evaluation and Results

The ECNN was evaluated against powerful white-box attacks, such as Projected Gradient Descent (PGD) and Carlini & Wagner (C&W), across several benchmarks:

  • MNIST: ECNN achieved 88.4% accuracy under PGD attack, significantly outperforming standard ensembles (0.2%) and previous ECOC methods (79.2%).
  • CIFAR-10: The model maintained 71.6% accuracy under PGD, while competing ensemble methods dropped as low as 2.5%.
  • CIFAR-100: On this complex dataset, ECNN reached 36.3% accuracy under PGD, compared to just 5.3% for a standard ResNet20.
  • GTSRB: When combined with traditional adversarial training, ECNN's robustness on traffic sign recognition improved from 51.9% to 69.4%.

Conclusion

The ECNN framework demonstrates that combining error-correcting codes with explicit diversity promotion creates a formidable defense against adversarial examples. By ensuring that sub-classifiers are both redundant and independent, the model significantly raises the bar for successful attacks. Future work will explore scaling the code matrix design for larger datasets like ImageNet and investigating potential adaptive attacks that might target the diversity-promoting loss directly.

Summary updated

BibTeX
@inproceedings{song2021error,
  author = {Yang Song and Qiyu Kang and Wee Peng Tay},
  title = {{Error-Correcting Output Codes with Ensemble Diversity for Robust Learning in Neural Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i11.17169},
}
Figure