Title: Projection Regret: Reducing Background Bias for Novelty Detection via Diffusion Models
Venue: NeurIPS 2023
Accepted: yes
Keywords: Novelty detection

out-of-distribution detection

consistency models

diffusion models

score-based generative models
Abstract: Novelty detection is a fundamental task of machine learning which aims to detect abnormal (*i.e.* out-of-distribution (OOD)) samples. Since diffusion models have recently emerged as the de facto standard generative framework with surprising generation results, novelty detection via diffusion models has also gained much attention. Recent methods have mainly utilized the reconstruction property of in-distribution samples. However, they often suffer from detecting OOD samples that share similar background information to the in-distribution data. Based on our observation that diffusion models can *project* any sample to an in-distribution sample with similar background information, we propose *Projection Regret (PR)*, an efficient novelty detection method that mitigates the bias of non-semantic information. To be specific, PR computes the perceptual distance between the test image and its diffusion-based projection to detect abnormality. Since the perceptual distance often fails to capture semantic changes when the background information is dominant, we cancel out the background bias by comparing it against recursive projections. Extensive experiments demonstrate that PR outperforms the prior art of generative-model-based novelty detection methods by a significant margin.

Projection Regret: Reducing Background Bias for Novelty Detection via Diffusion Models

Abstract

Novelty detection is a fundamental task of machine learning which aims to detect abnormal ( i.e. out-of-distribution (OOD)) samples. Since diffusion models have recently emerged as the de facto standard generative framework with surprising generation results, novelty detection via diffusion models has also gained much attention. Recent methods have mainly utilized the reconstruction property of in-distribution samples. However, they often suffer from detecting OOD samples that share similar background information to the in-distribution data. Based on our observation that diffusion models can project any sample to an in-distribution sample with similar background information, we propose Projection Regret (PR) , an efficient novelty detection method that mitigates the bias of non-semantic information. To be specific, PR computes the perceptual distance between the test image and its diffusion-based projection to detect abnormality. Since the perceptual distance often fails to capture semantic changes when the background information is dominant, we cancel out the background bias by comparing it against recursive projections. Extensive experiments demonstrate that PR outperforms the prior art of generative-model-based novelty detection methods by a significant margin.

1 Introduction

Novelty detection [1], also known as out-of-distribution (OOD) detection, is a fundamental machine learning problem, which aims to detect abnormal samples drawn from far from the training distribution ( i.e. , in-distribution). This plays a vital role in many deep learning applications because the behavior of deep neural networks on OOD samples is often unpredictable and can lead to erroneous decisions [2]. Hence, the detection ability is crucial for ensuring reliability and safety in practical applications, including medical diagnosis [3], autonomous driving [4], and forecasting [5].

The principled way to identify whether a test sample is drawn from the training distribution p data ( x ) or not is to utilize an explicit or implicit generative model . For example, one may utilize the likelihood function directly [6] or its variants [7, 8] as an OOD detector. Another direction is to utilize the generation ability, for example, reconstruction loss [9] or gradient representations of the reconstruction loss [10]. It is worth noting that the research direction of utilizing generative models for out-of-distribution detection has become increasingly important in recent years as generative models have been successful across various domains, e.g., vision [11, 12] and language [13], but also they have raised various social issues including deepfake [14] and hallucination [15].

Among various generative frameworks, diffusion models have recently emerged as the most popular framework due to their strong generation performance, e.g., high-resolution images [16], and its wide applicability, e.g., text-to-image synthesis [11]. Hence, they have also gained much attention as an attractive tool for novelty detection. For example, Mahmood et al. [17] and Liu et al. [18] utilize the reconstruction error as the OOD detection metric using diffusion models with Gaussian noises [17] or checkerboard masking [18]. Somewhat unexpectedly, despite the high-quality generation results,

<latexi sh

1_b

64="ZTdzj mMwFfrUg+OB

QKJ

q

>A

ESH

c

VN

9

W

8

I

v

Gy

Y

C

n

X

p

/

3

D

Lk

7

2

o

u

P

R

5

0

<latexi sh

1_b

64="D

R9

/gMYGj zL+

Z

m8

Xo

>A

E

3

cfVP

N

FH

U

IO

p

Q

k

C

w

W

S

v

T

J

u

d

B

n2

r

5

q

7

K

y

0

<latexi sh

1_b

64="oP0Sy

R

zuM7

nHL

>

DB

VJN

9

F2

r5ICT

ZU

K

G

X

pv mq

W

O

/8

w

Y

+

f

3

Q

d

<latexi sh

1_b

64="n+fpQ

r2k7

9dq ow

3

O

P

>A

C

H

c

V

EF

Zu

j

Yy

IG

NDg5

ML

J

W

S

X

U

T

/m

K

8

0

z

v

B

R

<latexi sh

1_b

64="qgM7wBp

L

R3FfO5

C

j/c

>A

nH

V

9

EJ

u

8

z

mIZ

y

r

0

o

W

k

GT

U

2

P

+

S

D

v

K

N

d

Y

X

Q

<latexi sh

1_b

64="PE

j

F

n2W+kZr

I

Jyz0B

mcw

>A

3

fV

L

N

p

Ud

C

SK

u

q

QG

8

XM

H

Y

O

D

7

9

/

R

o

T

g

5

v

<latexi sh

1_b

64="rd9Xo

Y

nu/5

y

R

f

w

>A

D

H

c

VJ

M

F

T

8

B

Wq

N

k+g

p

I

z

mvP

G

KL

E

0

7

3j

2

S

Q

Z

<latexi sh

1_b

64="VZE

gH

BK39C

L

F

rcQY

A

>

Dd

f

J

N

P

o

O

S

m

n

R

W

w

U

p

q

+

k

ju2

z/5M

8G

y

vX

0

I

T

7

<latexi sh

1_b

64="3DAH

LWy2

+Yj7

q

Cm zS

E

>

R

cdVN

9

8

IU

F

o

KG

g

n

p

0

u

r

O

P

f

wZk

T

J

X

/

v

Q

B

M

5

<latexi sh

1_b

64="

wX

KM9

q25

Ip

Sk

J

Y0

>A

ERn cdVPL

N

F

BU

G

o

y

j

C

r

Z

u

g+

/

H

W7

QO

8

m

3

T

f

D

<latexi sh

1_b

64="D

R9

/gMYGj zL+

Z

m8

Xo

>A

E

3

cfVP

N

FH

U

IO

p

Q

k

C

w

W

S

v

T

J

u

d

B

n2

r

5

q

7

K

y

0

<latexi sh

1_b

64="

L

p

V

mqv

R

9oz

Y

u

wH

>A

D

3

c

N

EF

2

+U

C

GI

BQ

k

X

rZSn

T

d

8

P

O

5

0/

W

f

K

y

M

g

J

j

7

<latexi sh

1_b

64="Jn jyu

UGH0

pDAq

w

/c+3

>

V

L

9N

EF

z

P

B

WIR

r

K

o5

Q

S

k

f

T

O

2

m

v

M

X

d

Z

Y

C

8

g

7

<latexi sh

1_b

64="Ak m3jq2y

DF

c

z7Y

Q

VU

>

ER

f

N

9

HW

8pX

S

G0

B

J

5w

I

d

K

g+

/

M

nL

o

P

u

v

Z

O

C

r

T

<latexi sh

1_b

64="OCv oA0QR7PTKw3

pFG

SuZ

I

>

E

n

9

J

X

y

k

j

q

2

LHWm r/Y

dM

+

8

g

U

z

5

D

B

t

<latexi sh

1_b

64="IAF

qKSo

E

7M

D

Z3yuYH

Q

>

m

cfVL

N

X

pz

+

R

g

C

G2

O

W

0

vr

P8

Uj

d

k

/

T

9

5

w

J

n

B

<latexi sh

1_b

64="NTLup5

jZ+

90

oYUM/r

Jq

g

>A

D

X

c

V

FB2

zGv

C

R

O

I

E

K

w

H8

k

S

3

W

d

y

f

n

7

m

P

Q

<latexi sh

1_b

64="

T

dA

f

8zNg

O0Z

HPW

j

>

c

VL

FB2

Gv

C

E

Y

K

p

U

r+

k

/

S

3

M

59y

u

n

7

m

I

Q

x

0

x

T

In-distribution

(Church)

Out-of-distribution

(Bridge)

x

t

f

θ

Π

t

θ

(

x

0

)

(a) Projection

Π

θ

d

(

,

) = 0

.

278

d

(

,

) = 0

.

244

In-distribution

Out-of-distribution

S

PR

= 0

.

278

-

0

.

244 = 0

.

034

S

PR

= 0

.

381

-

0

.

387 =

-

0

.

006

d

(

,

) = 0

.

381

d

(

,

) = 0

.

387

x

x

′

∼

Π

t

α

θ

(

x

)

Π

t

β

θ

(

x

′

)

Π

β

θ

(

x

)

+

N

(

0

, t

2

α

I

)

+

N

(

0

, t

2

β

I

)

f

θ

(b) Projection Regret S PR

their detection performance still lags behind other generative models, e.g. , energy-based models [19]. We find that these undesired results are related to the background bias problem: the reconstruction error is often biased by non-semantic ( i.e. , background) information. Namely, the prior methods often struggle to detect out-of-distribution images with similar backgrounds ( e.g. , CIFAR-100 images against CIFAR-10 ones).

Contribution. To reduce the background bias, we first systemically examine the behavior of diffusion models. We observe that the models can change semantic information to in-distribution without a major change to background statistics by starting from an intermediate point of the diffusion process and reversing the process, which is referred to as projection in this paper (see Figure 1a). Based on this observation, we suggest using the perceptual distance [20] between a test image and its projection to detect whether the test image is out-of-distribution.

Although our projection slightly changes the background statistics, the perceptual distance sometimes fails to capture semantic differences when the background information is dominant over the semantics. To resolve this issue, we propose Projection Regret , which further reduces the background bias by canceling out the background information using recursive projections (see Figure 1b). We also utilize an ensemble of multiple projections for improving detection performance. This can be calculated efficiently via the consistency model [21], which supports the reverse diffusion process via only one network evaluation.

Through extensive experiments, we demonstrate the effectiveness of Projection Regret (PR) under various out-of-distribution benchmarks. More specifically, PR outperforms the prior art of diffusionbased OOD detection methods with a large margin, e.g. , 0 . 620 → 0 . 775 detection accuracy (AUROC) against a recent method, LMD [18], under the CIFAR-10 vs CIFAR-100 detection task (see Table 1). Furthermore, PR shows superiority over other types of generative models (see Table 2), including EBMs [22, 23, 24] and VAEs [25]. We also propose a perceptual distance metric using underlying features ( i.e. , feature maps in the U-Net architecture [26]) of the diffusion model. We demonstrate that Projection Regret with this proposed metric shows comparable results to that of LPIPS [20] and outperforms other distance metrics, e.g. , SSIM [27] (see Table 5).

To sum up, our contributions are summarized as follows:

We find that the perceptual distance between the original image and its projection is a competitive abnormality score function for OOD detection (Section 3.1).

We also propose Projection Regret (PR) that reduces the bias of non-semantic information to the score (Section 3.2) and show its efficacy across challenging OOD detection tasks (Section 4.2).

We also propose an alternative perceptual distance metric that is computed by the decoder features of the pre-trained diffusion model (Section 4.3).

2 Preliminaries

2.1 Problem setup

Given a training distribution p data ( x ) on the data space X , the goal of out-of-distribution (OOD) detection is to design an abnormality score function S ( x ) ∈ R which identifies whether x is drawn from the training distribution ( i.e. , S ( x ) ≤ τ ) or not ( i.e. , S ( x ) > τ ) where τ is a hyperparameter. For notation simplicity, ' A vs B ' denotes an OOD detection task where A and B are in-distribution (ID) and out-of-distribution (OOD) datasets, respectively. For evaluation, we use the standard metric, area under the receiver operating characteristic curve (AUROC).

In this paper, we consider a practical scenario in a generative model p θ ( x ) pre-trained on p data ( x ) is only available for OOD detection. Namely, we do not consider (a) training a detector with extra information (e.g., label information and outlier examples) nor (b) accessing internal training data at the test time. As many generative models have been successfully developed across various domains and datasets in recent years, our setup is also widely applicable to real-world applications as well.

2.2 Diffusion and consistency models

Diffusion models (DMs). A diffusion model is defined over a diffusion process starting from the data distribution x 0 ∼ p data ( x ) with a stochastic differential equation (SDE) and its reverse-time process can be formulated as probability flow ordinary differential equation (ODE) [28, 29]:

where t ∈ [0 , T ] , T > 0 is a fixed constant, µ ( · , · ) and σ ( · ) are the drift and diffusion coefficients, respectively, and w t is the standard Wiener process. The variance-exploding (VE) diffusion model learns a time-dependent denoising function D θ ( x t , t ) by minimizing the following denoising score matching objective [29]:

where σ t depends on σ ( t ) . Following the practice of Karras et al. [29], we set σ t = t and discretize the timestep into ϵ = t 0 < t 1 < ... < t N = T for generation based on the ODE solver.

Consistency models (CMs). A few months ago, Song et al. [21] proposed consistency models , a new type of generative model, built on top of the consistency property of the probability flow (PF) ODE trajectories: points ( x t , t ) on the same PF ODE trajectory map to the same initial point x ϵ , i.e. , the model aims to learn a consistency function f θ ( x t , t ) = x ϵ . This function f θ can be trained by trajectory-wise distillation. The trajectory can be defined by the ODE solver of a diffusion model ( i.e. , consistency distillation) or a line ( i.e. , consistency training). For example, the training objective for the latter case can be formulated as follows:

where d is the distance metric, e.g. , ℓ 2 or LPIPS [20], and θ -is the target parameter obtained by exponential moving average (EMA) of the online parameter θ . The main advantage of CMs over DMs is that CMs support one-shot generation. In this paper, we mainly use CMs due to their efficiency, but our method is working with both diffusion and consistency models (see Table 6).

3 Method

In this section, we introduce Projection Regret (PR), a novel and effective OOD detection framework based on a diffusion model. Specifically, we utilize diffusion-based projection that maps an OOD image to an in-distribution one with similar background information (Section 3.1) and design an abnormality score function S PR that reduces background bias using recursive projections (Section 3.2).

3.1 Projection

Although previous OOD detection methods based on generative models have been successfully applied to several benchmarks [8, 17], e.g. , CIFAR-10 vs SVHN, they still struggle to detect out-ofdistribution samples of similar backgrounds to the in-distribution data ( e.g. , CIFAR-10 vs CIFAR-100). We here examine this challenging scenario with diffusion models.

<latexi sh

1_b

64="9mrRB5

2FI

vPd

