OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Diffusion Classifier

Diffusion Classifier is a Python research implementation of zero-shot image classification using conditional density estimates from pretrained diffusion models, without training an additional classifier.

Independent OpenViST project profile, based on linked sources.

Diffusion Classifier — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you want to investigate or reproduce diffusion-model classification experiments in a code-based research workflow, rather than use a hosted image-labeling service.

Who it is for

  • Computer-vision researchers studying zero-shot classification with generative models.
  • Practitioners evaluating candidate text prompts against an image dataset.
  • Researchers comparing diffusion-based classification or compositional-reasoning experiments.

Documented uses

  • Score candidate class prompts for images using Stable Diffusion epsilon-prediction loss.
  • Evaluate prompt formulations on a custom dataset.
  • Run documented class-conditional diffusion classification experiments on ImageNet.
  • Evaluate compositional reasoning on Winoground.
Before you choose

Requirements & limits

The implementation is in a public GitHub repository. The repository information supplied here does not specify a license.

  • The Stable Diffusion evaluation compares prompt candidates through epsilon-prediction loss.
  • Custom dataset evaluation requires a CSV with prompts correctly matched to class labels.
  • The README describes GPU use and recommends reducing evaluation scope or distributing work when runs are slow.
  • ImageNet evaluation with class-conditional diffusion models is described as very expensive.
  • The repository also documents a Winoground evaluation and CLIP/OpenCLIP baselines.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Evaluate candidate prompts on your own dataset

Run the documented Stable Diffusion zero-shot evaluation with prompts matched to class labels.

Before you start

  • The repository and its Conda environment created with conda env create -f environment.yml.
  • A dataset and a CSV file containing candidate prompts matched to their class labels; multiple prompts per class are supported.
  • A GPU for the Stable Diffusion workflow; the README cites GPUs from the 2080 Ti or 3080 through the 3090 or A6000.

Steps

  1. Create a prompt CSV for the dataset, using scripts/write_cifar10_prompts.py as the documented example.

  2. Run eval_prob_adaptive.py with the dataset name and prompt CSV path adjusted for the use case.

  3. Try the evaluation strategy on a small subset first; the README also describes --subset_path, --n_workers, and --worker_idx for subset evaluation and parallel work.

Expected outcome

The evaluation saves prompt losses for each test image in a log directory; accuracy can be computed from those saved results with `scripts/print_acc.py`.

Guide limitations

  • The example command's dataset and prompt-path values must be adapted to the user's data.
  • Evaluation may take a long time; the README suggests smaller subsets and adjusting --n_samples and --to_keep.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
18 October 2026
Original website title
diffusion-classifier/diffusion-classifier · Official homepage title · retained in its source language