Original: A Unified Model for Multi-class Anomaly Detection
Revised: A Unified Model for Multi-class Anomaly Detection

Original: Anonymous Author(s)
Revised: Anonymous Author(s)

Original: AffiliationAddress email
Revised: AffiliationAddress email

Original: Abstract
Revised: Abstract

Original: Despite the rapid advance of unsupervised anomaly detection, existing methodsrequire to train separate models for different objects.
Revised: Despite the rapid advance of unsupervised anomaly detection, existing methodsrequire to train separate models for different objects.

Original: In this work, we present
Revised: In this work, we present

Original: UniAD that accomplishes anomaly detection for multiple classes with a unifiedframework.
Revised: UniAD that accomplishes anomaly detection for multiple classes with a unifiedframework.

Original: Under such a challenging setting, popular reconstruction networksmay fall into an “identical shortcut”, where both normal and anomalous samplescan be well recovered, and hence fail to spot outliers.
Revised: Under such a challenging setting, popular reconstruction networksmay fall into an “identical shortcut”, where both normal and anomalous samplescan be well recovered, and hence fail to spot outliers.

Original: To tackle this obstacle, wemake three improvements.
Revised: To tackle this obstacle, wemake three improvements.

Original: First, we revisit the formulations of fully-connectedlayer, convolutional layer, as well as attention layer, and confirm the important roleof query embedding ( i.e. , within attention layer) in preventing the network fromlearning the shortcut.
Revised: First, we revisit the formulations of fully-connectedlayer, convolutional layer, as well as attention layer, and confirm the important roleof query embedding ( i.e. , within attention layer) in preventing the network fromlearning the shortcut.

Original: We therefore come up with a layer-wise query decoder tohelp model the multi-class distribution.
Revised: We therefore come up with a layer-wise query decoder tohelp model the multi-class distribution.

Original: Second, we employ a neighbor maskedattention module to further avoid the information leak from the input feature tothe reconstructed output feature.
Revised: Second, we employ a neighbor maskedattention module to further avoid the information leak from the input feature tothe reconstructed output feature.

Original: Third, we propose a feature jittering strategythat urges the model to recover the correct message even with noisy inputs.
Revised: Third, we propose a feature jittering strategythat urges the model to recover the correct message even with noisy inputs.

Original: Weevaluate our algorithm on MVTec-AD and CIFAR-10 datasets, where we surpassthe state-of-the-art alternatives by a sufficiently large margin.
Revised: Weevaluate our algorithm on MVTec-AD and CIFAR-10 datasets, where we surpassthe state-of-the-art alternatives by a sufficiently large margin.

Original: For example, whenlearning a unified model for 15 categories in MVTec-AD, we surpass the secondcompetitor on the tasks of both anomaly detection (from 88.1% to 96.5%) andanomaly localization (from 89.5% to 96.8%).
Revised: For example, whenlearning a unified model for 15 categories in MVTec-AD, we surpass the secondcompetitor on the tasks of both anomaly detection (from 88.1% to 96.5%) andanomaly localization (from 89.5% to 96.8%).

Original: Code will be made publicly available.
Revised: Code will be made publicly available.

Original:  Introduction
Revised:  Introduction

Original: Anomaly detection has found an increasingly wide utilization in manufacturing defect detection [3],medical image analysis [14] and video surveillance [43].
Revised: Anomaly detection has found an increasingly wide utilization in manufacturing defect detection [4],medical image analysis [16] and video surveillance [45].

Original: Considering the highly diverse anomalytypes, a common solution is to model the distribution of normal samples and then identify anomalousones via finding outliers.
Revised: Considering the highly diverse anomalytypes, a common solution is to model the distribution of normal samples and then identify anomalousones via finding outliers.

Original: It is therefore crucial to learn a compact boundary for normal data, as shownin Fig.
Revised: It is therefore crucial to learn a compact boundary for normal data, as shownin Fig.

Original: 1a.
Revised: 1a.

Original: For this purpose, existing methods [5, 8, 22, 24, 45, 48] propose to train separate modelsfor different classes of objects, like in Fig. 1c.
Revised: For this purpose, existing methods [6, 10, 24, 26, 47, 50] propose to train separate modelsfor different classes of objects, like in Fig. 1c.

Original: However, such a one-class-one-model scheme couldbe memory-consuming especially along with the number of classes increasing, and also uncongenialto the scenarios where the normal samples manifest themselves in a large intra-class diversity ( i.e. ,one object consists of various types).
Revised: However, such a one-class-one-model scheme couldbe memory-consuming especially along with the number of classes increasing, and also uncongenialto the scenarios where the normal samples manifest themselves in a large intra-class diversity ( i.e. ,one object consists of various types).

Original: In this work, we target a more practical task, which is to detect anomalies from different objectclasses with a unified framework.
Revised: In this work, we target a more practical task, which is to detect anomalies from different objectclasses with a unified framework.

Original: The task setting is illustrated in Fig.
Revised: The task setting is illustrated in Fig.

Original: 1d, where the training datacovers normal samples from a range of categories, and the learned model is asked to accomplishanomaly detection for all these categories without any fine-tuning.
Revised: 1d, where the training datacovers normal samples from a range of categories, and the learned model is asked to accomplishanomaly detection for all these categories without any fine-tuning.

Original: It is noteworthy that the categoricalinformation ( i.e. , class label) is inaccessible at both the training and the inference stages, considerablyeasing the difficulty of data preparation.
Revised: It is noteworthy that the categoricalinformation ( i.e. , class label) is inaccessible at both the training and the inference stages, considerablyeasing the difficulty of data preparation.

Original: Nonetheless, solving such a task is fairly challenging.
Revised: Nonetheless, solving such a task is fairly challenging.

Original: Recallthat the rationale behind unsupervised anomaly detection is to model the distribution of normal dataand find a compact decision boundary as in Fig.
Revised: Recallthat the rationale behind unsupervised anomaly detection is to model the distribution of normal dataand find a compact decision boundary as in Fig.

Original: 1a.
Revised: 1a.

Original: When it comes to the multi-class case, we expectthe model to capture the distribution of all classes simultaneously such that they can share the same
Revised: When it comes to the multi-class case, we expectthe model to capture the distribution of all classes simultaneously such that they can share the same

Original: [Figure]
Revised: [Figure]

Original: on Normal Datato
Revised: on Normal Data

Revised: Infer to Detect

Original: [Figure]
Revised: [Figure]

Original: Normal
Revised: Normal

Original: Anomaly
Revised: Anomaly

Original: Boundary
Revised: Boundary

Original: [Figure]
Revised: [Figure]

Original: boundary as in Fig.
Revised: boundary as in Fig.

Original: 1b.
Revised: 1b.

Original: But if we focus on a particular category, say the green one in Fig.
Revised: But if we focus on a particular category, say the green one in Fig.

Original: 1b, allthe samples from other categories should be considered as anomalies no matter whether they arenormal ( i.e. , blue circles) or anomalous ( i.e. , blue triangles) themselves.
Revised: 1b, allthe samples from other categories should be considered as anomalies no matter whether they arenormal ( i.e. , blue circles) or anomalous ( i.e. , blue triangles) themselves.

Original: From this perspective, howto accurately model the multi-class distribution becomes vital.
Revised: From this perspective, howto accurately model the multi-class distribution becomes vital.

Original: A widely used approach to learning the normal data distribution draws support from image (or feature)reconstruction [1, 4, 23, 36, 47], which assumes that a well-trained model always produces normalsamples regardless of the defects within the inputs.
Revised: A widely used approach to learning the normal data distribution draws support from image (or feature)reconstruction [2, 5, 25, 38, 49], which assumes that a well-trained model always produces normalsamples regardless of the defects within the inputs.

Original: In this way, there will be large reconstructionerrors for anomalous samples, making them distinguishable from the normal ones.
Revised: In this way, there will be large reconstructionerrors for anomalous samples, making them distinguishable from the normal ones.

Original: However, wefind that popular reconstruction networks suggest unsatisfying performance on the challenging taskstudied in this work.
Revised: However, wefind that popular reconstruction networks suggest unsatisfying performance on the challenging taskstudied in this work.