/L

C

>A

EUn

c

V

MwG

3T

q

OD

J

K

p

Sk

Z

zY

j

X

o

N

H

8

u

W

7

y

+

0

Q

f

g

<latexi sh

1_b

64="fEU8+z

QYvTj mrK5

Jnd

GS

>A

R

c

VN

9

0

B

uHI

y

g

k

o

F

X

/

DZ

CP

3

Ow

7

2

M

L

q

p

W

<latexi sh

1_b

64="

wN

gI

/

VO

k

ZqH

X

>A

ERn cd

9

0

BUr

Su

Ky

o

CIFAR100

(Out-of-distribution)

SVHN

(Out-of-distribution)

CIFAR10

(In-distribution)

Original images

Full-step Projection

Single-step Projection

Π

t

(

x

)

π

t

(

x

)

x

210

B

θ

θ

10

-

2

10

-

1

10

0

10

1

0

.

40

0

.

45

0

.

50

0

.

55

0

.

60

0

.

65

0

.

70

AUROC

CIFAR-10 vs CIFAR-100

S

LPIPS

Π

S /lscript

2

Π

S

LPIPS

π

S /lscript

2

π

10

-

2

10

-

1

10

0

10

1

0

.

0

0

.

2

0

.

4

0

.

6

0

.

8

1

.

0

AUROC

CIFAR-10 vs SVHN

S

LPIPS

Π

S /lscript

2

Π

S

LPIPS

π

S /lscript

2

π

t

t

Given discrete timesteps ϵ = t 0 < t 1 < . . . < t N = T , we first suggest two projection schemes, π t i θ ( x , z ) and Π t i θ ( x , z ) , by reversing the diffusion process until t = t i -1 and t = ϵ , respectively, starting from the noisy input x t i := x + t i z . Note that π θ can be implemented by only the diffusionbased denoising function D θ while Π θ can be done by multi-step denoising with D θ or single-step generation with the consistency model f θ as described in Section 2.2. We refer to π θ and Π θ as single-step and full-step projections, respectively, and the latter is illustrated in Figure 1a. We simply use π t i θ ( x ) and Π t i θ ( x ) with z ∼ N ( 0 , I ) unless otherwise stated.

We here systemically analyze the projection schemes π t i θ and Π t i θ with the denoising function D θ and the consistency function f θ , respectively, trained on CIFAR-10 [30] for various timesteps t ∈ [ ϵ, T ] . Note that both projections require only one network evaluation. Figure 2 shows the projection results of CIFAR-100 [30] and SVHN [31] OOD images where t i ≈ 1 . 09 ( i.e. , i = 7 , N = 17 , and T = 80 ). One can see semantic changes in the images while their background statistics have not changed much. Furthermore, the shift from the in-distribution CIFAR-10 dataset is less drastic than the OOD dataset. We also observe that the projections (i) do not change any information when t i is too small, but (ii) generate a completely new image when t i is too large, as shown in Figure 1a. Moreover, we observe that the single-step projection π t i θ outputs more blurry image than the full-step projection Π t i θ .

Based on these observations, we propose projection-based OOD detection scores by measuring the reconstruction error between an input x and its projection with a distance metric d ( · , · ) :

For the distance d , in this paper, we use the common metrics in computer vision: the ℓ 2 distance and the perceptual distance, LPIPS [20]. One may expect that the latter is fit for our setup since it focuses on semantic changes more than background changes. Other choices are also studied in Section 4.3.

C

G

z

vF

J

mD

Y

f8

P

3

j5

7

T

2

Q

M

L

p

W

+

We report the AUROC on the CIFAR-10 vs (CIFAR-100 or SVHN) tasks in Figure 3. As expected, the perceptual distance is better than the ℓ 2 distance when t i is not too small. Our proposed metric, S LPIPS Π shows the best performance in the intermediate time step and this even exceeds the performance of diffusion-model-based OOD detection methods [17, 18] in the CIFAR-10 vs CIFAR-100 task. Furthermore, the performance of S LPIPS π degrades in larger time step due to the blurry output of the diffusion model D θ . On the other hand, S ℓ 2 Π and S ℓ 2 π consistently struggle to detect the CIFAR-100 dataset and even output smaller abnormality scores on the SVHN dataset.

3.2 Projection Regret

While the perceptual distance performs better than the ℓ 2 distance, it may fail to capture the semantic change when background information is dominant. For example, we refer to Figure 1b for the failure case of S LPIPS Π . While the projection of the OOD ( i.e. , bridge) data shows in-distribution ( i.e. , church) semantics, the area of the changed region is relatively small. Hence, S LPIPS Π outputs a lower detection score for the OOD data than the in-distribution data.

To reduce such a background bias, we propose Projection Regret , a novel and effective detection method using recursive projections inspired by the observations in Section 3.1: (i) a projected image x ′ = Π t α θ ( x ) can be considered as an in-distribution image with a similar background to the original image x , and (ii) its recursive projection Π t β θ ( x ′ ) may not change semantic information much because of (i). Therefore, the change in background statistics from x to Π t β θ ( x ) would be similar to that from x ′ to Π t β θ ( x ′ ) , in other words, d ( x , Π t β θ ( x )) ≈ semantic difference + d ( x ′ , Π t β θ ( x ′ )) .

Based on this insight, we design our Projection Regret score, S PR , as follows:

where α and β are timestep hyperparameters. We mainly use LPIPS [20] for the distance metric d . It is worth noting that Projection Regret is a plug-and-play module: any pre-trained diffusion model θ and any distance metric d can be used without extra training and information. The overall framework is illustrated in Figure 1b and this can be efficiently implemented by the consistency model f θ and batch-wise computation as described in Algorithm 1.

Ensemble. It is always challenging to select the best hyperparameters for the OOD detection task since we do not know the OOD information in advance. Furthermore, they may vary across different OOD datasets. To tackle this issue, we also suggest using an ensemble approach with multiple timestep pairs. Specifically, given a candidate set of pairs C = { ( α i , β i ) } |C| i =1 , we use the sum of all scores, i.e. , S PR ( x ; θ ) = ∑ ( α,β ) ∈C S PR ( x , α, β ; θ ) , in our main experiments (Section 4.2) with a roughly selected C . 1 We discuss the effect of each component in Section 4.3.

4 Experiment

In this section, we evaluate the out-of-distribution (OOD) detection performance of our Projection Regret. We first describe our experimental setups, including benchmarks, baselines, and implementation details of Projection Regret (Section 4.1). We then present our main results on the benchmarks (Section 4.2) and finally show ablation experiments of our design choices (Section 4.3).

4.1 Experimental setups

We follow the standard OOD detection setup [33, 34, 35]. We provide further details in the Appendix.

Datasets. We examine Projection Regret under extensive in-distribution (ID) vs out-of-distribution (OOD) evaluation tasks. We use CIFAR-10/100 [30] and SVHN [31] for ID datasets, and CIFAR10/100, SVHN, LSUN [36], ImageNet [37], Textures [38], and Interpolated CIFAR-10 [19] for OOD datasets. Note that CIFAR-10, CIFAR-100, LSUN, and ImageNet have similar background information [39], so it is challenging to differentiate one from the other ( e.g. , CIFAR-10 vs ImageNet). Following Tack et al. [39], we remove the artificial noise present in the resized LSUN and ImageNet

