Source-linked AI summary
OCGAN: One-class Novelty Detection Using GANs with Constrained Latent Representations
Pramuditha Perera, Ramesh Nallapati, Bing Xiang
TL;DR
One-class novelty detection must identify whether a query belongs to a class using only in-class training examples, a setting complicated by out-of-class objects that may reconstruct well. OCGAN constrains a bounded latent space with adversarial discriminators and informative-negative sampling so its samples generate the known class. Across four public datasets and two protocols, OCGAN achieves state-of-the-art results and outperforms many recent methods, while performance is especially supported for single-concept images and remains limited on more complex natural images.
Problem
One-class novelty detection must accept in-class queries and reject out-of-class queries despite having no negative training data, and reconstruction-based representations can model some out-of-class objects.
Method
OCGAN uses a bounded latent space, adversarial latent and visual discriminators, and gradient-based informative-negative sampling to make latent samples represent the known class.
Results
OCGAN outperforms many recently proposed one-class novelty detection methods on four publicly available datasets evaluated with two protocols.
Takeaways & Limitations
OCGAN is effective especially when images contain a single concept, including COIL, MNIST, and fMNIST.
Takeaways & Limitations
Sampling all regions becomes impossible in high-dimensional latent spaces, while reducing dimensionality preserves less detail and can diminish novelty-detection performance.
Abstract
from arXiv · showhide
We present a novel model called OCGAN for the classical problem of one-class novelty detection, where, given a set of examples from a particular class, the goal is to determine if a query example is from the same class. Our solution is based on learning latent representations of in-class examples using a denoising auto-encoder network. The key contribution of our work is our proposal to explicitly constrain the latent space to exclusively represent the given class. In order to accomplish this goal, firstly, we force the latent space to have bounded support by introducing a tanh activation in the encoder's output layer. Secondly, using a discriminator in the latent space that is trained adversarially, we ensure that encoded representations of in-class examples resemble uniform random samples drawn from the same bounded space. Thirdly, using a second adversarial discriminator in the input space, we ensure all randomly drawn latent samples generate examples that look real. Finally, we introduce a gradient-descent based sampling technique that explores points in the latent space that generate potential out-of-class examples, which are fed back to the network to further train it to generate in-class examples from those points. The effectiveness of the proposed method is measured across four publicly available datasets using two one-class novelty detection protocols where we achieve state-of-the-art results.
1. Introduction
One-class novelty detection must reject out-of-class examples despite training on only one class. OCGAN addresses this by constraining the latent space so examples from it represent the known class.
- One-class novelty detection learns from a single observed class and must accept in-class examples while rejecting out-of-class queries.The absence of negative training data makes the problem difficult in practice.
- Figure 1 contrasts ordinary auto-encoder reconstructions with OCGAN outputs: out-of-class digits receive high MSE under OCGAN.Red intensity in the lower rows indicates the MSE.
- Auto-encoders can reconstruct out-of-class objects well, especially when the known class has complex shapes such as digit 8.This weakens novelty detection based solely on reconstruction error.
- OCGAN explicitly requires both strong in-class representation and poor out-of-class representation, unlike prior work focused mainly on preserving class details.The proposed method uses a two-fold latent-space learning process.
- OCGAN constrains the latent space so every sampled point generates an image from the known class, such as digit 8.Consequently, out-of-class inputs are mapped to reconstructions of the known class.
2. Related Work
Related work treats one-class novelty detection primarily as learning a representation, then scores queries using reconstruction error or latent-space modeling. The paper situates OCGAN among auto-encoder, GAN, and one-class modeling approaches while distinguishing novelty detection from related classification tasks.
- One-class Novelty Detection: Traditional methods use PCA or kernel PCA, while neural approaches learn analogous mappings with auto-encoder networks.
- One-class Novelty Detection: Representation-based novelty detection commonly uses reconstruction error or explicitly models known-class behavior in the latent space.Mean squared error is one reconstruction-based novelty function.
- One-class Novelty Detection: Prior work includes GAN-based denoising, image-space discriminator scores, One-class SVM, and SVDD applied to learned representations.
- Anomaly Detection and One-class Classification: One-class classification assigns hard labels and uses accuracy or F1, whereas novelty detection assigns novelty scores and uses receiver operating characteristic analysis.The two tasks have similar objectives but different outputs and evaluation measures.
- Adversarial Learning: GANs train a generator to produce realistic images and a discriminator to distinguish generated images from real ones.
3. Proposed Method: OCGAN
OCGAN constrains the entire latent space to represent only the known class, addressing out-of-class images that conventional auto-encoders may reconstruct well. It combines bounded latent support, adversarial discriminators, and informative-negative mining to improve class-consistent generation and novelty detection.
- Motivation: Conventional auto-encoders can reconstruct out-of-class images well because unobserved paths between in-class representations may contain other classes.For digit 8, an intermediate latent path can represent digit 1, producing low reconstruction error.
- Proposed Strategy: OCGAN forces every latent point, including points along paths between in-class examples, to decode into an image of the known class.For digit 8, latent paths are constrained to produce digit 8 images, making digit 1 reconstructions differ substantially from the input.
- Proposed Strategy: The model uses a denoising auto-encoder, latent discriminator, visual discriminator, and classifier as four jointly designed components.The encoder output uses tanh to bound latent support, while adversarial training regularizes latent projections and generated images.
- Proposed Strategy: Informative-negative mining makes generated samples more consistently resemble the target class across the latent space.Without mining, some digit 9 outputs resemble other digits; with mining, the generated outputs consistently look like 9s.
- Limitations: Some latent regions can still produce out-of-class images because exhaustive sampling is impossible in high-dimensional spaces.Reducing latent dimensionality may improve coverage but can discard detail and diminish novelty-detection performance.
- Proposed Strategy: Informative-negative mining follows classifier gradients from random latent samples toward points whose generated images appear out of class.These mined samples train the generator, while random samples continue training the two discriminators.
4. Experimental Results
OCGAN is evaluated on four public datasets under two one-class novelty-detection protocols, with results reported through AUC comparisons and an MNIST ablation study. Its strongest reported gains occur on COIL100 and MNIST, while CIFAR10 remains challenging for all methods.
- Evaluation setup: The evaluation uses four public multi-class object-recognition datasets, treating one class as known and the remaining classes as out-of-class samples.Performance is compared using AUC under relevant protocols.
- Dataset results: COIL100 yields 0.995 AUC for OCGAN versus 0.968 for [16] under Protocol 1.The passage attributes the high scores partly to small intra-class differences.
- Dataset results: OCGAN improves novelty-detection performance by over 2% compared with [16] on fMNIST under Protocol 1.fMNIST is described as more challenging because of considerable intra-class variance.
- Dataset results: OCGAN improves performance by about 3% over [16] on MNIST under Protocol 1 and achieves the best AUC for 9 of 10 classes under Protocol 2.It also reports a better average AUC under Protocol 2.
- Ablation study: On MNIST, mean AUC rises from 0.957 with only the autoencoder by 0.2% with the latent discriminator, 1% with the visual discriminator, and 0.4% with informative-negative mining.The study evaluates the autoencoder, discriminator combinations, and full OCGAN.
5. Conclusion
The paper identifies false positives from reconstruction-error novelty detection and proposes latent-space sampling to make the learned space represent only the known class. OCGAN outperforms many recent methods across four datasets, while its effectiveness is strongest for images containing a single concept.
- Conclusion: Autoencoders can reconstruct out-of-class examples when in-class objects are sufficiently diverse, producing low reconstruction error for novelties.The conclusion motivates latent-space sampling to combat this issue.
- Conclusion: OCGAN bounds the latent space, distributes in-class projections across it, tests random samples with a visual discriminator, and mines informative negatives.These components aim to make generated samples remain within the known class.
- Conclusion: OCGAN outperforms many recently proposed one-class novelty-detection methods on four publicly available datasets.An ablation study also finds each proposed component important for system functionality.
- Conclusion: The method is especially effective when images contain a single concept, as in COIL, MNIST, and fMNIST.The authors identify generalization to more complex natural images as future work.