Skip to content
jayaramkarivellurPublic

About

ai ml experiments

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

AutoTrainedNumPredict

AutoTrainedNumPredict is a browser-based, self-training handwritten digit recognizer for 10x10 pixel digits (1–9).
It automatically generates noisy training data, visualizes the training process, and performs frame-based prediction—no user training required!


Features

  • Auto-training:
    On page load, the app generates 10 noisy variants for each digit (1–9) using a perfect template, simulating real handwriting variation.

  • Heatmap Visualization:
    See a live grayscale heatmap for each digit as it is being trained—darker pixels are more frequently activated.

  • 10x10 Drawing Grid:
    Draw your own digit in a clean 10x10 grid after training completes.

  • Frame-Based Prediction:
    The system detects the bounding box (frame) around your drawing and only considers those pixels for prediction, making it robust to position and size.

  • Top-3 Predictions:
    Click "Predict" to see the three most likely digits with probabilities.

  • Continuous Learning:
    Each time you predict and label your drawing, it is added to the training set, improving the model over time.

  • Clear Button:
    Easily reset the drawing grid for a new input.


How It Works

  1. Auto-Training Phase

    • The app generates 10 noisy versions of each digit (1–9) using a base template and random pixel shifts.
    • Each noisy sample is added to the training set and the heatmap.
    • The training status and heatmap update in real time.
  2. Prediction Phase

    • Draw a digit in the grid.
    • Click Predict.
    • The app detects the frame (bounding box) of your drawing, rescales it, and compares it to the training set using Jaccard similarity.
    • The top 3 predictions with probabilities are shown.
    • Optionally, label your digit to add it to the training set (continuous learning).
  3. Repeat

    • Draw, predict, and improve as much as you like.

Usage

  1. Open index.html in your browser.
  2. Wait for the auto-training to finish (status will say "Training complete!").
  3. Draw a digit (1–9) in the grid.
  4. Click Predict to see the system's guess.
  5. Optionally, label your digit when prompted to improve the model with your own style.
  6. Use Clear to reset the grid and try another digit.

Example

Screenshot of AutoTrainedNumPredict interface


Technical Details

  • Frontend only: No server or backend required.
  • Grid size: 10x10 pixels for both training and prediction.
  • Frame-based: Only the bounding box of the drawing is used for matching.
  • Noise model: Each auto-trained sample is a slight random shift of the perfect template, ensuring robust recognition.
  • Similarity metric: Jaccard index on rescaled frame pixels.

Why Frame-Based?

Frame-based prediction ensures that the recognizer is robust to the position and scale of the digit within the grid, similar to modern deep learning approaches that use cropping and normalization for image recognition tasks[2][4].


License

MIT License


Acknowledgments

  • Inspired by classic handwritten digit recognition projects[2][4].
  • Uses ideas from auto-training and automated machine learning[1][3][5].

If anything goes wrong, just shout "Jin Yaang!" and Perp will fix it!

About

ai ml experiments

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages