ATLAS NOVA My AtlasVelocer ↗

Technology · Machine learning

Support vector machine

Supervised machine learning classifier

A support vector machine (SVM) is a supervised classifier: a program that learns from examples whose correct answer is already known, and then assigns new examples to one of two groups.

What makes it distinctive is not that it separates the groups, but how it chooses among all the separations that would work. Given two clouds of labelled points, many straight lines can divide them cleanly. The SVM picks the one that sits as far as possible from the nearest point of either cloud, so the empty band on each side of the boundary is as wide as it can be. That band is the margin, and the classifier is often called a maximum-margin classifier for this reason.

Key facts
88.2%Best fruit classification accuracy, Max-Wins-Voting SVM with Gaussian kernel (Zhang and Wu 2012)⁠[1]
22Microarray datasets on which SVMs beat random forests (Statnikov et al. 2008)⁠[2]
89%Transmembrane topology prediction accuracy on 131 crystal-structure sequences (Nugent and Jones 2009)⁠[3]
91.4%Subcellular localization accuracy for three prokaryotic locations from amino acid composition (Hua and Sun 2001)⁠[4]

Overview

Support vector machine

A concrete case makes the geometry plain. Imagine patients described by two measurements, say a blood marker and an age, some with a disease and some without, and suppose the two groups can be told apart by a straight line in that plane. Every line that leaves all the diseased patients on one side and all the healthy ones on the other is a candidate. The SVM's rule is to take the candidate whose distance to the closest patient is greatest. The few patients lying on the edges of the margin, the ones that pin the line in place, are the support vectors. Everything further away could be moved slightly, or deleted, without changing the boundary at all. This is the sparseness that writers on the method single out: only a handful of samples end up determining the classification or regression function, which is what makes SVMs workable on very large collections of data.⁠[5]

A two-dimensional plot with axes x1 and x2 showing filled black dots and open circles separated by a solid hyperplane labeled wx - b = 0, with dashed margin lines wx - b = 1 and wx - b = -1 and the margin width marked as 2/||w||.
A two-dimensional plot with axes x1 and x2 showing filled black dots and open circles separated by a solid hyperplane labeled wx - b = 0, with dashed margin lines wx - b = 1 and wx - b = -1 and the margin width marked as 2/||w||. View full-size image.Svm max sep hyperplane with margin by Cyc. Public domain, via Wikimedia Commons. Scaled to 800 pixels wide; no crop or other changes by Atlas Nova.

Real data rarely splits along a straight line, and the second idea handles that. A kernel is a function that measures similarity between two examples, and it lets the SVM behave as though the data had been mapped into a richer space where a straight boundary is again adequate, without ever computing that mapping explicitly. The kernel is the entry point for the method's flexibility: kernel methods allow large classes of functions, including nonlinear functions as well as functions defined on nonvectorial data.⁠[6] Kernels and their settings are treated in a later section.

Two properties explain why the method spread so widely. It produces sparse solutions, with only a few samples involved in determining the classification or regression function, which facilitates its application to problems involving a large amount of data. Both matter in fields like bioinformatics and text processing, which involve a large amount of data.⁠[5] Bernhard Schölkopf, in an introductory overview, points out that a particular advantage of SVMs over other learning algorithms is that they can be analyzed theoretically using concepts from computational learning theory while achieving good performance on real problems; examples of real-world applications include Dumais's text categorization on the Reuters collection and Osuna's face detection.⁠[7] Surveys describe SVMs as a family of machine learning methods introduced for classification and later generalized to other situations, built on statistical learning theory and convex optimization and used across bioinformatics, text categorization and computer vision.⁠[8]

The design is binary. An SVM draws one boundary between two classes, and a problem with eighteen kinds of fruit or a dozen kinds of heart rhythm does not fit that shape directly. The standard remedy is to build several binary classifiers and combine their answers; comparisons of the main schemes indicate that the 'one-against-one' and DAG methods are more suitable for practical use than the other methods.⁠[9] That extension, and the trade-offs between the schemes, is the subject of a later section.

An SVM is defined by what it refuses: among all boundaries that separate two classes, it keeps only the one with the widest empty margin around it.

History

From optimal margin classifiers to a general learning method

It appeared in the early nineties as optimal margin classifiers in the context of Vapnik's statistical learning theory.⁠[5] The framing mattered because it gave the boundary a justification that went beyond fitting the training data: the widest margin was not just a tidy choice but a way of controlling how much the classifier's behaviour could vary when shown new cases.

A diagram of two groups of dots (blue and green) separated by a shaded margin band with a red dividing line and labeled equations w*x−b=1, w*x−b=0, and w*x−b=−1, with a normal vector w and a distance marker.
A diagram of two groups of dots (blue and green) separated by a shaded margin band with a red dividing line and labeled equations w*x−b=1, w*x−b=0, and w*x−b=−1, with a normal vector w and a distance marker. View full-size image.SVM margin by Larhmam. CC BY-SA 4.0, via Wikimedia Commons. Scaled to 960 pixels wide; no crop or other changes by Atlas Nova.

From there the method moved onto a second theoretical footing. SVMs operate within the framework of regularization theory, which treats learning as the problem of minimizing an empirical risk in a well-posed and consistent way, penalizing solutions that are too finely tuned to the training sample.⁠[5] Kernel methods in general formulate learning problems in a reproducing kernel Hilbert space, a space of functions defined on the data domain, which allows both the construction and the analysis of algorithms while admitting large classes of functions, nonlinear ones included, and even functions defined on data that are not vectors at all.⁠[6] The optimal margin classifier and the kernel view are two descriptions of one object.

An early collection of essays presented the method to a broader audience with a particular claim attached: a distinctive advantage of SVMs over other learning algorithms is that they can be analysed theoretically using concepts from computational learning theory while at the same time achieving good performance when applied to real problems. The same collection carried two of those applications, a text-categorization problem that produced the best results to date on the Reuters collection and strong results on face detection.⁠[7]

Surveys now describe SVMs as a family of machine learning methods, originally introduced for classification and later generalized to various other situations, resting on statistical learning theory and convex optimization and used across bioinformatics, text categorization and computer vision.⁠[8] The margin, the kernel and the many-class extensions that follow are the working parts of that recipe, and each is taken up in turn.

The method's history is a shift in justification as much as in technique: the same boundary is defended first by statistical learning theory and later by regularization and kernel theory.

How it works

The widest street between two classes

The boundary an SVM draws is a hyperplane, the general name for a flat surface that divides a space in two: a line in a plane, a plane in three dimensions, and their higher-dimensional counterparts where the data live. A hyperplane is fixed by its orientation and its offset from the origin, and the classifier's decision is simply which side of it a new point falls on. The question the method answers is which of the infinitely many hyperplanes that separate two clouds should be chosen, and its answer is the one that leaves the widest empty corridor between them.

Picture the two clouds as towns on either side of a road. Any straight road with all the blue houses on one side and all the red houses on the other will do as a boundary, but most such roads run uncomfortably close to somebody's front door. The SVM's rule is to lay the road down the middle of the widest street it can find, so that the nearest house on each side is as far from the kerb as possible. The width of that street is the margin, and the classifier is called a maximum-margin classifier because it maximizes this width rather than merely achieving a separation. The geometric picture is not a decoration: it gives the problem a direct interpretation in terms of distances between sets of points, and SVMs are commonly illustrated with extensive visualisation of learning machines, kernels and penalty functions.⁠[10]

The houses that touch the kerbs are the ones that matter. These few points, lying exactly on the edge of the margin, are the support vectors, and they alone determine where the road goes. Every other point could be nudged a little, or removed from the data set entirely, and the boundary would not move, provided it stayed on its own side and outside the street. This is the sparseness of the solution: only a small fraction of the training examples end up entering the final classifier, the rest contributing nothing to it. Sparseness is a practical virtue as much as an aesthetic one, because a classifier that depends on a handful of stored examples is cheap to keep and to apply, and the property carries over to regression as well as classification.⁠[5]

