Neural Networks: Image Recognition to Handwritten Digits

Explore neural networks, their structure, functionality, and practical applications using TensorFlow and Keras.

Dive into neural networks, sophisticated models inspired by the human brain, used widely for complex tasks like image recognition and handwriting translation. Learn about TensorFlow and Keras libraries to build and visualize neural networks effectively.

Key Insights

  • Neural networks effectively handle intricate data, excelling in tasks such as image and speech recognition, chatbot interactions, and translating handwritten digits into recognizable numbers for uses like postal zip code scanning.
  • Inspired by the human brain, neural networks utilize interconnected layers (input, hidden, and output layers) composed of neurons, adjusting internal weights during training to accurately interpret data.
  • The article demonstrates practical use of TensorFlow and Keras libraries to visualize data as grayscale images, manually normalize data, build and train neural network models, and address common data-related challenges.

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.

In section five, we're going to start talking about neural networks. Neural networks are one of the most complex possible models and deal with the most complex of data. We're talking about image recognition, speech recognition, translation, chatbot conversations, even recommendation data, very complex interweaving of variables.

So it's not as well suited to things like the Titanic data, but it's really good for what we're going to use it for today, which is a classic example of neural network use, which is translating handwritten digits to actual numbers. And this is used quite a lot in the real world to produce things like machines to, or systems rather, to scan zip codes, for example, handwritten zip codes at the post office and be able to have with 99 plus percent accuracy what digit that is. That makes it much easier rather than having people go through the millions of letters that the US post office receives every day and just having somebody look at every single one's zip code and manually enter them.

So having something that can handle that complex a piece of data is incredibly powerful. So what is a neural network? Let's talk just for a bit about that. You can compare a neural network to a brain.

And in fact, that's the idea. It's a neural network as in brain network. And it's inspired by the brain, for sure, by how the brain is structured.

It has different layers of what we call neurons, also called nodes, but neuron is more brainy, so we tend to use that word. And all of these layers work together to solve the problem. So you often have an input layer where the data goes into the network, an output layer where the produces a result, like is this a two, is this a five? And in between what are called the hidden layers, because we don't really see those.

Data Analytics Certificate: Live & Hands-on, In NYC or Online, 0% Financing, 1-on-1 Mentoring, Free Retake, Job Prep. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.

They are the layers in between that are able to do the calculations to produce, based on the input, to produce the output. Now neural networks are going to adjust weights in those hidden layers. So they're going to take the, it's similar to the slope that we got with a linear regression, right? What number goes next to X to produce Y? Y equals MX plus B. What's a multiply X by? And ultimately, it's producing those numbers on every single possible bit of input to try to recognize different parts of a number, of a handwritten number, and figure out which parts of these are more or less important to identifying that as that number.

And that's how it trains. It tries different numbers, and it finds which ones produce the best result. And one of the neat things about the way that TensorFlow, our neural network library we'll be using, the way it visualizes things, we'll actually see it learning as we go, which makes it for a very neat visual and a very informative one.

We'll be diving into neural networks as we go. We'll also be talking about our, we'll be using our TensorFlow and Keras machine learning libraries. The data we'll be exploring will be the handwritten digits.

And we'll be covering all of these, how to visualize data as a grayscale image, how to normalize data, not using standard scaler, but just manually, and how to build, compile, train a machine learning model, a neural network machine learning model, and just in general, how neural networks work. We'll get into some issues with the data and how we can improve it. And we'll do all this here in section five to bring this course to a close.

I'll see you folks there.

Colin Jaffe

Colin Jaffe is a programmer, writer, and teacher with a passion for creative code, customizable computing environments, and simple puns. He loves teaching code, from the fundamentals of algorithmic thinking to the business logic and user flow of application building—he particularly enjoys teaching JavaScript, Python, API design, and front-end frameworks.

Colin has taught code to a diverse group of students since learning to code himself, including young men of color at All-Star Code, elementary school kids at The Coding Space, and marginalized groups at Pursuit. He also works as an instructor for Noble Desktop, where he teaches classes in the Full-Stack Web Development Certificate and the Data Science & AI Certificate.

Colin lives in Brooklyn with his wife, two kids, and many intricate board games.

More articles by Colin Jaffe

How to Learn Machine Learning

Master machine learning with hands-on training. Use Python to make, modify, and test your own machine learning models.

Yelp Facebook LinkedIn YouTube Twitter Instagram