Click and drag your mouse to draw a number between 0 and 9, and the AI will guess it! Make sure to draw your 0's big enough-- still fixing that! 98% test accuracy on MNIST. Want to know how it works? Check below
So what's the secret? If you click "see inside," you'll see a few lists that contain around 100,000 numbers in total! This is called an MLP, or Multi-Layer Perceptron, which is the most common type of AI neural network. Mine has 2 "layers," and here's how it works: 1. The pixels from your drawing get turned into a list of 784 numbers between 0 and 1. Here, 0 is white and 1 is black. 2. The first layer has 128 "neurons." Each neuron has its own list of 784 numbers. It multiplies and then adds these with your 784 input numbers to get a single value. This is called a dot product! 3. We apply an "activation function" to the first layer. It basically just sets all negative values to zero. 4. The second layer has only 10 neurons, each one holding its own list of 128 numbers. We use the dot product again to get 10 output numbers. 5. We apply another activation function to the second layer. 6. That's it! The the biggest output number should be the number you drew! For example, if the first number is the highest, then it thinks you drew a "0." If the last number is the highest, it thinks you drew a "9." But WHY does this work? Well, I trained it! Using a data set of 60,000 hand-drawn numbers, you can tell it to try to predict your number. Every time it gets something wrong, it changes each neuron's list by a super small amount to nudge it in the right direction. With 100,000 total numbers, this model has enough variables to eventually predict any number between 0 and 9!! Want to learn more? Leave your questions in the comments!