The same picture explains why the method tolerates a great many measurements per example. If the data are described by thousands of numbers, the points sit in a space of thousands of dimensions, and intuition about roads and houses breaks down there; but the margin is still a distance, and the rule of maximizing it still makes sense. What matters is not the number of dimensions but which points lie nearest the boundary, and that is a local question about a few examples. A classifier built this way can therefore be trained on data where the number of features dwarfs the number of samples, and sparse solutions facilitate application to problems that involve a large amount of data, such as text processing and bioinformatics tasks.⁠[5]

When the street cannot be clean

Real data rarely obliges with a clean gap. The clouds overlap, a few points sit on the wrong side of any sensible road, and insisting on a street with no houses in it would produce a boundary contorted around individual troublemakers. The standard SVM therefore allows violations: a point may lie inside the margin, or even on the wrong side of the hyperplane, at a price. The penalty parameter, usually written C, sets that price. A large C makes each violation expensive, so the classifier bends to classify almost every training point correctly and accepts a narrow margin; a small C makes violations cheap, so the classifier prefers a wide, smooth street and lets some points be misclassified.⁠[11]

C is therefore the dial that trades fit against tolerance. Turned far in one direction, the classifier chases every labelled example and risks fitting noise; turned far in the other, it ignores so much that it underfits the genuine pattern. The behaviour of the classifier at extreme settings of C, and the way that behaviour interacts with the width of a Gaussian kernel, has been analysed in detail, and the analysis helps in understanding the hyperparameter space that leads to an efficient heuristic method of searching for hyperparameter values with small generalization errors.⁠[11] The kernel's own width is the second dial, and the two are chosen together; that joint selection belongs to a later section.

The cost of a violation is not a single flat fee in every formulation. The classical SVM uses a hinge loss, which is related to the shortest distance between sets.⁠[12] Sparse solutions to classification problems are usually obtained: only a few samples are involved in the determination of the classification function.⁠[5] Variants replace the hinge with other losses to change the classifier's temperament, and those alternatives are taken up later.

Reading the margin as a guarantee

The width of the street is not only a tie-breaker among boundaries that all fit the training data. It is also a statement about how much the boundary could shift if the data were resampled, and this is the sense in which the margin is a form of insurance. A boundary squeezed between two nearly touching clouds can be tipped substantially by the arrival of one new point; a boundary down the middle of a wide empty street cannot. The method's origin as a family of optimal margin classifiers rests on exactly this argument, developed within statistical learning theory, which concerns itself with performance on examples never seen rather than on the training set alone.⁠[5]

That argument also supplies the method's characteristic failure mode. Because the boundary is pinned by the few points nearest it, those points carry disproportionate influence, and a mislabelled example sitting right at the kerb can drag the road with it. The SVM classifier can be very sensitive to outliers in the training sample, and later sections take up the losses and weightings devised to blunt that sensitivity.⁠[13] For the geometry itself, the lesson is simple: the widest street is the most defensible boundary available, and the price of that defensibility is dependence on a handful of critical examples.

The margin does two jobs at once: it selects one boundary from the many that separate the classes, and it measures how much that boundary could move if the data changed.

The SVM lays its boundary down the middle of the widest empty street between the classes.

Kernels: bending the boundary without leaving the maths

A straight boundary is a strong assumption, and most interesting data refuse it. Two clouds of points may be arranged in rings, one inside the other, or along a curve, so that no hyperplane separates them however it is placed. The obvious remedy is to give up on straight lines and fit a curved boundary directly, but that abandons the geometry that made the margin meaningful. The kernel exists to have both: the classifier still draws a flat boundary, but it draws it in a different space, one the data are mapped into before the boundary is chosen.

Two panels: on the left, green triangles and blue squares separated by a curved red dashed boundary; an arrow labeled "Easier separation in high dimension" points to the right, where the same points are separated by a flat purple plane in a 3D axis system.
Two panels: on the left, green triangles and blue squares separated by a curved red dashed boundary; an arrow labeled "Easier separation in high dimension" points to the right, where the same points are separated by a flat purple plane in a 3D axis system. View full-size image.Supporting Vector Machine by Pkuwangyan06. CC BY-SA 4.0, via Wikimedia Commons. Scaled to 960 pixels wide; no crop or other changes by Atlas Nova.
Figure 1. Fruit classification accuracy by multiclass strategy and kernel. Five-fold cross-validation accuracy of three multiclass support vector machines with three kernels on fruit photographs. The source states: “For LIN kernel, the classification accuracies of MWV-SVM and DAG-SVM are the same of 53.5%, higher than the WTA-SVM of 48.1%; for the HPOL kernel, the classification accuracy of MWV-SVM is 75.6%, higher than WTA-SVM of 61.7% and DAG-SVM of 70.1%; for the GRB kernel, the classification accuracy of MWV-SVM is 88.2%, still higher than WTA-SVM of 55.4% and DAG-SVM of 84.0%.” (Zhang & Wu (2012)).⁠[1]

The mapping is the trick. Suppose each example is replaced by a richer description of it, for instance by adding the squares and cross-products of its measurements alongside the measurements themselves. A curve in the original space becomes a flat surface in the enlarged one, and the maximum-margin machinery applies unchanged. The difficulty is that the enlarged space can be enormous, and computing every example's coordinates in it would be prohibitive. The kernel trick avoids the computation: the SVM's mathematics only ever needs the inner product between two mapped examples, never the mapped examples themselves, and a kernel is a function that returns that inner product directly from the two originals. One writes down a similarity between two raw examples and gets the behaviour of a classifier operating in a space of far higher dimension, without ever visiting it.

What makes a function a kernel

Not every similarity function can play this role. A positive definite kernel is one for which the inner-product interpretation is consistent: the similarities it reports between examples must behave like genuine inner products in some space, which is a requirement on the kernel's values taken across all the examples at once, not on any single pair. When that condition holds, the kernel is guaranteed to correspond to a mapping into a space of functions, a reproducing kernel Hilbert space, in which the learning problem can be posed and analysed as an ordinary linear problem. Working in such a space of functions is what allows the construction and analysis of learning algorithms while admitting large classes of functions, nonlinear ones included, and even functions defined on data that are not vectors at all, such as strings or graphs.⁠[6] The kernel is therefore the entry point for the method's flexibility, and the choice of similarity is a modelling decision in its own right.

Three kernels and what each assumes

The linear kernel is the plain inner product of two examples. It corresponds to no mapping at all, and the boundary it produces is a hyperplane in the original measurements. It is the right choice when the classes are already close to linearly separable, and it is the cheapest to compute.

The polynomial kernel raises the inner product to a power, optionally after adding a constant. A polynomial of degree two lets the boundary depend on products of pairs of measurements, so it can curve; higher degrees admit more elaborate surfaces. The degree is a setting the user chooses, and it controls how much interaction between measurements the classifier is allowed to see.

The Gaussian radial basis function kernel, usually written RBF, measures similarity by how close two examples are, falling off smoothly with distance. It corresponds to a mapping into an infinite-dimensional space, and it is the most flexible of the three: with the right width it can approximate very complicated boundaries. That flexibility is also its danger, because a kernel that can fit anything will fit noise if nothing restrains it. The width, often written sigma, sets how far the influence of one example reaches; a narrow kernel makes the boundary local and wiggly, a wide one makes it smooth and nearly linear.

Two dials, chosen together

The Gaussian kernel brings a second dial alongside the penalty parameter C. C controls how much a violation of the margin costs; the kernel width controls how curved the boundary is allowed to become. The two interact, and the behaviour of the classifier at extreme settings of both has been analysed in detail, which is what underpins the heuristic searches practitioners use to find workable values rather than trying every combination blindly. The same analysis concludes that if complete model selection using the Gaussian kernel has been conducted, there is no need to consider a linear SVM.⁠[11] The linear kernel is a convenience, not a separate capability.

