521153S Deep Learning
Fall 2024
Lecturer: Qing Liu
Slides: Jukka Komulainen
Zhuo Su
Qing Liu
Today’s agenda
‒ Course overview
‒ Introduction to what is deep learning
‒ Overview on machine learning with neural networks
University of Oulu
Teaching staff
Instructor Teaching Assistants
Qing Liu Yante Li Xiaoyun Zhang Ali Salar Mohamed Boyi Zheng
ElHabebe
Emails: [Link]@[Link]
University of Oulu
General information
‒ Remote course this year
• Please check the zoom links in Moodle
‒ Remember to register for the course in Peppi!
‒ Course material available in Moodle
• Schedule
• Lecture slides & videos
• Programming assignments and final project
• FAQ
University of Oulu
Programming assignments
‒ No exam!
‒ 4 programming assignments + final project
‒ Grading policy (min 50%) Late submission policy
• Assignment 1 = 10% ‒ Submitting after the deadline has passed
will always lead to a penalty.
• Assignment 2 = 10%
➢ within one week after the deadline: 75%
• Assignment 3 = 10% ➢ within two weeks after the deadline: 50%
• Assignment 4 = 10% ➢ two weeks after the deadline: 0%
• Final project = 60%
University of Oulu
Rules
‒ Cheating and plagiarism will be punished!
• Please finish the programming assingments on your own
• Do NOT share your code with others
‒ Discussing ideas is encouraged
‒ Asking questions directly from teaching staff is encouraged
‒ Cite clearly in your submission if you received help from others
‒ Late/incomplete submission is better than violating these rules!
University of Oulu
Communication
‒ For general questions use Moodle forums
• Check FAQ for possible answers to your question
‒ Join the course area on Discord for communication
• [Link]
• Get the DL role by reacting to the message “message "521153S
Deep Learning / Deep Learning” in the #course-signup channel
‒ More specific questions --> contact course staff directly
• Assignments or final project -- > the corresponding staff
University of Oulu
Software and computational platform
‒ Tools
• Jupyter notebooks
• Python (NumPy & PyTorch)
‒ Computational resources
• Google Colab or CSC ( [Link] -> log in with HaKa
using your university account -> Machine Learning / Deep Learning.)
• Computer rooms (20 pcs with GPUs in TS135 and TS137 respectively)
DL moodle -> Available time slots for the computer rooms
University of Oulu
Text books
‒ No course book
• Slides have been partially adapted from well-known courses
‒ Some recommended books
• “Deep Learning” by Ian Goodfellow, Yoshua Bengio & Aaron
Courville: [Link]
• “Grokking Deep Learning” by Andrew W. Trask
• “Deep Learning with PyTorch” by Eli Stevens, Luca Antiga & Thomas
Viehmann
• “Deep Learning with Python” by François Chollet
University of Oulu
Online courses
‒ Stanford CS231n: Deep Learning for Computer Vision
‒ Practical Deep Learning
‒ MIT: Introduction to Deep Learning
‒ NYU DS-GA 1008: Deep Learning
‒ Machine Learning Crash Course with TensorFlow APIs
‒ Nvidia Deep Learning Institute
University of Oulu
Some good blogs – among many others…
‒ Andrej Karpathy
• “Yes you should understand backprop”
• “A Recipe for Training Neural Networks”
• “The Unreasonable Effectiveness of Recurrent Neural Networks”
‒ Chris Olah
• “Understanding LSTM Networks”
• “Calculus on Computational Graphs: backpropagation”
• “Attention and Augmented Neural Networks”
‒ Sebastian Raschka
• “Understanding and Coding the Self-Attention Mechanism of Large Language Models From Scratch”
‒ About transformers
• “Annotated Transformer”
• “Instructions on Transformer for people outside NLP field, but with examples of NLP”
• “The Illustrated Transformer”
University of Oulu
Schedule and Content All lectures are delivered online Programming
Assignments
Week Date Time Topic Zoom meeting Start End Lecturer
1 Mon 27.10.2025 14:15-16:00 L1: Introduction and Basics of Deep Learning [Link] Qing Liu
1 Wed 29.10.2025 08:15-10:00 L2: Elements of Deep Learning via Linear Models [Link] Yante Li
2 Mon 03.11.2025 14:15-16:00 L3: Introduction to Deep Learning Software [Link] PA1 Mohamed
Elhabebe
2 Wed 05.11.2025 08:15-10:00 L4: Neural Networks & Deep Neural Networks [Link] PA2 Yante Li
3 Mon 10.11.2025 14:15-16:00 L5: Convolutional Neural Networks [Link] PA3 Yante Li
3 Wed 12.11.2025 08:15-10:00 L6: Training Deep Neural Network [Link] Ali Salar
4 Mon 17.11.2025 14:15-16:00 L7: Sequence Models [Link] PA4 PA1 Qing Liu
4 Wed 19.11.2025 08:15-10:00 L8: Transformers [Link] Final PA2 Yante Li
Project
5 Mon 24.11.2025 14:15-16:00 No Lecture! PA3
5 Wed 26.11.2025 08:15-10:00 No Lecture!
6 Mon 01.12.2025 14:15-16:00 L9: Generative Adversarial Networks & VAE & [Link] PA4 Qing Liu
Diffusion
6 Wed 03.12.2025 08:15-10:00 L10: Recent Advances, Limitations & New [Link] Qing Liu
Frontiers
No course exam! The deadline for the final project is 31.12.2025. Final
University of Oulu
Project
“AI Revolution”
University of Oulu
How AI is transforming the world
• AlphaGo (Reinforcement learning, deep learning)
University of Oulu
How AI is transforming the world
• ChatGPT (Large language models, deep learning)
University of Oulu
How AI is transforming the world
• Sora: text to video generation (Large vision models, deep learning)
[Link]
University of Oulu
How AI is transforming the world
• AI is “taking over” the Novel prizes in 2024 (Artificial neural networks)
“to construct methods that helped lay the foundation for
today’s powerful machine learning.”
University of Oulu
How AI is transforming the world
• AI is “taking over” the Novel prizes in 2024 (AlphaFold, deep learning)
“Demis Hassabis and John Jumper have developed an AI model
to solve a 50-year-old problem: predicting proteins’ complex
structures. These discoveries hold enormous potential.”
University of Oulu
If you still don’t believe…
Please visit [Link] to generate your videos if you like University of Oulu
What is Deep Learning ???
University of Oulu
AI (Artificial
Intelligence)
Machine
Learning
What is AI?
Deep Learning
University of Oulu
What is AI?
"the science and engineering of
making intelligent machines”
John McCarthy
“Father of AI”
(September 4, 1927 – October 24, 2011) was an
American computer scientist and cognitive scientist. He was one
of the founders of the discipline of artificial intelligence. He co-
authored the document that coined the term "artificial
intelligence" (AI).
University of Oulu
What is AI?
“AI is the science of making machines do
things that would require intelligence if
done by human.”
Marvin Minsky
A famous AI pioneer
(born August 9, 1927, New York, New York, U.S.—died January
24, 2016, Boston, Massachusetts) was an American
mathematician and computer scientist, one of the most famous
practitioners of the science of artificial intelligence (AI). Minsky
won the 1969 A.M. Turing Award, the highest honour
in computer science, for his pioneering work in AI.
University of Oulu
Other good definitions…
“Artificial intelligence is the ability of machines or software to perform
tasks commonly associated with intelligent beings.”
“Artificial intelligence is the intelligence of machines or software, as
opposed to the intelligence of humans or animals.”
“Artificial intelligence is a field of science concerned with building
computers and machines that can reason, learn, and act in such a way
that would normally require human intelligence or that involves data
whose scale exceeds what humans can analyze.”
University of Oulu
AI (Artificial
Intelligence)
Machine
Learning
What is Machine Learning?
Deep Learning
University of Oulu
Rule-based expert systems (Symbolic AI)
Building an intelligent system with traditional programming
1. Define a set of rules to operate or perform specific tasks
2. Program those rules into the computer
3. Feed with new examples and the program uses the rules to
operate or perform the tasks
University of Oulu
Question: Are apples fruit?
Answer: Yes.
University of Oulu
Limitations
‒ Rigorous programming
‒ Require a lot of domain knowledge by human experts
University of Oulu
Limitations of rule-based systems
What does this picture represent? University of Oulu
How do kids learn?
1. Expose them to lots of data
cat dog
2. Give them the “correct answer”
3. They will pick up the important patterns on their own
Kids learn from examples and experiences.
University of Oulu
AI (Artificial
Intelligence)
What is Machine Learning?
Machine
Learning
Make machines learn from examples and
experiences!
Deep Learning
University of Oulu
elephant
No, it’s a dog
Here is a magic box, now we don’t
care the inside structure.
University of Oulu
tiger
No, it’s a dog
Here is a magic box, now we don’t
care the inside structure.
University of Oulu
cat
No, it’s a dog
Here is a magic box, now we don’t
care the inside structure.
University of Oulu
Dog!!!
Here is a magic box, now we don’t
care the inside structure.
University of Oulu
Machine Learning
dog dog
dog cat
cat
dog
Training dog
dog cat
cat cat
dog
…
cat
dog
University of Oulu
Machine Learning
? cat
Evaluation cat
?
dog
?
Important: The model should generalize to unseen data!
University of Oulu
How we design the magic box?
Dog!!!
Feature
Predictor
engineering
University of Oulu
Traditional machine learning (1980s – 2010s)
Dog!!!
Hand-crafted features: Predictor:
Color, SVM (support vector
Edge, machine)
Shade, Logistic regression,
Orientations, Decision tree,
Size, Random forest,
… …
There are many advanced hand-crafted features like: LBP, SIFT, Gabor, HoG, MFCC, etc.
University of Oulu
Traditional machine learning (1980s – 2010s)
House data Human-crafted features: Predictor:
€400K
Year, SVM (support vector
Size, machine)
Number of rooms, Logistic regression,
Number of bedrooms, Decision tree,
Has sauna; Random forest,
zip_code, …
…
University of Oulu
Limitations
Now, tell me what the image represents?
University of Oulu
Limitations
• When the data becomes difficult to understand / tasks become
more challenging.
• When the dimension of the data becomes large.
• When the scales of the data change from hundreds to billions.
• …
Hand-crafted features have limited capability to represent the data
structure / distribution.
University of Oulu
But, how good features look like to represent the
complex data?
Can we make machine to automatically design
features by itself?
University of Oulu
Hiearchical feature representations
Here is where hand-crafted
features may get stuck
size
family size
#rooms
services
price
zip code
reputation
average income
University of Oulu
Hiearchical feature representations
Here is where hand-crafted
features may get stuck
University of Oulu
Can we make machine to automatically design
features by itself?
dog
dog
dog cat
Hand-crafted Predictor
cat feature design
dog (a good function) cat dog
dog by humans
cat dog
…
dog cat
Corresponding
Millions of labels
data samples
Not automatic, the features are designed by humans.
University of Oulu
A very simple solution!
dog
dog
dog cat
Hand-crafted Predictor
cat feature design
dog (a good function) cat dog
dog by humans
cat dog
…
dog cat
Corresponding
Millions of labels
data samples
Now, the features are the data itself.
University of Oulu
Can we make machine to automatically design
features by itself?
Predictor (a good function) dog
dog f_1 f_2 f_3
dog cat
Function Function Function Function
cat
dog 1 2 3 4 cat dog
dog
cat dog
…
dog cat
Corresponding
Millions of labels
data samples
The predictor is actually extracting good features!
University of Oulu
AI (Artificial
Intelligence)
What is Deep Learning?
Machine
Learning
“is the use of large multi-layer (artificial) neural
networks that compute with continuous (real
number) representations, a little like the
hierarchically organized neurons in human
Deep Learning brains”
University of Oulu
Hiearchical feature representations
University of Oulu
Supervised learning problems
Application Input 𝒙 Output 𝒚
Real estate House related features Price
Image tagging Image Object
Speech recognition Audio Text transcript
Machine translation English French
Autonomous driving Image & radar Positions of objects
University of Oulu
Scale matters
Large NNs
Medium NNs
Performance
Small NNs
”Traditional” ML
Amount of (labeled) data
University of Oulu
Deep learning - why now?
‒ Data
• Deep neural networks need a lot of information to learn from
• The digital era and the internet has supplied data
‒ Computing power
• Need to observe a lot of data within a practical amount of time
• Importance of GPUs
‒ Investments in technology
‒ Research community & open-source tools
University of Oulu
Overview on Learning with
Neural Networks
University of Oulu
HOW?
‒ Data samples, labels (supervised setting)
‒ A function to learn (the “predictor”)
sample 𝑥 (𝑖) 𝑣𝑎𝑙𝑢𝑒 (𝑖)
‒ A good schedule to learn the function 𝑓𝜃 (𝑥)
• Cost function
• Derivatives (gradient) calculation
• Parameter updating algorithm
• Learning rate
• Iterations
‒ Evaluation
University of Oulu
HOW?
‒ Data samples 𝑥, labels (or targets) 𝑦
Image classification Sentence generation (next word prediction)
dog Deep learning is a subset of machine learning,
which itself is a subset of artificial intelligence (AI).
cat It is based on the use of neural networks with many
dog layers (hence the term "deep") to model complex
dog
cat patterns in data. Deep learning has gained immense
… popularity and success in recent years, driven by
advancements in computational power, large
dog cat
datasets, and the development of sophisticated
algorithms.
𝑥 (𝑖) 𝑥 (𝑖) Deep Deep learning
𝑦 (𝑖) cat dog 𝑦 (𝑖) learning is
University of Oulu
HOW?
‒ A function to learn (the “predictor”)
sample 𝑥 (𝑖) 𝑣𝑎𝑙𝑢𝑒 (𝑖) 𝑦 (𝑖)
𝑓𝜃 (𝑥)
Should be in the same form
University of Oulu
HOW?
‒ A good schedule to learn the function
• Cost function
• Derivatives (gradient) calculation
• Parameter updating algorithm
• Learning rate sample 𝑥 (𝑖) 𝑣𝑎𝑙𝑢𝑒 (𝑖) 𝑦 (𝑖)
𝑓𝜃 (𝑥)
• Iterations
𝒍𝒐𝒔𝒔 = |𝒚(𝒊) − 𝒗𝒂𝒍𝒖𝒆 𝒊 |
How close is 𝑣𝑎𝑙𝑢𝑒 (𝑖) to 𝑦 (𝑖) ?
Closer is better , i.e., smaller loss is better.
University of Oulu
HOW?
‒ A good schedule to learn the function
• Cost function
• Derivatives (gradient) calculation
• Parameter updating algorithm sample 𝑥 (𝑖)
𝑓𝜃 (𝑥)
𝑣𝑎𝑙𝑢𝑒 (𝑖) 𝑦 (𝑖)
• Learning rate
• Iterations
𝒍𝒐𝒔𝒔 = |𝒚(𝒊) − 𝒗𝒂𝒍𝒖𝒆 𝒊 | = |𝒇𝜽 𝒙 − 𝑦 (𝑖) |
How can we update 𝜃 to make the loss smaller?
University of Oulu
HOW?
sample 𝑥 (𝑖) 𝑣𝑎𝑙𝑢𝑒 (𝑖)
𝑓𝜃 (𝑥)
‒ Evaluation
Image classification Sentence generation (next word prediction)
𝑥 (𝑖) One day,
Sentences starts with 𝑥 (𝑖) (by recurrently
generating values):
(𝑥 (𝑖) , 𝑦 (𝑖) ) One day, a curious young student named Mia sat in her college
dorm room, , staring at her laptop screen filled with complex
equations and graphs. She had recently discovered deep
learning and was fascinated by its potential to change the
𝑣𝑎𝑙𝑢𝑒 (𝑖) is it cat? world—especially in fields like healthcare, self-driving cars, and
artificial intelligence. Determined to understand this cutting-
edge technology, she decided to embark on a learning journey.
University of Oulu
Summary of the lecture
‒ Introduction to deep learning
• AI, Machine learning, Deep learning
• Intuition behind DL – learning hierarchical feature representations directly from data
‒ Overview on learning with (deep) neural networks
• Data
• A neural network (a complicated function)
• How to update the neural network
• Evaluation
University of Oulu
Next lecture
‒ Data samples, labels (supervised setting)
‒ A function to learn (the “predictor”)
--> Simple functions (linear regression, logistic regression)
‒ A good schedule to learn the function
• Cost function
• Derivatives (gradient) calculation
• Parameter updating algorithm
• Learning rate
• Iterations
‒ Evaluation
University of Oulu
AI should be designed to enhance
human capabilities and contribute to
human well-being, rather than replace
Fei-Fei Li humans.
ImageNet!
(Chinese: 李飞飞; pinyin: Lǐ Fēifēi; born July 3, 1976) is a
Chinese-American computer scientist, known for
establishing ImageNet, the dataset that enabled rapid advances
in computer vision in the 2010s
University of Oulu