Ipmv Mod 5&6 (Theory Questions)
Ipmv Mod 5&6 (Theory Questions)
SVM Kernels
In practice, SVM algorithm is implemented with kernel that transforms an input data space
into the required form. SVM uses a technique called the kernel trick in which kernel takes a
low dimensional input space and transforms it into a higher dimensional space. In simple
words, kernel converts non-separable problems into separable problems by adding more
dimensions to it. It makes SVM more powerful, flexible and accurate. The following are some
of the types of kernels used by SVM.
Linear Kernel
It can be used as a dot product between any two observations. The formula of linear kernel is
as below −
K(x,xi) = sum(x*xi)
From the above formula, we can see that the product between two vectors say 𝑥 & 𝑥𝑖 is the
sum of the multiplication of each pair of input values.
Polynomial Kernel
It is more generalized form of linear kernel and distinguish curved or nonlinear input space.
Following is the formula for polynomial kernel −
k(X,Xi) =1+sum(X*Xi)^d
Here d is the degree of polynomial, which we need to specify manually in the learning
algorithm.
Radial Basis Function (RBF) Kernel
RBF kernel, mostly used in SVM classification, maps input space in indefinite dimensional
space. Following formula explains it mathematically −
K(x,xi)=exp(-gamma*sum(x-xi^2))
Here, gamma ranges from 0 to 1. We need to manually specify it in the learning algorithm. A
good default value of gamma is 0.1.
Pros of SVM classifiers
SVM classifiers offers great accuracy and work well with high dimensional space. SVM
classifiers basically use a subset of training points hence in result uses very less memory.
Cons of SVM classifiers
They have high training time hence in practice not suitable for large datasets. Another
disadvantage is that SVM classifiers do not work well with overlapping classes.
Point C is the centroid. The phasor r completes 3600, we get a one dimensional representation
of r(Φ) will be constant, equal to the radius of the circle. The signature can thus be defined as
1-diemnsional representation of a boundary.
Consider another boundary in the shape of a square. In the case r(Φ) will be given by the
formula r(Φ)=x sec θ
The figure shows a N-point digital boundary in the spatial Domain. Each of these edges
pixels can be defined by its x and y coordinates. Starting at an arbitrary point
(x0,y0),(x1,y1),(x2,y2)……..(xn-1,yn-1) points are encountered as we move in the counter
clockwise direction. Each of these points can be expressed as xr and yr for r=0,1……N-1.
These coordinates values can be used to generate a complex function of the form,
f(n)= x(n)+j y(n) for n=0,1,2,……..,N-1
Hence the x-axis is treated as real axis and y-axis as the imaginary axis. The Fourier
transform of this function f(n) yields the frequency components that describe the given edge.
The discrete Fourier transform (DFT) of f(n) is
F(u)=1/N∑N−1n=0f(n)e−j2πun/N for u=0,1,2,………...,N−1
F(u)=1/N∑n=0N−1f(n)e−j2πun/N for u=0,1,2,………...,N−1
The advantage of using this equation is that it reduces the edge description problem from 2-
Diemsnsional to 1-Dimension.
Substituting the value of f(n) we have,
F(u)=1/N∑N−1n=0[x(n)+jy(n)]e−j2πun/N for u=0,1,2,…..,N−1
F(u)=1/N∑n=0N−1[x(n)+jy(n)]e−j2πun/N for u=0,1,2,…..,N−1
The coefficients of F(u) are called Fourier descriptors. The inverse discrete fourier transform
(IDFT) of F(u) gives back f(n).
F(n)=∑N−1n=0F(u)e+j2πun/N for n=0,1,2,3……N−1
F(n)=∑n=0N−1F(u)e+j2πun/N for n=0,1,2,3……N−1
However instead of using all the F(u) coefficients, we only use few of them while remaining
terms are made zero,
f(n)=∑N−1n=0F(u)e+j2πun/N for n=0,1,2,3……N−1
f(n)=∑n=0N−1F(u)e+j2πun/N for n=0,1,2,3……N−1
Although only M terms are used for F(u), f(n) still has 0 to N-1 values. That is the same
number of points exist in the new approximated boundary but not as many terms are used in
the reconstruction of each point.
A B-spline is a generalization of the Bezier curve. Let a vector known as the knot vector be
defined
T={t0,t1,……,tm} (1)
where T is a non decreasing sequence with ti belongs to [0,1] , and define control points P0, ...,
Pn. Define the degree as
P=m-n-1 (2)
(3)
(4)
Specific types include the non-periodic B-spline (first p+1 knots equal 0 and last p+1equal to
1; illustrated above) and uniform B-spline internal knots are equally spaced). A B-spline with
no internal knots is a Bezier curve.
APPLICATION
Fitting a smooth surface on irregular data is a problem in many applications of data analysis.
Spline polynomials in different orders have been used for interpolation and approximation in
one or two-dimensional space in many researches. These polynomials can be made by different
degrees and they have continuous derivative at the boundaries. The advantage of using B-spline
basis functions for obtaining spline polynomials is that they impose the continuity constraints
in an implicit form and, more importantly, their calculation is much simpler.