LANCE: Stress-testing Visual Models by Generating Language-guided Counterfactual Images

We propose an automated algorithm to stress-test a trained visual model by generating language-guided counterfactual test images (LANCE). Our method leverages recent progress in large language modeling and text-based image editing to augment an IID test set with a suite of diverse, realistic, and challenging test images without altering model weights. We benchmark the performance of a diverse set of pre-trained models on our generated data and observe significant and consistent performance drops. We further analyze model sensitivity across different types of edits, and demonstrate its applicability at surfacing previously unknown class-level model biases in ImageNet. Code is available at https://github.com/virajprabhu/lance.

Paper

References (74)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer Fgt77/10 · confidence 4/52023-07-06

Summary

This paper presents a method for stress-testing visual classifiers. The key idea is to use language to generate counterfactual images. Their approach can be summarized into four steps: 1) take an image input; 2) get its caption from a captioning model (BLIP-2); 3) perturb the caption by changing some words using ChatGPT and fine-tuned LLAMA; 4) generate new images based on perturbed captions using text inversion of Stable Diffusion. On the ImageNet dataset, they showed that various models such as ResNet-50 and ViT-B consistently achieve much lower performance on their generated new ImageNet compared to the original ImageNet, and the generated ImageNet enables surfacing model biases.

Strengths

1. This paper targets a novel direction --- stress-test visual models, which is important in real-world vision applications. 2. The proposed method is technical sound, and the generated images from their pipeline look good and realistic. 3. The paper conducted experiments on the realistic ImageNet dataset instead of simple synthetic datasets, showing the practical values of their method in realistic scenarios. 4. This paper is generally well-written and easy to understand.

Weaknesses

1. There is no baseline to compare, and the numbers are hard to justify their method's effectiveness. The main quantitive results from this paper showed that various vision models achieve much lower performance on their generated ImageNet dataset. However, it is unclear whether the generated images are 100% correct. If the text perturbation happens to change the class or introduce new classes to the image, the model prediction is expected to change and the performance will drop. Therefore, a human study showing the label validity of generated images is particularly necessary. 2. There are some existing works proposing very similar directions. For example, [1] is almost the same as this work, which uses textual reversion to convert an image into a token and compose this token with natural language and generate new images to test vision models. [2] uses off-the-shelf image captioning and generation models to discover model bugs. While [1] can be viewed as concurrent work, it would be helpful if the authors could discuss the similarity and differences between this work and [1-2]. 3. From Figure 6 last row, changing the caption from "car" to "bus" generates almost the same images, but model predictions change a lot. The change may be because generated images have specific patterns that are not perceptible to humans, which cannot reflect the actual errors using real images. 4. The stress test will be limited by language itself, as language is hard to represent certain properties of objects, such as orientation and lighting. However, this is also pointed out by the authors and is minor considering the advantage of using language. [1] Dataset interfaces: Diagnosing model failures using controllable counterfactual generation. https://arxiv.org/pdf/2302.07865. [2] Discovering Bugs in Vision Models using Off-the-shelf Image Generation and Captioning. https://arxiv.org/pdf/2208.08831.

Questions

- Algorithm 1: - Line 7 duplicate definition of "c" (previously used as the class, now used as the caption) - Line 13: ">" should be "<" - Equation 2: "|" in the denominator should be "||" - Line 282: what is the percentage for the generated counterfactuals to be semantically inconsistent with the ground truth label?

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

See weaknesses. I'm happy to increase my rating if these are well addressed, especially 1 and 2.

Reviewer 9YtG5/10 · confidence 2/52023-07-06

Summary

The paper proposes a way to generate new data to evaluated the robustness of model. It first captions an image, then changes part of it, then generates an image from the modified caption. The model is then evaluated on these new images to see how robust they are to things like background changes.

Strengths

The idea is interesting and is an easy way to generate new evaluation data. The paper is well written and easy to follow. The approach would be a valuable tool to evaluate models.

Weaknesses

Since it is an automated benchmark, it is unclear how good the quality is. It relies on a lot of parts working right (captioning model, caption changing model and image generation model). It would be good to have some human evaluation in Table 2 to see how well humans do on this set.

