MCEL: Margin-Based Cross-Entropy Loss for Error-Tolerant Quantized Neural Networks
Organizations: Ruhr-Universität Bochum, Germany
Abstract
Robustness to bit errors is a key requirement for the reliable use of neural networks (NNs) on emerging approximate computing platforms and error-prone memory technologies. A common approach to achieve bit error tolerance in NNs is injecting bit flips during training according to a predefined error model. While effective in certain scenarios, training-time bit flip injection introduces substantial computational overhead, often degrades inference accuracy at high error rates, and scales poorly for larger NN architectures. These limitations make error injection an increasingly impractical solution for ensuring robustness on future approximate computing platforms and error-prone memory technologies. In this work, we investigate the mechanisms that enable NNs to tolerate bit errors without relying on error-aware training. We establish a direct connection between bit error tolerance and classification margins at the output layer. Building on this insight, we propose a novel loss function, the Margin Cross-Entropy Loss (MCEL), which explicitly promotes logit-level margin separation while preserving the favorable optimization properties of the standard cross-entropy loss. Furthermore, MCEL introduces an interpretable margin parameter that allows robustness to be tuned in a principled manner. Extensive experimental evaluations across multiple datasets of varying complexity, diverse NN architectures, and a range of quantization schemes demonstrate that MCEL substantially improves bit error tolerance, up to 15 % in accuracy for an error rate of 1 %. Our proposed MCEL method is simple to implement, efficient, and can be integrated as a drop-in replacement for standard CEL. It provides a scalable and principled alternative to training-time bit flip injection, offering new insights into the origins of NN robustness and enabling more efficient deployment on approximate computing and memory systems.
Figures & tables
| Name | # Train | # Test | # Dim | # classes |
|---|---|---|---|---|
| FashionMNIST (VGG3) | 60000 | 10000 | (1,28,28) | 10 |
| SVHN (VGG7) | 73257 | 26032 | (3,32,32) | 10 |
| CIFAR10 (MobileNetV2) | 50000 | 10000 | (3,32,32) | 10 |
| Imagenette (ResNet18) | 9470 | 3925 | (3,64,64) | 10 |
| Name | Architecture | EP | BS | LR | SS | Gamma |
|---|---|---|---|---|---|---|
| VGG3 | In C64 MP2 C64 MP2 FC2048 FC10 | 100 | 256 | 10 | 0.5 | |
| VGG7 | In C64 C64 MP2 C128 C128 MP2 | 50 (100) | 256 | 5 (10) | 0.25 (0.5) | |
| In C256 C256 MP2 FC512 FC10 | ||||||
| MobileNetV2 | In C32 IRB(t1,c32) | 100 | 128 | 10 | 0.5 | |
| In IRB(t6,c64,s2) IRB(t6,c96) | ||||||
| In C256 AAP FC10 |
Neural Network Robustness
Neural network robustness studies how models withstand adversarial inputs, data shifts, noise, and hardware faults while maintaining reliable predictions.
See all 237 papers