Paper: Stylist: Style-Driven Feature Ranking for Robust Novelty Detection (ICLR-2024)

Reviewer comment (Novelty):
The paper addresses a minor tweak of an existing problem and proposes an intuitive method that can be integrated with existing techniques, resulting in a clear improvement over the baseline. While tackling a niche problem can be an easy way to write a paper, in representative venues like ICLR the focus should be on addressing the core of the problem rather than opting for low-hanging fruit. The authors could explore more impactful problems; for example, a single scalar uncertainty metric fails to differentiate between novel styles and contents. The proposed Stylist can be viewed as introducing a two-dimensional uncertainty to address this limitation. Building on this concept, the authors might consider developing a unified framework that addresses both domain generalization and novelty detection in real-world situations.

Author response:
**W1. Limited scope**
Respectfully, we don’t consider the Stylist approach or its setup a minor tweak or a low-hanging fruit, but on the contrary, it could help address really impactful problems. 

First, If the reviewer referred to the downstream task impact:

***a) Robust Novelty Detection (ND) task***: Going from ND towards Robust ND does not create a niche, but quite the contrary, extending the solutions that work only in isolated/well-controlled lab scenarios (where the style distribution remains stable at test time) towards real-life scenarios ( where this is almost never the case). Our solution is particularly suitable for this task because it allows us to define what a novelty is, in an implicit way, by excluding what it is not (the style), in a very generic way and weakly supervised manner. As opposed to this, for instance, a supervised downstream task would focus on defining the content, rather than defining the non-content (the style). Such an approach requires lots of supervision and focus on covering all the variations for the content aspects.

Secondly, if the reviewer referred to the main contribution impact, there is a large applicability to the idea:

***b) Biases***: Using Stylist, one can identify biases in a dataset, given a pre-trained representation by interpreting the environment-biased features. This could lead to better datasets in the field, and better understanding and discovery of the existing biases from commonly used data.

***c) Implicit Robustness***: Using Stylist, one can define the “space” for robustness in an implicit way, through environments (rather than doing it explicitly, with augmentations for instance). This leads to far more general and robust algorithms.

For both b) and c) scenarios, you need a way to define (label) or find (maybe in an unsupervised way) intrinsic environments from the dataset.

Reviewer comment (Experiments):
The OOD detection competitors considered in the paper apply simple methods, such as OCSVM or kNN, on top of a fixed representation. Given that this paper refines the representation, it is unsurprising that the proposed method enhances the original representation when appropriate hyperparameters are selected. Furthermore, it is unclear how the hyperparameters were selected; it seems they were chosen for optimal performance in the reported table. However, (1) hyperparameters should not be spoiled by the test cases, and (2) the OOD detection method should be robust to unseen samples. The correct approach is to select hyperparameters in a validation domain and evaluate their performance on novel test domains.

Author response:
**W4 and Q2. Hyperparameter selection**

***[hyperparameters]*** Stylist is robust to the choice of hyperparameters. We emphasize the constant improvement illustrated below. 

Hyperparameters:

* ***The feature extractor:***
In Table 2 of our manuscript we provide an analysis of the performance w.r.t. the considered feature extractor. Our Stylist, improves the performance regardless of the selected feature extractor. 

* ***The distance metric*** and the ***combination between pairwise distances*** employed in Step1 of our algorithm:
In Figure 7 of our manuscript we provide an ablation study regarding this matter. We highlight the performance improvement of our Stylist, irrespective of the considered configuration. 

* ***The percent of selected features***, for Step2 of our algorithm:
As highlighted in Figure 3, Stylist consistently improves over the baseline w.r.t. the percent of considered features, proving that the provided feature ranking is relevant for the novelty detection problem. To select an optimal percent of features per setup, we employ a validation step, analyzing either the performance on an ID validation set or the performance on an OOD test set. As highlighted in the table below, there is a very small performance variance between those techniques (< 0.07 for ResNet-18 features, and even 0 for CLIP features), highlighting that the performance is stable. This is an important property of our algorithm, managing to improve OOD performance, with ID chosen hyperparameters.

