SlideShare a Scribd company logo
1 of 97
Professor: Fu Xianping
Name: Syed Waqas Gillani(王思齐)
Student Id: 1120190866
Email: waqasgillani98@yahoo.com
• Patterns and Pattern Classes
• Pattern Classification by Prototype Matching
• Optimum (Bayes) Statistical Classifiers
• Neural Networks and Deep Learning
• Deep Convolutional Neural Networks
Patterns And Pattern Classes
• Introduction:
Introduction to basic techniques. x
• Quantitative descriptors (e.g. area, length…).
• Patterns arranged in vectors.
– Structural techniques.
• Qualitative descriptors (relational descriptors for repetitive structures, e.g. staircase).
• Patterns arranged in strings or trees.
• Central idea: Learning from sample patterns.
Patterns And Pattern Classes
Pattern: an arrangement of descriptors (or features).
Pattern class: a family of patterns sharing some common properties.
– They are denoted by ω1, ω2,…, ωW, W being the number of classes.
 Goal of pattern recognition: assign patterns to their classes with as little human
interaction as possible.
Pattern vectors
Historical example
– Recognition of three types of iris flowers by the lengths and widths of their petals
(Fisher 1936).
Variations between and within classes.
Class separability depends strongly on the choice of descriptors.
Shape signature represented by the sampled amplitude values.
Cloud of n-dimensional points.
Other shape characteristics could have been employed (e.g. moments).
The choice of descriptors has a profound role in the recognition performance.
• Petal and sepal width and length measurements performed on iris flowers for the
purpose of data classification. The image shown is of the Iris virginica gender.
x1 = Petal width
x2 = Petal length
x3 = Sepal width
x4 = Sepal length
• A noisy object boundary, and (b) its corresponding signature.
Decision-theoretic Methods
They are based on decision (discriminant) functions.
Let x=[x1, x2,…, xn]T represent a pattern vector.
For W pattern classes ω1, ω2,…, ωW, the basic problem is to find W decision functions
d1(x), d2(x),…, dW (x)
with the property that if x belongs to class ωi:
di (x)>dj (x) for j= 1,2,… w; j≠i
• The decision boundary separating class ωi from class ωj is given by the values of x
for which di (x) = dj (x) or
dij(x)= di (x)- dj (x)=0
If x belongs to class ωi :
dij (x)>0 for j= 1,2,… w; j≠I
Matching: an unknown pattern is assigned to the class to which it is closest with
respect to a metric.
– Minimum distance classifier
Computes the Euclidean distance between the unknown pattern and each of the
prototype vectors.
– Correlation
It can be directly formulated in terms of images
Optimum statistical classifiers
Neural networks
Structural Pattern
• Structural recognition techniques are based on representing objects as strings, trees
or graphs and then defining descriptors and recognition rules based on those
representations.
• The key difference between decision-theoretic and structural methods is that the
former uses quantitative descriptors expressed in the form of numeric vectors, while
the structural techniques deal with symbolic information.
• An example of pattern vectors based on properties of sub images. See Table 11.3 for
an explanation of the components of x.
• Feature vectors with components that are invariant to transformations such as
rotation, scaling, and translation. The vector components are moment invariants.
FIGURE 12.7 Pattern (feature) vectors formed by concatenating corresponding pixels from a set of
registered images.(Original images courtesy of NASA.)
Pattern Classification By
Prototype Matching
• Prototype matching involves comparing an unknown pattern against a set of
prototypes, and assigning to the unknown pattern the class of the prototype that is
the most “similar” to the unknown. Each prototype represents a unique pattern class,
but there may be more than one prototype for each class. What distinguishes one
matching method from another is the measure used to determine similarity.
Minimum Distance Classifier
• The prototype of each pattern class is the mean vector:
• Using the Euclidean distance as a measure of closeness:
We assign x to class ωj if Dj (x) is the smallest distance. That is, the smallest distance
implies the best match in this formulation.
• It is easy to show that selecting the smallest distance is equivalent to evaluating the
functions:
and assigning x to class ωj if dj (x) yields the largest numerical value. This formulation
agrees with the concept of a decision function.
• The decision boundary between classes ωi and ωj is given by:
• The surface is the perpendicular bisector of the line segment joining mi and mJ.
• For n=2, the perpendicular bisector is a line, for n=3 it is a plane and for n>3 it is
called a hyperplane.
• In practice, the classifier works well when the distance between means is large
compared to the spread of each class.
• This occurs seldom unless the system designer controls the nature of the input.
• An example is the recognition of characters on bank checks
– American Banker’s Association E-13B font character set.
• Characters designed on a 9x7 grid.
• The characters are scanned horizontally by a head that is narrower but taller than
the character which produces a 1D signal proportional to the rate of change of the
quantity of the ink.
• The waveforms (signatures) are different for each character.
• The American Bankers Association E-13B font character set and corresponding
waveforms.
Matching By Correlation
• We have seen the definition of correlation and its properties in the Fourier domain.
• This definition is sensitive to scale changes in both images.
• Instead, we use the normalized correlation coefficient.
• Normalized correlation coefficient:
• γ (x,y) takes values in [-1,1].
• The maximum occurs when the two regions are identical.
• The mechanics of template matching.
• It is robust to changes in the amplitudes.
• Normalization with respect to scale and rotation is a challenging task.
• The compared windows may be seen as random variables.
• The correlation coefficient measures the linear dependence between X and Y.
• Detection of the eye of the hurricane. image ,Template , ,.
image Template
Best match
Correlation
coefficients
Matching Structural Prototypes
• The techniques discussed up to this point deal with patterns quantitatively, and
largely ignore any structural relationships inherent in pattern shapes. The methods
discussed in this section seek to achieve pattern recognition by capitalizing precisely
on these types of relationships. In this section, we introduce two basic approaches
for the recognition of boundary shapes based on string representations, which are
the most practical approach in structural pattern recognition.
• Matching shape numbers
• String matching
Matching Shape Numbers
• The degree of similarity, k, between two shapes is defined as the largest order for
which their shape numbers still coincide.
− Reminder: The shape number of a boundary is the first difference of smallest
magnitude of its chain code (invariance to rotation).
− The order n of a shape number is defined as the number of digits in its
representation.
• Let a and b denote two closed shapes which are represented by 4-directional chain
codes and s(a) and s(b) their shape numbers.
• The shapes have a degree of similarity, k, if:
• This means that the first k digits should be equal.
• The subscript indicates the order. For 4-directional chain codes, the minimum order
for a closed boundary is 4.
• Alternatively, the distance between two shapes a and b is defined as the inverse of
their degree of similarity:
• It satisfies the properties:
String Matching
• Region boundaries a and b are code into strings denoted a1a2a3 …an and b1b2b3
…bm.
• Let p represent the number of matches between the two strings.
− A match at the k-th position occurs if ak=bk.
• The number of symbols that do not match is:
• A simple measure of similarity is:
Optimum Statistical Classifiers
• A probabilistic approach to recognition.
• It is possible to derive an optimal approach, in the sense that, on average, it yields
the lowest probability of committing classification errors.
• The probability that a pattern x comes from class ωj is denoted by p(ωj /x).
• If the classifier decides that x came from ωj when it actually came from ωi it incurs a
loss denoted by Lij.
Bayes Classifier
• As pattern x may belong to any of W classes, the average loss assigning x to ωj is:
• Because 1/p(x) is positive and common to all rj(x) the expression reduces to:
• p(x/ωj) is the pdf of patterns of class ωj (class conditional density).
• P(ωj) is the probability of occurrence of class ωj (a priori or prior probability).
• The classifier evaluates r1(x), r2(x),…, rW(x), and assigns pattern x to the class with the
smallest average loss.
• The classifier that minimizes the total average loss is called the Bayes classifier.
• It assigns an unknown pattern x to class ωi if:
• The loss for a wrong decision is generally assigned to a non zero value (e.g. 1)
• The loss for a correct decision is 0.
• The Bayes classifier assigns pattern x to class ωi if:
which is the computation of decision functions:
• The probability of occurrence of each class P(ωj) must be known.
– Generally, we consider them equal, P(ωj)=1/W.
• The probability densities of the patterns in each class P(x/ωj) must be known.
– More difficult problem (especially for multidimensional variables) which requires
methods from pdf estimation.
– Generally, we assume:
• Analytic expressions for the pdf.
• The pdf parameters may be estimated from sample patterns.
• The Gaussian is the most common pdf.
Bayes Classifier For Gaussian Pattern
Classes
• We first consider the 1-D case for W=2 classes.
For P(ωj)=1/2:
• In the n-D case:
• Each density is specified by its mean vector and its covariance matrix:
• Approximation of the mean vector and covariance matrix from samples from the
classes:
• It is more convenient to work with the natural logarithm of the decision function as
it is monotonically increasing and it does not change the order of the decision
functions:
• The decision functions are hyper quadrics.
• If all the classes have the same covarinace Cj=C, j=1,2,…,W the decision functions
are linear (hyperplanes):
• Moreover, if P(ωj)=1/W and Cj=I:
which is the minimum distance classifier decision function.
• The minimum distance classifier is optimum in the Bayes sense if:
− The pattern classes are Gaussian.
− All classes are equally to occur.
− All covariance matrices are equal to (the same multiple of) the identity matrix.
• Gaussian pattern classes satisfying these conditions are spherical clouds
(hyperspheres)
• The classifier establishes a hyperplane between every pair of classes.
− It is the perpendicular bisector of the line segment joining the centers of the
classes
Application To Remotely Sensed
Images
• 4-D vectors.
• Three classes
− Water
− Urban development
− Vegetation
• Mean vectors and covariance matrices learnt from samples whose class is known.
− Here, we will use samples from the image to learn the pdf parameters.
FIGURE 12.21 Bayes classification of multispectral data. (a)–(d) Images in the visible blue, visible
green, visible red, and near infrared wavelength bands. (e) Masks for regions of water (labeled 1),
urban development (labeled 2),and vegetation (labeled 3). (f) Results of classification; the black
dots denote points classified incorrectly. The other (white) points were classified correctly. (g) All
image pixels classified as water (in white). (h) All image pixels classified as urban development (in
white). (i) All image pixels classified as vegetation (in white).
• TABLE 12.1
Bayes classification of multispectral image data. Classes 1, 2, and 3 are water, urban,
and vegetation, respectively.
Neural Networks And Deep Learning
• Neural networks are a set of algorithms, modeled loosely after the human brain,
that are designed to recognize patterns. They interpret sensory data through a kind
of machine perception, labeling or clustering raw input. The patterns they recognize
are numerical, contained in vectors, into which all real-world data, be it images,
sound, text or time series, must be translated.
• Deep learning is the name we use for “stacked neural networks”; that is, networks
composed of several layers.
• Traditional object detection methods are built on handcrafted features and shallow
trainable architectures.
• The generation of candidate bounding boxes with a sliding window strategy is
redundant, inefficient and inaccurate.
The Perceptron
A single perceptron unit learns a linear boundary between two linearly separable
pattern classes. Figure 12.22(a) shows the simplest possible example in two
dimensions: two pattern classes, consisting of a single pattern each. A linear boundary
in 2-D is a straight line with equation y = ax + b, where coefficient a is the slope and b
is the y-intercept. Note that if b = 0, the line goes through the origin. Therefore, the
function of parameter b is to displace the line from the origin without affecting its
slope. For this reason, this “floating” coefficient that is not multiplied by a coordinate
is often referred to as the bias, the bias coefficient, or the bias weight.
in a line that separates the two classes in Fig. 12.22. This is a line positioned in such a
way that pattern (x , y ) 1 1 from class c1 lies on one side of the line, and pattern (x , y
) 2 2 from class c2 lies on the other. The locus of points (x, y) that are on the line,
satisfy the equation y − ax − b = 0. It then follows that any point on one side of the
line would yield a positive value when its coordinates are plugged into this equation,
and conversely for a point on the other side.
Points in n dimensions are vectors. The components of a vector, x1,x2……,xn are the
coordinates of the point. For the coefficients of the boundary separating the two
classes, we use the notation w1,w2 ,…,wn,wn+1, where wn+1 is the bias. The general
equation of our line using this notation is w1x1 + w2x2 + w3 = 0 (we can express this
equation in slope-intercept form as x2 + (w1 /w2 ) x1+ w3/ w2 = 0 ).Figure 12.22(b) is
the same as (a), but using this notation. Comparing the two figures, we see that y = x2
, x = x1, a =w1 /w2, and b =w3/ w2.
• FIGURE 12.22
(a) The simplest two-class example in 2-D, showing one possible decision boundary
out of an infinite number of such boundaries. (b) Same as (a), but with the decision
boundary expressed using more general notation.
an arbitrary point (x1 , x2 ) is on the positive side of a line if w1x1 + w2x2 + w3 > 0, and
conversely for any point on the negative side. For points in 3-D, we work with the
equation of a plane, w1x1 + w2x2 + w3x3 + w4 = 0, but would perform exactly the same
test to see if a point lies on the positive or negative side of the plane. For a point in n
dimensions, the test would be against a hyperplane, whose equation is
where w and x are n-dimensional column vectors and wTx is the dot (inner) product
of the two vectors. Because the inner product is commutative, we can express Eq. (12-
38) in the equivalent form xTw + wn+1 = 0. We refer to w as a weight vector and, as
above, to wn+1 as a bias. Because the bias is a weight that is always multiplied by 1,
sometimes we avoid repetition by using the term weights, coefficients, or parameters
when referring to the bias and the elements of a weight vector collectively.
find a set of weights with the property
Finding a line that separates two linearly separable pattern classes in 2-D can be done
by inspection. Finding a separating plane by visual inspection of 3-D data is more
difficult, but it is doable. For n > 3, finding a separating hyperplane by inspection
becomes impossible in general.
The perceptron is an implementation of such an algorithm. It attempts to find a
solution by iteratively stepping through the patterns of each of two classes. It starts
with an arbitrary weight vector and bias, and is guaranteed to converge in a finite
number of iterations if the classes are linearly separable.
The perceptron algorithm is simple. Let a > 0 denote a correction increment (also
called the learning increment or the learning rate), let w(1) be a vector with arbitrary
values, and let wn+1(1) be an arbitrary constant.
• For a pattern vector, x(k), at step k,
The correction in Eq. (12-40) is applied when the pattern is from class c1 and Eq. (12-
39) does not give a positive response. Similarly, the correction in Eq. (12-41) is applied
when the pattern is from class c2 and Eq. (12-39) does not give a negative response.
As Eq. (12-42) shows, no change is made when Eq. (12-39) gives the correct response.
The notation in Eqs. (12-40) through (12-42) can be simplified if we add a 1 at the end
of every pattern vector and include the bias in the weight vector. That is, we define x
Then, Eq. (12-39) becomes
where both vectors are now (n + 1)-dimensional. In this formulation, x and w are
referred to as augmented pattern and weight vectors, respectively. The algorithm in
Eqs. (12-40) through (12-42) then becomes: For any pattern vector, x(k), at step k
where the starting weight vector, w(1), is arbitrary and, as above, a is a positive
constant. The procedure implemented by Eqs. (12-40)–(12-42) or (12-44)–(12-46) is
called the perceptron training algorithm. The perceptron convergence theorem states
that the algorithm is guaranteed to converge to a solution (i.e., a separating
hyperplane) in a finite number of steps if the two pattern classes are linearly separable
Normally, Eqs. (12-44)–(12-46) are the basis for implementing the perceptron training
algorithm, and we will use it in the following paragraphs of this section. However, the
notation in Eqs. (12-40)–(12-42), in which the bias is shown separately, is more
prevalent in neural networks, so you need to be familiar with it as well.
FIGURE 12.23
Schematic of a perceptron, showing the operations it performs.
Figure 12.23 shows a schematic diagram of the perceptron. As you can see, all this
simple “machine” does is form a sum of products of an input pattern using the
weights and bias found during training. The output of this operation is a scalar value
that is then passed through an activation function to produce the unit’s output. For
the perceptron, the activation function is a thresholding function (we will consider
other forms of activation when we discuss neural networks). If the thresholded output
is a +1, we say that the pattern belongs to class c1. Otherwise, a −1 indicates that the
pattern belongs to class c2. Values
Multilayer Feedforward Neural
Networks
The architecture and operation of multilayer neural networks, and derive the
equations of backpropagation used to train them.
Model of an Artificial Neuron
Neural networks are interconnected perceptron-like computing elements called
artificial neurons. These neurons perform the same computations as the perceptron,
but they differ from the latter in how they process the result of the computations. As
illustrated in Fig. 12.23, the perceptron uses a “hard” thresholding function that
outputs two values, such as +1 and −1, to perform classification. Suppose that in a
network of perceptron's, the output before thresholding of one of the perceptron's is
infinitesimally greater than zero. When thresholded, this very small signal will be
turned into a +1. But a similarly small signal with the opposite sign would cause a
large swing in value from +1 to −1.
• FIGURE 12.29
Model of an artificial neuron, showing all the operations it performs. The “ℓ” is used to
denote a particular layer in a layered network.
Neural networks are formed from layers of computing units, in which the output of
one unit affects the behavior of all units following it. The perceptron’s sensitivity to
the sign of small signals can cause serious stability problems in an interconnected
system of such units, making perceptron's unsuitable for layered architectures. The
solution is to change the characteristic of the activation function from a hard limiter
to a smooth function.
z is the result of the computation performed by the neuron, as shown in Fig. 12.29.
Except for more complicated notation, and the use of a smooth function rather than a
hard threshold, this model performs the same sum-of-products operations as in Eq.
(12-36) for the perceptron. Note that the bias term is denoted by b instead of wn+1, as
we do the perceptron.
The symbol “ℓ” to denote layers.
variable z to denote the sum-of-products computed by the neuron. The output of the
unit, denoted by a, is obtained by passing z through h. h the activation function, and
refer to its output, a = h(z), as the activation value of the unit.
FIGURE 12.30 Various activation functions. (a) Sigmoid. (b) Hyperbolic tangent (also has a sigmoid shape,
but it is centered about 0 in both dimensions). (c) Rectifier linear unit (ReLU).
Figure 12.30(a) shows a plot of h(z) from Eq. (12-51). Because this function has the
shape of a sigmoid function, the unit in Fig. 12.29 is sometimes called an artificial
sigmoid neuron, or simply a sigmoid neuron. Its derivative has a very nice form,
expressible in terms of h(z) [see Problem 12.16(a)]:
Figures 12.30(b) and (c) show two other forms of h(z) used frequently. The hyperbolic
tangent also has the shape of a sigmoid function, but it is symmetric about both axes.
This property can help improve the convergence of the backpropagation algorithm to
be discussed later. The function in Fig. 12.30(c) is called the rectifier function, and a
unit using it is referred to a rectifier linear unit (ReLU). Often, you see the function
itself referred to as the ReLU activation function. Experimental results suggest that this
function tends to outperform the other two in deep neural networks.
Interconnecting Neurons To Form A
Fully Connected Neural Network
A typical neural network has anything from a few dozen to hundreds, thousands, or
even millions of artificial neurons called units arranged in a series of layers, each of
which connects to the layers on either side. Some of them, known as input units, are
designed to receive various forms of information from the outside world that the
network will attempt to learn about, recognize, or otherwise process. Other units sit
on the opposite side of the network and signal how it responds to the information it's
learned; those are known as output units. In between the input units and output
units are one or more layers of hidden units, which, together, form the majority of the
artificial brain. Most neural networks are fully connected, which means each hidden
unit and each output unit is connected to every unit in the layers either side. The
connections between one unit and another are represented by a number called
a weight, which can be either positive (if one unit excites another) or negative (if one
unit suppresses or inhibits another). The higher the weight, the more influence one
unit has on another.
Information flows through a neural network in two ways. When it's learning (being
trained) or operating normally (after being trained), patterns of information are fed
into the network via the input units, which trigger the layers of hidden units, and
these in turn arrive at the output units. This common design is called a feedforward
network. Not all units "fire" all the time. Each unit receives inputs from the units to its
left, and the inputs are multiplied by the weights of the connections they travel along.
Every unit adds up all the inputs it receives in this way and (in the simplest type of
network) if the sum is more than a certain threshold value, the unit "fires" and
triggers the units it's connected to (those on its right).
Neural networks learn things in exactly the same way, typically by a feedback process
called backpropagation (sometimes abbreviated as "back prop"). This involves
comparing the output a network produces with the output it was meant to produce,
and using the difference between them to modify the weights of the connections
between the units in the network, working from the output units through the hidden
units to the input units—going backward, in other words. In time, backpropagation
causes the network to learn, reducing the difference between actual and intended
output to the point where the two exactly coincide, so the network figures things out
exactly as it should.
Forward Pass Through A Feedforward
Neural Network
A forward pass through a neural network maps the input layer (i.e., values of x) to the
output layer. The values in the output layer are used for determining the class of an
input vector. The equations developed in this section explain how a feedforward
neural network carries out the computations that result in its output. Implicit in the
discussion in this section is that the network parameters (weights and biases) are
known. The important results in this section will be summarized in Table 12.2 at the
end of our discussion, but understanding the material that gets us there is important
when we discuss training of neural nets in the next section.
The Equations Of A Forward Pass
The outputs of the layer 1 are the components of input vector x:
where n1=n is the dimensionality of x. As illustrated in Figs. 12.29 and 12.31, the
computation performed by neuron i in layer ℓ is given by
for i = 1, 2,…, nℓ and ℓ = 2,…, L. Quantity zi(ℓ) is called the net (or total) input to
neuron i in layer ℓ, and is sometimes denoted by neti. The reason for this terminology
is that zi(ℓ) is formed using all outputs from layer ℓ − 1. The output (activation value)
of neuron i in layer is given by
where h is an activation function. The value of network output node i is
Equations (12-53) through (12-56) describe all the operations required to map the
input of a fully connected feedforward network to its output.
Matrix Formulation
The preceding example reveal that there are numerous individual computations
involved in a pass through a neural network. If you wrote a computer program to
automate the steps we just discussed, you would find the code to be very inefficient
because of all the required loop computations, the numerous node and layer indexing
you would need, and so forth. We can develop a more elegant (and computationally
faster) implementation by using matrix operations. This means writing Eqs. (12-53)
through (12-55) as follows. First, note that the number of outputs in layer 1 is always
of the same dimension as an input pattern, x, so its matrix (vector) form is simple:
a(1)=x (12-57)
Eq. (12-54). We know that the summation term is just the inner product of two vectors
[see Eqs. (12-37) and (12-38)]. However, this equation has to be evaluated for all
nodes in every layer past the first. This implies that a loop is required if we do the
computations node by node. The solution is to form a matrix, W(ℓ), that contains all
the weights in layer ℓ. The structure of this matrix is simple each of its rows contains
the weights for one of the nodes in layer : ℓ
Then, we can obtain all the sum-of-products computations, zi(ℓ), for layer
simultaneously:
where a(ℓ−1) is a column vector of dimension nℓ−1 ×1 containing the outputs of layer
ℓ−1, b() is a column vector of dimension nℓ ×1 containing the bias values of all the
neurons in layer, and z(ℓ) is an nℓ ×1 column vector containing the net input values, zi
(ℓ) i = 1 2 , , ,…, nℓ, to all the nodes in layer ℓ. You can easily verify that Eq. (12-59) is
dimensionally correct. Because the activation function is applied to each net input
independently of the others, the outputs of the network at any layer can be expressed
in vector form as:
Implementing Eqs. (12-57) through (12-60) requires just a series of matrix operations,
with no loops.
FIGURE 12.33
Same as Fig. 12.32, but using matrix labeling.
Deep Convolutional Neural Networks
• CNN is the most representative model of deep learning.
• A typical CNN architecture is referred to as Visual Geometry Group Network.
• Each layer of CNN is known as a feature map.
• The feature map of the input layer is a 3D matrix of pixel intensities for different
color channels (e.g. RGB).
• The feature map of any internal layer is an induced multi-channel image, whose
‘pixel’ can be viewed as a specific feature.
The typical VGG16 has totally 13 convolutional (conv) layers, 3 fully connected
layers, 3 max-pooling layers and a softmax classification layer.
The conv feature maps are produced by convoluting 3*3 filter windows, and feature
map resolutions are reduced with 2 stride max-pooling layers.
Every neuron is connected with a small portion of adjacent neurons from the
previous layer (receptive field).
Different types of transformations can be conducted on feature maps, such as
filtering and pooling.
Filtering(convolution) operation convolutes a filter matrix (learned weights) with the
values of a receptive field of neurons and takes a nonlinear function (such as
sigmoid, ReLU) to obtain final responses.
Pooling operation, such as max pooling, average pooling, L2-pooling and local
contrast normalization, summaries the responses of a receptive field into one value
to produce more robust feature descriptions.
With an interleave between convolution and pooling, an initial feature hierarchy is
constructed, which can be fine-tuned in a supervised manner by adding several fully
connected (FC) layers to adapt to different visual tasks.
Fully Connected Layer
According to the tasks involved, the final layer with different activation functions is
added to get a specific conditional probability for each output neuron.
And the whole network can be optimized on an objective function (e.g. mean
squared error or cross-entropy loss) via the stochastic gradient descent (SGD)
method.
• Hierarchical feature representation, which is the multilevel representations from
pixel to high-level semantic features learned by a hierarchical multi-stage structure,
can be learned from data automatically and hidden factors of input data can be
disentangled through multi-level nonlinear mappings.
• Compared with traditional shallow models, a deeper architecture provides an
exponentially increased expressive capability.
• The architecture of CNN provides an opportunity to jointly optimize several related
tasks together (e.g. Fast RCNN combines classification and bounding box regression
into a multi-task leaning manner).
• Benefitting from the large learning capacity of deep CNNs, some classical computer
vision challenges can be recast as high-dimensional data transform problems and
solved from a different viewpoint.
Neural Computations In A CNN
The basic computation performed by an artificial neuron is a sum of products
between weights and values from a previous layer. To this we add a bias and call the
result the net (total) input to the neuron, which we denoted by zi .
The sum involved in generating zi is a single sum. The computations performed in a
CNN to generate a single value in a feature map is 2-D convolution. this is a double
sum of products between the coefficients of a kernel and the corresponding elements
of the image array overlapped by the kernel. With reference to Fig. 12.40, let w denote
a kernel formed by arranging the weights in the shape of the receptive field we
discussed in connection with that figure. For notational consistency with Section 12.5,
let ax,y denote image or pooled feature values, depending on the layer.
The convolution value at any point (x, y) in the input is given by
where l and k span the dimensions of the kernel. Suppose that w is of size 3 × 3. Then,
we can then expand this equation into the following sum of products:
We could relabel the subscripts on w and a, and write instead
The results of Eqs. (12-84) and (12-85) are identical. If we add a bias to the latter
equation and call the result z we have
we add a bias to the spatial convolution computation performed by a CNN at any
fixed position (x, y) in the input, the result can be expressed in a form identical to the
computation performed by an artificial neuron in a fully connected neural net. We
need the x, y only to account for the fact that we are working in 2-D. If we think of z as
the net input to a neuron, the analogy with the neurons discussed in Section 12.5 is
completed by passing z through an activation function, h, to get the output of the
neuron:
This is exactly how the value of any point in a feature map. Value is given by
adding three convolution equations:
where the superscripts refer to the three pooled feature maps in Fig. 12.40. The values
of l, k, x, and y are the same in all three equations because all three kernels are of the
same size and they move in unison. We could expand this equation and obtain a sum
of products that is lengthier than for point A in Fig. 12.40, but we could still relabel all
terms and obtain a sum of products that involves only one summation, exactly as
before.
The preceding result tells us that the equations used to obtain the value of an
element of any feature map in a CNN can be expressed in the form of the
computation performed by an artificial neuron. This holds for any feature map,
regardless of how many convolutions are involved in the computation of the elements
of that feature map, in which case we would simply be dealing with the sum of more
convolution equations. The implication is that we can use the basic form of Eqs. (12-
86) and (12-87) to describe how the value of an element in any feature map of a CNN
is obtained. we do not have to account explicitly for the number of different pooled
feature maps used in a pooling layer. The result is a significant simplification of the
equations that describe forward and backpropagation in a CNN.
Multiple Input Images
• The values of ax,y just discussed are pixel values in the first layer but, in layers past
the first, ax,y denotes values of pooled features. However, our equations do not
differentiate based on what these variables actually represent. the three components
of an RGB image. The equations for the value of point A in the figure would now
have the same form as those we stated for point B only the weights and biases
would be different. Thus, the results in the previous discussion for one input image
are applicable directly to multiple input images.
The Equations Of A Forward Pass
Through A CNN
The result of convolving a kernel, w, and an input array with values ax,y , as
where l and k span the dimensions of the kernel, x and y span the dimensions of the
input, and b is a bias. The corresponding value of ax,y is
But this ax,y is different from the one we used to compute Eq. (12-89), in which ax,y
represents values from the previous layer. Thus, we are going to need additional
notation to differentiate between layers. As in fully connected neural nets, we use for
this purpose, and write Eqs. (12-89) and (12-90) as
for ℓ= 1, 2,…, Lc where Lc is the number of convolutional layers, and ax,y(ℓ) denotes the
values of pooled features in convolutional layer ℓ. When ℓ = 1,
ax,y(0) = {values of pixels in the input image(s)} (12-93)
When ℓ = Lc,
ax,y (Lc)= {values of pooled features in last layer of the CNN} (12-94)
Note that starts at 1 instead of 2, as we did in Section 12.5. The reason is that we are
naming layers, as in “convolutional layer .” It would be confusing to start at
convolutional layer 2. Finally, we note that the pooling does not require any
convolutions. The only function of pooling is to reduce the spatial dimensions of the
feature map preceding it, so we do not include explicit pooling equations here.
Equations (12-91) through (12-94) are all we need to compute all values in a forward
pass through the convolutional section of a CNN. As described in Fig. 12.40, the
values of the pooled features of the last layer are vectorized and fed into a fully
connected feedforward neural network, whose forward propagation is explained in
Eqs. (12-54) and (12-55) or, in matrix form, in Table 12.2.
TABLE 12.2
Steps in the matrix computation of a forward pass through a fully connected, feedforward multilayer neural
net.
Digital Image Processing.pptx

More Related Content

Similar to Digital Image Processing.pptx

Lecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest NeighborsLecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest NeighborsMarina Santini
 
DMTM Lecture 11 Clustering
DMTM Lecture 11 ClusteringDMTM Lecture 11 Clustering
DMTM Lecture 11 ClusteringPier Luca Lanzi
 
clustering tendency
clustering tendencyclustering tendency
clustering tendencyAmir Shokri
 
Machine learning Introduction
Machine learning IntroductionMachine learning Introduction
Machine learning IntroductionKuppusamy P
 
Machine Learning Foundations for Professional Managers
Machine Learning Foundations for Professional ManagersMachine Learning Foundations for Professional Managers
Machine Learning Foundations for Professional ManagersAlbert Y. C. Chen
 
Chris Dyer - 2017 - Neural MT Workshop Invited Talk: The Neural Noisy Channel...
Chris Dyer - 2017 - Neural MT Workshop Invited Talk: The Neural Noisy Channel...Chris Dyer - 2017 - Neural MT Workshop Invited Talk: The Neural Noisy Channel...
Chris Dyer - 2017 - Neural MT Workshop Invited Talk: The Neural Noisy Channel...Association for Computational Linguistics
 
Texture,pattern and pattern classes
Texture,pattern and pattern classesTexture,pattern and pattern classes
Texture,pattern and pattern classesrajisri2
 
