Foundation of AI

Deep Learning

Build neural networks that learn from data — the technology behind image recognition, ChatGPT, and self-driving cars.

Beginner Friendly Self-Paced Prerequisites: Python, basic maths (linear algebra helps)
Start Learning Deep Learning

What You'll Learn

  • What neurons, layers, and neural networks are — with simple intuition
  • How a neural network learns using backpropagation and gradient descent
  • How to build a neural network with Keras (TensorFlow) in Python
  • Convolutional Neural Networks (CNNs) for image classification
  • Recurrent Neural Networks (RNNs) and LSTMs for sequences and text
  • Transfer learning — reusing pre-trained models like ResNet and BERT
  • How to prevent overfitting with dropout, regularisation, and early stopping
  • The Transformer architecture that powers GPT, BERT, and modern LLMs

Introduction to Deep Learning

Deep Learning is a branch of machine learning that uses artificial neural networks with many layers to learn patterns directly from raw data. Instead of manually defining rules (like "a cat has pointy ears"), a deep neural network automatically discovers the features that distinguish cats from dogs by looking at millions of labelled examples.

The term "deep" refers to the many layers of a neural network. Each layer transforms the data into a higher-level representation. The first layer might detect edges in an image; the next detects shapes made of edges; the next detects object parts; and the final layer identifies the object. This hierarchical learning is what makes deep learning so powerful for images, text, audio, and video.

Deep learning is the foundation behind almost every major AI breakthrough of the last decade: image recognition (CNNs), language models (Transformers), speech recognition, AlphaGo, and generative AI like DALL-E and GPT-4. With frameworks like TensorFlow/Keras and PyTorch, you can build and train neural networks in Python with just a few lines of code.

Video Tutorials

Handpicked free YouTube videos to accelerate your understanding

🎧 Playing in English

But what is a neural network?

3Blue1Brown 19 min 🇬🇧 English

The most beautiful neural network intro ever made. Visually explains neurons, layers, weights, and activation functions with stunning animations.

🎧 Playing in English

Let's build GPT from scratch in code

Andrej Karpathy 2 hr 🇬🇧 English

Build a working GPT language model from absolute scratch using Python and PyTorch. The definitive hands-on deep learning tutorial.

Build and train your first neural network with Keras

Copy the code below and paste it into your Python environment or our free online compiler.

python
# Install: pip install tensorflow

import tensorflow as tf
from tensorflow import keras
import numpy as np

# 1. Load the MNIST dataset (70,000 handwritten digit images)
(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()

# 2. Normalise pixel values from 0-255 to 0-1
x_train = x_train / 255.0
x_test  = x_test  / 255.0

# 3. Build the neural network
#    Input: 28x28 image = 784 pixels
#    Hidden Layer 1: 128 neurons with ReLU activation
#    Hidden Layer 2: 64 neurons with ReLU activation
#    Output: 10 neurons (one per digit 0-9) with softmax
model = keras.Sequential([
    keras.layers.Flatten(input_shape=(28, 28)),   # 784 inputs
    keras.layers.Dense(128, activation='relu'),    # hidden layer 1
    keras.layers.Dropout(0.2),                     # prevent overfitting
    keras.layers.Dense(64, activation='relu'),     # hidden layer 2
    keras.layers.Dense(10, activation='softmax')   # output: 10 classes
])

# 4. Compile: choose optimiser, loss function, and metric
model.compile(
    optimizer='adam',
    loss='sparse_categorical_crossentropy',
    metrics=['accuracy']
)

# 5. Train for 5 epochs
model.fit(x_train, y_train, epochs=5, validation_split=0.1)

# 6. Evaluate on test data
test_loss, test_acc = model.evaluate(x_test, y_test)
print(f"Test accuracy: {test_acc:.4f}")   # ~0.979 (97.9%!)
Want to run this code in your browser — no setup needed? Open Free Compiler →

Key Concepts Explained

Master these terms and you'll understand 80% of the conversations in this field.

Neuron

The basic unit of a neural network. It takes several inputs, multiplies each by a weight, adds a bias, applies an activation function, and outputs a single number.

Layer

A group of neurons. An Input layer receives raw data. Hidden layers transform data. The Output layer produces the final prediction. Deep networks have many hidden layers.

Activation Function

A function applied to each neuron's output to introduce non-linearity. ReLU (max(0,x)) is the most common in hidden layers. Softmax is used in output layers for classification.

Backpropagation

The algorithm that trains neural networks. It calculates how much each weight contributed to the error, then adjusts all weights in the direction that reduces the error.

Gradient Descent

The optimisation algorithm that iteratively updates weights by moving them in the direction that decreases the loss function. Adam is a popular adaptive variant.

Overfitting

When the model memorises the training data too well and performs poorly on new data. Prevented by Dropout, L2 regularisation, data augmentation, and early stopping.

CNN (Convolutional Neural Network)

A network architecture specially designed for images. Convolutional layers detect local patterns (edges, textures) while pooling layers reduce spatial size.

Transformer

A modern architecture that uses self-attention to model relationships between all parts of the input at once. Powers GPT, BERT, and virtually all state-of-the-art NLP and vision models.

Your Deep Learning Learning Path

Follow these steps in order — each one builds on the last. Designed for complete beginners.

  1. 1

    Python & NumPy

    Learn Python and NumPy array operations. Deep learning is built on matrix multiplication, which NumPy handles efficiently.

  2. 2

    ML Foundations

    Understand supervised learning, loss functions, train/test splits, and linear regression. These concepts transfer directly to neural networks.

  3. 3

    First Neural Network

    Build a simple fully-connected network with Keras to classify the MNIST handwritten digits dataset.

  4. 4

    Convolutional Networks

    Learn CNNs and build an image classifier. Experiment with Conv2D layers, MaxPooling, and batch normalisation.

  5. 5

    Transfer Learning

    Download a pre-trained ResNet or EfficientNet and fine-tune its final layers on your own images. 90%+ accuracy with almost no data.

  6. 6

    Sequence Models

    Build RNNs and LSTMs for text classification, time series prediction, and next-word prediction.

  7. 7

    Transformers & LLMs

    Understand the attention mechanism and how Transformers work. Build a text classifier using a pre-trained BERT model from HuggingFace.

Ready to master Deep Learning?

Explore our free tutorials, hands-on code examples, and interview questions. No sign-up. No paywalls. Forever free.