Kernel choice is not only a matter of accuracy. In a study classifying images from the Corel stock photo collection using high-dimensional colour histograms as the only features, heavy-tailed RBF kernels of a generalised form far outperformed both traditional polynomial kernels and the standard Gaussian RBF. The same work found that a simple remapping of the input values improved linear SVMs so much that, for that problem, they became a valid alternative to RBF kernels.⁠[14] The lesson is that the kernel encodes an assumption about the data, and a kernel matched to the structure at hand can matter more than the classifier wrapped around it.

The settings are chosen by cross-validation: the training data are partitioned, the classifier is trained on some folds and tested on the held-out one, and the procedure is repeated so that every fold serves once as the test set, with the error rates averaged. The fruit classification study covered later used five-fold stratified cross-validation, in which each fold is arranged to have nearly the same class distribution as the others, and computed hundreds of simulations to estimate the optimal kernel parameters.⁠[1] That is the ordinary shape of the procedure: a grid or search over C and the kernel's own parameter, scored by held-out error rather than by fit to the training data.

A practical caution belongs here. Because the kernel determines the space in which the margin is measured, a poorly scaled kernel can make the margin meaningless, and the standard remedy is to normalise the measurements before training. The kernel is not a way of avoiding the modelling decision; it is a way of expressing it in a single function, which is easier to search over than an arbitrary curved boundary would be.

The kernel does not remove the need to choose a boundary's shape; it moves that choice into a similarity function, where it can be set by search and scored by held-out error.

Turning a two-class tool into a many-class one

The SVM as described draws one boundary between two groups. A problem with eighteen kinds of fruit, a dozen heart rhythms, or several subtypes of a disease has no such shape, and the method must be extended before it can be used on it. The extension is not a single technique but a family of schemes, and the differences between them are matters of both accuracy and cost. The original design was binary, and how to extend it effectively to the many-class case has remained an ongoing research question rather than a settled recipe.⁠[9]

The simplest idea is to give each class its own classifier. In the one-against-all scheme, one binary SVM is trained per class, each separating that class from all the others combined, and a new example is assigned to whichever classifier reports the strongest confidence. With eighteen fruit categories that means eighteen classifiers, each trained on the whole data set, so the training burden grows with the number of classes and every classifier must cope with a very lopsided problem in which one class faces all the rest. The alternative is one-against-one: a separate classifier is trained for every pair of classes, each on only the examples of those two, and the classifiers then vote on the answer. For eighteen classes that is 153 small classifiers rather than eighteen large ones, and each sees a balanced two-class problem.⁠[1] A third arrangement, the directed acyclic graph SVM, or DAGSVM, organises the pairwise classifiers into a tree of decisions, so that a new example is passed down a path and only a fraction of the pairwise classifiers is ever consulted.

The trade-offs between these arrangements are not merely arithmetic. A comparison of the main schemes, including one-against-all, one-against-one and the directed acyclic graph, together with two methods that solve the many-class problem in a single optimisation rather than by combining binary classifiers, found that the one-against-one and graph methods are more suitable for practical use than the others. The same comparison noted that methods treating all classes at once generally need fewer support vectors on large problems, though solving the many-class problem in one step requires a much larger optimisation and had until then been tested only on small data sets.⁠[9] The practical picture is therefore a trade between the simplicity of training many small classifiers and the economy of solving the whole problem together.

The fruit classification study shows the arithmetic in action. Its eighteen categories were handled by three different many-class schemes, and the one-against-all version was the slowest, because it trains on the full data set for each class;; and the graph scheme was faster still, roughly four times quicker than the voting scheme, because it needs only seventeen binary classifiers to reach a decision where the voting scheme consults all 153. Speed and accuracy did not point the same way, however: the best accuracy in that study came from the voting scheme with a Gaussian kernel, at 88.2 percent, while the graph scheme, though quickest, reached 84.0 percent with the same kernel.⁠[1] The full worked example, including the features and the confusions between similar fruits, is covered later.

A different line of attack avoids the combination of binary classifiers altogether. The multicategory support vector machine extends the binary formulation directly to several classes in a single problem, and it provides a unifying framework whether the costs of misclassifying different classes are equal or unequal. Its appeal is theoretical as much as practical: it inherits good properties from the binary case rather than assembling them from a patchwork of two-class decisions, and it comes with a tuning criterion analogous to the binary one, an approximate leave-one-out measure called Generalized Approximate Cross Validation. The demonstration in that work spanned cancer classification from microarray data and cloud classification from satellite radiance profiles.⁠[15] The cost is that the single optimisation is larger and harder to solve.

Which scheme to use also depends on the data. In a study of hyperspectral remote sensing images, where each pixel is described by hundreds of spectral bands, four many-class strategies were compared: one-against-all, one-against-one, and two hierarchical tree-based arrangements, judged on classification accuracy, computational time, stability to parameter settings and the complexity of the resulting architecture. The conclusion drawn from that real airborne dataset was that, whatever the many-class strategy adopted, SVMs are a valid and effective alternative to conventional pattern recognition approaches that first reduce the features and then classify.⁠[16] In other words, the choice among schemes shifts accuracy and cost by amounts that matter, but it does not decide whether the method is worth using at all.

A practical caution follows from all this. Because the schemes differ in how many classifiers they train and how the votes are combined, a reported accuracy for a many-class SVM is a statement about a particular arrangement, kernel and data set, not about the method in the abstract. The same classifier machinery can land at 88.2 percent or 84.0 percent on one collection of images depending only on how the classes were combined.⁠[1] When comparing methods, the arrangement belongs in the description alongside the kernel and the settings.

A many-class SVM is several binary decisions plus a rule for combining them, and the rule changes both the cost and the accuracy.

The section compares ways to extend the binary SVM to many classes.

Uses

Reading fruit from a photograph

A supermarket cashier who must price a loose piece of fruit has a problem that a barcode solves for packaged goods: the fruit has to be recognised before it can be weighed and charged. One answer is to let a camera do the recognising, and a study of fruit classification set out to test whether a support vector machine could do it from ordinary photographs taken with a digital camera.⁠[1] The task is a clean illustration of the whole method, because every stage of an SVM pipeline is visible in it: turning an object into numbers, reducing those numbers, choosing a kernel, and combining binary classifiers into a many-class decision.

A single green apple with a stem cavity sits on a white background, photographed from the side.
A single green apple with a stem cavity sits on a white background, photographed from the side. View full-size image.The Granny Smith by Dmitry Makeev. CC BY-SA 4.0, via Wikimedia Commons. Scaled to 960 pixels wide; no crop or other changes by Atlas Nova.

The first stage is to describe each fruit as a list of measurements, since a classifier sees nothing but numbers. From each image the study extracted 79 features: 64 describing colour, seven describing texture, and eight describing shape. Colour was captured as a histogram, a count of how much of the image falls into each of a set of colour bins. Texture and shape add what colour alone misses. The combination of colour, texture and shape proved more effective than any single kind of feature on its own.⁠[1]

Seventy-nine numbers per image is not a burden for a modern computer, but fewer numbers make training and testing faster, and dropping redundant ones can sharpen accuracy. The study therefore applied principal component analysis, a procedure that finds the directions in which the measurements vary most across the data set and re-expresses each example in terms of those directions rather than the original measurements. Reducing 79 features to 14 preserved 95.08% of the variation in the data while using only 17.7% of the memory the full set required.⁠[1] The reduction is not free of judgement, since the number of components kept is a choice, but the criterion used here was explicit: keep enough to retain almost all the energy, and discard the rest.

The data set itself was assembled over six months of on-site photography plus images gathered online, with backgrounds removed and each image cropped and downsampled to 256 by 256 pixels. It comprised 1,653 images across 18 categories, from Granny Smith apples and yellow bananas to black grapes, blackberries and strawberries, with the counts per category ranging from 45 red grape images to 140 Anjou pear images. The images were split into a training set of 1,322 and a test set of 331 in a four-to-one proportion, and the training set was further handled by five-fold stratified cross-validation, in which each fold is arranged to carry nearly the same class distribution as the others. The test set was constructed by randomly sampling in each group.⁠[1]

With the features prepared, the study compared three ways of combining binary classifiers into an eighteen-class decision, and three kernels, giving nine combinations to score. The kernels were linear, homogeneous polynomial, and Gaussian radial basis; the many-class schemes were the one-against-all arrangement, the pairwise voting scheme, and the directed acyclic graph. The best result came from the pairwise voting scheme with the Gaussian kernel, at 88.2% classification accuracy, well ahead of the same scheme with a polynomial kernel at 75.6% and with a linear kernel at 53.5%. The gap between kernels is the striking part: the same classifier and the same features moved from 53.5% with a linear kernel to 88.2% with a Gaussian kernel purely by changing the similarity function.⁠[1]

The one-against-all version was slowest, because each of its classifiers trains on the full data set; the pairwise voting scheme was faster, since each of its individual classifiers takes only about 2/18 of the data; and the graph scheme was roughly four times faster than voting, because it needs only seventeen binary classifiers to reach a decision where voting consults all 153. Accuracy did not follow speed: the graph scheme with the Gaussian kernel reached 84.0%, below the voting scheme's 88.2% with the same kernel, while the one-against-all scheme with that kernel managed only 55.4%.⁠[1] A user who needs a fast answer and a user who needs the most accurate one would therefore make different choices from the same experiment.

The errors are as instructive as the successes. Seven of the eighteen categories were recognised perfectly in the test set, including Granny Smith apples, watermelon, golden pineapple and all three grape varieties.⁠[1] The trouble came from three categories that resemble one another: Bosc pears, avocados and passion fruits. Of eighteen Bosc pear images, three were misclassified as avocados and three as passion fruits, leaving a 66.7% success rate; avocados and passion fruits each reached 71.43%, with their mistakes falling into the same small group.⁠[1] In the study's own reading, those three classes are not distinct from the classifier's point of view, which is a statement about the features as much as about the method: colour, texture and shape as measured here do not separate them cleanly, and no amount of tuning the boundary would recover information the description never carried.

That last point generalises beyond fruit. A classifier's accuracy is bounded by what its features reveal, and the choice of features, the reduction applied to them, the kernel and the many-class scheme all enter the final number together. The 88.2% figure belongs to one particular combination on one particular collection of images, and the same machinery scored 53.5% on the same images with a different kernel.⁠[1] Reading a benchmark as a property of the method in the abstract, rather than of the pipeline that produced it, is the commonest mistake made with results of this kind.

A worked pipeline is a chain of choices, and the reported accuracy belongs to the whole chain, not to the classifier alone.

Text, faces, genes and road signs

The method's reputation was made on problems where each example is a long list of measurements and labelled cases are scarce. Text is the clearest case. A document can be reduced to a vector recording which words it contains, giving thousands of dimensions, and an SVM trained on such vectors sorts documents into categories. An early collection of essays reported a text-categorization problem that yielded the best results to date on the Reuters collection, alongside strong results on face detection, where an image is likewise described by many pixel values and the task is to say whether a face is present.⁠[7]

Arrows connect a roadside sign photograph to a segmented red ring, a circular sign detection with four shape examples, and the recognised speed limit 50.
Colour segmentation finds candidate regions, linear SVMs detect sign shapes, and Gaussian-kernel SVMs recognise their content. The example follows a speed-limit sign marked 50. View full-size image.Road Sign Recognition with SVMs by Atlas Nova. Illustration generated with AI for this article and checked against its text.

Spam filtering sharpens the point, because the features are not counts but simple yes-or-no indicators. A message can be described by whether each of a vocabulary of words and markers appears in it, so every feature is binary. In a comparison against three other classifiers, an SVM performed best when using binary features, and on both a data set restricted to the 1,000 best features and one with over 7,000 dimensions boosting trees and SVMs had acceptable test performance in terms of accuracy and speed, while SVMs had significantly less training time.⁠[17]

A microarray measures the activity of thousands of genes at once for a single sample, so each patient or specimen becomes a point in a space of thousands of dimensions with only tens or hundreds of such points available. Using expression data from DNA microarray experiments, one early study classified genes by function, and found that SVMs best identified sets of genes sharing a common function when compared with several other supervised learning methods; the same work used the trained classifiers to predict functional roles for uncharacterized yeast genes from their expression data. The features that make the method suited to this are its flexibility in choosing a similarity function, the sparseness of its solution on large data sets, its ability to handle large feature spaces, and its ability to identify outliers.⁠[18]

Proteins present a different shape of problem: a sequence of amino acids of varying length must be turned into a fixed list of numbers before any classifier can see it. One approach predicts where a protein will be found inside a cell, its subcellular localization, from nothing more than the amino acid composition of its sequence. Trained this way, the classifier reached 91.4% accuracy across three subcellular locations in prokaryotic organisms and 79.4% across four locations in eukaryotic organisms, and its predictions proved robust to errors in the protein's N-terminal sequence.⁠[4]

A harder version of the same problem asks not where a protein goes but how it sits in a membrane. Alpha-helical transmembrane proteins thread through the cell membrane, and their topology is the count of membrane-spanning helices, their boundaries, and which side of the membrane each end faces. These proteins make up roughly 30% of a typical genome yet only 1.7% of known structures in the Protein Data Bank, because crystallising them is so difficult, which is precisely why a sequence-based predictor is worth having. The same system correctly predicted the topology of 93% (13 of 14) of proteins containing signal peptides, short targeting motifs that look much like membrane helices, and a separate classifier trained to tell transmembrane proteins from globular ones detected zero false positives, with a low false negative rate of 0.4%.⁠[3]

The recurring difficulty across these biological tasks is that the features are not cleanly separable. A signal peptide and a membrane helix are both stretches of hydrophobic residues, and confusing them corrupts the predicted topology, which is why the system needed a dedicated classifier for each.⁠[3] The same crowding of similar categories appeared in the fruit study, where Bosc Pears, Passion Fruits and Avocado were repeatedly confused for one another.⁠[1] In both cases the limit is set by what the description reveals, not by the boundary drawn through it.

Images of a different kind round out the range. A road-sign recognition system detected and recognised circular, rectangular, triangular and octagonal signs, covering all existing Spanish traffic-sign shapes, in three stages: segmenting the image by pixel colour, detecting a sign by shape using linear SVMs, and recognising its content with Gaussian-kernel SVMs. The reported results showed a high success rate and very few false positives in the final recognition stage, and the system proved invariant to translation, rotation and scale, and in many situations even to partial occlusion.⁠[19]

Sound gives one more example, and one where the raw material is a whole recording rather than a fixed vector. In speaker verification, the task is to confirm that a recording comes from a claimed person. A Gaussian mixture model, a statistical description of how a speaker's sound is distributed, can be summarised by stacking the means of its components into a single long vector, and that vector can then be fed to an SVM as an example. Kernels built from distance metrics between such models produced excellent classification accuracy in a standard speaker recognition evaluation.⁠[20]

What these applications share is not a subject matter but a shape. Each turns an object, a document, a face, a gene profile, a protein sequence, a photograph of a sign, a recording of a voice, into a list of numbers; each has few labelled examples relative to the length of that list; and each asks for a boundary between two groups. Where those conditions hold, the method's sparseness and its tolerance of many dimensions do the work. Where the categories blur into one another, as with signal peptides and membrane helices or with pears and avocados, no boundary can recover a distinction the numbers never carried.

The method travels well across domains because the domains can all be recast in one form: many measurements per example, few labelled examples, two groups to separate.

Research

Does it actually classify better?

Claims of superiority are easy to make and hard to establish, because a comparison between two classifiers is itself a piece of research with its own design choices, and those choices can decide the outcome before any data are seen. The question is not whether an SVM can beat a rival on one data set, which is almost always true of some data set for some method, but whether it does so when both are given a fair chance. Getting that fair chance is harder than it sounds, and the most instructive case in the literature is a comparison that first had to dismantle an earlier one.

