Abstract
Error-Correcting Output Codes (ECOCs) offer a principled approach for combining simple binary classifiers into multiclass classifiers. In this paper, we investigate the problem of designing optimal ECOCs to achieve both nominal and adversarial accuracy using Support Vector Machines (SVMs) and binary deep learning models. In contrast to previous literature, we present an Integer Programming (IP) formulation to design minimal codebooks with desirable error correcting properties. Our work leverages the advances in IP solvers to generate codebooks with optimality guarantees. To achieve tractability, we exploit the underlying graph-theoretic structure of the constraint set in our IP formulation. This enables us to use edge clique covers to substantially reduce the constraint set. Our codebooks achieve a high nominal accuracy relative to standard codebooks (e.g., one-vs-all, one-vs-one, and dense/sparse codes). We also estimate the adversarial accuracy of our ECOC-based classifiers in a white-box setting. Our IP-generated codebooks provide non-trivial robustness to adversarial perturbations even without any adversarial training.
Introduction
Multiclass classification is often handled by breaking a large problem into many smaller binary decisions (e.g., "Is this a cat or not?"). ECOCs provide a framework for this, where each class is assigned a unique bit-string (codeword). However, designing the "perfect" codebook—one where the codewords are far enough apart to correct errors but the binary classifiers aren't redundant—is a massive combinatorial challenge.
Existing methods usually rely on "continuous relaxations" (which lose optimality guarantees) or random search. As the number of classes ($k$) grows, the number of possible binary classifiers grows exponentially ($2^{k-1}-1$), making it nearly impossible to find the best subset using traditional tools. Furthermore, standard classifiers are notoriously fragile under adversarial perturbations (tiny, intentional changes to input data that cause misclassification).
Methods
The authors formulate the codebook design as an Integer Programming (IP) problem. Their goal is to maximize the minimum Hamming distance between any two codewords (row separation) while ensuring the binary classifiers are uncorrelated (column separation) and balanced.
To make this computationally feasible for more than 10 classes, they introduce a novel graph-theoretic optimization:
- IP1 & IP2: Initial formulations that are mathematically sound but computationally "heavy" due to a massive number of constraints.
- Edge Clique Covers (IP3): The authors prove that the constraints preventing redundant/correlated columns can be represented as a graph. By finding an "edge clique cover" of this graph, they can replace thousands of individual constraints with a single constraint per clique.
- Tractability: This reduction allows modern IP solvers (like Gurobi) to find optimal codebooks for up to 18 classes in reasonable time, achieving very low "optimality gaps." The edge clique cover approach reduced the number of constraints for an 18-class problem by a factor of 574x.
Key Results
The paper evaluates the approach across a variety of benchmarks, including toy datasets, UCI repository data (Glass, Ecoli, Yeast), and image classification (MNIST, CIFAR10).
- Nominal Accuracy: On the Ecoli dataset, the IP-generated codebook achieved 90.09% accuracy, significantly beating 1-vs-all (71.28%) and 1-vs-1 (77.22%).
- Adversarial Robustness: On CIFAR10 (using ResNet18), the IP3 codebook maintained ~16.5% accuracy under a strong PGD attack ($\epsilon = 8/255$). While 16% sounds low, standard ECOC methods like 1-vs-all and Sparse codes dropped to 0% accuracy under the same conditions.
Key Insights and Ideas
- Robustness-by-Design: The most striking finding is that a well-designed codebook provides inherent resistance to adversarial attacks. Because the codewords are mathematically "far apart," an attacker has to perturb the input much more significantly to flip enough binary bits to reach a different valid codeword.
- Optimization over Heuristics: While "Dense" or "Sparse" random codes are common in ECOC literature, optimized codes (IP3) consistently provide better error correction and higher nominal accuracy.
- Graph Theory as a Filter: The use of edge clique covers is a clever bridge between discrete optimization and graph theory. It effectively "compresses" the problem's complexity without losing the guarantee of an optimal solution.
Limitations and Future Work
While the paper successfully scales to 18 classes, many modern problems involve hundreds or thousands of classes (e.g., ImageNet). Further heuristics or hierarchical IP approaches would be needed there. Additionally, the authors suggest that combining their robust codebook design with actual adversarial training of the underlying binary models could lead to even higher levels of security.
Summary updated