LightNet: A Versatile, Standalone Matlab-based Environment for Deep Learning

Chengxi Ye, Chen Zhao, Yezhou Yang, Cornelia Fermüller, Yiannis Aloimonos

Introduction

Modern deep learning frameworks like TensorFlow and PyTorch are powerful but complex, often comprising hundreds of thousands of lines of code across multiple languages. This complexity creates a significant barrier for researchers and students who wish to understand the underlying mathematical operations or modify core computational modules. LightNet addresses this by providing a lightweight, purely Matlab-based framework that mirrors mathematical modeling directly in its implementation.

Framework Design and Methods

LightNet is built entirely in Matlab, leveraging vectorized matrix operations for efficiency. It supports diverse architectures, including Multilayer Perceptrons (MLP), Convolutional Neural Networks (CNN), LSTMs, and Q-Networks.

A key innovation in LightNet is Selective-SGD, an optimization algorithm designed to automate hyper-parameter tuning. Instead of manual learning rate selection, Selective-SGD evaluates multiple candidate rates over a few iterations and dynamically selects the most efficient one.

Comparison of training loss for Selective-SGD versus standard SGD with fixed learning rates.

Additionally, the framework utilizes FFT-based convolutions for efficient processing of large kernels and allows for seamless switching between CPU and GPU computation with a simple configuration flag.

Evaluation and Results

The framework's versatility was tested across several domains, including image classification (MNIST, CIFAR-10), language modeling (Shakespeare text), and reinforcement learning (Cart-Pole).

Training loss and error rates over 20 epochs using standard SGD.

Key performance metrics include:

  • Code Efficiency: The core package consists of only 1,762 lines of code, a fraction of the size of industrial frameworks like Caffe (~74k lines) or TensorFlow (~335k lines).
  • Processing Speed: On an Nvidia Titan X GPU, LightNet processed 750 images per second for a 4-layer CNN on CIFAR-10, outperforming CPU execution by 5x.
  • Optimization: Selective-SGD achieved state-of-the-art accuracy on CIFAR-10, demonstrating that automated scheduling can match or exceed manual tuning.

Discussion and Conclusion

LightNet demonstrates that the fundamental mathematics of deep learning can be implemented concisely without sacrificing capability. By prioritizing readability and mathematical intuition, it serves as an excellent tool for rapid prototyping and education. While its reliance on proprietary Matlab software and lack of distributed multi-node scaling may limit its use in massive production environments, its transparency offers a unique platform for developing and visualizing novel network models.

Summary updated

BibTeX
@inproceedings{ye2016lightnet,
  author = {Chengxi Ye and Chen Zhao and Yezhou Yang and Cornelia Fermüller and Yiannis Aloimonos},
  title = {{LightNet: A Versatile, Standalone Matlab-based Environment for Deep Learning}},
  booktitle = {ACM Multimedia},
  year = {2016},
  url = {https://openreview.net/forum?id=kN7JITDdp-},
}
Figure