Probability distribution Function & Decision Trees in machine learning
Probability distribution Function  & Decision Trees in machine learningProbability distribution Function  & Decision Trees in machine learning
Probability distribution Function & Decision Trees in machine learningSadia Zafar
 
Dimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptxDimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptxRohanBorgalli
 
[Paper reading] L-SHAPLEY AND C-SHAPLEY: EFFICIENT MODEL INTERPRETATION FOR S...
[Paper reading] L-SHAPLEY AND C-SHAPLEY: EFFICIENT MODEL INTERPRETATION FOR S...[Paper reading] L-SHAPLEY AND C-SHAPLEY: EFFICIENT MODEL INTERPRETATION FOR S...
[Paper reading] L-SHAPLEY AND C-SHAPLEY: EFFICIENT MODEL INTERPRETATION FOR S...Daiki Tanaka
 
Introduction to Probabilistic Latent Semantic Analysis
Introduction to Probabilistic Latent Semantic AnalysisIntroduction to Probabilistic Latent Semantic Analysis
Introduction to Probabilistic Latent Semantic AnalysisNYC Predictive Analytics
 
How to analyse bulk transcriptomic data using Deseq2
How to analyse bulk transcriptomic data using Deseq2How to analyse bulk transcriptomic data using Deseq2
How to analyse bulk transcriptomic data using Deseq2AdamCribbs1
 
Text classification using Text kernels
Text classification using Text kernelsText classification using Text kernels
Text classification using Text kernelsDev Nath
 

Similar to Digital Image Processing.pptx (20)

Lecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest NeighborsLecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest Neighbors
 
DMTM Lecture 11 Clustering
DMTM Lecture 11 ClusteringDMTM Lecture 11 Clustering
DMTM Lecture 11 Clustering
 
clustering tendency
clustering tendencyclustering tendency
clustering tendency
 
Cs345 cl
Cs345 clCs345 cl
Cs345 cl
 
Machine learning Introduction
Machine learning IntroductionMachine learning Introduction
Machine learning Introduction
 
Machine Learning Foundations for Professional Managers
Machine Learning Foundations for Professional ManagersMachine Learning Foundations for Professional Managers
Machine Learning Foundations for Professional Managers
 
Chris Dyer - 2017 - Neural MT Workshop Invited Talk: The Neural Noisy Channel...
Chris Dyer - 2017 - Neural MT Workshop Invited Talk: The Neural Noisy Channel...Chris Dyer - 2017 - Neural MT Workshop Invited Talk: The Neural Noisy Channel...
Chris Dyer - 2017 - Neural MT Workshop Invited Talk: The Neural Noisy Channel...
 
Texture,pattern and pattern classes
Texture,pattern and pattern classesTexture,pattern and pattern classes
Texture,pattern and pattern classes
 