Questions

How can the quality of the generated dataset be evaluated? How do we know it is generating a good benchmark?

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

2: You are willing to defend your assessment, but it is quite likely that you did not understand the central parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

Yes.

Reviewer muqu6/10 · confidence 2/52023-07-14

Summary

This paper proposed a new testing protocol LANCE for existing vision models. It adopts LLM-based caption perturbation and DDPM based image editor to generate counterfactual samples. Specifically, for each image, LANCE first use a pre-trained captioner (BLIP-2) to generate the corresponding caption. Then it adopts an LLM to perturb the caption with different factors (subject, object, background, etc.). The goal of perturbation is to generate a caption corresponding to a counterfactual image with semantics preserved. With the perturbed caption, the author generates another image with counterfactual aspects and similar looking with the original image. The authors observed a significant performance drop when testing image classification models on these generated images. Furthermore, the authors also present a detailed analysis based on the perturbation factors.

Strengths

1. The authors establish an interesting pipeline to generate counterfactual hard examples for testing vision models. It involve an LLM-based image caption perturbator and a ddpm-based image editor. Qualitative results show that this pipeline can generate some impressive counterfactual images. 2. The authors present a detailed analysis on the performance degradation when testing on the generated counterfactual images.

Weaknesses

1. The authors should present more quantitative statistics about the counterfactual examples generation pipeline, for example: 1. What is the success rate of an LLM to generate a plausible perturbed caption (GPT-3.5 & Finetuned LLAMA-7B). Also, I noticed that you are using Nvidia A40 (48GB), thus a comparison between different LLAMA variants (+13B, e.g.) are also welcomed. 2. What is the success rate of DDPM-based image editing? I'm specially interested in that since I observe poor quality when using StableDiffusion to generate common images (compared to other advanced AIGC models). 2. Are all newly generated images (781 images, according to the supp) verified manually by human? If so, how many worker-hours are required to generate these samples?

Questions

See Weakness.

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

2: You are willing to defend your assessment, but it is quite likely that you did not understand the central parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

See Weakness.

Reviewer G3fV5/10 · confidence 4/52023-07-19

Summary

The paper proposes to use recent advances in text-to-image generation/editing to design evaluation by generating "counterfactual" data. The main idea of the method is to make semantically irrelevant (to the output class) edits to an image and observe its effects on the model predictions. A variety of models including CNNs, and ViT (trained classically as well as via language supervision) are tested, which show that such editing operation can indeed make a "hard" test set where most tested methods struggle to do well.

Strengths