Original: They typically fall into an “identity shortcut”, which appears as returning adirect copy of the input disregarding its content.
Revised: They typically fall into an “identity shortcut”, which appears as returning adirect copy of the input disregarding its content.

Original: 1 As a result, even anomalous samples can be wellrecovered with the learned model and hence become hard to detect.
Revised: 1 As a result, even anomalous samples can be wellrecovered with the learned model and hence become hard to detect.

Original: To address this issue, we carefully tailor a feature reconstruction framework that prevents the modelfrom learning the shortcut.
Revised: To address this issue, we carefully tailor a feature reconstruction framework that prevents the modelfrom learning the shortcut.

Original: First, we revisit the formulations of fully-connected layer, convolutionallayer, as well as attention layer used in neural networks, and observe that both fully-connectedlayer and convolutional layer face the risk of learning a trivial solution.
Revised: First, we revisit the formulations of fully-connected layer, convolutionallayer, as well as attention layer used in neural networks, and observe that both fully-connectedlayer and convolutional layer face the risk of learning a trivial solution.

Original: This drawback is furtheramplified under the multi-class setting in that the normal data distribution becomes far more complex.
Revised: This drawback is furtheramplified under the multi-class setting in that the normal data distribution becomes far more complex.

Original: Instead, the attention layer is sheltered from such a risk, benefiting from a learnable query embedding(see Sec. 3.1).
Revised: Instead, the attention layer is sheltered from such a risk, benefiting from a learnable query embedding(see Sec. 3.1).

Original: Accordingly, we propose a layer-wise query decoder to intensify the use of queryembedding.
Revised: Accordingly, we propose a layer-wise query decoder to intensify the use of queryembedding.

Original: Second, we argue that the full attention ( i.e. , every feature point relates to each other)also contributes to the shortcut issue, because it offers the chance of directly copying the input tothe output.
Revised: Second, we argue that the full attention ( i.e. , every feature point relates to each other)also contributes to the shortcut issue, because it offers the chance of directly copying the input tothe output.

Original: To avoid the information leak, we employ a neighbor masked attention module, where afeature point relates to neither itself nor its neighbors.
Revised: To avoid the information leak, we employ a neighbor masked attention module, where afeature point relates to neither itself nor its neighbors.

Original: Third, inspired by Bengio et al.
Revised: Third, inspired by Bengio et al.

Original: [2], we proposea feature jittering strategy, which requires the model to recover the source message even with noisyinputs.
Revised: [3], we proposea feature jittering strategy, which requires the model to recover the source message even with noisyinputs.

Original: All these designs help the model escape from the “identity shortcut”, as shown in Fig.
Revised: All these designs help the model escape from the “identity shortcut”, as shown in Fig.

Original: 2b.
Revised: 2b.

Original: Extensive experiments on MVTec-AD [3] and CIFAR-10 [20] demonstrate the sufficient superiorityof our approach, which we call UniAD , over existing alternatives under the unified task setting.
Revised: Extensive experiments on MVTec-AD [4] and CIFAR-10 [22] demonstrate the sufficient superiorityof our approach, which we call UniAD , over existing alternatives under the unified task setting.

Original: Forinstance, when learning a single model for 15 categories in MVTec-AD, we achieve state-of-the-artperformance on the tasks of both anomaly detection and anomaly localization, boosting the AUROCfrom 88.1% to 96.5% and from 89.5% to 96.8%, respectively.
Revised: Forinstance, when learning a single model for 15 categories in MVTec-AD, we achieve state-of-the-artperformance on the tasks of both anomaly detection and anomaly localization, boosting the AUROCfrom 88.1% to 96.5% and from 89.5% to 96.8%, respectively.

Original:  Related work
Revised:  Related work

Original: Anomaly detection.
Revised: Anomaly detection.

Original: 1) Classical approaches extend classical machine learning methods for one-classclassification, such as one-class support vector machine (OC-SVM) [35] and support vector datadescription (SVDD)
Revised: 1) Classical approaches extend classical machine learning methods for one-classclassification, such as one-class support vector machine (OC-SVM) [37] and support vector datadescription (SVDD)

Original: Patch-level embedding [45], geometric transformation [15], and elasticweight consolidation [30] are incorporated for improvement.
Revised: Patch-level embedding [47], geometric transformation [17], and elasticweight consolidation [32] are incorporated for improvement.

Original: 2) Pseudo-anomaly converts anomalydetection to supervised learning, including classification [22, 29, 42], image denoising [48], and hyper- sphere segmentation [24].
Revised: 2) Pseudo-anomaly converts anomalydetection to supervised learning, including classification [24, 31, 44], image denoising [50], and hyper- sphere segmentation [26].

Original: However, these methods partly rely on how well proxy anomalies matchreal anomalies that are not known [10].
Revised: However, these methods partly rely on how well proxy anomalies matchreal anomalies that are not known [12].

Original: Modeling then comparison assumes that the pre-trainednetwork is capable of extracting discriminative features for anomaly detection [8, 31].
Revised: Modeling then comparison assumes that the pre-trainednetwork is capable of extracting discriminative features for anomaly detection [10, 33].

Original: PaDiM [8] and MDND [31] extract pre-trained features to model normal distribution, then utilize a distance metric tomeasure the anomalies.
Revised: PaDiM [10]and MDND [33] extract pre-trained features to model normal distribution, then utilize a distancemetric to measure the anomalies.

Original: Nevertheless, these methods need to memorize and model all normal features,thus are computationally expensive.
Revised: Nevertheless, these methods need to memorize and model all normalfeatures, thus are computationally expensive.

Original: Knowledge distillation proposes that the student distilled bya teacher on normal samples could only extract normal features [5, 10, 34, 41, 42].
Revised: Knowledge distillation proposes that the studentdistilled by a teacher on normal samples could only extract normal features [6, 12, 36, 43, 44].

Original: Recent worksmainly focus on model ensemble [5], feature pyramid [34, 41], and reverse distillation [10].
Revised: Recentworks mainly focus on model ensemble [6], feature pyramid [36, 43], and reverse distillation [12].

Original: Reconstruction-based anomaly detection.
Revised: Reconstruction-based anomaly detection.

Original: These methods rely on the hypothesis that reconstructionmodels trained on normal samples only succeed in normal regions, but fail in anomalous regions [4,23, 33].
Revised: These methods rely on the hypothesis that reconstructionmodels trained on normal samples only succeed in normal regions, but fail in anomalous regions [5,25, 35].

Original: Early attempts include Auto-Encoder (AE) [4, 7], Variational Auto-Encoder (VAE) [19, 23],and Generative Adversarial Net (GAN) [1, 27, 33, 47].
Revised: Early attempts include Auto-Encoder (AE) [5, 8], Variational Auto-Encoder (VAE) [21, 25],and Generative Adversarial Net (GAN) [2, 29, 35, 49].

Original: However, these methods face the problem thatthe model could learn tricks that the anomalies are also restored well.
Revised: However, these methods face the problem thatthe model could learn tricks that the anomalies are also restored well.

Original: Accordingly, researchers adoptdifferent strategies to tackle this issue, such as adding instructional information ( i.e. , structural [49]or semantic [36, 43]), memory mechanism [16, 17, 26], iteration mechanism [9], image maskingstrategy [44], and pseudo-anomaly 
Revised: Accordingly, researchers adoptdifferent strategies to tackle this issue, such as adding instructional information ( i.e. , structural [51]or semantic [38, 45]), memory mechanism [18, 19, 28], iteration mechanism [11], image maskingstrategy [46], and pseudo-anomaly [8, 31].

Original: Recently, DRAEM [48] first recovers the pseudo-anomalydisturbed normal images for representation, then utilizes a discriminative net to distinguish theanomalies, achieving excellent performance.
Revised: Recently, DRAEM [50] first recovers the pseudo-anomalydisturbed normal images for representation, then utilizes a discriminative net to distinguish theanomalies, achieving excellent performance.

Original: However, DRAEM [48] ceases to be effective underthe unified case.
Revised: However, DRAEM [50] ceases to be effective underthe unified case.