My7class
My7classMy7class
My7class
 
Probability distribution Function & Decision Trees in machine learning
Probability distribution Function  & Decision Trees in machine learningProbability distribution Function  & Decision Trees in machine learning
Probability distribution Function & Decision Trees in machine learning
 
Dimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptxDimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptx
 
Linear Regression.pptx
Linear Regression.pptxLinear Regression.pptx
Linear Regression.pptx
 
Cluster Analysis.pptx
Cluster Analysis.pptxCluster Analysis.pptx
Cluster Analysis.pptx
 
[Paper reading] L-SHAPLEY AND C-SHAPLEY: EFFICIENT MODEL INTERPRETATION FOR S...
[Paper reading] L-SHAPLEY AND C-SHAPLEY: EFFICIENT MODEL INTERPRETATION FOR S...[Paper reading] L-SHAPLEY AND C-SHAPLEY: EFFICIENT MODEL INTERPRETATION FOR S...
[Paper reading] L-SHAPLEY AND C-SHAPLEY: EFFICIENT MODEL INTERPRETATION FOR S...
 
Introduction to Probabilistic Latent Semantic Analysis
Introduction to Probabilistic Latent Semantic AnalysisIntroduction to Probabilistic Latent Semantic Analysis
Introduction to Probabilistic Latent Semantic Analysis
 
How to analyse bulk transcriptomic data using Deseq2
How to analyse bulk transcriptomic data using Deseq2How to analyse bulk transcriptomic data using Deseq2
How to analyse bulk transcriptomic data using Deseq2
 
Text classification using Text kernels
Text classification using Text kernelsText classification using Text kernels
Text classification using Text kernels
 
Lec10 matching
Lec10 matchingLec10 matching
Lec10 matching
 
CNN for modeling sentence
CNN for modeling sentenceCNN for modeling sentence
CNN for modeling sentence
 
Cluster analysis
Cluster analysisCluster analysis
Cluster analysis
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 