[S1] Great Presentation Clarity: The paper is very well written and the details about what has gone into the final data-generation scheme are presented in sufficient detail. The experimental setup, the algorithm, and the implementation of the baseline models are clearly explained and should be easily reproducible independently. [S2] Good evaluation/results: The proposed model, based on the experiments presented, show a huge potential for using counterfactual generation of images to stress-test models. While the paper only makes a handful of edit types, there is a possibility to design hyper-specific probes (does change clothing color change models predictions about a person's profession?) that can be designed for specific applications.

Weaknesses

[W1] Need more discussion of scope and their limitations: While the main idea is sound and the descriptions are clear, the evaluation/discussion leaves a lot to be desired. Most of the evaluation is done "end-to-end" which does not give much insight into the success of the various stages involved in the process. Some example concerns that I have: - The success of checks and balances (L155 and L185) is not verified/discussed. Do they always work? When do they fail? What are the effects of their failing? - What is the diagnostic prowess of this method? Besides showing that the edit-based perturbations does indeed make models flip their predictions (which has also been previously shown via adverserial noise injection), what insights can we draw from this type of stress testing? Does the results of this type of probe correlate with other tests (perhaps for bias/fairness and/or other diagnostic datasets? Do the edits represent (in the paper's view), the realm of possible naturally occurring variations in background/unrelated content in the picture? If not, can this still diagnose/predict the model's robustness in the real world? Or, is this just another form of discovering "adversarial attack" on the model predictions? There is only a very short limitation section at the end of the conclusion section. I would have liked to see a more open discussion about exactly what (in view of the paper) can this method tell us about a model and what it cannot. [W2] No manual/external/independent validation: The quality of the edits, and the accuracy of the labels post-edit are not validated by any external/manual evaluation. We only see decreased overall accuracies for popular methods. While a simple baseline of random edit is tested, it is not clear whether a noise perturbation/other simpler perturbation techniques could also result in similar loss. Regardless of the loss in accuracy produced, it is also important to know whether the editing process leaves any unwanted artifacts. E.g., In the headline image, there is no actual sled visible, and the prediction of it likely comes from context. As such, it is unsurprising that changing the dog breed to pomeranian (an unlikely breed to be pulling sleds, also both "husky" and "pomeranian" are actual categories by themselves) would result in flipped predictions. To be clear, I am not claiming that this is "OKAY" behavior, just that perhaps the mechanism is "label noise" in Imagenet rather than "context bias" (Since there is nothing but the context that can help us make predictions). I am claiming, however, that this is a different category of error than other examples in the paper. Both are important, and the proposed method is likely to help uncover both, but at a lack of external validation about the accuracy of the labels before and after the edit operation. Some questions that I'd have liked validated externally: - Can the accuracy of the "perturber" be measured independently? - What is the accuracy of the ground truth labels post-edit? Are they truly unchanged? Are the methods presented in L185 and L155 (re. checks and balances) enough? Do they work? Have they avoided this issue successfully? - Since there is a pervasive error in Imagenet (https://arxiv.org/abs/2103.14749), does this method have any correlation with the noisy labels? In other words, is this intervention making "easy to predict" examples harder or primarily just the "confusing" ones?

Questions

Please see the weaknesses above

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

4 excellent

Contribution

2 fair

Limitations

Please see the weaknesses above

Reviewer Fgt72023-08-14

Thanks for the reaponse

We thank the authors for the detailed response. The answers to most questions seem persuasive, therefore I'm increasing my score. Additional question: In response PDF Figure 1, it seems both edits are not successful (at least I cannot see there is any semantic change between the original images and edited images, e.g., from "boy" to "teenage boy", from "man" to "middle-aged man"), but it was rated as success (rated 5 in the range of 1-5). I'm worried about the data annotation quality.

Authorsrebuttal2023-08-16

Thank you for considering our rebuttal!

We appreciate the reviewer's effort in considering our response and are glad it was able to address their concerns. In both generated images on PDF Figure 1, the person's facial features are modified to make them look older (best-viewed zoomed-in). Further, the screenshot included in the screenshot is only from a single respondent. On average, the average edit success rating (mean and 1 standard deviation) for the first edit was 4.27$\pm$0.65, and 4.82$\pm$0.40 for the second, indicating that at least a few respondents found both edits to only be partially successful. We took several measures to ensure that our human study was high quality, including selecting external respondents who were uninvolved in the project in any capacity and providing carefully-worded instructions. In fact, the average response time recorded was about 20 minutes for the full study or $\sim$24 seconds per question, which we believe is adequate time to provide carefully considered responses. We hope this addresses the reviewer's concern, and would be happy to provide any further clarifications.

Reviewer Fgt72023-08-18

Thanks for the additional explanation

The clarification on the examples in the rebuttal PDF makes sense to me. I increase my score to 7 regarding this.

Authorsrebuttal2023-08-18

Thank you for the thoughtful review!

We sincerely hope that our rebuttal has addressed the reviewer's concerns, and would be happy to answer any lingering questions. Otherwise, we would appreciate if they would consider updating their score in light of our response.

Authorsrebuttal2023-08-18

Thank you for the thoughtful review!

We sincerely hope that our rebuttal has addressed the reviewer's concerns, and would be happy to answer any lingering questions. Otherwise, we would appreciate if they would consider updating their score in light of our response.

Authorsrebuttal2023-08-18

Thank you for the thoughtful review!

We sincerely hope that our rebuttal has addressed the reviewer's concerns, and would be happy to answer any lingering questions. Otherwise, we would appreciate if they would consider updating their score in light of our response.

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC