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.
- Goal: Classify image as
catordog - 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.
git clone https://github.com/samjkent/MCXN947-FreeRTOS.git
cd MCXN947-FreeRTOSBuild and flash are handled via just:
just build # Build firmware
just flash # Flash firmware to deviceAll command details are found in the justfile.
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