Enhancing the Robustness of State-of-the-Art CNNs using Quantum Error Correcting Output Codes (QECOC)
This repository presents a framework to enhance the robustness of convolutional neural networks (CNNs) using Quantum Error Correcting Output Codes (QECOC). The defence mechanism follows a QECOC head randomization strategy during the inference stage, reducing the efficiency of a particular white-box ECOC-targeted attack. The proposed model architecture consists of a BaseModel followed by n Quantum ECOC heads, each corresponding to a distinct and orthogonal set of codebooks.
Implements the QECOC architecture and experiments.
qecoc_utils.py
Contains the quantum circuit construction, training and evaluation routines, and helper functions for QECOC.
Implements the classical ECOC baseline for comparison.
ecoc_utils.py
Contains training, evaluation logic, and supporting utilities.
Defines various CNN base models evaluated in this study, including architectures like ResNet, DenseNet121, and GoogLeNet.
Preprocesses datasets and saves them into structured directories for easy access during training and evaluation.
Implements targeted attack (Zhang, B et al., 2020) on individual ECOC codebooks to test model robustness under adversarial conditions.
Packages necessary for this repo
- Supports both classical and quantum ECOC implementations.
- Integrates seamlessly with popular CNN backbones.
- Provides modular scripts for training, evaluation, and dataset handling.