datasets. We also remove overlapping categories from the OOD datasets for each task. We also apply Projection Regret in a one-class classification benchmark on the CIFAR-10 dataset. In this benchmark, we construct 10 subtasks where each single class in the corresponding subtask are chosen as in-distribution data and rest of the classes are selected as outlier distribution data. Finally, we also test Projection Regret in ColoredMNIST [40] benchmark where classifiers are biased towards spurious background information. All images are 32 × 32.

Baselines. We compare Projection Regret against various generative-model-based OOD detection methods. For the diffusion-model-based baselines, we compare Projection Regret against MSMA [17] and LMD [18]. We refer to Section 5 for further explanation. We implement MSMA 2 in the original NCSN and implement LMD in the consistency model. Furthermore, we experiment with the ablation of MSMA that compares ℓ 2 distance between the input and its full-step projection instead of the single-step projection. Since likelihood evaluation is available in Score-SDE [28], we also compare Projection Regret with input likelihood [6], input complexity [7], and likelihood-regret [8] from the results of [18]. Finally, we compare Projection Regret with OOD detection methods that are based on alternative generative models, including V AE [41], GLOW [42], and energy-based models (EBMs) [19, 23, 22, 24]. Finally, for one-class classification, various reconstruction and generative model-based methods are included for reference ( e.g. [43, 44, 45, 46]).

Implementation details. Consistency models are trained by consistency distillation in CIFAR10/CIFAR-100 datasets and consistency training in the SVHN/ColoredMNIST datasets. We set the hyperparameters consistent with the author's choice [21] on CIFAR-10. We implement the code on the PyTorch [47] framework. All results are averaged across 3 random seeds. We refer to the Appendix for further details.

6

7

8

9

10

6

7

8

9

10

0.666

0.675

0.69

0.692

0.683

0.687

0.721

0.747

0.745

0.729

0.67

0.707

0.75

0.76

0.744

0.656

0.686

0.718

0.746

0.74

0.648

0.673

0.693

0.716

0.725

CIFAR-10 vs CIFAR-100 (

n

=40,

n

=10).

1

11

21

31

41

n

0.66

0.68

0.70

0.72

0.74

0.76

AUROC

CIFAR-10 vs CIFAR-100

n =10

1

3

5

7

9

11

n

0.750

0.752

0.754

0.756

0.758

0.760

0.762

AUROC

CIFAR-10 vs CIFAR-100

n

=40

4.2 Main results

Table 1 shows the OOD-detection performance against diffusion-model-based methods. Projection Regret consistently outperforms MSMA and LMD on 8 out of 9 benchmarks. While Projection Regret mainly focuses on OODs with similar backgrounds, Projection Regret also outperforms baseline methods on the task where they show reasonable performance ( e.g. , CIFAR-10 vs SVHN).

In contrast, MSMA struggles on various benchmarks where the ID and the OOD share similar backgrounds ( e.g. , CIFAR-10 vs CIFAR-100). While LMD performs better in such benchmarks, LMD shows underwhelming performance in SVHN vs (CIFAR-10 or CIFAR-100) and even underperforms over input likelihood [6]. To analyze this phenomenon, we perform a visualization of the SVHN samples that show the highest abnormality score and their inpainting reconstructions in the Appendix. The masking strategy of LMD sometimes discards semantics and thereby reconstructs a different image. In contrast, Projection Regret shows near-perfect OOD detection performance in these tasks.

We further compare Projection Regret against OOD detection methods based on alternative generative models ( e.g. , EBM [24], GLOW [42]) in Table 2. We also denote the category of each baseline method. Among the various generative-model-based OOD detection methods, Projection Regret shows the best performance on average. Significantly, while CLEL [24] requires an extra self-supervised model for joint modeling, Projection Regret outperforms CLEL in 3 out of 4 tasks.

We finally compare Projection Regret against various one-class classification methods in Table 3. Projection Regret achieves the best performance and outperforms other reconstruction-based methods consistently. Furthermore, when combined with the contrastive learning method [50] by simply multiplying the anomaly score, our approach consistently improves the performance of the contrastive training-based learning method. Specifically, Projection Regret outperforms the contrastive trainingbased method in airplane class where the data contains images captured in varying degrees. As such, contrastive training-based methods underperform since they use rotation-based augmentation to generate pseudo-outlier data.

4.3 Analysis

Hyperparameter analysis. We analyze the effect of hyperparameters for Projection Regret under the CIFAR-10 vs CIFAR-100 task. First, we conduct experiments with varying the timestep index

hyperparameters α and β . As mentioned in Section 3.2, the ensemble performs better ( i.e. , 0 . 775 in Table 1) than the best hyperparameter selected ( i.e. , 0 . 760 when α = 9 , β = 8 ).

Furthermore, we perform ablation on the ensemble size hyperparameter n α and n β . While selecting a larger ensemble size improves the performance, we show reasonable performance can be achieved in smaller n α or n β ( e.g. , n α = 40 , n β = 5 or n α = 20 , n β = 10 ) without much sacrifice on the performance.

Ablation on the components of Projection Regret. We further ablate the contribution of each component in Projection Regret under the CIFAR-10 dataset. First, we set the best-performing timestep index hyperparameter ( α = 9 , β = 8 ) under the CIFAR-10 vs CIFAR-100 detection task. Furthermore, we also compare the projection baseline method, i.e. , S LPIPS Π ( · , t β ; θ ) where β = 8 .

The performance of each method is shown in Table 4. We also denote the absolute improvements over LMD [18]. Our proposed baseline method S LPIPS Π already improves over LMD in 3 out of 4 tasks, especially in the CIFAR-10 OOD dataset with similar background statistics. Furthermore, we observe consistent gains on both Projection Regret with and without ensemble over baselines. The largest gain is observed in Projection Regret over the projection baseline S LPIPS Π ( e.g. , 9.3% in the CIFAR-10 vs CIFAR-100 detection task).

Diffusion-model-based distance metric. While we mainly use LPIPS [20] as the distance metric d , we here explore alternative choices on the distance metric.

We first explore the metric that can be extracted directly from the pre-trained diffusion model. To this end, we consider intermediate feature maps of the U-Net [51] decoder of the consistency model f θ since the feature maps may contain semantic information to reconstruct the original image [52]. Formally, let F ( ℓ ) ( x , t, z ) ∈ R C ℓ × H ℓ × W ℓ be the ℓ -th decoder feature map of f θ ( x + t z , t ) . Motivated by semantic segmentation literature [53, 54] that utilize the cosine distance between two feature maps, we define our U-Net-based distance metric d UNet ( · , · ) as follows:

where d cos ( u , v ) = ∥ ∥ u / ∥ u ∥ 2 -v / ∥ v ∥ 2 ∥ ∥ 2 2 is the cosine distance and t γ is a timestep hyperparameter. We set t γ small enough to reconstruct the original image, e.g. , t γ = 0 . 06 ( i.e. , γ = 3 ), for evaluation.

We report the result in Table 5. We also test the negative SSIM index [27] as the baseline distance metric. While LPIPS performs the best, our proposed distance d UNet shows competitive performance against LPIPS and outperforms LMD and MSMA in CIFAR-10 vs (CIFAR-100, LSUN or ImageNet) tasks. On the other hand, SSIM harshly underperforms LPIPS and d UNet .

Using the diffusion model for full-step projection. While the consistency model is used for full-step projection throughout our experiments, a diffusion model can also generate full-step projection Π t θ ( x )

