Skip to content

samjkent/MCXN947-FreeRTOS

Repository files navigation

TFLite Micro Cat vs Dog Classifier (MCXN947 Example)

README generated by ChatGPT

This is a working example of training and deploying a tiny machine learning model that classifies images as either cat or dog, built for microcontroller deployment on the NXP MCXN947 running FreeRTOS.

It uses knowledge distillation to train a small student model to mimic a larger, more accurate teacher model, resulting in a classifier that is compact enough to run on constrained devices.


🧠 Model Overview

  • Goal: Classify image as cat or dog
  • Technique: Trained using knowledge distillation to compress a larger model
  • Frameworks: TensorFlow / TensorFlow Lite Micro
  • Output: Single logit (0 = Cat, 1 = Dog)

Training occurs in Google Colab, and the final TFLite model is compiled into firmware for inference.


🚀 Quick Start

1. Clone the repo

git clone https://github.com/samjkent/MCXN947-FreeRTOS.git
cd MCXN947-FreeRTOS

2. Build and flash to the MCXN947

Build and flash are handled via just:

just build     # Build firmware
just flash     # Flash firmware to device

All command details are found in the justfile.


📟 Inference Output

Serial output from the device:

Registering debug_log_callback
Running inference on new image
Image: Dog
Dog detected
Image: Dog
Dog detected
Image: Cat
Cat detected

About

Example FreeRTOS and tflite-micro project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors