[Paper Review] LANCE: Stress-testing Visual Models by Generating Language-guided Counterfactual Images
LANCE proposes an automated method to stress-test visual models by generating language-guided counterfactual images that perturb specific visual attributes (e.g., object, color, background) while preserving the original label. By leveraging large language models and text-to-image diffusion models, LANCE creates realistic, diverse test images that expose model vulnerabilities, revealing significant and consistent performance drops across diverse pretrained models on ImageNet, especially in detecting class-level biases.
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.
Motivation & Objective
- To address the limitations of static, aggregate metrics like accuracy in evaluating visual models on IID test sets, which fail to detect model vulnerabilities to specific visual perturbations.
- To overcome the static nature of existing OOD benchmarks by generating dynamic, model-specific test suites that probe real-world robustness.
- To automate the discovery of model biases by generating realistic, diverse counterfactual images through language-guided interventions on visual attributes.
- To provide a scalable, non-invasive method to assess model sensitivity across different types of visual edits without retraining.
- To surface previously unknown class-level biases in ImageNet by isolating consistent interventions that alter model predictions.
Proposed method
- Use an image captioning model to generate a natural language description of the input image and its ground truth label.
- Fine-tune a large language model (LLM) to generate realistic, semantically coherent perturbations of a single visual attribute (e.g., subject, object, adjective, domain, background), while preserving the ground truth category.
- Apply text-to-image diffusion models with null-text inversion and prompt-guided editing to generate counterfactual images conditioned on the original image and the edited caption.
- Ensure image realism and edit fidelity through automated checks and balances, including label consistency verification and quality filtering.
- Evaluate model performance on both original and generated counterfactual images to compute average accuracy drop as a measure of sensitivity.
- Conduct human evaluation on realism, edit success, fidelity, label consistency, and ethical concerns to validate the quality and safety of generated images.
![Figure 1 : The predominant paradigm in computer vision is to benchmark trained models on IID test sets using aggregate metrics such as accuracy, which does not adequately vet models for deployment, e.g. for the test image above, while a trained ResNet-50 model [ 1 ] accurately predicts the ground tr](https://ar5iv.labs.arxiv.org/html/2305.19164/assets/x1.png)
Experimental results
Research questions
- RQ1How effective is LANCE at generating realistic and diverse counterfactual images that stress-test visual models?
- RQ2To what extent do pretrained visual models exhibit performance degradation when exposed to language-guided counterfactual edits?
- RQ3Which types of visual perturbations (e.g., object, color, background) most significantly degrade model performance?
- RQ4Can LANCE uncover previously unknown class-level biases in ImageNet that are not detectable via standard evaluation?
- RQ5How do the generated counterfactual images compare in realism and edit quality to existing baseline methods?
Key findings
- LANCE-generated counterfactual images achieved an average realism score of 4.2 out of 5 in human evaluation, indicating high perceptual quality.
- Edit success averaged 3.7 out of 5, with background edits showing the lowest performance due to incorrect region targeting.
- Image fidelity was high, averaging 4.5 out of 5, indicating that changes were relevant and well-localized.
- Label consistency was maintained in 95% of cases, confirming that the generated images remain plausible for the original label.
- Only 2% of generated images raised ethical concerns, primarily due to stereotypical or biased representations in text-to-image generation.
- Performance drops were consistently significant across diverse models, revealing previously undetected class-level biases in ImageNet, especially under attribute-specific perturbations.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.