Original: Moreover, there is still an important aspect that has not been well studied, i.e. ,what architecture is the best reconstruction model?
Revised: Moreover, there is still an important aspect that has not been well studied, i.e. ,what architecture is the best reconstruction model?

Original: In this paper, we first compare and analyze threepopular architectures including MLP, CNN, and transformer.
Revised: In this paper, we first compare and analyze threepopular architectures including MLP, CNN, and transformer.

Original: Then, accordingly, we base on thetransformer and further design three improvements, which compose our UniAD.
Revised: Then, accordingly, we base on thetransformer and further design three improvements, which compose our UniAD.

Original: Transformer in anomaly detection.
Revised: Transformer in anomaly detection.

Original: Transformer [39] with attention mechanism, first proposed innatural language processing, has been successfully used in computer vision [6, 13].
Revised: Transformer [41] with attention mechanism, first proposed innatural language processing, has been successfully used in computer vision [7, 15].

Original: Some attemptstry to utilize transformer for anomaly detection.
Revised: Some attemptstry to utilize transformer for anomaly detection.

Original: InTra [28] adopts transformer to recover the imageby recovering all masked patches one by one.
Revised: InTra [30] adopts transformer to recover the imageby recovering all masked patches one by one.

Original: VT-ADL [25] and AnoVit [46] both apply transformerencoder to reconstruct images.
Revised: VT-ADL [27] and AnoVit [48] both apply transformerencoder to reconstruct images.

Original: However, these methods directly utilize vanilla transformer, and donot figure out why transformer brings improvement.
Revised: However, these methods directly utilize vanilla transformer, and donot figure out why transformer brings improvement.

Original: In contrast, we confirm the efficacy of the queryembedding to prevent the shortcut, and accordingly design a layer-wise query decoder.
Revised: In contrast, we confirm the efficacy of the queryembedding to prevent the shortcut, and accordingly design a layer-wise query decoder.

Original: Also, to avoidthe information leak of the full attention, we employ a neighbor masked attention module.
Revised: Also, to avoidthe information leak of the full attention, we employ a neighbor masked attention module.

Original:  Method
Revised:  Method

Original: 3.1 Revisiting feature reconstruction for anomaly detection
Revised: 3.1 Revisiting feature reconstruction for anomaly detection

Original: In Fig. 2, following the feature reconstruction paradigm [36], we build an MLP, a CNN, and atransformer (with query embedding) to reconstruct the features extracted by a pre-trained backbone.
Revised: In Fig. 2, following the feature reconstruction paradigm [38], we build an MLP, a CNN, and atransformer (with query embedding) to reconstruct the features extracted by a pre-trained backbone.

Original: The reconstruction errors represent the anomaly possibility.
Revised: The reconstruction errors represent the anomaly possibility.

Original: The architectures of the three networksare given in Supplementary Material .
Revised: The architectures of the three networksare given in Supplementary Material .

Original: The metric is evaluated every 10 epochs.
Revised: The metric is evaluated every 10 epochs.

Original: Note that the periodicevaluation is impractical since anomalies are not available during training.
Revised: Note that the periodicevaluation is impractical since anomalies are not available during training.

Original: As shown in Fig.
Revised: As shown in Fig.

Original: 2a, aftera period of training, the performances of the three networks decrease severely with the losses goingextremely small.
Revised: 2a, aftera period of training, the performances of the three networks decrease severely with the losses goingextremely small.

Original: We attribute this to the problem of “identical shortcut”, where both normal andanomalous regions can be well recovered, thus failing to spot anomalies.
Revised: We attribute this to the problem of “identical shortcut”, where both normal andanomalous regions can be well recovered, thus failing to spot anomalies.

Original: This speculation is verifiedby the visualization results in Fig.
Revised: This speculation is verifiedby the visualization results in Fig.

Original: 2b (more results in Supplementary Material ).
Revised: 2b (more results in Supplementary Material ).

Original: However, comparedwith MLP and CNN, the transformer suffers from a much smaller performance drop, indicating aslighter shortcut problem.
Revised: However, comparedwith MLP and CNN, the transformer suffers from a much smaller performance drop, indicating aslighter shortcut problem.

Original: This encourages us to analyze as follows.
Revised: This encourages us to analyze as follows.

Original: We denote the features in a normal image as x + ∈ R K × C , where K is the feature number, C isthe channel dimension.
Revised: We denote the features in a normal image as x + ∈ R K × C , where K is the feature number, C isthe channel dimension.

Original: The batch dimension is omitted for simplicity.
Revised: The batch dimension is omitted for simplicity.

Original: Similarly, the features in ananomalous image are denoted as x − ∈ R K × C .
Revised: Similarly, the features in ananomalous image are denoted as x − ∈ R K × C .

Original: The reconstruction loss is chosen as the MSE loss.
Revised: The reconstruction loss is chosen as the MSE loss.

Original: We start from a simple 1-layer network as the reconstruction net, which is trained with x + and testedto detect anomalous regions in x − .
Revised: We provide a rough analysis using a simple 1-layer network as the reconstruction net, which is trainedwith x + and tested to detect anomalous regions in x − .

Original: Fully-connected layer in MLP .
Revised: Fully-connected layer in MLP .

Original: Denote the weights and bias in this layer as w ∈ R C × C , b ∈ R C ,respectively, this layer can be represented as,
Revised: Denote the weights and bias in this layer as w ∈ R C × C , b ∈ R C ,respectively, this layer can be represented as,

Original: [Equation]
Revised: [Equation]

Original: With the MSE loss pushing y to x + , the model may take shortcut to regress w → I (identity matrix),b → 0 .
Revised: With the MSE loss pushing y to x + , the model may take shortcut to regress w → I (identity matrix),b → 0 .

Original: Ultimately, this model could also reconstruct x − well, failing in anomaly detection.
Revised: Ultimately, this model could also reconstruct x − well, failing in anomaly detection.

Original: [Figure]
Revised: [Figure]

Original: During the training of MLP, CNN, and transformer, the reconstruction error keeps going smaller on normal samples, but the performance on anomalies suffers from a severe drop after reaching the peak.
Revised: During the training of MLP, CNN, and transformer, the reconstruction error keeps going smaller on normal samples, but the performance on anomalies suffers from a severe drop after reaching the peak.

Original: This is caused by the model learning an “identical shortcut”, which tends to directly copy the input as the output regardless of whether it is normal or anomalous.
Revised: This is caused by the model learning an “identical shortcut”, which tends to directly copy the input as the output regardless of whether it is normal or anomalous.

Original: (b) Visual explanation of the shortcut issue, where the anomalous samples can be well recovered and hence become hard to detect from normal ones.
Revised: (b) Visual explanation of the shortcut issue, where the anomalous samples can be well recovered and hence become hard to detect from normal ones.

Original: In contrast, UniAD overcomes such a problem and manages to reconstruct anomalies as normal samples .
Revised: In contrast, UniAD overcomes such a problem and manages to reconstruct anomalies as normal samples .

Original: It is noteworthy that all models are learned for feature reconstruction and a separate decoder is employed to render images from features.
Revised: It is noteworthy that all models are learned for feature reconstruction and a separate decoder is employed to render images from features.

Original: This decoder is only used for visualization.
Revised: This decoder is only used for visualization.

Original: Convolutional layer in CNN .
Revised: Convolutional layer in CNN .

Original: A convolutional layer with 1 × 1 kernel is equivalent to a fullyconnected layer.
Revised: A convolutional layer with 1 × 1 kernel is equivalent to a fullyconnected layer.

Original: Besides, An n × n ( n > 1 ) kernel has more parameters and larger capacity, and cancomplete whatever 1 × 1 kernel can.
Revised: Besides, An n × n ( n > 1 ) kernel has more parameters and larger capacity, and cancomplete whatever 1 × 1 kernel can.

Original: Thus, this layer also has the chance to learn a shortcut.
Revised: Thus, this layer also has the chance to learn a shortcut.

Original: Transformer with query embedding .
Revised: Transformer with query embedding .

Original: In such a model, there is an attention layer with a learnablequery embedding, q ∈ R K × C .
Revised: In such a model, there is an attention layer with a learnablequery embedding, q ∈ R K × C .

