Traditional anomaly detection operates under a clean, mathematical assumption: "normal" behavior forms a dense cluster in a feature space, and "anomalies" are the sparse outliers far from that cluster. However, when applied to complex real-world environments, this assumption quickly falls apart. A person sprinting is perfectly normal on an athletics track, but highly anomalous inside a shopping mall (Liu et al.). A vehicle coming to a complete stop is expected at a red light, but represents a critical hazard in the middle of a highway (Rosenhahn et al.).
As Ionescu et al. and Ravanbakhsh et al. observe, abnormality is rarely an intrinsic property of an action or object; instead, it is strictly a function of the surrounding environmental context. To handle this relativity, researchers have shifted toward context-dependent anomaly detection—architectures that dynamically adjust their decision boundaries based on the scene.
Shifting Boundaries via Explicit Scene Conditioning
Why do standard models fail when moving between environments? Many deep learning systems rely on global memory pools or reconstruction baselines trained on a broad mix of normal data. However, Liu et al. point out in Learning Appearance-motion Normality for Video Anomaly Detection that these global pools average out the unique constraints of individual scenes. By trying to learn a single, universal definition of normality, the model becomes blind to localized context.
To fix this, modern frameworks inject scene context directly into the model's decision-making process. Instead of asking "Is this action normal?", the model evaluates "Is this action normal given this specific background?"
Standard Approach:
[ Object / Motion Features ] ──> [ Global Normality Model ] ──> Anomaly Score
Context-Dependent Approach:
[ Object / Motion Features ] ──┐
├──> [ Conditional Model ] ──> Context-Aware Score
[ Scene / Background Prior ] ──┘
For instance, in A New Comprehensive Benchmark for Semi-supervised Video Anomaly Detection and Anticipation, Cao et al. et al. introduced a framework that explicitly conditions a generative model (a conditional variational autoencoder) on a static image of the environment's background. By treating the background as an explicit prior, the model learns to map spatial constraints directly to expected motion patterns, making it easy to flag unauthorized vehicle movement in pedestrian zones.
Similarly, Liu et al. developed a Prompt-based Feature Mapping Framework (PFMF) that extracts environment-specific vectors from pre-trained scene classification models. These vectors act as contextual prompts that condition feature transformations, ensuring that abnormality is always defined relative to the physical setting of the video.
Meta-Learning for Few-Shot Scene Adaptation
Conditioning works well if the model has already seen the environment during training. But what happens when a model is deployed in a completely unfamiliar location? Retraining a massive neural network from scratch for every new camera angle or factory floor is computationally impossible.
The solution is to treat scene adaptation as a meta-learning problem: teaching the model how to rapidly grasp a new scene's baseline of normality from just a few frames of video.
Meta-Training Phase:
[ Scene A ] ──> Learn Baseline ──┐
[ Scene B ] ──> Learn Baseline ──┼──> Learn the *process* of rapid adaptation
[ Scene C ] ──> Learn Baseline ──┘
Deployment Phase:
[ New Scene X ] + [ 5 Reference Frames ] ──> Dynamic Parameter Shift ──> Ready
In Learning Normal Dynamics in Videos With Meta Prototype Network, Chen et al. et al. addressed this by proposing a Meta Prototype Unit (MPU). Instead of relying on a static memory bank, the MPU dynamically updates a set of real-time "normality prototypes" on the fly, allowing the model to adapt to new environments at a blistering 166.8 FPS.
In a similar vein, Lu et al. formulated few-shot scene-adaptive anomaly detection by training models to "learn to learn" environmental baselines. By exposing the network to a wide variety of scenes during meta-training, it learns to extract the underlying statistical structure of a new environment from a tiny support set, shifting its internal parameters to fit the new context without catastrophic forgetting.
Capturing Semantic and Spatial Incongruence
Context isn't just about the visual background; it is also about the relationships between objects and their expected locations. An anomaly can occur when an object is entirely normal on its own but completely out of place semantically. Weinshall et al. formalized this concept as an incongruent event—a situation where a general classifier (which recognizes the object) and a specific classifier (which understands the scene context) disagree.
To capture these nuances, models must integrate high-level semantic relationships. Choi et al. demonstrated in Exploiting hierarchical context on a large database of object categories that modeling the statistical likelihood of object co-occurrence and spatial positioning using tree-structured graphical models allows systems to detect "out-of-context" anomalies (such as a car appearing on a sidewalk or a boat in a swimming pool).
In modern video analysis, Sun et al. achieved this by integrating scene-level semantic features directly into object encoders in Hierarchical Semantic Contrast for Scene-aware Video Anomaly Detection. By contrasting hierarchical semantics, their model prevents background information from being discarded as noise. Instead, the model actively checks whether an object's behavior violates local spatial constraints, transforming anomaly detection from a low-level pixel reconstruction task into a high-level contextual reasoning process.