Reviewer comment (Novelty):
The cut and paste strategy used for creating COCOShift95 has been considered in prior works such as Waterbirds and Background Challenge. Additionally, natural benchmarks such as MetaShift, which include multi-domain images from COCO, could have been used instead. Therefore, the technical contribution of the proposed dataset collection strategy is also not convincing.

Author response:
**W5.2. (2) The cut and paste strategy has been considered in prior works. The approach of creating an artificial dataset through cut and paste has been proposed in previous works, such as Waterbirds and Background Challenge. Additionally, why not use more natural benchmarks, such as MetaShift, which also include multi-domain images from COCO? Therefore, the technical contribution of the proposed dataset collection strategy is also not convincing.**

We took them into account in the beginning, but each one has at least one major flaw that led us to discard them.

***[Waterbirds]*** This dataset has only 2 environments, one used for training, and one used for testing. The existence of multiple environments is essential to define what the style consists of, so we need to see at least 2 domains to determine the environment-biased features. Indeed, it is very similar to COCOShift in other regards.

***[Background challenge benchmark]*** This benchmark does not provide labels for the style, but only for the content, so we can’t run our approach on top of it as we need to know the environment for each sample. Furthermore, by construction, we have secondary objects in the samples, for which we don’t have labels, but they come from the same set of classes as the main content. This makes it impossible to have a clear separation between the style and content.

***[MetaShift]*** Here, the annotations of each image encompass nearly all the objects present within it. Usually, there are 3 or more different objects per image, which intersect the content and environment label sets. Also, the labels are very noisy. A clear example is the image highlighted at https://huggingface.co/datasets/metashift?row=3 . The image is labeled as a bus in a fence context, but the predominant objects in the foreground are the horses, which is a given label for other samples. This is such a common occurrence that we only found 2159 clean samples (with no conflicting annotations). For non-intersecting content and environment label sets, there are only 281 samples. We consider that these numbers are too small to create a reliable benchmark.

Reviewer comment (Experiments):
Were the hyperparameters chosen from the val set, and are they generalizable to unseen domains?

Author response:
**W4 and Q2. Hyperparameter selection**

***[hyperparameters]*** Stylist is robust to the choice of hyperparameters. We emphasize the constant improvement illustrated below. 

Hyperparameters:

* ***The feature extractor:***
In Table 2 of our manuscript we provide an analysis of the performance w.r.t. the considered feature extractor. Our Stylist, improves the performance regardless of the selected feature extractor. 

* ***The distance metric*** and the ***combination between pairwise distances*** employed in Step1 of our algorithm:
In Figure 7 of our manuscript we provide an ablation study regarding this matter. We highlight the performance improvement of our Stylist, irrespective of the considered configuration. 

* ***The percent of selected features***, for Step2 of our algorithm:
As highlighted in Figure 3, Stylist consistently improves over the baseline w.r.t. the percent of considered features, proving that the provided feature ranking is relevant for the novelty detection problem. To select an optimal percent of features per setup, we employ a validation step, analyzing either the performance on an ID validation set or the performance on an OOD test set. As highlighted in the table below, there is a very small performance variance between those techniques (< 0.07 for ResNet-18 features, and even 0 for CLIP features), highlighting that the performance is stable. This is an important property of our algorithm, managing to improve OOD performance, with ID chosen hyperparameters.

Reviewer comment (Novelty):
Important references are missing. There have been some works on how to achieve novelty detection in the case of domain shift, which is the same as this paper. For example:  
1. Open domain generalization with domain-augmented meta-learning. CVPR 2021  
2. Open-set learning under covariate shift. ML 2022  
3. Open-Set Single Domain Generalization. ICLR 2022  
These works all consider open-set learning/novelty detection under distribution shift. Moreover, the ML'22 and ICLR’22 works could improve cross-domain generalization without the requirement of multiple domains.

Author response:
This is a very important observation, we address it below (we refer to those methods in the revised paper).

***[open set vs novelty detection]*** Open-set (OS) and novelty detection (ND) are strongly related, but also different in some key aspects. OS requires more supervision than ND, as during training, OS has access to the semantic labels of the normal/known data. Meanwhile, ND observes during training the set of normal classes, without having access to their specific content labels. OS is typically approached in a supervised learning context, while ND methods are often employed in an unsupervised context.  The indicated papers are not an exception, requiring annotated semantic labels for the training set. CVPR’21 optimizes a meta-learning objective that requires semantic labels. ML’22 requires the target concepts in order to identify the semantic and environmental parts of the image for the EnvMix step. ICLR’22 employs semantic labels for the minimization stage and implicitly they are used for increasing the diversity of the source domain and the generation of auxiliary unknown class samples. 