Original: When using this layer as the reconstruction model, it is denoted as,
Revised: When using this layer as the reconstruction model, it is denoted as,

Original: [Equation]
Revised: [Equation]

Original: To push y to x + , the attention map, softmax ( q ( x + ) T / √ C ) , should approximate I (identity matrix),so q must be highly related to x + .
Revised: To push y to x + , the attention map, softmax ( q ( x + ) T / √ C ) , should approximate I (identity matrix),so q must be highly related to x + .

Original: Considering that q in the trained model is relevant to normalsamples, the model could not reconstruct x − well.
Revised: Considering that q in the trained model is relevant to normalsamples, the model could not reconstruct x − well.

Original: The ablation study in Sec.
Revised: The ablation study in Sec.

Original: 4.5 shows that withoutthe query embedding, the performance of transformer drops dramatically by 13.4% and 18.1% inpixel ROAUC and image ROAUC, respectively.
Revised: 4.5 shows that withoutthe query embedding, the performance of transformer drops dramatically by 13.4% and 18.1% inpixel ROAUC and image ROAUC, respectively.

Original: Thus the query embedding is of vital significance tomodel the normal distribution.
Revised: Thus the query embedding is of vital significance tomodel the normal distribution.

Original: However, transformer still suffers from the shortcut problem, which inspires our three improvements.1)
Revised: However, transformer still suffers from the shortcut problem, which inspires our three improvements.1)

Original: According to that the query embedding can prevent reconstructing anomalies, we design a Layerwise Query Decoder (LQD) by adding the query embedding in each decoder layer rather than onlythe first layer in vanilla transformer.
Revised: According to that the query embedding can prevent reconstructing anomalies, we design a Layerwise Query Decoder (LQD) by adding the query embedding in each decoder layer rather than onlythe first layer in vanilla transformer.

Original: We suspect that the full attention increases the possibilityof the shortcut.
Revised: We suspect that the full attention increases the possibilityof the shortcut.

Original: Since one token could see itself and its neighbor regions, it is easy to reconstructby simply copying.
Revised: Since one token could see itself and its neighbor regions, it is easy to reconstructby simply copying.

Original: Thus we mask the neighbor tokens when calculating the attention map, called
Revised: Thus we mask the neighbor tokens when calculating the attention map, called

Original: Neighbor Masked Attention (NMA).
Revised: Neighbor Masked Attention (NMA).

Original: We employ a Feature Jittering (FJ) strategy to disturb theinput features, leading the model to learn normal distribution from denoising.
Revised: We employ a Feature Jittering (FJ) strategy to disturb theinput features, leading the model to learn normal distribution from denoising.

Original: Benefiting from thesedesigns, our UniAD achieves satisfying performance, as illustrated in Fig.
Revised: Benefiting from thesedesigns, our UniAD achieves satisfying performance, as illustrated in Fig.

Original: 3.2 Improving feature reconstruction for unified anomaly detection
Revised: 3.2 Improving feature reconstruction for unified anomaly detection

Original: Overview .
Revised: Overview .

Original: As shown in Fig.
Revised: As shown in Fig.

Original: 3, our UniAD is composed of a Neighbor Masked Encoder (NME)and a Layer-wise Query Decoder (LQD).
Revised: 3, our UniAD is composed of a Neighbor Masked Encoder (NME)and a Layer-wise Query Decoder (LQD).

Original: Firstly, the feature tokens extracted by a fixed pre-trainedbackbone are further integrated by NME to derive the encoder embeddings.
Revised: Firstly, the feature tokens extracted by a fixed pre-trainedbackbone are further integrated by NME to derive the encoder embeddings.

Original: Then, in each layerof LQD, a learnable query embedding is successively fused with the encoder embeddings and theoutputs of the previous layer (self-fusion for the first layer).
Revised: Then, in each layerof LQD, a learnable query embedding is successively fused with the encoder embeddings and theoutputs of the previous layer (self-fusion for the first layer).

Original: The feature fusion is completed bythe Neighbor Masked Attention (NMA).
Revised: The feature fusion is completed bythe Neighbor Masked Attention (NMA).

Original: The final outputs of LQD are viewed as the reconstructedfeatures.
Revised: The final outputs of LQD are viewed as the reconstructedfeatures.

Original: Also, we propose a Feature Jittering (FJ) strategy to add perturbations to the input features,leading the model to learn normal distribution from the denoising task.
Revised: Also, we propose a Feature Jittering (FJ) strategy to add perturbations to the input features,leading the model to learn normal distribution from the denoising task.

Original: Finally, the results of anomalylocalization and detection are obtained through the reconstruction differences.
Revised: Finally, the results of anomalylocalization and detection are obtained through the reconstruction differences.

Original: [Figure]
Revised: [Figure]

Original: Masked
Revised: Masked

Original: [Figure]
Revised: [Figure]

Original: Query Embedding
Revised: Query Embedding

Original: Feed Forward Net
Revised: Feed Forward Net

Original: N ×
Revised: N ×

Original: MSE Loss
Revised: MSE Loss

Original: Feature Tokens
Revised: Feature Tokens

Original: Reconstructed Tokens
Revised: Reconstructed Tokens

Original: Feature Tokens
Revised: Feature Tokens

Original: Feed Forward Net
Revised: Feed Forward Net

Original: K
Revised: K

Original: N ×
Revised: N ×

Original: V
Revised: V

Original: Q
Revised: Q

Original: K
Revised: K

Original: V
Revised: V

Original: Q
Revised: Q

Original: Outputs of Last LQD Layer
Revised: Outputs of Last LQD Layer

Original: Perturbation
Revised: Perturbation

Original: K
Revised: K

Original: V
Revised: V

Original: Q
Revised: Q

Original: NME
Revised: NME

Original: LQD
Revised: LQD

Original: Feature Jittering
Revised: Feature Jittering

Original: Reconstructed Tokens
Revised: Reconstructed Tokens

Original: Difference
Revised: Difference

Original: Feature Tokens
Revised: Feature Tokens

Original: Reconstructed Tokens
Revised: Reconstructed Tokens

Original: +
Revised: +

Original: Localization Results
Revised: Localization Results

Original: Avg Pool & Max
Revised: Avg Pool & Max

Original: Detection Results
Revised: Detection Results

Original: Train on Normal Samples
Revised: Train on Normal Samples

Original: Test for Anomaly Localization & Detection + + + + + - + Add Followed by Layer Norm
Revised: Test for Anomaly Localization & Detection + + + + + - + Add Followed by Layer Norm

Original: Neighbor masked attention .
Revised: Neighbor masked attention .

Original: We suspect that the full attention in vanilla transformer [39] contributes to the “identical shortcut”.
Revised: We suspect that the full attention in vanilla transformer [41] contributes to the “identical shortcut”.

Original: In full attention, one token is permitted to see itself, so it will be easy to reconstruct by simply copying.
Revised: In full attention, one token is permitted to see itself, so it will be easy to reconstruct by simply copying.

Original: Moreover, considering that the feature tokens are extracted by a CNN backbone, the neighbor tokens must share lots of similarities.
Revised: Moreover, considering that the feature tokens are extracted by a CNN backbone, the neighbor tokens must share lots of similarities.

Original: Therefore, we propose to mask the neighbor tokens when calculating the attention map, called Neighbor Masked Attention (NMA).
Revised: Therefore, we propose to mask the neighbor tokens when calculating the attention map, called Neighbor Masked Attention (NMA).

Original: Note that the neighbor region is defined in the 2D space, as shown in Fig.
Revised: Note that the neighbor region is defined in the 2D space, as shown in Fig.

Original: [Figure]
Revised: [Figure]

Original: where pixels relate to neither themselves nor neighbors.
Revised: where pixels relate to neither themselves nor neighbors.

Original: Neighbor masked encoder .
Revised: Neighbor masked encoder .

Original: The encoder follows the standard architecture in vanilla transformer.
Revised: The encoder follows the standard architecture in vanilla transformer.

Original: Each layer consists of an attention module and a Feed-Forward Network (FFN).
Revised: Each layer consists of an attention module and a Feed-Forward Network (FFN).

Original: However, the fullattention is replaced by our proposed NMA to prevent the information leak.
Revised: However, the fullattention is replaced by our proposed NMA to prevent the information leak.

Original: Layer-wise query decoder .
Revised: Layer-wise query decoder .

Original: It is analyzed in Sec.
Revised: It is analyzed in Sec.

Original: 3.1 that the query embedding could help preventreconstructing anomalies well.
Revised: 3.1 that the query embedding could help preventreconstructing anomalies well.

Original: However, there is only one query embedding in the vanilla transformer.
Revised: However, there is only one query embedding in the vanilla transformer.

Original: Therefore, we design a Layer-wise Query Decoder (LQD) to intensify the use of query embedding,as shown in Fig.
Revised: Therefore, we design a Layer-wise Query Decoder (LQD) to intensify the use of query embedding,as shown in Fig.

Original: Specifically, in each layer of LQD, a learnable query embedding is first fusedwith the encoder embeddings, then integrated with the outputs of the previous layer (self-integrationfor the first layer).
Revised: Specifically, in each layer of LQD, a learnable query embedding is first fusedwith the encoder embeddings, then integrated with the outputs of the previous layer (self-integrationfor the first layer).

Original: The feature fusion is implemented by NMA.
Revised: The feature fusion is implemented by NMA.

Original: Following the vanilla transformer, a2-layer FFN is applied to handle these fused tokens, and the residual connection is utilized to facilitatethe training.
Revised: Following the vanilla transformer, a2-layer FFN is applied to handle these fused tokens, and the residual connection is utilized to facilitatethe training.

Original: The final outputs of LQD serve as the reconstructed features.
Revised: The final outputs of LQD serve as the reconstructed features.

Original: Feature jittering .
Revised: Feature jittering .

Original: Inspired by Denoising Auto-Encoder (DAE) [2, 40], we add perturbations to featuretokens, guiding the model to learn knowledge of normal samples by the denoising task.
Revised: Inspired by Denoising Auto-Encoder (DAE) [3, 42], we add perturbations to featuretokens, guiding the model to learn knowledge of normal samples by the denoising task.

Original: Specifically,for a feature token, f tok ∈ R C , we sample the disturbance D from a Gaussian distribution,
Revised: Specifically,for a feature token, f tok ∈ R C , we sample the disturbance D from a Gaussian distribution,

Original: [Equation]
Revised: [Equation]

Original: where α is the jittering scale to control the noisy degree.
Revised: where α is the jittering scale to control the noisy degree.

Original: Also, the sampled disturbance is added tof tok with a fixed jittering probability, p .
Revised: Also, the sampled disturbance is added tof tok with a fixed jittering probability, p .

Original: 3.3 Implementation details
Revised: 3.3 Implementation details

Original: Feature extraction .
Revised: Feature extraction .

Original: We adopt a fixed EfficientNet-b4 [37] pre-trained on ImageNet [11] as thefeature extractor.
Revised: We adopt a fixed EfficientNet-b4 [39] pre-trained on ImageNet [13] as thefeature extractor.

Original: The features from stage-1 to stage-4 are selected.
Revised: The features from stage-1 to stage-4 are selected.

Original: Here the stage means thecombination of blocks that have the same size of feature maps.
Revised: Here the stage means thecombination of blocks that have the same size of feature maps.

Original: Then these features are resized to thesame size, and concatenated along channel dimension to form a feature map, f org ∈ R C org × H × W .
Revised: Then these features are resized to thesame size, and concatenated along channel dimension to form a feature map, f org ∈ R C org × H × W .

Original: Afterward, this feature map is tokenized to H × W feature tokens with C org channels.

Original: Feature reconstruction .
Revised: Feature reconstruction .

Original: A linear projection is first applied to these feature tokens to reduce C org to a smaller channel, C .
Revised: The feature map, f org , is first tokenized to H × W feature tokens, followedby a linear projection to reduce C org to a smaller channel, C .

Original: Then these tokens are processed by NME and LQD.
Revised: Then these tokens are processed by NME and LQD.

Original: The learnableposition embeddings [12, 13] are added inthe attention module to inform the spatial information.
Revised: The learnable position embeddings [14, 15] are added in attention modules to informthe spatial information.

Original: Afterward, another linear projection is used to recover the channel from C to C org .
Revised: Afterward, another linear projection is used to recover the channel from C to C org .

Original: After reshape,the reconstructed feature map, f rec ∈ R C org × H × W , is finally obtained.
Revised: After reshape, the reconstructed feature map, f rec ∈ R C org × H × W , is finally obtained.

Original: Objective function .
Revised: Objective function .

Original: Our model is trained with the MSE loss as,
Revised: Our model is trained with the MSE loss as,

Original: [Equation]
Revised: [Equation]

Original: Inference for anomaly localization .
Revised: Inference for anomaly localization .

Original: The result of anomaly localization is an anomaly score map,which assigns an anomaly score for each pixel.
Revised: The result of anomaly localization is an anomaly score map,which assigns an anomaly score for each pixel.

Original: Specifically, the anomaly score map, s , is calculatedas the L2 norm of the reconstruction differences as,
Revised: Specifically, the anomaly score map, s , is calculatedas the L2 norm of the reconstruction differences as,

Original: [Equation]
Revised: [Equation]

Original: Then s is up-sampled to the image size with bi-linear interpolation to obtain the localization results.
Revised: Then s is up-sampled to the image size with bi-linear interpolation to obtain the localization results.

Original: Inference for anomaly detection .
Revised: Inference for anomaly detection .

Original: Anomaly detection aims to detect whether an image containsanomalous regions.
Revised: Anomaly detection aims to detect whether an image containsanomalous regions.

Original: We transform the anomaly score map, s , to the anomaly score of the image bytaking the maximum value of the averagely pooled s .
Revised: We transform the anomaly score map, s , to the anomaly score of the image bytaking the maximum value of the averagely pooled s .

Original:  Experiment
Revised:  Experiment

Original: 4.1 Datasets 
Revised: 4.1 Datasets and metrics

Original: MVTec-AD [3] is a comprehensive, multi-object, multi-defect industrial anomaly detection datasetwith 15 classes.
Revised: MVTec-AD [4] is a comprehensive, multi-object, multi-defect industrial anomaly detection datasetwith 15 classes.

Original: For each anomalous sample in the test set, the ground-truth includes both imagelabel and anomaly segmentation.
Revised: For each anomalous sample in the test set, the ground-truth includes both imagelabel and anomaly segmentation.

Original: In the existing literature, only the separate case is researched.
Revised: In the existing literature, only the separate case is researched.

Original: Inthis paper, we introduce the unified case, where only one model is used to handle all categories.
Revised: Inthis paper, we introduce the unified case, where only one model is used to handle all categories.

Original: CIFAR-10 [20] is a classical image classification dataset with 10 categories.
Revised: CIFAR-10 [22] is a classical image classification dataset with 10 categories.

Original: Each category has 5000images for training and 1000 images for testing. Existing methods [5, 21, 34] evaluate CIFAR-10 inthe separate case, where one class is viewed as normal samples, and others serve as anomalies. 
Revised: Existing methods [6, 23,36 ] evaluate CIFAR-10 mainly in the one-versus-many setting, where one class is viewed as normalsamples, and others serve as anomalies. Semantic AD [1, 9] proposes a many-versus-one setting,treating one class as anomalous and the remaining classes as normal.

Original: Incontrast, we propose the unified case, which is detailed in Sec. 4.4. 
Revised: Different from both, we proposea unified case ( many-versus-many setting), which is detailed in Sec. 4.4. Metrics .

Revised: Following prior works [4, 6, 50], the Area Under the Receiver Operating Curve (AUROC)is used as the evaluation metric for anomaly detection.

Original: 4.2 Anomaly detection on MVTec-AD
Revised: 4.2 Anomaly detection on MVTec-AD

Original: Setup .
Revised: Setup .

Original: Anomaly detection aims to detect whether an image contains anomalous regions.
Revised: Anomaly detection aims to detect whether an image contains anomalous regions.

Original: Theperformance is evaluated on MVTec-AD [3].
Revised: Theperformance is evaluated on MVTec-AD [4].

