Deep Neural Network on MSP430FR5994

Embedded Machine Learning Implementation

September 2024

CEmbedded MLMSP430FR5994MNISTNeural Networks

Overview

A complete 784-32-10 deep neural network implemented from scratch in C for handwritten digit recognition on the resource-constrained MSP430FR5994 microcontroller. This project demonstrates the feasibility of running machine learning inference on embedded systems with limited computational resources.

The Challenge

Implementing a functional neural network on a microcontroller with only 8KB of RAM and 256KB of flash memory, while maintaining acceptable accuracy and inference speed.

The Solution

Developed custom matrix multiplication algorithms optimized for embedded systems, implemented efficient sigmoid activation functions, and carefully managed memory usage through strategic data structure design.

Key Features

  • 93% accuracy on MNIST handwritten digit recognition
  • Complete forward propagation implementation in C
  • Optimized matrix operations for embedded constraints
  • Custom sigmoid activation function implementation
  • Memory-efficient neural network architecture
  • Real-time inference on 16MHz microcontroller

Technical Details

  • Hand-crafted C implementation with no external ML libraries
  • Fixed-point arithmetic for efficient computation
  • Optimized memory layout to fit network weights in flash
  • Custom activation functions tuned for embedded performance
  • Achieved inference times suitable for real-time applications
  • Comprehensive testing and validation on MNIST dataset
Edward Serna | Computer Engineering Portfolio