***[requirement of multiple domains]*** Our Stylist employs the multi-environment setup as a way of defining the style of the images, namely the covariate shifts that should be ignored. Our algorithm is flexible and not restricted to a fixed definition of style and content. Content should not be understood as elements of WordNet hierarchy, but rather as what is constant between environments. Similarly, we define the style as the elements that vary between environments. In this setup, the absence of multiple training domains means the absence of a defined problem. 

***CVPR’21*** Open Domain Generalization with Domain-Augmented Meta-Learning. Yang Shu, Zhangjie Cao, Chenyu Wang, Jianmin Wang, Mingsheng Long, CVPR 2021

***ML’22*** Open-set learning under covariate shift. Jie-Jing Shao, Xiao-Wen Wang, Lan-Zhe Guo, Machine Learning 2022

***ICLR’22*** CrossMatch: Cross-Classifier Consistency Regularization for Open-Set Single Domain Generalization. Ronghang Zhu, Sheng Li, ICLR 2022

Reviewer comment (Novelty):
The previous works mainly focus on improving model robustness from the perspective of representation learning, while the current work assumes that the representation has already been well learned and mainly focuses on feature selection.

Author response:
***[sufficiency of representation capacity]*** We rely on the existence of a pre-trained representation that captures relevant features for both known and unknown content and style. Considering the availability of heavily pre-trained models and scenarios like the use case illustrated below, such a representation can be easily accessible. As we are focusing on a flexible definition of style and content, an ideal representation will evenly capture elements of style and content.

***[will it still learn spurious correlations]*** In the unsupervised setup of novelty detection, during training, we observe normal samples in a few training environments. Assuming a perfectly balanced dataset, the ND algorithm will immediately correlate the normal samples with the seen training environments as it does not have access to semantic labels, as in the case of open-set recognition, to guide the learning process towards semantic features. Also, we can deal with biased datasets, which can further enhance this effect. In this context, the feature ranking strategy employed by Stylist will ensure that the novelty detection algorithm only has access to the relevant features, while ignoring environment-biased ones.

Reviewer comment (Experiments):
How does the author consider the sufficiency of representation capacity? Can we assume that the representation has been sufficiently learned after thorough across-domain representation learning? Will it still learn spurious correlations? Comparison with these works, especially the specific clarification of the applicable scope for this work, will further improve this manuscript.

Author response:
***[sufficiency of representation capacity]*** We rely on the existence of a pre-trained representation that captures relevant features for both known and unknown content and style. Considering the availability of heavily pre-trained models and scenarios like the use case illustrated below, such a representation can be easily accessible. As we are focusing on a flexible definition of style and content, an ideal representation will evenly capture elements of style and content.

***[will it still learn spurious correlations]*** In the unsupervised setup of novelty detection, during training, we observe normal samples in a few training environments. Assuming a perfectly balanced dataset, the ND algorithm will immediately correlate the normal samples with the seen training environments as it does not have access to semantic labels, as in the case of open-set recognition, to guide the learning process towards semantic features. Also, we can deal with biased datasets, which can further enhance this effect. In this context, the feature ranking strategy employed by Stylist will ensure that the novelty detection algorithm only has access to the relevant features, while ignoring environment-biased ones.

Reviewer comment (Novelty):
Differences with existing work and the rationale behind the assumptions made in the current work. [See weakness part]

Author response:
***[open set vs novelty detection]*** Open-set (OS) and novelty detection (ND) are strongly related, but also different in some key aspects. OS requires more supervision than ND, as during training, OS has access to the semantic labels of the normal/known data. Meanwhile, ND observes during training the set of normal classes, without having access to their specific content labels. OS is typically approached in a supervised learning context, while ND methods are often employed in an unsupervised context.  The indicated papers are not an exception, requiring annotated semantic labels for the training set. CVPR’21 optimizes a meta-learning objective that requires semantic labels. ML’22 requires the target concepts in order to identify the semantic and environmental parts of the image for the EnvMix step. ICLR’22 employs semantic labels for the minimization stage and implicitly they are used for increasing the diversity of the source domain and the generation of auxiliary unknown class samples. 