Original: The image size is selected as 224 × 224 , and the size forresizing feature maps is set as 14 × 14 .
Revised: The image size is selected as 224 × 224 , and the size forresizing feature maps is set as 14 × 14 .

Original: The feature maps from stage-1 to stage-4 of EfficientNet-b4[37] respectively have the channel of 24, 32, 56, and 160, and they are resized and concatenatedtogether to form a 272-channel feature map.
Revised: The feature maps from stage-1 to stage-4 of EfficientNet-b4[39] are resized and concatenated together to form a 272-channel feature map.

Original: The reduced channel dimension is set as 256.
Revised: The reduced channeldimension is set as 256.

Original: AdamWoptimizer [18] with weight decay 1 × 10 − 4 is used for training.
Revised: AdamW optimizer [20] with weight decay 1 × 10 − 4 is used.

Original: Our model is trained for 1000 epochson 8 GPUs (NVIDIA Tesla V100 16GB) with batch size 64.
Revised: Our model istrained for 1000 epochs on 8 GPUs (NVIDIA Tesla V100 16GB) with batch size 64.

Original: The learning rate is 1 × 10 − 4 initially,and dropped by 0.1 after 800 epochs.
Revised: The learningrate is 1 × 10 − 4 initially, and dropped by 0.1 after 800 epochs.

Original: The neighbor size is set as 7 × 7. The jittering scale and jitteringprobability are chosen as 20 and 1, respectively.
Revised: The neighbor size, jittering scale, andjittering probability are set as 7 × 7, 20, and 1, respectively.

Original: The evaluation is run with 5 random seeds.
Revised: The evaluation is run with 5 random seeds.

Revised: In both the separate case and the unified case, the reconstruction models are trained from the scratch.

Original: Baselines .
Revised: Baselines .

Original: Our approach is compared with baselines including: US [5], PSVDD [45], PaDiM [8],
Revised: Our approach is compared with baselines including: US [6], PSVDD [47], PaDiM [10],

Original: CutPaste [22], MKD [34], and DRAEM [48].
Revised: CutPaste [24], MKD [36], and DRAEM [50].

Original: Under the separate case, the baselines’ metric isreported in their papers except the metric of US borrowed from [48].
Revised: Under the separate case, the baselines’ metric isreported in their papers except the metric of US borrowed from [50].

Original: Under the unified case, US,
Revised: Under the unified case, US,

Original: PSVDD, PaDiM, CutPaste, MKD, and DRAEM are run with the publicly available implementations.
Revised: PSVDD, PaDiM, , MKD and DRAEM are run with the publicly available implementations

Original: Quantitative results of anomaly detection on MVTec-AD [3] are shown in Tab. 1.

Original: Thoughall baselines achieve excellent performances under the separate case, their performances drop

Original: [Table]
Revised: [Table]

Original: [Table] [Table][Table]
Revised: [Table] [Table]

Original: [Table] [Table]
Revised: [Table] [Table]

Original: [Table] [Table] [Table] [Table]
Revised: 96.8 ±

Original: [Table] [Table]
Revised: [Table] [Table]

Original: dramatically under the unified case.
Revised: Quantitative results of anomaly detection on MVTec-AD [4] are shown in Tab. 1. Thoughall baselines achieve excellent performances under the separate case, their performances dropdramatically under the unified case.

Original: The previous SOTA, DRAEM, a reconstruction-based methodtrained by pseudo-anomaly, suffers from a drop of near 10%.
Revised: The previous SOTA, DRAEM, a reconstruction-based methodtrained by pseudo-anomaly, suffers from a drop of near 10%.

Original: For another strong baseline, CutPaste,a pseudo-anomaly approach, the drop is as large as 18.6%.
Revised: For another strong baseline, CutPaste,a pseudo-anomaly approach, the drop is as large as 18.6%.

Original: However, our UniAD has almost noperformance drop from the separate case (96.6%) to the unified case (96.5%).
Revised: However, our UniAD has almost noperformance drop from the separate case (96.6%) to the unified case (96.5%).

Original: Moreover, we beat thebest competitor, DRAEM, by a dramatically large margin (8.4%), demonstrating our superiority.
Revised: Moreover, we beat thebest competitor, DRAEM, by a dramatically large margin (8.4%), demonstrating our superiority.

Original: 4.3 Anomaly localization on MVTec-AD
Revised: 4.3 Anomaly localization on MVTec-AD

Original: Setup and baselines .
Revised: Setup and baselines .

Original: Anomaly localization aims to localize anomalous regions in an anomalousimage.
Revised: Anomaly localization aims to localize anomalous regions in an anomalousimage.

Original: MVTec-AD [3] is chosen as the benchmark dataset.
Revised: MVTec-AD [4] is chosen as the benchmark dataset.

Original: The setup is the same as that in Sec. 4.2.
Revised: The setup is the same as that in Sec. 4.2.

Original: Besides the competitors in Sec.
Revised: Besides the competitors in Sec.

Original: 4.2, FCDD [24] is included, whose metric under the separate case isreported in its paper.
Revised: 4.2, FCDD [26] is included, whose metric under the separate case isreported in its paper.

Original: Under the unified case, we run FCDD with the implementation: FCDD.
Revised: Under the unified case, we run FCDD with the implementation: FCDD.

Original: Quantitative results of anomaly localization on MVTec-AD [3] are reported in Tab. 2.
Revised: Quantitative results of anomaly localization on MVTec-AD [4] are reported in Tab. 2.

Original: Similarto Sec.
Revised: Similarto Sec.

Original: 4.2, switching from the separate case to the unified case, the performance of all competitorsdrops significantly.
Revised: 4.2, switching from the separate case to the unified case, the performance of all competitors

Original: For example, the performance of US, an important distillation-based baseline,

Original: [Figure]
Revised: [Figure]

Original: Anomaly
Revised: Anomaly

Original: [Figure]
Revised: [Figure]

Original: GT

Original: Pred

Original: Normal

Original: Anomaly

Original: Recon

Original: GT
Revised: GT

Original: [Figure]
Revised: [Figure]

Original: The approach to visualizing reconstruction is the same as the one used in Fig.
Revised: The approach to visualizing reconstruction is the same as the one used in Fig.

Original: [Table]
Revised: [Table]

Original: decreases by 12.1%.
Revised: drops significantly. For example, the performance of US, an important distillation-based baseline,decreases by 12.1%.

Original: FCDD, a pseudo-anomaly approach, suffers from a dramatic drop of 28.7%,reflecting the pseudo-anomaly is not suitable for the unified case.
Revised: FCDD, a pseudo-anomaly approach, suffers from a dramatic drop of 28.7%,reflecting the pseudo-anomaly is not suitable for the unified case.

Original: However, our UniAD even gains aslight improvement from the separate case (96.6%) to the unified case (96.8%), proving the suitabilityof our UniAD for the unified case.
Revised: However, our UniAD even gains aslight improvement from the separate case (96.6%) to the unified case (96.8%), proving the suitabilityof our UniAD for the unified case.

Original: Moreover, we significantly surpass the strongest baseline, PaDiM,by 7.3%.
Revised: Moreover, we significantly surpass the strongest baseline, PaDiM,by 7.3%.

Original: This significant improvement reflects the effectiveness of our model.
Revised: This significant improvement reflects the effectiveness of our model.

Original: Qualitative results for anomaly localization on MVTec-AD [3] are illustrated in Fig.
Revised: Qualitative results for anomaly localization on MVTec-AD [4] are illustrated in Fig.

Original: For bothglobal (Fig. 5a) and local (Fig. 5b) structural anomalies, both scattered texture perturbations (Fig.
Revised: For bothglobal (Fig. 5a) and local (Fig. 5b) structural anomalies, both scattered texture perturbations (Fig.

Original: 5c)and multiple texture scratches (Fig. 5d), our method could successfully reconstruct anomalies to theircorresponding normal samples, then accurately localize anomalous regions through reconstructiondifferences.
Revised: 5c)and multiple texture scratches (Fig. 5d), our method could successfully reconstruct anomalies to theircorresponding normal samples, then accurately localize anomalous regions through reconstructiondifferences.

