Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
37 views40 pages

Lecture3 Intro ML For MedicalDataAnalysis

Uploaded by

Batuhan Ekinci
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views40 pages

Lecture3 Intro ML For MedicalDataAnalysis

Uploaded by

Batuhan Ekinci
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

AI in Healthcare

Lecture 3: Introduction to Machine Learning for


Medical Data Analysis
Dr. Sema Candemir
Eskişehir Technical University Computer Engineering Department
Computational Framework

Regions of Interest Detection


organs, IVC filters, pathology lesions

Clinical Disease Detection


Problem Computational pneumonia , TB, Covid-19
Framework
Medical Data Prognosis
• Images (CXR, CT, Ultrasound,…) Severity, mortality, cognitive decline…
• Clinical Reports (Radiology reports)
• Medical Health Records
• Demographics

Computational Framework (mathematical operations)


Image processing, Computer vision, Machine Learning, Statistics, Programming skills (C++, Python), Libraries (tensor
flow, keras…), follow up recent literature…
AI in Healthcare
What is Deep Learning?
• Intelligence: The capacity for logic, understanding, self-
awareness, emotional knowledge, reasoning, planning,
creativity, critical thinking, and problem solving.
• Artificial Intelligence: Broad term, making machines to Artificial Intelligence
imitate human intelligence and behavior.
Machine Learning (Linear
• Machine Learning: subset of AI, imitate human learning regression, SVM, Decision Trees…)
process… process of developing a model/algorithm which
learns from data (learn the underlying pattern) and make Deep Learning
inference for unseen instances. (CNN, GANs, RNN…)
• Deep Learning: subset of machine learning/uses neural
networks (architectures with many layers) for the learning
process.

AI in Healthcare
Machine Learning
• Machine Learning is the field of study that gives computers the ability to
learn without being explicitly programmed (Arthur Samuel, 1959).

• Machine Learning helps us to extract meaningful patterns from examples.

AI in Healthcare
• Machine Learning is the field of study that gives computers the ability to learn
without being explicitly programmed (Arthur Samuel, 1959).

• Explicit programming: program the computer which follows a pre-described


series of steps, like rule-based programming.
• The functions are written explicitly by a human programmer.

• Machine learning: A family of statistical and mathematical modelling


techniques that uses a variety of approaches to automatically learn without
explicit programming.
• Learning from data without explicit programming.
• Like humans, learning through examples and experience. (ML imitating human
learning process).

AI in Healthcare
• We want to write a program which detects
a fracture on X-rays.
• In explicity programming, we need to
explicitly describe all the rules and decision
related with fracture.
• It can be tough to come up with all
different rules that could define it.
Credit - https://www.coursera.org/learn/fundamental-
machine-learning-healthcare (Stanford University)

In machine learning approach,


• We curate a dataset with thousand of images of fractures on X-rays
• Feed them into a machine learning model
• Let the model learns the rules implicitly in a function.

AI in Healthcare
An example
Credit -
https://www.coursera.org/learn/
fundamental-machine-learning-
healthcare (Stanford University)

AI in Healthcare
Learning a relationship means,
learning a function f

Credit –

If your f function is linear


regression, then, mapping x to y
means, finding optimal f could be linear regression, support vector machines, decision
parameters for linear tree, random forest, neural networks…
regression.

AI in Healthcare
Supervised learning – we
provide input and output
pairs. (supervising the model
with the right answer)

Learning means adjusting a


set of numbers known as
parameters.

We will talk about how the model updates its parameters in


training loop section.