***[requirement of multiple domains]*** Our Stylist employs the multi-environment setup as a way of defining the style of the images, namely the covariate shifts that should be ignored. Our algorithm is flexible and not restricted to a fixed definition of style and content. Content should not be understood as elements of WordNet hierarchy, but rather as what is constant between environments. Similarly, we define the style as the elements that vary between environments. In this setup, the absence of multiple training domains means the absence of a defined problem.

Reviewer comment (Experiments):
In practice, how to determine the proportion of selected features? As shown in Figure 3. An inappropriate number of selected features can lead to a drop in ROC-AUC.

Author response:
We can determine the optimal proportion of features following a validation methodology on the ID validation set or by employing an oracle strategy and interrogating the OOD test set. In the table below we compare these approaches, highlighting that the optimal number of features is stable between the two setups. The variance between the two approaches is <=0.068.  Also, we emphasize that Stylist manages to always improve over the baseline considering 100% of the features, in all the considered configurations. 

|Dataset | Features | Optimal nr. of features selection approach | ROC-AUC all feat. | ROC-AUC Stylist feat. | % selected feat. |
|--|--|--|--|--|--|
|COCOShift_balanced | CLIP | Based on ID val set | 95.06 | 95.40 (+0.34) | 95 | 
| |  | Based on OOD test set | 95.06 | 95.40 (+0.34) | 95 | 
| |  | **Variance w.r.t. features selection approach** | - | **0** | - | 
| | ResNet-18 | Based on ID val set | 80.93 | 83.24 (+2.31) | 10 | 
| |  | Based on OOD test set | 80.93 | 83.49 (+2.56) | 40 | 
| |  | **Variance w.r.t. features selection approach** | - | **0.068** | - | 
|COCOShift75 | CLIP | Based on ID val set | 94.88 | 95.21 (+0.33) | 95 | 
| |  | Based on OOD test set | 94.88 | 95.21 (+0.33) | 95 | 
| |  | **Variance w.r.t. features selection approach** | - | **0** | - | 
| | ResNet-18 | Based on ID val set | 80.40 | 84.71 (+4.31) | 10 | 
| |  | Based on OOD test set | 80.40 | 84.71 (+4.31) | 10 | 
| |  | **Variance w.r.t. features selection approach** | - | **0** | - | 
|COCOShift95 | CLIP | Based on ID val set | 94.53 | 94.92 (+0.39) | 95 | 
| |  | Based on OOD test set | 94.53 | 94.92 (+0.39) | 95 | 
| |  | **Variance w.r.t. features selection approach** | - | **0** | - | 
| | ResNet-18 | Based on ID val set | 79.82 | 85.01 (+5.19) | 25 | 
| |  | Based on OOD test set | 79.82 | 85.13 (+5.31) | 30 | 
| |  | **Variance w.r.t. features selection approach** | - | **0.008** | - |

Reviewer comment (Experiments):
The paper focuses on the problem of detecting novel environments based on semantic and style changes, but it does not address other important aspects of novelty detection, such as temporal changes or changes in the data distribution over time. The authors could expand the scope of their work to address these other aspects of novelty detection and provide a more comprehensive solution to the problem.

Author response:
**W3. The paper focuses on the problem of detecting novel environments based on semantic and style changes, but it does not address other important aspects of novelty detection, such as temporal changes or changes in the data distribution over time. The authors could expand the scope of their work to address these other aspects of novelty detection and provide a more comprehensive solution to the problem.**

This is a very interesting point raised by the reviewer. The proposed approach is flexible to the definition of style and content. Style should not be understood solely as characteristics that separate for example sketches, real images, or paintings (as in DomainNet), or specific background characteristics like water, sand, or forest (as in Waterbirds, or fMoW with regions environments), but rather as the general covariate shift that we wish to be robust to (as temporal shifts that you mentioned).

