IP FeatureExtractionEndAnalysis L7
IP FeatureExtractionEndAnalysis L7
end analysis
Jayanta Mukhopadhyay
Dept. of CSE,
IIT Kharagpur
A feature of an image ?
l Characterizes its visual content.
l A part of an organization on describing a region
l A higher level organization than a pixel
l A point in a multidimensional space
l feature vector: n-Dimensional vector: x ϵ Rn
l Represents
l a point within a neighborhood
l a pattern
l a patch
l an object
l the whole image
Role of features in Image
Analysis
Feature Extraction
Role of features in learning
visual content
Classification
ML
/ regression
/clustering
DL
Feature
extraction
Input
image Preprocessing
Region descriptors
l Patch descriptors
l Texture descriptors
l Shape descriptors
Patch Descriptor: Histogram of
Gradients (HoG)
l Compute centered horizontal and vertical
gradients with no smoothing.
l Compute gradient orientation and magnitudes,
l For color image, pick the color channel with the
highest gradient magnitude for each pixel.
l For a 64x128 image, divide the image into 16x16
blocks of 50% overlap. à7x15=105 blocks in
total.
N.Dalal and B. Triggs, Histograms of oriented gradients for
human detection, CVPR-2005
Histogram of Gradients (HoG)
l Character recognition
l Train a classifier.
l A greedy approach:
l Select the best scoring window
Shashaank. M. Aswatha et al., A Method for Extracting Text from Stone Inscriptions using
Character spotting, ACCV, 2014.
E-PURALEKHAK
Original
Intermediate
Inscription
Result
Image
Unicode
generation Editable
text
Texture descriptor
l Texture: spatial
arrangement of the
colors or intensities in
an image
l A quantitative measure
of the arrangement of
intensities in the region.
3 2 1
4 c 0
You may have
5 6 7 different ordering of
neighbors.
o Values range from 0 to 255.
o Obtain normalized histogram over a region.
o Not rotational invariant.
o Invariant to illumination and contrast.
T. Ojala, M. Pietikainen, and D. Harwood, A Comparative Study of Texture Measures with
Classification Based on Feature Distributions, Pattern Recognition, vol. 29, pp. 51-59, 1996.
Co-occurrence Matrix (Cr)
0 1 0 1
0 0
0 0 1 1
0 0 1 1 1
1
1 1 0 0 C(1,0)
C(0,1) 0 1
1 1 0 0
0
1
C(0,1)
Co-occurrence Matrix (Cr)
1 0 1
0
4 2 0 4 2
0 0 1 1 0
0 0 1 1 2 4 1 2 4
1
1 1 0 0 C(1,0)
C(0,1) 0 1
1 1 0 0
0 2 2
1 2 3
C(1,1)
Normalized Co-occurrence
Matrix (Nr)
Divide by the sum of frequencies in a matrix.
1 0 1
0
1/3 1/6 0 1/3 1/6
0 0 1 1 0
0 0 1 1 1/6 1/3 1 1/6 1/3
1
1 1 0 0 C(1,0)
C 0 1
1 1 0 0 (0,1)
0 2/9 2/9
1 2/9 1/3
C(1,1)
Symmetric Co-occurrence
Matrix (Sr)
Sr(x,y)=Cr(x,y)+C-r(x,y)
1 0 1
0
0 4+4 2+2 0 4+4 2+2
0 0 1 1
0 0 1 1 1 4+4 2+2
1 2+2 4+4
1 1 0 0
C(0,1)+C(0,-1) 0 1 C(1,0)+C(-1,0)
1 1 0 0
0 2+2 2+2
1 2+2 3+3
C(1,1)+C(-1,-1)
Features from Normalized Co-
occurrence Matrix
∑3 ∑4 𝑁- 𝑥, 𝑦 𝑥𝑦 − 𝜇3 𝜇4
𝐶𝑜𝑟𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 =
𝜎3 𝜎4
Features from Normalized Co-
occurrence Matrix
l Signature of a contour
l Slope density function
l Features of boundary segments
29
Courtesy: P.P. Das, Professor, Dept. of CSE, IIT Kharagpur
Signature of a contour
l For a signature convert a 2-D boundary into a
representative 1-D function
l Plot the distance of the boundary from the
centroid as a function of angle
30
31
32
Boundary Segments
l Boundary segments: decompose a boundary into
segments.
l Use of the convex hull of the region enclosed by
the boundary is a powerful tool for robust
decomposition of the boundary. A boundary
segment
Convex
deficiency
33
Boundary Segments
l The Convex Hull (CH) H of a
set S is defined as the smallest
convex set that contains S
l We define the set of Convex
Deficiencies (CD)
l D = H \ S. Small irregularities lead
l Follow the boundary and mark to tiny meaningless
the points at which transition is convex deficiency
components scattered
made into or out of a all along the boundary.
component of D Apply polygon approximation to find CH.
34
35
? gm/dl
Classification approaches
Classification:
Task of assigning a known category or class to
an object.
n Discriminant analysis
l Probabilistic
n Linear discriminant
l Bayesian classification analysis (LDA)
l Distance based n Artificial neural network
l K-Nearest neighbor (ANN)
n Feed-forward neural
network.
Perceptron modelling a neuron
bias
x1 w1
Signum Logistic / Sigmoid
x2 w2 f (z) o
wn
xn
A network of perceptrons
provides a powerful
model describing input /
output relations.
https://pixabay.com/vectors/brain-neuron-nerves-cell-science-2022398/
Artificial Neural Network
l A network of perceptrons.
l Input: A vector
O
I
u
n
t
p
p
u
u
t
t
Feed-forward Network
l No feed back or loop in the network.
X
Multilayered feed-forward
Network
Hidden n Layer-wise
Input Layer -2 processing
n i th layer takes input
from (i-1)th layer
and forwards its
Output output to the input
of next layer.
Fully connected
Output
(FC) feed-
Layer
forward network.
Hidden
Layer -1
Mathematical description of
the model
l Bias: wj0(i)
b(i)
W(i)
Input output relation
W(i) b(i)
l Output of j th neuron in i th layer:
i
W(1),b(1) W(2),b(2) W(m),b(m)
Input Output
Input output relation
Input W Output
Parameters
Optimization problem
Minimize:
-2(t-o) xi
f ’(z) Analytical method!
Computed given the
functional values.
f(z)(1-f(z))
Computing gradient: Back
propagation method
l Initialize W(0) .
l For each training sample (xi, oi) do
l Compute functional values of each neuron
in the forward pass.
l Update weights of each link starting from
the output layer using back propagation.
l Continue till it converges.
Classification or regression?
l Primarily a regressor.
l Build a model to predict functional value F(x)
given input x.
l Can be converted to a classifier by appropriate
encoding of classes (output vector o).
l Two class problem
l Binary encoding: 0 / 1
A. Ghosh, et al, A Low-Cost Test for Anemia Using an Artificial Neural Network,
Computer Methods and Programs in Biomedicine, Volume 229, 2023, 107251.
Measuring hemoglobin from
images of blood sample
ROI
Color correction
A. Ghosh, et al, A Low-Cost Test for Anemia Using an Artificial Neural Network,
Computer Methods and Programs in Biomedicine, Volume 229, 2023, 107251.
Measuring hemoglobin from
images of blood sample
Data Set: 344 Blood Samples of 86 patients
A. Ghosh, et al, A Low-Cost Test for Anemia Using an Artificial Neural Network,
Computer Methods and Programs in Biomedicine, Volume 229, 2023, 107251.
Measuring hemoglobin from
images of blood sample
A. Ghosh, et al, A Low-Cost Test for Anemia Using an Artificial Neural Network,
Computer Methods and Programs in Biomedicine, Volume 229, 2023, 107251.
Performance Analysis
A. Ghosh, et al, A Low-Cost Test for Anemia Using an Artificial Neural Network,
Computer Methods and Programs in Biomedicine, Volume 229, 2023, 107251.
Evaluation of a classifier
l Two class problems. AP AN
63