The setting was cancer classification from gene expression microarrays, where each sample is described by thousands of gene measurements and the task is to assign it to a diagnostic category or predict a clinical outcome. Support vector machines had come to be regarded as a best-of-class algorithm for such data, having been reported to significantly outperform k-nearest neighbours, backpropagation and probabilistic neural networks, weighted voting methods and decision trees. A later piece of work then reported that random forests, an ensemble method that averages many decision trees, had predictive performance comparable to the best alternatives and, according to its data, slightly better than SVMs on average across ten data sets.⁠[2] If that were right it would matter a great deal, since it would mean the presumed leader in the field had been overtaken.

The comparison that produced that conclusion turned out to contain several biases, each of which worked against the SVM. The random forests were applied to the datasets prior to gene selection while the SVMs were applied with a subset of only 200 genes, a number chosen arbitrarily, even though the number of optimal genes varies from data set to data set and SVMs are known to be fairly insensitive to a very large number of irrelevant genes. A one-against-one scheme was used for the many-class tasks, a scheme shown to be inferior in this domain to one-against-rest. Only linear SVMs were tried, with no tuning of the penalty parameter that balances fitting the data against insensitivity to outliers. The performance measure was the proportion of correct classifications, which is sensitive to unbalanced classes and has less power to discriminate between classifiers than alternatives such as the area under the ROC curve. No statistical comparison between the classifiers was performed at all, and the error estimator used was not the most appropriate for microarray data.⁠[2]

Correcting those limitations reversed the finding. Across 22 diagnostic and prognostic data sets, with no gene selection performed and again with several popular gene selection methods applied, the SVMs exhibited lower classification error than the random forests, both on average and in the majority of the individual data sets, often by a large margin.⁠[2] The episode is a lesson about benchmarking before it is a lesson about classifiers: a method can appear to lose purely because it was handicapped in the design of the contest, and the handicap need not be deliberate. Handing one algorithm a pre-filtered feature set and the other the raw data, or tuning one and not the other, is the kind of asymmetry that creeps into comparisons quietly.

Why the gap exists is a separate question, and the same work offered two explanations rather than one settled answer. The first concerns sensitivity to settings. A simulation experiment showed that the random forest's performance varied a great deal with the values of its two main inputs, the number of genes randomly selected at each split and the number of trees, even when the underlying boundary was a simple linear one; the SVM's main parameter, by contrast, had only minor effects on the error. In practice this means that finding a random forest's best configuration for a given data set requires extensive search, and with the small validation sets typical of microarray studies that search itself creates an opportunity to overfit.⁠[2]

The second explanation is structural. Prior work had established that linear decision functions capture the underlying distributions in microarray classification well, and the two algorithms model such functions differently. A decision tree can represent a linear boundary exactly only if that boundary happens to line up with the axes of the measurements; otherwise an infinitely large tree is needed, and the forest's vote approximates the line by a staircase of rectangular steps. An SVM, using linear classifiers, represents the same boundary naturally with a small number of free parameters.⁠[2] The advantage, on this account, is not that the SVM is cleverer in general but that it happens to fit the shape of the problem at hand.

Two cautions follow, and both are easy to lose sight of. The first is that 22 data sets from one domain, all of them microarray expression studies, do not establish a ranking in general; the result is a statement about that kind of data, with its many measurements, few samples and near-linear structure.⁠[2] The second is that a benchmark is only as good as its design, and the corrected comparison is more trustworthy than the one it replaced precisely because its authors went looking for the biases rather than accepting the first result. The broader question of when a benchmark settles a question and when it merely starts one is taken up later, along with the costs and vulnerabilities that no accuracy figure captures.

Support vector machines versus random forests on 22 datasets. The section reports how the SVM and random forest results split across the 22 cancer datasets. From this article: “Support vector machines nominally outperformed random forests in 15 datasets, lost in 4, and tied in 3.⁠”⁠[2]

Margins, noise and the cost of a wrong label

The margin is a promise about new data, and the promise is only as good as the training labels it rests on. Because the boundary is pinned by the few points nearest it, a single mislabelled example sitting at the kerb can drag the road with it. The standard SVM uses the hinge loss, and the SVM classifier can be very sensitive to outliers in the training sample.⁠[13] That unbounded rise is what makes the classifier sensitive to outliers: one badly placed example can pull the boundary a long way, because the cost of ignoring it keeps growing the further the boundary moves from it.

A graph compares blue hinge loss with orange truncated hinge loss, accompanied by formulas, five numbered explanations, and a table of example loss values.
Hinge loss grows as a misclassified example falls farther onto the wrong side of the decision boundary. The illustrated truncated loss caps that cost at 2, limiting the contribution of extreme outliers. View full-size image.How Truncated Hinge Loss Caps Outliers by Atlas Nova. Illustration generated with AI for this article and checked against its text.

Capping the price of a bad example

A natural remedy is to stop charging once a point is hopeless. The robust truncated hinge loss does exactly this: beyond a certain distance the cost stops rising, so a point far on the wrong side is treated as an outlier to be written off rather than an error to be chased. The classifier built on it, the robust truncated hinge loss SVM, was shown to be more robust to outliers and to deliver more accurate classifiers using a smaller set of support vectors than the standard SVM. The same work established a theoretical property that matters for many-class problems: the method is Fisher-consistent, meaning it converges to the best possible classifier in the limit, even when no single class dominates the data, a situation that is particularly challenging for multicategory classification.⁠[13] Capping the loss therefore buys robustness without giving up the guarantee that the method is solving the right problem.

A different way to soften the classifier's temper is to change what the loss measures. The hinge loss is related to the shortest distance between sets, and the corresponding classifier is hence sensitive to noise and unstable for re-sampling. The pinball loss, long used in regression, is instead tied to a quantile distance, and a classifier built on it, called pin-SVM, was shown to have the same computational complexity as the hinge version while enjoying noise insensitivity and stability under resampling. An insensitive zone can be added to make the solution sparse again, recovering the property that only a few examples determine the boundary.⁠[12] The trade is a familiar one: a loss that ignores small errors near the boundary produces a calmer classifier, at the cost of no longer insisting that every correctly labelled point be pushed safely outside the margin.

When the label itself is uncertain

Both of these remedies assume the labels are right and the points are awkward. In many settings the labels are genuinely doubtful. A credit scorer cannot say that a customer is absolutely good, sure to repay on time, or absolutely bad, certain to default; the honest description is that each customer belongs to both groups with different degrees of membership. Fuzzy support vector machines handle this by attaching a membership value to each training point and reformulating the problem so that different points make different contributions to the learning of the decision surface. Fuzzy SVMs apply a fuzzy membership to each input point and reformulate the SVMs so that different input points can make different contributions to the learning of the decision surface.⁠[21]

Applied to credit risk, this idea was pushed further: a fuzzy SVM was built that treats every sample as belonging to both the good and the bad class, but with different memberships, rather than assigning each to one class with a weight. The intention was to gain generalization ability while preserving the insensitivity to outliers that fuzzy SVMs already had, and the problem was reformulated as a quadratic programming problem in the usual way. On three public data sets the new classifier showed better discriminatory power than both the standard SVM and the earlier fuzzy SVM, provided an appropriate kernel and membership scheme were chosen.⁠[22] The qualification is doing real work in that sentence: the gain depended on two modelling choices, so the result is a statement about a well-configured pipeline rather than about fuzzy memberships in the abstract.

Robustness and regularization as one thing

Behind these variants sits a result that reframes the whole question. A regularized SVM, the ordinary kind with a penalty on the size of the weights, turns out to be exactly equivalent to a robust optimization problem, one that explicitly plans for the worst case within some allowance for noise in the data. The equivalence runs both ways: it suggests new SVM-like algorithms that build in protection against noise while controlling overfitting, and it supplies an interpretation of why regularized SVMs work at all, since robustness itself becomes the reason they generalize well.⁠[23] On this view the penalty parameter is not an arbitrary brake on complexity but the size of the disturbance the classifier is being insured against.

