Learning from Few Samples: Transformation-Invariant SVMs with Composition and Locality at Multiple Scales
Abstract
Motivated by the problem of learning with small sample sizes, this paper shows how to incorporate into support-vector machines (SVMs) those properties that have made convolutional neural networks (CNNs) successful.
Particularly important is the ability to incorporate domain knowledge of invariances, e.g., translational invariance of images.
Kernels based on the maximum similarity over a group of transformations are not generally positive definite.
Perhaps it is for this reason that they have not been studied theoretically.
We address this lacuna and show that positive definiteness indeed holds with high probability for kernels based on the maximum similarity in the small training sample set regime of interest, and that they do yield the best results in that regime.
We also show how additional properties such as their ability to incorporate local features at multiple spatial scales, e.g., as done in CNNs through max pooling, and to provide the benefits of composition through the architecture of multiple layers, can also be embedded into SVMs.
We verify through experiments on widely available image sets that the resulting SVMs do provide superior accuracy in comparison to well-established deep neural network benchmarks for small sample sizes.
Introduction
With the goal of learning when the number of training samples is small, and motivated by the success of CNNs [35, 31], we wish to endow SVMs with as much a priori domain knowledge as possible.
One such important domain property for image recognition is translational invariance.
An image of a dog remains an image of the same dog if the image is shifted to the left.
Similarly, it is also rotation-invariant.
More generally, given a group of transformations under which the classification of images is invariant, we show how to endow SVMs with the knowledge of such invariance.
One common approach is data augmentation [29, 6], where several transformations of each training sample are added to the training set.
When applying SVMs on this augmented training set, it corresponds to a kernel that defines the similarity between two vectors X 1 and X 2 as the average similarity between X 1 and all transformations of X 2 .
However the average also includes transformations that are maximally dissimilar, and we show that it leads to poor margins and poor classification results.
More appealing is to construct a kernel that defines similarity as the maximum similarity between Xand all transformations of X 2 .
We show that this kernel is positive definite with high probability in the small sample size regime of interest to us, under a probabilistic model for features.
We verify this property on widely available datasets and show that the improvement obtained by endowing SVMs with this transformation invariance yields considerably better test accuracy.
Another important domain property for image recognition is the “locality" of features, e.g., an edge depends only on a sharp gradient between neighboring pixels.
Through operations such as maxpooling, CNNs exploit locality at multiple spatial scales.
We show how one may incorporate such locality into polynomial SVMs.
Finally, their multi-layer architecture provides CNNs the benefits of composition [7].
We show how one can iteratively introduce multiple layers into SVMs to facilitate composition.
The introduction of multiple layers increases computational complexity, and we show how this can be alleviated by parallel computation so as to achieve a reduction of computation time by increasing memory.
We show experimentally that the resulting SVMs provide significantly improved performance for small datasets.
Translational and rotational invariance embedded into SVMs allows them to recognize objects that have not already been centered in images or oriented in upright positions; referred to as transformed datasets in the sequel.
The transformation-invariant SVMs provide significant improvements over SVMs as well as CNN benchmarks without data augmentation when the training set is small.
For 100/200/500 training samples, the recognition accuracy of the MNIST dataset [17] is increased, respectively, from the figures of 68.33%/83.20%/91.33% reported by the CNNs optimized over architectures and dimensions [10] to, respectively, 81.55%/89.23%/93.11%.
Similar improvements are also obtained in the EMNIST Letters [4] and Transformed MNIST datasets.
Computational results reported here are for small datasets, handled efficiently by LIBSVM [2].
1.1 Background
In the early 2000s, SVMs [5] were one of the most effective methods for image classification [19].
They had a firm theoretical foundation of margin maximization [32, 1] that is especially important in high dimensions, and a kernel method to make high-dimensional computation tractable.
However, with the advent of CNNs and the enhanced computing power of GPUs, SVMs were replaced in image classification.
One reason was that CNNs were able to incorporate prior knowledge.
The pioneering paper [35] emphasizes that “It is usually accepted that good generalization performance on real-world problems cannot be achieved unless some a priori knowledge about the task is built into the system.
Back-propagation networks provide a way of specifying such knowledge by imposing constraints both on the architecture of the network and on its weights.
In general, such constraints can be considered as particular transformations of the parameter space.
" It further mentions specifically that, “Multilayer constrained networks perform very well on this task when organized in a hierarchical structure with shift-invariant feature detectors."
Indeed, CNNs have successfully incorporated several important characteristics of images.
One, mentioned above (called shift-invariance), is translational invariance, which is exploited by the constancy, i.e., location independence, of the convolution matrices.
A second is locality.
For example, an “edge" in an image can be recognized from just the neighboring pixels.
This is exploited by the low dimensionality of the kernel matrix.
A third characteristic is the multiplicity of spatial scales, i.e., a hierarchy of spatial “features" of multiple sizes in images.
These three properties are captured in modern CNNs through the “pooling" operation at the ( ℓ + 1) -th layer, where the features of the ℓ -th layer are effectively low-pass filtered through operations such as max-pooling.
More recently, it has been shown that depth in neural networks (NNs) of rectified linear units (ReLUs) permits composition, enhances expressivity for a given number of parameters, and reduces the number needed for accurate approximations [7].
Generally, neural networks have become larger over time with the number of parameters ranging into hundreds of millions, concomitantly also data-hungry, and therefore inapplicable in applications where data is expensive or scarce, e.g., medical data [20].
For these reasons, there is an interest in methodologies for learning efficiently from very few samples, which is the focus of this paper.
1.2 Related Work
There are mainly two sets of studies: on transformation-invariant kernels and on local correlations.
Transformation-Invariant Kernels.
There are two major routes to explore transformation invariant kernels [26, 16].
The most widely used is based on Haar-integration kernels, called “average-fit” kernels in this paper, which average over a transformation group [27, 12, 11, 23, 21, 22].
Although trivially positive definite, they appear to produce poor results in our testing (Section 4).
Mairal et al.
[21] reported some good results when a large dataset is available for pre-training bottom network layers unsupervised [24], but our focus is on data-scarce situations where no such large dataset is available.
This paper concentrates on “best-fit” kernels, which are based on the maximum similarity over transformations.
“Jittering kernels" [8, 9] calculate the minimum distance between one sample and all jittered forms of another sample, analogous to this paper.
Instead of measuring the minimum distance between samples, tangent distance kernels [30, 13] use a linear approximation to measure the minimum distance between sets generated by the transformation group, which can only guarantee local invariance.
In comparison, our “best-fit” kernel is defined as the maximum inner product between one sample and all transformed forms of another sample, which enjoys global invariance and differs from jittering kernels for non-norm-preserving transformations (e.g., scaling transformations).
Although “best-fit” kernels enjoy a good performance, they are not guaranteed to be positive definite, thus the global optimality of the SVM solution cannot be guaranteed theoretically.
We address this lacuna and show that positive definiteness indeed holds with high probability in the small training sample set regime for the “best-fit” kernel.
Additionally, we show that locality at multiple scales can further improve the performance of “best-fit” kernels.
We note that there were also some works that treat an indefinite kernel matrix as a noisy observation of some unknown positive semidefinite matrix [3, 36], but our goal is to analyze conditions that make the “best-fit” kernel positive definite.
Local Correlations.
Since “local correlations," i.e., dependencies between nearby pixels, are more pronounced than long-range correlations in natural images, Scholkopf et al.
[25] defined a two-layer kernel utilizing dot product in a polynomial space which is mainly spanned by local correlations between pixels.
We extend the structure of two-layer local correlation to multilayer architectures by introducing further compositions, which gives the flexibility to consider the locality at multiple spatial scales.
We also analyze the corresponding time and space complexity of multilayer architectures.
Kernels with Transformational Invariance
To fix notation, let S =
{ ( X 1 , y 1 ) , . . .
, ( X n , y n ) } be a set of n labeled samples with m -dimensional feature vectors
X i =
( X (1) i , . . .
, X ( m ) i )
T ∈
X ⊂ R m and labels y i ∈ Y .
2.1 Transformation Groups and Transformation-Invariant Best-Fit Kernels
We wish to endow the kernel of the SVM with the domain knowledge that the sample classification is invariant under certain transformations of the sample vectors.
Let G be a transformation group that acts on X , i.e., for all S, T, U ∈ G : (i) T maps X into X ; (ii) the identity map I ∈ G ; (iii) ST ∈ G ; (iv) ( ST ) U = S ( TU ) ; (v) there is an inverse T − 1 ∈ G with TT − 1 =
T − 1 T
= I .
We start with a base kernel K base : X × X → R that satisfies the following properties:
Symmetry, i.e., K base ( X i , X j ) =
K base ( X j , X i ) ; 2.
Positive definiteness, i.e., positive semi-definiteness
of
its
Gram
matrix: (cid:80)
[Equation]
=
[Equation]
i
[Equation]
j K base ( X i , X j ) ≥ 0 for all
α 1 , . . . , α n ∈ R ; 3.
Transformation-invariant over G , i.e., K base ( TX
[Equation]
G .
Define the kernel with the “best-fit" transformation over G by
[Equation]
Lemma 1.
K G ,best,base is a symmetric kernel that is also transformation-invariant over the group G , i.e., K G ,best,base ( TX i , X j ) =
K G ,best,base ( X i , T − 1 X j ) .
Proof.
The symmetry follows since
[Equation]
The transformational invariance follows since
[Equation]
The Translation Group: Of particular interest in image classification is the group of translations, a subgroup of the group of transformations.
Let X i =
{ X ( p,q ) i : p ∈
[ m 1 ] , q ∈ [ m 2 ] } denote a two-dimensional m 1 × m 2 array of pixels, with m = m 1 m 2 .
Let T rs
X i :=
{ X (( p − r )mod m 1 , ( q − s )mod m 2 ) i : p ∈ [ m 1 ] , q ∈ [ m 2 ] } denote the transformation that translates the array by r pixels in the x -direction, and by s pixels in the y -direction.
The translation group is
G trans := { T rs : r ∈ [ m 1 ] , s ∈ [ m 2 ] } .
For notational simplicity, we will denote the resulting kernel
K G trans ,best,base by K TI,best,base .
2.2 Positive Definiteness of Translation-Invariant Best-Fit Kernels
There are two criteria that need to be met when trying to embed transformational invariance into
SVM kernels.
(i)
The kernel will need to be invariant with respect to the particular transformations of interest in the application domain.
(ii)
The kernel will need to be positive definite to have provable guarantees of performance.
K TI,best,base satisfies property (i) as established in Lemma 1.
Concerning property (ii) though, in general, K TI,best,base is an indefinite kernel.
We now show that when the base kernel is a normalized linear kernel, K linear ( X i , X j ) := 1 m X Ti X j , then it is indeed positive definite in the small sample regime of interest under a probabilistic model for dependent features.
Assumption 1.
Suppose that n samples { X 1 , X 2 , . . .
, X m } are i.i.d., with X i =
{ X (1) i , X (2) i , . . .
, X ( m ) i } being a normal random vector with X i ∼ N (0 , Σ) , ∀ i ∈ [ n ] .
Suppose also that ∥ λ ∥ 2 / ∥ λ ∥ ∞ ≥ (ln m ) 1+ ϵ 2 / 2 for some ϵ ∈ (0 , 1] , where λ :=
( λ (1) , . . .
, λ ( m ) ) is comprised of the eigenvalues of Σ .
Note that X ( p ) i may be correlated with X ( q ) i , for p ̸ = q .
Example 1.
When Σ = I m , i.e., X ( p ) i ∼ N (0 , 1) , ∀ p ∈ [ m ] , the condition ∥
λ ∥ 2 / ∥ λ ∥ ∞ ≥ (ln m ) 1+ ϵ 2 / 2 holds trivially since ∥ λ ∥ 2 = √ m and ∥ λ ∥ ∞
= 1 .
We note that for independent features, we can relax the normality (Assumption 1) to sub-Gaussianity.
Theorem 1.
Let
K
[Equation]
,best,linear
[Equation]
be the best-fit translation invariant kernel with the base kernel chosen as the normalized linear kernel.
Under Assumption 1, if n ≤
[Equation]
, then K TI,best,linear is a positive definite kernel with probability approaching one, as m → ∞ .
Outline of proof.
We briefly explain ideas behind the proof, with details presented in Appendix B. For brevity, we denote K TI,best,linear ( X i , X j ) and K linear ( X i , X j ) by K TI,ij and K ij , respectively.
From Gershgorin’s circle theorem [33] every eigenvalue of K TI,best,linear lies within at least one of the Gershgorin discs D ( K TI,ii , r i ) :
= { λ ∈ R | | λ − K TI,ii | ≤ r i } , where r i := (cid:80)
j ̸
= i | K TI,ij | .
Hence if K TI,ii > (cid:80) j ̸
= i | K TI,ij | , ∀ i , then K TI is a positive definite kernel.
Accordingly, we study a tail bound on (cid:80)
j ̸
= i | K Ti,ij | and an upper bound on K TI,ii , respectively, to complete the proof.
Note that ∥ λ ∥ 1 ≤ √ m ∥ λ ∥ 2 for an m -length vector λ , which implies that n = ˜ O ( √ m ) .
We now show that positive definiteness in the small sample regime also holds for the polynomial kernels which are of importance in practice:
[Equation]
Theorem 2.
For any γ ∈ R + and d ∈ N , the translation-invariant kernels,
[Equation]
[Equation] [Equation]
[Equation]
are positive definite with probability approaching one as m → + ∞ , under Assumption 1, when ∥ λ ∥ ∞ ≤ 1 , and n ≤
[Equation]
[Table]
Proof.
Note that ∥ λ ∥ ∞ ≤ 1 can be satisfied simply by dividing all entries of the X i s by (cid:112)
∥ λ ∥ ∞ .
The detailed proof is presented in Appendix C.
Remark.
Since Gershgorin’s circle theorem is a conservative bound on the eigenvalues of a matrix, the bound n = ˜ O ( √ m ) on the number of samples for positive definiteness is also conservative.
In practice, positive definiteness of K TI,best,linear holds for larger n .
Even more usefully, K TI,best,poly is positive definite for a much larger range of n than K TI,best,linear , as reported in Table 1.
2.3 Comparison with the Average-Fit Kernel and Data Augmentation 2.3.1 Average-Fit Kernel
In [12], the following “average-fit kernel" kernel is considered
[Equation]
which seeks the “average" fit over all transformations.
We denote it by K TI,avg,linear ( X i , X j ) for short.
It is trivially invariant with respect to the transformations in G and positive definite.
However, it is not really a desirable choice for translations when the base kernel is the linear kernel.
Note that 1 |G trans ] (cid:80) T ∈G trans TX i = α (1 , 1 , . .
. , 1) T , where α
= 1 m (cid:80) p ∈ [ m 1 ] ,q ∈ [ m 2 ]
X ( p,q ) i is the average brightness level of X i .
Therefore K TI,avg,linear ( X i , X j ) = m × (Avg brightness level of X i ) ×
(Avg brightness level of X j ).
The kernel solely depends on the average brightness levels of the samples, basically blurring out all details in the samples.
In the case of rotational invariance, it depends only on the average brightness along each concentric circumference.
As expected, it produces very poor results, as seen in the experimental results in Section 4.
2.3.2 Data Augmentation
Data augmentation is a popular approach to learn how to recognize translated images.
It augments the dataset by creating several translated copies of the existing samples.
(A special case is the virtual support vectors method which augments the data with transformations of the support vectors and retrains [26].)
SVM with kernel K base applied to the augmented data is equivalent to employing the average-fit kernel as (4).
Consider the case where the augmented data consists of all translates of each image.
The resulting dual problem for SVM margin maximization [5] is:
[Equation]
The corresponding classifier is sign ( (cid:80) i,T λ ∗ i,T y i K base ( TX i , X ) + b ∗ ) , where λ ∗ is the optimal dual variable and b ∗ =
y j − (cid:80) i,T λ ∗ i,T y i K base ( TX i , T ′ X j ) , for any j and T ′ satisfying λ ∗ j,T ′ > 0 .
When no data augmentation is implemented, i.e., |G trans | = 1 , we use λ i as shorthand for λ
i, 1 .
As shown in Theorem 4.1 [18], this is simply the dual problem for the SVM with K TI,avg,base , and (cid:80)
i λ i K TI,avg,base ( X i , X j ) =
(cid:80) i,T ∈G
λ
i,T K base ( TX i , X j ) ∀ j .
Hence data augmentation is mathematically equivalent to a kernel with average similarity over all transformations.
This yields a poor classifier since it only leverages the average brightness level of an image.
A simple example illustrates superiority of K TI,best,linear over K TI,avg,linear or data augmentation.
[Figure]
Example 2.
Consider a special case of the translation group with m 1 = 2 and m 2 = 1 .
Consider a training set with just two samples X
= (1 , 2) and X 2 = (5 , 2) , shown in red in Figure 1.
Note that a translation in the image space is a right shift of vector elements.
(So a translation of X 1 = (1 , 2) yields the augmented datum X
= (2 , 1) in this two-dimensional context because of wraparound.)
Two new samples X 3 = (2 , 1) and X 4 = (2 , 5) are therefore generated through data augmentation, shown in green.
The decision boundary of the base kernel with augmented data (equivalent to the average-fit kernel K TI,avg ) is shown by the blue solid line in Figure 1.
Note that the linear decision boundary X (1) + X (2) = 5 depends solely on the brightness level X (1) + X (2) .
However, the decision boundary of the best-fit kernel K TI,best,linear
[Equation]
X
[Equation]
X
[Equation]
=
sup T ∈G trans 12 ( TX i ) T X
j
is piecewise linear due to the “sup” operation.
Each piece focuses only on the half of the samples that are on the same side of the symmetry axis (black dashed line), leading to the red piecewise linear separatrix with a larger margin.
(The red margin is √ 102 , which is larger than the blue margin √ 2 .)
The best-fit kernels thereby maximize the margin over the larger class of piecewise linear separatrices by exploiting the invariances.
Even when data augmentation is used, it only produces linear separatrices and thus still has smaller margins.
Benefits will be even more pronounced in higher dimensions.
For other kernels (e.g., polynomial kernels), the shape of the decision boundary will be altered correspondingly (e.g., piecewise polynomial), but the
TI best-fit kernel will still provide a larger margin.
2.4 Rotation-Invariant Kernels
To mathematically treat rotation-invariant kernels, consider images that are circular, of radius r , with each concentric annulus from radius ( p − 1)
r mto prm 1 , for p ∈ [ m 1 ] , comprised of m 2 pixels spanning the sectors [2 kπ/m 2 , 2( k + 1) π/m 2 ) for k = 0 , 1 , . . .
, m 2 − 1 .
Denote the element in the p -th annulus and q -th sector as “pixel" X ( p,q ) , and define the rotation group G rotate :
=
{ T 1 , T 2 , ..., T m 2 } , where T q ′ X ( p,q )
=
X ( p,q + q ′ ) .
The rotation-invariant (RI) best-fit kernel is
[Equation]
Lemma 2.
Under Assumption 1 , the rotational invariant kernel K RI,best,poly is positive definite with probability approaching one as m → + ∞ , under the same conditions as in Theorem 1.
In Section 4, we report on the large performance gain of K RI,best,poly .
Incorporating Locality at Multiple Spatial Scales
To better illustrate the property of “locality" and its incorporation into SVMs, consider the simple context of a polynomial kernel and a one-dimensional real-valued pixel sequence.
Let us regard the individual pixel values in the sequence { X (1) i , X (2) i , . . .
, X ( m ) i } as the primitive features at “Layer 0".
Consider now a “local" feature depending only on the nearby pixels { X ( ℓ ) i , X ( ℓ +1) i , . . .
, X ( ℓ + k 1 ) i } that can be modeled by a polynomial of degree d 1 .
We refer to k 1 as the locality parameter.
Such a local feature is a linear combination of monomials of the form (cid:81) min( ℓ + k 1 ,m ) j = ℓ ( X ( j ) i ) c
j with (cid:80) min( ℓ + k 1 ,m ) j = ℓ c j ≤ d 1 where each integer c j ≥ 0 .
This gives rise to a kernel
[Equation]
We regard “Layer 1" as comprised of such local features of locality parameter k 1 , at most k 1 apart.
“Layer 2" allows the composition of local features at Layer 1 that are at most k 2 apart:
[Equation]
This can be recursively applied to define deeper kernels with locality at several coarser spatial scales.
The above procedure extends naturally to two-dimensional images { X ( p,q ) i :
[Equation]
Then the kernel at Layer 1 is simply ( (cid:80) m 2 − k 1 s =
[Equation]
m
[Equation] [Equation]
(cid:80)
[Equation]
X
[Equation]
i
X (
[Equation]
q ) j + 1)
d 1 + 1) d 2 .
The resulting kernels are always positive definite:
Lemma 3.
K L is a positive definite kernel.
Proof.
Note that if K 1 and K 2 are positive definite kernels, then the following kernels K obtained by Schur products [28], addition, or adding a positive constant elementwise, are still positive definite kernels: (i) K ij = αK 1 ,ij + βK 2 ,ij , (ii) K ij =
( K 1 ,ij ) ℓ 1 ( K 2 ,ij ) ℓ 2 , (iii) K ij =
K 1 ,ij + γ , ∀ α, β ≥ 0 , ℓ 1 , ℓ 2 ∈ N , γ ≥ 0 .
The kernel K L can be obtained by repeatedly employing the above operations with α = β
= γ = 1 , starting with a base linear kernel which is positive definite with high probability under the conditions of Theorem 2.
One difference from CNNs is that, for the same input layer, one cannot have multiple output channels.
If we design multiple channels with different degrees, then the channel with a larger degree will automatically subsume all terms generated by the channel with a smaller degree.
Therefore, it is equivalent to having only one output channel with the largest degree.
However, if the images have multiple channels to start with (as in R, G, and B, for example), then they can be handled separately.
But after they are combined at a layer, there can only be one channel at subsequent higher layers.
Combining Locality at Multiple Spatial Scales with Transformational Invariance.
To combine both locality at multiple spatial scales and transformational invariance, a kernel with locality at multiple spatial scales can be introduced as a base kernel into transformation-invariant kernels.
Complexity Analysis and Memory Trade-off.
One may trade off between the memory requirement and computation time when it comes to the depth of the architecture.
Supported by adequate memory space, one can store all kernel values from every layer, with both computation time and memory space increasing linearly with depth.
In contrast, when limited by memory space, one can store only the kernel values from the final layer.
In that case, although the memory requirement does not increase with depth, computation time grows exponentially with depth.
The time complexity of computing the polynomial kernel is between O ( n 2 m ) and O ( n 3 m ) based on LIBSVM [2], while space complexity is O ( n 2 ) .
With sufficient memory of order O ( n 2 m ) , the computations of kernel values can be parallelized so that the time complexity of the locality kernel is considerably reduced to between O ( n 2 kd ) and O ( n 3 kd ) , where k and d are the locality parameter and the depth, respectively, with kd ≪ m .
Note that since our focus is on small sample sizes, the
O ( n 2 ) complexity is acceptable.
[Table]
Experimental Evaluation 4.1 Datasets
We evaluate the performance of the methods developed on four datasets:
The Original MNIST Dataset [17] 2.
The EMNIST Letters Dataset [4] 3.
The Translated MNIST Dataset: Since most generally available datasets appear to have already been centered or otherwise preprocessed, we “uncenter" them to better verify the accuracy improvement of TI kernels.
We place the objects in a larger (64*64*1) canvas, and then randomly translate them so that they are not necessarily centered but still maintain their integrity.
In addition, we add a Gaussian noise ( µ = 0 , σ = 0 . 1 ) to avoid being able to accurately center the image by calculating the center-of-mass.
We call the resulting dataset the “Translated dataset".
Figure 1(b) shows some samples from different classes of the Translated MNIST dataset.
The Rotated MNIST Dataset: We place the original image in the middle of a larger canvas and rotate it, with the blank area after
rotation
filled with Gaussian noise.
RI kernels are not designed to and cannot distinguish between equivalent elements (e.g., 6 versus 9), and so we skip them.
Figure 1(c) displays samples from different classes of the Rotated MNIST dataset.
4.2 Experimental Results and Observations
Table 2 and Figure 2 provide the test accuracy of all methods on the Original and Transformed
MNIST Datasets, respectively, while Table 2 shows the test accuracy for the EMNIST Letters Dataset [4].
The letters L, TI, and RI represent Locality at multiple spatial scales, TI kernels, and RI kernels, respectively.
A combination such as L-TI represents an SVM with both Locality and Translational
Invariance.
Note that the intended application of our proposed methods is to learn when data is scarce and there is no large database of similar data, which precludes the possibility of pre-training.
We provide code at https://github.com/tliu1997/TI-SVM.
For the Original MNIST dataset with 100/200/500 training samples (Table 2), after introducing locality and transformational invariance, the classification accuracy is improved from 68.33%/83.20%/91.33% reported by the best CNNs optimized over architectures and dimensions [10] to 81.55%/89.23%/93.11% respectively.
The improvements indicate that the original dataset does not center and deskew objects perfectly.
Larger improvements can be observed on the EMNIST Letters dataset [4] compared with the original SVM, two-sided tangent distance (TD) nearest neighbors [30], RI kernel based on Average-Fit, and ResNet.
(Since we find that the test accuracy of TD-based
[Figure]
while similarly
L does so nearest neighbors [30] is better than that of TD-based SVMs [13], we only report results of TD-based nearest neighbors as one of the baselines.)
All results are multi-class classification accuracies.
In Figure 2, we present the obtained test accuracy as a function of the number of training samples, for two different transformed datasets.
Experiments are performed 5 times with mean and standard deviation denoted by the length of the bars around the mean, for 100/300/500/700/1000 training samples respectively.
(L-)TI-SVM and (L-)RI-SVM outperform ResNet in many cases when there is no data augmentation since they embed useful domain knowledge for classifiers, especially for the small size regime of training samples.
However, with the increase in the number of training samples, the benefits brought by domain knowledge gradually decrease, as shown in Figure 2.
Additionally, the test accuracy of the newly proposed methods has a smaller variance than ResNet’s in general.
From the experimental results, we see that all SVMs with newly defined kernels improve upon the test accuracy of the original SVM method, whether they are original datasets or transformed datasets.
They also greatly outperform the best CNNs in the small training sample regime of interest.
For transformed datasets, improvements are more significant.
Note that the performance improvement of proposed methods comes at the cost of longer computation time.
When computation time is critical, we may simply use new single methods, i.e., L-SVM, TI-SVM, and RI-SVM, which enjoy a relatively good performance at a small cost of additional computation time.
4.3 Details of Experimental Evaluation
With consideration of computational speed and memory space, we utilize a two-layer structure (5) as well as a k 1 − 1 2 -zero padding and a stride of 1 to implement locality.
In order to compare the test accuracy of L-SVM, TI-SVM, RI-SVM and further combine them, we select a polynomial kernel with a fixed degree (8 in our experiments) to realize the proposed methods.
Note that degree 8 is not necessarily the optimal degree; one can tune the specific degree for different datasets.
We compare our results with [10], which adopts a tree building technique to examine all the possible combinations of layers and corresponding dimensionalities to find the optimal CNN architecture.
As for the DNN benchmark of the EMNIST Letters and the Transformed MNIST datasets, we select
ResNet [14, 15], a classic CNN architecture, as a DNN benchmark.
Plus, for fairness, we do not implement data augmentation for any models and train all from scratch.
Note that all experimental results are based on LIBSVM [2] and are carried out on an Intel Xeon
E5-2697A V4 Linux server with a maximum clock rate of 2.6 GHz and a total memory of 512 GB.
Concluding Remarks
In this paper, we have developed transformation-invariant kernels that capture domain knowledge of the invariances in the domain.
They can also additionally incorporate composition and locality at multiple spatial scales.
The resulting kernels appear to provide significantly superior classification performance in the small sample size regime that is of interest in this paper.
Experiments demonstrate that for the same polynomial kernel, incorporating locality and transformational invariance improves accuracy, especially for situations where data is scarce.
Acknowledgement
This material is based upon work by Texas A&M University that is partially supported by the US Army
Contracting Command under W911NF-22-1-0151, US Office of Naval Research under N00014-21-12385, 4/21-22 DARES: Army Research Office W911NF-21-20064, US National Science Foundation under CMMI-2038625.
The views expressed herein and conclusions contained in this document are those of the authors and should not be interpreted as representing the views or official policies, either expressed or implied, of the U.S. Army Contracting Command, ONR, ARO, NSF or the United States Government.
The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein
Checklist
The checklist follows the references.
Please read the checklist guidelines carefully for information on how to answer these questions.
For each question, change the default [TODO] to [Yes] , [No] or [N/A] .
You are strongly encouraged to include a justification to your answer , either by referencing the appropriate section of your paper or providing a brief inline description.
For example:
• Did you include the license to the code and datasets?
[Yes] See Section ?? .
• Did you include the license to the code and datasets?
[No] The code and the data are proprietary.
• Did you include the license to the code and datasets?
[N/A]
Please do not modify the questions and only use the provided macros for your answers.
Note that the
Checklist section does not count towards the page limit.
In your paper, please delete this instructions block and only keep the Checklist section heading above along with the questions/answers below.
For all authors... (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
[Yes] (b) Did you describe the limitations of your work?
[Yes] See Section 2.2 (conservative bound caused by Gershgorin’s circle theorem) and Section 4.2 (possibly longer computation time).
(c) Did you discuss any potential negative societal impacts of your work?
[N/A] (d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] 2.
If you are including theoretical results... (a) Did you state the full set of assumptions of all theoretical results?
[Yes] See Section 2.
(b) Did you include complete proofs of all theoretical results?
[Yes] See Appendix B and C. 3.
If you ran experiments... (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[Yes] See https://github.com/tliu1997/TI-SVM.
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)?
[Yes] See Section 4.
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[Yes] See Figure 2.
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)?
[Yes] See Section 4.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... (a) If your work uses existing assets, did you cite the creators?
[Yes] (b) Did you mention the license of the assets?
[Yes] (c) Did you include any new assets either in the supplemental material or as a URL?
[Yes] See https://github.com/tliu1997/TI-SVM.
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating?
[N/A]
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
[N/A] 5.
If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable?
[N/A] (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable?
[N/A] (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation?
[N/A]
A Supporting Definitions and Lemmas
Definition 1.
A random variable X with mean µ = E
[ X ] is sub-exponential if there are non-negative parameters ( ν, b ) such that [34]
[Equation]
We denote this by X ∼ SE ( ν, b ) .
Lemma 4 (Sub-exponential tail bound [34]) .
Suppose that X ∼ SE ( ν, b ) .
Then,
[Equation]
Some properties related to sub-exponential random variables are listed below.
Lemma 5 ([34]) .
For a standard normal random variable X , X 2 is SE (2 , 4) ; 2.
For random variable X ∼ SE ( ν, b ) , aX ∼ SE ( aν, ab ) ;
Consider independent random variables X 1 , . .
, X n , where X i ∼ SE ( ν i , b i ) .
Let ν =
ν 1 , . .
ν n ) and b = ( b 1 , . .
, b n ) .
Then (cid:80) ni
=1 X i ∼ SE ( ∥ ν ∥ 2 , ∥ b ∥ ∞ ) .
B Proof of Theorem
Theorem 3 (Restatement of Theorem 1) .
Let
K
[Equation] [Equation]
[Equation]
be the best-fit translation invariant kernel with the base kernel chosen as the normalized linear kernel.
Under Assumption 1, if n ≤ ∥ λ ∥2 ∥ λ ∥ 2 (ln m ) 1+ ϵ 2 , then K TI,best,linear is a positive definite kernel with probability approaching one, as m → ∞ .
Proof of Theorem 1.
For brevity, we denote K TI,best,linear ( X i , X j ) and K linear ( X i , X j ) by K TI,ij and K ij , respectively.
From Gershgorin’s circle theorem [33] every eigenvalue of K TI,best,linear lies within at least one of the Gershgorin discs D ( K TI,ii , r i ) :=
{ λ ∈ R | | λ − K TI,ii | ≤ r i } , where r i :=
(cid:80)
j ̸
= i | K TI,ij | .
Hence if K TI,ii > (cid:80) j ̸
= i | K TI,ij | , ∀ i , then K TI,best,linear is a positive definite kernel.
Note that the dimension of the vector X i is m = m 1 × m 2 in the case of a two-dimensional array.
Under Assumption 1, X i ∼ N (0 , Σ) , ∀ i ∈ [ n ] .
Since Σ is symmetric and positive semi-definite, there exists an orthogonal matrix O ∈ R m × m with Σ = O · diag (cid:0) λ (1) , . .
, λ ( m ) (cid:1) · O T , where λ (1) , . .
, λ ( m ) ≥ 0 are the eigenvalues of Σ .
Define Σ 12 := O · diag (cid:16) √ λ (1) , . .
. , √ λ ( m ) (cid:17) · O T , then X i = Σ 12 Z i , where Z i ∼ N (0 , I m ) .
Define H i :=
O T
Z i ∼ N (0 , I m ) , then
[Equation]
i ) 2 , and E [ ∥ X i ∥ 2 ] =
(cid:80) mp
=1 λ ( p ) E
[( H ( p ) i ) 2 ] =
∥ λ ∥ 1 .
Let λ :=
( λ (1) , . . .
, λ ( m ) ) .
Based on Lemma 5, we have ( H ( p ) i ) 2 ∼ SE (2 , 4) , λ ( p ) ( H ( p ) i ) 2 ∼ SE (2 λ ( p ) , 4 λ ( p ) ) , and ∥ X i ∥ 2 ∼ SE (2 ∥ λ ∥ 2 , 4 ∥ λ ∥ ∞ ) .
According to Lemma 4,
[Equation]
Let t = ∥
λ ∥ 1 / 2 , then we have
[Equation]
where ( a ) holds due to Holder’s inequality.
Noting that K TI,ii = max T ∈G K linear ( TX i , X i ) ≥
K ii , ∀ i ,
[Equation]
Now we turn to the off-diagonal terms K TI,ij for i ̸
= j .
For p ∈ [ m ] , one can write
X
[Equation]
p )
[Equation]
p )
[Equation]
Note that H ( p ) i H ( p ) j
= 12 ( Y ( p ) + ,ij − Y ( p ) − ,ij )( Y ( p ) + ,ij + Y ( p ) − ,ij ) , where Y ( p ) + ,ij := 1 √
( H ( p )
j + H ( p ) i ) and
Y ( p ) − ,ij := 1 √ 2 ( H ( p ) j − H ( p ) i ) are independent N (0 , 1) random variables.
Hence ( Y ( p ) + ,ij ) 2 and ( Y ( p ) − ,ij )are chi-squared random variables, and their moment generating functions are E [ e r ( Y ( p ) + ,ij ) 2 ]
=
E [ e r ( Y ( p ) − ,ij ) 2 ] = 1 √ 1 − 2 r for r < 12 .
Hence for any | r | ≤ 1 / ∥ λ ∥ ∞ , we know
[Equation]
[Equation]
where ( b ) is true since the random variables { Y ( p ) + ,ij , Y ( p ) − ,ij } p ∈ [ m ] are mutually independent.
It can be verified that 1 √ 1 − x ≤ e x for 0 ≤ x ≤ 1 / 2 .
We can then upper bound the moment generating function of E [ e rX ⊤
i X j ] , since for any | r | ≤ 1 / ∥ λ ∥ ∞ ,
[Equation]
This implies X ⊤ i X j ∼ SE ( √ 2 ∥ λ ∥ 2 , ∥ λ ∥ ∞ ) .
Since E [ X ⊤ i X j ] = 0 , by Lemma 4, we know
[Equation]
Let t = ∥
λ ∥ 2 (ln m ) (1+ ϵ ) / 2 .
Under the assumption that ∥ λ ∥ 2 ∥ λ ∥ ∞ ≥ (ln m ) (1+ ϵ ) / 2, we have
[Equation]
[Equation]
Note that | K TI,ij | = | sup T K linear ( TX i , X j ) | ≤ sup T | K linear ( TX i , X j ) | , then
P ( | K TI,ij | ≥ ∥ λ ∥ 2 (ln m ) 1+ ϵ
[Equation]
[Equation]
where ( c ) holds since the distribution is translation invariant, and ( d ) holds since K ij is a symmetric random variable,
i
[Equation]
e., p K ij ( y ) =
p K ij ( − y ) .
Combining (7) and (9), we have
P
[Equation]
K TI,
[Equation]
Above, ( e ) holds since the probability distributions of | K TI,ij | are identical for all j ̸
= i .
Since ∥ λ ∥ 1 ≥ ∥ λ ∥ 2 , the assumption ∥ λ ∥ 2 ∥ λ ∥ ∞ ≥ (ln m ) (1+ ϵ ) / 2 implies ∥ λ ∥ 1 ∥ λ ∥ ∞ ≥ (ln m ) (1+ ϵ ) / 2 .
Note that since n = ˜ O ( √ m ) ,
[Equation]
Therefore, K TI,best,linear is a positive definite kernel with probability approaching one as m → ∞ .
C Proof of Theorem
Theorem 4 (Restatement of Theorem 2) .
For any γ ∈ R + and d ∈ N , the translation-invariant kernels,
K
[Equation]
are positive definite with probability approaching 1 as m → + ∞ , under Assumption 1, ∥ λ ∥ ∞ ≤ 1 , and n ≤ ∥ λ ∥
[Equation]
Proof.
Define event A γ,m,n := { γm ( TX i )
⊤ X j ≥ − 1 , ∀ T ∈ G , ∀ i ̸
= j } , and event B m,n := { K TI,best,linear is pd } .
Denote K ( · , · ) =
(1 + γK TI,best,linear ( · , · ))
d .
Conditioned on event
A γ,m,n , K TI,best,poly ( X i , X j ) =
K ( X i , X j ) for off-diagonal entries, and K TI,best,poly ( X i , X i ) ≥ K
( X i , X i ) .
This implies K TI,best,poly ⪰ K .
Conditioned on event B m,n , the three properties in the proof of Lemma 3 indicate K is pd.
Thus K TI,best,poly is pd conditioned on A γ,m,n ∩ B m,n .
Now B m,n holds w.h.p.
by Theorem 1.
By the symmetric distribution of K ij and (8), we have
[Equation]
[Equation]
Due to ∥ λ ∥ 2 ≤ √ m and union bounds, lim m →∞ P ( A γ,m,n ) ≥ lim m →∞ 1 − 1 poly ( m ) = 1 .
D Extensions to other kernels
The property of transformational invariance can be extended to other kernels with the guarantee of positive definiteness, e.g., radial basis function (RBF) kernels with norm-preserving transformations (i.e., ∥ TX i ∥ =
∥
X i ∥ , ∀ i ∈ [ n ] ).
Define the normalized base kernel as
[Equation]
If transformations are norm-preserving, then
[Equation]
By Theorem 1 and three properties in the proof of Lemma 3, K TI,best,rbf is still positive definite since e x = (cid:80) ∞ i =
x i i ! .
However, the design of locality at multiple scales doesn’t apply to RBF kernels since the kernel tricks cannot be utilized anymore.
Since we merge two designs in the experimental part, we choose polynomial kernels to illustrate the designs in the paper.