Fusion Anything Model (FAM) β€” v1

Paper GitHub License

This repository hosts the pretrained model checkpoint (FAM.pt) for Fusion Anything: A Generalized Multimodal Foundation Model.


Model Overview

FAM is a multimodal foundation model that uses in-context-learning to solve multimodal prediction tasks in a forward pass. Inference code can be found at https://github.com/huizi-Cui/Fusion_Anything_Model.


Intended Use & Scope

Supported Use Cases

  • Task: Supervised multimodal classification via in-context learning (fit stores labeled Context samples without updating model weights; predict_proba / predict performs inference on unlabeled Query samples).
  • Modalities: 1 to 8 modalities per task, supplied as finite 2D NumPy feature arrays [n_samples, n_features] with aligned sample rows (no NaN or Inf values).
  • Classes: 2 to 10 classes, contiguously integer-encoded starting from 0 (all target classes must appear in the Context set).For tasks with more than 10 classes, one feasible approach is to decompose them into smaller classification tasks.

Limitations

  • Pre-extracted features: FAM accepts numerical features and embeddings, requiring external encoders for raw modalities such as images, audio, and text.

Usage

1. Install the Package

git clone https://github.com/huizi-Cui/Fusion_Anything_Model.git
cd Fusion_Anything_Model

# Install PyTorch with CUDA support (adjust cu128 for your CUDA version)
pip install torch==2.9.0 torchvision==0.24.0 --index-url https://download.pytorch.org/whl/cu128

# Install Fusion Anything
pip install -e .

2. Download the Checkpoint

huggingface-cli download FusionAnything/FAMv1 FAM.pt --local-dir checkpoints

Alternatively, place FAM.pt anywhere and set FAM_CHECKPOINT=/path/to/FAM.pt or pass checkpoint="/path/to/FAM.pt" to FusionAnythingClassifier.

3. Run Inference

import numpy as np
from fusion_anything import FusionAnythingClassifier

# Each modality is a finite 2D array of shape [n_samples, n_features]
context = {
    "image": np.load("context_image.npy"),
    "tabular": np.load("context_tabular.npy"),
}
labels = np.load("context_labels.npy")  # 1D integer array, 0..K-1 (2 <= K <= 10)

query = {
    "image": np.load("test_image.npy"),
    "tabular": np.load("test_tabular.npy"),
}

model = FusionAnythingClassifier(device="cuda:0", preprocessing="pca")
model.fit(context, labels, structured_modalities=["tabular"])

probabilities = model.predict_proba(query)  # shape: [n_query, n_classes]
predictions = model.classes_[probabilities.argmax(axis=1)]

License & Acknowledgments


Citation

This repo is Built with PriorLabs-TabPFN (PriorLabs/TabPFN, subject to the Prior Labs License). We thank the Prior Labs researchers for generously sharing their insights, model weights, data, and code.

@article{cui2026fusion,
  title={Fusion Anything: A Generalized Multimodal Foundation Model},
  author={Cui, Huizi and Han, Zongbo and Ding, Chenggong and Xiao, Naichuan and Yang, Jialong and Chen, Jingdong and Wang, Guangyu and Hu, Qinghua and Zhang, Changqing},
  journal={arXiv preprint arXiv:2609.22107},
  year={2026}
}

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

Paper for FusionAnything/FAMv1