r/madeinpython • u/EventHorizon-dev • 16m ago
I built a handwritten AI calculator with real-time learning in Python
Hey everyone,
I wanted to share an AI project I've been working on: a handwritten math calculator powered by a Keras/TensorFlow neural network and a Tkinter drawing interface.
Unlike standard digit-only classifiers, this model recognizes both digits (0β9) and basic mathematical operators (+, -), allowing users to hand-draw expressions and compute results. It also features live incremental learning, so you can instantly correct the model if it misidentifies a symbol.
Key features:
- Multi-class recognition for digits and operators from 28x28 grayscale images.
- Interactive Tkinter drawing canvas with automatic color normalization (to match the MNIST format).
- Live on-device correction using
train_on_batch: clicking a correction button immediately updates the neural network's weights and saves the model. - Real-time equation building and evaluation.
I'll drop the link to the GitHub repository in the first comment below if anyone wants to check out the code or test it. I'd love to hear your feedback or ideas for new features!