Seyed Ali Madani Tonekaboni
Farnoosh Khodakarami
Practical Machine Learning in Healthcare
1
2
Health and mathematics
Biology
Chemistry
Physics
Mathematics
Mathematics
Mathematics
Prescription
(Quantitative
+Qualitative)
Patient
checkup
Known rules
3
Health and mathematics
Biology
Chemistry
Physics
Mathematics
Mathematics
Mathematics
Prescription
(Quantitative
+Qualitative)
Patient
checkup
Known rules
4
Healthcare and machine learning
Improve quality
(and quantity) of
life by improving
and automating:
● Diagnosis
● Treatment
● ….
Patient
information
Machine learning
5
Healthcare and machine learning
Improve quality
(and quantity) of
life by improving
and automating:
● Diagnosis
● Treatment
● ….
Patient
information
Collected data
Machine learning functions and tools need specific
data formats
Features(Attribute/variable)
Datarecords
(samples)
# Features = Dimension of dataset
6
● Some ML models use other inputs like images in
convolutional neural network
Health data (sample types)
7
Sample types
Patient samples Animal models
Cell lines and other
model system
Health data (variable types)
8
Variable types
Medical
information
Molecular
features
Features in
molecules
Organism to DNA
9
We can extract
information in any
of these levels and
use the as different
feature types in our
model
Atom
Molecule
Cell
Tissue
Organ
System
Organism
Scale in
different levels
of organization
10
Data type
11
Survey
information
No need for measurement or
quantification technologies
Macroscopic
measurement
High level measurements without
molecular level information
Microscopic
measurement
Capturing molecular level information in
cells, blood, etc.
Medical information (Survey)
12
Age Gender Medication history
Medical information (Macroscopic measurements)
13
Height Weight
Medical information (Macroscopic measurements)
14
Blood pressure Heartbeat
Medical information (Macroscopic measurements)
15
Tumor existence
and size
Heartbeat
Medical information (Microscopic measurements)
16
Blood sugar
Histopathological
images
Medical information (Microscopic measurements)
17
Quantifying molecular feature values in
cells, blood serum, etc.
Molecular features in
central dogma of
biology
18
Molecular features (Protein)
19
Protein structure determine its function
20
Hemoglobin beta
Protein structure determine its function
21
Hemoglobin beta
Machine learning and proteins
22
how a small-molecule
drug will interact with
proteins in the body
Molecular features (DNA and RNA)
23
Medical Imaging
● The most direct way to see inside the human
(or animal) body
is cut it open (i.e., surgery)
● We can see inside the human body in ways
that are less
invasive or (completely non-invasive)
● We can even see
metabolic/functional/molecular activities
which are not visible to naked eye
24
Imaging Techniques
Ultrasound PET
MRICT
Clinical Task on Images
● Detection: Detecting abnormality on the images
● Characterization: Characterizing this abnormality
Segmentation: Detecting boundary of abnormality
Diagnosis: Identify this abnormality as benign or malignant
Staging Classify this abnormalities into multiple predefined category
● Monitoring:
Tracing object characteristic during monitoring scans
26
Treatment
Machine
learning
Images
Machine learning and Radiomics
Image acquisition
&
Segmentation Prognosis
Feature Extraction
Texture
ShapeIntensity
Wavelet
Survival prediction
staging
Disease Progression
Toxicity
Personal Optimal
Treatment
Reduce Cost
27
Step By step to
Machine Learning
Farnoosh Khodakarami
Postdoctoral Fellow
Princess Margaret Research Institute / University of Toronto
28
Field of study that gives
computers the ability to learn
without being explicitly
programmed
(Arthur Samuel 1951)
https://www.ibm.com/ibm/history/ibm100/us/en/i
cons/ibm700series/impacts/
The Samuel Checkers-playing Program was among the world's first successful
self-learning programs.
He coined the term "machine learning" in 1959
29
TheMachineLearningProcesses
Gathering and
Cleaning data
Model building and
Model evaluation
Deploy selected Model and
present result 30
DataSet
Size Location ... #Rooms
DataRecords
(samples)
Features(Variable/Attribute)
A data set (or dataset) is a collection of data
Every column of the table represents a particular variable,
Each row corresponds to a given member of the data set
31
32
Supervised vs
Unsupervised Learning
Unsupervised Learning
- No Knowledge of output
- data is unlabeled
- Self guided learning
- Goal: determine data
patterns/grouping
Supervised Learning
- Knowledge of output
- data is labeled with class or
value
- Goal: predict value label or
class label
33
34
35
Linear Regression
36
Price
?
1M
3M
37
Linear Regression
Linear regression is the simplest and most widely used statistical
technique
A linear model expresses the target output value in terms of a sum of
weighted input variables.
38
Linear Regression
Size of the house feet2
Priceofthehouse
500 1000 1500 2000 2500
400
300
200
100
500
600
700
fi
= w0
xi
+b0
(x,y)
x
y
39
Overfitting
Overfitting: Good
performance on the training
data, poor generalization to
other data.
Underfitting: Poor
performance on the training
data and poor generalization to
other data
Image source wikipedia
40
Bias–variance tradeoff
41
High variance High bias
Low bias
Low variance
K-Folds Cross Validation
Image source wikipedia
42
Regularized learning
43
Regularization to overcome overfitting
Hastie, T., Tibshirani, R., & Wainwright, M. (2015). Statistical learning with sparsity:
the lasso and generalizations. Chapman and Hall/CRC 44
Objective function:
Constraint for regularization:
Ridge regression
Optimization space in regularization
Hastie, T., Tibshirani, R., & Wainwright, M. (2015). Statistical learning with sparsity:
the lasso and generalizations. Chapman and Hall/CRC 45
Lasso Ridge
a a
b b
contours of the
residual-sum-of-squares
Constraints
Autoencoders
46
47
What are neurons in artificial neural networks?
Feature 1
Feature 2
Feature 3
Supposedly Feature 1
Supposedly Feature 2
Supposedly Feature 3
Supposedly Feature M-2
Supposedly Feature M-2
Supposedly Feature M
Feature M-2
Feature M-1
Feature M
Embeddings
48
What are neurons in artificial neural networks?
Feature 1
Feature 2
Feature 3
Supposedly Feature 1
Supposedly Feature 2
Supposedly Feature 3
Supposedly Feature M-2
Supposedly Feature M-2
Supposedly Feature M
Feature M-2
Feature M-1
Feature M
Embeddings
Encoding Decode
49
What are neurons in artificial neural networks?
Feature 1
Feature 2
Feature 3
Feature M-2
Feature M-1
Feature M
50
What are neurons in artificial neural networks?
Feature 1
Feature 2
Feature 3
Feature M-2
Feature M-1
Feature M
New feature 1
New feature 2
New feature H-1
New feature H
H < M => reducing dimension
51
What are the connections in artificial neural networks?
Feature 1
Feature 2
Feature 3
Feature M-2
Feature M-1
Feature M
New feature (NF) 1
52
What are the connections in artificial neural networks?
Feature 1
Feature 2
Feature 3
Feature M-2
Feature M-1
Feature M
New feature (NF) 1
NF1 = W1*F1+W2*F2+W3*F3+...WM*FM
?
53
Adding nonlinearity via activation functions
Output of a neuron = activation(weighted sum of inputs of the neuron)
NF1 = activation(W1*F1+W2*F2+W3*F3+...WM*FM)
Deep learning for image classification
54
Convolutional Neural Network (CNN)
55
Convolutional layers
Detect Pattern in Images
- shape, object, corners,
circles
Specify filters in the images
Deeper layers can detect
more complex objects
Different Level of
abstraction
56Source: Deep learning: a bird’s-eye view, by R. Pieters, 2015, pp. 58, 62.
Convolutional Neural Network (CNN)
57
resource: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6268174/
Convolutional Neural Network (CNN)
58
Issues in CNN
59
Slow training (for complex tasks)
High computational cost
Lot of data to train them
Transfer learning
60
61
Transfer Learning
● Deep convolutional neural network models may take days or even weeks to
train on very large datasets.
● Reusing the already trained model is a way to short-cut this process.
62
https://medium.com/free-code-camp/asl-recognition-using-transfer-learning-918ba054c004
Transfer Learning as feature extractor
63
https://towardsdatascience.com/a-comprehensive-hands-on-guide-to-transfer-learning-with-real-world-applic
ations-in-deep-learning-212bf3b2f27a
Where to find pre-trained models for transfer learning
❏ Keras: https://keras.io/applications/
❏ TensorFlow: https://github.com/tensorflow/models
❏ caffe: https://github.com/BVLC/caffe/wiki/Model-Zoo
❏ caffe2: https://github.com/caffe2/caffe2/wiki/Model-Zoo
❏ pytorch: https://github.com/Cadene/pretrained-models.pytorch
❏ Lasagne: https://github.com/Lasagne/Recipes
❏ Many pretrained models for various platforms can also be found at
https://www.gradientzoo.com.
64
Some
pre-trained
CNN
Models
65
Transfer Learning on Medical imaging
❏ Cheplygina V, de Bruijne M, Pluim JP. Not-so-supervised: a survey of
semi-supervised, multi-instance, and transfer learning in medical image
analysis. Medical image analysis. 2019 May 1;54:280-96.
❏ Deep Learning for Computer Vision with Python.
https://www.pyimagesearch.com/2018/12/03/deep-learning-and-medical-image-analysis-with-keras/
https://towardsdatascience.com/convolutional-neural-network-for-breast-cancer-classification-52f1213dcc9
66
Skin cancer Breast Cancer

Machine learning in Healthcare - WeCloudData