with better generation quality through multi-step sampling. For verification, we experiment with the EDM [29] trained in the CIFAR-10 dataset and perform full-step projection via the 2nd-order Heun's sampler. Since sampling by diffusion model increases the computation cost by 2 β times compared to the consistency model, we instead experiment on the smaller number of ensemble size n α = 10 , n β = 5 and report the result of Projection Regret with a consistency model computed in the same hyperparameter setup as a baseline.

We report the result in Table 6. We denote the result of Projection Regret utilizing the full-step projection based on the diffusion model and the consistency model as EDM and CM, respectively. Despite its excessive computation cost, Projection Regret on EDM shows negligible performance gains compared to that on CM.

Projection Regret helps robustness against spurious correlations. While we mainly discuss the problem of generative model overfitting into background information in the unsupervised domain, such a phenomenon is also observed in supervised learning where the classifier overfits the background or texture information [56]. Motivated by the results, we further evaluate our results against the spurious OODs where the OOD data share a similar background to the ID data but with different semantics. Specifically, we experiment on the coloredMNIST [40] dataset following the protocol of [55]. We report the result in Table 7. Note that spurious OOD data have the same background statistics and different semantic (digit) information. Projection Regret achieves near-perfect OOD detection performance. It is worth noting that Projection Regret does not use any additional information while the baseline proposed by [55] uses label information.

5 Related Works

Fast sampling of diffusion models. While we use full-step projection of the image for Projection Regret, this induces excessive sampling complexity in standard diffusion models [26, 57, 28]. Hence, we discuss works that efficiently reduce the sampling complexity of the diffusion models. PNDM [58] and GENIE [59] utilize multi-step solvers to reduce the approximation error when sampling with low NFEs. Salimans and Ho [60] iteratively distill the 2-step DDIM [61] sampler of a teacher network into a student network.

Out-of-distribution detection on generative models. Generative models have been widely applied to out-of-distribution detection since they implicitly model the in-distribution data distribution. A straightforward application is directly using the likelihood of the explicit likelihood model ( e.g. , VAE [41]) as a normality score function [6]. However, Nalisnick et al. [33] discover that such models may assign a higher likelihood to OOD data. A plethora of research has been devoted to explaining the aforementioned phenomenon [62, 7, 63, 64]. Serrà et al. [7] hypothesize that deep generative models assign higher likelihood on the simple out-of-distribution dataset. Kirichenko et al. [63] propose that flow-based models' [42] likelihood is dominated by local pixel correlations.

Finally, diffusion models have been applied for OOD detection due to their superior generation capability. Mahmood et al. [17] estimate the ℓ 2 distance between the input image and its single-step projection as the abnormality score function. Liu et al. [18] applies checkerboard masking to the input image and performs a diffusion-model-based inpainting task. Then, reconstruction loss between the inpainted image and the original image is set as the abnormality score function.

Reconstruction-based out-of-distribution detection methods. Instead of directly applying pretrained generative models for novelty detection, several methods[43, 46, 45] train a reconstruction model for out-of-distribution. MemAE [43] utilizes a memory structure that stores normal representation. DROCC [46] interprets one-class classification as binary classification and generates boundary data via adversarial generation. Similarly, OCGAN [45] trains an auxiliary classifier that controls the generative latent space of the GAN model. While these methods are mainly proposed for one-class classification, we are able to outperform them with significant gains.

Debiasing classifiers against spurious correlations. Our objective to capture semantic information for novelty detection aligns with lines of research that aim to debias classifiers against spurious correlations [40, 56, 65, 66, 67]. Geirhos et al. [56] first observe that CNN-trained classifiers show vulnerability under the shift of non-semantic regions. Izmailov et al. [66] tackles the issue by group robustness methods. Motivated by research on interpretability, Wu et al. [67] apply Grad-CAM [68] to discover semantic features. Ming et al. [55] extend such a line of research to out-of-distribution detection by testing OOD detection algorithms on spurious anomalies.

6 Conclusion

In this paper, we propose Projection Regret, a novel and effective out-of-distribution (OOD) detection method based on the diffusion-based projection that transforms any input image into an in-distribution image with similar background statistics. We also utilize recursive projections to reduce background bias for improving OOD detection. Extensive experiments demonstrate the efficacy of Projection Regret on various benchmarks against the state-of-the-art generative-model-based methods. We hope that our work will guide new interesting research directions in developing diffusion-based methods for not only OOD detection but also other downstream tasks such as image-to-image translation [69].

Limitation. Throughout our experiments, we mainly use the consistency models to compute the fullstep projection via one network evaluation. This efficiency is a double-edged sword, e.g. , consistency models often generate low-quality images compared to diffusion models. This might degrade the detection accuracy of our Projection Regret, especially when the training distribution p data is difficult to learn, e.g. , high-resolution images. However, as we observed in Table 6, we strongly believe that our approach can provide a strong signal to detect out-of-distribution samples even if the consistency model is imperfect. In addition, we also think there is room for improving the detection performance by utilizing internal behaviors of the model like our distance metric d UNet . Furthermore, since diffusion models use computation-heavy U-Net architecture, our computational speed is much slower than other reconstruction-based methods.

Negative social impact. While near-perfect novelty detection algorithms are crucial for real-life applications, they can be misused against societal agreement. For example, an unauthorized data scraping model may utilize the novelty detection algorithm to effectively collect the widespread data. Furthermore, the novelty detection method can be misused to keep surveillance on minority groups.

Acknowledgments and Disclosure of Funding

This work is fully supported by LG AI Research.

References

Victoria Hodge and Jim Austin. A survey of outlier detection methodologies. Artificial intelligence review , 22:85-126, 2004.

Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR , 2015.

Jasper Linmans, Jeroen van der Laak, and Geert Litjens. Efficient out-of-distribution detection in digital pathology using multi-head convolutional neural networks. In MIDL , pages 465-478, 2020.

Julia Nitsch, Masha Itkina, Ransalu Senanayake, Juan Nieto, Max Schmidt, Roland Siegwart, Mykel J Kochenderfer, and Cesar Cadena. Out-of-distribution detection for automotive perception. In 2021 IEEE International Intelligent Transportation Systems Conference (ITSC) , pages 2938-2943. IEEE, 2021.

Ramneet Kaur, Kaustubh Sridhar, Sangdon Park, Susmit Jha, Anirban Roy, Oleg Sokolsky, and Insup Lee. Codit: Conformal out-of-distribution detection in time-series data. arXiv preprint arXiv:2207.11769 , 2022.

C. M. Bishop. Novelty detection and neural network validation. In ICANN , 1994.

Joan Serrà, David Álvarez, Vicenç Gómez, Olga Slizovskaia, José F. Núñez, and Jordi Luque. Input complexity and out-of-distribution detection with likelihood-based generative models. In ICLR , 2020.

Zhisheng Xiao, Qing Yan, and Yali Amit. Likelihood regret: An out-of-distribution detection score for variational autoencoder. In NeurIPS , 2020.

Houssam Zenati, Manon Romain, Chuan Sheng Foo, Bruno Lecouat, and Vijay Ramaseshan Chandrasekhar. Adversarially learned anomaly detection. In ICDM , 2018.

Gukyeong Kwon Mohit Prabhushankar, Dogancan Temel, and Ghassan AlRegib. Backpropagated gradient representations for anomaly detection. In ECCV , 2020.

Robin Rombach, Andreas Blattman, Dominik Lorenz, Patrick Esser, and Björn Ommer. Highresolution image synthesis with latent diffusion models. In CVPR , 2022.