AI in Healthcare
A new patient admitted to the
hospital, the trained model (
which is trained with previous
patient`s data) predicts if new
patient have heart attack.

AI in Healthcare
Machine Learning
The field of machine learning is
developing algorithms for finding
good values of parameters that
allow models to match inputs (x)
closely with their corresponding
outputs (y).

f could be linear regression, support vector machines, decision


tree, random forest, neural networks…
Credit - https://www.coursera.org/learn/fundamental-machine-
learning-healthcare (Stanford University)
AI in Healthcare
Machine Learning

• f could be linear regression, support vector machines, decision tree, random forest,
neural networks…

• There are different machine learning techniques in terms of how they learn from the
data.
• Linear regression, Logistic Regression, Support Vector Machines, Naïve bayes,
Decision trees, k-nearest neighbors, Neural Networks, Ensembles….

AI in Healthcare
• Review and evaluate the ~100 AI/ML studies in
brain MRI analysis over the past 12 years
(2022)
• 71% - classification of AD, MCI and (HC-health
control) normal aging
• 25% - prediction of MCI conversion to AD

• Support Vector Machines (SVM): a conventional ML


model, determine optimal decision boundaries for
classifying data.
• Random Forest (RF): combination of decision trees.
Robust. Better on tabular data.(structured
data)….Easier to program but computationally
costly.
The best performance was achieved by using deep • Logistic Regression (LR): generated probabilities for
learning-based convolutional neural network (CNN) with binary dependent variable.
weighted accuracy 89%. • CNN: Convolutional Neural Networks
HC vs. AD classification: the reported performance, the • NC-ANN: Non-convolutional artificial neural
weighted average accuracy is 91% networks
MCI to AD conversion: the weighted average accuracy of
79%. AI in Healthcare Dr. Sema CANDEMIR
Linear Regression
• Suppose you want to know if money makes people
happy.
• You download the Better Life Index data from the
OECD’s website and gross domestic product (GDP) per
capita from the IMF’s website.
• Looks like life satisfaction goes up linearly as the
country`s GDP per capita increases.
• Model Selection: you decide to model life satisfaction
as a linear function of GDP per capita. (you selected a
linear model)

Credit for Linear Regression slides - O’Reilly - Hands-On Machine Learning with Scikit-Learn,
Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems

AI in Healthcare
• This model has two model parameters, θ0 and θ1
• How can you know which parameters perform
best?
• We need a performance measure. How good
does your model perform?
• Cost function: lets define the cost function as
the distance between the model predictions and
the training examples.
• The aim is to minimize the cost – so minimize the
distances.
• Training the model: Linear regression algorithm
finds model parameters which fits best to training
data.

AI in Healthcare
• Talk: The Most Important Models - Jeff Macaluso

AI in Healthcare
• How happy are Cypriots?
• Cyprus’s GDP per capita - $22,587
• https://github.com/ageron/handson-ml2

AI in Healthcare
ML Models
• You studied the data.
• Model Selection- You selected a model.
• Model Training - You trained it on the training data (i.e., the learning algorithm searched for
the model parameter values that minimize a cost function).
• Inference - You applied the model to make predictions on new cases hoping that this model
will generalize.

• Generalization: The system needs to be able to make good predictions for examples it has
never seen before.
• Having a good performance measure on training data is good, but not enough. We also need
to perform well on new instances.

AI in Healthcare
Another Example
• Kidney stone (bobrek tasi) prediction based on urine (idrar) analysis
• Kidney Stone Prediction based on Urine Analysis (kaggle.com)
• Determine if certain physical characteristics of the urine might be related to the formation of calcium
oxalate crystals.
The six physical characteristics of the urine are:
• specific gravity, the density of the urine relative
to water;
• pH, the negative logarithm of the hydrogen ion;
• osmolarity (mOsm) is proportional to the
concentration of molecules in solution;
• conductivity (mMho milliMho). Conductivity is
proportional to the concentration of charged
ions in solution;
• urea concentration in millimoles per litre;
• calcium concentration (CALC) in
millimolesllitre.

AI in Healthcare
AI in Healthcare
AI in Healthcare
AI in Healthcare
AI in Healthcare
AI in Healthcare
AI in Healthcare
• Run these two scripts on your side, step by step, and make sure you
understand each step.

• Question – Think - Why MLPClassifier perform worse than


LogisticRegression for this problem?

• Check scikit-learn library for other type of machine learning models. For
instance Decision Trees or Support Vector Machines?

AI in Healthcare
Definitions / Terminology
• Classification: Assigning a class label to a group of data. (e.g., tumor region is benign or
malignant, X-ray belongs to a patient with TB, patient has a hearth attack or not…).
• Model: The set of weights learned by a machine learning system.
• Algorithm: The series of steps taken to create the model that will be used for prediction
• Labeled data: The data with a corresponding correct label. (e.g., the tumor region is benign,
the boundary of tumor region,…)
• Training: The phase during which the machine learning algorithm is given labeled data. The
weights are updated until no improvement in model performance.
• Validation set: The data used during training to validate the model performance and to
make decisions for hyperparameters.
• Testing: The test set is used for generalization.

AI in Healthcare
Hw1 – c Answer

AI in Healthcare
Classification (Binary Classification)
• The goal is to predict the class/category.
• Develop a model to predict whether a patient is at risk of developing diabetes based on various
health indicators.

• Features – X :
• Glucose level (measured in mg/dL)
• Body Mass Index
• Age
• Blood pressure (in mmHg)
• Family history of diabetes (binary: 0 for no, 1 for yes)

• Target Label - y
• Diabetes status (binary: 0 for non-diabetic, 1 for diabetic)

AI in Healthcare
Classification (Multiclass Classification)
• Develop a model to predict the risk level of heart disease for patients based on various
cardiovascular risk factors..

• Features – X :
• Age
• Gender (male or female)
• Cholesterol levels (in mg/dL)
• Blood pressure (in mmHg)
• Body Mass Index
• Smoking status (categorical: non-smoker, former smoker, current smoker)
• Family history of heart disease (binary: 0 for no, 1 for yes)
• Physical activity level (categorical: low, moderate, high)

• Target Label - y
• Heart disease risk level (multiple classes, e.g., Low Risk, Moderate Risk, High Risk)

AI in Healthcare
Regression
• The goal is to predict a numerical value.
• Develop a model to predict a patient's blood pressure based on various health indicators.

• Features – X :
• Age
• Body Mass Index
• Cholesterol levels (in mg/dL)
• Resting heart rate (beats per minute)
• Number of hours of exercise per week

• Target Label - y
• Systolic blood pressure (in mmHg)

AI in Healthcare
AI in Healthcare
AI in Healthcare
Machine Learning for Medical Imaging

• “ The appeal of having a computer that


performs repetitive and well-defined tasks is
clear: computers will perform a given task
consistently and tirelessly.”

• “More recently, machines have


demonstrated the capability to learn and
master tasks, showing that machine learning
algorithms are potential useful components
of computer-aided diagnosis and decision
support systems.”

• “Even more exciting is the finding that in


some cases, computers seem to be able to
see patterns that are beyond human
perception”
AI in Healthcare
AI in Healthcare
The pipeline typically begins with computing the image features which
are fed into machine learning algorithm to be used in making prediction.

Feature extraction: transforming raw data into an abstract form.


• Color: Invariant to size and direction (e.g., RGB, histogram distribution,
color moments)
• Shape: image structure (e.g., sphericity)
• Texture: characterize randomness, granulation and homogeneity (e.g.,
Gabor features, Haar features, SIFT, SURF).
• Global features vs. Local features: Local feature extracting is working in
local regions (e.g., SIFT, SURF)

AI in Healthcare
If a machine learning algorithm is applied to a
set of labeled data
• MRI images with tumor
• with labels benign and malignant
The algorithm can learn discriminatory function
f(.) from the training data.

Supervised learning – model gaining experience


by using images of brain tumor and
corresponding “correct” labels.

Then, use learned function f(.) to make a


prediction for unseen instances.
• The tumor in a new MRI image is whether
benign or malignant.

AI in Healthcare
Traditional ML usage
1) Feature engineering. Medical Data Feature Engineering
Descriptors (SIFT, SURF, Haar)
models the visual information Output
Covid / NoCovid
2) Train features with a machine
learning algorithm (e.g., SVM, Classification
Decision trees, NN)
Medical Data
Data-driven Approach
Output
Deep Learning (Feature Covid / NoCovid
extraction + Training)
Feature Engineering + Classification

AI in Healthcare
Main Challenges of ML
Your tasks is to develop a learning model and train it on some data, two things can go
wrong, “bad data” and “bad algorithm”.

• Insufficient quantity of training data. (Limited medical data).


• Poor quality data: If your training data is full of errors, outliers and noise, it will make it
harder for the system to detect the underlying patterns, so your system is less likely to
perform well.
• Irrelevant Features: As the saying goes, garbage in, garbage out. Your system will only be
capable of learning if the training data contains enough relevant features.
• Feature engineering: Coming up with a good set of features to train on.
• Overfitting – Underfitting: finding the right balance between model simplicity and
complexity.
• Interpretability – NN-based models are considered as black boxes, hard to interpret their
decisions.
• Bias – ML models inherit biases present in the training data.

AI in Healthcare
Homework (no formal grading for this homework)
• Chapter 1.The Machine Learning Landscape. Please
read the text that is highlighted in color and answer
the questions that are also highlighted in red at the
end of the reading.

• There's no formal grading for this homework, so


there's no need to submit it.

AI in Healthcare

You might also like