Digital Image Processing.pptx

  • 1. Professor: Fu Xianping Name: Syed Waqas Gillani(王思齐) Student Id: 1120190866 Email: waqasgillani98@yahoo.com
  • 2. • Patterns and Pattern Classes • Pattern Classification by Prototype Matching • Optimum (Bayes) Statistical Classifiers • Neural Networks and Deep Learning • Deep Convolutional Neural Networks
  • 3. Patterns And Pattern Classes • Introduction: Introduction to basic techniques. x • Quantitative descriptors (e.g. area, length…). • Patterns arranged in vectors. – Structural techniques. • Qualitative descriptors (relational descriptors for repetitive structures, e.g. staircase). • Patterns arranged in strings or trees. • Central idea: Learning from sample patterns.
  • 4. Patterns And Pattern Classes Pattern: an arrangement of descriptors (or features). Pattern class: a family of patterns sharing some common properties. – They are denoted by ω1, ω2,…, ωW, W being the number of classes.  Goal of pattern recognition: assign patterns to their classes with as little human interaction as possible.
  • 5. Pattern vectors Historical example – Recognition of three types of iris flowers by the lengths and widths of their petals (Fisher 1936). Variations between and within classes. Class separability depends strongly on the choice of descriptors. Shape signature represented by the sampled amplitude values. Cloud of n-dimensional points. Other shape characteristics could have been employed (e.g. moments). The choice of descriptors has a profound role in the recognition performance.
  • 6. • Petal and sepal width and length measurements performed on iris flowers for the purpose of data classification. The image shown is of the Iris virginica gender. x1 = Petal width x2 = Petal length x3 = Sepal width x4 = Sepal length
  • 7. • A noisy object boundary, and (b) its corresponding signature.
  • 8. Decision-theoretic Methods They are based on decision (discriminant) functions. Let x=[x1, x2,…, xn]T represent a pattern vector. For W pattern classes ω1, ω2,…, ωW, the basic problem is to find W decision functions d1(x), d2(x),…, dW (x) with the property that if x belongs to class ωi: di (x)>dj (x) for j= 1,2,… w; j≠i
  • 9. • The decision boundary separating class ωi from class ωj is given by the values of x for which di (x) = dj (x) or dij(x)= di (x)- dj (x)=0 If x belongs to class ωi : dij (x)>0 for j= 1,2,… w; j≠I Matching: an unknown pattern is assigned to the class to which it is closest with respect to a metric. – Minimum distance classifier Computes the Euclidean distance between the unknown pattern and each of the prototype vectors. – Correlation It can be directly formulated in terms of images Optimum statistical classifiers Neural networks
  • 10. Structural Pattern • Structural recognition techniques are based on representing objects as strings, trees or graphs and then defining descriptors and recognition rules based on those representations. • The key difference between decision-theoretic and structural methods is that the former uses quantitative descriptors expressed in the form of numeric vectors, while the structural techniques deal with symbolic information.
  • 11. • An example of pattern vectors based on properties of sub images. See Table 11.3 for an explanation of the components of x.
  • 12. • Feature vectors with components that are invariant to transformations such as rotation, scaling, and translation. The vector components are moment invariants.
  • 13. FIGURE 12.7 Pattern (feature) vectors formed by concatenating corresponding pixels from a set of registered images.(Original images courtesy of NASA.)
  • 14. Pattern Classification By Prototype Matching • Prototype matching involves comparing an unknown pattern against a set of prototypes, and assigning to the unknown pattern the class of the prototype that is the most “similar” to the unknown. Each prototype represents a unique pattern class, but there may be more than one prototype for each class. What distinguishes one matching method from another is the measure used to determine similarity.
  • 15. Minimum Distance Classifier • The prototype of each pattern class is the mean vector: • Using the Euclidean distance as a measure of closeness: We assign x to class ωj if Dj (x) is the smallest distance. That is, the smallest distance implies the best match in this formulation.
  • 16. • It is easy to show that selecting the smallest distance is equivalent to evaluating the functions: and assigning x to class ωj if dj (x) yields the largest numerical value. This formulation agrees with the concept of a decision function. • The decision boundary between classes ωi and ωj is given by:
  • 17. • The surface is the perpendicular bisector of the line segment joining mi and mJ. • For n=2, the perpendicular bisector is a line, for n=3 it is a plane and for n>3 it is called a hyperplane.
  • 18.
  • 19. • In practice, the classifier works well when the distance between means is large compared to the spread of each class. • This occurs seldom unless the system designer controls the nature of the input. • An example is the recognition of characters on bank checks – American Banker’s Association E-13B font character set. • Characters designed on a 9x7 grid. • The characters are scanned horizontally by a head that is narrower but taller than the character which produces a 1D signal proportional to the rate of change of the quantity of the ink. • The waveforms (signatures) are different for each character.
  • 20. • The American Bankers Association E-13B font character set and corresponding waveforms.
  • 21. Matching By Correlation • We have seen the definition of correlation and its properties in the Fourier domain. • This definition is sensitive to scale changes in both images. • Instead, we use the normalized correlation coefficient. • Normalized correlation coefficient:
  • 22. • γ (x,y) takes values in [-1,1]. • The maximum occurs when the two regions are identical. • The mechanics of template matching. • It is robust to changes in the amplitudes. • Normalization with respect to scale and rotation is a challenging task.
  • 23.
  • 24. • The compared windows may be seen as random variables. • The correlation coefficient measures the linear dependence between X and Y.
  • 25. • Detection of the eye of the hurricane. image ,Template , ,. image Template Best match Correlation coefficients
  • 26. Matching Structural Prototypes • The techniques discussed up to this point deal with patterns quantitatively, and largely ignore any structural relationships inherent in pattern shapes. The methods discussed in this section seek to achieve pattern recognition by capitalizing precisely on these types of relationships. In this section, we introduce two basic approaches for the recognition of boundary shapes based on string representations, which are the most practical approach in structural pattern recognition. • Matching shape numbers • String matching
  • 27. Matching Shape Numbers • The degree of similarity, k, between two shapes is defined as the largest order for which their shape numbers still coincide. − Reminder: The shape number of a boundary is the first difference of smallest magnitude of its chain code (invariance to rotation). − The order n of a shape number is defined as the number of digits in its representation. • Let a and b denote two closed shapes which are represented by 4-directional chain codes and s(a) and s(b) their shape numbers. • The shapes have a degree of similarity, k, if:
  • 28. • This means that the first k digits should be equal. • The subscript indicates the order. For 4-directional chain codes, the minimum order for a closed boundary is 4. • Alternatively, the distance between two shapes a and b is defined as the inverse of their degree of similarity:
  • 29. • It satisfies the properties:
  • 30. String Matching • Region boundaries a and b are code into strings denoted a1a2a3 …an and b1b2b3 …bm. • Let p represent the number of matches between the two strings. − A match at the k-th position occurs if ak=bk. • The number of symbols that do not match is: • A simple measure of similarity is:
  • 31. Optimum Statistical Classifiers • A probabilistic approach to recognition. • It is possible to derive an optimal approach, in the sense that, on average, it yields the lowest probability of committing classification errors. • The probability that a pattern x comes from class ωj is denoted by p(ωj /x). • If the classifier decides that x came from ωj when it actually came from ωi it incurs a loss denoted by Lij.
  • 32. Bayes Classifier • As pattern x may belong to any of W classes, the average loss assigning x to ωj is: • Because 1/p(x) is positive and common to all rj(x) the expression reduces to:
  • 33. • p(x/ωj) is the pdf of patterns of class ωj (class conditional density). • P(ωj) is the probability of occurrence of class ωj (a priori or prior probability). • The classifier evaluates r1(x), r2(x),…, rW(x), and assigns pattern x to the class with the smallest average loss. • The classifier that minimizes the total average loss is called the Bayes classifier. • It assigns an unknown pattern x to class ωi if:
  • 34. • The loss for a wrong decision is generally assigned to a non zero value (e.g. 1) • The loss for a correct decision is 0.
  • 35. • The Bayes classifier assigns pattern x to class ωi if: which is the computation of decision functions:
  • 36. • The probability of occurrence of each class P(ωj) must be known. – Generally, we consider them equal, P(ωj)=1/W. • The probability densities of the patterns in each class P(x/ωj) must be known. – More difficult problem (especially for multidimensional variables) which requires methods from pdf estimation. – Generally, we assume: • Analytic expressions for the pdf. • The pdf parameters may be estimated from sample patterns. • The Gaussian is the most common pdf.
  • 37. Bayes Classifier For Gaussian Pattern Classes • We first consider the 1-D case for W=2 classes. For P(ωj)=1/2:
  • 38. • In the n-D case: • Each density is specified by its mean vector and its covariance matrix:
  • 39. • Approximation of the mean vector and covariance matrix from samples from the classes: • It is more convenient to work with the natural logarithm of the decision function as it is monotonically increasing and it does not change the order of the decision functions:
  • 40. • The decision functions are hyper quadrics. • If all the classes have the same covarinace Cj=C, j=1,2,…,W the decision functions are linear (hyperplanes): • Moreover, if P(ωj)=1/W and Cj=I: which is the minimum distance classifier decision function.
  • 41. • The minimum distance classifier is optimum in the Bayes sense if: − The pattern classes are Gaussian. − All classes are equally to occur. − All covariance matrices are equal to (the same multiple of) the identity matrix. • Gaussian pattern classes satisfying these conditions are spherical clouds (hyperspheres) • The classifier establishes a hyperplane between every pair of classes. − It is the perpendicular bisector of the line segment joining the centers of the classes
  • 42. Application To Remotely Sensed Images • 4-D vectors. • Three classes − Water − Urban development − Vegetation • Mean vectors and covariance matrices learnt from samples whose class is known. − Here, we will use samples from the image to learn the pdf parameters.
  • 43.
  • 44. FIGURE 12.21 Bayes classification of multispectral data. (a)–(d) Images in the visible blue, visible green, visible red, and near infrared wavelength bands. (e) Masks for regions of water (labeled 1), urban development (labeled 2),and vegetation (labeled 3). (f) Results of classification; the black dots denote points classified incorrectly. The other (white) points were classified correctly. (g) All image pixels classified as water (in white). (h) All image pixels classified as urban development (in white). (i) All image pixels classified as vegetation (in white).
  • 45. • TABLE 12.1 Bayes classification of multispectral image data. Classes 1, 2, and 3 are water, urban, and vegetation, respectively.
  • 46. Neural Networks And Deep Learning • Neural networks are a set of algorithms, modeled loosely after the human brain, that are designed to recognize patterns. They interpret sensory data through a kind of machine perception, labeling or clustering raw input. The patterns they recognize are numerical, contained in vectors, into which all real-world data, be it images, sound, text or time series, must be translated. • Deep learning is the name we use for “stacked neural networks”; that is, networks composed of several layers. • Traditional object detection methods are built on handcrafted features and shallow trainable architectures. • The generation of candidate bounding boxes with a sliding window strategy is redundant, inefficient and inaccurate.
  • 47. The Perceptron A single perceptron unit learns a linear boundary between two linearly separable pattern classes. Figure 12.22(a) shows the simplest possible example in two dimensions: two pattern classes, consisting of a single pattern each. A linear boundary in 2-D is a straight line with equation y = ax + b, where coefficient a is the slope and b is the y-intercept. Note that if b = 0, the line goes through the origin. Therefore, the function of parameter b is to displace the line from the origin without affecting its slope. For this reason, this “floating” coefficient that is not multiplied by a coordinate is often referred to as the bias, the bias coefficient, or the bias weight.
  • 48. in a line that separates the two classes in Fig. 12.22. This is a line positioned in such a way that pattern (x , y ) 1 1 from class c1 lies on one side of the line, and pattern (x , y ) 2 2 from class c2 lies on the other. The locus of points (x, y) that are on the line, satisfy the equation y − ax − b = 0. It then follows that any point on one side of the line would yield a positive value when its coordinates are plugged into this equation, and conversely for a point on the other side. Points in n dimensions are vectors. The components of a vector, x1,x2……,xn are the coordinates of the point. For the coefficients of the boundary separating the two classes, we use the notation w1,w2 ,…,wn,wn+1, where wn+1 is the bias. The general equation of our line using this notation is w1x1 + w2x2 + w3 = 0 (we can express this equation in slope-intercept form as x2 + (w1 /w2 ) x1+ w3/ w2 = 0 ).Figure 12.22(b) is the same as (a), but using this notation. Comparing the two figures, we see that y = x2 , x = x1, a =w1 /w2, and b =w3/ w2.
  • 49. • FIGURE 12.22 (a) The simplest two-class example in 2-D, showing one possible decision boundary out of an infinite number of such boundaries. (b) Same as (a), but with the decision boundary expressed using more general notation.
  • 50. an arbitrary point (x1 , x2 ) is on the positive side of a line if w1x1 + w2x2 + w3 > 0, and conversely for any point on the negative side. For points in 3-D, we work with the equation of a plane, w1x1 + w2x2 + w3x3 + w4 = 0, but would perform exactly the same test to see if a point lies on the positive or negative side of the plane. For a point in n dimensions, the test would be against a hyperplane, whose equation is
  • 51. where w and x are n-dimensional column vectors and wTx is the dot (inner) product of the two vectors. Because the inner product is commutative, we can express Eq. (12- 38) in the equivalent form xTw + wn+1 = 0. We refer to w as a weight vector and, as above, to wn+1 as a bias. Because the bias is a weight that is always multiplied by 1, sometimes we avoid repetition by using the term weights, coefficients, or parameters when referring to the bias and the elements of a weight vector collectively. find a set of weights with the property
  • 52. Finding a line that separates two linearly separable pattern classes in 2-D can be done by inspection. Finding a separating plane by visual inspection of 3-D data is more difficult, but it is doable. For n > 3, finding a separating hyperplane by inspection becomes impossible in general. The perceptron is an implementation of such an algorithm. It attempts to find a solution by iteratively stepping through the patterns of each of two classes. It starts with an arbitrary weight vector and bias, and is guaranteed to converge in a finite number of iterations if the classes are linearly separable. The perceptron algorithm is simple. Let a > 0 denote a correction increment (also called the learning increment or the learning rate), let w(1) be a vector with arbitrary values, and let wn+1(1) be an arbitrary constant.
  • 53. • For a pattern vector, x(k), at step k,
  • 54. The correction in Eq. (12-40) is applied when the pattern is from class c1 and Eq. (12- 39) does not give a positive response. Similarly, the correction in Eq. (12-41) is applied when the pattern is from class c2 and Eq. (12-39) does not give a negative response. As Eq. (12-42) shows, no change is made when Eq. (12-39) gives the correct response. The notation in Eqs. (12-40) through (12-42) can be simplified if we add a 1 at the end of every pattern vector and include the bias in the weight vector. That is, we define x Then, Eq. (12-39) becomes
  • 55. where both vectors are now (n + 1)-dimensional. In this formulation, x and w are referred to as augmented pattern and weight vectors, respectively. The algorithm in Eqs. (12-40) through (12-42) then becomes: For any pattern vector, x(k), at step k
  • 56. where the starting weight vector, w(1), is arbitrary and, as above, a is a positive constant. The procedure implemented by Eqs. (12-40)–(12-42) or (12-44)–(12-46) is called the perceptron training algorithm. The perceptron convergence theorem states that the algorithm is guaranteed to converge to a solution (i.e., a separating hyperplane) in a finite number of steps if the two pattern classes are linearly separable Normally, Eqs. (12-44)–(12-46) are the basis for implementing the perceptron training algorithm, and we will use it in the following paragraphs of this section. However, the notation in Eqs. (12-40)–(12-42), in which the bias is shown separately, is more prevalent in neural networks, so you need to be familiar with it as well.
  • 57. FIGURE 12.23 Schematic of a perceptron, showing the operations it performs.
  • 58. Figure 12.23 shows a schematic diagram of the perceptron. As you can see, all this simple “machine” does is form a sum of products of an input pattern using the weights and bias found during training. The output of this operation is a scalar value that is then passed through an activation function to produce the unit’s output. For the perceptron, the activation function is a thresholding function (we will consider other forms of activation when we discuss neural networks). If the thresholded output is a +1, we say that the pattern belongs to class c1. Otherwise, a −1 indicates that the pattern belongs to class c2. Values
  • 59. Multilayer Feedforward Neural Networks The architecture and operation of multilayer neural networks, and derive the equations of backpropagation used to train them. Model of an Artificial Neuron Neural networks are interconnected perceptron-like computing elements called artificial neurons. These neurons perform the same computations as the perceptron, but they differ from the latter in how they process the result of the computations. As illustrated in Fig. 12.23, the perceptron uses a “hard” thresholding function that outputs two values, such as +1 and −1, to perform classification. Suppose that in a network of perceptron's, the output before thresholding of one of the perceptron's is infinitesimally greater than zero. When thresholded, this very small signal will be turned into a +1. But a similarly small signal with the opposite sign would cause a large swing in value from +1 to −1.
  • 60. • FIGURE 12.29 Model of an artificial neuron, showing all the operations it performs. The “ℓ” is used to denote a particular layer in a layered network.
  • 61. Neural networks are formed from layers of computing units, in which the output of one unit affects the behavior of all units following it. The perceptron’s sensitivity to the sign of small signals can cause serious stability problems in an interconnected system of such units, making perceptron's unsuitable for layered architectures. The solution is to change the characteristic of the activation function from a hard limiter to a smooth function.
  • 62. z is the result of the computation performed by the neuron, as shown in Fig. 12.29. Except for more complicated notation, and the use of a smooth function rather than a hard threshold, this model performs the same sum-of-products operations as in Eq. (12-36) for the perceptron. Note that the bias term is denoted by b instead of wn+1, as we do the perceptron. The symbol “ℓ” to denote layers. variable z to denote the sum-of-products computed by the neuron. The output of the unit, denoted by a, is obtained by passing z through h. h the activation function, and refer to its output, a = h(z), as the activation value of the unit.
  • 63. FIGURE 12.30 Various activation functions. (a) Sigmoid. (b) Hyperbolic tangent (also has a sigmoid shape, but it is centered about 0 in both dimensions). (c) Rectifier linear unit (ReLU).
  • 64. Figure 12.30(a) shows a plot of h(z) from Eq. (12-51). Because this function has the shape of a sigmoid function, the unit in Fig. 12.29 is sometimes called an artificial sigmoid neuron, or simply a sigmoid neuron. Its derivative has a very nice form, expressible in terms of h(z) [see Problem 12.16(a)]: Figures 12.30(b) and (c) show two other forms of h(z) used frequently. The hyperbolic tangent also has the shape of a sigmoid function, but it is symmetric about both axes. This property can help improve the convergence of the backpropagation algorithm to be discussed later. The function in Fig. 12.30(c) is called the rectifier function, and a unit using it is referred to a rectifier linear unit (ReLU). Often, you see the function itself referred to as the ReLU activation function. Experimental results suggest that this function tends to outperform the other two in deep neural networks.
  • 65. Interconnecting Neurons To Form A Fully Connected Neural Network A typical neural network has anything from a few dozen to hundreds, thousands, or even millions of artificial neurons called units arranged in a series of layers, each of which connects to the layers on either side. Some of them, known as input units, are designed to receive various forms of information from the outside world that the network will attempt to learn about, recognize, or otherwise process. Other units sit on the opposite side of the network and signal how it responds to the information it's learned; those are known as output units. In between the input units and output units are one or more layers of hidden units, which, together, form the majority of the artificial brain. Most neural networks are fully connected, which means each hidden unit and each output unit is connected to every unit in the layers either side. The connections between one unit and another are represented by a number called a weight, which can be either positive (if one unit excites another) or negative (if one unit suppresses or inhibits another). The higher the weight, the more influence one unit has on another.
  • 66.
  • 67. Information flows through a neural network in two ways. When it's learning (being trained) or operating normally (after being trained), patterns of information are fed into the network via the input units, which trigger the layers of hidden units, and these in turn arrive at the output units. This common design is called a feedforward network. Not all units "fire" all the time. Each unit receives inputs from the units to its left, and the inputs are multiplied by the weights of the connections they travel along. Every unit adds up all the inputs it receives in this way and (in the simplest type of network) if the sum is more than a certain threshold value, the unit "fires" and triggers the units it's connected to (those on its right).
  • 68. Neural networks learn things in exactly the same way, typically by a feedback process called backpropagation (sometimes abbreviated as "back prop"). This involves comparing the output a network produces with the output it was meant to produce, and using the difference between them to modify the weights of the connections between the units in the network, working from the output units through the hidden units to the input units—going backward, in other words. In time, backpropagation causes the network to learn, reducing the difference between actual and intended output to the point where the two exactly coincide, so the network figures things out exactly as it should.
  • 69. Forward Pass Through A Feedforward Neural Network A forward pass through a neural network maps the input layer (i.e., values of x) to the output layer. The values in the output layer are used for determining the class of an input vector. The equations developed in this section explain how a feedforward neural network carries out the computations that result in its output. Implicit in the discussion in this section is that the network parameters (weights and biases) are known. The important results in this section will be summarized in Table 12.2 at the end of our discussion, but understanding the material that gets us there is important when we discuss training of neural nets in the next section.
  • 70. The Equations Of A Forward Pass The outputs of the layer 1 are the components of input vector x: where n1=n is the dimensionality of x. As illustrated in Figs. 12.29 and 12.31, the computation performed by neuron i in layer ℓ is given by for i = 1, 2,…, nℓ and ℓ = 2,…, L. Quantity zi(ℓ) is called the net (or total) input to neuron i in layer ℓ, and is sometimes denoted by neti. The reason for this terminology is that zi(ℓ) is formed using all outputs from layer ℓ − 1. The output (activation value) of neuron i in layer is given by
  • 71. where h is an activation function. The value of network output node i is Equations (12-53) through (12-56) describe all the operations required to map the input of a fully connected feedforward network to its output.
  • 72. Matrix Formulation The preceding example reveal that there are numerous individual computations involved in a pass through a neural network. If you wrote a computer program to automate the steps we just discussed, you would find the code to be very inefficient because of all the required loop computations, the numerous node and layer indexing you would need, and so forth. We can develop a more elegant (and computationally faster) implementation by using matrix operations. This means writing Eqs. (12-53) through (12-55) as follows. First, note that the number of outputs in layer 1 is always of the same dimension as an input pattern, x, so its matrix (vector) form is simple: a(1)=x (12-57)
  • 73. Eq. (12-54). We know that the summation term is just the inner product of two vectors [see Eqs. (12-37) and (12-38)]. However, this equation has to be evaluated for all nodes in every layer past the first. This implies that a loop is required if we do the computations node by node. The solution is to form a matrix, W(ℓ), that contains all the weights in layer ℓ. The structure of this matrix is simple each of its rows contains the weights for one of the nodes in layer : ℓ
  • 74. Then, we can obtain all the sum-of-products computations, zi(ℓ), for layer simultaneously: where a(ℓ−1) is a column vector of dimension nℓ−1 ×1 containing the outputs of layer ℓ−1, b() is a column vector of dimension nℓ ×1 containing the bias values of all the neurons in layer, and z(ℓ) is an nℓ ×1 column vector containing the net input values, zi (ℓ) i = 1 2 , , ,…, nℓ, to all the nodes in layer ℓ. You can easily verify that Eq. (12-59) is dimensionally correct. Because the activation function is applied to each net input independently of the others, the outputs of the network at any layer can be expressed in vector form as:
  • 75. Implementing Eqs. (12-57) through (12-60) requires just a series of matrix operations, with no loops.
  • 76. FIGURE 12.33 Same as Fig. 12.32, but using matrix labeling.
  • 77. Deep Convolutional Neural Networks • CNN is the most representative model of deep learning. • A typical CNN architecture is referred to as Visual Geometry Group Network. • Each layer of CNN is known as a feature map. • The feature map of the input layer is a 3D matrix of pixel intensities for different color channels (e.g. RGB). • The feature map of any internal layer is an induced multi-channel image, whose ‘pixel’ can be viewed as a specific feature.
  • 78.
  • 79. The typical VGG16 has totally 13 convolutional (conv) layers, 3 fully connected layers, 3 max-pooling layers and a softmax classification layer. The conv feature maps are produced by convoluting 3*3 filter windows, and feature map resolutions are reduced with 2 stride max-pooling layers. Every neuron is connected with a small portion of adjacent neurons from the previous layer (receptive field). Different types of transformations can be conducted on feature maps, such as filtering and pooling.
  • 80. Filtering(convolution) operation convolutes a filter matrix (learned weights) with the values of a receptive field of neurons and takes a nonlinear function (such as sigmoid, ReLU) to obtain final responses. Pooling operation, such as max pooling, average pooling, L2-pooling and local contrast normalization, summaries the responses of a receptive field into one value to produce more robust feature descriptions. With an interleave between convolution and pooling, an initial feature hierarchy is constructed, which can be fine-tuned in a supervised manner by adding several fully connected (FC) layers to adapt to different visual tasks.
  • 82. According to the tasks involved, the final layer with different activation functions is added to get a specific conditional probability for each output neuron. And the whole network can be optimized on an objective function (e.g. mean squared error or cross-entropy loss) via the stochastic gradient descent (SGD) method.
  • 83. • Hierarchical feature representation, which is the multilevel representations from pixel to high-level semantic features learned by a hierarchical multi-stage structure, can be learned from data automatically and hidden factors of input data can be disentangled through multi-level nonlinear mappings. • Compared with traditional shallow models, a deeper architecture provides an exponentially increased expressive capability.
  • 84. • The architecture of CNN provides an opportunity to jointly optimize several related tasks together (e.g. Fast RCNN combines classification and bounding box regression into a multi-task leaning manner). • Benefitting from the large learning capacity of deep CNNs, some classical computer vision challenges can be recast as high-dimensional data transform problems and solved from a different viewpoint.
  • 85. Neural Computations In A CNN The basic computation performed by an artificial neuron is a sum of products between weights and values from a previous layer. To this we add a bias and call the result the net (total) input to the neuron, which we denoted by zi . The sum involved in generating zi is a single sum. The computations performed in a CNN to generate a single value in a feature map is 2-D convolution. this is a double sum of products between the coefficients of a kernel and the corresponding elements of the image array overlapped by the kernel. With reference to Fig. 12.40, let w denote a kernel formed by arranging the weights in the shape of the receptive field we discussed in connection with that figure. For notational consistency with Section 12.5, let ax,y denote image or pooled feature values, depending on the layer.
  • 86.
  • 87. The convolution value at any point (x, y) in the input is given by where l and k span the dimensions of the kernel. Suppose that w is of size 3 × 3. Then, we can then expand this equation into the following sum of products: We could relabel the subscripts on w and a, and write instead
  • 88. The results of Eqs. (12-84) and (12-85) are identical. If we add a bias to the latter equation and call the result z we have we add a bias to the spatial convolution computation performed by a CNN at any fixed position (x, y) in the input, the result can be expressed in a form identical to the computation performed by an artificial neuron in a fully connected neural net. We need the x, y only to account for the fact that we are working in 2-D. If we think of z as the net input to a neuron, the analogy with the neurons discussed in Section 12.5 is completed by passing z through an activation function, h, to get the output of the neuron:
  • 89. This is exactly how the value of any point in a feature map. Value is given by adding three convolution equations: where the superscripts refer to the three pooled feature maps in Fig. 12.40. The values of l, k, x, and y are the same in all three equations because all three kernels are of the same size and they move in unison. We could expand this equation and obtain a sum of products that is lengthier than for point A in Fig. 12.40, but we could still relabel all terms and obtain a sum of products that involves only one summation, exactly as before.
  • 90. The preceding result tells us that the equations used to obtain the value of an element of any feature map in a CNN can be expressed in the form of the computation performed by an artificial neuron. This holds for any feature map, regardless of how many convolutions are involved in the computation of the elements of that feature map, in which case we would simply be dealing with the sum of more convolution equations. The implication is that we can use the basic form of Eqs. (12- 86) and (12-87) to describe how the value of an element in any feature map of a CNN is obtained. we do not have to account explicitly for the number of different pooled feature maps used in a pooling layer. The result is a significant simplification of the equations that describe forward and backpropagation in a CNN.
  • 91. Multiple Input Images • The values of ax,y just discussed are pixel values in the first layer but, in layers past the first, ax,y denotes values of pooled features. However, our equations do not differentiate based on what these variables actually represent. the three components of an RGB image. The equations for the value of point A in the figure would now have the same form as those we stated for point B only the weights and biases would be different. Thus, the results in the previous discussion for one input image are applicable directly to multiple input images.
  • 92. The Equations Of A Forward Pass Through A CNN The result of convolving a kernel, w, and an input array with values ax,y , as where l and k span the dimensions of the kernel, x and y span the dimensions of the input, and b is a bias. The corresponding value of ax,y is
  • 93. But this ax,y is different from the one we used to compute Eq. (12-89), in which ax,y represents values from the previous layer. Thus, we are going to need additional notation to differentiate between layers. As in fully connected neural nets, we use for this purpose, and write Eqs. (12-89) and (12-90) as
  • 94. for ℓ= 1, 2,…, Lc where Lc is the number of convolutional layers, and ax,y(ℓ) denotes the values of pooled features in convolutional layer ℓ. When ℓ = 1, ax,y(0) = {values of pixels in the input image(s)} (12-93) When ℓ = Lc, ax,y (Lc)= {values of pooled features in last layer of the CNN} (12-94)
  • 95. Note that starts at 1 instead of 2, as we did in Section 12.5. The reason is that we are naming layers, as in “convolutional layer .” It would be confusing to start at convolutional layer 2. Finally, we note that the pooling does not require any convolutions. The only function of pooling is to reduce the spatial dimensions of the feature map preceding it, so we do not include explicit pooling equations here. Equations (12-91) through (12-94) are all we need to compute all values in a forward pass through the convolutional section of a CNN. As described in Fig. 12.40, the values of the pooled features of the last layer are vectorized and fed into a fully connected feedforward neural network, whose forward propagation is explained in Eqs. (12-54) and (12-55) or, in matrix form, in Table 12.2.
  • 96. TABLE 12.2 Steps in the matrix computation of a forward pass through a fully connected, feedforward multilayer neural net.