Abstract
A common assumption of novelty detection is that the distribution of both "normal" and "novel" data are static. This, however, is often not the case - for example scenarios where data evolves over time or scenarios in which the definition of normal and novel depends on contextual information, both leading to changes in these distributions. This can lead to significant difficulties when attempting to train a model on datasets where the distribution of normal data in one scenario is similar to that of novel data in another scenario. In this paper we propose a context-aware approach to novelty detection for deep autoencoders to address these difficulties. We create a semi-supervised network architecture that utilises auxiliary labels to reveal contextual information and allow the model to adapt to a variety of contexts in which the definitions of normal and novel change. We evaluate our approach on both image data and real world audio data displaying these characteristics and show that the performance of individually trained models can be achieved in a single model.
Introduction
In traditional novelty detection, a model learns a representation of "normal" data and flags deviations as "novel." However, in many real-world scenarios, the definition of normality is relative. For instance, environmental sounds or industrial sensor readings may vary significantly based on the operating mode or external conditions. When these distributions overlap—where data considered normal in one context appears novel in another—standard static models struggle, leading to high false-alarm rates.
The authors introduce CANDE (Context-Aware Novelty Detection autoEncoder), a framework designed to handle such distribution shifts by incorporating contextual metadata. By conditioning a single model on auxiliary labels, CANDE can adapt its internal representation of normality to match the current scenario.
Methodology
The core of the CANDE architecture is a Deep Autoencoder enhanced with context-aware conditioning. The model uses Feature-wise Linear Modulation (FiLM) to integrate contextual information across its layers.
FiLM Conditioning
Instead of simply concatenating context labels to the input, CANDE employs FiLM to apply a mathematical transformation to the activations of every layer. As shown in Figure 1, the activations $x'$ are scaled by $\gamma_k$ and shifted by $\beta_k$, where these parameters are derived from the context vector $h_c$. This allows the context to influence feature extraction at multiple levels of abstraction.
Contextual Encoders
The context vector $h_c$ can be generated in two primary ways:
- One-hot Encoding: A simple categorical ID representing the context.
- Contextual Embeddings: A more sophisticated approach where a separate context discriminator is trained. Features are extracted from the discriminator's penultimate layer and averaged to create a rich "fingerprint" for each context, as illustrated in Figure 2.
Experimental Evaluation
The approach was tested on two datasets:
- MNIST (Synthetic Context): Digits were partitioned into three contexts with overlapping "normal" sets (e.g., 0-2 normal in Context 1, 3-5 in Context 2). Standard autoencoders failed due to the contradictory labels (average rank 6.0), while CANDE with one-hot conditioning nearly matched the performance of specialized individual models (average rank 1.33).
- MIMII (Industrial Audio): This dataset contains sounds from four machine types across 16 unique contexts. CANDE models, particularly those using 64-dimensional learned embeddings, consistently outperformed unconditioned benchmarks and maintained robustness against background noise.
Conclusion
CANDE demonstrates that a single, context-aware model can achieve the performance of multiple specialized models. By using FiLM conditioning and learned contextual embeddings, the system effectively manages overlapping data distributions. Future work will focus on handling gradual concept drift and adapting to entirely unseen contexts at test time.
Summary updated