CorrectNet: Robustness Enhancement of Analog In-Memory Computing for Neural Networks by Error Suppression and Compensation

Amro Eldebiky, Grace Li Zhang, Georg Boecherer, Bing Li, Ulf Schlichtmann

TL;DR

CorrectNet is a novel framework designed to make analog in-memory computing (IMC) robust enough for real-world deep learning. By combining a specialized training regularization that prevents errors from "snowballing" across layers with tiny, digitally-implemented "fix-it" layers placed via reinforcement learning, CorrectNet can restore the accuracy of noisy hardware from a broken 1.7% back to over 95% of its original performance.

What Problem Does This Paper Address?

Deep Neural Networks (DNNs) are computationally expensive. To make them faster and more energy-efficient, researchers are turning to Analog In-Memory Computing (IMC). Instead of moving data back and forth between a processor and memory, IMC uses emerging hardware like Resistive RAM (RRAM) to perform calculations directly where the data lives, using the physical properties of electricity (Ohm’s Law and Kirchhoff’s Law).

The catch? Hardware isn't perfect. Manufacturing "process variations" and environmental noise mean that the weight you program into an RRAM cell isn't exactly what you get. In a deep network, these tiny deviations act like a game of "telephone"—a small error in the first layer gets amplified by the second, then the third, until the final output is complete gibberish. As shown in the paper's analysis, even moderate noise can cause a model's accuracy to plummet to near zero.

Fig. 2: Inference accuracy degradation of neural networks under variations in weights.

Methods

The authors propose a two-stage solution called CorrectNet:

  1. Error Suppression (The Shield): During training, they apply a modified Lipschitz constant regularization. In mathematics, the Lipschitz constant describes how much a function can "stretch" or amplify its input. By forcing the Lipschitz constant of each layer to be $\leq 1$, they ensure that errors coming from previous layers are suppressed rather than amplified. This is achieved by adding a specific penalty term to the loss function that keeps the weight matrices "orthogonal" and limits their spectral norm.
  2. Error Compensation (The Scalpel): Even with suppression, some errors persist. The authors introduce light-weight "Generators" and "Compensators"—essentially tiny $1 \times 1$ convolutional layers. Crucially, these are intended to be executed on digital circuits, making them immune to the analog noise affecting the rest of the chip.
  3. Reinforcement Learning (The Architect): Adding too many digital compensation layers would ruin the energy efficiency of the analog system. The authors use a Reinforcement Learning (RL) agent to automatically find the best locations and sizes for these compensation layers, balancing the trade-off between accuracy recovery and hardware overhead.
The RL agent searches for the optimal configuration of compensation layers to maximize reward (accuracy vs. overhead).

Datasets

The framework was evaluated using two popular architectures across three standard computer vision benchmarks:

  • VGG16 trained on CIFAR-10 and CIFAR-100.
  • LeNet-5 trained on MNIST and CIFAR-10.

The hardware noise was simulated using a log-normal distribution, which is the standard model for representing variations in RRAM devices.

Key Insights and Ideas

  • Noise is Multiplicative, Not Just Additive: The paper highlights that hardware variations don't just add a bit of "fuzz"; they change the fundamental scaling of the data as it passes through the network.
  • Lipschitz as a Robustness Tool: While Lipschitz continuity is often used to stabilize GANs or provide theoretical bounds, this paper cleverly applies it as a physical "shock absorber" for hardware noise.
  • Hybrid is Better: Instead of trying to make the analog hardware perfect (which is nearly impossible), CorrectNet uses a hybrid approach: let the analog crossbars do the heavy lifting, and use tiny digital "checkpoints" to keep the data on track.

Key Results

The results are striking. Under high levels of hardware variation ($\sigma = 0.5$):

  • VGG16 on CIFAR-100: Accuracy crashed from 70.52% to a useless 1.69%. CorrectNet recovered it to 67.01% (over 95% of the original performance).
  • LeNet-5 on MNIST: Accuracy dropped from 98.79% to 84.58%. CorrectNet brought it back to 97.47%.
  • Efficiency: This recovery was achieved with a weight overhead of only 0.58% to 5%, meaning the energy-saving benefits of analog computing remain largely intact.
  • No Retraining Needed: Unlike previous methods, CorrectNet doesn't require "online retraining" (tuning the model for every individual chip after it's manufactured), which is a massive win for mass production.

Limitations and Future Work

While CorrectNet is highly effective, the authors note a few areas for further exploration:

  • RL Search Cost: Finding the optimal locations for compensation layers requires an RL search process, which adds to the initial design time (though not the final chip's execution time).
  • Digital-Analog Interface: The framework assumes a hybrid architecture where digital and analog components can communicate efficiently. The actual hardware implementation of this interface is a separate engineering challenge.
  • Scaling: Future work could involve testing CorrectNet on even larger, more modern architectures like Transformers or Vision Transformers (ViTs).

Summary updated

BibTeX
@inproceedings{eldebiky2023correctnet,
  author = {Amro Eldebiky and Grace Li Zhang and Georg Boecherer and Bing Li and Ulf Schlichtmann},
  title = {{CorrectNet: Robustness Enhancement of Analog In-Memory Computing for Neural Networks by Error Suppression and Compensation}},
  booktitle = {DATE},
  year = {2023},
  doi = {10.23919/date56975.2023.10137106},
}
Figure