Original: More qualitative results are given in Supplementary Material .
Revised: More qualitative results are given in Supplementary Material .

Original: 4.4 Anomaly detection on CIFAR-10
Revised: 4.4 Anomaly detection on CIFAR-10

Original: Setup .
Revised: Setup .

Original: To further verify the effectiveness of our UniAD, we extend CIFAR-10 [20] to the unifiedcase, which consists of four combinations.
Revised: To further verify the effectiveness of our UniAD, we extend CIFAR-10 [22] to the unifiedcase, which consists of four combinations.

Original: For each combination, five categories together serveas normal samples, while other categories are viewed as anomalies.
Revised: For each combination, five categories together serveas normal samples, while other categories are viewed as anomalies.

Original: The class indices of the fourcombinations are { 01234 } , { 56789 } , { 02468 } , { 13579 } .
Revised: The class indices of the fourcombinations are { 01234 } , { 56789 } , { 02468 } , { 13579 } .

Original: Here, { 01234 } means the normal samplesinclude images from class 0 , 1 , 2 , 3 , 4 , and similar for others.
Revised: Here, { 01234 } means the normal samplesinclude images from class 0 , 1 , 2 , 3 , 4 , and similar for others.

Original: Note that the class index is obtained bysorting the class names of 10 classes.
Revised: Note that the class index is obtained bysorting the class names of 10 classes.

Original: The setup of the model is detailed in Supplementary Material .
Revised: The setup of the model is detailed in Supplementary Material .

Original: Baselines .
Revised: Baselines .

Original: US [5], FCDD [24], FCDD+OE [24], PANDA [30], and MKD [34] serve as competitors.
Revised: US [6], FCDD [26], FCDD+OE [26], PANDA [32], and MKD [36] serve as competitors.

Original: US, FCDD, FCDD+OE, PANDA, and MKD are run with the publicly available implementations.
Revised: US, FCDD, FCDD+OE, PANDA, and MKD are run with the publicly available implementations.

Original: Quantitative results of anomaly detection on CIFAR-10 [20] are shown in Tab. 3.
Revised: Quantitative results of anomaly detection on CIFAR-10 [22] are shown in Tab. 3.

Original: When fiveclasses together serve as normal samples, two recent baselines, US and FCDD, almost lose theirability to detect anomalies.
Revised: When fiveclasses together serve as normal samples, two recent baselines, US and FCDD, almost lose theirability to detect anomalies.

Original: When utilizing 10000 images sampled from CIFAR-100 [20] as auxiliary
Revised: When utilizing 10000 images sampled from CIFAR-100 [22] as auxiliary

Original: Outlier Exposure (OE), FCDD+OE improves the performance by a large margin.
Revised: Outlier Exposure (OE), FCDD+OE improves the performance by a large margin.

Original: We still stablyoutperform FCDD+OE by 3.2% without the help of OE, indicating the efficacy of our UniAD.
Revised: We still stablyoutperform FCDD+OE by 3.2% without the help of OE, indicating the efficacy of our UniAD.

Original: 4.5 Ablation studies
Revised: 4.5 Ablation studies

Original: To verify the effectiveness of the proposed modules and the selection of hyperparameters, weimplement extensive ablation studies on MVTec-AD [3] under the unified case.
Revised: To verify the effectiveness of the proposed modules and the selection of hyperparameters, weimplement extensive ablation studies on MVTec-AD [4] under the unified case.

Original: Layer-wise query .
Revised: Layer-wise query .

Original: Tab.
Revised: Tab.

Original: 4a verifies our assertion that the query embedding is of vital significance.1)
Revised: 4a verifies our assertion that the query embedding is of vital significance.1)

Original: Without query embedding, meaning the encoder embeddings are directly input to the decoder,the performance is the worst. 2)
Revised: Without query embedding, meaning the encoder embeddings are directly input to the decoder,the performance is the worst. 2)

Original: Adding only one query embedding to the first decoder layer ( i.e. ,vanilla transformer [39]) promotes the performance dramatically by 13.4% and 18.1% in anomaly 
Revised: Adding only one query embedding to the first decoder layer ( i.e. ,vanilla transformer [41]) promotes the performance dramatically by 13.4% and 18.1% in anomaly [Table]

Original: [Table]
Revised: [Table]

Original: localization and detection, respectively.
Revised: localization and detection, respectively.

Original: With layer-wise query embedding in each decoder layer,pixel-level and image-level AUROC is further improved by 3.7% and 7.4%, respectively.
Revised: With layer-wise query embedding in each decoder layer,pixel-level and image-level AUROC is further improved by 3.7% and 7.4%, respectively.

Original: Layer number .
Revised: Layer number .

Original: We conduct experiments to investigate the influence of layer number, as shownin Tab. 4b.
Revised: We conduct experiments to investigate the influence of layer number, as shownin Tab. 4b.

Original: 1) No matter with which combination, our model outperforms vanilla transformer by alarge margin, reflecting the effectiveness of our design.
Revised: 1) No matter with which combination, our model outperforms vanilla transformer by alarge margin, reflecting the effectiveness of our design.

Original: The best performance is achieved with amoderate layer number: 4Enc+4Dec.
Revised: The best performance is achieved with amoderate layer number: 4Enc+4Dec.

Original: A larger layer number like 6Enc+6Dec does not bring furtherpromotion, which may be because more layers are harder to train.
Revised: A larger layer number like 6Enc+6Dec does not bring furtherpromotion, which may be because more layers are harder to train.

Original: Neighbor masked attention .
Revised: Neighbor masked attention .

Original: The effectiveness of NMA is proven in Tab. 4a.
Revised: The effectiveness of NMA is proven in Tab. 4a.

Original: Under the caseof one query embedding, adding NMA brings promotion by 3.5% for localization and 8.5% fordetection.
Revised: Under the caseof one query embedding, adding NMA brings promotion by 3.5% for localization and 8.5% fordetection.

Original: The neighbor size of NMA is selected in Tab. 4c.
Revised: The neighbor size of NMA is selected in Tab. 4c.

Original: 1 × 1 neighbor size is the worst,because 1 × 1 is too small to prevent the information leak, thus the recovery could be completed bycopying neighbor regions.
Revised: 1 × 1 neighbor size is the worst,because 1 × 1 is too small to prevent the information leak, thus the recovery could be completed bycopying neighbor regions.

Original: A larger neighbor size ( ≥ 5 × 5) is obviously much better, and the bestone is selected as 7 × 7. 3)
Revised: A larger neighbor size ( ≥ 5 × 5) is obviously much better, and the bestone is selected as 7 × 7. 3)

Original: We also study the place to add NMA in Tab. 4d.
Revised: We also study the place to add NMA in Tab. 4d.

Original: Only adding NMA in theencoder (Enc) is not enough.
Revised: Only adding NMA in theencoder (Enc) is not enough.

Original: The performance could be stably improved when further adding NMAin the first or second attention in the decoder (Enc+Dec1, Enc+Dec2) or both (All).
Revised: The performance could be stably improved when further adding NMAin the first or second attention in the decoder (Enc+Dec1, Enc+Dec2) or both (All).

Original: This reflects thatthe full attention of the decoder also contributes to the information leak.
Revised: This reflects thatthe full attention of the decoder also contributes to the information leak.

Original: Feature jittering .
Revised: Feature jittering .

Original: 1) Tab. 4a confirms the efficacy of FJ.
Revised: 1) Tab. 4a confirms the efficacy of FJ.

Original: With one query embedding as the baseline,introducing FJ could bring an increase of 3.0% for localization and 7.4% for detection, respectively.2)
Revised: With one query embedding as the baseline,introducing FJ could bring an increase of 3.0% for localization and 7.4% for detection, respectively.2)

Original: According to Tab. 4e, the jittering scale, α , is chosen as 20.
Revised: According to Tab. 4e, the jittering scale, α , is chosen as 20.

Original: A larger α ( i.e. , 30) disturbs the featuretoo much, degrading the results.
Revised: A larger α ( i.e. , 30) disturbs the featuretoo much, degrading the results.

Original: In Tab.
Revised: In Tab.

