π Lesson 7: Neural Networks and How They Work
Lesson Objective:
To help learners understand what Artificial Neural Networks (ANNs) are, how they are inspired by the human brain, and how they function to enable modern AI systems.
What Are Neural Networks?
Note: While their full name is Artificial Neural Networks (ANNs), they are commonly referred to as “Neural Networks”, or sometimes “Neural Nets”
A Neural Network is a type of machine learning model that is inspired by the structure and function of the human brain.
Just like our brains have neurons connected by synapses, a neural network consists of digital βneuronsβ arranged in layers β and they learn by passing signals between them.
Neural Networks allow machines to learn from complex data like images, sound, and language.
The Inspiration: The Human Brain
Your brain contains about 86 billion neurons.
Each neuron receives signals, processes them, and sends outputs to other neurons.
A neural network simulates this process digitally, with layers of artificial neurons that:
-
Receive input (data)
-
Process it using weighted connections
-
Pass results to the next layer
-
Output a prediction or decision
Basic Structure of a Neural Network
-
Input Layer β Receives the data (e.g., pixels in an image or words in a sentence)
-
Hidden Layers β Perform calculations and learn patterns
-
Output Layer β Produces the final answer or prediction
Example:
For a photo of a cat, the output layer might say:
β 95% Cat, 4% Dog, 1% Other
Big Question: How Does a Neural Network Learn?
-
Data is passed through the network.
-
Each connection between neurons has a weight (importance level).
-
The system compares its prediction with the correct answer (label).
-
It adjusts the weights to improve accuracy β a process called backpropagation.
-
This cycle is repeated thousands or millions of times until the network becomes very good at the task.
Think of it as a “trial and error” based learningβ but at lightning speed!
Real-Life Example: Image Recognition
Letβs say we want to build an AI (using Neural Networks) to recognize cats in photos.
-
We show it thousands of labeled images (cat or not-cat).
-
The neural network starts learning what a βcatβ looks like: eyes, ear shape, whiskers, fur texture, etc. All of these biological features have similar patterns in cats, and neural network learns these patterns (at a pixel level on the images).
-
Eventually, after seeing thousands of cats, it can look at a new image itβs never seen before and say: βThatβs a cat!β
Analogy: Layers of Understanding
Imagine a human learning to recognize a dog:
-
First, we see the shape (ears, tail)
-
Then, we remember past experiences
-
Then, we distinguish it from a wolf or a fox
-
Finally, we say βThatβs a dog!β
Neural networks go through layers of analysis, just like we do β from raw data to meaning.
Business Use Cases of Neural Networks
Industry | AI Use Case |
---|---|
Healthcare | Detecting tumors in medical scans |
Finance | Identifying fraudulent transactions |
Retail | Recommending products based on behavior |
Entertainment | Personalizing content on Netflix or Spotify |
Transportation | Powering self-driving car vision systems |
Fun Fact
The neural network behind ChatGPT (the most popular AI program currently) is called a Transformer, which is a special kind of deep neural network designed to understand human language. It has billions of artificial neurons!
Recommended Reading to learn more about Transformers:
https://gsbx.org/transformers-for-deep-learning-ai/
Reflection Prompt (for Learners)
-
Have you ever used an app or tool (like Google Photos or facial recognition) that may have used a neural network behind the scenes?
β Quick Quiz (not scored)
-
What is a neural network inspired by?
-
What are the three main parts of a neural network?
-
What is backpropagation?
-
Give one real-world use case for neural networks.
-
True or False: Neural networks are only used for images.
Key Takeaway
Neural Networks are the brain behind modern AI.
They allow machines to learn patterns, make predictions, and adapt to complex data β just like how our brains learn from experience.