Understand how neural networks learn to recognize handwriting by analyzing patterns across thousands of images. Learn how these models progressively refine their accuracy through self-testing and pixel-level adjustments.
Key Insights
- Neural network models learn handwriting recognition by analyzing patterns across 60,000 training images, each consisting of 28 by 28 pixel arrays, allowing them to generalize understanding to new images.
- The model progressively improves accuracy through iterative self-testing processes, adjusting internal parameters such as neuron weights to emphasize important pixel relationships.
- Upon testing with 10,000 new images, neural networks assign confidence scores to predictions, clearly indicating their certainty level, even when images closely resemble multiple digits.
Note: These materials offer prospective students a preview of how our classes are structured. Students enrolled in this course will receive access to the full set of materials, including video lectures, project-based assignments, and instructor feedback.
Before we start normalizing data, getting it all set up and training our model, let's talk about that process a little bit more. We're going to feed the model, our 60,000 28 × 28 arrays, our X train, our training data, and the label, the answers, the Y train. And if we're talking to the model, we might say, hey, model, look at this.
It's a handwritten eight. I want you to memorize all 784 numbers that make up this eight. Hey, here's another one.
This one's a five. There are 60,000 in all, so good luck. Read them all.
Pay close attention to patterns. Later, we're going to ask you to identify ones you've never seen before, and you should know from looking at these 60,000, getting these patterns, you'll be able to look at the next 10,000 and be able to be like, yep, 98% accurate, identifying each one. So it's going to do it through repetition.
We're going to see this in process, which is one of the neatest things in the neural network model system. It'll detect patterns and it'll only do okay, but it will keep improving. It will train itself.
It will watch it train itself. It'll quiz itself. It'll say like, okay, I got this model.
How accurate am I? And it'll say, eh, not accurate enough. Let me see if I can improve it. And it'll run as many times as we want it to run, trying to improve itself.
It will turn its knobs and dials. It'll add these weights to the hidden layer neurons. It'll say, okay, maybe this pixel was a little less important.
This pixel's a little more important. This aspect of this pixel is more important. This one's relationship to the pixels around it.
It will look at more and more numbers and keep quizzing itself and make sure it's still improving. And when it's done, we are able to test it, show it the 10,000 testing images and see how it does. And one of the interesting things about our neural networks is they hedge their bets.
They assign a confidence score to each of the 10 digits. Most of the time, this will be like, I'm 99% sure that's a nine. And in fact, it's rounding to get to 99%.
It's like 99.99999999. For some digits, is an example, zero that kind of looks like a six, The model might be like, you know, I'm like 53% sure it's a zero, but 47% of me thinks it's a six. But hey, a little more zero, so I'm going to say zero. But it will tell us how confident it was in that.
Now our testing data is going to be very similar, right? We're going to give it 28 × 28 arrays, 10,000 of them, and say, okay, you've seen 60,000 of them. You've learned how to identify these digits. Hope you got the hang of it because now here's a 10,000-point quiz.
Good luck. But it's going to do great. You'll be surprised maybe at how great it does.
Okay, next we'll do normalizing data, and we'll start training our model.