Wenhu Chen, Hexiang Hu, Chitwan Saharia, and William W. Cohen. Re-imagen:retrievalaugmented text-to-image generator. In ICLR , 2023.

Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. arXiv preprint arXiv:2005.14165 , 2020.

Apruva Gandhi and Shomik Jain. Adversarial perturbations fool deepfake detectors. In IJCNN , 2020.

Shiyue Zhang and Mohit Bansal. Addressing semantic drift in question generation for semisupervised question answering. In EMNLP , 2019.

Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J. Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. arXiv preprint arXiv:2104.07636 , 2021.

Ahsan Mahmood, Junier Oliva, and Martin Andreas Styner. Multiscale score matching for out-of-distribution detection. In ICLR , 2021.

Zhenzhen Liu, Jin Peng Zhou, Yufan Wang, and Kilian Q. Weinberger. Unsupervised out-ofdistribution detection with diffusion inpainting. arXiv preprint arXiv:2302.10326 , 2023.

Yilun Du and Igor Mordatch. Implicit generation and generalization in energy-based models. In NeurIPS , 2019.

Richard Zhang, Philip Isola, Alexei A. Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR , 2018.

Yang Song, Prafulla Dhariwal, Mark Chen, and Ilya Sutskever. Consistency models. In ICML , 2023.

Yilun Du, Shuang Li, Joshua Tenenbaum, and Igor Mordatch. Improved contrastive divergence training of energy-based models. In ICML , 2021.

Zhisheng Xiao, Karsten Kreis, Jan Kautz, and Arash Vahdat. Vaebm: A symbiosis between variational autoencoders and energy-based models. In ICLR , 2021.

Hankook Lee, Jongheon Jeong, Sejun Park, and Jinwoo Shin. Guiding energy-based models via contrastive latent variables. In ICLR , 2023.

Arash Vahdat and Jan Kautz. Nvae: A deep hierarchical variational autoencoder. In NeurIPS , 2020.

Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In NeurIPS , 2019.

Zhou Wang, Alan C. Bovik, Hamid R. Sheikh, and Eero P. Simoncelli. Image quality assessment: From error visibility to structural similarity. IEEE Transactions on Image Processing , 2004.

Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In ICLR , 2021.

Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. In NeurIPS , 2022.

Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Master's thesis, Department of Computer Science, University of Toronto , 2009.

Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning , 2011.

Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In ICLR , 2018.

Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Do deep generative models know what they don't know? In ICLR , 2019.

Shiyu Liang, Yixuan Li, and R. Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. In ICLR , 2018.

Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In NeurIPS , 2018.

Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365 , 2015.

Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR , 2009.

Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In CVPR , 2014.

Jihoon Tack, Sangwoo Mo, Jongheon Jeong, and Jinwoo Shin. Csi: Novelty detection via contrastive learning on distributionally shifted instances. In NeurIPS , 2020.

Martin Arjovsky, Léon Bottou, Ishann Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893 , 2019.

Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In NeurIPS , 2014.

Durk P. Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In NeurIPS , 2018.

Dong Gong, Lingqiao Liu, Vuong Le, Budhaditya Saha, Moussa Reda Mansour, Svetha Venkatesh, and Anton van den Hengel. Memorizing normality to detect anomaly: memoryaugmented deep autoencoder for unsupervised anomaly detection. In ICCV , 2019.

Thomas Schlegl, Philipp Seeböck, Sebastian M. Waldstein, Ursula Schmidt-Erfurth, and Georg Langs. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In IPMI , 2017.

Pramuditha Perera, Ramesh Nallapati, and Bing Xiang. Ocgan: One-class novelty detection using gans with constrained latent representations. In CVPR , 2019.

Sachin Goyal, Aditi Raghyunathan, Moksh Jain, Harsha Simhadri, and Prateek Jain. Drocc: Deep robust one-class classification. In ICML , 2020.

Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Z. Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In NeurIPS , 2019.

Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P. Kingma. Pixelcnn++: a pixelcnn implementation with discretized logistic mixture likelihood and other modifications. In ICLR , 2017.

Zhiwei Zhang, Shifeng Chen, and Lei Sun. P-kdgan: Progressive knowledge distillation with gans for one-class novelty detection. In IJCAI , 2020.

Dan Hendrycks, Mantas Mazeika, Saurav Kadavath, and Dawn Song. Using self-supervised learning can improve model robustness and uncertainty. In NeurIPS , 2019.

Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In MICCAI , 2015.

Dmitry Baranchuk, Andrey Voynov, Ivan Rubachev, Valentin Khrulkov, and Artem Babenko. Label-efficient semantic segmentation with diffusion models. In ICLR , 2022.

Gen Li, Varun Jampani, Laura Sevilla-Lara, Deqing Sun, Jonghyun Kim, and Joongkyu Kim. Adaptive prototype learning and allocation for few-shot segmentation. In CVPR , 2021.

Bo Pang, Yizhuo Li, Yifan Zhang, Gao Peng, Jiajun Tang, Kaiwen Zha, Jiefeng Li, and Cewu Lu. Unsupervised representation for semantic segmentation by implicit cycle-attention contrastive learning. In AAAI , 2022.

Yifei Ming, Hang Yin, and Yixuan Li. On the impact of spurious correlation for out-ofdistribution detection. In AAAI , 2022.

Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A. Wichmann, and Wieland Brendel. Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. In ICLR , 2019.

Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In NeurIPS , 2020.

Luping Liu, Yi Ren, Zhijie Lin, and Zhou Zhao. Pseudo numerical methods for diffusion models on manifolds. In ICLR , 2022.

Tim Dockhorn, Arash Vahdat, and Karsten Kreis. Genie: Higher-order denoising diffusion solvers. In NeurIPS , 2022.

Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. In ICLR , 2022.

Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In ICLR , 2021.

Sungik Choi and Sae-Young Chung. Novelty detection via blurring. In ICLR , 2020.

Polina Kirichenko, Pavel Izmailov, and Andrew Gordon Wilson. Why normalizing flows fail to detect out-of-distribution data. In NeurIPS , 2020.

Lily H. Zhang, Mark Goldstein, and Rajesh Ranganath. Understanding failures in out-ofdistribution detection with deep generative models. In ICML , 2021.

Junhyun Nam, Hyuntak Cha, Sungsoo Ahn, Jaeho Lee, and Jinwoo Shin. Learning from failure: training debiased classifier from biased classifier. In NeurIPS , 2020.

Pavel Izmailov, Polina Kirichenko, Nate Gruver, and Andrew Gordon Wilson. On feature learning in the presence of spurious correlations. In NeurIPS , 2022.

Shirley Wu, Mert Yuksekgonul, Linjun Zhang, and James Zou. Discover and cure: conceptaware mitigation of spurious correlations. In ICML , 2023.

Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: visual explanations from deep networks via gradient-based localization. In ICCV , 2017.

Xuan Su, Jiaming Song, Chenlin Meng, and Stefano Ermon. Dual diffusion implicit bridges for image-to-image translation. In ICLR , 2023.

Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In NeurIPS , 2017.

Supplementary Material

Projection Regret: Reducing Background Bias for Novelty Detection via Diffusion Models

A Full algorithm

We refer to Algorithm 1 for the efficient computation of our method.

B Implementation details

