homkermap.h implements the homogeneous kernel maps introduced in [13] , [14] . Such maps are efficient linear representations of popular kernels such as the intersection, , and Jensen-Shannon ones.
Overview
The homogeneous kernel map is a finite dimensional linear approximation of homgeneous kernels, including the intersection, , and Jensen-Shannon kernels. These kernels are ffrequently used in computer vision applications because they are particular suitable for data in the format of histograms, which encompasses many visual descriptors used.
Let be non-negative scalars and let
be an homogeneous kernel such as the
and or the intersection ones:
For vectorial data , the homogeneous kernels in an additive combination
.
The homogeneous kernel map of order is a vectorial function
such that, for any choice of
, one has
Given the feature map for the scalar case, the corresponding feature map for the vectorial case is obtained by stacking
. Note that the combined feature
has dimension
.
Using linear analysis tools (e.g. a linear support vector machine) on top of dataset that has been encoded by the homogeneous kernel map is therefore approximately equivalent to using a method based on the corresponding non-linear kernel.
Extension to the negative reals
Any positive (semi-)definite kernel defined on the non-negative reals
can be extended to the entiere real line by using the definition:
The homogeneous kernel map implements this extension by defining . Note that other extensions are possible, such as
where is the Heavyside function, but may require higher dimensional feature maps.
Homogeneity order
Any (1-)homogeneous kernel can be extended to a so called gamma-homgeneous kernel
by the definition
Smaller value of enhance the kernel non-linearity and are sometimes beneficial in applications (see [1,2] for details).
Windowing and period
This section discusses aspects of the homogeneous kernel map which are more technical and may be skipped. The homogeneous kernel map approximation is based on periodicizing the kernel; given the kernel signature
the homogeneous kerne map is a feature map for the windowed and periodicized kernel whose signature is given by
where is a windowing function and
is the period. This implementation of the homogeneous kernel map supports the use of a uniform window (
) or of a rectangular window (
). Note that
is equal to the logarithmic ratio of the arguments of the kernel. Empirically, the rectangular window seems to have a slight edge in applications.
Usage
The homogeneous kernel map is implemented as an object of type VlHomogeneousKernelMap. To use thois object, first create an instance by vl_homogeneouskernelmap_new, then use vl_homogeneouskernelmap_evaluate_d or vl_homogeneouskernelmap_evaluate_f (depdening on whether the data is double
or float
) to compute the feature map . When done, dispose of the object by calling vl_homogeneouskernelmap_delete.
The constructor vl_homogeneouskernelmap_new requires the kernel type kernel
(see VlHomogeneousKernelType), the homogeneity order gamma
(use one for the standard kernels), the approximation order order
(usually order one is enough), the period period (use a negative value to use the default period), and a window type window
(use VlHomogeneousKernelMapWindowRectangular if unsure). The approximation order trades off the quality and dimensionality of the approximation. The resulting feature map , computed by vl_homogeneouskernelmap_evaluate_d or vl_homogeneouskernelmap_evaluate_f , is
2*order+1
dimensional.
The code pre-computes the map for efficient evaluation. The table spans values of
in the range
. In particular, values smaller than
are treated as zeroes (which result in a null feature).
Technical details
The code uses the expressions given in [13] , [14] to compute in closed form the maps for the suppoerted kernel types. For efficiency reasons, it tabulates
when the homogeneous kernel map object is created.
The interal table stores for
by sampling this variable. In particular,
x
is decomposed as
x = mantissa * (2**exponent), minExponent <= exponent <= maxExponent, 1 <= matnissa < 2.
Each octave is further subdivided in numSubdivisions
sublevels.
When the map is evaluated,
x
is decomposed back into exponent and mantissa, and the result is computed by bilinear interpolation from the appropriate table entries.