Neural networks are machine learning models loosely inspired by the brain. They consist of layers of connected artificial neurons that process data and produce a prediction.
How neural networks work
A neural network learns to recognize patterns in data. It is made of many simple processing units called nodes, or neurons. Each connection between two nodes has a weight, and during training, the network adjusts these weights so that its predictions get closer to the correct answers.
In forward propagation, the input data passes through the layers of the network. Each layer performs calculations on the data and passes the result to the next layer. The last layer produces the prediction, such as a class label or a set of values.
In backward propagation, or backpropagation, the network compares its prediction with the correct answer and works backward through the layers to find out how each weight should change to reduce the error.
A common problem is overfitting: the network fits its training data so closely that it learns noise and details specific to that data, and then makes worse predictions on new data.
On the other hand, neural networks can handle very large and complex datasets, and they usually get better as they are trained on more data.
Neural networks and deep learning
A neural network is a type of machine learning model made of layers of connected neurons. Neural networks are used for image recognition, speech recognition, natural language processing, and many other tasks.
Deep learning is the subfield of machine learning that uses neural networks with many layers, called deep neural networks. Each layer works on the output of the previous one, so the network learns features of the data on its own: simple ones in the first layers and more abstract ones in the later layers. This makes deep learning a good fit for images, audio, and text, where the data is complex and unstructured.
History of neural networks
Neural network research started in the 1940s, when scientists tried to describe the neurons of the brain in mathematical form. In 1943, Warren McCulloch and Walter Pitts proposed the threshold logic unit (TLU), a simple neuron model that outputs 1 or 0 depending on whether its input passes a threshold. In the late 1950s, Frank Rosenblatt proposed the perceptron, a single-layer network for simple linear classification.
Multi-layer networks were studied in the 1960s and 1970s, but computers were slow and there was no practical way to train them. In 1974, Paul Werbos described the backpropagation algorithm for training multi-layer networks in his PhD thesis. The method became widely known after a 1986 paper by David Rumelhart, Geoffrey Hinton, and Ronald Williams. In the 1980s and 1990s, neural networks found their first practical uses, such as reading handwritten digits on bank checks.
Since around 2012, deep learning has progressed quickly thanks to large datasets and fast hardware. Deep networks now give the best results in image and speech recognition and in natural language processing, and large language models such as ChatGPT are neural networks too.
Examples of neural networks applications and implementations
In image recognition, neural networks identify objects, people, and scenes in images and videos, and they power image search, tagging, and captioning. In speech recognition, they transcribe speech to text and recognize spoken commands in voice assistants, dictation software, and speech-to-text services.
In natural language processing, neural networks understand and generate text: they translate, summarize, analyze sentiment, and answer questions. Other applications include self-driving cars, healthcare, recommendation systems, robotics, fraud detection, and games.
A neural network can be trained with supervised, unsupervised, or reinforcement learning, and it is often one part of a larger system.
The conceptual difference between classic ML and NN
Neural networks differ from classic machine learning algorithms in a few ways.
Classic ML algorithms, such as linear regression, logistic regression, and decision trees, have a simple structure: a formula with a few coefficients or a tree of if-then rules. A neural network has many layers of connected neurons, which lets it model much more complex patterns.
Classic algorithms usually need manual feature engineering: a person decides which features to compute from the raw data and prepares them in a form the algorithm can use. Neural networks learn useful features from the data themselves.
Linear models can't capture non-linear relationships unless you add non-linear features by hand. Decision trees and other non-linear methods do better, but they still struggle with very complex relationships, such as the ones in raw images or speech. Neural networks model non-linearity with the non-linear activation functions of their neurons.
The price is that neural networks need much more computing power than classic algorithms, and it's harder to explain why they make a particular prediction.
Why NN became so popular
Neural networks became popular once there was enough data to train deep networks, which can learn complex patterns but need many examples to do so.
Graphics processing units (GPUs) played a big role too. GPUs were built to render graphics, which takes many simple calculations running in parallel. Training a neural network consists of the same kind of calculations, mostly matrix multiplications, so GPUs train large networks much faster than ordinary processors.
Open-source libraries such as PyTorch, TensorFlow/Keras, and JAX made it much easier for researchers and developers to build, train, and deploy neural networks.
Conclusion
A neural network learns patterns from data by adjusting the weights of the connections between its neurons: forward propagation makes a prediction, and backpropagation corrects the weights.
Deep learning uses networks with many layers, which learn features of the data on their own.
Compared with classic ML algorithms, neural networks can model more complex, non-linear patterns, but they need more computing power and are harder to interpret.
Large datasets, GPUs, and open-source libraries such as PyTorch made neural networks practical, and they now lead in image and speech recognition and in language processing.