What deep learning is and how it differs from classical ML

Updated

Deep learning uses artificial neural networks with multiple hidden layers to learn representations from data automatically. Unlike classical machine learning, which often requires manual feature extraction and smaller datasets, deep learning models need large amounts of data and powerful hardware such as GPUs. The term 'deep' refers to the many layers of algorithms that enable the network to learn hierarchical features.

What deep learning is and how it differs from classical ML
Photo: Jason W. Rocks and Pankaj Mehta, CC BY 4.0

What is deep learning

Deep learning is a subset of machine learning that uses artificial neural networks with multiple layers to model complex patterns in data. According to IBM's definition, deep learning models are built from multilayered neural networks that are loosely modeled on the human brain's structure. The 'deep' in deep learning refers to the presence of at least four hidden layers, though modern architectures often have many more.

AWS explains that deep learning teaches computers to process data in a way inspired by the human brain, enabling them to recognize complex pictures, text, sounds, and other data patterns. Deep learning models power many current AI applications, including computer vision, natural language processing, and generative AI.

The MIT Press textbook by Goodfellow, Bengio, and Courville describes deep learning as a resource for students and practitioners entering the field of machine learning in general and deep learning in particular. The book covers the mathematical foundations and practical methodology for building deep networks.

How deep learning works

Deep learning models are composed of layers of interconnected nodes called neurons. Each neuron performs a mathematical operation on its inputs, applying a weight and an activation function. The NVIDIA glossary notes that the word 'deep' represents the many layers of algorithms used to recognize patterns in data. During training, the network adjusts the weights through a process called backpropagation, which minimizes the difference between predicted and actual outputs.

Google Cloud documentation explains that deep learning works by using artificial neural networks to learn from data. The first layer might learn to identify edges, the second layer shapes, and the third layer objects. As the network learns, the weights on connections between nodes are adjusted based on performance on training data, often using techniques like backpropagation.

The MIT News article describes neural nets as a means of doing machine learning where a computer learns by analyzing training examples. Each node assigns a weight to incoming connections, sums the weighted inputs, and if the sum exceeds a threshold, the node fires and passes data to the next layer. This process is repeated across many layers to produce a final output.

Key differences from classical machine learning

Classical machine learning algorithms typically require manual feature extraction, where a human expert identifies relevant features from the data. In contrast, deep learning models automatically learn high-level features from raw data. The Microsoft Learn article states that in classical machine learning, the algorithm requires explicit guidance on how to make accurate predictions, such as through feature extraction, while deep learning can learn through its own data processing due to the artificial neural network structure.

Data requirements also differ significantly. Classical ML can work with small amounts of data, whereas deep learning needs large training datasets to achieve high accuracy. The Microsoft Learn table compares the two: machine learning can use small amounts of data, while deep learning needs large amounts. Hardware dependencies differ as well: classical ML can run on low-end machines, but deep learning depends on high-end machines with GPUs to perform the many matrix multiplication operations efficiently.

Training time is another distinction. Classical ML models train relatively quickly, from seconds to hours, while deep learning models usually take much longer because they involve many layers. The output format also varies: classical ML typically outputs a numerical value such as a score or classification, whereas deep learning can produce multiple formats including text, scores, or sound.

Common types of deep learning models

Convolutional neural networks (CNNs) are designed for image recognition and processing. The Google Cloud documentation explains that CNNs are particularly good at identifying objects in images even when partially obscured. NVIDIA notes that CNNs are used in autonomous vehicles, medical imaging, and fusion energy research.

Recurrent neural networks (RNNs) are used for natural language processing and speech recognition. They understand the context of a sentence or phrase and can generate text or translate languages. The NVIDIA glossary states that RNNs provide the natural language processing brains for virtual assistants like Amazon Alexa and Google Assistant.

Deep reinforcement learning combines deep learning with reinforcement learning, allowing an agent learns to act in an environment by interacting and receiving rewards or penalties. This type is used in robotics and game playing, as noted by Google Cloud.

Applications and challenges

Deep learning is applied across many domains. The AWS documentation lists use cases including computer vision (object detection, facial recognition), speech recognition (virtual assistants, transcription), natural language processing (chatbots, sentiment analysis), recommendation engines, and generative AI. Self-driving cars, medical image analysis, and fraud detection are prominent examples.

Challenges include the need for large amounts of labeled data, high computational cost, and the risk of overfitting. The Google Cloud documentation mentions that deep learning models may be prone to overfitting, meaning they learn noise rather than underlying relationships. Bias in training data can also lead to unfair or inaccurate predictions. Cloud computing services have become integral to addressing the hardware demands, as noted by IBM.

How a deep learning model is trainedStep 1: Input data is fed into the network; Step 2: Data passes forward through hidden layers; Step 3: Output is compared to the correct label; Step 4: Error is computed and backpropagated; Step 5: Weights are adjusted to reduce error; Step 6: Process repeats until accuracy improvesHow a deep learning model is trainedInput data is fed into the networkData passes forward through hidden layersOutput is compared to the correct labelError is computed and backpropagatedWeights are adjusted to reduce errorProcess repeats until accuracy improves
How a deep learning model is trained
Comparison of classical machine learning and deep learning
AspectClassical Machine LearningDeep Learning
Data sizeCan work with small amounts of dataNeeds large amounts of training data
Feature engineeringRequires manual feature extraction by usersLearns high-level features automatically
HardwareCan run on low-end machines, less computational power neededDepends on high-end machines, especially GPUs
Training timeRelatively short, seconds to hoursUsually long due to many layers
InterpretabilityOften more interpretableOften considered a 'black box'
Output formatTypically numerical value (score or classification)Can be multiple formats (text, score, sound)

Frequently asked questions

What is a neural network?

A neural network is a computing system modeled loosely on the human brain, consisting of interconnected nodes (neurons) organized in layers. Each node applies a weight to its inputs and passes the result through an activation function.

Why is deep learning called 'deep'?

The term 'deep' refers to the many layers of algorithms in the neural network. According to IBM, deep learning refers to training models with at least four layers, though modern architectures often have many more.

What is backpropagation?

Backpropagation is a training algorithm that computes the gradient of the loss function with respect to the network's weights. It sends errors backward through the network to adjust weights and improve the model, as described by NVIDIA.

Do deep learning models need GPUs?

Yes, deep learning models typically require GPUs because they perform many matrix multiplication operations in parallel. NVIDIA explains that GPUs have hundreds of cores that can handle thousands of threads simultaneously, providing significant speedup over CPU-only training.

What is transfer learning?

Transfer learning reuses knowledge from a previously solved task to address a related but different problem. Microsoft Learn states that by repurposing the final layers of a pre-trained model, one can significantly reduce the time, data, and compute resources needed to train a new model.