Non-negative isomorphic neural networks for photonic neuromorphic accelerators

Manos Kirtas, Nikolaos Passalis, Nikolaos Pleros, Anastasios TefasarXiv 2023

TL;DR

Photonic neuromorphic accelerators offer incredible speed and energy efficiency but struggle to represent the negative numbers essential for modern deep learning. This paper introduces a mathematical framework to transform standard neural networks into "non-negative isomorphic" equivalents and a specialized optimizer (NNSGD) that allows these networks to be trained or fine-tuned without the accuracy loss typically seen in non-negative models.

What Problem Does This Paper Address?

Deep Learning (DL) models rely heavily on negative weights and activations. However, many promising photonic hardware architectures—specifically incoherent setups—operate based on optical power, which is inherently non-negative.

To handle negative values, engineers usually have to add complex hardware like balanced photodetectors, extra biasing circuits, or phase modulators. These additions increase the physical footprint, cost, and energy consumption of the chip, undermining the very benefits of using photonics. While one could simply "clip" weights to be positive during training, this usually leads to significant performance degradation. The authors seek a way to achieve the accuracy of standard networks using only the non-negative operations native to simple photonic hardware.

Methods

The authors propose two primary innovations:

  1. Non-Negative Transformation (NNT): This is a mathematical method to convert a standard "signed" neural network into a non-negative isomorphic equivalent. The core idea is a coordinate change: by shifting and rotating the input space and adjusting the activation functions, a neuron with negative weights can be represented by a neuron with only positive weights that produces the exact same output.
  2. Non-Negative Stochastic Gradient Descent (NNSGD): Standard optimization often pushes weights toward negative values. To prevent this, the authors developed a sign-preserving multiplicative update rule. Instead of the traditional additive update, NNSGD uses a tanh function of the gradient scaled by the absolute value of the parameter. This ensures that if a weight starts positive, it stays positive throughout training.

The researchers tested these methods across various architectures, including Multilayer Perceptrons (MLPs), Convolutional Neural Networks (CNNs), and Recurrent Neural Networks (RNNs), using hardware-realistic activation functions like the photonic sigmoid and photonic sinusoidal functions.

Datasets

The framework was evaluated on a diverse set of benchmarks to prove its versatility:

  • Image Classification: MNIST, Fashion MNIST (FMNIST), and CIFAR10.
  • Malware Classification: The Malimg dataset (images generated from malware binaries).
  • Financial Forecasting: FI2010 (large-scale time-series data from limit order books).
  • Natural Language Processing: The Names dataset (predicting language of origin from surname spelling).

Key Insights and Ideas

  • Isomorphism as a Solution: The "difficulty" of training non-negative networks isn't a fundamental limit of neural networks, but rather a mismatch between the data's coordinate system and the hardware's constraints. As shown in Figure 1, a simple rotation of the decision boundary allows a non-negative classifier to perform identically to a regular one.
Decision boundary rotation: (a) Regular training with negative weights. (b) Constrained non-negative training fails. (c) The proposed isomorphic transformation achieves perfect accuracy using only positive parameters.
  • Preserving Information: Traditional "clipping" (setting negative weights to zero) is catastrophic for pre-trained models because it destroys learned information. The NNT method preserves this information by remapping it into a positive space.
  • Variance Stability: A common failure in non-negative training is that parameter variance diminishes over time, leading to convergence issues. NNSGD maintains parameter variance, allowing the training process to proceed smoothly.

Key Results

The results demonstrate that non-negativity does not have to mean lower accuracy:

  • Perfect Matching: In every test case, the NNT-transformed models achieved the exact same accuracy as their regular counterparts (see Table 1). For example, a CNN on MNIST maintained 98.81% accuracy after transformation.
Table 1: Applying proposed transformation in various datasets, architectures and photonic configura- tions. The Non-negative Match column defines if the performance of the non-negative isomorphic matches trained model’s one.
  • Superior Post-Training: When fine-tuning pre-trained models, the proposed NNSGD significantly outperformed baseline clipping methods. On MNIST, direct clipping dropped accuracy to ~11%, while the proposed method maintained ~97.4% (see Table 2).
Table 2: Non-negative post training after transformation using MLPs
  • Competitive Training from Scratch: Even when training from scratch, the non-negative isomorphic networks reached accuracies highly competitive with (and sometimes exceeding) standard networks.

Limitations and Future Work

  • Gated Architectures: The current transformation cannot be directly applied to RNNs with complex gating mechanisms like LSTMs or GRUs; these will require further mathematical adjustments.
  • Hardware Subtraction: The shifted activation functions require a subtraction operation. While this can be integrated into hardware, it adds a small layer of complexity to the implementation.
  • Intermediate Values: To ensure intermediate activations remain non-negative during continuous post-training, the transformation may need to be reapplied periodically, which could increase computational overhead during the training phase.

Summary updated

Abstract

Neuromorphic photonic accelerators are becoming increasingly popular, since they can significantly improve computation speed and energy efficiency, leading to femtojoule per MAC efficiency. However, deploying existing DL models on such platforms is not trivial, since a great range of photonic neural network architectures relies on incoherent setups and power addition operational schemes that cannot natively represent negative quantities. This results in additional hardware complexity that increases cost and reduces energy efficiency. To overcome this, we can train non-negative neural networks and potentially exploit the full range of incoherent neuromorphic photonic capabilities. However, existing approaches cannot achieve the same level of accuracy as their regular counterparts, due to training difficulties, as also recent evidence suggests. To this end, we introduce a methodology to obtain the non-negative isomorphic equivalents of regular neural networks that meet requirements of neuromorphic hardware, overcoming the aforementioned limitations. Furthermore, we also introduce a sign-preserving optimization approach that enables training of such isomorphic networks in a non-negative manner.
BibTeX
@misc{kirtas2023non,
  author = {Manos Kirtas and Nikolaos Passalis and Nikolaos Pleros and Anastasios Tefas},
  title = {{Non-negative isomorphic neural networks for photonic neuromorphic accelerators}},
  year = {2023},
  eprint = {2310.01084},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.01084},
}

Loading related content...

Figure