# Neural Networks Explained Simply: How Perceptrons Work

> This beginner-friendly guide draws inspiration from neuroscience to explain the core principles of neural networks. It breaks down how a perceptron mimics human brain neurons by processing weighted inputs and using a threshold to output 0 or 1, while using a practical handwritten digit 8 recognition example to demonstrate supervised learning and the perceptron learning algorithm.

- Source: https://www.waytoagi.com/en/kb/learning-path/perceptron-neural-network
- Original (Feishu, Chinese): https://waytoagi.feishu.cn/wiki/XQSDwNHHCiROnJkD3dMciVlvnmc
- Updated: 2026-10-27

---

> 🔗 Original link: https://mp.weixin.qq.com/s/O0k1o5x_iDNTVN-50D_fVQ

> ⏰ Published: 2024-08-12

> Author: **Digital Life Jax**

The development of artificial intelligence began in 1950. Over the decades, it has gone through various milestones and transformations. The related neural network technologies have also evolved from the initial single-layer perceptron to complex hierarchical and convolutional neural networks, continuously driving progress in the AI field. This momentum culminated in 2022 with the release of ChatGPT, which completely captured the public’s attention.

Artificial intelligence technology has undergone a long iterative process. No matter how it evolves, it cannot be separated from the foundational inspiration of the earliest neural network model — the “perceptron.” As a major milestone in the field of artificial intelligence, this article focuses on explaining the implementation of the “perceptron.”

**Let’s start by truly understanding the perceptron, and through it, gain a solid grasp of what neural networks really are.**


# 01. Neural Networks — The Perceptron

Neural network technology draws inspiration from neuroscience and seeks to capture some of the unconscious cognitive processes behind humans’ so-called “rapid perception,” such as the brain’s automatic ability to recognize faces or understand speech.

In the late 1950s, psychologist Frank Rosenblatt was inspired by the way neurons in the human brain process information. A neuron is a cell in the brain that can receive electrical or chemical input signals from other connected neurons.

**Simply put, a neuron adds up all the input signals it receives from other neurons. If the total reaches a certain threshold level, the neuron becomes activated.**

Importantly, the different connections (synapses) between a given neuron and other neurons have different strengths. When calculating the total input signal, the neuron assigns smaller weights to weak connections and larger weights to strong ones.

For computer scientists, this information-processing mechanism in neurons can be simulated by a computer program with multiple inputs and a single output — the perceptron.