That reframing explains why the losses above are variations on a theme rather than unrelated fixes. Truncating the hinge, replacing it with a pinball loss, or weighting points by fuzzy membership are all ways of specifying how much a disturbed or doubtful example is allowed to move the boundary. The margin sets the classifier's confidence; the loss sets what it is willing to sacrifice to keep that confidence; and the regularization equivalence says the two are, in the end, the same dial seen from different sides.

A loss function is a statement about which mistakes the classifier should care about, and how much.

Choosing kernels and settings in practice

An SVM has no opinion about its own settings. The penalty parameter C and the kernel's own parameter, such as the width of a Gaussian, must be supplied from outside, and the classifier's accuracy depends on them as much as on the data. Choosing them is therefore part of building the classifier, not an afterthought, and the choice is made by measurement rather than by argument: candidate settings are tried, each is scored on data the classifier was not trained on, and the best-scoring combination is kept.

The scoring is done by cross-validation, the procedure described earlier in which the labelled data are partitioned into folds, the classifier is trained on all but one fold and tested on the held-out one, and the process repeats until every fold has served as the test set. The average error across the folds is the estimate used to compare settings. A refinement called stratified cross-validation arranges each fold to carry nearly the same class distribution as the whole data set, so that no fold is dominated by one class and the error estimate is not thrown off by an unlucky split. The number of folds is itself a choice with consequences: too many folds makes the error estimate less biased but more variable and slower to compute, too few makes it faster and steadier but more biased, and the fruit study settled on five by trial and error.⁠[1]

The settings interact, which is why they are searched together rather than one at a time. C controls how heavily a violation of the margin is penalized, and the Gaussian kernel's width controls how far the influence of a single example reaches; the behaviour of the classifier at extreme values of both has been analysed in detail, and that analysis is what underpins the heuristic searches used to find workable values instead of trying every combination blindly. The same analysis reaches a conclusion that simplifies the search: if complete model selection using the Gaussian kernel has been carried out, there is no need to consider a linear SVM.⁠[11]

The search has a cost that grows with the data. Training an SVM takes time and memory that depend on the size of the training set, and when the collection of labelled examples becomes very large this burden is the method's principal shortcoming rather than a detail. One response is to train on a chosen subset rather than the whole collection, and a body of work has grown up around how to select that subset well; a review of the methods divides them into categories according to the idea behind the selection, which helps in understanding what each is trying to preserve.⁠[24] That the discarded examples genuinely do not matter is the sparseness property seen earlier, now put to work as a computational strategy.

A related line of work replaces the standard formulation with a modified one whose solution comes from a linear system rather than a quadratic programming problem. In least squares support vector machines, a least squares cost function is used so that the dual problem becomes a set of linear equations, and the formulation is related to a ridge regression approach for classification with binary targets and to Fisher's linear discriminant analysis in the feature space. The price of that convenience is that the sparseness of the standard SVM is lost, because the choice of a squared penalty spreads weight across many examples; sparseness can be restored in a second stage by gradually pruning the support values and optimizing the settings during the pruning. On twenty public benchmark data sets, the least squares version with a Gaussian kernel and standard cross-validation for setting its parameters achieved test performance comparable to the standard SVM, and both were consistently very good against a range of other methods including decision-tree, statistical and instance-based learners.⁠[25] The practical upshot is that the choice between the two formulations is often a matter of training convenience rather than of accuracy.

Software matters more than it might seem, because the search over settings multiplies the number of times a classifier must be trained. Implementations of SVMs exist in almost every popular programming language, and in the R statistical environment four packages contain related software, which raises the practical question of how they differ. Comparing those implementations is what lets a user pick one on grounds other than familiarity, since the same mathematical classifier can be packaged with different facilities for tuning, different kernels, and different behaviour on large inputs.⁠[26]

Two habits keep the procedure honest. The first is to keep the test data out of the search entirely: if the same held-out set is used both to choose the settings and to report the accuracy, the reported figure is optimistic, because the settings have been fitted to it. The second is to report the settings alongside the result, since an accuracy figure without its kernel and parameters describes a classifier that cannot be rebuilt. The costs of getting this wrong, and the ways a classifier can be undermined by its training data, are covered later.

Settings are chosen by held-out error, never by fit to the training data, and the chosen values belong in any reported result.

Cross-validation trains and tests on rotating folds until each fold has served as the test set.

Risks and limits

Limits, costs and vulnerabilities

Every method has a price, and for the support vector machine the largest one is paid at training time. Fitting the classifier means solving an optimization problem whose size grows with the number of training examples, so both the time and the memory required rise as the collection of labelled cases grows. On modest data sets this is invisible; on very large ones it becomes the method's principal shortcoming rather than a detail of implementation.⁠[24] The reason is structural rather than accidental. The classifier is defined by the examples nearest the boundary, but which examples those are is not known in advance, so the training procedure must consider all of them before it can conclude that most of them do not matter.

Two scatterplots show blue and orange classes with circled support vectors, vertical margin lines, and a boundary shifted after a blue point is discarded.
Removing a critical training example can change the maximum-margin boundary. In this illustrative case, the boundary moves from x₁ = 2 to x₁ = 1.5. View full-size image.How Subset Selection Changes the Boundary by Atlas Nova. Illustration generated with AI for this article and checked against its text.

The obvious response is to train on a chosen subset instead of the whole collection, and a body of work has grown up around how to choose it well. A review of these methods divides the state-of-the-art techniques into several categories, which helps understand the underlying ideas behind these algorithms and may be useful in designing new methods.⁠[24] The strategy rests on the sparseness property described earlier, since an example that ends up far from the margin genuinely has no effect on the answer and can be dropped without loss. What the selection methods trade away is certainty: a subset chosen by a heuristic may discard an example that a full training run would have found critical, and the resulting classifier is an approximation rather than the same object.

The cost of a doubtful label

The second vulnerability is built into the standard formulation. The hinge loss charges every violation of the margin and keeps charging, rising without limit as a point falls further onto the wrong side. That unbounded rise is what makes the ordinary SVM sensitive to outliers: a single badly placed example can pull the boundary a long way, because the cost of ignoring it keeps growing the further the boundary moves from it. The robust truncated hinge loss addresses this by ceasing to charge beyond a certain distance, so that a point far on the wrong side is written off as an outlier rather than chased, and the classifier built on it was shown to be more robust to outliers and to deliver more accurate classifiers using a smaller set of support vectors than the standard SVM. The same work established that the method is Fisher-consistent, even when there is no dominating class, a scenario that is particularly challenging for multicategory classification.⁠[13]

A third limit is the one that catches newcomers: the classifier has no opinion about its own settings. The penalty parameter and the kernel's width must be supplied from outside, and accuracy depends on them as much as on the data. The behaviour at extreme values of both has been analysed in detail, and that analysis helps in understanding the hyperparameter space that leads to an efficient heuristic method of searching for values with small generalization errors.⁠[11] The practical consequence is that a poorly tuned SVM can underperform a simpler method, and the failure will look like a property of the classifier rather than of the settings chosen for it.

An adversary who writes the training data

A more pointed vulnerability arises when the training data are not a neutral sample. Most learning algorithms assume their training data come from a natural or well-behaved distribution, and in security-sensitive settings that assumption does not hold: someone may be choosing the examples deliberately. A poisoning attack exploits this by injecting specially crafted training data whose effect is to increase the classifier's error on new cases. Because the SVM's decision function is determined by its support vectors, an intelligent adversary can, to some extent, predict how the boundary will shift in response to malicious input and construct data accordingly.

The attack uses a gradient ascent strategy, with the gradient computed from properties of the SVM's optimal solution, and it can be kernelized so that the malicious examples can be constructed in the input space even when the kernel is nonlinear. Experiments showed that the procedure reliably finds good local maxima of the non-convex validation error surface, significantly increasing the classifier's test error.⁠[27] The lesson is not that the SVM is uniquely fragile but that a classifier pinned by a few critical examples offers an adversary a small, well-defined target.

