Skip to main content
Back

Ends Soon: Get 20% off all AlphaSignal Pro subscriptions. Subscribe here.

Apple's DFN5B-CLIP Hits 84% ImageNet Accuracy by Teaching AI to Pick Its Own Data

Apple's DFN5B-CLIP-ViT-H-14-378 keeps climbing Hugging Face charts, hitting 84.2% zero-shot ImageNet accuracy by rethinking how training data is filtered.

Pro

  • Apple's DFN5B-CLIP-ViT-H-14-378 hits 84.2% zero-shot ImageNet accuracy, beating LAION-2B and OpenAI WIT baselines.
  • Trained on 5B pairs filtered from 43B candidates using a small learned Data Filtering Network.
  • Key insight: a good filter network is not the same as a good classifier, per the paper.
  • Loads directly in OpenCLIP as a drop-in replacement for older CLIP ViT-L and ViT-H backbones.
  • Strong on classification and retrieval, weak on counting, distance estimation, and long-tail wildlife.
  • Shipped under Apple's AMLR license, converted from JAX Axlearn checkpoints to PyTorch.

Apple’s DFN5B-CLIP-ViT-H-14-378 has accumulated nearly 800,000 Hugging Face downloads and powers dozens of Spaces. Hugging Face counts file requests rather than unique users, but the activity shows substantial adoption of a model released without a broad product launch.

The checkpoint packages a ViT-H/14 CLIP model with a 378-pixel input size. CLIP models map images and text into the same vector space, allowing developers to classify images from text prompts, retrieve images from natural-language queries, cluster visual collections, and supply features to multimodal systems. Apple’s model differs from common open CLIP baselines through its training data: a learned network selected five billion image-text pairs from a much larger candidate pool.

  • Architecture: ViT-H/14 image encoder with a CLIP text encoder
  • Input size: 378 by 378 pixels
  • Training set: DFN-5B, filtered from roughly 43 billion candidate pairs
  • Interface: Compatible with OpenCLIP
  • License: Apple Machine Learning Research license

A learned filter picks five billion pairs

The DFN paper, written by researchers from Apple and the University of Washington, treats data selection as a learned component of the training pipeline. Conventional web-scale datasets often rely heavily on language detection, metadata rules, similarity thresholds, deduplication, and manually chosen quality signals. Data Filtering Networks use a trained model as the central scorer for deciding which image-text pairs enter the final dataset.

The experiments found that downstream classification accuracy poorly predicts filtering quality. Some networks with strong ImageNet results produced weaker training sets, while lower-accuracy networks trained on smaller, carefully selected datasets became better filters. The useful property was the network’s ability to rank candidate pairs by training value, rather than its ability to serve directly as the final classifier.

Apple applied the filter to approximately 43 billion uncurated pairs, including 12.8 billion from CommonPool-12.8B and another 30 billion public image-text pairs. The resulting DFN-5B dataset contains five billion selected pairs. According to the paper, training the filtering network cost less than one-fiftieth of the subsequent CLIP training run.

The downloadable checkpoint contains the final CLIP encoder trained on DFN-5B. Reproducing the curation pipeline still requires a candidate corpus, the paper’s filtering procedure, and the infrastructure to score billions of pairs.

Recognition rises; spatial reasoning lags

The paper reports 84.4% zero-shot ImageNet top-1 accuracy for a ViT-H model trained on DFN-5B. The converted Hugging Face checkpoint reports 84.2%. Evaluation code, preprocessing, and checkpoint conversion can produce small differences, so deployments should measure the downloaded weights with their own pipeline.

Selected results reported on the Hugging Face model card
Benchmark Reported score
ImageNet-1k 0.842
ImageNet-A 0.799
ImageNet-R 0.938
ObjectNet 0.797
Food-101 0.963
Stanford Cars 0.960
Oxford-IIIT Pet 0.967
MSCOCO retrieval 0.637
Flickr retrieval 0.881
38-dataset average 0.709

The rows use benchmark-specific metrics, so scores should be compared with results from the same benchmark and evaluation recipe. ImageNet-A measures performance on naturally occurring examples that often fool ImageNet classifiers, while ImageNet-R covers renditions such as paintings and cartoons. Those results provide targeted evidence about robustness under distribution shifts.

Spatial and compositional tasks remain weak. The model card reports 0.36 on CLEVR Counts, 0.21 on CLEVR Distance, 0.38 on KITTI distance, and 0.22 on iWildCam. Applications involving counting, metric distance, localization, or long-tailed wildlife recognition need task-specific evaluation and often a specialized model.

OpenCLIP setup that handles devices

The checkpoint loads through OpenCLIP after installing open_clip_torch and a PyTorch build suitable for the target hardware:

python -m pip install open_clip_torch pillow

The following example moves the model and inputs to the same device, enables mixed precision on CUDA, normalizes both embedding sets, and returns relative scores over a fixed set of labels:

from contextlib import nullcontext

import torch
import torch.nn.functional as F
from PIL import Image
from open_clip import create_model_from_pretrained, get_tokenizer

model_id = "hf-hub:apple/DFN5B-CLIP-ViT-H-14-378"
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

model, preprocess = create_model_from_pretrained(model_id)
model = model.to(device).eval()
tokenizer = get_tokenizer("ViT-H-14")

labels = ["dog", "cat", "donut", "beignet"]
prompts = [f"a photo of a {label}" for label in labels]

image = (
    preprocess(Image.open("photo.jpg").convert("RGB"))
    .unsqueeze(0)
    .to(device)
)
text = tokenizer(prompts).to(device)

amp = (
    torch.autocast(device_type="cuda", dtype=torch.float16)
    if device.type == "cuda"
    else nullcontext()
)

with torch.inference_mode(), amp:
    image_features = F.normalize(model.encode_image(image), dim=-1)
    text_features = F.normalize(model.encode_text(text), dim=-1)

    logits = model.logit_scale.exp() * image_features @ text_features.T
    logit_bias = getattr(model, "logit_bias", None)
    if logit_bias is not None:
        logits = logits + logit_bias

    scores = logits.softmax(dim=-1)

best_index = scores[0].argmax().item()
print(labels[best_index], scores[0, best_index].item())

The softmax values rank mutually exclusive candidates supplied in that call; they are not calibrated real-world probabilities. Independent multilabel tagging usually requires sigmoid scores plus thresholds tuned on a validation set. Production classifiers also benefit from multiple prompt templates per class, averaged text embeddings, and evaluation against representative data.

Resolution carries a compute cost

The bundled preprocessing should remain part of the inference pipeline because the checkpoint expects its configured resize, crop, and normalization values. A 378-pixel image produces 27 by 27 patches with a 14-pixel patch size, or 729 image tokens before the class token. A 224-pixel ViT-H/14 produces 256 patches. The larger input therefore creates about 2.85 times as many patch tokens and attention maps roughly eight times as large, although total runtime depends on the full architecture and hardware.

Apple’s training metadata says the base model saw 39 billion samples at 224-pixel resolution before a further five billion samples at higher resolution. “Samples seen” counts training presentations and can include repeated examples; it does not mean the dataset contains 44 billion unique pairs.

The ViT-H architecture also makes this a large frozen backbone. GPU inference, mixed precision, batching, and cached text embeddings are useful for sustained throughput. CPU execution is possible through PyTorch but may be too slow for interactive or high-volume services.

Where the checkpoint fits

  • Zero-shot classification: Add or revise categories through text prompts without training a new classifier head.
  • Image-text retrieval: Precompute normalized image embeddings, index them with an approximate nearest-neighbor system, and embed queries at request time.
  • Clustering and deduplication: Group semantically similar images or rank likely duplicates using embedding similarity.
  • Frozen visual features: Feed image embeddings into a lightweight classifier trained for a specific domain.
  • Multimodal systems: Use the vision tower after training or adapting the projection layer that connects it to a language model.
  • Dataset triage: Rank image-text pairs by similarity as one signal within a broader curation process.

Replacing another CLIP backbone requires more care when downstream components were trained against the original embedding distribution or dimensions. Multimodal language models generally need a retrained projector or adapter, while vector indexes need to be rebuilt from embeddings generated by the new checkpoint.

Detection, segmentation, keypoint estimation, counting, and depth estimation call for models trained with spatial supervision. Latency-sensitive services may also favor a smaller ViT-B or ViT-L checkpoint after measuring the accuracy and throughput trade-off.

License and data limits reach production

The checkpoint uses Apple’s Machine Learning Research license, whose terms differ from common permissive licenses such as MIT and Apache-2.0. Teams should review the model card and license before production deployment, redistribution, fine-tuning, or inclusion in a commercial product.

DFN-5B was derived from web-scale public image-text data. Learned filtering can improve average pair quality while preserving social biases, unsafe associations, mislabeled content, and uneven geographic or cultural coverage. Domain-specific validation, abuse testing, and output controls remain necessary for user-facing systems.

Data curation becomes part of model design

The DFN experiments show that a relatively inexpensive learned filter can improve the dataset used by a far more expensive training run. Within the paper’s compute-controlled comparisons, better selection of training pairs produced stronger CLIP models than established open datasets built from the same general class of web data.

That result gives model builders another optimization target alongside architecture, loss functions, and training schedules. The released encoder is useful on its own, while the broader contribution is a repeatable method for training a network to choose the data that trains the next network.