Our Stylist method does not make any other assumption on what the style is, the only way to provide a definition for what is the style, is the multi-environment setup considered in our work: what is changing between environments is irrelevant for the final task, and we call it style. So, if our training environments are composed of aerial images of a city observed over a long period of time, the style will capture those changes that occur over time. 
Moreover, we did a test to emphasize your proposed temporal shift use-case. First, we applied Stylist for the first 5 years of fMoW. Next, we observed the ND performance using our solution on a later year (with a visible temporal shift). The ROC-AUC improvement is around 1%, when compared with using all the features, emphasizing that our method works for different types of styles, specified and embedded as supervision signals from the multi-environment labels setup.

Reviewer comment (Novelty):
The authors mention that their method focuses on feature ranking rather than domain adaptation or anomaly detection, but it is not clear how this approach is fundamentally different from other methods. Could the authors provide more details on how their method differs from existing methods and what makes it unique?

Author response:
**Q1 (and W1) - The authors mention that their method focuses on feature ranking rather than domain adaptation or anomaly detection, but it is not clear how this approach is fundamentally different from other methods. Could the authors provide more details on how their method differs from existing methods and what makes it unique?**

We have completed the comparative analysis from our manuscript tackling the following points:

***[Robust Novelty Detection (our task) vs. Anomaly Detection]*** While anomaly detection is focused on identifying any abnormal or previously unseen elements, robust novelty detection focuses on identifying content distribution changes, while ignoring style changes that may appear. Considering the first example from Figure 1 of our manuscript, in anomaly detection, the sketch of the banana should be identified as an anomaly, because the style change is still considered an anomaly. In Robust Novelty Detection, the banana is classified as a normal class, because we should be robust to style changes.

***[Robust Novelty Detection (our task) vs. Open Set Recognition]*** Open-set (OS) and novelty detection (ND) are strongly related, but also different in some key aspects. OS requires more supervision than ND, as during training, OS has access to the semantic labels of the normal / known data. Meanwhile, ND observes during training the set of normal classes, without having access to their specific content labels. OS is typically approached in a supervised learning context, while ND methods are often employed in an unsupervised context.

***[Stylist (ours) vs. Domain Adaptation]*** Stylist is rather a domain generalization technique, removing environment-biased features and in consequence building representations that are robust to covariate shifts. Different from a domain adaptation technique (like TENT or TTT-MAE), Stylist does not require access to unlabeled target environment (test) data in order to compute the feature ranking.

Reviewer comment (Reproducibility):
It is not clear how to compute the Eq.(1) and Eq.(2). For example, how to construct different environments? How to split the features extracted from a pre-trained model into $N$ dimensions? It seems that if the pre-trained feature is very large, the computational cost is expensive.

Author response:
**W1. How to construct different environments? How to split the extracted features into N dimensions? The computational cost is expensive.**

***[environments]*** For the current version of our method, we need to have labels for the environments, so we don’t build them, we consider them as given. In the generalization field, there are a lot of works that are based on having annotations for multiple training distributions (=our environments), like IRM, LISA, or all the other methods that report on the WILDS benchmark.

***[extracted features]*** We think there is a misunderstanding here, we don’t split the features into N dimensions, but simply take the entire pre-trained features (e.g. ResNet18, with 512 features) and decide for each feature (of all 512 features), with our method, how much it varies between different environments.

***[computational cost]*** Quite the opposite, the computational impact is really low. For each feature, we only need to compute the inter-environments Wasserstein distances, which is extremely fast (for instance, for 10k samples, split into 5 environments, it takes ~ 4 seconds on a single CPU, with no optimizations whatsoever, since this was not our focus). All those operations can also be easily parallelized on CPUs. For more details on the implementation, we also attach the code to the submission.

***IRM*** - Invariant Risk Minimization: Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, David Lopez-Paz

***LISA*** - Improving Out-of-Distribution Robustness via Selective Augmentation: Huaxiu Yao, Yu Wang, Sai Li, Linjun Zhang, Weixin Liang, James Zou, Chelsea Finn

***WILDS*** - https://wilds.stanford.edu/datasets/

Reviewer comment (Experiments):
In the experiments, the authors simply compare the proposal with the feature selection method and novelty detection method. However, there are some algorithms related to spurious relations that can be easily adapted to solve the novelty detection problem. Moreover, the adopted novelty detection methods are not SOTA. So, the experiment results are not convincing. More related methods should be discussed.