One benchmark is not a verdict

The last caution is about evidence rather than mechanism. A comparison between classifiers is itself a piece of research with design choices, and those choices can decide the outcome before any data are seen. The microarray episode covered earlier is the clearest illustration: a comparison that had reported random forests slightly ahead of SVMs turned out to have given the forests the full gene set and the SVMs an arbitrary subset of 200 genes, to have used a many-class scheme known to be inferior in that domain, and to have tuned no parameters at all; once those limitations were corrected across 22 data sets, the SVMs showed lower error both on average and in the majority of individual sets.⁠[2] A method can appear to lose purely because it was handicapped in the design of the contest, and the handicap need not be deliberate.

The same restraint applies to results that favour the method. In a comparison of SVM, random forest and extreme learning machine for network intrusion detection on a standard benchmark data set, the extreme learning machine outperformed the other approaches.⁠[28] That is one result on one data set in one domain, and it does not overturn the microarray finding any more than the microarray finding settles the general question. What both illustrate is that a reported ranking belongs to a particular data set, feature set, tuning effort and error measure, and that the honest reading of any single benchmark is narrow.

The method's costs are training time that grows with the sample, a boundary that a few doubtful or malicious examples can move, settings that must be tuned from outside, and evidence that is only ever as good as the comparison that produced it.

Later developments

Variants that move the boundary

The standard SVM draws one flat boundary and lets a few nearby examples pin it in place. A family of variants keeps the margin idea but changes what the boundary is allowed to be, or how much of the data must be examined to find it. They are worth knowing because the choice among them is often a choice about computation and about the shape of the boundary, not about accuracy in the abstract.

Two planes instead of one

The twin support vector machine replaces the single separating hyperplane with two nonparallel planes, one fitted close to each of the two classes and pushed away from the other. Each plane comes from its own optimization problem, and each of those problems is smaller than the one a conventional SVM must solve, so training is quicker. On several benchmark data sets the twin SVM was not only fast but showed good generalization, and the pair of planes can also be used to reveal two-dimensional projections of the data that make its structure visible.⁠[29] The idea is in the spirit of proximal SVMs via generalized eigenvalues, in which each of two data sets is made proximal to one of two distinct planes that are not parallel to each other; each plane is generated so that it lies closest to one set and as far as possible from the other, and each is obtained as the eigenvector corresponding to a smallest eigenvalue of a generalized eigenvalue problem [9, 22]. That work reported advantages in both computation time and test-set correctness on public data sets.⁠[30]

The nonparallel idea was later given a more careful formulation. The nonparallel support vector machine builds two primal problems that implement the structural risk minimization principle, the same principle underlying the standard SVM, and its dual problems keep the properties that let the kernel trick be applied directly. This matters because the earlier nonparallel classifiers had to construct separate approximate problems for the nonlinear case, and those nonlinear problems could not reduce to the linear case even when a linear kernel was used. The nonparallel SVM also retains the sparseness of the standard method, can be solved by the same efficient sequential minimization algorithms, and contains the twin SVM as a special case when its parameters are chosen appropriately. Experiments across many data sets confirmed its effectiveness in both sparseness and classification accuracy.⁠[31]

Trading a little accuracy for speed

A separate line of work attacks the training cost directly. The reduced support vector machine preselects a subset of the data to serve as support vectors and solves a smaller optimization problem, which is aimed at the difficulty of handling large data sets with nonlinear kernels.⁠[32] The question is whether the saving costs anything. In an empirical study, the test accuracy of the reduced version was in general a little lower than that of the standard SVM, and for problems of up to tens of thousands of examples, existing standard implementations were quite competitive on training time when the proportion of support vectors was not high. The conclusion drawn was that the reduced method is mainly useful for larger problems, or for those in which many examples end up as support vectors.⁠[32] The variant is thus a deliberate approximation, and its value depends on how much of the data the full method would have needed anyway.

Using unlabelled examples

The variants so far assume every training example carries a label. In many settings labels are scarce while unlabelled examples are abundant, and the Laplacian support vector machine puts that surplus to work. It regularizes the SVM with the unnormalized graph Laplacian, a term built from a graph connecting examples to one another, so that examples close together in that graph are encouraged to receive similar classifications. The method was tested on urban monitoring and cloud screening from remote sensing images, problems in which making adequate use of the wealth of unlabeled samples is critical, and results across different sensors and with a low number of training samples demonstrated its potential.⁠[33] The unlabelled data do not supply answers; they supply the shape of the space in which the boundary is drawn.

The same classifier on a quantum computer

One variant changes the machine rather than the mathematics. The support vector machine, described as an optimized binary classifier, can be implemented on a quantum computer with complexity logarithmic in the size of the vectors and the number of training examples. In cases where classical sampling algorithms require polynomial time, this yields an exponential speedup. At the core of the construction is a technique for efficiently performing a matrix inversion of the kernel matrix, the matrix of inner products between training examples.⁠[34] The result is a statement about computational complexity under stated conditions, not a claim that every SVM problem becomes easy; it belongs with the other variants as a change in how the same boundary is found.

What the variants have in common

Twin and proximal planes, reduced training sets, graph-based semi-supervision and quantum implementations all keep a decision surface chosen with a margin in mind. What they vary is the cost of finding it, the shape it is permitted to take, and the kind of information allowed to influence it. A reader who understands the margin, the kernel and the penalty parameter can place each variant by asking which of those three it alters, and by asking what it gives up in return.

The variants change the boundary's shape, the training cost, or the information used.

Key studies

YearStudySampleDesignFinding
1999Drucker et al.⁠[17]two email datasets, one with 1000 features and one with over 7000comparison of four classifiers for spam categorizationSupport vector machines performed best with binary features and had significantly less training time than boosting trees.
2001Hua & Sun⁠[4]proteins from prokaryotic and eukaryotic organismsprediction of protein subcellular localization from amino acid compositionTotal prediction accuracy reached 91.4% for three locations in prokaryotes and 79.4% for four locations in eukaryotes.
2003Kuan-Ming Lin & Chih-Jen Lin⁠[32]problems with up to tens of thousands of data pointsempirical study of reduced support vector machinesTest accuracy of the reduced machine was generally a little lower than the standard machine, and the standard machine was competitive on training time.
2004van Gestel et al.⁠[25]twenty public benchmark datasetsbenchmark of least squares support vector machine classifiersThe support vector machine and least squares support vector machine with radial basis kernel and cross-validation achieved comparable test performance.
2006Moguerza & Muñoz⁠[5]690 documents described by 982 termscomparison of three classifiers on a text datasetThe linear support vector machine made 3.0% test errors, against 14.0% for the nearest neighbor classifier and 31.4% for linear discriminant analysis.
2007Maldonado-Bascon et al.⁠[19]three-stage detection and recognition systemThe system detected and recognized circular, rectangular, triangular and octagonal signs with a high success rate and very few false positives.
2008Statnikov et al.⁠[2]22 diagnostic and prognostic cancer datasetsbenchmark comparison with a permutation testSupport vector machines nominally beat random forests in 15 datasets and lost in 4, with average area under the curve of 0.775 against 0.742.
2009Nugent & Jones⁠[3]131 protein sequences with known crystal structuresfull cross-validation of a support vector machine topology predictorTopology prediction accuracy was 89%, with signal peptides predicted at 93% and re-entrant helices at 44%.
2012Zhang & Wu⁠[1]5-fold stratified cross validation of multiclass support vector machinesMax-Wins-Voting with a Gaussian radial basis kernel reached 88.2% accuracy, the best of the tested combinations.
2018Ahmad et al.⁠[28]the NSL knowledge discovery and data mining benchmarkcomparison of support vector machine, random forest and extreme learning machine classifiers for intrusion detectionThe extreme learning machine outperformed the support vector machine and random forest on this benchmark.

See also

