See our collection for all versions of CaiT.

Run CaiT with Keras 3: JAX, PyTorch, or TensorFlow

GitHub Docs Collection

zeromodels/cait_s24_224_fb_dist_in1k

Paper: Going deeper with Image Transformers (arXiv:2103.17239) · HF Papers

CaiT (Class-Attention in Image Transformers) deepens ViTs with class-attention layers. Distilled ImageNet variants included.

For more details on the model, please go to the upstream model card.

Pure-Keras 3 conversion of timm/cait_s24_224.fb_dist_in1k for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.

This is an image-classification / backbone checkpoint (CaiTImageClassify / CaiTModel).

✨ Quick start

import os

os.environ["KERAS_BACKEND"] = "torch"  # or "jax" / "tensorflow"

from PIL import Image
from zeromodels.models.cait import CaiTImageClassify, CaiTModel, CaiTImageProcessor

model = CaiTImageClassify.from_weights("zeromodels/cait_s24_224_fb_dist_in1k")
processor = CaiTImageProcessor.from_weights("zeromodels/cait_s24_224_fb_dist_in1k")

image = Image.open("your_image.jpg").convert("RGB")
pixels = processor(image)  # resize + normalize (normalization lives in the processor)
logits = model(pixels, training=False)
print(logits.shape)  # (1, num_classes)

# Feature extraction: the backbone without the classifier head
backbone = CaiTModel.from_weights("zeromodels/cait_s24_224_fb_dist_in1k", as_backbone=True)
features = backbone(pixels, training=False)

Load any CaiT variant the same way with from_weights("zeromodels/<variant>"):

Variant Hub
cait_m36_384_fb_dist_in1k zeromodels/cait_m36_384_fb_dist_in1k
cait_m48_448_fb_dist_in1k zeromodels/cait_m48_448_fb_dist_in1k
cait_s24_224_fb_dist_in1k zeromodels/cait_s24_224_fb_dist_in1k
cait_s24_384_fb_dist_in1k zeromodels/cait_s24_384_fb_dist_in1k
cait_s36_384_fb_dist_in1k zeromodels/cait_s36_384_fb_dist_in1k
cait_xs24_384_fb_dist_in1k zeromodels/cait_xs24_384_fb_dist_in1k
cait_xxs24_224_fb_dist_in1k zeromodels/cait_xxs24_224_fb_dist_in1k
cait_xxs24_384_fb_dist_in1k zeromodels/cait_xxs24_384_fb_dist_in1k
cait_xxs36_224_fb_dist_in1k zeromodels/cait_xxs36_224_fb_dist_in1k
cait_xxs36_384_fb_dist_in1k zeromodels/cait_xxs36_384_fb_dist_in1k

Tips

  • Set KERAS_BACKEND before importing Keras / zeromodels.
  • CaiTImageClassify returns class logits; CaiTModel returns features (as_backbone=True for multi-scale stages).
  • See docs and Loading Weights.
  • Upstream / timm checkpoints: CaiTImageClassify.from_weights("hf:timm/cait_s24_224.fb_dist_in1k").

Special Thanks

A huge thank you to the CaiT authors and the timm / Hub communities for creating and releasing these models.

License: see YAML license (usually matches the upstream checkpoint).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for zeromodels/cait_s24_224_fb_dist_in1k

Finetuned
(2)
this model

Collection including zeromodels/cait_s24_224_fb_dist_in1k

Paper for zeromodels/cait_s24_224_fb_dist_in1k