Share your repls and programming experiences

← Back to all posts
Digit Draw: Neural Network Digit Recognition
h
MrEconomical (2203)

Neural Network Recognition

Digit Draw is a program to recognize 28x28 pixel hand-drawn digits. It uses a neural network made with brain.js trained on MNIST data (a database of hand-drawn digits). It takes in an array of 28x28 for the darkness of each pixel and outputs an array of length 10 of the certainty for each digit. The neural network works fairly well and is able to predict the digit most of the time.

Specifications

Input Size: 784
Hidden Layers: 1
Hidden Layer Neurons: 392
Activation Function: Sigmoid
Output Size: 10

Resources

brain.js - https://github.com/BrainJS
MNIST - http://yann.lecun.com/exdb/mnist/

Commentshotnewtop
syc1 (21)

I drew a 7 and it said 0.01 :/

CProgrammer4 (0)

All the other digits work, though. Really good job, man! I don't know anything about NN or web design, so this is WAY better than I could do. I am not trying to poop on your parade or anything. Maybe you just need a larger variety of picture training data of crooked, sloppy, photoshopped/distorted, etc... numbers. You could probably draw more digits yourself, scan them in, and improve your little NN.

Don't give up, dude. This is pretty cool!

CProgrammer4 (0)

It can't handle fours in the corners, either.

CProgrammer4 (0)

That's a perfect 4 for crying out loud! lol

mathmaniac88 (21)

@CProgrammer4 Note that this is merely a client. Do not expect too much of someone who only knows how to utilize the AI methods but does not know how to implement them.

Rileygamer21 (35)

Really cool idea im getting into ml learning also and im starting to learn about nn too :). So if you could send me stuff you used to learn about nn that would be cool. Also, 1 works now if you didn't

already know.

Rileygamer21 (35)

@CProgrammer4 weird its working 4 me (get the stupid joke?). I think its because of how you draw the four.

Rileygamer21 (35)

@CProgrammer4 it works for me so that's kinda weird

Rileygamer21 (35)

@CProgrammer4 maybe the space between the two things on the 4 are to far apart of somethin

CProgrammer4 (0)

More issues with the number 4.

CProgrammer4 (0)

It looks to have significant trouble recognizing fours.

replitjeremy (66)

Awesome, can you add a clear button? I'm too lazy to erase :)

HarryXChen (1)

How long was it trained for?

MrEconomical (2203)

@HarryXChen idk why 1 doesn't work
was trained on 10,000 digits

HarryXChen (1)

@MrEconomical That's quite a lot to be still missing some things

AdCharity (1270)

nice project :D although sadly I believe this has been done on repl before (with very similar specifications - not saying you're copying its very common to use MNIST data as a somewhat first project)
https://neuralnetwork.ieatpython.repl.co/

Edit: just a question, but can brain.js train on base 64 images? I was going to try but I got lazy

MrEconomical (2203)

@AdCharity no the input must be array of number or object for a feed forward back propagation network I tried with base64

AdCharity (1270)

@MrEconomical ah >:l
btw that is a mad face. Btw if I normalized base64 images (like if one was longer than the other and cut of the ends) then would it work? Brain.js can accept strings extremely quickly if you encode the data.... mmm

MrEconomical (2203)

@mwilki7 it looks for dark squares lol not light ones

[deleted]

finally, a neural net that isnt garbage

Zavexeon (1039)

@sanjaykdragon Finally, a neural network that's actually a neural network.