References

  1. Zhang, Y., & Wu, L. (2012). Classification of Fruits Using Computer Vision and a Multiclass Support Vector Machine. Sensors, 12(9), 12489-12505. doi:10.3390/s120912489
  2. Statnikov, A., Wang, L., & Aliferis, C. F. (2008). A comprehensive comparison of random forests and support vector machines for microarray-based cancer classification. BMC Bioinformatics, 9(1). doi:10.1186/1471-2105-9-319
  3. Nugent, T., & Jones, D. T. (2009). Transmembrane protein topology prediction using support vector machines. BMC Bioinformatics, 10(1). doi:10.1186/1471-2105-10-159
  4. Hua, S., & Sun, Z. (2001). Support vector machine approach for protein subcellular localization prediction. Bioinformatics, 17(8), 721-728. doi:10.1093/bioinformatics/17.8.721
  5. Moguerza, J. M., & Muñoz, A. (2006). Support Vector Machines with Applications. Statistical Science, 21(3), 322-336. doi:10.1214/088342306000000493
  6. Hofmann, T., Schölkopf, B., & Smola, A. J. (2008). Kernel methods in machine learning. The Annals of Statistics, 36(3), 1171-1220. doi:10.1214/009053607000000677
  7. Hearst, M. A., Dumais, S. T., Osuna, E., Platt, J., & Scholkopf, B. (1998). Support vector machines. IEEE Intelligent Systems and their Applications, 13(4), 18-28. doi:10.1109/5254.708428
  8. Mammone, A., Turchi, M., & Cristianini, N. (2009). Support vector machines. WIREs Computational Statistics, 1(3), 283-289. doi:10.1002/wics.49
  9. Chih-Wei Hsu, & Chih-Jen Lin (2002). A comparison of methods for multiclass support vector machines. IEEE Transactions on Neural Networks, 13(2), 415-425. doi:10.1109/72.991427
  10. Brereton, R. G., & Lloyd, G. R. (2010). Support Vector Machines for classification and regression. The Analyst, 135(2), 230-267. doi:10.1039/b918972f
  11. Keerthi, S. S., & Lin, C. J. (2003). Asymptotic Behaviors of Support Vector Machines with Gaussian Kernel. Neural Computation, 15(7), 1667-1689. doi:10.1162/089976603321891855
  12. Xiaolin Huang, Lei Shi, & Suykens, J. A. K. (2014). Support Vector Machine Classifier With Pinball Loss. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(5), 984-997. doi:10.1109/tpami.2013.178
  13. Wu, Y., & Liu, Y. (2007). Robust Truncated Hinge Loss Support Vector Machines. Journal of the American Statistical Association, 102(479), 974-983. doi:10.1198/016214507000000617
  14. Chapelle, O., Haffner, P., & Vapnik, V. N. (1999). Support vector machines for histogram-based image classification. IEEE Transactions on Neural Networks, 10(5), 1055-1064. doi:10.1109/72.788646
  15. Lee, Y., Lin, Y., & Wahba, G. (2004). Multicategory Support Vector Machines: Theory and Application to the Classification of Microarray Data and Satellite Radiance Data. Journal of the American Statistical Association, 99(465), 67-81. doi:10.1198/016214504000000098
  16. Melgani, F., & Bruzzone, L. (2004). Classification of hyperspectral remote sensing images with support vector machines. IEEE Transactions on Geoscience and Remote Sensing, 42(8), 1778-1790. doi:10.1109/tgrs.2004.831865
  17. Drucker, H., Donghui Wu, & Vapnik, V. N. (1999). Support vector machines for spam categorization. IEEE Transactions on Neural Networks, 10(5), 1048-1054. doi:10.1109/72.788645
  18. Brown, M. P. S., Grundy, W. N., Lin, D., Cristianini, N., Sugnet, C. W., Furey, T. S., Ares, M., & Haussler, D. (2000). Knowledge-based analysis of microarray gene expression data by using support vector machines. Proceedings of the National Academy of Sciences, 97(1), 262-267. doi:10.1073/pnas.97.1.262
  19. Maldonado-Bascon, S., Lafuente-Arroyo, S., Gil-Jimenez, P., Gomez-Moreno, H., & Lopez-Ferreras, F. (2007). Road-Sign Detection and Recognition Based on Support Vector Machines. IEEE Transactions on Intelligent Transportation Systems, 8(2), 264-278. doi:10.1109/tits.2007.895311
  20. Campbell, W. M., Sturim, D. E., & Reynolds, D. A. (2006). Support vector machines using GMM supervectors for speaker verification. IEEE Signal Processing Letters, 13(5), 308-311. doi:10.1109/lsp.2006.870086
  21. Chun-Fu Lin, & Sheng-De Wang (2002). Fuzzy support vector machines. IEEE Transactions on Neural Networks, 13(2), 464-471. doi:10.1109/72.991432
  22. Yongqiao Wang, Shouyang Wang, & Lai, K. K. (2005). A new fuzzy support vector machine to evaluate credit risk. IEEE Transactions on Fuzzy Systems, 13(6), 820-831. doi:10.1109/tfuzz.2005.859320
  23. Huan, X., Caramanis, C., & Mannor, S. (2008). Robustness and Regularization of Support Vector Machines. arXiv. doi:10.48550/arxiv.0803.3490 Free full text
  24. Nalepa, J., & Kawulok, M. (2019). Selecting training sets for support vector machines: a review. Artificial Intelligence Review, 52(2), 857-900. doi:10.1007/s10462-017-9611-1
  25. van Gestel, T., Suykens, J. A. K., Baesens, B., Viaene, S., Vanthienen, J., Dedene, G., de Moor, B., & Vandewalle, J. (2004). Benchmarking Least Squares Support Vector Machine Classifiers. Machine Learning, 54(1), 5-32. doi:10.1023/b:mach.0000008082.80494.e0
  26. Karatzoglou, A., Meyer, D., & Hornik, K. (2006). Support Vector Machines in R. Journal of Statistical Software, 15(9). doi:10.18637/jss.v015.i09
  27. Biggio, B., Nelson, B. A., & Laskov, P. (2012). Poisoning Attacks against Support Vector Machines. arXiv. doi:10.48550/arxiv.1206.6389 Free full text
  28. Ahmad, I., Basheri, M., Iqbal, M. J., & Rahim, A. (2018). Performance Comparison of Support Vector Machine, Random Forest, and Extreme Learning Machine for Intrusion Detection. IEEE Access, 6, 33789-33795. doi:10.1109/access.2018.2841987
  29. Jayadeva, Khemchandani, R., & Chandra, S. (2007). Twin Support Vector Machines for Pattern Classification. IEEE Transactions on Pattern Analysis and Machine Intelligence, 29(5), 905-910. doi:10.1109/tpami.2007.1068
  30. Mangasarian, O. L., & Wild, E. W. (2006). Multisurface proximal support vector machine classification via generalized eigenvalues. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28(1), 69-74. doi:10.1109/tpami.2006.17
  31. Yingjie Tian, Zhiquan Qi, Xuchan Ju, Yong Shi, & Xiaohui Liu (2014). Nonparallel Support Vector Machines for Pattern Classification. IEEE Transactions on Cybernetics, 44(7), 1067-1079. doi:10.1109/tcyb.2013.2279167
  32. Kuan-Ming Lin, & Chih-Jen Lin (2003). A study on reduced support vector machines. IEEE Transactions on Neural Networks, 14(6), 1449-1459. doi:10.1109/tnn.2003.820828
  33. Gomez-Chova, L., Camps-Valls, G., Munoz-Mari, J., & Calpe, J. (2008). Semisupervised Image Classification With Laplacian Support Vector Machines. IEEE Geoscience and Remote Sensing Letters, 5(3), 336-340. doi:10.1109/lgrs.2008.916070
  34. Rebentrost, P., Mohseni, M., & Lloyd, S. (2014). Quantum Support Vector Machine for Big Data Classification. Physical Review Letters, 113(13). doi:10.1103/physrevlett.113.130503

Cite this page: Atlas Nova editors. (2026). Support vector machine. Atlas Nova. https://velocer.io/atlas/support-vector-machines/