Concept-based Analysis of Neural Networks via Vision-Language Models

Ravi Mangal, Nina Narodytska, Divya Gopinath, Boyue Caroline Hu, Anirban Roy, Susmit Jha, Corina S. Pasareanu · DOI

Abstract

Deep Neural Networks (DNNs) are often criticized for their "black-box" nature, making formal verification of their decision-making processes difficult. This paper presents a novel framework that utilizes Vision-Language Models (VLMs), such as CLIP, to bridge the semantic gap between low-level pixel data and human-understandable concepts. By mapping a vision model's internal representations to a VLM's embedding space, the authors enable formal verification of conceptual properties (e.g., "does a truck classification depend on the presence of wheels?"). The approach reduces complex verification tasks to linear constraint problems, offering a scalable and interpretable method for analyzing model logic.

1. Introduction

The deployment of computer vision models in safety-critical applications necessitates a rigorous understanding of their internal logic. However, traditional formal verification methods are limited by the "semantic gap"—the disconnect between raw pixel values and the high-level concepts humans use to describe images. While we can verify a model's robustness to $L_\infty$ perturbations, such metrics do not explain whether a model is making decisions based on relevant features or spurious correlations.

Furthermore, the massive size of modern DNNs makes exhaustive formal verification computationally prohibitive. This paper addresses these challenges by introducing a framework that leverages the pre-existing semantic knowledge within Vision-Language Models (VLMs) to perform concept-based analysis and verification.

2. Methodology

The proposed framework consists of four primary components designed to translate neural activations into logical specifications.

2.1 $\text{Con}_{\text{spec}}$ Specification Language

The authors introduce $\text{Con}_{\text{spec}}$, a first-order logic language tailored for concept-based specifications. It allows for the definition of "strength predicates," which compare the relative activation of different concepts. For example, a specification might assert that for an image to be classified as a "truck," the concept of wheels must be more prominent than the concept of wings (wheels > wings). This approach is more robust than absolute detection, as it matches the "fuzzy" nature of neural network activations.

2.2 Cross-Model Mapping

To connect a standard vision model (e.g., ResNet-18) to the semantic space of a VLM, the authors learn an affine map, $r_{\text{map}}$. This map translates the internal feature embeddings of the target vision model into the embedding space of CLIP. This allows the vision model's "internal state" to be interpreted through CLIP's extensive vocabulary of visual concepts learned from millions of image-text pairs.

2.3 Model Decomposition and Verification

The framework exploits the architecture of modern classifiers, which typically consist of a feature-extracting encoder followed by a linear classification head. By applying the affine map to the encoder's output, the authors can bypass the non-linear complexity of the encoder during the verification phase. The verification problem is then reduced to checking linear constraints on the model's head using the SCIP solver. If the solver cannot find a counter-example to a negated property, the property is formally proven to hold within a specific region of the embedding space.

3. Experimental Setup

The framework was evaluated using the following components:

  • RIVAL-10 (RIch VisuAL Attributions): A subset of ImageNet containing 10 classes (matching CIFAR-10) with 26,000 images. It provides manual annotations for 18 attributes (concepts) and segmentation masks, serving as a ground truth baseline.
  • CLIP (Pre-trained): Utilized as the foundational VLM to provide the semantic embedding space.
  • ResNet-18: The primary vision model subjected to analysis.

4. Key Results

The experiments yielded several insights into the feasibility of concept-based verification:

  • Semantic Alignment: The learned affine map achieved a high $R^2$ score of 0.786 and a low Mean Squared Error (0.963), indicating that the internal representations of standard vision models are remarkably well-aligned with the semantic space of VLMs.
  • Verification Efficiency: By simplifying the problem to linear constraints on the model's head, the verification process was highly efficient, typically concluding in a few seconds per specification on standard hardware.
  • Model Logic Validation: The framework successfully validated that models often follow human-intuitive logic. For instance, in the "truck" class, the satisfaction probability for predicates like wheels > wings was consistently high, confirming the model's reliance on appropriate features.
  • Identifying Focus Regions: The framework successfully identified "focus regions" where the ResNet-18 model was making decisions for the "right" reasons (e.g., identifying a car based on its rectangular shape and metallic texture) versus regions where it might be relying on noise.

5. Discussion and Limitations

While promising, the framework has limitations. The accuracy of the verification depends heavily on the "faithfulness" of the alignment between the vision model and the VLM. If the mapping $r_{\text{map}}$ is inaccurate, the verification results may not truly reflect the vision model's internal state.

Additionally, the current proofs are "local," meaning they hold for specific neighborhoods within the embedding space rather than providing global guarantees across all possible inputs. Defining what constitutes a "realistic" or "in-distribution" embedding remains a challenge; verifying a model on nonsensical or out-of-distribution embeddings may yield technically correct but practically irrelevant results.

6. Conclusion

This research demonstrates that Vision-Language Models can serve as a powerful "concept repository" for the formal analysis of black-box vision models. By bridging the semantic gap, the framework provides a path toward more interpretable and verifiable AI systems. Future work will focus on utilizing these concept-based specifications as run-time monitors to detect adversarial attacks or misclassifications in real-time.

Summary updated

BibTeX
@inproceedings{mangal2024concept,
  author = {Ravi Mangal and Nina Narodytska and Divya Gopinath and Boyue Caroline Hu and Anirban Roy and Susmit Jha and Corina S. Pasareanu},
  title = {{Concept-based Analysis of Neural Networks via Vision-Language Models}},
  booktitle = {SAIV},
  year = {2024},
  doi = {10.1007/978-3-031-65112-0\_3},
}
Figure