Source-linked AI summary
Learning Deep Features for One-Class Classification
Pramuditha Perera, Vishal M. Patel
TL;DR
One-class classification must recognize alien instances despite training data containing only one class, while existing features may lack both compactness and descriptiveness. DOC fine-tunes CNN features with compactness and descriptiveness losses, using the target one-class data and an external multi-class dataset. Across anomaly detection, novelty detection, and mobile active authentication, the method achieves state-of-the-art performance, with reported improvements over prior methods.
Problem
One-class classification has only single-class training data, and existing strategies do not jointly produce features that are compact and descriptive.
Method
DOC fine-tunes a CNN using compactness loss on the one-class dataset and descriptiveness loss on an external multi-class reference dataset.
Results
DOC achieves state-of-the-art performance across abnormal image detection, novelty detection, and mobile active authentication, improving AlexNet by nearly 13% and around 14% in reported tasks.
Takeaways & Limitations
The method produces class-specific features that are generically discriminative while maintaining compactness for the target class.
Takeaways & Limitations
The reported analysis includes erroneous detections in one-class novelty detection for the American Flag class, despite mean detection scores of 0.0398 for American Flag and 8.8884 for alien images.
Abstract
from arXiv · showhide
We propose a deep learning-based solution for the problem of feature learning in one-class classification. The proposed method operates on top of a Convolutional Neural Network (CNN) of choice and produces descriptive features while maintaining a low intra-class variance in the feature space for the given class. For this purpose two loss functions, compactness loss and descriptiveness loss are proposed along with a parallel CNN architecture. A template matching-based framework is introduced to facilitate the testing process. Extensive experiments on publicly available anomaly detection, novelty detection and mobile active authentication datasets show that the proposed Deep One-Class (DOC) classification method achieves significant improvements over the state-of-the-art.
I. INTRODUCTION
One-class classification learns from a single concept’s examples while detecting alien classes at test time. DOC addresses this setting by fine-tuning deep features with compactness and descriptiveness objectives, using external multi-class data.
- Problem: One-class classification trains on examples from one concept, although testing may include objects from alien classes.Applications include novelty detection, anomaly detection, medical imaging, and mobile active authentication.
- Problem: Because alien-class samples are unavailable or costly to obtain, conventional one-class methods can perform poorly on real-world datasets.Prior methods achieved an Area Under the Curve of 60%-65% for CIFAR10.
- Approach: One-class transfer learning uses data from a different domain to engineer deep features specialized to the target one-class task.The framework fine-tunes features before classification with the strategy used for single-class training data.
- Approach: DOC starts from a pre-trained model, freezes initial features, and learns later feature and classification subnetworks using two losses.Compactness loss uses the provided one-class dataset, while descriptiveness loss uses an external multi-class reference dataset.
- Contributions: The paper proposes a deep feature-engineering scheme and reports state-of-the-art one-class classification performance across three tasks on three public datasets.The contributions target anomaly detection, novelty detection, and mobile active authentication.
II. RELATED WORK
Related one-class methods include generative models, boundary-based classifiers, novelty-detection approaches, and CNN or autoencoder feature extractors. The paper identifies a shared gap: existing strategies do not jointly produce compact and descriptive features.
- Classical methods: Earlier one-class methods estimate parametric generative models, construct separating boundaries with one-class SVM or SVDD, or use neural-network-based approaches.These methods model the training data or isolate it from an out-of-class region.
- Anomaly detection: Anomaly-detection research includes Gaussian-process modeling, KL-divergence maximization, and other methods summarized in the literature.The cited KL-divergence approach assumes the underlying distribution is a known Gaussian.
- Novelty detection: Novelty-detection methods model data distributions, improve tail modeling, or use null-space frameworks for single- and multiple-class settings.Prior work notes that the null-space method does not yield superior results in some settings.
- Mobile active authentication: Mobile active authentication uses enrolled user data as one-class training data, with some recent approaches using CNNs to extract face-image attributes.The objective is to continuously monitor user identity from enrolled data.
- Feature learning gap: Deep-layer activations and autoencoders can provide one-class features, but these approaches do not incorporate outside-world knowledge or jointly ensure compactness and descriptiveness.The paper states that none of the three discussed strategies produces features satisfying both properties.
III. DEEP ONE-CLASS CLASSIFICATION (DOC)
One-class feature learning must jointly produce compact representations for the target class and descriptive representations that distinguish alien classes. The proposed DOC formulation addresses this gap by optimizing both properties, motivated by failures of existing strategies.
- Useful one-class features must jointly maximize compactness within the target class and descriptiveness across concepts.Compactness reduces intra-class variation, while descriptiveness supports discrimination; neither property alone is sufficient.
- Existing strategies fail to guarantee both properties: pretrained features may lack compactness, while normal-only fine-tuning may lack discriminative ability.
- One-class classification learns from examples of a single concept while testing may include objects from alien classes.
- AlexNet features and two-class training with ImageNet objects do not sufficiently separate normal and abnormal chair images.
- Fine-tuning only on normal chairs can collapse representations because identical labels permit a zero-loss trivial solution.The resulting network has zero discriminative ability when abnormal chairs appear.
B. Proposed Loss Functions
DOC quantifies the two desired feature properties with complementary losses. Compactness is estimated from target-class feature variance, while descriptiveness is assessed through classification on an external multi-class reference dataset.
- DOC introduces measurable compactness and descriptiveness losses to optimize one-class features.
- Compactness loss uses feature-distribution variance, approximated from feature batches, because lower spread indicates greater compactness.
- Descriptiveness loss is the reference-dataset cross-entropy loss, with lower loss indicating a more descriptive representation.
- t-SNE visualization qualitatively shows better distinction between normal and abnormal images than the alternative strategies.
- The proposed feature learning uses a target one-class dataset for compactness and an external multi-class dataset for descriptiveness.
- The principles are intended to apply beyond AlexNet to other CNN architectures.
D. Architecture
The DOC training architecture uses tied reference and secondary CNNs, with compactness computed from target-class batches. The compactness loss is implemented with Euclidean distances and supports backpropagation.
- DOC uses two structurally identical CNNs, reference and secondary, with corresponding weights tied across the networks.
- Compactness loss is based on average similarity or mean squared intra-batch distance among samples from the same class.
- The proposed implementation and source code are associated with AlexNet, whose pretrained model and code are referenced by the paper.
- The loss input is a batch X={x_1,...,x_n} in R^n×k, where n is batch size and each x_i is a k-dimensional feature.
- For each sample, the method computes its distance from the mean of the remaining batch samples before averaging these distances.
- The compactness loss is proportional to sample feature variance, making it an inverse measure of feature-distribution compactness.
F. Training
DOC trains tied reference and secondary CNNs with compactness and descriptiveness objectives, then uses learned features for template-based one-class testing. Training stops after composite-loss convergence, while balancing the losses avoids trivial features.
- F. Training: The training architecture uses tied reference and secondary CNNs initialized from pretrained weights, with most layers frozen during fine-tuning.The two networks share corresponding weights, while training updates only the final layers.
- F. Training: Training uses a composite loss with λ = 0.1 and continues until convergence, which generally occurs around two epochs.The reported chair-class example shows composite loss stabilizing around 2 epochs, alongside the highest test accuracy after convergence.
- F. Training: Compactness and descriptiveness losses jointly assess within-class compactness and the learned feature’s ability to describe concepts in a reference dataset.Descriptiveness is evaluated using an external multiclass reference dataset, while compactness uses the one-class target dataset.
- F. Training: A large emphasis on compactness can produce trivial zero-output features, so both networks should remain present with greater prominence given to the reference-network loss.When λ = 0, the learned filters become zero and every input produces zero output.
- G. Testing: Testing extracts features with the secondary network, builds templates from target-training samples, and classifies test images using a matching rule and threshold.The experiments use Euclidean distance, while the classification rule assigns the target or other-class identity according to δ.
H. Memory Efficient Implementation
The implementation and evaluation setup address memory overhead and define the experimental protocol across three one-class classification tasks. Performance is measured with average ROC AUC under standardized train-test and template-generation procedures.
- H. Memory Efficient Implementation: The shared-weight reference and secondary networks require nearly twice the number of network parameters in memory.Dynamic frameworks such as PyTorch can alter the implementation to reduce this consumption, unlike static architectures such as Caffe.
- H. Memory Efficient Implementation: An alternative implementation uses one core network with compactness and descriptiveness branches, alternating reference and target batches through separate loss calculations.The descriptiveness loss is scaled by 1 − λ in this setup.
- H. Memory Efficient Implementation: The method is evaluated on abnormal image detection, single-class image novelty detection, and active authentication against state-of-the-art and CNN baselines.Additional task-specific methods are also reported for each experiment.
- H. Memory Efficient Implementation: Experiments generally use 50% of data for training, 40 randomly selected training samples for templates, and equal numbers of positive and alien test samples.For multiclass datasets, one class is treated as positive while all others are treated as alien.
- H. Memory Efficient Implementation: Performance is reported as average ROC AUC across available dataset classes, with Euclidean distance used to compare test images against stored templates.The reported figures average AUC values over multiple classes in each dataset.
B. Results
The method is evaluated on abnormal image detection, novelty detection, and active authentication using datasets and protocols tailored to each one-class task. Results report substantial improvements over prior methods, with performance varying by task and backbone.
- Abnormal Image Detection: Abnormal image detection uses normal PASCAL images for training and abnormal images from the 1001 Abnormal Objects Dataset for testing.The dataset covers six object classes, including Airplane, Boat, Car, Chair, Motorbike, and Sofa.
- Abnormal Image Detection: 4.5% improvement over the Adjusted Graphical Method is achieved by the proposed VGG-based method on abnormal image detection.The proposed framework improves AlexNet performance by nearly 14% on this dataset.
- One-Class Novelty Detection: Novelty detection evaluates one enrolled class against alien classes from Caltech 256, including both repeated-class and broader all-class experiments.The American Flag is used as the known class in the repeated experiment, while the robustness test evaluates 40 enrolled classes against the other 255 classes.
- One-Class Novelty Detection: 13% improvement over AlexNet and 9% over VGG16 are reported across Caltech 256 novelty detection experiments.Performance is approximately consistent across classes, although VGG16 binary CNN performance is within about 1% of the proposed method in this setting.
- Active Authentication: Active authentication uses face images from UMDAA-02, where one enrolled user is tested against the other users as alien classes.The dataset contains 48 users and substantial pose, illumination, and appearance variation.
- Active Authentication: 8% improvement with AlexNet and around 6% with VGG16 are reported over conventional CNN-based methods.The best performance is obtained by the proposed method based on VGG16.
C. Discussion
The discussion examines failure cases, reference-data usage, and template-count effects. Errors reflect visual ambiguity, while template requirements depend on how well the enrolled class is isolated.
- Analysis on Mis-classifications: False negatives occur when the American Flag is backgrounded or too close to identify clearly, while false positives share flag colors or waving-flag texture.At threshold δ = 0, mean detection scores are 0.0398 for American Flag images and 8.8884 for alien images.
- Using a Subset of the Reference Dataset: Using a subset of a large reference dataset is presented as practical because few training iterations can avoid over-fitting.The text warns that otherwise the resulting network can have poor generalization properties.
- Number of Training Iterations: Training beyond composite-loss convergence can produce inferior features through over-fitting when only a reference-data subset is used.The reported experiments converged around 2 epochs for all test cases.
- Effect of Number of Templates: Template count has little effect when novelty classes are well isolated, but more templates improve AUC for the more difficult active-authentication setting.The novelty-detection recognition rate was 98%, whereas active authentication benefits from additional templates because users occupy a smaller shared subspace.
D. Impact of Different Features
Later CNN feature layers generally improve abnormality-detection performance, while reference-dataset choice also affects the informativeness of learned features. The proposed method uses compactness and descriptiveness objectives and achieves state-of-the-art results across the reported test cases.
- Feature choice: VGG16 features from fc6, fc7, and fc8 achieved AUCs of 0.856, 0.956, and 0.969, respectively, with later layers performing better generally.The paper attributes this partly to better generalization in later layers and to compactness loss being minimized at fc8.
- Reference dataset: Using Places365 instead of ILVRC12 reduced VGG16 performance by 0.038, while Oxford flowers 102 reduced it by 0.026.The authors associate ILVRC12’s best performance with its larger number of non-trivial classes and greater content diversity.
- Method: The proposed method engineers class-specific yet generically discriminative features with compactness and descriptiveness losses on a CNN backbone.The architecture can be based on a CNN backbone of choice.
- Overall outcome: The method achieved state-of-the-art performance on abnormal image detection, novelty detection, and face-based mobile active authentication datasets.Experiments used AlexNet- and VGG16-based backbone architectures.
APPENDIX A: DERIVATIONS
The appendix derives the batch-variance loss as a scaled version of average sample variance and outlines its backpropagation through the feature representations. The supplied derivation presents the loss definition, its variance equivalence, and partial-derivative steps.
- Variance equivalence: The derivation concludes that l_b = βσ^2, where β = n^2k/(n−1)^2 and σ^2 is average sample variance.Thus, the batch-variance loss is a scaled version of sample variance.
- Loss definition: Batch-variance loss is defined using centered feature vectors z_i = x_i − m_i and their inner products.The supplied derivation writes the loss as l_b = 1/(nk) times the summed squared centered representations.
- Backpropagation: Backpropagation is obtained by taking partial derivatives of l_b with respect to x_ij and applying the chain rule.The supplied passage reports a resulting derivative term of −1/(n−1).
APPENDIX B : DETAILED NETWORK ARCHITECTURES
The proposed method is adapted to AlexNet and VGG16 using a parallel network with shared convolutional and fully connected weights. Target and reference images jointly provide the losses during training.
- Architectures: Figure 9 shows adaptations of the proposed method to AlexNet and VGG16, the architectures used throughout the experiments.The supplied passage identifies the two CNN backbones but does not describe their full layer configurations.
- Parallel training: Each training step feeds one target-dataset image and one reference-dataset image into parallel branches with shared weights.The branches evaluate cross-entropy loss and batch-variance loss.
- Optimization: Training uses stochastic gradient descent with learning rate 5×10^-5 and weight decay 0.0005.These settings are reported for all experiments.