![](https://www.waytoagi.com/api/kb-media/VYKPbvYVNozqA5xyddLcDNePn2e)

Analogy between a biological neuron and a perceptron: A neuron in the brain (A) and a simple perceptron (B).

In the diagram, (A) shows a neuron with its dendrites (structures that bring input signals to the cell), cell body, and axon (the output channel). (B) illustrates the structure of a simple perceptron.

Similar to a neuron, the perceptron adds up all the input signals it receives. If the sum is greater than or equal to the perceptron’s threshold, it outputs 1 (activated); otherwise, it outputs 0 (not activated).

To simulate the varying connection strengths of neurons, Rosenblatt proposed assigning a weight to each input of the perceptron. When summing the inputs, each input is first multiplied by its weight before being added to the total.

The threshold of the perceptron is a value set by the programmer, but it can also be learned by the perceptron itself. We will explain this further later in the article.

**In short, a perceptron is a simple program that makes a yes-or-no decision (outputting 1 or 0) based on whether the weighted sum of its inputs meets a certain threshold.**

In everyday life, you probably make decisions in a similar way.

For example, you might hear from several friends how much they liked a particular movie. However, you trust the taste of some friends more than others, so you unconsciously assign higher weights to their opinions.

If the total “liking score” from your friends is large enough (i.e., exceeds some unconscious threshold), you decide to watch the movie. If a perceptron had friends, it would decide whether to watch a movie in exactly the same way.

# 02. Image Recognition

Inspired by the neural networks in the human brain, Rosenblatt proposed that perceptron networks could be used to perform visual tasks such as face and object recognition. To understand how a perceptron network works, we will explore how a single perceptron can perform a specific visual task—recognizing the handwritten digit shown in the image below.

![](https://www.waytoagi.com/api/kb-media/PUBLbLc2PomXdLxrQsEcwIECnzg)

We will design the perceptron as an “8” detector. That is, if the input is an image of the digit 8, it outputs 1; if the input image contains any other digit, it outputs 0.

Designing such a detector requires us to first figure out how to convert an image into a set of numerical inputs, and then determine the weights and threshold of the perceptron so that it can produce the correct output (1 for 8, 0 for all other digits).

![](https://www.waytoagi.com/api/kb-media/OdOGbjJMJojQtoxz4JecZXmTnne)

Note: Each pixel in the 18×18 pixel image corresponds to one input of the perceptron. The perceptron therefore has a total of 324 (18×18) inputs.

The image above (A) shows an enlarged handwritten digit 8. The X-axis contains 18 grid squares, and the Y-axis also contains 18 grid squares, resulting in a total of 18×18 = 324 grid squares.

Each grid square (pixel) has an intensity value that can be represented numerically—**pixel intensity**. In a black-and-white image, a pure white square has a pixel intensity of 255, a pure black square has a pixel intensity of 0, and gray squares fall somewhere in between.

This perceptron has 324 (18×18) inputs, each corresponding to the pixel intensity of one grid square. Each input also has its own weight.

So how can we accurately set the correct weights and threshold for a given task? Rosenblatt once again provided an answer inspired by the brain: **the perceptron should learn these values by itself.**

From the perspective of behavioral psychology, positive and negative reinforcement can be used to train rats and pigeons to perform specific tasks.

A perceptron should be trained on samples in a similar way: rewarded when it produces the correct behavior and punished when it makes a mistake. Today, this form of conditioned computation is known in the field of artificial intelligence as **supervised learning**.

# 03. Perceptron Learning Algorithm

During training, the learning system is given a sample, which produces an output. At that moment, it is given a “supervisory signal” that indicates how far the output deviates from the correct answer. The system then adjusts its weights and threshold based on this signal.

Supervised learning typically requires a large number of positive examples (e.g., a collection of the digit “8” written by different people) and negative examples (e.g., a collection of other handwritten digits that are not 8). Each sample is labeled by a human with its category—“8” or “not 8”—and these labels serve as the supervisory signal.

The set of positive and negative samples used to train the system is called the **training set**. The remaining samples, known as the **test set**, are used to evaluate the system’s performance after training, allowing us to observe how well it performs on general cases rather than just on the data it was trained on.

One of the most important terms in computer science is **algorithm**—a “recipe” of steps that a computer follows to solve a specific problem. Rosenblatt’s primary contribution to artificial intelligence was the design of a specific algorithm: the **perceptron learning algorithm**. Using this algorithm, a perceptron can be trained on samples to determine the weights and threshold that produce correct answers.

Initially, the perceptron’s weights and threshold are set to random numbers between -1 and 1. In our example, the weight for the first input might be set to 0.2, the weight for the second input to -0.6, and the threshold to 0.7. These initial values can be easily generated using a random number generator (before training begins, the weights and threshold for each input are randomly initialized).

Training can then begin. First, the initial training sample is fed into the perceptron. At this point, the perceptron does not yet know the correct class label. It multiplies each input by its corresponding weight, sums all the results, compares the sum with the threshold, and outputs either 1 or 0. An output of 1 indicates that the input is an “8,” while 0 indicates that it is “not 8.”

Next, the perceptron’s output is compared with the correct label provided by a human (“8” or “not 8”). If the perceptron’s answer is correct, its weights and threshold remain unchanged. However, if it is wrong, the weights and threshold are adjusted so that the perceptron’s answer for this training sample moves closer to the correct answer.

In addition, the amount by which each weight is changed depends on the value of its associated input. In other words, the “blame” for the error is distributed according to which inputs had a larger or smaller influence.

In the 324-pixel grid of the “8” shown in the image above, pure black squares (pixel intensity = 0) have a large influence, while pure white squares (pixel intensity = 255) have no influence at all.

**For readers interested in the mathematical principles, the computational details are provided below:**

| From a mathematical perspective, the perceptron learning algorithm is as follows. For each weight *wⱼ*:  
*wⱼ* ← *wⱼ* + η(*t* − *y*)*xⱼ*,  
where *t* is the correct output (1 or 0), *y* is the perceptron’s actual output for the given input, *xⱼ* is the input associated with weight *wⱼ*, and η is the learning rate set by the programmer. The arrow denotes an update.  
The threshold is incorporated by adding an extra input *x₀* = 1 with corresponding weight *w₀* = −threshold.  
With this additional input and weight (called the bias), the perceptron fires only when the dot product of the input vector and the weight vector is greater than or equal to 0. Typically, input values are scaled or otherwise transformed to prevent the weights from becoming excessively large. |

The next training sample repeats the entire process. The perceptron runs through all the training samples many times, making small adjustments to the weights and threshold each time it makes an error.

As the behavioral psychologist B.F. Skinner discovered while training pigeons, learning gradually through a large number of trials is far more effective. If the weights and threshold are changed too drastically in a single trial, the system may end up learning the wrong thing.

For example, the system might become overly focused on the fact that the top and bottom halves of an “8” are always exactly the same size. After many repeated passes over the training samples, the system will eventually obtain a set of weights and a threshold that produce the correct answer for every sample in the training set. At this point, we can evaluate the perceptron using the test set to see how well it performs on images it has never seen before.

As long as the system is provided with enough training samples, its recognition accuracy will continue to improve. Once the correct recognition rate for the digit “8” reaches a certain level, the adjustments to the input weights and threshold for “8” will become smaller and smaller, eventually stabilizing at a balanced value.

**At this stage, we can say that the system has completed training and has achieved XX% accuracy in recognizing the digit “8.”**

# 04, The “Sub-Symbolic” School

Rosenblatt mathematically proved that for a specific class of tasks, a perceptron, in principle, could learn to perform those tasks with perfect accuracy after sufficient training. However, because a perceptron’s “knowledge” consists solely of the pair of numerical values — the weights and threshold it has learned — it is extremely difficult for us to discover the rules the perceptron is actually using when performing a recognition task.

The weights and threshold of a perceptron do not represent specific concepts, and these numbers are very hard to translate into meanings that humans can understand. This situation becomes even more complex in today’s neural networks that contain millions or even billions of weights.

One might draw a rough analogy between the perceptron and the human brain. If I could open your brain and observe a portion of its hundreds of billions of neurons, I probably still wouldn’t be able to clearly discern your thoughts or the rules you use to make a particular decision.

Yet the human brain has produced language, which allows you to use symbols (words and phrases) to convey your thoughts to me, or to explain the purpose behind something you do.

In this sense, our neural activations can be considered sub-symbolic, yet from these sub-symbolic foundations the brain somehow creates symbols. By analogy with the sub-symbolic neural networks in the brain, the perceptron and more complex artificial neural networks are also referred to as the “sub-symbolic” school.

**Supporters of this school believe that to achieve artificial intelligence, it must emerge from neuron-like structures in a way similar to how intelligent symbol manipulation emerges from the brain.**

Using a single-neuron structure like the perceptron is far from enough. Can a machine learn to translate between languages and text given a sufficient number of training samples? How can we make machines walk, speak, and recognize humans?

**Thus, hierarchical neural networks, convolutional neural networks, recurrent neural networks, deep belief networks, and other models came rushing onto the stage.**

# 05, What Are Large Language Models?

Understanding the principles of the perceptron and single neurons lays a better foundation for subsequently grasping “machine learning based on deep neural networks.”

The large models we often hear about have tens of billions or even hundreds of billions of parameters. These “parameters” are simply the sum of all the input weights and output thresholds in the neural network.

Suppose a neuron has 9 input weights and 1 output threshold; we can then say that this neuron has 10 parameters.

When we have 10 billion such neurons, the neural network model can be said to have 100 billion parameters — that is, what we call a “hundred-billion-parameter-scale large model.”

**Pretty simple, right? So that’s what all those official mentions of “tens of billions” or “hundreds of billions of parameters” in large models actually mean.**

Let’s extend the idea a little further.

The perceptron (single neuron) mentioned above, through certain learning algorithms, can endow that single neuron with a degree of simple intelligence — for example, recognizing individual digits.

Now imagine: if a single neuron can produce simple intelligent behavior through learning algorithms, what happens when there are 10 billion neurons? The collective intelligence produced by 10 billion neurons working together — how immensely powerful would that intelligence be?

Each neuron only needs to remember its own tiny set of rules and can possess the ability to recognize something very small. When you scale the number of such neurons up to 10 billion or 100 billion, **what emerges is what we now frequently hear about: collective intelligence, or intelligence emergence!**

A classic example of “intelligence emergence” in nature is the ant. A single ant is a very simple intelligent creature, but once a colony of ants gathers, they can build extraordinarily complex nest structures. (Feel free to look it up if you’re interested.)

And what about the human brain? According to scientific statistics, the human brain contains approximately 100 billion neurons. These vast numbers of neurons form an extremely complex neural network, which is the foundation of human intelligence.

So now you know why you still need to eat a lot of food after a day at work even if you didn’t exercise — because the operation of your massive neural network also consumes energy. AI replenishes its energy by consuming electricity, while we replenish ours by consuming food (another piece of weird knowledge added 🤔).

# 06. A Thought Exercise

Suppose we are now training a neural network that contains 1 billion neurons. The goal of this network is to recognize whether an animal in an image is a dog or a cat.

Each neuron only needs to be responsible for identifying a very small part. For example, some neurons are responsible for recognizing the contour of a cat’s face, while others are responsible for recognizing a cat’s eyes. These recognition results are then passed to another group of neurons in the lower layer, which combine the cat’s contour and eye features to determine whether the animal is indeed a cat.

Now imagine: among these 1 billion neurons, if the final recognition result is wrong, how can we precisely locate which specific group of neurons made the mistake, ultimately causing the entire recognition to fail?

![](https://www.waytoagi.com/api/kb-media/HNSdbb18WoRlxdxJwXhcLTCinBe)

We can use the image above as an example. Each ⚪️ in the diagram represents a neuron. The recognition result of one neuron is sent to all downstream neurons. After receiving inputs from upstream neurons, the downstream neurons make their own judgments and then pass their outputs to the next layer of neurons.

This process continues layer by layer through the neural network until the final output neurons produce a result based on all the upstream information.

If the final output is an incorrect value, how do we trace back and identify which neuron (or neurons) in the middle produced the wrong recognition result that led to the final error?

**Only by locating which neurons caused the anomaly after the final result is wrong can we adjust the recognition weights of those specific neurons individually, thereby improving the overall accuracy of the final recognition.**

How can this be achieved? Feel free to think about it. But there’s no rush to give an answer, because this problem is extremely difficult—so difficult that it once stalled the entire field of neural networks for many years.

Just imagine: a group of the world’s top minds (both men and women) were unable to break through this problem, which delayed the progress of AI for years. That should give you a sense of how significant this challenge was.

**Of course, I will reveal the answer in the next article and explain the related concepts.** Readers who are interested, don’t forget to follow our official account at the bottom of the article. More exciting content awaits you!

# 07. Conclusion

![](https://www.waytoagi.com/api/kb-media/Ky3cbaJuGoxgX5xFZS8cmGj4neb)

The development history of AI (Image source: Beijing Academy of Artificial Intelligence)

From its proposal in 1950 to the achievements we see today, the development of AI has only spanned a few decades.

For the general public, our use of AI began to become widespread only in the past 20 years, alongside the growth of the domestic internet.

The earliest applications were mainly chatbots and customer service robots based on NLP technology—this is also the field the author has been working in for the past few years. (People used to complain that robots were dumb; now the narrative has flipped to “AI is about to replace humans.” How quickly public opinion changes, haha.)

Subsequently, breakthroughs in machine translation (Chinese-English), speech recognition, face recognition, and other technologies emerged. These breakthroughs are now widely used in daily life—such as voice assistants, smart translation devices, and facial recognition payment systems.

However, most of these earlier technological breakthroughs were limited to specific domains, with relatively narrow model applications. For example, a translation bot could only do translation after training, and a customer service bot could only give accurate replies within a specific context.

Then came the breakthrough of large language models such as OpenAI’s ChatGPT, which demonstrated a new development path to the world. Through large-scale pre-training, models can exhibit a wide range of intelligent capabilities. A single model can now handle chatting, translation, solving math problems, writing code, providing writing guidance, and even offering emotional support.

This kind of multifunctional, human-like intelligent AI model has opened a new technical direction for the future of AI, while also bringing new anxieties to humanity:

**We were promised that AI would do the sweeping and dishwashing so humans could write poetry and paint. How come now AI is writing poetry and painting, while we humans are still sweeping and washing dishes 😂**

When the author first saw this online joke, it was genuinely funny. But if you think about it carefully, you’ll realize that **“human-machine symbiosis”** is almost an inevitable path for human development.

Which young person today goes out without their phone? Who doesn’t use a computer at work? Phones and computers *are* machines.

We have unknowingly been living alongside these machines for decades. Far from lowering our quality of life, they have greatly improved the convenience of our daily lives.

When computers first became widespread, they replaced some highly repetitive jobs, but they also fueled the rise of the software industry. Software engineers who understood how computers worked, product managers who used computers to uncover human needs, and white-collar workers who leveraged software to boost efficiency—all of them gained new opportunities and advancement after computers became ubiquitous.

**Therefore, the birth of new AI technology will inevitably go through a similar process. Rather than worrying about the present, it’s better to bet on the future.** Human-machine symbiosis is bound to be the inevitable trend. In large part, personal value may come from how well one can collaborate seamlessly with intelligent machines.

Only by deeply understanding the principles behind AI can we better harness it. Let’s learn about AI together, move forward hand in hand, and embrace the coming era of intelligence!

# 08. Final Thoughts

To be honest, I originally just wanted to document my own learning journey. But the more I wrote, the more addicted I became—because I realized that chatting with all of you through the screen is way more fun than studying AI alone!

**If you also enjoy tinkering with artificial intelligence, how about we form a little AI squad? Come hang out in my friend circle—coffee’s on me ☕️ (When you scan the code to connect, please remember to note “AI Buddy” →)**

![](https://www.waytoagi.com/api/kb-media/A8PwbmbAyo9eghxqbXtceXognZg)

**A quiet word for my socially anxious friends: If adding a new contact requires half an hour of mental preparation, our official account can be your “online tree hollow” 🌱**

**Feel free to type out any questions directly. I read every single message carefully (serious face).**

**Once you follow, you’ll also be the first to receive new articles, AI gadgets, pitfall-avoidance guides, private tool collections…**

**All neatly packaged and delivered straight to you (just scan here to follow →)**

![](https://www.waytoagi.com/api/kb-media/ZdhVbdZs8okfrAxU2EXcJYH2nor)
