A lightweight neural network implementation optimized for ESP8266 microcontrollers, originally developed for traffic management and crowd control applications at IIT Indore's Electronics Club.
This repository contains a quantized TensorFlow Lite model converted for edge deployment, implementing a two-layer neural network (784-128-10 architecture) trained on the Fashion MNIST dataset. Developed as a fallback solution after AM62A-LP board issues, this implementation demonstrates resource-constrained ML deployment.
- Memory-efficient design: 1.2MB flash consumption with PROGMEM storage for model parameters
- TensorFlow Lite Micro integration: Quantized model deployment for 8-bit microcontrollers
- PlatformIO compatibility: Pre-configured build environment for seamless deployment
- Real-time inference: 120ms average prediction time on ESP8266 (80MHz)
Edge-ML/
├── CONTRIBUTORS.md
├── README.md
├── platformio.ini
└── src/
├── NeuralNetwork.cpp
├── NeuralNetwork.h
├── dense1_bias.h
├── dense1_weights.h
├── dense2_bias.h
├── dense2_weights.h
├── main.cpp
├── model_data.cc
├── model_data.h
└── test_images.h
-
Prerequisites:
- PlatformIO Core (VSCode extension recommended)
- ESP8266 board support
-
Clone repository:
git clone https://github.com/Stonky-Boi/Edge-ML.git
cd Edge-ML
- Build & Upload:
pio run -t upload
#include "NeuralNetwork.h"
void setup() {
Serial.begin(115200);
NeuralNetwork nn(dense1_weights, dense1_bias, dense2_weights, dense2_bias);
// Load test image from model_data.cc
std::vector input(test_image, test_image + 784);
auto prediction = nn.predict(input);
Serial.print("Predicted class: ");
Serial.println(std::distance(prediction.begin(),
std::max_element(prediction.begin(), prediction.end())));
}
See CONTRIBUTORS.md for the complete list of developers and mentors.
For model training and quantization: Fashion MNIST Training Notebook