Author response:
**W2. Comparison with other spurious algorithms and SOTA for Novelty Detection. More related methods should be discussed.**

***[Comparison with invariant learning (or other spurious-related algorithms)]***
There is a very important difference in the setup between the existing methods for learning features that are invariant to the environment (like IRM) and our Stylist:

***a)*** For computing the invariant features, all the others need both semantic (content) labels (namely content classes) and environment labels, while our Stylist only needs the environment labels. We argue that it is a huge effort to have those semantic labels, similar to the supervised vs unsupervised differences.

***b)*** Indeed, to continue the argument, one may say that we use pre-trained models. And this means we also need labels at some point. So, to balance the need for semantic labels, we can make the IRM also use pre-trained models this way: one can learn IRM to predict labels that a pre-trained method gives for the current dataset. But this is a tricky step, because it might result in a lot of knowledge loss, since for training the IRM, you will go beyond the pre-trained features, to a final target class that is not necessarily mapped over the new dataset. This way, the final supervision will greatly influence the representations, especially if there is not a 100% alignment between your new dataset and the pre-trained model training dataset (and this is a common case).

***c)*** Nevertheless, since semantic labels are available in our used datasets, we did an experiment that focuses on the complementarity between the methods, not on their differences (we explained before why this direct comparison is not fair): We first trained IRM on those semantic labels. Next, we applied Stylist on top of them. Interestingly, we see a 1% increase over using 100% of the features, showing that the two methods are somehow complementary.

***IRM*** - Invariant Risk Minimization: Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, David Lopez-Paz

***[SOTA for Novelty Detection]*** Our method is for ***a) feature selection***, while the downstream task is ***b) Novelty Detection***, analysed in the setup where the data is shifting.

***b)*** Indeed, we do not compare against SOTA solutions for Novelty Detection, since they have no focus on the distribution shift of the input data, unlike in our case, and the comparison would be pointless. The most similar setup we found for ND in out-of-distribution, is the Out-of-distribution detection, because there is a shift in data and for a good performance, the model should be able to detect it. So we compare against the SOTA for this task (Out-of-distribution detection), called kNN+. We also add to the comparison with classic Novelty Detection solutions, that could be easily adapted for our setup (see Table 1).

***a)*** Consequently, we also compared against other feature selection approaches, basic and adapted for multiple-environments (env-aware) (see Figure 6).

***kNN+*** - Out-of-Distribution Detection with Deep Nearest Neighbors: Yiyou Sun, Yifei Ming, Xiaojin Zhu, Yixuan Li


***[More related methods]*** The reviewer does not specify exactly the related methods to be discussed. We add in the revised paper **Open-Set methods** and **Domain adaptation** ones (see related work). We have discussed already in the experimental section **Feature selection** and **Novelty detection** algorithms, and in the related work, **spurious/invariant learning** methods.

Reviewer comment (Novelty):
In my view, the spurious problems can be easily addressed with data augmentation. So I think maybe there exist easier methods to solve the problem in this paper.

Author response:
**W3. The spurious problems can be easily addressed with data augmentation**
Since it might be true that with the proper augmentations for each task and dataset, you might address some of the bias problems (like ImageNet has a bias that the main objects are always in the center), others can’t be addressed by this, e.g.:

* If cows are always on the grass background in training, how can one augment the data to prepare it for other kinds of backgrounds? Just by first identifying the exact problem and building the exact custom augmentations on synthetic data (if you can for instance do a proper instance segmentation). But this is way more complicated and hand-designed than our proposed solution.

* Another case is when the bias is distributed across the image, like CT image devices in hospitals that have different acquisition parameters that influence the entire image. This makes it impossible to augment in a generic way, since you don’t know how data will look for the next hospital. So you will need to see the “test” data. With our Stylist approach, you might figure out the features that are responsible for the acquisition parameters beforehand.

More, please note that the best augmentations to make for a scenario, are task and data-dependent, as shown in ERM w/ targeted aug. Also, please take into account that there is a whole subfield of ML research regarding spurious correlations and biases.

***ERM w/ targeted aug***: Out-of-Distribution Robustness via Targeted Augmentations: Irena Gao, Shiori Sagawa, Pang Wei Koh, Tatsunori Hashimoto, Percy Liang