We train the baseline EDM [29] model for 390k iterations for all datasets. Then, we perform consistency distillation [21] for the CIFAR-10 and CIFAR-100 [30] datasets and consistency training for the SVHN [31] dataset. The resulting FID score [70] of the CIFAR-10/CIFAR-100 dataset is 5.52/7.0 and 8.0 for the SVHN dataset (the model trained by consistency training usually shows higher FID than the one trained by consistency distillation). While training the base EDM diffusion model and the consistency model, we use 8 A100 GPUs. During the out-of-distribution detection, we use 1 A100 GPU. For the ensemble size hyperparameter n α and n β , we set n α = 40 , n β = 10 for CIFAR-10/SVHN experiments and n α = 100 , n β = 5 for CIFAR-100 experiment. As mentioned in the main paper, we set our base hyperparameter that shows the best performance against the rotated in-distribution dataset and set the ensemble configurations around it. We use 8 hyperparameter configurations for the CIFAR-10 and CIFAR-100 datasets and 4 hyperparameter configurations for the SVHN dataset. To be specific, chosen configurations are C = { (7 , 6) , (7 , 7) , (8 , 7) , (8 , 8) , (9 , 8) , (9 , 9) , (10 , 9) , (10 , 10) } for CIFAR-10/CIFAR-100 dataset and C = { (10 , 10) , (11 , 10) , (11 , 11) , (12 , 11) } for the SVHN dataset.

C Visualization of LMD in SVHN dataset

We further reconstruct the output of the LMD [18] when SVHN is the in-distribution dataset. Following the practice of Liu et al. [18], we set the mask as the alternating checkboard mask throughout the experiments in Section 4.2. We visualize a grid of 9 samples and their reconstructions where LMD shows the highest abnormality score in Figure 5. We can see LMD's inconsistent reconstruction in such data, thereby failing to reconstruct consistent images. Furthermore, as mentioned in Section 4.2, sometimes the checkboard strategy discards the in-distribution data's semantics and thereby fails to reconstruct the original image.

(a) Original images

(b) Masked images

(c) Reconstruced images

26

39

10

Peer reviews:
comments: SUMMARY:
Recent methods have mainly utilized the reconstruction property of in-distribution samples to detect OOD by diffusion models. However, they often suffer from detecting OOD samples that share similar background information to the in-distribution data. Based on the observation that diffusion models can project any sample to an in-distribution sample with similar background information, the paper proposes Projection Regret (PR), an efficient novelty detection method that mitigates the bias of non-semantic information. To be specific, PR computes the perceptual distance between the test image and its recursive diffusion-based projection to detect the abnormality.

STRENGTHS:
1. The paper is written well and is easy to understand.
2. The studied problem is very important.
3. The results seem to outperform state-of-the-art.

WEAKNESSES:
1. From the introduction, the projection cannot change the background information too much, which seems to be harmful on near-OOD detection, such as Cifar10 vs Cifar100. Since c100 and c10 has a similar background, then wouldn't this projection create a barrier further for solving the OOD detection problem?
2. The design and hyperparameter search (including the ensemble) seems to be very important on the results. How do the authors get the best configuration on a new ID/OOD pair? Is there any sensitivity analysis on more pairs? i.e., doe the current Figure 3 generalize to most ID/OOD pairs?
3. The computational budget is a little bit concerning in the algorithm. Is there any concrete comparison or explanation?
4. More results on large-scale benchmarks (i.e., ImageNet) and large (diffusion) models seem to be more meaningful for practical concerns and interpretability.

QUESTIONS:
see above

