GRKneg: Negative-Augmented OC-SVM Kernel
- GRKneg is a kernel technique that integrates actual and generated negatives to improve the accuracy of one-class support vector machines.
- It constructs a centered kernel matrix using spectral thresholding of the pseudoinverse derived from combined real and synthetic negative samples.
- Empirical results demonstrate significant gains in outlier detection, especially when negative samples are scarce, compared to traditional OC-SVM.
A Generalized Reference Kernel with Negative Samples (GRKneg) is a kernel engineering technique for one-class support vector machines (OC-SVM) designed to leverage small sets of labeled negative samples to enhance outlier detection accuracy. Unlike classical OC-SVM, which constructs kernels solely from positive class data, GRKneg constructs a kernel that incorporates both actual and generated negative examples, thereby regularizing and reshaping the feature space in a principled manner while retaining compatibility with standard OC-SVM solvers. This approach demonstrates significant empirical improvements in low-negative-sample regimes, offering a drop-in replacement for the base RBF kernel in one-class classification tasks (Raitoharju, 17 Jun 2025).
1. Mathematical Formulation
Let denote the positive (inlier) training set, the available negative (outlier) training set, and the base kernel, frequently chosen as RBF. The GRKneg approach forms an augmented reference vector set
where are generated negatives sampled independently from a Gaussian , with and .
The centered reference-reference and reference-positive kernel matrices,
are computed and centered via
0
to obtain 1 and 2.
The GRKneg kernel matrix on the positive set is
3
where 4 is the Moore–Penrose pseudoinverse, computed using eigen-decomposition with only nonzero eigenvalues retained.
For any 5, the GRKneg kernel is given by
6
with 7 after centering. This construction is a valid Mercer kernel and defines an implicit mapping
8
No additional explicit regularization is introduced apart from spectral thresholding in the pseudoinverse (Raitoharju, 17 Jun 2025, Raitoharju et al., 2022).
2. Reference Vector Generation and Selection
Nine reference vector selection/generation strategies were evaluated. The optimal variant concatenates the original 9 negative training samples and 0 generated negatives from 1. The process is:
- Compute 2 from negatives.
- Generate 3 synthetic negatives 4.
- Concatenate 5 to form 6 (7).
- Construct and center the kernel matrices as previously specified.
- Perform eigen-decomposition and compute the pseudoinverse.
- Form the final GRKneg kernel matrix.
Using only positives as references was found to be ineffective for OC-SVM, while using a mixture of true and generated negatives maximized kernel informativeness, particularly when real negatives are scarce (Raitoharju, 17 Jun 2025).
3. Integration with OC-SVM Framework
GRKneg serves as a direct replacement for the conventional kernel in standard OC-SVM pipelines. The OC-SVM dual maximization for 8-SVM remains: 9 subject to 0, 1.
All other algorithmic details, including parameter 2, thresholding, and solver mechanics, are unchanged from standard OC-SVM usage; only the kernel is replaced (Raitoharju, 17 Jun 2025).
4. Algorithmic Workflow
The GRKneg process comprises four main stages:
- Preprocessing: Standardize all positive samples and negative samples using positive-set statistics.
- Reference Kernel Construction:
- Estimate 3.
- Generate 4 synthetic negatives.
- Build 5, form and center the 6 and 7 base kernel matrices.
- Perform spectral decomposition and compute pseudoinverse to construct 8.
- OC-SVM Model Training: Use 9 and parameter 0 in standard OC-SVM dual optimization to obtain 1, threshold 2.
- Testing: For a test point 3, compute the centered 4 vector, assemble 5, and apply the OC-SVM scoring rule: 6; classify as an outlier if 7 (Raitoharju, 17 Jun 2025).
5. Hyperparameterization and Implementation
Principal parameters and settings include:
- Base-kernel bandwidth 8, with 9 the mean squared distance among training samples, and 0 swept over 1.
- OC-SVM parameter 2.
- Number of generated negative samples 3.
- Eigenvalue truncation: retain nonzero eigenvalues (as in LIBSVM pseudo-inverse defaults).
- Parameter selection via 5-fold cross-validation within training data.
Implementation is realized in MATLAB and LIBSVM via custom precomputed kernels (option 4) (Raitoharju, 17 Jun 2025).
6. Empirical Evaluation
Experiments were performed across 14 one-class benchmarks (UCI Iris, Seeds, Ionosphere, Sonar, Bankruptcy, Happiness) at negative counts 5. The geometric mean (Gmean 6) was the principal metric.
Key findings, averaged across tasks, include:
| Negatives | SVM (Binary) | OC-SVM (RBF) | GRKneg (Variant 7) | GRK-Only Negatives (Var 3) |
|---|---|---|---|---|
| 5 | 70.0 ± 12.7 | 73.7 ± 6.1 | 79.5 ± 9.0 | 74.6 ± 7.4 |
| 10 | 76.4 ± 5.9 | 75.0 ± 4.7 | 81.9 ± 4.6 | 79.2 ± 6.7 |
| 20 | 84.1 ± 3.2 | 75.9 ± 4.0 | 83.7 ± 4.1 | 82.8 ± 5.7 |
For very small negative sample sizes (7 or 8), GRKneg outperformed both baseline OC-SVM and classical binary SVM. For larger negative sets (9), binary SVM achieved the highest Gmean, but GRKneg remained competitive (Raitoharju, 17 Jun 2025). These patterns are consistent with general findings for negative-augmented GRK variants (Raitoharju et al., 2022).
7. Interpretation, Limitations, and Future Directions
GRKneg enables OC-SVM to exploit small amounts of negative-label information to engineer the kernel space, resulting in significant accuracy gains in data-scarce, imbalance-prone outlier detection scenarios. The kernel implicitly regularizes the model via the spectrum of the reference Gram matrix and may be viewed as an extension of the generalized reference kernel (GRK) framework with negative augmentation (Raitoharju et al., 2022).
Limitations include:
- Computational overhead due to the eigen-decomposition of the 0 reference Gram matrix.
- Reliance on a Gaussian approximation for the negative distribution, which may not capture complex outlier structures.
- Introduction of hyperparameters such as the number of generated negatives and the base kernel scale.
A plausible implication is that further advances can be achieved by employing more sophisticated negative-sample generation techniques (e.g., mixture models, adversarial sampling), adapting reference selection for multi-view or deep-feature scenarios, and benchmarking against other semi-supervised or class-imbalance–aware SVM variants.
GRKneg unifies and extends prior kernel approximation and regularization paradigms—Nyström approximation, the Non-linear Projection Trick, and random mapping—into a kernel construction paradigm that directly incorporates side information, notably negative samples, to robustly enhance one-class classification performance in practical settings where negative data are limited (Raitoharju, 17 Jun 2025, Raitoharju et al., 2022).