Env-Aware Anomaly Detection Ignore Style Changes Stay True to Content Stefan Smeu

2025-04-29 0 0 4.26MB 11 页 10玖币
侵权投诉
Env-Aware Anomaly Detection: Ignore Style Changes,
Stay True to Content!
Stefan Smeu
Bitdefender, Romania
University of Bucharest
ssmeu@bitdefender.com
Elena Burceanu
Bitdefender, Romania
eburceanu@bitdefender.com
Andrei Liviu Nicolicioiu
MPI for Intelligent Systems, Tübingen
andrei.nicolicioiu@tuebingen.mpg.de
Emanuela Haller
Bitdefender, Romania
ehaller@bitdefender.com
Abstract
We introduce a formalization and benchmark for the unsupervised anomaly detec-
tion task in the distribution-shift scenario. Our work builds upon the iWildCam
dataset, and, to the best of our knowledge, we are the first to propose such an
approach for visual data. We empirically validate that environment-aware methods
perform better in such cases when compared with the basic Empirical Risk Mini-
mization (ERM). We next propose an extension for generating positive samples for
contrastive methods that considers the environment labels when training, improving
the ERM baseline score by 8.7%.
1 Introduction and related work
Identifying and following novelty [
31
] is an intriguing human ability that could trigger scientific
discoveries [
21
]. Machine learning models that can mimic this behavior and detect novelty when
facing unfamiliar situations are vital for fields like video surveillance [
15
], intrusion detection in
cybersecurity [
22
], manufacturing inspection [
30
], and many others [
40
]. Anomaly Detection (
AD
)
is an umbrella term [
48
] for methods whose goal is to identify samples that deviate from an assumed
notion of normality. Normals and anomalies are supposed to come from different distributions. But
how and up to what limit do they differ? Defining what changes constitute anomalies and what
changes should be ignored is essential.
Deep learning methods proved their representation power in multiple fields [
13
,
36
,
37
,
10
,
16
,
11
,
7
,
47
] and were assumed to become invariant to irrelevant aspects under the big data regime. Yet,
recent works proved that these representations are susceptible to unwanted biases [
4
] and prone to
finding shortcuts [
14
], relying on spurious features while failing to capture relevant aspects of the
data. Consequently, those models exhibit poor performance when dealing with slightly different,
out-of-distribution (OOD) settings, where spurious features are no longer informative. Avoiding
spurious correlations is a challenging problem, impossible to solve in the in-distribution (ID) training
setup [
42
]. Recent works [
33
,
34
,
18
,
24
,
27
,
12
,
2
,
49
] tackle this problem by using an informative
process that splits the dataset into multiple environments, extracting additional information. Except
for AnoShift [
12
], which focuses on network traffic data, all those benchmarks and approaches
address supervised scenarios.
Equal contribution
Workshop on Distribution Shifts, 36th Conference on Neural Information Processing Systems (NeurIPS 2022).
arXiv:2210.03103v2 [cs.CV] 23 Nov 2022
Figure 1: OOD Content and Style Setup. a) Dataset: The samples’ input distribution varies on the
Content and Style axis. In training, we have only normal data, while in the testset we also have a
3rd (anomalous) class. b) Step 1: Pretraining algos learn its parameters using the training data, with
labels for the two normal classes. c) Step 2: AD methods use the embeddings learned in Step 1 to
transform their input.
We follow the same line to enable robust AD and exploit the multi-environments approach in
unsupervised anomaly detection from visual data. Moreover, we formalize the notion of anomaly
under the distribution shift paradigm.
To summarize, our main contributions are the following:
We propose a benchmark for unsupervised anomaly detection in images, focusing on real-
world cases, where the input distribution is different in sub-groups of data. We formally
emphasize the differences between anomaly detection and classical (supervised) distribution
shift analysis.
We validate that shallow AD methods can benefit from working on top of embeddings
pretrained using environment-aware methods (like Fish, IRM, LISA). We prove consistent
improvements over ERM pretraining over a wide range of AD methods.
We introduce a way of adjusting the contrastive methods to be aware of multiple environ-
ments, making them more robust in out-of-distribution setups. Empirical validation over
MoCo v3, shows an 8.7% increase in ROC-AUC w.r.t. ERM, on iWildsCam dataset, in the
anomaly detection setup.
2 Generalization facets for Anomaly Detection
Latent factorization of the data
It is useful to formalize the data samples
x
as being determined by
two latent factors: Content and Style [
32
,
46
]. The
Content
should determine the task at hand, i.e.,
it should be the cause of the desired target. At the same time, the
Style
could represent unrelated
2
Figure 2: Positive samples in contrastive learning. In EA-MoCo, our env-aware baseline over Mo-
Cov3, for the positive samples we use: the basic augmented anchor (left) and the closest sample from
another, randomly chosen, environment (right). We compute distances over representations obtained
with an diffusion based autoencoder, learned under ERM, over samples from all environments.
features spuriously correlated with the target. Inferring these latent factors is an extremely difficult
problem, seen as a goal of representation learning [
32
]. It is impossible in the unsupervised setting
without additional inductive biases, or other information [
17
,
29
] and it is outside our scope. Instead,
we start from a weaker assumption, that we have data in which only the
Style
is changed. We aim
to use this factorization in AD to highlight directions toward building methods that are robust to
irrelevant changes (involving Style) while capable of detecting relevant changes (involving Content).
Environments
We call domains or environments [
18
,
2
] sub-groups of the data, each with a different
distribution, but all respecting some common basic rules. Namely, the Content is shared, but Style or
relations involving Style change. Examples of domains include pictures taken indoor vs. outdoor
[
51
], or in different locations [
5
], real photos vs sketches [
25
], or images of animals with changing
associations in each environments [
26
]. Our goal is to be robust to the Style differences between
different environments while identifying the Content changes as anomalies.
2.1 Out-of-distribution regimes
When dealing with real-world data, the test distributions usually differ from the training ones,
encountering changes in Style or/and Content. We provide next an in-depth characterization of
possible scenarios for AD in those regimes, linking them to common methods that work in each
category for supervised tasks. For explicit examples and details, see Appendix A.2.
A. ID setting
The default paradigm in Machine Learning, both in supervised and unsupervised
learning. Although this is the default paradigm, the usual assumption that train and test data come from
the same distribution is very strong and almost never true for real-world datasets [9, 45, 12, 27, 18].
B. Style OOD
Most works that develop methods robust to some (i.e. Style) distribution changes
reside in this category [
43
,
2
,
19
,
49
]. Environments have differences based on Style, but have the
same Content and the goal is to learn representations that are invariant across environments.
C. Content OOD
The assumption here is that environments contain changes in distribution that are
always relevant (i.e. changes in Content) for the task and should be noticed. Methods in this category
must detect such changes while optionally performing another basic task. Anomaly, novelty, or OOD
detection methods work in this regime [48].
D. Style and Content OOD
Here, environments bring changes in both Content and Style. We argue
that this is the most realistic setting and it is mainly unaddressed in the anomaly detection literature.
An ideal anomaly detection method will only detect Content anomalies, while being robust to Style
changes. Our main analyses and experiments are performed in this setting, showing the blind spots of
current approaches and possible ways forward.
We formalize and detail the distribution shifting scenarios in Appendix A.2. To the best of our
knowledge, we are the first to cover this topic for anomaly detection in particular and for unsupervised
learning in general.
3
摘要:

Env-AwareAnomalyDetection:IgnoreStyleChanges,StayTruetoContent!StefanSmeuBitdefender,RomaniaUniversityofBucharestssmeu@bitdefender.comElenaBurceanuBitdefender,Romaniaeburceanu@bitdefender.comAndreiLiviuNicolicioiuMPIforIntelligentSystems,Tübingenandrei.nicolicioiu@tuebingen.mpg.deEmanuelaHallerBit...

展开>> 收起<<
Env-Aware Anomaly Detection Ignore Style Changes Stay True to Content Stefan Smeu.pdf

共11页,预览3页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:图书资源 价格:10玖币 属性:11 页 大小:4.26MB 格式:PDF 时间:2025-04-29

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 11
客服
关注