Glaucoma classification from Fundus Images
BPEye PBL Training for
Shirshak Acharya
Research Assistant, NAAMII
2024-25
Outline
Outline (2)
Outline (3)
Glaucoma Classification
Classify if image is Glaucoma or not from below?
Glaucoma Classification
Classify if image is Glaucoma or not from below?
Fundus Images
Fundus Images
Fundus Camera
Fundus Images : Data Understanding
Glaucoma
Not Glaucoma
Fundus Images : Data Understanding
Glaucoma
Not Glaucoma
Fundus Images : Data Understanding
Glaucoma
Not Glaucoma
Fundus Images : Data Understanding
Glaucoma
Not Glaucoma
Fundus Images : Data Understanding
Glaucoma
Not Glaucoma
Airogs Dataset
How do doctor classify Glaucoma
Glaucoma Classification Training
healthy optic disc
glaucomatous optic disc
Glaucoma Classification Training
From features mentioned at previous slide. Classify Glaucoma
Glaucoma Classification Training
From features mentioned at previous slide. Classify Glaucoma
not glaucoma
Glaucoma Classification Training
From features mentioned at previous slide. Classify Glaucoma
Glaucoma Classification Training
From features mentioned at previous slide. Classify Glaucoma
glaucomatous
Identifying Glaucoma
Not Glaucoma
Glaucoma
Doctor
Fundus Images
How did we learn to classify Glaucoma Images?
Problem with current approaches
Solution : Use of AI models
How can we teach these to machines?
How do we learn to see
What we see in image ?
What machines see in image?
What is image to machine
How do doctor classify Glaucoma
Extract Feature from image
Hand Engineered Feature Extraction:
Edge Detection
How ??
Hand Engineered Feature Extraction:
Edge Detection
Edge Detection from Hand Engineered Features
Edge Detection (Details Heavy)
Sobel Edge Detection (Details Heavy)
Hand Engineered Feature Extraction: Threshold
Hand Engineered Feature Extraction: Harris Corner
Hand Engineered Feature Extraction: Harris Corner
�
Hand Engineered Feature Extraction: Harris Corner
Feature Extraction (Details)
Linear Filter
Computation Example
Computation Example
Linear Filtering
Linear Filtering
Linear Filtering
Linear Filtering
Correlation and Convolution
Correlation (previous slides) :
Convolution :
Features depend on imaging conditions and hard to design “invariant” features Relatively strong domain knowledge required
Source: http://cs231n.github.io/classification
Challenging conditions in Feature Extraction
Feature Extraction : Learned from data
Feature Extraction : Learned from data - CNN
X 2
X 3
CNN Feature Maps Visualization (VGG-16)
Deeper Layer Feature Map of Glaucoma
Deeper Layer Feature Map of Normal
Feature Maps
Glaucoma
Not-Glaucoma
Feature Maps
Fully Connected (4096)
Fully Connected (4096)
Fully Connected (1000)
Glaucomatic
Non Glaucomatic
Classification from feature maps (VGG-16)
Linear Functions to Deep Network
Linear Regression
Data from G. WiF. Journal of StaJsJcs EducaJon, Volume 21, Number 1 (2013)
Linear Regression
Linear Regression
Linear Regression
Data from G. WiF. Journal of StaJsJcs EducaJon, Volume 21, Number 1 (2013)
Which m & c to use?
Least Square Linear Regression
Data from G. WiF. Journal of StaJsJcs EducaJon, Volume 21, Number 1 (2013)
Least Square Linear Regression
Data from G. WiF. Journal of StaJsJcs EducaJon, Volume 21, Number 1 (2013)
Least Square Linear Regression
X1 & X2 – independent variables
Gradient Descent
Gradient Descent
Gradient Descent
Gradient Descent
Gradient Descent
Gradient Descent
Gradient Descent Example
Gradient Descent Example
Gradient Descent Example
Gradient Descent Example
Linear Functions to Deep Network
Linear Functions to Deep Network
Linear Functions to Deep Network
Linear Functions to Deep Network
Composition with Non-Linear Functions
Sigmoid Function
Composing Sigmoid with Linear Function
https://medium.com/@melodious/understanding-deep-neural-networks-from-first-principles-logistic-regression-bd2f01c9e263
Activation Functions
Adding non-linearity and composing :
Can model complex relationships between input & output
Training a Logistic Regression
https://medium.com/@melodious/understanding-deep-neural-networks-from-first-principles-logistic-regression-bd2f01c9e263
Model
Loss Function
Training a Logistic Regression
https://medium.com/@melodious/understanding-deep-neural-networks-from-first-principles-logistic-regression-bd2f01c9e263
Loss function over m training samples
Training a Logistic Regression
Training a Logistic Regression
Training a Logistic Regression
Training a Logistic Regression
CNN in a typical Scenario
(sparse -> less parameters -> less computation)
Why CNNs
Sparse Connectivity of CNN
Sparse connectivity:
Sparse connectivity:
Sparse Connectivity of CNN
Sparse connectivity:
Sparse connectivity:
Receptive Field of CNN
Increasing Layers increases receptive field of CNN
CNNs Parameter Sharing
CNNs Parameter Sharing
Fully Connected (Bottom), Convolutional (Top)
Because of parameter sharing, single parameter is used across all locations.
CNNs Parameter Sharing
Fully Connected (Bottom), Convolutional (Top)
Because of parameter sharing, single parameter is used across all locations.
No parameter sharing ; one parameter for each input is used for only one output.
CNNs Parameter Sharing
CNNs Parameter Sharing
No. of parameters originally = 25
After sparse connectivity = 13
After parameter sharing = 2
CNNs Parameter Sharing
No. of parameters originally = 25
After sparse connectivity = 13
After parameter sharing = 2
Reduce parameters by 12.5x
CNNs Equivariance to Translation
Translation Equivariance
Translation Invariance
Pooling
Max Pooling and Invariance to Small Shifts
Max Pooling and Invariance to Small Shifts
What about other invariance such as rotation ?
Max Pooling and Invariance to Small Shifts
What about other invariance such as rotation ?
Pool over multiple feature maps!
But what are feature maps ?
CNN in a typical Scenario
CNN in a typical scenario
Need of Data Augmentation
Original glaucoma image
Rotated
Glaucomatous
Not Glaucomatous
Same
Max Pooling Over Multiple Feature Maps
Three learned filters + max pooling
= Invariant to rotation
Pooling to Down Sample Image
Pooling Drawbacks :
Strided Convolutions to Down Sample Image
Comparative Analysis: Maxpool vs Strided Conv
Layer Patterns
* Repetition; ? Optional;
Common ConvNet Architectures
Successful Examples and Network Engineering
Alex net, VGG, GoogLeNet with Inception Module, Residual Net
Successful Examples and Network Engineering
The LeNet-5 Architecture, 1998 [1]
Successful Examples and Network Engineering
Krizhevsky, Alex, Ilya Sutskever, and Geoffrey E. Hinton. "Imagenet classification with deep convolutional neural networks." Advances in neural information processing systems. 2012.
AlexNet Architecture, 2012 [1]
- Image Translation & horizontal Reflections
- Altering the intensities of the RGB
Successful Examples and Network Engineering
Krizhevsky, Alex, Ilya Sutskever, and Geoffrey E. Hinton. "Imagenet classification with deep convolutional neural networks." Advances in neural information processing systems. 2012.
5x5 conv layer - Global features captured,
Max-pool - low-level features captured
3x3 conv layer - distributed features captured
1x1 conv layer - depth reduction
Inception module with dimension reductions
Successful Examples and Network Engineering
Krizhevsky, Alex, Ilya Sutskever, and Geoffrey E. Hinton. "Imagenet classification with deep convolutional neural networks." Advances in neural information processing systems. 2012.
Inception module with dimension reductions
5x5 conv layer - Global features captured,
3x3 conv layer - distributed features captured
1x1 conv layer - depth reduction
Max-pool - low-level features captured
Successful Examples and Network Engineering
Residual Module of ResNet, 2016 [1]
Successful Examples and Network Engineering
Krizhevsky, Alex, Ilya Sutskever, and Geoffrey E. Hinton. "Imagenet classification with deep convolutional neural networks." Advances in neural information processing systems. 2012.
Different scaling methods
vs. EfficientNet Compound scaling
Narrative : Glaucoma Classification
Narrative : Glaucoma Classification (2)
Narrative : Glaucoma Classification (3)
Pooling - Downsampling Image, Invariance to small shift
Pooling with data augmentation and transformation - Invariance to rotation, scaling, size
Why strided convolution is better than pooling?
How does simple CNN Layer Pattern Look like?(73, 74)
Engineered Architectures and Examples of best CNN Architectures (75)
Lenet-5 started use of convolution and subsampling (pooling) which used tanh activations (76)
Alexnet : add data augmentation, dropout feature, ReLU instead of tanh, established use of GPU for fast training (Slide 77)
Inception : used 1x1 for reduce dimensionality, implement multiple filters of 1x1, 3x3, 5x5 helps extract relevant features without the need for deeper or wider networks , introduces additional hyperparameter like number and sizes of filters.
Resnet : used skip connections to allow gradients to flow directly to earlier layers, (vanishing gradient)
Efficient Net : Instead of randomly scaling introduced compound scaling to scale up width, depth, and resolution.
Technical Detailed Narrative:Glaucoma Classification
Extract feature from image – Feature Extraction (20)
Hand engineered feature extraction – extracts edge, corners, (21, 22)
Elementwise multiplication of filter and images creates feature map. (23)
Edge detection – sharp change in image pixels (24, 25)
Image Thresholding, Harris Corner (26, 27)
Challenging conditions in feature extractions (28)
Feature Learning and Classification in CNN (30)
CNN feature maps visualization – How does a CNN learn? (31, 32, 33)
How do linear function in CNN work? (34 - 38)
Why is it necessary to incorporate Non-Linear activations in Linear Functions (37, 38)
Composition linear models with non linear activation-sigmoid (39, 40, 41 )
Logistic Regression – Powerful Backbone of Neural Network is born (42 - 47)
How CNN is so powerful?(48, 49)
Sparse Connectivity of CNN (50, 51 ), Receptive Field (52), Parameter Sharing 53-58),
Translation Equivariance & Invariance (59, 61, 61)
Technical Detailed Narrative : Glaucoma Classification (2)