Original: 4f, the jittering probability, p , is studied.
Revised: 4f, the jittering probability, p , is studied.

Original: In essence, thetask would be a denoising task with feature jittering, and be a reconstruction task without featurejittering.
Revised: In essence, thetask would be a denoising task with feature jittering, and be a reconstruction task without featurejittering.

Original: The results show that the full denoising task ( i.e. , p = 1 ) is the best.
Revised: The results show that the full denoising task ( i.e. , p = 1 ) is the best.

Original:  Conclusion
Revised:  Conclusion

Original: In this work, we propose UniAD that unifies anomaly detection regarding multiple classes.
Revised: In this work, we propose UniAD that unifies anomaly detection regarding multiple classes.

Original: For such achallenging task, we assist the model against learning an “identical shortcut” with three improvements.
Revised: For such achallenging task, we assist the model against learning an “identical shortcut” with three improvements.

Original: First, we confirm the effectiveness of the learnable query embedding and carefully tailor a layer-wisequery decoder to help model the complex distribution of multi-class data.
Revised: First, we confirm the effectiveness of the learnable query embedding and carefully tailor a layer-wisequery decoder to help model the complex distribution of multi-class data.

Original: Second, we come up with aneighbor masked attention module to avoid the information leak from the input to the output.
Revised: Second, we come up with aneighbor masked attention module to avoid the information leak from the input to the output.

Original: Third,we propose feature jittering that helps the model less sensitive to the input perturbations.
Revised: Third,we propose feature jittering that helps the model less sensitive to the input perturbations.

Original: Under theunified task setting, our method achieves state-of-the-art performance on MVTec-AD and CIFAR-10datasets, significantly outperforming existing alternatives.
Revised: Under theunified task setting, our method achieves state-of-the-art performance on MVTec-AD and CIFAR-10datasets, significantly outperforming existing alternatives.

Original: Discussion .
Revised: Discussion .

Original: In this work, different kinds of objects are handled without being distinguished.
Revised: In this work, different kinds of objects are handled without being distinguished.

Original: We havenot used the category labels that may help the model better fit multi-class data.
Revised: We havenot used the category labels that may help the model better fit multi-class data.

Original: How to incorporatethe unified model with category labels should be further studied.
Revised: How to incorporatethe unified model with category labels should be further studied.

Original: In practical applications, the normalsamples are not as consistent as those in MVTec-AD.
Revised: In practical uses, normal samples arenot as consistent as those in MVTec-AD, often manifest themselves in some diversity.

Original: Therefore, the ability to deal with the scenarioswhere the normal samples share some diversity is important. Our UniAD is capable of handling all15 categories in MVTec-AD, hence would be more suitable for real scenes. 
Revised: Our UniADcould handle all 15 categories in MVTec-AD, hence would be more suitable for real scenes. However,anomaly detection may be used for video surveillance, which may infringe personal privacy.

Original: Checklist
Revised: Checklist

Original: For all authors...
Revised: For all authors...

Original: (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
Revised: (a) Do the main claims made in the abstract and introduction accurately reflect the paper’scontributions and scope?

Original: [Yes]
Revised: [Yes]

Original: (b) Did you describe the limitations of your work?
Revised: (b) Did you describe the limitations of your work?

Original: [Yes] See Sec. 5.
Revised: [Yes] See Sec. 5.

Original: (c) Did you discuss any potential negative societal impacts of your work?
Revised: (c) Did you discuss any potential negative societal impacts of your work?

Original: [N/A]
Revised: [N/A]

Original: (d) Have you read the ethics review guidelines and ensured that your paper conforms tothem?
Revised: (d) Have you read the ethics review guidelines and ensured that your paper conforms tothem?

Original: [Yes]
Revised: [Yes]2.

Original: If you are including theoretical results...
Revised: If you are including theoretical results...

Original: (a) Did you state the full set of assumptions of all theoretical results?
Revised: (a) Did you state the full set of assumptions of all theoretical results?

Original: [N/A]
Revised: [N/A](b)

Original: (b) Did you include complete proofs of all theoretical results?
Revised: Did you include complete proofs of all theoretical results?

Original: [N/A]
Revised: [N/A]

Original: If you ran experiments...
Revised: If you ran experiments...

Original: (a) Did you include the code, data, and instructions needed to reproduce the main
Revised: (a) Did you include the code, data, and instructions needed to reproduce the main

Original: experimental results (either in the supplemental material or as a URL)?
Revised: experimental results (either in the supplemental material or as a URL)?

Original: [Yes] SeeSec. 4 and the supplemental material.
Revised: [Yes] See Sec. 4 and the supplemental material.

Original: (b) Did you specify all the training details (e g., data splits, hyperparameters,
Revised: (b) Did you specify all the training details (e.g., data splits, hyperparameters,

Original: how they
Revised: how they

Original: were chosen)?
Revised: were chosen)?

Original: [Yes] See Sec.
Revised: [Yes] See Sec.

Original: 4.1 & Sec.
Revised: 4.1 & Sec.

Original: 4.4 for data splits, and Sec.
Revised: 4.4 for data splits, and Sec.

Original: 4.5 for the choice
Revised: 4.5 for the choice

Original: of hyperparameters.
Revised: of hyperparameters.

Original: (c) Did you report error bars (e.g., with respect to the random seed after running
Revised: (c) Did you report error bars (e.g., with respect to the random seed after running

Original: experiments multiple times)?
Revised: experiments multiple times)?

Original: [Yes] See Tab. 1, Tab. 2, and Tab. 3.
Revised: [Yes] See Tab. 1, Tab. 2, and Tab. 3.

Original: (d) Did you include the total amount of compute and the type of resources used (e.g., type
Revised: (d) Did you include the total amount of compute and the type of resources used (e

Original: of GPUs, internal cluster, or cloud provider)?
Revised: g., typeof GPUs, internal cluster, or cloud provider)?

Original: [Yes] See Setup in Sec.4.2.
Revised: [Yes] See Setup in Sec.

Original: If you are using existing assets (e
Revised: If you are using existing assets (e

Original: g., code, data, models) or curating/releasing new assets...
Revised: g., code, data, models) or curating/releasing new assets...

Original: (a) If your work uses existing assets, did you cite the creators?
Revised: (a) If your work uses existing assets, did you cite the creators?

Original: [Yes] See Sec. 4.
Revised: [Yes] See Sec. 4.

Original: (b) Did you mention the license of the assets?
Revised: (b) Did you mention the license of the assets?

Original: [N/A]
Revised: [N/A]

Original: (c) Did you include any new assets either in the supplemental material or as a URL?
Revised: (c) Did you include any new assets either in the supplemental material or as a URL?

Original: [N/A]
Revised: [N/A]

Original: (d) Did you discuss whether and how consent was obtained from people whose data you’re
Revised: (d) Did you discuss whether and how consent was obtained from people whose data you’re

Original: using/curating?
Revised: using/curating?

Original: [N/A]
Revised: [N/A]

Original: (e) Did you discuss whether the data you are using/curating contains personally identifiable
Revised: (e) Did you discuss whether the data you are using/curating contains personally identifiable

Original: information or offensive content?
Revised: information or offensive content?

Original: [N/A]
Revised: [N/A]

Original: If you used crowdsourcing or conducted research with human 
Revised: If you used crowdsourcing or conducted research with human subjects...

Original: subjects...

Original: (a) Did you include the full text of instructions given to participants 
Revised: (a) Did you include the full text of instructions given to participants and screenshots, if

Original: and

Original: screenshots

Original: , if

Original: applicable?
Revised: applicable?

Original: [N/A]
Revised: [N/A]

Original: (b) Did you describe any potential participant risks , with links to Institutional Review
Revised: (b) Did you describe any potential participant risks, with links to Institutional Review

Original: Board (IRB) approvals, if applicable?
Revised: Board (IRB) approvals, if applicable?

Original: [N/A]
Revised: [N/A]

Original: c) Did you include the estimated hourly wage paid to participants and the total amount
Revised: (c) Did you include the estimated hourly wage paid to participants and the total amount

Original: spent on participant compensation?
Revised: spent on participant compensation?

Original: [N/A]
Revised: [N/A]