LIMITATIONS:
yes
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 2
DATE: 2023-06-30

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper discusses a method in machine learning known as Novelty Detection, which is used to identify abnormal or out-of-distribution (OOD) samples. The authors suggest that diffusion models, a popular generative framework due to their strong generation performance, has recently become an attractive tool for novelty detection.\n\nHowever, the authors note a problem: while these models excel at generating high-quality results, they often struggle to detect OOD images with similar backgrounds. This issue, referred to as 'background bias', can lead to inaccurate novelty detection.\n\nTo address this issue, the paper proposes 'Projection Regret' (PR), a method which reduces the impact of background bias and improves the accuracy of novelty detection. PR calculates the perceptual distance between a test image and its 'projection' (an in-distribution sample with similar background information created by the diffusion model). To further mitigate the effect of dominant background information, PR uses recursive projections to cancel out the background bias.\n\nThe paper also introduces an ensemble of multiple projections for improved detection performance, calculated efficiently via a consistency model. A new perceptual distance metric using underlying features of the diffusion model is proposed and compared to other metrics, showing promising results.\n\nIn conclusion, the paper's main contributions are:\n1. Identifying the issue of background bias in novelty detection via diffusion models.\n2. Proposing a solution, Projection Regret (PR), which mitigates this bias and enhances OOD detection.\n3. Introducing an alternative perceptual distance metric computed from decoder features of the pre-trained diffusion model.\n\nExtensive experiments demonstrate that PR significantly outperforms previous diffusion-based novelty detection methods, showing potential for future applications.\n\nSTRENGTHS:\n**Originality:** The paper presents a novel method called Projection Regret (PR) to address the problem of background bias in novelty detection using diffusion models. This is a creative combination of existing ideas, especially the use of perceptual distance and recursive projections to cancel out dominant background information. The proposed alternative perceptual distance metric using decoder features of the pre-trained diffusion model also adds to the originality.\n\n**Quality:** The research appears to be of high quality. The authors have carried out extensive experiments to demonstrate the effectiveness of their proposed method. They have also compared PR with other existing methods for novelty detection, showing that it outperforms them by a significant margin.\n\n**Clarity:** The paper is well written and structured. The authors clearly outline the problem of background bias in novelty detection, explain the concept behind PR, and provide detailed explanations of their experimental setup and results. They also do a good job of explaining complex concepts in an understandable way.\n\n**Significance:** The significance of this work lies in its potential to improve the accuracy of novelty detection in machine learning, which has broad applications in many fields, including medical diagnosis, autonomous driving, and forecasting. By addressing the issue of background bias, the proposed PR method could enhance the reliability and safety of deep learning applications. Additionally, the proposed perceptual distance metric could serve as a useful tool for researchers working on similar problems in the future.\n\nWEAKNESSES:\nWhile the paper presents a significant contribution to the field, there are a few areas where it could be improved:\n\n**1. Evaluation metrics:** While the paper does an excellent job of comparing with existing methods and demonstrating the superiority of PR, it might benefit from more diverse evaluation metrics. At present, the paper primarily focuses on detection accuracy (AUROC). Incorporating additional measures such as precision-recall curves or F1 scores could provide a more comprehensive evaluation.\n\n**2. Real-world applications:** The paper demonstrates PR's effectiveness using standard datasets (CIFAR-10 vs CIFAR-100 etc.), but it would be valuable to see how PR performs in real-world scenarios. It is crucial to know how the method copes with the complexity and variability found in actual application scenarios including medical imaging or self-driving car data.\n\n**3. Deeper exploration of background bias:** Although the authors have proposed an innovative solution to tackle the issue of background bias, they could delve deeper into this problem. Understanding the nature of this bias, its origins, and why it is particularly problematic for diffusion models can further enhance the paper's impact.\n\n**4. Computational efficiency:** While the authors mention that PR can be calculated efficiently via a consistency model, specific data about computational requirements, time complexity, and scalability is missing. Providing these details can help readers assess whether PR is suitable for their specific use-cases, especially those that require real-time processing or deal with large-scale datasets.\n\n**5. Robustness analysis:** The paper could benefit from a detailed robustness analysis of PR against various types of noise and distortions. This would allow potential users to understand the limits of the approach and potential pitfalls in practical applications. \n\nBy addressing these points, the paper could strengthen its contributions and appeal to a broader audience within the machine learning community.\n\nQUESTIONS:\n**Questions:**\n\n1. Could you provide more details on the computational requirements of PR? For instance, what is the time complexity and how does it scale with the size of the dataset?\n\n2. Would PR be equally effective in real-world applications where data might be more complex or noisy compared to standard datasets like CIFAR-10 or CIFAR-100?\n\n3. Could you delve deeper into the issue of background bias? Understanding its origins and why it affects diffusion models specifically could strengthen the paper.\n\n4. Have you investigated the robustness of PR against various types of noise and distortions? If not, do you anticipate that the method would be robust against such challenges?\n\n**Suggestions:**\n\n1. Consider incorporating additional evaluation metrics such as precision-recall curves or F1 scores for a more comprehensive evaluation of PR's performance.\n\n2. It would be beneficial to demonstrate how PR performs with real-world datasets, such as medical imaging data or self-driving car sensory data. This would help readers understand its applicability and effectiveness in practical scenarios.\n\n3. Detailed information about computational efficiency, including time complexity and scalability aspects, would be useful for potential users assessing suitability for their specific use-cases.\n\n4. Conducting a robustness analysis against various types of noise and distortions would further validate the efficacy of PR under different challenging conditions.\n\nLIMITATIONS:\nThe authors have addressed some limitations of their work, particularly the issue of background bias in diffusion models and how their proposed method, Projection Regret (PR), mitigates this. However, a few additional limitations could be further discussed:\n\n1. **Computational Resources:** While the authors mention that PR can be calculated efficiently, the paper does not provide specific details on computational requirements or scalability. As advanced machine learning models often require significant computational resources, an evaluation of this aspect would be helpful for potential users.\n\n2. **Robustness:** The paper does not explicitly discuss the robustness of PR to noise or distortions in the data. Given that real-world data can often be noisy or imperfect, discussing the limitations of PR in handling such situations would be beneficial.\n\nRegarding the broader societal impacts, the paper does not directly address this point. While novelty detection in machine learning can have multiple positive societal impacts, like enhancing medical diagnosis or improving safety in autonomous driving, it might also have potential negative impacts:\n\n1. **Privacy concerns:** Improving the ability of machines to identify novel information could potentially lead to privacy concerns, as more accurate models might be misused for surveillance or unauthorized data collection.\n\n2. **System Misuse:** In high-stakes applications, an over-reliance on automated novelty detection systems that might still make mistakes could lead to serious consequences.\n\nThe authors could improve their paper by addressing these points, possibly in a new section dedicated to limitations and broader societal impacts. This would help readers appreciate the full context of the research, including its potential downsides.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 2, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-07-02"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper presents a novel approach to detecting and handling novelty in data using a generative diffusion model, with a specific focus on addressing biased backgrounds. The proposed method aims to transform noisy samples into perfect ones by leveraging the capabilities of the diffusion model. The central idea is that by reversing the effects of noise on an inlier sample (x+noise), the resulting output will closely resemble the original sample (X). Conversely, if X were to be treated as an out-of-distribution (OOD) sample, the diffusion model trained on similar OOD backgrounds could project the samples onto a background resembling the inlier data.\n\nUnlike traditional methods, such as auto-encoders that rely on reconstruction error, this approach emphasizes the significance of high and meaningful reconstruction errors for anomaly detection. Since the primary focus is on the foreground, which constitutes a small portion of the images, the reconstruction error becomes a more reliable indicator of anomalies.\n\nTo validate the effectiveness of the proposed method, the authors conducted evaluations on various datasets, including CIFAR-10, CIFAR-100, SVHN, and ImageNet. Comparative analyses were performed against existing generative models commonly employed for novelty detection.\n\nSTRENGTHS:\nRecently, there has been growing concern that existing methods for image classification, which are generally not specific to one-class classification or novelty detection tasks, face significant challenges. Additionally, studies in the field have highlighted the problem of bias in the background for novelty detection. In response, this paper addresses this ongoing challenge by proposing a solution.\n\nThe paper leverages the reverse step of the diffusion model to restore noisy outliers, with the goal of aligning the background of these recovered samples more closely with the inlier samples. This approach is intriguing and tackles a specific aspect of the problem.\n\nThe results demonstrate the effectiveness of the proposed idea.\n\nWEAKNESSES:\nOne weakness of this paper is that the main idea of using projection and reconstruction error for novelty detection is not novel. There have been previous papers, such as \"Adversarially One-Class Classifier for Novelty Detection\" (CVPR 2018), that have presented similar ideas but with different approaches. Thus, the high-level novelty of the proposed method is questionable. However, the method is novel. \n \nFurthermore, the paper claims the method is less biased towards the background. However, the datasets used for evaluation, such as CIFAR and SVHN, are not known for having extreme biases toward the background. To address the bias problem effectively, evaluating the method on datasets that exhibit strong biases in the background would be more appropriate, such as \"Hard ImageNet: Segmentations for Objects with Strong Spurious Cues.\" Other papers specifically tackle the issue of spurious correlations and out-of-distribution detection, such as \"On The Impact Of Spurious Correlation For Out-of-distribution Detection\" by Yifei Ming (2021). It would be valuable to compare the results of the proposed method with those papers that specifically address the bias problem rather than just comparing against other generative models.\n\nMoreover, the proposed method may fail in cases where the OOD samples have backgrounds that are very similar to the inliers but differ in the main concept or foreground. In such scenarios, the background would be ideally recovered using the proposed method, leading to false positives where OOD samples are detected as inliers.\n\n\n\nAt the moment there are a lot of methods that try to handle the same problem to the reconstruction error can be a reliable score for novelty detection for example, see the Mem-autoencoder paper for novelty or anomaly detection. \n\n\nAddressing these weaknesses and providing a more thorough comparison with relevant papers and datasets would strengthen the overall contribution of the proposed method.\n\nQUESTIONS:\nThe idea and problem mentioned in this paper are interesting. However, the authors need to consider the following points: (1) They should review documents in the field of fairness for anomaly detection and those that attempt to mitigate bias. (2) There are benchmarks for evaluating methods biased against the background, such as Hard ImageNet. While these datasets may not be explicitly designed for out-of-distribution (OOD) detection, evaluating the proposed method on such data would be beneficial. Although CIFAR-10 and CIFAR-100 not have meaningful background concepts, additional evaluations on datasets with more pronounced background biases would provide valuable insights. (3) The comparison with existing methods needs improvement.\"\n\nLIMITATIONS:\nN/A", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-03"}

comments: SUMMARY:
This paper proposes Projection Regret (PR) to mitigate the bias of background information for novelty detection. As an effective perceptual distance, it is able to detect abnormality by reducing the effect of dominant background using recursive projections. Experimental results show the effectiveness of the proposed novelty detection framework.

STRENGTHS:
1. Good motivation to explain the background bias problem.
2. well written and easy to follow this paper.
3. The effectiveness of Projection Regret.

WEAKNESSES:
My main concerns lie in the following two aspects: (1) About the detection running time. Diffusion models are used in the proposed method, which leads to the increase of inference time when detecting the abnormality of test images. (2) It lacks experimental comparison on other practical industry product detection tasks, such as MVTecAD and BTAD benchmark, which seem to be more challenging to evaluate the effectiveness of the proposed method.

QUESTIONS:
Refer to the Weaknesses.

LIMITATIONS:
Yes.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2023-07-06