Aug 13, 2026

Visual Digits :TRAINABLE K-NN based ML thinking model

machine learning ( ml ) artificial intelligence ( ai ) python html css javascript ( js ) web development

#Visual Digits

A webapp made in vscode that guesses cursorwritten digits from 0-9 using a user-trainable K-NN model 

The app uses a simple manually trained dataset anyone can update locally by training their K-NN model , of which new training data is stored in localstorage of the browser itself !! 

## Features

- Draw digits with your cursor
- Guess digits from 0 to 9
- Manually train the webapp by approving the correct digit
- Saves training data locally in the browser's localstorage

## Training Your Dataset- after drawing and guessing , you can click one of the digits from 0 to 9 below the "train as" header 
- on clicking , the guessed drawing is stored under that digit as sample
- the more data the better

## How It Works

- Your drawing is converted into a 28×28 grid of pixel values. When you click Guess, the app compares it to every saved example using Euclidean distance and picks the closest match (k-NN with k=3). The pre-trained dataset (217 samples) is embedded in the js file from my python project. Any new drawings you train are saved to your browser's localStorage and persist across page loads.

1

Give a star to encourage!Discussion
Start a new conversation!
Login to join the discussion

More Builds by Bhuvan Rai

web development html css javascript ( js ) frontend
python file management system utility quality of life tool pip