I'm proud to announce a demo showing that neural networks can run and even do useful work on TI graphing calculators. With this project, you can train a 4-layer convolutional neural network (CNN) to identify handwritten digits, directly on a TI-84 Plus CE calculator. You can test it on samples from the MNIST handwritten digit dataset, or connect a USB mouse and draw digits for it to identify.



I've seen a number of projects that bring "AI" to graphing calculators, all using a TI-84 Plus CE as a dumb terminal for the ChatGPT API. One used the ESP32 wireless microcontroller board, with a 240MHz CPU, to communicate with the ChatGPT API, while others have used a simpler USB serial connection. One project was even subverted by a cryptobro "entrepreneur" to claim he created an LLM so efficient, it could run on a calculator. But none of these projects was actually running any kind of intelligence on the calculator itself, not even the simplest single-layer neural network. Calculators aren't particularly powerful, but they are as capable of performing the math using in machine learning as any other general-purpose CPU, so I set out to make a calculator run a neural network - and do something useful with it.

Over March 25-27, 2023, I took the Amtrak California Zephyr from San Francisco all the way to Chicago, a 56-hour journey during which I challenged myself to complete this project. These three days (details on my blog) encompassed tasks like:
  1. Building a Python tool to pack the 70,000 sample images from the MNIST dataset into AppVars
  2. Porting the components of a very simple C neural network framework to the TI-84 Plus CE
  3. Making my fledgling program compile and run on both PC and calculator
  4. Building a new memory allocator
  5. Overhauling the neural network framework I had ported to support checkpointing
  6. Much testing and debugging

At the end of that train trip, I had a program that could train and run a convolutional neural network on the MNIST handwritten digit dataset to identify digits directly on the calculator. Although the calculator can run both training and inference, at its current speed it would require 1316 hours (55 days) to train on all the images in the dataset, or even 76 hours for the 3,486 samples that could fit in the calculator’s Flash memory. Therefore, it was prudent to train the network on a computer (requiring less than 5 minutes), transfer the checkpointed network state, and run inference on the calculator: inference takes around 18 seconds. The trained network achieves better than 95% accuracy, and qualitatively, its predictions make sense.

Shortly after I returned, I added USB mouse support, and with the finished product, you can draw a digit with the mouse, and in 18 seconds, the program will identify which digit you drew. Potential future work includes accelerating the program through the use of better-optimized software floats or fixed-point numbers, and provide higher accuracy through the use of quantized weights and values. As a coda to this project, I'd like to make my own version of simply tethering a calculator to an LLM like ChatGPT, as I think there are more useful features it could facilitate than simply holding a conversation with it.

Watched your video very interesting! Can I download this?
Mcdonalds_lover_32 wrote:
Watched your video very interesting! Can I download this?
Great idea. I'll upload the program, the training data, and the trained weights.
KermMartian wrote:
Mcdonalds_lover_32 wrote:
Watched your video very interesting! Can I download this?
Great idea. I'll upload the program, the training data, and the trained weights.

Thanks I can't wait to try it out! Very Happy
This is really cool Kerm! A good demonstration and an informative video.
Your video popped up in my youtube feed and it looks really cool. Out of curiosity, has anyone created an ELIZA chat bot for the ce? I know there's one for the 89.
Calculatordream wrote:
Your video popped up in my youtube feed and it looks really cool. Out of curiosity, has anyone created an ELIZA chat bot for the ce? I know there's one for the 89.

Yes. Check out CHELSEA by JWinslow23. (It's in Basic, which is pretty cool.)
Hey, really stupid question (just me being ignorant old me) but where can I find the files Kerm uploaded?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement